mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-53140 question: Support localised floats when previewing a question
This commit is contained in:
parent
bb4079498f
commit
197e074eba
@ -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)) {
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user