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

Quiz section headings sometimes get added in the wrong place

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      1. Start with a quiz like this

      • Section 1
        • Page 1
          • Q1
        • Page 2
          • Q2
        • Page 3
          • Q3
        • Page 4
          • Q4

      2. Click the remove page-break icon after Q1, so that, without a page reload, you have

      • Section 1
        • Page 1
          • Q1
          • Q2
        • Page 2
          • Q3
        • Page 3
          • Q4

      3. Choose 'Add new section heading' in the Page 2 menu and verify you end up with the expected result:

      • Section 1
        • Page 1
          • Q1
          • Q2
      • Section heading ...
        • Page 2
          • Q3
        • Page 3
          • Q4

      (Before this fix, the new heading would end up at the start of page 3 instead.)

      Show
      1. Start with a quiz like this Section 1 Page 1 Q1 Page 2 Q2 Page 3 Q3 Page 4 Q4 2. Click the remove page-break icon after Q1, so that, without a page reload, you have Section 1 Page 1 Q1 Q2 Page 2 Q3 Page 3 Q4 3. Choose 'Add new section heading' in the Page 2 menu and verify you end up with the expected result: Section 1 Page 1 Q1 Q2 Section heading ... Page 2 Q3 Page 3 Q4 (Before this fix, the new heading would end up at the start of page 3 instead.)
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Steps to reproduce

      1. Start with a quiz like this

      • Section 1
        • Page 1
          • Q1
        • Page 2
          • Q2
        • Page 3
          • Q3
        • Page 4
          • Q4

      2. Click the remove page-break icon after Q1, so you have

      • Section 1
        • Page 1
          • Q1
          • Q2
        • Page 2
          • Q3
        • Page 3
          • Q4

      3. Choose 'Add new section heading' in the Page 2 menu.

      Actual result:

      • Section 1
        • Page 1
          • Q1
          • Q2
        • Page 2
          • Q3
      • Section heading ...
        • Page 3
          • Q4

      Expected result:

      • Section 1
        • Page 1
          • Q1
          • Q2
      • Section heading ...
        • Page 2
          • Q3
        • Page 3
          • Q4

      The problem is that the Ajax action for add/remove page-break does not update the data used by the add section heading action. That data includes the page number that was output when the page was first rendered. (I assume we are fixing up the add Question actions, but we should test that too.)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/May/15