Issue Details (XML | Word | Printable)

Key: MDL-18857
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Dan Marsden
Reporter: Lars Kobbe
Votes: 4
Watchers: 4
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

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

Created: 14/Apr/09 11:27 PM   Updated: 22/Sep/09 02:53 AM
Return to search
Component/s: SCORM
Affects Version/s: 1.9.4
Fix Version/s: None

File Attachments: None
Image Attachments:

1. atividades-outline.png
(50 kB)

2. SCORM_Complete_Report.png
(40 kB)

3. SCORM_Outline_Report1.png
(33 kB)

4. SCORM_Outline_Report2.png
(35 kB)

Participants: Dan Marsden, Lars Kobbe and Marcelo Oliveira
Security Level: None
Difficulty: Easy
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
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;
            }
.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Lars Kobbe made changes - 17/Apr/09 05:39 PM
Field Original Value New Value
Attachment SCORM_Complete_Report.png [ 16930 ]
Attachment SCORM_Outline_Report2.png [ 16932 ]
Attachment SCORM_Outline_Report1.png [ 16931 ]
Marcelo Oliveira made changes - 22/Sep/09 02:53 AM
Attachment atividades-outline.png [ 18412 ]