Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49557

AICC prerequisites don't work, aicclib.php needs a couple of tweaks.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.4, 3.2.1
    • 2.7.3
    • SCORM
    • MOODLE_27_STABLE
    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • master_MDL-49557
    • Hide

      Add the AICC packages linked in the description to a course - make sure that adding the packages does not throw a db level error. NOTE: these packages do not contain any content and you will see a blank page on entering. Just make sure no DB level errors occur.

      Also - run through the test in MDLQA-8720

      Show
      Add the AICC packages linked in the description to a course - make sure that adding the packages does not throw a db level error. NOTE: these packages do not contain any content and you will see a blank page on entering. Just make sure no DB level errors occur. Also - run through the test in MDLQA-8720

      When importing an AICC course with a .pre descriptor I get a "Default exception handler: Error writing to database Debug: Column 'identifier' cannot be null".

      After some debug it turns out that the relevant part of aicclib.php contains a logical error in line 253:

                          $courses[$courseid]->elements[$columns->mastercol + 1]->prerequisites = substr(trim($matches[2 - $columns->mastercol]), 1, -1);
      

      should be

                          $courses[$courseid]->elements[substr(trim($matches[$columns->mastercol+1]), 1, -1)]->prerequisites = substr(trim($matches[1-$columns->mastercol+1]), 1, -1);
      

      After this correction the import works fine, but then you get an error on the page displaying the AICC course structure: in locallib.php a call to scorm_eval_prerequisites() can't find the function, since this is contained in scorm_12lib.php that's not included when in AICC mode.

      So you need to add:

         require_once($CFG->dirroot.'/mod/scorm/datamodels/scorm_12lib.php');
      

      at the very start of aicclib.php.

      After this couple of edits everything works as expected: the AICC package containing a .pre descriptor file is loaded in Moodle without any error, and the prerequisites are honored when playing the course.

      The code should also be consolidated because it expects the values in files to be quoted and without any space between values, while in datatype CMIFormatCSV «Field data may or may not be enclosed in double-quotes (“”). Field data must be enclosed in double quotes if it contains leading/trailing spaces or commas (“,”s). Leading/trailing space on unquote field data is ignored.»

        1. quoted_nospace.zip
          1 kB
        2. quoted_space.zip
          1 kB
        3. unquoted_nospace.zip
          1 kB
        4. unquoted_space.zip
          1 kB

            danmarsden Dan Marsden
            vdellaiuto Vittorio Dell'Aiuto
            Ankit Agarwal Ankit Agarwal
            Dan Poltawski Dan Poltawski
            Damyon Wiese Damyon Wiese
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.