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

Scorm in Moodle 2.4 cannot be reviewed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.4, 2.4.1
    • SCORM
    • None
    • MOODLE_24_STABLE

      Scorm in Moodle 2.4 has an error when review a lesson.

      Reproduction steps:

      • Attempting a Scorm lesson the first time, everything goes well.
      • Enter that lesson again with Start new attempt checked => fine
        However, enter that lesson again with Start new attempt unchecked => error

      The problem is in the player.php file, scorm_get_toc is expected to always return a sco object:

      $result = scorm_get_toc($USER, $scorm, $cm->id, TOCJSLINK, $currentorg, $scoid, $mode, $attempt, true, true);
      $sco = $result->sco;
      ...
          if ($trackdata = scorm_get_tracks($sco->id, $USER->id, $attempt)) {
      
      

      However, the scorm_get_toc function return either a sco object or an array of sco objects:

          if (empty($scoid)) {
              $result->sco = $scoes['scoes'][0]->children;
          } else {
              $result->sco = scorm_get_sco($scoid);
          }
      

      Therefore, when reviewing, the array of scos is returned and it cannot select any sco to display. Placing an if like below seems to work but I'm not sure it works in every case, since I'm not familiar with the scorm specification.

      $result = scorm_get_toc($USER, $scorm, $cm->id, TOCJSLINK, $currentorg, $scoid, $mode, $attempt, true, true);
      if (is_array($result->sco)) {
          $sco = $result->sco[0];
      } else {
          $sco = $result->sco;
      }
      ...
          if ($trackdata = scorm_get_tracks($sco->id, $USER->id, $attempt)) {...
      
      

            danmarsden Dan Marsden
            lnthanhtri Tri Le
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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