Quiz time limit field: Store it in the DB as an int(10), like the other time-related columns. Also, include the unit (minutes) in the forum label.
This commit is contained in:
@@ -528,6 +528,7 @@ $string['timecompleted'] = 'Completed';
|
||||
$string['timedelay'] = 'You are not allowed to do the quiz since you have not passed the time delay before attempting another quiz';
|
||||
$string['timeleft'] = 'Time Remaining';
|
||||
$string['timelimit'] = 'Time limit';
|
||||
$string['timelimitmin'] = 'Time limit (minutes)';
|
||||
$string['timelimitexeeded'] = 'Sorry! Quiz time limit exceeded!';
|
||||
$string['timestr'] = '%%H:%%M:%%S on %%d/%%m/%%y';
|
||||
$string['timesup'] = 'Time is up!';
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
<FIELD NAME="grade" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sumgrades" NEXT="timecreated"/>
|
||||
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade" NEXT="timemodified"/>
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="timelimit"/>
|
||||
<FIELD NAME="timelimit" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="password"/>
|
||||
<FIELD NAME="timelimit" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="password"/>
|
||||
<FIELD NAME="password" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timelimit" NEXT="subnet"/>
|
||||
<FIELD NAME="subnet" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="password" NEXT="popup"/>
|
||||
<FIELD NAME="popup" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="subnet" NEXT="delay1"/>
|
||||
|
||||
@@ -55,6 +55,17 @@ function xmldb_quiz_upgrade($oldversion=0) {
|
||||
$db->debug = true;
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2007070200) {
|
||||
|
||||
/// Changing precision of field timelimit on table quiz to (10)
|
||||
$table = new XMLDBTable('quiz');
|
||||
$field = new XMLDBField('timelimit');
|
||||
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'timemodified');
|
||||
|
||||
/// Launch change of precision for field timelimit
|
||||
$result = $result && change_field_precision($table, $field);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class mod_quiz_mod_form extends moodleform_mod {
|
||||
$timelimitgrp=array();
|
||||
$timelimitgrp[] = &$mform->createElement('text', 'timelimit');
|
||||
$timelimitgrp[] = &$mform->createElement('checkbox', 'timelimitenable', '', get_string('enable'));
|
||||
$mform->addGroup($timelimitgrp, 'timelimitgrp', get_string("timelimit", "quiz"), array(' '), false);
|
||||
$mform->addGroup($timelimitgrp, 'timelimitgrp', get_string('timelimitmin', 'quiz'), array(' '), false);
|
||||
$mform->setType('timelimit', PARAM_TEXT);
|
||||
$timelimitgrprules = array();
|
||||
$timelimitgrprules['timelimit'][] = array(null, 'numeric', null, 'client');
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2007062600; // The (date) version of this module
|
||||
$module->version = 2007070200; // The (date) version of this module
|
||||
$module->requires = 2007062401; // Requires this Moodle version
|
||||
$module->cron = 0; // How often should cron check this module (seconds)?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user