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

Improving import: chapter names and order



    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.8.1
    • Fix Version/s: None
    • Component/s: Book
    • Labels:
    • Affected Branches:


      On 2.8.1 and a version of 2.7 (hence I assume all before 2.8.1) the import function for the Book module appears to have two limitations that I've developed some initial fixes for. The problems first and the code will come eventually, once I work through the process.

      File names become chapter titles with no modification

      If an imported file is named Diigo tool disappears_sub.html then this will be the title of the chapter created in the book. When the author's intent is almost certainly that the title be Diigo tool disappears

      Dropping the .html and the _sub which indicates a sub chapter.

      Order of imported chapters relies on the php hash/key order

      If I create a zip with the following content. The aim being that the order of the files in this zip file is the order I want the chapters to appear in the book

      Archive: import.zip
      testing: The tools we'll be using.html OK
      testing: Diigo.html OK
      testing: Diigo tool disappears_sub.html OK
      testing: A blog.html OK
      testing: Twitter.html OK
      No errors detected in compressed data of import.zip.

      This will probably not be the order of the chapters imported.

      This is because the import function creates a PHP hash where the key is the pathname for each file. The order in which this hash is traversed is dependent upon whatever PHP does.

      A better solution would be to process the chapters in the order contained in the zip file. Allowing the author some control.




            Unassigned Unassigned
            djplanner David Jones
            Component watchers:
            David Jones, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            0 Vote for this issue
            1 Start watching this issue