]> git.mjollnir.org Git - moodle.git/commitdiff
Changed "eachattemptbuildsonthelast" column name to
authorstronk7 <stronk7>
Mon, 4 Aug 2003 10:31:12 +0000 (10:31 +0000)
committerstronk7 <stronk7>
Mon, 4 Aug 2003 10:31:12 +0000 (10:31 +0000)
"attemptonlast". Seems to work.

mod/quiz/attempt.php
mod/quiz/db/mysql.php
mod/quiz/db/mysql.sql
mod/quiz/mod.html

index f75903dd488d7239db10570ed3b976d8965b034b..2f882388517c9c820212a2a7468b69a1b4e62b95 100644 (file)
 
     $result = NULL;     // Default
     $questions = NULL;  // Default
-    if ($quiz->eachattemptbuildsonthelast) {
+    if ($quiz->attemptonlast) {
         $latestfinishedattempt->attempt = 0;
         foreach ($attempts as $attempt) {
             if ($attempt->timefinish
index f8f7a974e245092064add6dca3c685c2db3ffe6d..1bb4cb0fb0260adc7dce8d3ae571367174f90105 100644 (file)
@@ -126,6 +126,10 @@ function quiz_upgrade($oldversion) {
         execute_sql(" ALTER TABLE {$CFG->prefix}quiz ADD eachattemptbuildsonthelast TINYINT(4) DEFAULT '0' NOT NULL AFTER `attempts` ");
     }
 
+    if ($oldversion < 2003080400) {
+        table_column("quiz", "eachattemptbuildsonthelast", "attemptonlast", "TINYINT", "4", "UNSIGNED", "0", "NOT NULL", "");
+    }
+
     return true;
 }
 
index ea0b347d171dcf343d4fcd58c73175bebddef1d7..b3482a8b8050102c401cce59a7b0d0733aa2ab1b 100644 (file)
@@ -21,7 +21,7 @@ CREATE TABLE `prefix_quiz` (
   `timeopen` int(10) unsigned NOT NULL default '0',
   `timeclose` int(10) unsigned NOT NULL default '0',
   `attempts` smallint(6) NOT NULL default '0',
-  `eachattemptbuildsonthelast` tinyint(4) NOT NULL default '0',
+  `attemptonlast` tinyint(4) NOT NULL default '0',
   `feedback` tinyint(4) NOT NULL default '0',
   `correctanswers` tinyint(4) NOT NULL default '1',
   `grademethod` tinyint(4) NOT NULL default '1',
index ac895a2a27c5eef7402b0cfeb153b0b1800f9384..6d638473cca4433740b2f3842989f04d5be7d3e4 100644 (file)
@@ -19,8 +19,8 @@
     if (!isset($form->attempts)) {
         $form->attempts = 0;
     }
-    if (!isset($form->eachattemptbuildsonthelast)) {
-        $form->eachattemptbuildsonthelast = 0;
+    if (!isset($form->attemptonlast)) {
+        $form->attemptonlast = 0;
     }
     if (!isset($form->grademethod)) {
         $form->grademethod = "";
         $options = array();
         $options[0] = get_string("no");
         $options[1] = get_string("yes");
-        choose_from_menu($options, "eachattemptbuildsonthelast",
-                         "$form->eachattemptbuildsonthelast", "");
+        choose_from_menu($options, "attemptonlast",
+                         "$form->attemptonlast", "");
         helpbutton("eachattemptbuildsonthelast",
                    get_string("eachattemptbuildsonthelast", "quiz"),
                    "quiz");