$cat->info = $form['newinfo'];
$cat->publish = $form['newpublish'];
$cat->course = $course->id;
+ $cat->stamp = make_unique_id_code();
if (!insert_record("quiz_categories", $cat)) {
error("Could not insert the new quiz category '$val'");
} else {
}
}
+ if ($oldversion < 2003082700) {
+ table_column("quiz_categories", "", "stamp", "varchar", "255", "", "", "not null");
+ if ($categories = get_records("quiz_categories")) {
+ foreach ($categories as $category) {
+ $stamp = make_unique_id_code();
+ if (!set_field("quiz_categories", "stamp", $stamp, "id", $category->id)) {
+ notify("Error while adding stamp to category id = $category->id");
+ }
+ }
+ }
+ }
+
return true;
}
`name` varchar(255) NOT NULL default '',
`info` text NOT NULL,
`publish` tinyint(4) NOT NULL default '0',
+ `stamp` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Categories are for grouping questions';
# --------------------------------------------------------
}
}
+ if ($oldversion < 2003082700) {
+ table_column("quiz_categories", "", "stamp", "varchar", "255", "", "", "not null");
+ if ($categories = get_records("quiz_categories")) {
+ foreach ($categories as $category) {
+ $stamp = make_unique_id_code();
+ if (!set_field("quiz_categories", "stamp", $stamp, "id", $category->id)) {
+ notify("Error while adding stamp to category id = $category->id");
+ }
+ }
+ }
+ }
+
return true;
}
name varchar(255) NOT NULL default '',
info text NOT NULL default '',
publish integer NOT NULL default '0'
+ stamp varchar(255) NOT NULL default '',
);
# --------------------------------------------------------
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2003082301; // The (date) version of this module
+$module->version = 2003082700; // The (date) version of this module
$module->cron = 0; // How often should cron check this module (seconds)?
?>