Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Base class for quiz reports that are basically a table with one row for each attempt. More...
Public Member Functions | |
display ($cm, $course, $quiz) | |
Override this function to displays the report. More... | |
get_current_group ($cm, $course, $context) | |
Get the current group for the user user looking at the report. More... | |
print_header_and_tabs ($cm, $course, $quiz, $reportmode='overview') | |
Initialise some parts of $PAGE and start output. More... | |
Public Attributes | |
string const | ALL_WITH = 'all_with' |
constant used for the options, means all users with attempts. | |
int const | DEFAULT_PAGE_SIZE = 30 |
default page size for reports. | |
string const | ENROLLED_ALL = 'enrolled_any' |
constant used for the options, means all enrolled users. | |
string const | ENROLLED_WITH = 'enrolled_with' |
constant used for the options, means only enrolled users with attempts. | |
string const | ENROLLED_WITHOUT = 'enrolled_without' |
constant used for the options, means only enrolled users without attempts. | |
const | NO_GROUPS_ALLOWED = -2 |
Protected Member Functions | |
add_grade_columns ($quiz, $usercanseegrades, &$columns, &$headers, $includefeedback=true) | |
Add all the grade and feedback columns, if applicable, to the $columns and $headers arrays. More... | |
add_state_column (&$columns, &$headers) | |
Add the state column to the $columns and $headers arrays. More... | |
add_time_columns (&$columns, &$headers) | |
Add all the time-related columns to the $columns and $headers arrays. More... | |
add_user_columns ($table, &$columns, &$headers) | |
Add all the user-related columns to the $columns and $headers arrays. More... | |
configure_user_columns ($table) | |
Set the display options for the user-related columns in the table. More... | |
delete_selected_attempts ($quiz, $cm, $attemptids, core\dml\sql_join $allowedjoins) | |
Delete the quiz attempts. More... | |
get_base_url () | |
Get the base URL for this report. More... | |
get_students_joins ($cm, $course=null) | |
Get sql fragments (joins) which can be used to build queries that will select an appropriate set of students to show in the reports. More... | |
init ($mode, $formclass, $quiz, $cm, $course) | |
Initialise various aspects of this report. More... | |
load_relevant_students ($cm, $course=null) | |
Get information about which students to show in the report. More... | |
print_standard_header_and_messages ($cm, $course, $quiz, $options, $currentgroup, $hasquestions, $hasstudents) | |
Outputs the things you commonly want at the top of a quiz report. More... | |
process_actions ($quiz, $cm, $currentgroup, core\dml\sql_join $groupstudentsjoins, core\dml\sql_join $allowedjoins, $redirecturl) | |
Process any submitted actions. More... | |
set_up_table_columns ($table, $columns, $headers, $reporturl, mod_quiz_attempts_report_options $options, $collapsible) | |
Set up the table. More... | |
Protected Attributes | |
object | $context |
the quiz context. | |
mod_quiz_attempts_report_form | $form |
The settings form to use. | |
string | $mode |
the mode this report is. | |
string | $qmsubselect |
SQL fragment for selecting the attempt that gave the final grade, if applicable. | |
boolean | $showgrades = null |
caches the results of should_show_grades(). | |
Base class for quiz reports that are basically a table with one row for each attempt.
|
protected |
Add all the grade and feedback columns, if applicable, to the $columns and $headers arrays.
object | $quiz | the quiz settings. |
bool | $usercanseegrades | whether the user is allowed to see grades for this quiz. |
array | $columns | the list of columns. Added to. |
array | $headers | the columns headings. Added to. |
bool | $includefeedback | whether to include the feedbacktext columns |
|
protected |
Add the state column to the $columns and $headers arrays.
array | $columns | the list of columns. Added to. |
array | $headers | the columns headings. Added to. |
|
protected |
Add all the time-related columns to the $columns and $headers arrays.
array | $columns | the list of columns. Added to. |
array | $headers | the columns headings. Added to. |
|
protected |
Add all the user-related columns to the $columns and $headers arrays.
table_sql | $table | the table being constructed. |
array | $columns | the list of columns. Added to. |
array | $headers | the columns headings. Added to. |
|
protected |
Set the display options for the user-related columns in the table.
table_sql | $table | the table being constructed. |
|
protected |
Delete the quiz attempts.
object | $quiz | the quiz settings. Attempts that don't belong to this quiz are not deleted. |
object | $cm | the course_module object. |
array | $attemptids | the list of attempt ids to delete. |
core\dml\sql_join | $allowedjoins | (joins, wheres, params) This list of userids that are visible in the report. Users can only delete attempts that they are allowed to see in the report. Empty means all users. |
Reimplemented in testable_quiz_attempts_report.
|
abstractinherited |
Override this function to displays the report.
$cm | the course-module for this quiz. |
$course | the coures we are in. |
$quiz | this quiz. |
Reimplemented in quiz_statistics_report, quiz_responses_report, quiz_overview_report, quiz_grading_report, and testable_quiz_attempts_report.
|
protected |
Get the base URL for this report.
moodle_url | the URL. |
|
inherited |
Get the current group for the user user looking at the report.
object | $cm | the course_module information. |
object | $coures | the course settings. |
context | $context | the quiz context. |
int | the current group id, if applicable. 0 for all users, NO_GROUPS_ALLOWED if the user cannot see any group. |
|
protected |
Get sql fragments (joins) which can be used to build queries that will select an appropriate set of students to show in the reports.
object | $cm | the course module. |
object | $course | the course settings. |
array | with four elements: 0 => integer the current group id (0 for none). 1 => core\dml\sql_join Contains joins, wheres, params for all the students in this course. 2 => core\dml\sql_join Contains joins, wheres, params for all the students in the current group. 3 => core\dml\sql_join Contains joins, wheres, params for all the students to show in the report. Will be the same as either element 1 or 2. |
|
protected |
Initialise various aspects of this report.
string | $mode | |
string | $formclass | |
object | $quiz | |
object | $cm | |
object | $course |
array | with four elements: 0 => integer the current group id (0 for none). 1 => core\dml\sql_join Contains joins, wheres, params for all the students in this course. 2 => core\dml\sql_join Contains joins, wheres, params for all the students in the current group. 3 => core\dml\sql_join Contains joins, wheres, params for all the students to show in the report. Will be the same as either element 1 or 2. |
|
protected |
Get information about which students to show in the report.
object | $cm | the coures module. |
object | $course | the course settings. |
array | with four elements: 0 => integer the current group id (0 for none). 1 => array ids of all the students in this course. 2 => array ids of all the students in the current group. 3 => array ids of all the students to show in the report. Will be the same as either element 1 or 2. |
|
inherited |
Initialise some parts of $PAGE and start output.
object | $cm | the course_module information. |
object | $coures | the course settings. |
object | $quiz | the quiz settings. |
string | $reportmode | the report name. |
Reimplemented in quiz_grading_report.
|
protected |
Outputs the things you commonly want at the top of a quiz report.
Calls through to print_header_and_tabs() and then outputs the standard group selector, number of attempts summary, and messages to cover common cases when the report can't be shown.
stdClass | $cm | the course_module information. |
stdClass | $course | the course settings. |
stdClass | $quiz | the quiz settings. |
mod_quiz_attempts_report_options | $options | the current report settings. |
int | $currentgroup | the current group. |
bool | $hasquestions | whether there are any questions in the quiz. |
bool | $hasstudents | whether there are any relevant students. |
|
protected |
Process any submitted actions.
object | $quiz | the quiz settings. |
object | $cm | the cm object for the quiz. |
int | $currentgroup | the currently selected group. |
core\dml\sql_join | $groupstudentsjoins | (joins, wheres, params) the students in the current group. |
core\dml\sql_join | $allowedjoins | (joins, wheres, params) the users whose attempt this user is allowed to modify. |
moodle_url | $redirecturl | where to redircet to after a successful action. |
Reimplemented in quiz_overview_report.
|
protected |
Set up the table.
table_sql | $table | the table being constructed. |
array | $columns | the list of columns. |
array | $headers | the columns headings. |
moodle_url | $reporturl | the URL of this report. |
mod_quiz_attempts_report_options | $options | the display options. |
bool | $collapsible | whether to allow columns in the report to be collapsed. |