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

Error when collapsing grade categories

    Details

    • Testing Instructions:
      Hide
      Test 1
      1. Create a course.
      2. Visit the course.
      3. Under 'Course administration' select 'Gradebook setup'.
      4. Add a grade item.
      5. Hide the grade item.
      6. Enrol a teacher in the course.
      7. Under 'Course administration' > 'Users' select 'Permissions'.
      8. Select the teacher role.
      9. Set the capability 'moodle/grade:viewhidden' to 'Prevent'.
      10. Log in as the teacher.
      11. Visit the 'Grader report'.
      12. Ensure you can expand/contract the course category item with no debugging message being shown.
      Test 2
      1. Create a course.
      2. Visit the course.
      3. Enrol a student in the course.
      4. Create two assignments in the course.
      5. Mark the student with '50' for one and '100' for another.
      6. Hide the assignment you graded '100'.
      7. Enrol a teacher in the course.
      8. Under 'Course administration' > 'Users' select 'Permissions'.
      9. Select the teacher role.
      10. Set the capability 'moodle/grade:viewhidden' to 'Prevent'.
      11. Log in as the teacher.
      12. View the grader report.
      13. Click on the icon next to the course name to expand what is shown (Assignment with course total, just the assignment, just course total) and check there are no errors and the course total does not change.
      Test 3 (Test MDL-57601)

      1. Create new course with all default settings.
      2. Enrol a test account user as manager on the course, and enrol a second test account as a student.
      3. Go to the permissions screen and remove the moodle/grade:viewhidden capability from Manager on the course
      4. On the course main page, add an quiz. Use default settings. Save and display.
      5. Edit the quiz. Change the max grade to '0'.
      6. Log in using the manager test account.
      7. View the gradebook

      EXPECTED: Gradebook should display correctly, showing the student with total (no marks) and no grade items.
      BEFORE FIX: An error message displays: 'Incorrect size of arrays in params of grade_grade::get_hiding_affected()!'

      Test 4

      1. Create new course with all default settings.
      2. Enrol a test account user as manager on the course, and enrol a second test account as a student.
      3. Go to the permissions screen and remove the moodle/grade:viewhidden capability from Manager on the course
      4. On the course main page, add an quiz. Use default settings. Save and display.
      5. Grade a few students manually on the quiz.
      6. Edit the quiz. Change the max grade to '0'.
      7. Log in using the manager test account.
      8. View the gradebook
      EXPECTED: Gradebook should display correctly with no errors

      Show
      Test 1 Create a course. Visit the course. Under 'Course administration' select 'Gradebook setup'. Add a grade item. Hide the grade item. Enrol a teacher in the course. Under 'Course administration' > 'Users' select 'Permissions'. Select the teacher role. Set the capability 'moodle/grade:viewhidden' to 'Prevent'. Log in as the teacher. Visit the 'Grader report'. Ensure you can expand/contract the course category item with no debugging message being shown. Test 2 Create a course. Visit the course. Enrol a student in the course. Create two assignments in the course. Mark the student with '50' for one and '100' for another. Hide the assignment you graded '100'. Enrol a teacher in the course. Under 'Course administration' > 'Users' select 'Permissions'. Select the teacher role. Set the capability 'moodle/grade:viewhidden' to 'Prevent'. Log in as the teacher. View the grader report. Click on the icon next to the course name to expand what is shown (Assignment with course total, just the assignment, just course total) and check there are no errors and the course total does not change. Test 3 (Test MDL-57601 ) 1. Create new course with all default settings. 2. Enrol a test account user as manager on the course, and enrol a second test account as a student. 3. Go to the permissions screen and remove the moodle/grade:viewhidden capability from Manager on the course 4. On the course main page, add an quiz. Use default settings. Save and display. 5. Edit the quiz. Change the max grade to '0'. 6. Log in using the manager test account. 7. View the gradebook EXPECTED: Gradebook should display correctly, showing the student with total (no marks) and no grade items. BEFORE FIX: An error message displays: 'Incorrect size of arrays in params of grade_grade::get_hiding_affected()!' Test 4 1. Create new course with all default settings. 2. Enrol a test account user as manager on the course, and enrol a second test account as a student. 3. Go to the permissions screen and remove the moodle/grade:viewhidden capability from Manager on the course 4. On the course main page, add an quiz. Use default settings. Save and display. 5. Grade a few students manually on the quiz. 6. Edit the quiz. Change the max grade to '0'. 7. Log in using the manager test account. 8. View the gradebook EXPECTED: Gradebook should display correctly with no errors
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Pull 3.1 Branch:
    • Pull Master Branch:
      MDL-57296-master
    • Sprint:
      3.3 sprint 2

      Description

      When collapsing grade categories in the grader report in Moodle 3.0 as a teacher without 'moodle/grade:viewhidden' capability the following error shows:

      Incorrect size of arrays in params of grade_grade::get_hiding_affected()!

      This stops the user from being able to uncollapse the categories to fix the issue since the report does not show when that error appears.

      I see the following record in mdl_user_preferences when it happens:

      id userid name value
      13332 68776 grade_report_grader_collapsed_categories75

      {"aggregatesonly":["105"],"gradesonly":[]}

      Clearing out the value for that record allows the grader report to load again for that user.

      Please also see this forum discussion in regards to other reports and possible workarounds/solutions: https://moodle.org/mod/forum/discuss.php?d=331991

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    13/Mar/17