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

Arguments to scorm_seq_termination reversed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.8.2
    • Fix Version/s: None
    • Component/s: SCORM
    • Labels:
    • Affected Branches:
      MOODLE_28_STABLE

      Description

      In mod/scorm/datamodels/scorm_13lib.php, it appears that the arguments to scorm_seq_termination() are reversed.

      The function is defined to take $seq, $userid, where $seq is an object:
      line 212 function scorm_seq_termination ($seq, $userid) {
      line 213 if (empty($seq->currentactivity)) {
      line 214 $seq->termination = false;

      It's called on line #26 with different arguments:
      line 26 $seq = scorm_seq_termination($scoid, $userid, $seq);

      This results in the predictable error:
      Attempt to assign property of non-object in on line 215

      Without spending hours trying to understand what exactly $seq (sequence?) is and how it is supposed to behave, I think the fix is to pass the arguments to scorm_seq_termination in the order that the function declaration expects them:
      $seq = scorm_seq_termination($seq, $userid);

      Does anyone who understands what that code is supposed to do have a comment on that?

        Attachments

          Activity

            People

            • Assignee:
              danmarsden Dan Marsden
              Reporter:
              raymor Ray Morris
              Participants:
              Component watchers:
              Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: