|
|
| Participants: |
Eric Merrill and Gordon Bateson
|
| Security Level: |
None
|
| Resolved date: |
07/Feb/08
|
| Affected Branches: |
MOODLE_19_STABLE
|
| Fixed Branches: |
MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, 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
|
|
Description
|
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
|
Show » |
|