<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"/>
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');
}
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;
}
// 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)?