-
Bug
-
Resolution: Fixed
-
Major
-
None
-
1.9.11
-
None
-
MOODLE_19_STABLE
When you enter (as a student) the hotpot quiz to take it, it counts all records in prefix_hotpot_attempts and compares that number against the allowed attempt count. If it is more then the allowed count then it won't let you in.
The problem is that prefix_hotpot_attempts can record multiple entries for one attempt (it appears to be one per page view).
In mod/hotpot/index.php the attempt count is gained by selecting COUNT(DISTINCT clickreportid).
So on line 64 of mod/hotpot/view.php, I changed the line from:
} else if ($hotpot->attempts && $hotpot->attempts <= count_records('hotpot_attempts', 'hotpot', $hotpot->id, 'userid', $USER->id)) {
to:
} else if ($hotpot->attempts && $hotpot->attempts <= count_records_select('hotpot_attempts', 'hotpot='.$hotpot->id.' AND userid='.$USER->id, 'COUNT(DISTINCT clickreportid)')) {
This basically changes it so that attempts are counted the same way in both places.
Questions, comments?
-eric