diff --git a/lib/questionlib.php b/lib/questionlib.php index a465c7debec..e0b3014af54 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -796,7 +796,7 @@ function question_preview_url($questionid, $preferredbehaviour = null, } if (!is_null($maxmark)) { - $params['maxmark'] = $maxmark; + $params['maxmark'] = format_float($maxmark, strlen($maxmark), true, true); } if (!is_null($displayoptions)) { diff --git a/question/previewlib.php b/question/previewlib.php index 588e435a4ca..6c11625e391 100644 --- a/question/previewlib.php +++ b/question/previewlib.php @@ -52,9 +52,8 @@ class preview_options_form extends moodleform { get_string('howquestionsbehave', 'question'), $behaviours); $mform->addHelpButton('behaviour', 'howquestionsbehave', 'question'); - $mform->addElement('text', 'maxmark', get_string('markedoutof', 'question'), + $mform->addElement('float', 'maxmark', get_string('markedoutof', 'question'), array('size' => '5')); - $mform->setType('maxmark', PARAM_FLOAT); if ($this->_customdata['maxvariant'] > 1) { $variants = range(1, $this->_customdata['maxvariant']); @@ -152,7 +151,7 @@ class question_preview_options extends question_display_options { protected function get_field_types() { return array( 'behaviour' => PARAM_ALPHA, - 'maxmark' => PARAM_FLOAT, + 'maxmark' => PARAM_LOCALISEDFLOAT, 'variant' => PARAM_INT, 'correctness' => PARAM_BOOL, 'marks' => PARAM_INT,