Upgrade all attempts at a quiz to the Moodle 1.5 model on attempts.php and report.php

This commit is contained in:
gustav_delius
2005-05-23 20:52:55 +00:00
parent 1775f57d24
commit b3ccc054e7
2 changed files with 20 additions and 0 deletions
+10
View File
@@ -45,6 +45,16 @@
redirect('edit.php?quizid='.$quiz->id);
}
// Upgrade any attempts that have not yet been upgraded to the
// Moodle 1.5 model (they will not yet have the timestamp set)
if ($attempts = get_records_sql("SELECT a.*".
" FROM {$CFG->prefix}quiz_attempts a, {$CFG->prefix}quiz_states s".
" WHERE a.quiz = '$quiz->id' AND s.attempt = a.id AND s.timestamp = 0")) {
foreach ($attempts as $attempt) {
quiz_upgrade_states($attempt);
}
}
add_to_log($course->id, "quiz", "attempts", "attempts.php?id=$cm->id", "$quiz->id", "$cm->id");
/// Define some strings
+10
View File
@@ -46,6 +46,16 @@
redirect('edit.php?quizid='.$quiz->id);
}
// Upgrade any attempts that have not yet been upgraded to the
// Moodle 1.5 model (they will not yet have the timestamp set)
if ($attempts = get_records_sql("SELECT a.*".
" FROM {$CFG->prefix}quiz_attempts a, {$CFG->prefix}quiz_states s".
" WHERE a.quiz = '$quiz->id' AND s.attempt = a.id AND s.timestamp = 0")) {
foreach ($attempts as $attempt) {
quiz_upgrade_states($attempt);
}
}
add_to_log($course->id, "quiz", "report", "report.php?id=$cm->id", "$quiz->id", "$cm->id");