Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

User:Eric Merrill/gradereports

From MoodleDocs
< Eric Merrill
Revision as of 21:26, 13 July 2015 by Eric Merrill (talk | contribs)
(Eric Merrill/gradereports) Eric Merrill/gradereports | Latest revision (diff) | Newer revision → (diff)

The problem

Right now, grades that need to be computed for display in reports are handled in multiple ways and in multiple locations. Reports get grade_grade::get_hiding_affected() and then each report uses it in a different way. Leading to different and inconsistent displays.

Proposal

I am proposing moving the computation layer deeper into the API, so that all computations are done at the same point in the code. New class *grade_report_grade*. This would be a sub-class grade_grade, but would represent the computed grade for display. You would specify when it is "computed" what the re-computation behavior, and the user visibility behavior is.

Possible methods:

  • static compute_report_grades() - would recursively compute grade_report_grades based on a passed node, or user/courseid
  • user_visible() - Should the item be visible to the user