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

Excel export can still generates an invalid sheet names

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course called "ThisCourseNameIsLong" (as the shortname)
      2. Create a quiz, name the Quiz "ABCDEFGHI's gonna fail", with one true-false question.
        (the goal here is that the single quote in the name ends up as the 31st character)
      3. Attempt the quiz as two different students
      4. Go to Quiz -> Results -> Statistics, and choose to export the entire report at Excel format.
      5. Verify that the export file is written with no errors. (Since it is a binary file download, you probably need to look for errors in the PHP logs.)
      Show
      Create a course called "ThisCourseNameIsLong" (as the shortname) Create a quiz, name the Quiz "ABCDEFGHI's gonna fail", with one true-false question. (the goal here is that the single quote in the name ends up as the 31st character) Attempt the quiz as two different students Go to Quiz -> Results -> Statistics, and choose to export the entire report at Excel format. Verify that the export file is written with no errors. (Since it is a binary file download, you probably need to look for errors in the PHP logs.)
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Exporting quiz overviews can still fail like in MDL-51375, you just need to have the lucky number of characters in your course and quiz name for the sheet to fail.

      MDL-51375 resolved the case where a name being set with a single quote at the start or end.

      However, right after that, a substr is run on the name trimming it down to 32 chars long, and if you had a longer name, with a single quote that just so happens to appear in the 32nd position, its not a single quote at the end of the sheet name - which causes a fatal error.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aolley Adam Olley
                Reporter:
                aolley Adam Olley
                Peer reviewer:
                Tim Hunt
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Andrew Nicols
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón, Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Mar/16