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

Quiz manual grading: page size preference can get stuck at 0

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Initial setup

      1. Create a course.
      2. Create a teacher and a student account.
      3. Create a Quiz activity.
      4. Create an Essay question and add it to the created Quiz activity.

      Testing

      1. Log in as a student.
      2. Attempt the Quiz and submit the answer.
      3. Log in as a teacher.
      4. Go to the Manual grading report of the Quiz.
      5. Click on the "grade" link in the report table.
      6. Set the Questions per page value to 0 and press "Change options".
      7. Verify that you will see an error message: You must enter a number not starting with a 0 here.
      8. Set the Questions per page value to 1 and Press "Change options".
      9. Verify that you will not see an error message: You must enter a number not starting with a 0 here.
      10. Verify that in the address bar of the browser, you will see something like: &pagesize=1.
      11. Change the &pagesize=1 to &pagesize=0 and press Enter.
      12. Verify that you will see an exception error: Invalid page size.
      13. Remove the &pagesize=0 and press Enter.
      14. Verify that the page will load successfully.
      15. Verify that the Questions per page value is 1.

       Also try eintering other non-standard values, like 'frog' or -7.

      Show
      Initial setup Create a course. Create a teacher and a student account. Create a Quiz activity. Create an Essay question and add it to the created Quiz activity. Testing Log in as a student. Attempt the Quiz and submit the answer. Log in as a teacher. Go to the Manual grading report of the Quiz. Click on the "grade" link in the report table. Set the Questions per page value to 0 and press "Change options". Verify that you will see an error message:  You must enter a number not starting with a 0 here . Set the Questions per page value to 1 and Press "Change options". Verify that you will not see an error message:  You must enter a number not starting with a 0 here . Verify that in the address bar of the browser, you will see something like:  &pagesize=1 . Change the  &pagesize=1 to  &pagesize=0 and press Enter. Verify that you will see an exception error:  Invalid page size . Remove the  &pagesize=0 and press Enter. Verify that the page will load successfully. Verify that the Questions per page value is 1 .  Also try eintering other non-standard values, like 'frog' or -7.
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE
    • Pull 3.10 Branch:
      MDL-71126-310
    • Pull 3.11 Branch:
      MDL-71126-311
    • Pull Master Branch:
      MDL-71126-master

      Description

      When manually grading a quiz, the "Questions per page" can be set to 0 and produces a coding error. This is saved as a user preference with the key "quiz_grading_pagesize" and brakes grading for this user for the whole site.

      The input for this form does not seem to be validated.

       

      This might be related to MDL-3953.

      Steps to reproduce:

      1. Create a course.
      2. Create a quiz activity.
      3. Add an "Essay" question.
      4. Login as a student, and submit the quiz.
      5. Login as teacher,  go to Manual grading screen.
      6. Press "grade" link to make a grade.
      7. Set 0 in "Questions per page" in "Options", and press "Change options".
      8. The error "Coding error detected, it must be fixed by a programmer: moodle_database::get_in_or_equal() does not accept empty arrays" is shown, and the user cannot manual grade any more.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              huongn@moodle.com Huong Nguyen
              Reporter:
              Daniel Ziegenberg Daniel Ziegenberg
              Peer reviewer:
              Tim Hunt Tim Hunt
              Integrator:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tester:
              Anna Carissa Sadia Anna Carissa Sadia
              Participants:
              Component watchers:
              Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Jul/21

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 4 hours, 50 minutes
                  1d 4h 50m