Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-22046

When Attempts grading is set to "Last Attempt", an incomplete exam causes a user's grade to show as zero on some pages.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.9.9
    • 1.9.5
    • SCORM
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      With Attempts grading set to Last Attempt, if a user has an incomplete exam, the assessments report page shows that user as having a grade of '0'.

      It's questionable if this is really a "bug", but it was not what our users expected or wanted.

      The fix was to add a function "scorm_get_last_completed_attempt" to mod/scorm/locallib.php, nearly identical to "scorm_get_last_attempt":

      function scorm_get_last_completed_attempt($scormid, $userid) {
      /// Find the last completed attempt number for the given user id and scorm id
      if ($lastattempt = get_record('scorm_scoes_track', 'userid', $userid, 'scormid', $scormid, 'value', 'completed', 'max(attempt) as a')) {
      if (empty($lastattempt->a))

      { return '1'; }

      else

      { return $lastattempt->a; }

      }
      }

      and to change the call to "scorm_get_last_attempt" in the LASTATTEMPT block in the switch statement in scorm_grade_user, to "scorm_get_last_completed_attempt".

            danmarsden Dan Marsden
            bcota@unicon.net Bruce Cota (Inactive)
            Nobody Nobody (Inactive)
            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.