Moodle
  1. Moodle
  2. MDL-29646

Track Details for multiple SCOs failed

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.2
    • Fix Version/s: 2.1.3
    • Component/s: SCORM
    • Labels:
      None
    • Database:
      Any
    • Testing Instructions:
      Hide
      • Deploy the Scorm package from http://moodle.org/mod/data/view.php?d=50&rid=4083&filter=1
      • Browse scorm to submit a few attempts
      • Goto the report page of the scorm
      • Make sure Track details is set to yes
      • Click on the link of various track reports and make sure they all display data of their respective Sco.
      • Click on the Attempt number link (1,2, etc) in the report page. Click and test track details link on the resulting page.
      • Browse around the report with various options and make sure there is no regressions
      Show
      Deploy the Scorm package from http://moodle.org/mod/data/view.php?d=50&rid=4083&filter=1 Browse scorm to submit a few attempts Goto the report page of the scorm Make sure Track details is set to yes Click on the link of various track reports and make sure they all display data of their respective Sco. Click on the Attempt number link (1,2, etc) in the report page. Click and test track details link on the resulting page. Browse around the report with various options and make sure there is no regressions
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull Master Branch:
      MDL-29646-master
    • Rank:
      19157

      Description

      When we try to consult the report detail of a Sco from the scorm user report page (mod/scorm/userreport.php), for a scorm package with multiple Scos, only the details for the last sco of the package is viewable.
      Indeed, whatever the sco details link we clicked, it's always the last sco which is displayed.

        Issue Links

          Activity

          Hide
          Dan Marsden added a comment -

          comment from Matt Powel in forums with suggested fix: - thanks Matt:
          ----------------------------------------------------------

          Not sure how helpful this is to you but i have just corrected this bug on my local copy.

          The issue was that $sco var is created initially based on the scoid passed as $b but is then overwritten by the line 122: foreach ($scoes as $sco).

          By giving the initial $sco declaration a different name e.g. $selsco = $DB->get_record('scorm_scoes', array('id'=>$b), '*', MUST_EXIST);

          then changing all references elsewhere i now have this working.

          Also whilst in there i spotted that the scores are not displayed correctly and changing line line 214 from

          s($trackdata->$element);

          to

          $row[] = s($trackdata->$element);

          corrected that issue.

          Show
          Dan Marsden added a comment - comment from Matt Powel in forums with suggested fix: - thanks Matt: ---------------------------------------------------------- Not sure how helpful this is to you but i have just corrected this bug on my local copy. The issue was that $sco var is created initially based on the scoid passed as $b but is then overwritten by the line 122: foreach ($scoes as $sco). By giving the initial $sco declaration a different name e.g. $selsco = $DB->get_record('scorm_scoes', array('id'=>$b), '*', MUST_EXIST); then changing all references elsewhere i now have this working. Also whilst in there i spotted that the scores are not displayed correctly and changing line line 214 from s($trackdata->$element); to $row[] = s($trackdata->$element); corrected that issue.
          Hide
          Ankit Agarwal added a comment -

          Hi Dan,
          Yes thats exactly what is happening, the $sco variable was getting overwritten in the for loop and was pointing to the last sco, before generating the track details.

          $sco = $DB->get_record('scorm_scoes', array('id'=>$b), '*', MUST_EXIST);
          ...
          ...
          foreach ($scoes as $sco)
          ...
          ...
          if ($trackdata = scorm_get_tracks($sco->id, $user, $attempt)) {
          

          Thanks

          Show
          Ankit Agarwal added a comment - Hi Dan, Yes thats exactly what is happening, the $sco variable was getting overwritten in the for loop and was pointing to the last sco, before generating the track details. $sco = $DB->get_record('scorm_scoes', array('id'=>$b), '*', MUST_EXIST); ... ... foreach ($scoes as $sco) ... ... if ($trackdata = scorm_get_tracks($sco->id, $user, $attempt)) { Thanks
          Hide
          Dan Marsden added a comment -

          looks good to me - thanks Ankit!

          Show
          Dan Marsden added a comment - looks good to me - thanks Ankit!
          Hide
          Ankit Agarwal added a comment -

          Thanks Dan! Up for integration!

          Show
          Ankit Agarwal added a comment - Thanks Dan! Up for integration!
          Hide
          Aparup Banerjee added a comment -

          cool, this has been integrated.

          Show
          Aparup Banerjee added a comment - cool, this has been integrated.
          Hide
          Rossiani Wijaya added a comment -

          This is working great.

          Test passed.

          Show
          Rossiani Wijaya added a comment - This is working great. Test passed.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Done, your delicious hacks have been sent upstream, many thanks!

          Closing as fixed, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Done, your delicious hacks have been sent upstream, many thanks! Closing as fixed, ciao

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: