quiz MDL-24727 column missed from install.xml

This commit is contained in:
Tim Hunt
2010-10-20 10:14:19 +00:00
parent a63f4129ee
commit 9bb6663e04
3 changed files with 21 additions and 5 deletions
+2 -1
View File
@@ -35,7 +35,8 @@
<FIELD NAME="popup" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Force the quiz to be attempted in a full-screen pop-up window with some evil JavaScript that attempts to prevent copying and pasting, etc." PREVIOUS="subnet" NEXT="delay1"/>
<FIELD NAME="delay1" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Enforced delay between the first and second attempts, in seconds." PREVIOUS="popup" NEXT="delay2"/>
<FIELD NAME="delay2" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Enforced delay between the second and subsequent attempts, in seconds." PREVIOUS="delay1" NEXT="showuserpicture"/>
<FIELD NAME="showuserpicture" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Option to show the user's picture during the attempt and on the review page." PREVIOUS="delay2"/>
<FIELD NAME="showuserpicture" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Option to show the user's picture during the attempt and on the review page." PREVIOUS="delay2" NEXT="showblocks"/>
<FIELD NAME="showblocks" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Whether blocks should be shown on the attempt.php and review.php pages." PREVIOUS="showuserpicture"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
+18 -3
View File
@@ -328,16 +328,16 @@ function xmldb_quiz_upgrade($oldversion) {
if ($oldversion < 2010051800) {
/// Define field showblocks to be added to quiz
// Define field showblocks to be added to quiz
$table = new xmldb_table('quiz');
$field = new xmldb_field('showblocks', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'showuserpicture');
/// Conditionally launch add field showblocks
// Conditionally launch add field showblocks
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
/// quiz savepoint reached
// quiz savepoint reached
upgrade_mod_savepoint(true, 2010051800, 'quiz');
}
@@ -356,6 +356,21 @@ function xmldb_quiz_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2010080600, 'quiz');
}
if ($oldversion < 2010102000) {
// Define field showblocks to be added to quiz
// Repeat this step, because the column was missing from install.xml for a time.
$table = new xmldb_table('quiz');
$field = new xmldb_field('showblocks', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'showuserpicture');
// Conditionally launch add field showblocks
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// quiz savepoint reached
upgrade_mod_savepoint(true, 2010102000, 'quiz');
}
return true;
}
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2010080600; // The (date) version of this module
$module->version = 2010102000; // The (date) version of this module
$module->requires = 2010080300; // Requires this Moodle version
$module->cron = 0; // How often should cron check this module (seconds)?