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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9.8
    • 1.9.4
    • SCORM
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE
    • Easy

      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; }

      .

            danmarsden Dan Marsden
            lars.kobbe Lars Kobbe (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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