MDL-7925 - it happened again. Stupid bloodly forms lib. I have no idea what it was playing at. Merged from MOODLE_18_STABLE.
This commit is contained in:
@@ -24,6 +24,13 @@ class description_qtype extends default_questiontype {
|
||||
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;
|
||||
|
||||
@@ -43,6 +43,17 @@ function xmldb_qtype_multichoice_upgrade($oldversion=0) {
|
||||
$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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?PHP // $Id$
|
||||
|
||||
$plugin->version = 2007041300;
|
||||
$plugin->version = 2007072000;
|
||||
$plugin->requires = 2006032200;
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user