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

Grade calculation not correct

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.0
    • SCORM
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      as part of the changes for MDL-11501 the new function "scorm_get_attempt_status" was added, however it's calculation of grades/attempts isn't quite right -

      this call:
      $attempts = $DB->get_records_select('scorm_scoes_track',"element='cmi.core.score.raw' AND userid=? AND scormid=?", array($user->id, $scorm->id),'attempt','attempt AS attemptnumber, value AS grade');

      gets this error:
      Did you remember to make the first column something unique in your call to get_records? Duplicate value '1' found in column 'attemptnumber'.

      because each SCO within a SCORM returns a value - this wouldn't be a problem if "grade" from the above sql wasn't used later in the function:
      $result .= get_string('gradeforattempt', 'scorm').' ' . $attempt->attemptnumber . ': ' . $attempt->grade .'%<BR>';

      Attachments

        Activity

          People

            piers Piers Harding
            danmarsden Dan Marsden
            Dan Marsden Dan Marsden
            Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10