stamp, and a default version of 1.
When questions are updated, the version number is incremented.
continue;
}
+ $question->stamp = make_unique_id_code(); // Set the unique code (not to be changed)
+ $question->version = 1; // Original version of this question
+
if (!$question->id = insert_record("quiz_questions", $question)) {
error("Could not insert new question!");
}
echo "<hr><p><b>$count</b>. ".stripslashes($question->questiontext)."</p>";
$question->category = $this->category->id;
+ $question->stamp = make_unique_id_code(); // Set the unique code (not to be changed)
+ $question->version = 1; // Original version of this question
if (!$question->id = insert_record("quiz_questions", $question)) {
error("Could not insert new question!");
} else {
if (!empty($question->id)) { // Question already exists
+ $question->version ++; // Update version number of question
if (!update_record("quiz_questions", $question)) {
error("Could not update question!");
}
} else { // Question is a new one
+ $question->stamp = make_unique_id_code(); // Set the unique code (not to be changed)
+ $question->version = 1;
if (!$question->id = insert_record("quiz_questions", $question)) {
error("Could not insert new question!");
}