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

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.5
    • 1.9.9
    • SCORM
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

    Description

      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".

      Attachments

        Activity

          People

            danmarsden Dan Marsden
            bcota@unicon.net Bruce Cota
            Nobody Nobody
            Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8/Jun/10