I have introduced the new field $attempt->uniqueid, see http://mantis.york.ac.uk/moodle/mod/forum/discuss.php?d=852#3380

This commit is contained in:
gustav_delius 2005-07-02 18:14:51 +00:00
parent 591212f69d
commit d115d8c736
18 changed files with 70 additions and 46 deletions

View file

@ -173,8 +173,8 @@
delete_records('quiz_grades', 'quiz', $quiz->id, 'userid', $USER->id);
foreach ($oldattempts as $oldattempt) {
// there should only be one but we loop just in case
delete_records('quiz_states', 'attempt', $oldattempt->id);
delete_records('quiz_newest_states', 'attemptid', $oldattempt->id);
delete_records('quiz_states', 'attempt', $oldattempt->uniqueid);
delete_records('quiz_newest_states', 'attemptid', $oldattempt->uniqueid);
}
}
}
@ -312,7 +312,7 @@
// Find all the questions for this attempt for which the newest
// state is not also the newest graded state
if ($closequestions = get_records_select('quiz_newest_states',
"attemptid = $attempt->id AND newest != newgraded", '', 'questionid, questionid')) {
"attemptid = $attempt->uniqueid AND newest != newgraded", '', 'questionid, questionid')) {
// load all the questions
$closequestionlist = implode(',', array_keys($closequestions));