Moodle

Tutors should not be able to see hidden grades on grader report

Details

  • Type: Sub-task Sub-task
  • Status: Reopened Reopened
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9
  • Fix Version/s: STABLE backlog
  • Component/s: Gradebook
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

See the attached screenshot. The averages for columns CORRECTLY show a "-" when:

  • the current user does not have permissions to view hidden grades
  • any value in the column contains a hidden grades.

The problem is that this kind of behaviour this is not mirrored for the case of totals for categories (including the whole course). This needs to be fixed.

Can we make the category aggregates behave in exactly the same way?

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

Assigning to Nicolas as he's already working on this.

Show
Martin Dougiamas added a comment - Assigning to Nicolas as he's already working on this.
Hide
Nicolas Connault added a comment -

All done. Created a new method in grade_item object: has_hidden_grades(). It takes the optional groupsql and groupwheresql as params, and returns a count of the hidden grades within the grade_item, limited to the group if specified.

Show
Nicolas Connault added a comment - All done. Created a new method in grade_item object: has_hidden_grades(). It takes the optional groupsql and groupwheresql as params, and returns a count of the hidden grades within the grade_item, limited to the group if specified.
Hide
Martin Dougiamas added a comment -

so does this add a new SQL call for every row?

Show
Martin Dougiamas added a comment - so does this add a new SQL call for every row?
Hide
Petr Škoda (skodak) added a comment -

if grade hidden and user can not see it, NULL is used instead in column total calculation now

Show
Petr Škoda (skodak) added a comment - if grade hidden and user can not see it, NULL is used instead in column total calculation now
Hide
Petr Škoda (skodak) added a comment -

should be fixed now, please reopen again in case of any problems found, thanks

Show
Petr Škoda (skodak) added a comment - should be fixed now, please reopen again in case of any problems found, thanks
Hide
Nicolas Connault added a comment -

Problem here, a user without grade:viewhidden cannot see any averages at all! In the grader report there is no average row, with or without group selected, even if there are no hidden items or grades.

Show
Nicolas Connault added a comment - Problem here, a user without grade:viewhidden cannot see any averages at all! In the grader report there is no average row, with or without group selected, even if there are no hidden items or grades.
Hide
Nicolas Connault added a comment -

I just attached a proposed solution for this. It hides the average of an item if the user doesn't have grade:viewhidden, and any of the following conditions:

1. The grade item is calculated
2. The grade item is hidden or contains any hidden grade
2. The grade item is a category or course item, which category or course contains any hidden item or grade

In all other conditions, the average is shown.

I may be missing cases in which an average still depends on a hidden grade, but I can't think of any right now.

Show
Nicolas Connault added a comment - I just attached a proposed solution for this. It hides the average of an item if the user doesn't have grade:viewhidden, and any of the following conditions: 1. The grade item is calculated 2. The grade item is hidden or contains any hidden grade 2. The grade item is a category or course item, which category or course contains any hidden item or grade In all other conditions, the average is shown. I may be missing cases in which an average still depends on a hidden grade, but I can't think of any right now.
Hide
Nicolas Connault added a comment -

I just simplified the patch, using caching of categories that include hidden/calculated grades. This makes the procedure much faster and reduces coding changes.

Show
Nicolas Connault added a comment - I just simplified the patch, using caching of categories that include hidden/calculated grades. This makes the procedure much faster and reduces coding changes.
Hide
Nicolas Connault added a comment -

One possible issue is that grade_item->has_hidden_grades() checks the grade item for all grades regardless of group. Group should be checked.

Show
Nicolas Connault added a comment - One possible issue is that grade_item->has_hidden_grades() checks the grade item for all grades regardless of group. Group should be checked.
Hide
Nicolas Connault added a comment -

Added the group code to the patch.

Show
Nicolas Connault added a comment - Added the group code to the patch.
Hide
Petr Škoda (skodak) added a comment -

anybody using grader report should have view hidden grades capability, right?

Show
Petr Škoda (skodak) added a comment - anybody using grader report should have view hidden grades capability, right?
Hide
Nicolas Connault added a comment -

Yes Petr, there is a case for a "reviewing" user like an inspector who can view the grader report but not turn editing on. Viewhidden may also be taken off from such a user, in which case we need to either hide the averages completely or implement a solution such as the one in the attached patch.

I've just updated the patch with a final solution: Users with viewhidden off cannot collapse columns. This removes the need to implement an expensive grade_category->has_hidden_grades() method.

Show
Nicolas Connault added a comment - Yes Petr, there is a case for a "reviewing" user like an inspector who can view the grader report but not turn editing on. Viewhidden may also be taken off from such a user, in which case we need to either hide the averages completely or implement a solution such as the one in the attached patch. I've just updated the patch with a final solution: Users with viewhidden off cannot collapse columns. This removes the need to implement an expensive grade_category->has_hidden_grades() method.
Hide
Petr Škoda (skodak) added a comment -

My point of view is that grader report is doing way too much, there should be a special report for inspectors if needed.

Show
Petr Škoda (skodak) added a comment - My point of view is that grader report is doing way too much, there should be a special report for inspectors if needed.
Hide
Petr Škoda (skodak) added a comment - - edited

Delaying a bit more, this will need some time and testing, sorry ...

Show
Petr Škoda (skodak) added a comment - - edited Delaying a bit more, this will need some time and testing, sorry ...

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: