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

use new course formats API in IMS-CC export

    XMLWordPrintable

Details

    • Task
    • Status: Reopened
    • Minor
    • Resolution: Unresolved
    • 2.4
    • None
    • Backup: IMS-CC

    Description

      In 2.4 (master) there is a new API for course formats. One of parts of it is removing the file
      format/FORMATNAME/config.php and replacing it with class method.
      IMS-CC export tries to access config.php class

      Another part of course format changes is that course formats can have course and section options. Fields numsections, hiddensections, coursedisplay do not exist any more in table

      {course}

      . They are now options for core formats 'topics' and 'weeks' (and maybe some contributed formats). In MDL-36017 I commented the code accessing numsections, but you may want to access it conditionally.

      --- a/backup/cc/cc_lib/cc_convert_moodle2.php
      +++ b/backup/cc/cc_lib/cc_convert_moodle2.php
      @@ -83,14 +83,15 @@ abstract class cc_convert_moodle2 {
                       $coursef = new XMLGenericDocument();
                       $course_file = $dir . DIRECTORY_SEPARATOR .'course' . DIRECTORY_SEPARATOR . 'course.xml';
                       $coursef->load($course_file);
      -                $numsections = (int)$coursef->nodeValue('/course/numsections');
      +                //$numsections = (int)$coursef->nodeValue('/course/numsections');
      +                // TODO MDL-35781, this is commented because numsections is now optional attribute
                       $section_list = $docp->nodeList('/moodle_backup/information/contents/sections/section');
                       if (!empty($section_list)) {
                           $count = 0;
                           foreach ($section_list as $node) {
      -                        if ($count > $numsections) {
      -                            break;
      -                        }
      +                        //if ($count > $numsections) {
      +                        //    break;
      +                        //}
                               $sectionid    = $docp->nodeValue('sectionid', $node);
                               $sectiontitle = $docp->nodeValue('title'    , $node);
                               $sectionpath  = $docp->nodeValue('directory', $node);

      Attachments

        Issue Links

          Activity

            People

              darko.miletic Darko Miletic
              marina Marina Glancy
              Darko Miletic, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: