Class providing an API for the overview report building and displaying.
More...
|
| __construct ($userid, $gpr, $context) |
| Constructor. More...
|
|
| fill_table ($activitylink=false, $studentcoursesonly=false) |
| Fill the table for displaying. More...
|
|
| get_lang_string ($strcode, $section=null) |
| First checks the cached language strings, then returns match if found, or uses get_string() to get it from the DB, caches it then returns it. More...
|
|
| get_numusers ($groups=true, $users=false) |
| Fetches and returns a count of all the users that will be shown on this page. More...
|
|
| get_pref ($pref, $objectid=null) |
| Given the name of a user preference (without grade_report_ prefix), locally saves then returns the value of that preference. More...
|
|
| print_table ($return=false) |
| Prints or returns the HTML from the flexitable. More...
|
|
| print_teacher_table () |
| Print a table to show courses that the user is able to grade.
|
|
| process_action ($target, $action) |
| Processes a single action against a category, grade_item or grade. More...
|
|
| process_data ($data) |
| Processes the data sent by the form (grades and feedbacks). More...
|
|
| set_pref ($pref, $pref_value='default', $itemid=null) |
| Uses set_user_preferences() to update the value of a user preference. More...
|
|
| setup_courses_data ($studentcoursesonly) |
| Set up the courses grades data for the report. More...
|
|
| setup_table () |
| Prepares the headers and attributes of the flexitable.
|
|
| setup_users () |
| Sets up this report's user criteria to restrict the selection of users to display.
|
|
|
| blank_hidden_total ($courseid, $course_item, $finalgrade) |
| Optionally blank out course/category totals if they contain any hidden items. More...
|
|
| blank_hidden_total_and_adjust_bounds ($courseid, $course_item, $finalgrade) |
| Optionally blank out course/category totals if they contain any hidden items. More...
|
|
| get_sort_arrow ($direction='move', $sortlink=null) |
| Returns an arrow icon inside an tag, for the purpose of sorting a column. More...
|
|
| setup_groups () |
| Sets up this object's group variables, mainly to restrict the selection of users to display.
|
|
|
string | $groupsql |
| An SQL fragment used to add linking information to the group tables. More...
|
|
string | $groupwheresql |
| An SQL constraint to append to the queries used by this object to build the report. More...
|
|
array | $groupwheresql_params = array() |
| The ordered params for $groupwheresql $groupwheresql_params.
|
|
string | $userwheresql |
| An SQL constraint to append to the queries used by this object to build the report. More...
|
|
array | $userwheresql_params = array() |
| The ordered params for $userwheresql $userwheresql_params.
|
|
Class providing an API for the overview report building and displaying.
@uses grade_report
◆ __construct()
grade_report_overview::__construct |
( |
|
$userid, |
|
|
|
$gpr, |
|
|
|
$context |
|
) |
| |
Constructor.
Sets local copies of user preferences and initialises grade_tree.
- Parameters
-
int | $userid | |
object | $gpr | grade plugin return tracking object |
string | $context | |
◆ blank_hidden_total()
grade_report::blank_hidden_total |
( |
|
$courseid, |
|
|
|
$course_item, |
|
|
|
$finalgrade |
|
) |
| |
|
protectedinherited |
Optionally blank out course/category totals if they contain any hidden items.
- Deprecated:
- since Moodle 2.8 - Call blank_hidden_total_and_adjust_bounds instead.
- Parameters
-
string | $courseid | the course id |
string | $course_item | an instance of grade_item |
string | $finalgrade | the grade for the course_item |
- Return values
-
string | The new final grade |
◆ blank_hidden_total_and_adjust_bounds()
grade_report::blank_hidden_total_and_adjust_bounds |
( |
|
$courseid, |
|
|
|
$course_item, |
|
|
|
$finalgrade |
|
) |
| |
|
protectedinherited |
Optionally blank out course/category totals if they contain any hidden items.
- Parameters
-
string | $courseid | the course id |
string | $course_item | an instance of grade_item |
string | $finalgrade | the grade for the course_item |
- Return values
-
array[] | containing values for 'grade', 'grademax', 'grademin', 'aggregationstatus' and 'aggregationweight' |
◆ check_access()
static grade_report_overview::check_access |
( |
|
$systemcontext, |
|
|
|
$context, |
|
|
|
$personalcontext, |
|
|
|
$course, |
|
|
|
$userid |
|
) |
| |
|
static |
Check if the user can access the report.
- Parameters
-
stdClass | $systemcontext | system context |
stdClass | $context | course context |
stdClass | $personalcontext | personal context |
stdClass | $course | course object |
int | $userid | userid |
- Return values
-
bool | true if the user can access the report |
- Since
- Moodle 3.2
◆ fill_table()
grade_report_overview::fill_table |
( |
|
$activitylink = false , |
|
|
|
$studentcoursesonly = false |
|
) |
| |
Fill the table for displaying.
- Parameters
-
bool | $activitylink | If this report link to the activity report or the user report. |
bool | $studentcoursesonly | Only show courses that the user is a student of. |
◆ get_lang_string()
grade_report::get_lang_string |
( |
|
$strcode, |
|
|
|
$section = null |
|
) |
| |
|
inherited |
First checks the cached language strings, then returns match if found, or uses get_string() to get it from the DB, caches it then returns it.
- Parameters
-
string | $strcode | |
string | $section | Optional language section |
- Return values
-
◆ get_numusers()
grade_report::get_numusers |
( |
|
$groups = true , |
|
|
|
$users = false |
|
) |
| |
|
inherited |
Fetches and returns a count of all the users that will be shown on this page.
- Parameters
-
boolean | $groups | include groups limit |
boolean | $users | include users limit - default false, used for searching purposes |
- Return values
-
◆ get_pref()
grade_report::get_pref |
( |
|
$pref, |
|
|
|
$objectid = null |
|
) |
| |
|
inherited |
Given the name of a user preference (without grade_report_ prefix), locally saves then returns the value of that preference.
If the preference has already been fetched before, the saved value is returned. If the preference is not set at the User level, the $CFG equivalent is given (site default). Can be called statically, but then doesn't benefit from caching
- Parameters
-
string | $pref | The name of the preference (do not include the grade_report_ prefix) |
int | $objectid | An optional itemid or categoryid to check for a more fine-grained preference |
- Return values
-
mixed | The value of the preference |
◆ get_sort_arrow()
grade_report::get_sort_arrow |
( |
|
$direction = 'move' , |
|
|
|
$sortlink = null |
|
) |
| |
|
protectedinherited |
Returns an arrow icon inside an tag, for the purpose of sorting a column.
- Parameters
-
◆ print_table()
grade_report_overview::print_table |
( |
|
$return = false | ) |
|
Prints or returns the HTML from the flexitable.
- Parameters
-
bool | $return | Whether or not to return the data instead of printing it directly. |
- Return values
-
◆ process_action()
grade_report_overview::process_action |
( |
|
$target, |
|
|
|
$action |
|
) |
| |
Processes a single action against a category, grade_item or grade.
- Parameters
-
string | $target | Sortorder |
string | $action | Which action to take (edit, delete etc...) |
- Return values
-
Reimplemented from grade_report.
◆ process_data()
grade_report_overview::process_data |
( |
|
$data | ) |
|
Processes the data sent by the form (grades and feedbacks).
- Parameters
-
- Return values
-
bool | Success or Failure (array of errors). |
Reimplemented from grade_report.
◆ set_pref()
grade_report::set_pref |
( |
|
$pref, |
|
|
|
$pref_value = 'default' , |
|
|
|
$itemid = null |
|
) |
| |
|
inherited |
Uses set_user_preferences() to update the value of a user preference.
If 'default' is given as the value, the preference will be removed in favour of a higher-level preference.
- Parameters
-
string | $pref | The name of the preference. |
mixed | $pref_value | The value of the preference. |
int | $itemid | An optional itemid to which the preference will be assigned |
- Return values
-
◆ setup_courses_data()
grade_report_overview::setup_courses_data |
( |
|
$studentcoursesonly | ) |
|
Set up the courses grades data for the report.
- Parameters
-
bool | $studentcoursesonly | Only show courses that the user is a student of. |
- Return values
-
array | of course grades information |
◆ supports_mygrades()
static grade_report_overview::supports_mygrades |
( |
| ) |
|
|
static |
This report supports being set as the 'grades' report.
Reimplemented from grade_report.
◆ viewed()
static grade_report_overview::viewed |
( |
|
$context, |
|
|
|
$courseid, |
|
|
|
$userid |
|
) |
| |
|
static |
Trigger the grade_report_viewed event.
- Parameters
-
stdClass | $context | course context |
int | $courseid | course id |
int | $userid | user id |
- Since
- Moodle 3.2
◆ $baseurl
string grade_report::$baseurl |
|
inherited |
base url for sorting by first/last name.
$baseurl
◆ $context
◆ $course
object grade_report::$course |
|
inherited |
◆ $courseid
int grade_report::$courseid |
|
inherited |
◆ $currentgroup
int grade_report::$currentgroup |
|
inherited |
The current group being displayed.
$currentgroup
◆ $currentgroupname
string grade_report::$currentgroupname |
|
inherited |
The current groupname being displayed.
$currentgroupname
◆ $gpr
object grade_report::$gpr |
|
inherited |
Grade plugin return tracking object.
$gpr
◆ $gradebookroles
string grade_report::$gradebookroles |
|
inherited |
The roles for this report.
$gradebookroles
◆ $group_selector
string grade_report::$group_selector |
|
inherited |
A HTML select element used to select the current group.
$group_selector
◆ $groupsql
string grade_report::$groupsql |
|
protectedinherited |
An SQL fragment used to add linking information to the group tables.
$groupsql
◆ $groupwheresql
string grade_report::$groupwheresql |
|
protectedinherited |
An SQL constraint to append to the queries used by this object to build the report.
$groupwheresql
◆ $gtree
◆ $lang_strings
array grade_report::$lang_strings = array() |
|
inherited |
Array of cached language strings (using get_string() all the time takes a long time!).
$lang_strings
◆ $page
Current page (for paging).
$page
◆ $pbarurl
string grade_report::$pbarurl |
|
inherited |
base url for paging.
$pbarurl
◆ $prefs
array grade_report::$prefs = array() |
|
inherited |
User preferences related to this report.
$prefs
◆ $showrank
array grade_report_overview::$showrank |
Show student ranks within each course.
$showrank
◆ $studentcourseids
array grade_report_overview::$studentcourseids |
An array of course ids that the user is a student in.
$studentcourseids
◆ $table
object grade_report_overview::$table |
A flexitable to hold the data.
$table
◆ $teachercourses
array grade_report_overview::$teachercourses |
An array of courses that the user is a teacher in.
$teachercourses
◆ $user
object grade_report_overview::$user |
◆ $userwheresql
string grade_report::$userwheresql |
|
protectedinherited |
An SQL constraint to append to the queries used by this object to build the report.
$userwheresql
The documentation for this class was generated from the following file: