Moodle
  1. Moodle
  2. MDL-21444

AICC: total_time is always accumulated over the record representing the first attempt, opposite to the logic implemented for SCORM tracked actitivties

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.9
    • Component/s: SCORM
    • Labels:
      None
    • Environment:
      LAMP, PHP 5.2.12
    • Database:
      MySQL
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      26670

      Description

      As described in the subject, AICC total_time accumulation logic differs from that implemented for SCORM tracked activities, mainly due to:
      1. the different nature of the 'run time environment', AICC being server side through HTTP POST (HACP) and SCORM, API based, trough a combination of client side logic (JS based) and PHP logic (mainly for storing data, with no logic over the data model);
      2. bug MDL-21304 which has hidden the issue.

        Activity

        Matteo Scaramuccia created issue -
        Hide
        Matteo Scaramuccia added a comment -

        Path proposal, mod/scorm/aicc.php:

        @@ -332,7 +332,8 @@
                         case 'exitau':
                             if ($status == 'Running') {
                                 if (isset($SESSION->scorm_session_time) && ($SESSION->scorm_session_time != '')) {
        -                            if ($track = get_record_select('scorm_scoes_track',"userid='$USER->id' AND scormid='$scorm->id' AND scoid='$sco->id' AND element='cmi.core.total_time'")) {
        +                            if ($track = get_record_select('scorm_scoes_track',"userid='$USER->id' AND scormid='$scorm->id' AND scoid='$sco->id' AND attempt='$attempt' AND element='cmi.core.total_time'")) {
                                        // Add session_time to total_time
                                         $value = scorm_add_time($track->value, $SESSION->scorm_session_time);
                                         $track->value = $value;
        @@ -346,6 +347,7 @@
                                         $track->scoid = $sco->id;
                                         $track->element = 'cmi.core.total_time';
                                         $track->value = $SESSION->scorm_session_time;
        +                                $track->attempt = $attempt;
                                         $track->timemodified = time();
                                         $id = insert_record('scorm_scoes_track',$track);
                                     }
        
        Show
        Matteo Scaramuccia added a comment - Path proposal, mod/scorm/aicc.php : @@ -332,7 +332,8 @@ case 'exitau': if ($status == 'Running') { if (isset($SESSION->scorm_session_time) && ($SESSION->scorm_session_time != '')) { - if ($track = get_record_select('scorm_scoes_track', "userid='$USER->id' AND scormid='$scorm->id' AND scoid='$sco->id' AND element='cmi.core.total_time'" )) { + if ($track = get_record_select('scorm_scoes_track', "userid='$USER->id' AND scormid='$scorm->id' AND scoid='$sco->id' AND attempt='$attempt' AND element='cmi.core.total_time'" )) { // Add session_time to total_time $value = scorm_add_time($track->value, $SESSION->scorm_session_time); $track->value = $value; @@ -346,6 +347,7 @@ $track->scoid = $sco->id; $track->element = 'cmi.core.total_time'; $track->value = $SESSION->scorm_session_time; + $track->attempt = $attempt; $track->timemodified = time(); $id = insert_record('scorm_scoes_track',$track); }
        Hide
        Dan Marsden added a comment -

        fix now in 1.9Stable and Head - thanks for the report/patch Matteo! - would be great if you could test this and confirm it's fixed.

        thanks!

        Show
        Dan Marsden added a comment - fix now in 1.9Stable and Head - thanks for the report/patch Matteo! - would be great if you could test this and confirm it's fixed. thanks!
        Dan Marsden made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.9.9 [ 10405 ]
        Resolution Fixed [ 1 ]
        Hide
        Matteo Scaramuccia added a comment -

        Hi Dan,
        FYI any of the patches proposed into the tracker - using new as well as already existing entries - by me is happily running in production since/before the time of submission

        Ciao,
        Matteo

        Show
        Matteo Scaramuccia added a comment - Hi Dan, FYI any of the patches proposed into the tracker - using new as well as already existing entries - by me is happily running in production since/before the time of submission Ciao, Matteo
        Hide
        Dan Marsden added a comment -

        Thanks Matteo - it always helps to have a 2nd pair of eyes on the actual commit that goes in - just in case there's a typo somewhere I missed!

        Show
        Dan Marsden added a comment - Thanks Matteo - it always helps to have a 2nd pair of eyes on the actual commit that goes in - just in case there's a typo somewhere I missed!
        Martin Dougiamas made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        QA Assignee nobody
        Martin Dougiamas made changes -
        Workflow jira [ 34916 ] MDL Workflow [ 63758 ]
        Martin Dougiamas made changes -
        Workflow MDL Workflow [ 63758 ] MDL Full Workflow [ 93009 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: