Moodle
  1. Moodle
  2. MDL-16184

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.1, 1.9.2
    • Fix Version/s: 1.9.5
    • Component/s: SCORM
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      31179

      Description

      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.

        Issue Links

          Activity

          Hide
          Dan Marsden added a comment -

          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!

          Show
          Dan Marsden added a comment - 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!
          Hide
          Jose G. C. added a comment -

          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...

          Show
          Jose G. C. added a comment - 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...
          Hide
          Piers Harding added a comment -

          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.

          Show
          Piers Harding added a comment - 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.
          Hide
          Ron Meske added a comment -

          Piers, Can you attach the modified files. I am will to test them.

          Show
          Ron Meske added a comment - Piers, Can you attach the modified files. I am will to test them.
          Hide
          Ron Meske added a comment -

          BTW: We are on 1.9.2, build 20080910

          Show
          Ron Meske added a comment - BTW: We are on 1.9.2, build 20080910
          Hide
          Piers Harding added a comment -

          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.

          Show
          Piers Harding added a comment - 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.
          Hide
          Piers Harding added a comment -

          proposed patch for 1.9 STABLE.

          Show
          Piers Harding added a comment - proposed patch for 1.9 STABLE.
          Hide
          Ron Meske added a comment -

          Piers,
          Do you mean 1.9.3 stable or will 1.9.2 work?

          Show
          Ron Meske added a comment - Piers, Do you mean 1.9.3 stable or will 1.9.2 work?
          Hide
          Piers Harding added a comment -

          That would be cvs branch MOODLE_19_STABLE which is currently 1.9.3+ - using the weekly build should be OK.

          Show
          Piers Harding added a comment - That would be cvs branch MOODLE_19_STABLE which is currently 1.9.3+ - using the weekly build should be OK.
          Hide
          Piers Harding added a comment -

          have backported fix to 1.9. Please review.

          Show
          Piers Harding added a comment - have backported fix to 1.9. Please review.
          Hide
          Ron Meske added a comment -

          Is this available in the latest build? Otherwise, I could use some direction on how to apply the patch.

          Thanks,
          Ron

          Show
          Ron Meske added a comment - Is this available in the latest build? Otherwise, I could use some direction on how to apply the patch. Thanks, Ron
          Hide
          Dan Marsden added a comment -

          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

          Show
          Dan Marsden added a comment - 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
          Hide
          Dan Marsden added a comment -

          ...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"

          Show
          Dan Marsden added a comment - ...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"
          Hide
          Ron Meske added a comment -

          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?

          Show
          Ron Meske added a comment - 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?
          Hide
          valerian added a comment -

          Ron, i've the same problem, I've attached a patch to correct this
          the patch resolves also this issue : MDL-21421

          Show
          valerian added a comment - Ron, i've the same problem, I've attached a patch to correct this the patch resolves also this issue : MDL-21421
          Hide
          Ron Meske added a comment -
          Show
          Ron Meske added a comment - Does this also fix http://tracker.moodle.org/browse/MDL-21423?
          Hide
          valerian added a comment -

          Ron, normally yes it resolves also this issue : MDL-21421

          Show
          valerian added a comment - Ron, normally yes it resolves also this issue : MDL-21421
          Hide
          valerian added a comment -

          Sorry, a mistake in my previous link,
          It also fix this one : MDL-21423

          Show
          valerian added a comment - Sorry, a mistake in my previous link, It also fix this one : MDL-21423
          Hide
          Dan Marsden added a comment -

          latest patch from valerian now backported to 1.9Stable - Ron - it would be really appreciated if you could test and post your results here!

          Show
          Dan Marsden added a comment - latest patch from valerian now backported to 1.9Stable - Ron - it would be really appreciated if you could test and post your results here!
          Hide
          Ron Meske added a comment -

          Almost perfect. To test I upgraded our Moodle 1.9.4 install to the latest stable.

          The first access date is now only set once and on subsequent launches is not update. Perfect!

          However, there is an issue that was not noticed before because of how it was functioning. The first access date is not actually set the first time until the SCORM SCO sends the LMSFinish and exits. I have not determined if the LMS Finish triggers it or the Exit. I expected that the first access would be set upon launch of the SCO, as that is the first access.

          Should this be created as a new tracker issue?

          Show
          Ron Meske added a comment - Almost perfect. To test I upgraded our Moodle 1.9.4 install to the latest stable. The first access date is now only set once and on subsequent launches is not update. Perfect! However, there is an issue that was not noticed before because of how it was functioning. The first access date is not actually set the first time until the SCORM SCO sends the LMSFinish and exits. I have not determined if the LMS Finish triggers it or the Exit. I expected that the first access would be set upon launch of the SCO, as that is the first access. Should this be created as a new tracker issue?
          Hide
          Dan Marsden added a comment -

          thanks Ron - that's great! - makes sense to move the new issue to a new Tracker issue! - Valerian, it would be great if you got a chance to check this out and post a patch to resolve it as well!

          thanks to all who tested/patched and provided feedback!

          Show
          Dan Marsden added a comment - thanks Ron - that's great! - makes sense to move the new issue to a new Tracker issue! - Valerian, it would be great if you got a chance to check this out and post a patch to resolve it as well! thanks to all who tested/patched and provided feedback!
          Hide
          Ron Meske added a comment -

          I have created a new issue for setting of the First Access Date upon launch instead of exit. See MDL-22168

          Show
          Ron Meske added a comment - I have created a new issue for setting of the First Access Date upon launch instead of exit. See MDL-22168

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: