Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
|
This is a table subclass for displaying the quiz responses report, showing first or all tries. More...
Public Member Functions | |
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 ($tablerow) | |
Generate the display of the checkbox column. | |
col_duration ($attempt) | |
Generate the display of the duration column. | |
col_email ($tablerow) | |
Cell value function for email 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 ($tablerow) | |
Generate the display of the attempt state column. | |
col_sumgrades ($tablerow) | |
Cell value function for sumgrades column. | |
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_no_of_tries ($tablerow, $slot) | |
How many tries were attempted at this question in this slot, during this usage? | |
get_row_class ($tablerow) | |
get_sort_columns () | |
get_summary_after_try ($tablerow, $slot) | |
Get the summary of the response after the try. | |
make_review_link ($data, $tablerow, $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 ($tablerow, $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_question_attempt ($questionusagesid, $slot) | |
Return the question attempt object. | |
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) | |
Has this question usage been flagged? | |
is_grade_item_column (string $columnname) | |
Is this the column key for an extra grade item column? | |
is_last_try ($tablerow, $slot, $tryno) | |
Is this the last try in the question attempt? | |
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 ($tablerow, $slot) | |
The grade for this slot after this try. | |
slot_state ($tablerow, $slot) | |
Find the state for $slot given after this try. | |
step_no_for_try ($questionusageid, $slot, $tryno) | |
What is the step no this try was seen in? | |
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. | |
question_usage_by_activity[] | $questionusagesbyactivity |
The full question usage object for each try shown in report. | |
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. | |
This is a table subclass for displaying the quiz responses report, showing first or all tries.
|
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 master core\output\checkbox_toggleall component that selects/deselects all quiz attempts.
string | $columnname | The name of the checkbox column. |
string |
quiz_first_or_all_responses_table::col_checkbox | ( | $attempt | ) |
Generate the display of the checkbox column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
Reimplemented from mod_quiz\local\reports\attempts_report_table.
|
inherited |
Generate the display of the duration column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
quiz_first_or_all_responses_table::col_email | ( | $tablerow | ) |
Cell value function for email column.
This extracts the contents for any cell in the email column from the row data.
stdClass | $tablerow | Row data. |
string | What to put in the cell for this column, for this row data. |
|
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. |
quiz_first_or_all_responses_table::col_state | ( | $attempt | ) |
Generate the display of the attempt state column.
stdClass | $attempt | the table row being output. |
string | HTML content to go inside the td. |
Reimplemented from mod_quiz\local\reports\attempts_report_table.
quiz_first_or_all_responses_table::col_sumgrades | ( | $tablerow | ) |
Cell value function for sumgrades column.
This extracts the contents for any cell in the sumgrades column from the row data.
stdClass | $tablerow | Row data. |
string | What to put in the cell for this column, for this row data. |
Reimplemented from quiz_last_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 from quiz_last_responses_table.
quiz_first_or_all_responses_table::get_no_of_tries | ( | $tablerow, | |
$slot ) |
How many tries were attempted at this question in this slot, during this usage?
stdClass | $tablerow | attempt data from db. |
int | $slot | Slot number |
int | the number of tries in the question attempt for slot $slot. |
|
protectedinherited |
Get an appropriate qubaid_condition for loading more data about the attempts we are displaying.
qubaid_condition |
|
protected |
Return the question attempt object.
int | $questionusagesid | |
int | $slot |
question_attempt |
|
protectedinherited |
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.
quiz_first_or_all_responses_table::get_row_class | ( | $tablerow | ) |
Reimplemented from mod_quiz\local\reports\attempts_report_table.
quiz_first_or_all_responses_table::get_summary_after_try | ( | $tablerow, | |
$slot ) |
Get the summary of the response after the try.
stdClass | $tablerow | row data |
int | $slot | Slot number. |
string | summary for the question after this try. |
|
protectedinherited |
Return an appropriate icon (green tick, red cross, etc.) for a grade.
float | $fraction | grade on a scale 0..1. |
string | html fragment. |
|
protected |
Has this question usage been flagged?
int | $questionusageid | Question usage id. |
int | $slot | Slot number |
bool | Has it been flagged? |
Reimplemented from mod_quiz\local\reports\attempts_report_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 the last try in the question attempt?
stdClass | $tablerow | attempt data from db. |
int | $slot | Slot number |
int | $tryno | try no |
bool | Is it the last try? |
|
protectedinherited |
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.
|
protected |
Load any extra data after main query.
At this point you can call {
Reimplemented from mod_quiz\local\reports\attempts_report_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. |
quiz_first_or_all_responses_table::make_review_link | ( | $data, | |
$attempt, | |||
$slot ) |
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 from mod_quiz\local\reports\attempts_report_table.
|
inherited |
Reimplemented from mod_quiz\local\reports\attempts_report_table.
|
protectedinherited |
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. |
|
protected |
The grade for this slot after this try.
stdClass | $tablerow | attempt data from db. |
int | $slot | Slot number. |
float | The fraction. |
Reimplemented from mod_quiz\local\reports\attempts_report_table.
|
protected |
Find the state for $slot given after this try.
stdClass | $tablerow | row data |
int | $slot | Slot number. |
question_state | The question state after the attempt. |
Reimplemented from mod_quiz\local\reports\attempts_report_table.
|
protected |
What is the step no this try was seen in?
int | $questionusageid | The question usage id. |
int | $slot | Slot number |
int | $tryno | Try no |
int | the step no or zero if not found |
|
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 {