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

Grade button appears in assignments without having grading capability

XMLWordPrintable

    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-82611-403
    • MDL-82611-404
    • Hide
      1. Log in as admin
      2. Create two users:
        • User 1
        • User 2
      3. Create a course
      4. Enrol "User 1" as a teacher
      5. Enrol "User 2" as a student
      6. Edit course permissions
      7. Remove mod/assign:grade capality from teacher role
      8. Navigate to course
      9. Add Assignment activity to course
      10. Navigate to course assignment activity
      11. Confirm there is a Grade button and pressing it opens the assignment grader page
      12. Log out
      13. Log in as User 1
      14. Navigate to course assignment activity
      15. Confirm there is no Grade button on page
      16. Press View all submissions
      17. Confirm it opens the assignment submissions page
      Show
      Log in as admin Create two users: User 1 User 2 Create a course Enrol "User 1" as a teacher Enrol "User 2" as a student Edit course permissions Remove mod/assign:grade capality from teacher role Navigate to course Add Assignment activity to course Navigate to course assignment activity Confirm there is a Grade button and pressing it opens the assignment grader page Log out Log in as User 1 Navigate to course assignment activity Confirm there is no Grade button on page Press View all submissions Confirm it opens the assignment submissions page

      When users do not have the permission to grade assignments, it would make sense then for the grade button to not exist.
      This would benefit use cases where non-students still need to be able to view grades, but not edit them.

      Replication Steps

      1. Ensure a non student role, such as non editing teacher, does not have the permission mod/assign:grade
      2. (optional) create an assignment, ignore if there is one you can test with already
      3. Log in as a non editing teacher
      4. Go to the assignment

      Observed: The button exists and when clicked, you are taken to a nopermission error
      Suggested: The button should not exist if you do not have the permission to go to that page.

      nopermissions
      Sorry, but you do not currently have permissions to do that (Grade assignment).
      File: /lib/accesslib.php
      Line: 875
      Stack trace:
       
      Error code: nopermissions
      * line 875 of /lib/accesslib.php: core\exception\required_capability_exception thrown
      * line 4022 of /mod/assign/locallib.php: call to require_capability()
      * line 679 of /mod/assign/locallib.php: call to assign->view_single_grading_panel()
      * line 1437 of /mod/assign/lib.php: call to assign->view()
      * line 7492 of /lib/moodlelib.php: call to mod_assign_output_fragment_gradingpanel()
      * line 415 of /lib/external/externallib.php: call to component_callback()
      * line ? of unknownfile: call to core_external::get_fragment()
      * line 253 of /lib/external/classes/external_api.php: call to call_user_func_array()
      * line 83 of /lib/ajax/service.php: call to core_external\external_api::call_external_function()
      

        1. Screenshot from 2024-07-31 08-38-24.png
          Screenshot from 2024-07-31 08-38-24.png
          129 kB
        2. MDL-82611_403_1.png
          MDL-82611_403_1.png
          74 kB
        3. MDL-82611_403_2.png
          MDL-82611_403_2.png
          82 kB
        4. MDL-82611_403_3.png
          MDL-82611_403_3.png
          68 kB
        5. MDL-82611_403_4.png
          MDL-82611_403_4.png
          102 kB
        6. MDL-82611_404_2.png
          MDL-82611_404_2.png
          84 kB
        7. MDL-82611_404_3.png
          MDL-82611_404_3.png
          73 kB
        8. MDL-82611_404_4.png
          MDL-82611_404_4.png
          109 kB
        9. MDL-82611_main_1.png
          MDL-82611_main_1.png
          76 kB
        10. MDL-82611_main_2.png
          MDL-82611_main_2.png
          83 kB
        11. MDL-82611_main_4.png
          MDL-82611_main_4.png
          107 kB
        12. MDL-82611_404_1.png
          MDL-82611_404_1.png
          79 kB
        13. MDL-82611_main_3.png
          MDL-82611_main_3.png
          73 kB

            pholden Paul Holden
            samual.preiss Samual Preiss
            Luca Bösch Luca Bösch
            Huong Nguyen Huong Nguyen
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 11 minutes
                2h 11m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.