Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-29493 questions should be createable with defaultmark a float.
  • Loading branch information
timhunt committed Sep 23, 2011
1 parent dab8148 commit 7664182
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions question/previewlib.php
Expand Up @@ -54,14 +54,14 @@ public function definition() {

$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);
Expand Down
2 changes: 1 addition & 1 deletion question/type/edit_question_form.php
Expand Up @@ -152,7 +152,7 @@ protected function definition() {

$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');

Expand Down

0 comments on commit 7664182

Please sign in to comment.