Issue Details (XML | Word | Printable)

Key: MDL-16184
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Piers Harding
Reporter: Ron Meske
Votes: 0
Watchers: 1
Operations

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

First Access and Last Access dates for SCOs are always the same

Created: 24/Aug/08 06:22 AM   Updated: 12/Feb/09 04:34 AM
Return to search
Component/s: SCORM
Affects Version/s: 1.9.1, 1.9.2
Fix Version/s: 1.9.5

File Attachments: 1. Text File scorm_start_and_end_time_19.patch (6 kB)

Issue Links:
Duplicate
 
Relates
 

Database: Any
Participants: Dan Marsden, Jose G. C., Piers Harding and Ron Meske
Security Level: None
QA Assignee: Ron Meske
Resolved date: 29/Jan/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
The reports for SCOs display identical dates/times for First Access and Last Access when accesed from users profile activity reports regardless of data stored.

The logic for First A ccess of a sco is based on finding the earliest time of a all elemts modified, but this is not an acurrate result as each time a data is written to a field the timemodified is updated. Therefore if a Course has one SCO and only writes to the fields of total_time, score_raw, lesson_status, lesson_location, suspend_data, these fields may be updated several times while the sco is being viewed.

I recommend adding an additional field for storing the first access date.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Ron Meske made changes - 24/Aug/08 06:48 AM
Field Original Value New Value
Description The reports for SCOs display identical dates for First Access and Last Acces. It looks like there is only one field 'timemodified' being used for both dates in the table '*_scorm_scoes_track'. Recommend adding a field for first access. The reports for SCOs display identical dates/times for First Access and Last Access when accesed from users profile activity reports.

This also seems to occur if a course is completed in one session for the SCORM report accessed from the actual course.
Ron Meske made changes - 24/Aug/08 07:11 AM
Description The reports for SCOs display identical dates/times for First Access and Last Access when accesed from users profile activity reports.

This also seems to occur if a course is completed in one session for the SCORM report accessed from the actual course.
The reports for SCOs display identical dates/times for First Access and Last Access when accesed from users profile activity reports regardless of data stored.

The logic for First A ccess of a sco is based on finding the earliest time of a all elemts modified, but this is not an acurrate result as each time a data is written to a field the timemodified is updated. Therefore if a Course has one SCO and only writes to the fields of total_time, score_raw, lesson_status, lesson_location, suspend_data, these fields may be updated several times while the sco is being viewed.

I recommend adding an additional field for storing the first access date.

Dan Marsden made changes - 25/Aug/08 06:35 AM
Link This issue has been marked as being related by MDL-8150 [ MDL-8150 ]
Dan Marsden made changes - 01/Dec/08 12:50 PM
Link This issue is duplicated by MDL-16897 [ MDL-16897 ]
Dan Marsden added a comment - 01/Dec/08 12:52 PM
assigning to Piers - I've closed the other duplicate for this which has another suggestion on how to fix - If possible would be good to fix without the addition of DB fields so it can be fixed in stable trees as well (we cannot make changes to the db schema in stable) Thanks!

Dan Marsden made changes - 01/Dec/08 12:52 PM
Assignee Dan Marsden [ danmarsden ] Piers Harding [ piers ]
Jose G. C. added a comment - 01/Dec/08 06:22 PM
Hi,

I think the problem here is not the same as in MDL-16897, but the two issues affect the report.

In the other case the problem was about extracting track data and here the problem is about keeping that data. The solution proposed there (MDL-16897) extracts the earliest of the modifying times, that is not the real first access as it's not stored.

I consider that the solution proposed by Ron of an additional field is the optimum.

Another issue regarding this is that some fields are re-stored (and thus timemodified updated) when they're not modified but only read. As I'm developing some SCORM 2004 packages I observed the cmi.objectives and cmi.interactions timemodified is updated when the tracks are read.

