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

Quiz no longer respects questionsperpage default setting

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Login as admin
      2. Go to Site Admin > Plugins > Quiz and find the questionsperpage setting
      3. Set it to Never and save
      4. Go into a course and create a quiz
      5. Confirm that the setting New page under Layout defaults to Never
      6. Back in the admin settings, change the value to After adding each question, and check the Advanced checkbox. Save.
      7. Go and create a quiz in a course again.
      8. Confirm that New page under Layout now appears under the Show more expansion.
      9. Confirm the New page value defaults to Every question.
      10. Change the admin setting to After adding 2 questions, and uncheck the Advanced checkbox. Save.
      11. Go and create a quiz in a course again.
      12. Confirm that the setting New page under Layout defaults to Every 2 questions.
      13. Confirm the New page setting under Layout does not appear under the Show more link (ie not advanced).
      Show
      Login as admin Go to Site Admin > Plugins > Quiz and find the questionsperpage setting Set it to Never and save Go into a course and create a quiz Confirm that the setting New page under Layout defaults to Never Back in the admin settings, change the value to After adding each question , and check the Advanced checkbox. Save. Go and create a quiz in a course again. Confirm that New page under Layout now appears under the Show more expansion. Confirm the New page value defaults to Every question . Change the admin setting to After adding 2 questions , and uncheck the Advanced checkbox. Save. Go and create a quiz in a course again. Confirm that the setting New page under Layout defaults to Every 2 questions . Confirm the New page setting under Layout does not appear under the Show more link (ie not advanced).
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:
      MDL-68986-master

      Description

      In MDL-67351, the quiz mod form was changed to use mod_form:apply_admin_defaults(), and so the individual default setting were removed from the form.

      That worked fine in all except one case, questionsperpage (Layout > New page setting), from what I can tell. The problem is that the questionsperpage is actually contained within a group, questionsperpagegrp, in the form, and apply_admin_defaults() does not recursively check. It only applys the defaults for elements that are at the root level of the form.

      So either apply_admin_defaults() needs to be updated to "search" for form elements, or this line needs to be brought back in.

      This also applies to the advanced flag for the item, which is actually controlled under the questionsperpagegrp name, since it is the entire group that has that flag. Because of that, this line would also need to come back, since that would not be an easy fix to apply_admin_defaults().

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              emerrill Eric Merrill
              Reporter:
              emerrill Eric Merrill
              Peer reviewer:
              Tim Hunt
              Integrator:
              Víctor Déniz Falcón
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jun/20

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 20 minutes
                  1h 20m