table_column("quiz", "", "shuffleanswers", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL", "shufflequestions");
}
- if ($oldversion < 2003071000) {
+ if ($oldversion < 2003071001) {
modify_database ("", " CREATE TABLE `prefix_quiz_numerical` (
`id` int(10) unsigned NOT NULL auto_increment,
+ `question` int(10) unsigned NOT NULL default '0',
`answer` int(10) unsigned NOT NULL default '0',
`min` varchar(255) NOT NULL default '',
`max` varchar(255) NOT NULL default '',
CREATE TABLE `prefix_quiz_numerical` (
`id` int(10) unsigned NOT NULL auto_increment,
+ `question` int(10) unsigned NOT NULL default '0',
`answer` int(10) unsigned NOT NULL default '0',
`min` varchar(255) NOT NULL default '',
`max` varchar(255) NOT NULL default '',
);");
modify_database ("", "CREATE INDEX prefix_quiz_match_question_idx ON prefix_quiz_match (question);");
}
+ if ($oldversion < 2003071001) {
+ modify_database ("", " CREATE TABLE prefix_quiz_numerical (
+ id SERIAL PRIMARY KEY,
+ question integer NOT NULL default '0',
+ answer integer NOT NULL default '0',
+ min varchar(255) NOT NULL default '',
+ max varchar(255) NOT NULL default ''
+ ); ");
+ modify_database ("", "CREATE INDEX prefix_quiz_numerical_answer_idx ON prefix_quiz_numerical (answer);");
+ }
return true;
}
# --------------------------------------------------------
CREATE INDEX prefix_quiz_multichoice_question_idx ON prefix_quiz_multichoice (question);
+#
+# Table structure for table quiz_numerical
+#
+
+CREATE TABLE prefix_quiz_numerical (
+ id SERIAL PRIMARY KEY,
+ question integer NOT NULL default '0',
+ answer integer NOT NULL default '0',
+ min varchar(255) NOT NULL default '',
+ max varchar(255) NOT NULL default ''
+);
+# --------------------------------------------------------
+CREATE INDEX prefix_quiz_numerical_answer_idx ON prefix_quiz_numerical (answer);
+
#
# Table structure for table quiz_question_grades
#
}
} else { // completely new answer
unset($options);
- $options->min= $question->min[$key];
- $options->max= $question->max[$key];
- $options->answer= $answer->id;
+ $options->question = $question->id;
+ $options->answer = $answer->id;
+ $options->min = $question->min[$key];
+ $options->max = $question->max[$key];
if (!insert_record("quiz_numerical", $options)) {
$result->error = "Could not insert quiz numerical options!";
return $result;
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2003071000; // The (date) version of this module
+$module->version = 2003071001; // The (date) version of this module
$module->cron = 0; // How often should cron check this module (seconds)?
?>