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

Grade calculation not correct

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: SCORM
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      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

            • Assignee:
              piers Piers Harding
              Reporter:
              danmarsden Dan Marsden
              Tester:
              Dan Marsden
              Participants:
              Component watchers:
              Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10