mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Update old quiz logs
This commit is contained in:
parent
b44b3a9f29
commit
af7d68413f
@ -181,6 +181,17 @@ function quiz_upgrade($oldversion) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($oldversion < 2004020500) {
|
||||
if ($quizzes = get_records("quiz")) {
|
||||
foreach ($quizzes as $quiz) {
|
||||
if ($cm = get_coursemodule_from_instance("quiz", $quiz->id, $quiz->course)) {
|
||||
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
|
||||
WHERE module = 'quiz' AND url = 'view.php?id=$cm->id'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -136,6 +136,17 @@ function quiz_upgrade($oldversion) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($oldversion < 2004020500) {
|
||||
if ($quizzes = get_records("quiz")) {
|
||||
foreach ($quizzes as $quiz) {
|
||||
if ($cm = get_coursemodule_from_instance("quiz", $quiz->id, $quiz->course)) {
|
||||
execute_sql("UPDATE {$CFG->prefix}log SET cmid = '$cm->id'
|
||||
WHERE module = 'quiz' AND url = 'view.php?id=$cm->id'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2004013101; // The (date) version of this module
|
||||
$module->requires = 2004013101; // Requires this Moodle version
|
||||
$module->version = 2004020500; // The (date) version of this module
|
||||
$module->requires = 2004013101; // Requires this Moodle version
|
||||
$module->cron = 0; // How often should cron check this module (seconds)?
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user