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

Read-only view of quiz settings overrides

    XMLWordPrintable

Details

    • MOODLE_311_STABLE, MOODLE_39_STABLE
    • MOODLE_311_STABLE
    • MDL-69735_311
    • Hide

      Setup

      1. You need to have, or create, a course with some groups and a quiz.
      2. Log in as teacher.
      3. Go to the quiz.
      4. Go to the 'User overrides' page in the quiz settings menu.
      5. Verify there is a message saying this quiz has no overrides.
      6. Add one or more user override
      7. While you are adding the override, copy the URL of this screen for later use.
      8. Go to the 'Group overrides' page in the quiz settings menu.
      9. Add one ore more overrides.
      10. Log out

      Test viewing user overrides

      1. Log in as a non-editing teacher.
      2. Navigate to the quiz.
      3. Verify that you have the 'User overrides' and 'Group overrides' options in the Settings menu.
      4. Go to the user overrides page.
      5. Verify that you can see what overrides have been set up.
      6. Verify that you have no editing controls.

      Test viewing group overrides

      1. Go to the group overrides page.
      2. Verify that you can see what overrides have been set up.
      3. Verify that you have no editing controls.
      4. Copy the URL of this screen for later use.

      Test permission checks

      1. Try to go to the 'Add override' URL which you copied during the 'Setup' stage.
      2. Verify that you get a permission denied error.
      3. Log out
      4. Log in as a student.
      5. Try to co directly to the URL of the 'Group overrides' page, which you copied during the 'Test viewing group overrides' state
      6. Verify that you get a permission denied error.
      Show
      Setup You need to have, or create, a course with some groups and a quiz. Log in as teacher. Go to the quiz. Go to the 'User overrides' page in the quiz settings menu. Verify there is a message saying this quiz has no overrides. Add one or more user override While you are adding the override, copy the URL of this screen for later use. Go to the 'Group overrides' page in the quiz settings menu. Add one ore more overrides. Log out Test viewing user overrides Log in as a non-editing teacher. Navigate to the quiz. Verify that you have the 'User overrides' and 'Group overrides' options in the Settings menu. Go to the user overrides page. Verify that you can see what overrides have been set up. Verify that you have no editing controls. Test viewing group overrides Go to the group overrides page. Verify that you can see what overrides have been set up. Verify that you have no editing controls. Copy the URL of this screen for later use. Test permission checks Try to go to the 'Add override' URL which you copied during the 'Setup' stage. Verify that you get a permission denied error. Log out Log in as a student. Try to co directly to the URL of the 'Group overrides' page, which you copied during the 'Test viewing group overrides' state Verify that you get a permission denied error.

    Description

      At the moment there is just a single capability 'mod/quiz:manageoverrides' which controls access to the screens where you can see which User and Group overrides exist and edit them.

      We now have a requirement for some people to just be able to check the list, without being able to alter it. So, that would require adding capability 'mod/quiz:viewoverrides' (giving to non-editing teacher by default), and for users who have that capability, but not 'mod/quiz:manageoverrides', then they should be able to see the overrides that exist without editing them.

      I think this just requires:

      1. Add the new capabillity to mod/quiz/db/access.php. I suggest giving it to Non-editing teacher by default.
      2. In quiz_extend_settings_navigation in mod/quiz/lib.php, show the list to uses with either capability, not just the current one.
      3. Edit mod/quiz/overrides.php so that if you have the new capability, you can access that page, but without any of the editing controls.
      4. Add a Behat test to verify it.

      Attachments

        1. Screenshot 1.PNG
          Screenshot 1.PNG
          19 kB
        2. screenshot-1.png
          screenshot-1.png
          17 kB
        3. Screenshot 2.png
          Screenshot 2.png
          32 kB
        4. Screenshot 3.PNG
          Screenshot 3.PNG
          20 kB
        5. Screenshot 4.png
          Screenshot 4.png
          189 kB

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              timhunt Tim Hunt
              Mahmoud Kassaei Mahmoud Kassaei
              Jun Pataleta Jun Pataleta
              Gladys Basiana Gladys Basiana
              Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                17/May/21

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours
                  5h