MDL-29493 questions should be createable with defaultmark a float.

This commit is contained in:
Tim Hunt
2011-09-23 12:52:39 +01:00
parent 136fa79e34
commit 51fd4dd261
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -54,14 +54,14 @@ class preview_options_form extends moodleform {
$mform->addElement('text', 'maxmark', get_string('markedoutof', 'question'),
array('size' => '5'));
$mform->setType('maxmark', PARAM_NUMBER);
$mform->setType('maxmark', PARAM_FLOAT);
if ($this->_customdata['maxvariant'] > 1) {
$variants = range(1, $this->_customdata['maxvariant']);
$mform->addElement('select', 'variant', get_string('questionvariant', 'question'),
array_combine($variants, $variants));
}
$mform->setType('maxmark', PARAM_INT);
$mform->setType('variant', PARAM_INT);
$mform->addElement('select', 'correctness', get_string('whethercorrect', 'question'),
$hiddenofvisible);
+1 -1
View File
@@ -152,7 +152,7 @@ abstract class question_edit_form extends moodleform {
$mform->addElement('text', 'defaultmark', get_string('defaultmark', 'question'),
array('size' => 3));
$mform->setType('defaultmark', PARAM_INT);
$mform->setType('defaultmark', PARAM_FLOAT);
$mform->setDefault('defaultmark', 1);
$mform->addRule('defaultmark', null, 'required', null, 'client');