]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13328 correct the counting of attempts when clickreporting has been enabled
authorgbateson <gbateson>
Thu, 7 Feb 2008 04:17:55 +0000 (04:17 +0000)
committergbateson <gbateson>
Thu, 7 Feb 2008 04:17:55 +0000 (04:17 +0000)
mod/hotpot/view.php

index 84dd4f124cbbe765817720f620214be9e88266b6..c04afd7d933541dd84cb6b153ec8fe2882cfc72c 100644 (file)
@@ -61,7 +61,7 @@
         } else if ($hotpot->subnet && !address_in_subnet($_SERVER['REMOTE_ADDR'], $hotpot->subnet)) {
             $error = get_string("subneterror", "quiz");
         // check number of attempts
-        } else if ($hotpot->attempts && $hotpot->attempts <= count_records('hotpot_attempts', 'hotpot', $hotpot->id, 'userid', $USER->id)) {
+        } else if ($hotpot->attempts && $hotpot->attempts <= count_records_select('hotpot_attempts', 'hotpot='.$hotpot->id.' AND userid='.$USER->id, 'COUNT(DISTINCT clickreportid)')) { 
             $error = get_string("nomoreattempts", "quiz");
         // get password
         } else if ($hotpot->password && empty($hppassword)) {