]> git.mjollnir.org Git - moodle.git/commitdiff
New quiz option - "Each attempt builds on the last"
authorkaipe <kaipe>
Sun, 3 Aug 2003 22:54:02 +0000 (22:54 +0000)
committerkaipe <kaipe>
Sun, 3 Aug 2003 22:54:02 +0000 (22:54 +0000)
This makes it possible for students to take a tedious quiz, save it half-way and have it graded. The student can then, at a later point, get back to the quiz and have the previous answers already filled in and graded. The student can then continue with the remaining questions as well as redo all the answers that got wrong at the previous attempt.
It seems to work fine with one little twisted exception:
Say that the student attempts the quiz first and that the teacher thereafter edits the quiz and removes or adds a few questions. This will work out fine for as long as the teacher do not get the idea of adding a question with question type RANDOM. The quiz will be fully functional again after removing that RANDOM question or resetting the option 'Each attempt builds on the last" to NO.
Not a very serious problem but it takes someone with greater insight in question type RANDOM to resolve it.

As always, I can not commit lang/en/quiz.php.

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

index 1b90cf4de68ff1cdd9e43049309b391aaa84b5c1..f8f7a974e245092064add6dca3c685c2db3ffe6d 100644 (file)
@@ -122,6 +122,10 @@ function quiz_upgrade($oldversion) {
                               ) TYPE=MyISAM COMMENT='Options for multianswer questions'; ");
     }
 
+    if ($oldversion < 2003080301) {
+        execute_sql(" ALTER TABLE {$CFG->prefix}quiz ADD eachattemptbuildsonthelast TINYINT(4) DEFAULT '0' NOT NULL AFTER `attempts` ");
+    }
+
     return true;
 }
 
index 4ebbb36e56104f98c2d6fd572f1cb3d0b726b4fa..ea0b347d171dcf343d4fcd58c73175bebddef1d7 100644 (file)
@@ -21,6 +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',
   `feedback` tinyint(4) NOT NULL default '0',
   `correctanswers` tinyint(4) NOT NULL default '1',
   `grademethod` tinyint(4) NOT NULL default '1',