Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
|
Public Member Functions | |
__construct ($quiz, $context, $qmsubselect, quiz_responses_options $options, core\dml\sql_join $groupstudentsjoins, core\dml\sql_join $studentsjoins, $questions, $reporturl) | |
Constructor. | |
base_sql (\core\dml\sql_join $allowedstudentsjoins) | |
Contruct all the parts of the main database query. | |
build_table () | |
checkbox_col_header (string $columnname) | |
Generates the contents for the checkbox column header. | |
col_checkbox ($attempt) | |
Generate the display of the checkbox column. | |
col_duration ($attempt) | |
Generate the display of the duration column. | |
col_feedbacktext ($attempt) | |
Generate the display of the feedback column. | |
col_fullname ($attempt) | |
Generate the display of the user's full name column. | |
col_picture ($attempt) | |
Generate the display of the user's picture column. | |
col_state ($attempt) | |
Generate the display of the attempt state column. | |
col_sumgrades ($attempt) | |
col_timefinish ($attempt) | |
Generate the display of the finish time column. | |
col_timestart ($attempt) | |
Generate the display of the start time column. | |
data_col ($slot, $field, $attempt) | |
get_row_class ($attempt) | |
get_sort_columns () | |
make_review_link ($data, $attempt, $slot) | |
Make a link to review an individual question in a popup window. | |
other_cols ($colname, $attempt) | |
query_db ($pagesize, $useinitialsbar=true) | |
set_quiz_setting (quiz_settings $quizobj) | |
A way for the report to pass in the quiz settings object. | |
setup_sql_queries ($allowedjoins) | |
Set up the SQL queries (count rows, and get data). | |
wrap_html_finish () | |
wrap_html_start () | |
Public Attributes | |
$useridfield = 'userid' | |
Protected Member Functions | |
add_grade_item_mark (int $gradeitemid) | |
Add a field marks$gradeitemid to the query, with the total score for that grade item. | |
add_latest_state_join ($slot) | |
Add the information about the latest state of the question with slot $slot to the query. | |
field_from_extra_data ($attempt, $slot, $field) | |
Column text from the extra data loaded in load_extra_data(), before html formatting etc. | |
get_qubaids_condition () | |
Get an appropriate qubaid_condition for loading more data about the attempts we are displaying. | |
get_required_latest_state_fields ($slot, $alias) | |
Get any fields that might be needed when sorting on date for a particular slot. | |
icon_for_fraction ($fraction) | |
Return an appropriate icon (green tick, red cross, etc.) for a grade. | |
is_flagged ($questionusageid, $slot) | |
Work out if a particular question in a particular attempt has been flagged. | |
is_grade_item_column (string $columnname) | |
Is this the column key for an extra grade item column? | |
is_latest_step_column ($column) | |
Is this a column that depends on joining to the latest state information? | |
load_extra_data () | |
Load any extra data after main query. | |
load_grade_item_marks () | |
Load the total mark for each grade item for each attempt. | |
load_question_latest_steps (?qubaid_condition $qubaids=null) | |
Load information about the latest state of selected questions in selected attempts. | |
requires_extra_data () | |
Does this report require loading any more data after the main query. | |
requires_latest_steps_loaded () | |
Does this report require the detailed information for each question from the question_attempts_steps table? | |
slot_fraction ($attempt, $slot) | |
Get the mark (out of 1) for the question in a particular slot. | |
slot_state ($attempt, $slot) | |
Get the question attempt state for a particular question in a particular quiz attempt. | |
submit_buttons () | |
Output any submit buttons required by the $this->includecheckboxes form. | |
update_sql_after_count ($fields, $from, $where, $params) | |
Lets subclasses modify the SQL after the count query has been created and before the full query is. | |
Protected Attributes | |
bool null | $canreopen = null |
used by { | |
context_module | $context |
the quiz context. | |
array | $displayoptions |
the display options. | |
float[][] null array | $gradeitemtotals = null |
total mark for each grade item. | |
core dml sql_join | $groupstudentsjoins |
Contains joins, wheres, params to find students in the currently selected group, if applicable. | |
bool | $includecheckboxes |
whether to include the column with checkboxes to select each attempt. | |
array | $lateststeps = null |
information about the latest step of each question. | |
stdClass | $options |
attempts_report_options the options affecting this report. | |
string | $qmsubselect |
HTML fragment to select the first/best/last attempt, if appropriate. | |
array | $questions |
the questions that comprise this quiz. | |
stdClass | $quiz |
the quiz settings for the quiz we are reporting on. | |
quiz_settings quiz_settings | $quizobj |
quiz settings object for this quiz. | |
moodle_url | $reporturl |
the URL of this report. | |
string | $strtimeformat |
strftime format. | |
core dml sql_join | $studentsjoins |
Contains joins, wheres, params to find the students in the course. | |
string | $togglegroup = 'quiz-attempts' |
The toggle group name for the checkboxes in the checkbox column. | |
quiz_last_responses_table::__construct | ( | $quiz, | |
$context, | |||
$qmsubselect, | |||
quiz_responses_options | $options, | ||
core\dml\sql_join | $groupstudentsjoins, | ||
core\dml\sql_join | $studentsjoins, | ||
$questions, | |||
$reporturl ) |
Constructor.
stdClass | $quiz | |
context | $context | |
string | $qmsubselect | |
quiz_responses_options | $options | |
core\dml\sql_join | $groupstudentsjoins | |
core\dml\sql_join | $studentsjoins | |
array | $questions | |
moodle_url | $reporturl |
|
protectedinherited |
Add a field marks$gradeitemid to the query, with the total score for that grade item.
int | $gradeitemid | the grade item to add information for. |
|
protectedinherited |
Add the information about the latest state of the question with slot $slot to the query.
The extra information is added as a join to a 'table' with alias qa$slot, with columns that are a union of the columns of the question_attempts and question_attempts_states tables.
int | $slot | the question to add information for. |
|
inherited |
Contruct all the parts of the main database query.
core\dml\sql_join | $allowedstudentsjoins | (joins, wheres, params) defines allowed users for the report. |
array | with 4 elements [$fields, $from, $where, $params] that can be used to build the actual database query. |
|
inherited |
Generates the contents for the checkbox column header.
It returns the HTML for a toggler core\output\checkbox_toggleall component that selects/deselects all quiz attempts.
string | $columnname | The name of the checkbox column. |
string |
|
inherited |
Generate the display of the checkbox column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
Reimplemented in quiz_first_or_all_responses_table.
|
inherited |
Generate the display of the duration column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
|
inherited |
Generate the display of the feedback column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
|
inherited |
Generate the display of the user's full name column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
|
inherited |
Generate the display of the user's picture column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
|
inherited |
Generate the display of the attempt state column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
Reimplemented in quiz_first_or_all_responses_table.
quiz_last_responses_table::col_sumgrades | ( | $attempt | ) |
Reimplemented in quiz_first_or_all_responses_table.
|
inherited |
Generate the display of the finish time column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
|
inherited |
Generate the display of the start time column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
|
protected |
Column text from the extra data loaded in load_extra_data(), before html formatting etc.
stdClass | $attempt | |
int | $slot | |
string | $field |
string |
Reimplemented in quiz_first_or_all_responses_table.
|
protectedinherited |
Get an appropriate qubaid_condition for loading more data about the attempts we are displaying.
qubaid_condition |
|
protected |
Get any fields that might be needed when sorting on date for a particular slot.
int | $slot | the slot for the column we want. |
string | $alias | the table alias for latest state information relating to that slot. |
string | sql fragment to alias fields. |
Reimplemented from mod_quiz\local\reports\attempts_report_table.
|
protectedinherited |
Return an appropriate icon (green tick, red cross, etc.) for a grade.
float | $fraction | grade on a scale 0..1. |
string | html fragment. |
|
protectedinherited |
Work out if a particular question in a particular attempt has been flagged.
int | $questionusageid | used to identify the attempt of interest. |
int | $slot | identifies which question in the attempt to check. |
bool | true if the question is flagged in the attempt. |
Reimplemented in quiz_first_or_all_responses_table.
|
protectedinherited |
Is this the column key for an extra grade item column?
string | $columnname | e.g. 'marks123' or 'duration'. |
int | grade item id if this is a column for showing that grade item grade, else, 0. |
|
protected |
Is this a column that depends on joining to the latest state information?
If so, return the corresponding slot. If not, return false.
string | $column | a column name |
int|false | false if no, else a slot. |
Reimplemented from mod_quiz\local\reports\attempts_report_table.
|
protectedinherited |
Load any extra data after main query.
At this point you can call {
Reimplemented in quiz_first_or_all_responses_table.
|
protectedinherited |
Load information about the latest state of selected questions in selected attempts.
The results are returned as a two-dimensional array $qubaid => $slot => $dataobject.
qubaid_condition | null | $qubaids | used to restrict which usages are included in the query. See { |
array | of records. See the SQL in this function to see the fields available. |
|
inherited |
Make a link to review an individual question in a popup window.
string | $data | HTML fragment. The text to make into the link. |
stdClass | $attempt | data for the row of the table being output. |
int | $slot | the number used to identify this question within this usage. |
Reimplemented in quiz_first_or_all_responses_table.
quiz_last_responses_table::other_cols | ( | $colname, | |
$attempt ) |
Reimplemented from mod_quiz\local\reports\attempts_report_table.
|
protected |
Does this report require loading any more data after the main query.
bool | should { |
Reimplemented from mod_quiz\local\reports\attempts_report_table.
|
protectedinherited |
Does this report require the detailed information for each question from the question_attempts_steps table?
bool | should { |
Reimplemented in quiz_overview_table.
|
inherited |
A way for the report to pass in the quiz settings object.
Currently done in {
quiz_settings | $quizobj |
|
inherited |
Set up the SQL queries (count rows, and get data).
core\dml\sql_join | $allowedjoins | (joins, wheres, params) defines allowed users for the report. |
|
protectedinherited |
Get the mark (out of 1) for the question in a particular slot.
stdClass | $attempt | the row data |
int | $slot | which slot to check. |
float | the score for this question on a scale of 0 - 1. |
Reimplemented in quiz_first_or_all_responses_table.
|
protectedinherited |
Get the question attempt state for a particular question in a particular quiz attempt.
stdClass | $attempt | the row data. |
int | $slot | indicates which question. |
question_state | the state of that question. |
Reimplemented in quiz_first_or_all_responses_table.
|
protectedinherited |
Output any submit buttons required by the $this->includecheckboxes form.
Reimplemented in quiz_overview_table.
|
protectedinherited |
Lets subclasses modify the SQL after the count query has been created and before the full query is.
string | $fields | SELECT list. |
string | $from | JOINs part of the SQL. |
string | $where | WHERE clauses. |
array | $params | Query params. |
array | with 4 elements ($fields, $from, $where, $params) as from base_sql. |
Reimplemented in quiz_overview_table.
|
protectedinherited |
used by {
|
protectedinherited |
total mark for each grade item.
Array question_usage.id => quiz_grade_item.id => mark. Loaded by {
|
protectedinherited |
information about the latest step of each question.
Loaded by {
|
protectedinherited |
quiz settings object for this quiz.
Gets set in {