return false;
}
+ function save_question($question, $form, $course) {
+ // Make very sure that descriptions can'e be created with a grade of
+ // anything other than 0.
+ $form->defaultgrade = 0;
+ return parent::save_question($question, $form, $course);
+ }
+
function get_question_options(&$question) {
// No options to be restored for this question type
return true;
$result = $result && add_field($table, $field);
}
+ // This upgrade actually belongs to the description question type,
+ // but that does not have a DB upgrade script. Therefore, multichoice
+ // is doing it.
+ // The need for this is that for a while, descriptions were being created
+ // with a defaultgrade of 1, when it shoud be 0. We need to reset them all to 0.
+ // This is re-occurrence of MDL-7925, so we need to do it again.
+ if ($result && $oldversion < 2007072000) {
+ $result = set_field('question', 'defaultgrade', 0,
+ 'qtype', DESCRIPTION, 'defaultgrade', 1);
+ }
+
return $result;
}