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

SCORM 2004 attempts not incremented

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.2.6, 3.3.3
    • 2.9.3, 3.0, 3.0.1, 3.2.5, 3.3.2
    • SCORM
    • MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MDL-52653-master
    • Hide
      1. add a SCORM 2004 package to a course (for example, https://scorm.com/wp-content/assets/golf_examples/PIFS/RuntimeBasicCalls_SCORM20043rdEdition.zip)
      2. as a student, open the activity and complete it. In the golf example, you need to click the "Next button" until you get to the last page, and then "Submit answers".
      3. Go back to the course view, and open the activity again.
      4. Click "Start a new attempt", and then "Enter".
      5. Exit the activity and then open it again. The summary should show "Number of attempts you have made: 2".
      Show
      add a SCORM 2004 package to a course (for example, https://scorm.com/wp-content/assets/golf_examples/PIFS/RuntimeBasicCalls_SCORM20043rdEdition.zip ) as a student, open the activity and complete it. In the golf example, you need to click the "Next button" until you get to the last page, and then "Submit answers". Go back to the course view, and open the activity again. Click "Start a new attempt", and then "Enter". Exit the activity and then open it again. The summary should show "Number of attempts you have made: 2".

      The number of attempts for a SCORM 2004 activity is never incremented. This is due to a bug in the function scorm_check_mode (/mod/scorm/lib.php).
      the line

      $tracks = $DB->get_recordset('scorm_scoes_track', array('scormid' => $scorm->id, 'userid' => $userid, 'attempt' => $attempt, 'element' => 'cmi.core.lesson_status')) 
      

      will never give a result for a SCORM 2004 since "cmi.core.lesson_status" is for SCORM 1.2 api only.

      Proposal :
      add a line before and change this line :

      $element = (scorm_version_check($scorm->version, SCORM_13)) ? 'cmi.completion_status' : 'cmi.core.lesson_status';
      $tracks = $DB->get_recordset('scorm_scoes_track', array('scormid' => $scorm->id, 'userid' => $userid, 'attempt' => $attempt, 'element' => $element));
      

      Worked for me.

      Jean-Sébastien Rousseau-Piot
      Belgium

            Lawson-Perfect Christian Lawson-Perfect
            jeanseb Jean-Sébastien Rousseau-Piot
            Ankit Agarwal Ankit Agarwal
            Damyon Wiese Damyon Wiese
            David Monllaó David Monllaó
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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