The workaround I am using is setting the cmi.exit as "suspend" in the first access and keep it unmodified even when the SCO is completed. But this is only a workaround...


Piers Harding committed 3 files to 'Moodle CVS' - 20/Dec/08 03:20 PM
MDL-16184 - patch to correct the calculation of first, and last access to a SCORM attempt.
MODIFY mod/scorm/locallib.php   Rev. 1.84    (+45 -1 lines)
MODIFY mod/scorm/loaddatamodel.php   Rev. 1.2    (+3 -0 lines)
MODIFY mod/scorm/report.php   Rev. 1.57    (+5 -5 lines)
Piers Harding added a comment - 20/Dec/08 03:22 PM
Commited a fix for this against HEAD. This is a proposed approach and I am seeking feedback on it. The idea is that it "gracefully degrades" as it deals with existing data, and new.

Ron Meske added a comment - 23/Dec/08 03:27 AM
Piers, Can you attach the modified files. I am will to test them.

Ron Meske added a comment - 23/Dec/08 03:37 AM
BTW: We are on 1.9.2, build 20080910

Piers Harding added a comment - 29/Dec/08 02:41 AM
Hi Ron - the best I can do is provide you with the patch for 1.9 STABLE. Hopefully you are able to upgrade to latest 1.9?

Cheers,
Piers Harding.


Piers Harding added a comment - 29/Dec/08 02:42 AM
proposed patch for 1.9 STABLE.

Piers Harding made changes - 29/Dec/08 02:42 AM
Attachment scorm_start_and_end_time_19.patch [ 15963 ]
Ron Meske added a comment - 29/Dec/08 08:06 AM
Piers,
Do you mean 1.9.3 stable or will 1.9.2 work?

Piers Harding added a comment - 29/Dec/08 09:25 AM
That would be cvs branch MOODLE_19_STABLE which is currently 1.9.3+ - using the weekly build should be OK.

Piers Harding committed 4 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 29/Jan/09 03:16 AM
MDL-16184 - patch to correct the calculation of first, and last access to a SCORM attempt. backport to 1.9. + missing php tag in debug.
MODIFY mod/scorm/datamodels/debug.js.php   Rev. 1.1.2.6    (+1 -1 lines)
MODIFY mod/scorm/Attic/api.php   Rev. 1.24.6.3    (+7 -3 lines)
MODIFY mod/scorm/report.php   Rev. 1.46.2.9    (+9 -6 lines)
MODIFY mod/scorm/locallib.php   Rev. 1.46.2.27    (+44 -2 lines)
Piers Harding added a comment - 29/Jan/09 03:17 AM
have backported fix to 1.9. Please review.

Piers Harding made changes - 29/Jan/09 03:17 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
QA Assignee rmeske
Ron Meske added a comment - 29/Jan/09 04:00 AM
Is this available in the latest build? Otherwise, I could use some direction on how to apply the patch.

Thanks,
Ron


Dan Marsden added a comment - 29/Jan/09 02:54 PM
Hi Ron, it's in CVS MOODLE_19_STABLE - won't be in the latest package on download.moodle.org until next week.

info here on how to apply patches fyi:
http://docs.moodle.org/en/Development:How_to_apply_a_patch


Dan Marsden added a comment - 29/Jan/09 02:57 PM
...but if you don't have easy CVS access, you could pull a tar out of the catalyst Git repo here:
http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=shortlog;h=refs/heads/MOODLE_19_STABLE

click on "tree" - then "snapshot"


Ron Meske added a comment - 03/Feb/09 11:34 PM
Thank you Dan, I was able to download the 4 files and apply to our version of Moodle 1.9.4 build 20090128.

The "Started on" date&time field is still updated every time the scorm course is accessed. This value should remain fixed to the date&time the course is first started.

Other than replacing the four files, should I have made any modifications to the database?


Dan Marsden made changes - 12/Feb/09 04:34 AM
Fix Version/s 1.9.5 [ 10320 ]