mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
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:
parent
591212f69d
commit
d115d8c736
18 changed files with 70 additions and 46 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue