Quiz report to help teachers manually grade questions that need it.
More...
|
| display ($quiz, $cm, $course) |
| Override this function to display the report.
|
|
| get_current_group ($cm, $course, $context) |
| Get the current group for the user user looking at the report.
|
|
| print_header_and_tabs ($cm, $course, $quiz, $reportmode='overview') |
| Initialise some parts of $PAGE and start output.
|
|
|
const | DEFAULT_ORDER = 'random' |
|
const | DEFAULT_PAGE_SIZE = 5 |
|
int const | NO_GROUPS_ALLOWED = -2 |
| special value used in place of groupid, to mean the use cannot access any groups.
|
|
string const | REGEX_POSITIVE_INT = '/^[1-9]\d*$/' |
| Positive integer regular expression.
|
|
|
| base_url () |
| Get the URL of the front page of the report that lists all the questions.
|
|
| display_grading_interface ($slot, $questionid, $grade, $pagesize, $page, $shownames, $showcustomfields, $order, $counts) |
| Display the UI for grading attempts at one question.
|
|
| display_index ($includeauto) |
| Display the report front page which summarises the number of attempts to grade.
|
|
| format_count_for_table ($counts, $type, $gradestring) |
| Renders the contents of one cell of the table on the index view.
|
|
| get_qubaids_condition () |
| Get the JOIN conditions needed so we only show attempts by relevant users.
|
|
| get_question_heading (stdClass $attempt, bool $shownames, bool $showcustomfields) |
| Get question heading.
|
|
| get_question_state_summary ($slots) |
| Load information about the number of attempts at various questions in each summarystate.
|
|
| get_usage_ids_where_question_in_state ($summarystate, $slot, $questionid=null, $orderby='random', $page=0, $pagesize=null) |
| Get a list of usage ids where the question with slot $slot, and optionally also with question id $questionid, is in summary state $summarystate.
|
|
| grade_question_url ($slot, $questionid, $grade, $page=true) |
| Get the URL to grade a batch of question attempts.
|
|
| list_questions_url ($includeauto=null) |
| Get the URL of the front page of the report that lists all the questions.
|
|
| load_attempts_by_usage_ids ($qubaids) |
| Load the quiz_attempts rows corresponding to a list of question_usage ids.
|
|
| process_submitted_data () |
| Save all submitted marks to the database.
|
|
| validate_submitted_marks () |
| When saving a grading page, are all the submitted marks valid?
|
|
|
stdClass | $cm |
| the course_module settings.
|
|
context | $context |
| the quiz context.
|
|
stdClass | $course |
| the course settings.
|
|
int | $currentgroup |
| the current group, 0 if none, or NO_GROUPS_ALLOWED.
|
|
array | $extrauserfields = [] |
| extra user fields.
|
|
array | $questions |
| from quiz_report_get_significant_questions.
|
|
stdClass | $quiz |
| the quiz settings.
|
|
quiz_grading_renderer | $renderer |
| Renderer of Quiz Grading.
|
|
string | $userssql |
| fragment of SQL code to restrict to the relevant users.
|
|
array | $viewoptions = [] |
| URL parameters for what is being displayed when grading.
|
|
Quiz report to help teachers manually grade questions that need it.
This report basically provides two screens:
- List question that might need manual grading (or optionally all questions).
- Provide an efficient UI to grade all attempts at a particular question.
- Copyright
- 2006 Gustav Delius
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ base_url()
quiz_grading_report::base_url |
( |
| ) |
|
|
protected |
Get the URL of the front page of the report that lists all the questions.
- Return values
-
◆ display()
quiz_grading_report::display |
( |
| $quiz, |
|
|
| $cm, |
|
|
| $course ) |
Override this function to display the report.
- Parameters
-
stdClass | $quiz | this quiz. |
stdClass | $cm | the course-module for this quiz. |
stdClass | $course | the coures we are in. |
Reimplemented from mod_quiz\local\reports\report_base.
◆ display_grading_interface()
quiz_grading_report::display_grading_interface |
( |
| $slot, |
|
|
| $questionid, |
|
|
| $grade, |
|
|
| $pagesize, |
|
|
| $page, |
|
|
| $shownames, |
|
|
| $showcustomfields, |
|
|
| $order, |
|
|
| $counts ) |
|
protected |
Display the UI for grading attempts at one question.
- Parameters
-
int | $slot | identifies which question to grade. |
int | $questionid | identifies which question to grade. |
string | $grade | type of attempts to grade. |
int | $pagesize | number of questions to show per page. |
int | $page | current page number. |
bool | $shownames | whether student names should be shown. |
bool | $showcustomfields | whether custom field values should be shown. |
string | $order | preferred order of attempts. |
stdClass | $counts | object that stores the number of each type of attempt. |
◆ display_index()
quiz_grading_report::display_index |
( |
| $includeauto | ) |
|
|
protected |
Display the report front page which summarises the number of attempts to grade.
- Parameters
-
bool | $includeauto | whether to show automatically-graded questions. |
◆ format_count_for_table()
quiz_grading_report::format_count_for_table |
( |
| $counts, |
|
|
| $type, |
|
|
| $gradestring ) |
|
protected |
Renders the contents of one cell of the table on the index view.
- Parameters
-
stdClass | $counts | counts of different types of attempt for this slot. |
string | $type | the type of count to format. |
string | $gradestring | get_string identifier for the grading link text, if required. |
- Return values
-
◆ get_current_group()
mod_quiz\local\reports\report_base::get_current_group |
( |
| $cm, |
|
|
| $course, |
|
|
| $context ) |
|
inherited |
Get the current group for the user user looking at the report.
- Parameters
-
stdClass | $cm | the course_module information. |
stdClass | $course | the course settings. |
context | $context | the quiz context. |
- Return values
-
int | the current group id, if applicable. 0 for all users, NO_GROUPS_ALLOWED if the user cannot see any group. |
◆ get_qubaids_condition()
quiz_grading_report::get_qubaids_condition |
( |
| ) |
|
|
protected |
Get the JOIN conditions needed so we only show attempts by relevant users.
- Return values
-
◆ get_question_heading()
quiz_grading_report::get_question_heading |
( |
stdClass | $attempt, |
|
|
bool | $shownames, |
|
|
bool | $showcustomfields ) |
|
protected |
Get question heading.
- Parameters
-
stdClass | $attempt | An instance of quiz_attempt. |
bool | $shownames | True to show the student first/lastnames. |
bool | $showcustomfields | Whether custom field values should be shown. |
- Return values
-
string | The string text for the question heading. |
◆ get_question_state_summary()
quiz_grading_report::get_question_state_summary |
( |
| $slots | ) |
|
|
protected |
Load information about the number of attempts at various questions in each summarystate.
The results are returned as an two dimensional array $qubaid => $slot => $dataobject
- Parameters
-
array | $slots | A list of slots for the questions you want to konw about. |
- Return values
-
array | The array keys are slot,qestionid. The values are objects with fields $slot, $questionid, $inprogress, $name, $needsgrading, $autograded, $manuallygraded and $all. |
◆ get_usage_ids_where_question_in_state()
quiz_grading_report::get_usage_ids_where_question_in_state |
( |
| $summarystate, |
|
|
| $slot, |
|
|
| $questionid = null, |
|
|
| $orderby = 'random', |
|
|
| $page = 0, |
|
|
| $pagesize = null ) |
|
protected |
Get a list of usage ids where the question with slot $slot, and optionally also with question id $questionid, is in summary state $summarystate.
Also return the total count of such states.
Only a subset of the ids can be returned by using $orderby, $limitfrom and $limitnum. A special value 'random' can be passed as $orderby, in which case $limitfrom is ignored.
- Parameters
-
int | $slot | The slot for the questions you want to konw about. |
int | $questionid | (optional) Only return attempts that were of this specific question. |
string | $summarystate | 'all', 'needsgrading', 'autograded' or 'manuallygraded'. |
string | $orderby | 'random', 'date', 'student' or 'idnumber'. |
int | $page | implements paging of the results. Ignored if $orderby = random or $pagesize is null. |
int | $pagesize | implements paging of the results. null = all. |
- Return values
-
array | with two elements, an array of usage ids, and a count of the total number. |
◆ grade_question_url()
quiz_grading_report::grade_question_url |
( |
| $slot, |
|
|
| $questionid, |
|
|
| $grade, |
|
|
| $page = true ) |
|
protected |
Get the URL to grade a batch of question attempts.
- Parameters
-
int | $slot | |
int | $questionid | |
string | $grade | |
int | bool | $page | = true, link to current page. false = omit page. number = link to specific page. |
- Return values
-
◆ list_questions_url()
quiz_grading_report::list_questions_url |
( |
| $includeauto = null | ) |
|
|
protected |
Get the URL of the front page of the report that lists all the questions.
- Parameters
-
bool | $includeauto | if not given, use the current setting, otherwise, force a particular value of includeauto in the URL. |
- Return values
-
◆ load_attempts_by_usage_ids()
quiz_grading_report::load_attempts_by_usage_ids |
( |
| $qubaids | ) |
|
|
protected |
Load the quiz_attempts rows corresponding to a list of question_usage ids.
- Parameters
-
int[] | $qubaids | the question_usage ids of the quiz_attempts to load. |
- Return values
-
array | quiz attempts, with added user name fields. |
◆ print_header_and_tabs()
quiz_grading_report::print_header_and_tabs |
( |
| $cm, |
|
|
| $course, |
|
|
| $quiz, |
|
|
| $reportmode = 'overview' ) |
Initialise some parts of $PAGE and start output.
- Parameters
-
stdClass | $cm | the course_module information. |
stdClass | $course | the course settings. |
stdClass | $quiz | the quiz settings. |
string | $reportmode | the report name. |
Reimplemented from mod_quiz\local\reports\report_base.
◆ process_submitted_data()
quiz_grading_report::process_submitted_data |
( |
| ) |
|
|
protected |
Save all submitted marks to the database.
- Return values
-
bool | returns true if some attempts or all are graded. False, if none of the attempts are graded. |
◆ validate_submitted_marks()
quiz_grading_report::validate_submitted_marks |
( |
| ) |
|
|
protected |
When saving a grading page, are all the submitted marks valid?
- Return values
-
bool | true if all valid, else false. |
The documentation for this class was generated from the following file: