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

SCORM 2004 attempts not incremented

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.3, 3.0, 3.0.1, 3.2.5, 3.3.2
    • Fix Version/s: 3.2.6, 3.3.3
    • Component/s: SCORM
    • Testing Instructions:
      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".
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-52653-master

      Description

      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

        Attachments

          Activity

            People

            Assignee:
            Lawson-Perfect Christian Lawson-Perfect
            Reporter:
            jeanseb Jean-Sébastien Rousseau-Piot
            Peer reviewer:
            Ankit Agarwal
            Integrator:
            Damyon Wiese
            Tester:
            David Monllaó
            Participants:
            Component watchers:
            Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Nov/17