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

Activity Report (Outline) for users does not list completed SCORM activities with score=0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.4
    • Fix Version/s: 1.9.8
    • Component/s: SCORM
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      I noticed that when viewing the Activity Report (Outline), some completed SCORM activities were not displayed (no timestamp was given). I compared them with the Activity Report (Complete) and found that the listed SCORM activities had a score above 0, the missing ones a score of 0. I checked the code at mod/scorm/locallib.php and found the relevant lines at 477 to 486:

      if (!empty($userdata->score_raw)) {
      $attemptscore->values++;
      $attemptscore->sum += $userdata->score_raw;
      $attemptscore->max = ($userdata->score_raw > $attemptscore->max)?$userdata->score_raw:$attemptscore->max;
      if (isset($userdata->timemodified) && ($userdata->timemodified > $attemptscore->lastmodify))

      { $attemptscore->lastmodify = $userdata->timemodified; }

      else

      { $attemptscore->lastmodify = 0; }

      }

      The variable $attemptscore->lastmodify will only be set if $userdata->score_raw is not empty. Some SCORM activities, however, can be completed without generating such score and thus will not be listed in outline mode of the Activity Report. My suggestion is to move the inner if-block outside of the first if-block as such:

      if (!empty($userdata->score_raw))

      { $attemptscore->values++; $attemptscore->sum += $userdata->score_raw; $attemptscore->max = ($userdata->score_raw > $attemptscore->max)?$userdata->score_raw:$attemptscore->max; }

      if (isset($userdata->timemodified) && ($userdata->timemodified > $attemptscore->lastmodify))

      { $attemptscore->lastmodify = $userdata->timemodified; }

      else

      { $attemptscore->lastmodify = 0; }

      .

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  4 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Mar/10