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

Review / browse mode not passed correctly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.1
    • Fix Version/s: 2.4.7, 2.5.3
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide

      make sure SCORM debugger is enabled
      Add the attached SCORM file to your course.
      Enter the SCORM in normal mode as a student and make sure you answer both questions correctly.
      Finish/exit the SCORM
      Return to the SCORM again and enter it but make sure "start new attempt" checkbox is not ticked and normal mode is selected.
      Review mode text will show in header of player.
      In the SCORM debugger select cmi.core.lesson_status and hit the LMSGetValue Button
      a line like this should appear in the debugger:

      Thu, 12 Sep 2013 22:58:02 GMT: LMSGetValue("cmi.core.lesson_mode") - review => 0

      make sure that line states "Review" and not "normal" or "preview" and no Red errors occur in the debugger window.

      Show
      make sure SCORM debugger is enabled Add the attached SCORM file to your course. Enter the SCORM in normal mode as a student and make sure you answer both questions correctly. Finish/exit the SCORM Return to the SCORM again and enter it but make sure "start new attempt" checkbox is not ticked and normal mode is selected. Review mode text will show in header of player. In the SCORM debugger select cmi.core.lesson_status and hit the LMSGetValue Button a line like this should appear in the debugger: Thu, 12 Sep 2013 22:58:02 GMT: LMSGetValue("cmi.core.lesson_mode") - review => 0 make sure that line states "Review" and not "normal" or "preview" and no Red errors occur in the debugger window.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:
      master_MDL-37524

      Description

      In mod/scorm/player.php line #136, the $mode ('normal', 'review', or 'browse') is an argument to scorm_get_toc:

      $result = scorm_get_toc($USER, $scorm, $cm->id, TOCJSLINK, $currentorg, $scoid, $mode, $attempt, true, true);

      However, $mode isn't actualy set until nine lines later:
      if (($trackdata->status == 'completed') || ($trackdata->status == 'passed') || ($trackdata->status == 'failed'))

      { $mode = 'review'; }

      By the time $mode is set, the loadSCO.php URL has already been stashed in the toc title attribute by scorm_get_toc, so it's too late. The mode=review isn't passed to loadSCO.php and cmi.mode isn't set correctly.

      The attached patch re-calls scorm_get_toc if $mode=review nine lines later.

      Also in the patch are two other minor and self-explanatory fixes for places $mode isn't passed.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Nov/13