Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-3409

Hotpot incorrectly counts number of attempts when entering quiz

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • 1.9.11
    • Module: HotPot
    • 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

            xxxxxxx Gordon Bateson
            emerrill Eric Merrill
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.