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

Quiz section headings sometimes get added in the wrong place

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.9
    • 2.9
    • Quiz
    • MOODLE_29_STABLE
    • MOODLE_29_STABLE
    • 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.)

    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

              mkassaei Mahmoud Kassaei
              timhunt Tim Hunt
              Tim Hunt Tim Hunt
              Andrew Lyons Andrew Lyons
              Rajesh Taneja Rajesh Taneja
              Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/May/15