MDL-7925 - description question types were being created with defaultgrade = 1. It should be zero, so fix the bug, and reset any wrong ones in the database. Merged from MOODLE_17_STABLE.

This commit is contained in:
tjhunt
2006-12-15 15:41:56 +00:00
parent 4e3ea0e0d9
commit 828df720a2
3 changed files with 14 additions and 9 deletions
@@ -1,5 +1,8 @@
<?php
$QTYPES[$question->qtype]->print_question_form_start($question, array(), $course, $usehtmleditor,
array('defaultgrade', 'penalty'));
?>
<input type="hidden" name="defaultgrade" value="0" />
<?php
$QTYPES[$question->qtype]->print_question_form_end($question);
?>
+10 -8
View File
@@ -23,14 +23,16 @@ function xmldb_qtype_multichoice_upgrade($oldversion=0) {
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
// 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.
// See MDL-7925.
if ($result && $oldversion < 2006121500) {
$result = set_field('question', 'defaultgrade', 0,
'qtype', DESCRIPTION, 'defaultgrade', 1);
}
return $result;
}
+1 -1
View File
@@ -1,6 +1,6 @@
<?PHP // $Id$
$plugin->version = 2006081900;
$plugin->version = 2006121500;
$plugin->requires = 2006032200;
?>