Moodle
  1. Moodle
  2. MDL-18835

Human-readable time periods in SCORM reports

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4
    • Fix Version/s: 1.9.9
    • Component/s: SCORM, Usability
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      35505

      Description

      Currently SCORM reports exhibit time periods notation format, which is understandable but yet not so user-friendly: P1DT1H2M32.1S for example. Using some complex regular expressions, we can replace this notation by usual one: 1 day 1 hour 2 minutes 32.1 sec. The attached patch does this by adding a formatter function and calling it in every place where report prints out date/time periods. The patch is applied with -p0.

      1. scorm_format_unittest.patch
        2 kB
        Vlas Voloshin
      2. scorm_time.patch
        4 kB
        Vlas Voloshin
      3. scorm_time2.patch
        5 kB
        Vlas Voloshin
      1. Screenshot.png
        12 kB

        Issue Links

          Activity

          Hide
          Dan Marsden added a comment -

          Hi Vlas - I might be missing something, but the SCORM's I have loaded display times like 00:00:03.97 not P1DT1H2M32.1S (which is still bad usability!) - I've only got Scorm 1.2 objects loaded though - does this occur with SCORM 2004 objects? - could you provide some screenshots or a test SCORM object that displays the times in that format?

          thanks!

          Show
          Dan Marsden added a comment - Hi Vlas - I might be missing something, but the SCORM's I have loaded display times like 00:00:03.97 not P1DT1H2M32.1S (which is still bad usability!) - I've only got Scorm 1.2 objects loaded though - does this occur with SCORM 2004 objects? - could you provide some screenshots or a test SCORM object that displays the times in that format? thanks!
          Hide
          Vlas Voloshin added a comment -

          Hello! Yes, you're right - such format is used in SCORM 2004 standard. However, I didn't manage to find a package to show this clearly, as they whether show time in the format you've mentioned, or just show "P" instead of time (which actually tells that it's SCORM 2004 format, but without data). I'm attaching a screenshot from edited pipwerks wrapper example - it sends actual time. The format itself is described in SCORM 2004 standard: "SCORM® 2004 3rd Edition Run-Time Environment (RTE) Version 1.0" document, paragraph 4.1.1.7, timeinterval data type.
          Actually, back-compatibility is not a problem as the function I've introduced checks whether first symbol of date/time string is 'P', which whould mean that this is SCORM 2004 format. In other case, it just returns the input string without any changes.

          Show
          Vlas Voloshin added a comment - Hello! Yes, you're right - such format is used in SCORM 2004 standard. However, I didn't manage to find a package to show this clearly, as they whether show time in the format you've mentioned, or just show "P" instead of time (which actually tells that it's SCORM 2004 format, but without data). I'm attaching a screenshot from edited pipwerks wrapper example - it sends actual time. The format itself is described in SCORM 2004 standard: "SCORM® 2004 3rd Edition Run-Time Environment (RTE) Version 1.0" document, paragraph 4.1.1.7, timeinterval data type. Actually, back-compatibility is not a problem as the function I've introduced checks whether first symbol of date/time string is 'P', which whould mean that this is SCORM 2004 format. In other case, it just returns the input string without any changes.
          Hide
          Dan Marsden added a comment -

          cool - we really need to display the time consistently in the reports for both SCORM 1.2 and 2004 objects - if you could add to your scorm_format_date_time function to make it translate SCORM 1.2 times in the same way it translates the 2004 ones that would be great!

          Show
          Dan Marsden added a comment - cool - we really need to display the time consistently in the reports for both SCORM 1.2 and 2004 objects - if you could add to your scorm_format_date_time function to make it translate SCORM 1.2 times in the same way it translates the 2004 ones that would be great!
          Hide
          Vlas Voloshin added a comment -

          Dan, I made changes as you've proposed: now this function suggests that given string is of SCORM 1.2 format if the first character of string is not 'P', and does corresponding conversion. I also improved SCORM 2004 converter a little, concerning convertion of seconds.
          I made another patch, scorm_time2.patch, you'll have to reverse-apply first one first as the second one is based on current cvs. Those regexp's might be difficult to understand, but I've tried to test every case so I hope it works right

          Show
          Vlas Voloshin added a comment - Dan, I made changes as you've proposed: now this function suggests that given string is of SCORM 1.2 format if the first character of string is not 'P', and does corresponding conversion. I also improved SCORM 2004 converter a little, concerning convertion of seconds. I made another patch, scorm_time2.patch, you'll have to reverse-apply first one first as the second one is based on current cvs. Those regexp's might be difficult to understand, but I've tried to test every case so I hope it works right
          Hide
          Vlas Voloshin added a comment -

          Some time has passed - but to no avail, unfortunately I thought maybe the patch is not applied just because it's hard to check all those regexp's... So I made a unit test file to check the work of the function on both SCORM2004 and SCORM 1.2 time formats, I attach it here. Please take in consideration that those tests I made there only work with English language strings for days, hours, minutes, etc., so you would need to switch your Moodle to English before running them.

          Show
          Vlas Voloshin added a comment - Some time has passed - but to no avail, unfortunately I thought maybe the patch is not applied just because it's hard to check all those regexp's... So I made a unit test file to check the work of the function on both SCORM2004 and SCORM 1.2 time formats, I attach it here. Please take in consideration that those tests I made there only work with English language strings for days, hours, minutes, etc., so you would need to switch your Moodle to English before running them.
          Hide
          Dan Marsden added a comment -

          thanks for the unit tests - we don't have any funding to work on SCORM at the moment, so it's done in our own time - Unfortunately for you SCORM 2004 priority for us is lower than the other stuff as we know the SCORM 2004 stuff isn't good.

          We are actively looking for funding and have had a range of people who want the work done, but no-one has been able to provide any funding to allow us to get into it yet.

          thanks!

          Show
          Dan Marsden added a comment - thanks for the unit tests - we don't have any funding to work on SCORM at the moment, so it's done in our own time - Unfortunately for you SCORM 2004 priority for us is lower than the other stuff as we know the SCORM 2004 stuff isn't good. We are actively looking for funding and have had a range of people who want the work done, but no-one has been able to provide any funding to allow us to get into it yet. thanks!
          Hide
          Dan Marsden added a comment -

          finally got round to reviewing this - looks good! - I have pushed this into HEAD - with a change to the unit tests to work with non-english langs - can you please check it out?

          thanks!

          Show
          Dan Marsden added a comment - finally got round to reviewing this - looks good! - I have pushed this into HEAD - with a change to the unit tests to work with non-english langs - can you please check it out? thanks!
          Hide
          Dan Marsden added a comment -

          fix now in 1.9 stable too - thanks for the report!

          Show
          Dan Marsden added a comment - fix now in 1.9 stable too - thanks for the report!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: