// database (backup_version) to determine whether upgrades should
// be performed (see db/backup_*.php)
-$backup_version = 2003082300; // The current version is a date (YYYYMMDDXX)
+$backup_version = 2003082301; // The current version is a date (YYYYMMDDXX)
-$backup_release = "0.8.9 alpha"; // User-friendly version number
+$backup_release = "0.8.10 alpha"; // User-friendly version number
fwrite ($bf,full_tag("IMAGE",6,false,$question->image));
fwrite ($bf,full_tag("DEFAULTGRADE",6,false,$question->defaultgrade));
fwrite ($bf,full_tag("QTYPE",6,false,$question->qtype));
+ fwrite ($bf,full_tag("STAMP",6,false,$question->stamp));
+ fwrite ($bf,full_tag("VERSION",6,false,$question->version));
//Now, depending of the qtype, call one function or other
if ($question->qtype == "1") {
$status = quiz_backup_shortanswer($bf,$preferences,$question->id);
$question->image = backup_todb($que_info['#']['IMAGE']['0']['#']);
$question->defaultgrade = backup_todb($que_info['#']['DEFAULTGRADE']['0']['#']);
$question->qtype = backup_todb($que_info['#']['QTYPE']['0']['#']);
+ $question->stamp = backup_todb($que_info['#']['STAMP']['0']['#']);
+ $question->version = backup_todb($que_info['#']['VERSION']['0']['#']);
//Check if the question exists
- //by category,questiontext and qtype
- //But do it only if the question type isn't RANDOM (4) or RANDOMSAMATCH (6), because this
- //types can have duplicates in the fields I'm searching !!
- //I think that some modifications should be done here !!
- //Detected by scott dot elliott at mchsi dot com in Bug 84
- if ($question->qtype != 4 and $question->qtype != 6) {
- $question_exists = get_record ("quiz_questions","category",$question->category,
- "questiontext",$question->questiontext,
- "qtype",$question->qtype);
- } else {
- $question_exists = false;
- }
+ //by category,stamp and version
+ $question_exists = get_record ("quiz_questions","category",$question->category,
+ "stamp",$question->stamp,
+ "version",$question->version);
//If the question exists, only record its id
if ($question_exists) {
$newid = $question_exists->id;