]> git.mjollnir.org Git - moodle.git/commitdiff
Quiz time limit field: Store it in the DB as an int(10), like the other time-related...
authortjhunt <tjhunt>
Mon, 2 Jul 2007 06:48:50 +0000 (06:48 +0000)
committertjhunt <tjhunt>
Mon, 2 Jul 2007 06:48:50 +0000 (06:48 +0000)
lang/en_utf8/quiz.php
mod/quiz/db/install.xml
mod/quiz/db/upgrade.php
mod/quiz/mod_form.php
mod/quiz/version.php

index 1de91fe5689346cf9a9275d12e68c6da042b5980..8cf4ff159105c8b4af6287b8445d2e6200a2ea07 100644 (file)
@@ -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!';
index f3e37aa0d8f249f3223e647166ec09db5f9259d8..84fdd257313e2fe745260cd8d79a29b18c1068f8 100755 (executable)
         <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"/>
index 5e2f04e2f8d571dee27685826a28fc1e972c6797..5a4eabf7304ca21d7e0620c62ed9fc8f5a05bee4 100644 (file)
@@ -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;
 }
 
index 4cb412b966d8e93feda1ca3a851caba11f54aca8..6b80a36aece8465c4314514dd9a02ff1fa33ddc8 100644 (file)
@@ -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');
index 40b6d1f6b32ba7d3a34ef847b0c6f3a7e478cfb2..d0f0a9c1319444bfb042dff896fef00a47f28e93 100644 (file)
@@ -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)?