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

For a quiz with more than 10 questions, remove page break then add section heading fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.3
    • Fix Version/s: 3.1.4, 3.2.1
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      The Behat test is probably sufficient (I verifed it failed before fixing the JavaScript) but here are the steps if you want to do it manually.

      1. Create a new course
      2. Create a quiz
      3. Add 11 questions, one on each page.
      4. Use the remove page-break icon to remove the page-break between pages 10 and 11.
      5. From the Add menu for page 10, choose a new section heading.
      Show
      The Behat test is probably sufficient (I verifed it failed before fixing the JavaScript) but here are the steps if you want to do it manually. Create a new course Create a quiz Add 11 questions, one on each page. Use the remove page-break icon to remove the page-break between pages 10 and 11. From the Add menu for page 10, choose a new section heading.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Thanks to Antonia Bonaccorso for reporting this in the forum, and patiently explaining to me how to reproduce it.

      1. On https://qa.moodle.net/course/view.php?id=7, or any new course, as teacher.
      2. Add 11 questions to a quiz, one on each page.
      3. Use the remove page-break icon to remove the page-break between pages 10 and 11.
      4. From the Add menu for page 10, choose a new section heading.

      Expected result: page reloads with the new head.

      Actual result: Error: Column 'firstslot' cannot be null

      If you look at the HTTP traffic, you can see the problem is a request /mod/quiz/edit.php?cmid=977&addsectionatpage=100 (when it should be 10).

      The problem is, the JavaScript that updates the page after altering page-breaks incorrectly handles two-digit page-breaks.

        Attachments

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Jan/17