Moodle
  1. Moodle
  2. MDL-10358

Scorm - Can not update SCORM packages

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.9.1
    • Component/s: SCORM
    • Labels:
      None
    • Environment:
      LAMP
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      28866

      Description

      In previous versions of Moodle, I would update a SCORM package by:

      1. remove the reference to the SCORM package
      2. Save changes
      3. reference the SCORM package
      4. Save changes

      This would reset everything, if the structure changed, it would reflect the changes.

      In Moodle 1.8 I'm having a difficult time updating the packages. I have tried everything and it doesn't seem to update the structure. All sorts of weird things are happening like, the structure is labeled as the old structure, but the links to the files are the new structure. Anything I try does not produce the result desired.

      Furthermore if I change the frequency of the update to Every time it's used it and the SCORM package doesn't even load up the structure of the package. So that seems to be broken too.

        Activity

        Hide
        Jason added a comment -

        The following fixes the update every time it's used. It was'nt working because a function being called was in a file not included.

        OLD

        if ($scorm->updatefreq == UPDATE_EVERYTIME)

        { $scorm->instance = $scorm->id; scorm_update_instance($scorm); }

        NEW

        if ($scorm->updatefreq == UPDATE_EVERYTIME)

        { $scorm->instance = $scorm->id; //JASON SHAW: Hack inserted because update everytime it was visited didn t work because the lib.php file was not included and the function being called i s in that file require_once($CFG->dirroot.'/mod/scorm/lib.php'); scorm_update_instance($scorm); }
        Show
        Jason added a comment - The following fixes the update every time it's used. It was'nt working because a function being called was in a file not included. OLD if ($scorm->updatefreq == UPDATE_EVERYTIME) { $scorm->instance = $scorm->id; scorm_update_instance($scorm); } NEW if ($scorm->updatefreq == UPDATE_EVERYTIME) { $scorm->instance = $scorm->id; //JASON SHAW: Hack inserted because update everytime it was visited didn t work because the lib.php file was not included and the function being called i s in that file require_once($CFG->dirroot.'/mod/scorm/lib.php'); scorm_update_instance($scorm); }
        Hide
        Dan Marsden added a comment -

        assigning to me - will test fix and look at patching it.

        Dan

        Show
        Dan Marsden added a comment - assigning to me - will test fix and look at patching it. Dan
        Hide
        Dan Marsden added a comment -

        thanks for the good report! - fix now in 1.9Stable and HEAD

        Show
        Dan Marsden added a comment - thanks for the good report! - fix now in 1.9Stable and HEAD
        Hide
        Petr Škoda added a comment -

        the locallib.php + lib.php are not good:
        1/ each file should include lib.php and locallibe only when required
        2/ the begging of locallib.php is very problematic - there can not be globals, fors and other operations in global scope of locallib.php because those might be included from fucntions

        my +1 for major locallib.php refactoring

        Show
        Petr Škoda added a comment - the locallib.php + lib.php are not good: 1/ each file should include lib.php and locallibe only when required 2/ the begging of locallib.php is very problematic - there can not be globals, fors and other operations in global scope of locallib.php because those might be included from fucntions my +1 for major locallib.php refactoring
        Hide
        Dan Marsden added a comment -

        I agree - there are a lot of areas in scorm code that should be tidied up.... I don't have any time at the moment.... I took this bug on before I started the new job....haven't had a chance to see how our new scorm person is going yet either!

        Dan

        Show
        Dan Marsden added a comment - I agree - there are a lot of areas in scorm code that should be tidied up.... I don't have any time at the moment.... I took this bug on before I started the new job....haven't had a chance to see how our new scorm person is going yet either! Dan
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Agree about locallib being 100% free of global code. Anyway, in this case, lib.php is being included because we need some function there, isn't it?

        Also, Dan, how is this working under 18_STABLE? Should the patch be backported there?

        Closing this... I'd recommend to open a new track about locallib discussion (or GDF/HQ). Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Agree about locallib being 100% free of global code. Anyway, in this case, lib.php is being included because we need some function there, isn't it? Also, Dan, how is this working under 18_STABLE? Should the patch be backported there? Closing this... I'd recommend to open a new track about locallib discussion (or GDF/HQ). Ciao
        Hide
        Dan Marsden added a comment -

        would probably be a good idea to backport "something" to 1.8 stable.... should include scorm/lib.php somewhere else.... no time to look at this right now, but will try to put in the list of things todo!

        Dan

        Show
        Dan Marsden added a comment - would probably be a good idea to backport "something" to 1.8 stable.... should include scorm/lib.php somewhere else.... no time to look at this right now, but will try to put in the list of things todo! Dan

          People

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

            Dates

            • Created:
              Updated:
              Resolved: