From d6478d4f820c56b6be34fc8f8989b18d471bc0f7 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Mon, 4 Aug 2003 10:31:12 +0000 Subject: [PATCH] Changed "eachattemptbuildsonthelast" column name to "attemptonlast". Seems to work. --- mod/quiz/attempt.php | 2 +- mod/quiz/db/mysql.php | 4 ++++ mod/quiz/db/mysql.sql | 2 +- mod/quiz/mod.html | 8 ++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index f75903dd48..2f88238851 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -193,7 +193,7 @@ $result = NULL; // Default $questions = NULL; // Default - if ($quiz->eachattemptbuildsonthelast) { + if ($quiz->attemptonlast) { $latestfinishedattempt->attempt = 0; foreach ($attempts as $attempt) { if ($attempt->timefinish diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php index f8f7a974e2..1bb4cb0fb0 100644 --- a/mod/quiz/db/mysql.php +++ b/mod/quiz/db/mysql.php @@ -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; } diff --git a/mod/quiz/db/mysql.sql b/mod/quiz/db/mysql.sql index ea0b347d17..b3482a8b80 100644 --- a/mod/quiz/db/mysql.sql +++ b/mod/quiz/db/mysql.sql @@ -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', diff --git a/mod/quiz/mod.html b/mod/quiz/mod.html index ac895a2a27..6d638473cc 100644 --- a/mod/quiz/mod.html +++ b/mod/quiz/mod.html @@ -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 = ""; @@ -140,8 +140,8 @@ $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"); -- 2.39.5