Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 310] [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

This file defines the quiz manual grading report class.

Copyright: 2006 Gustav Delius
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 683 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: quiz_grading_report  - X-Ref

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.

display($quiz, $cm, $course)   X-Ref
No description

get_qubaids_condition()   X-Ref
Get the JOIN conditions needed so we only show attempts by relevant users.

return: qubaid_join

load_attempts_by_usage_ids($qubaids)   X-Ref
Load the quiz_attempts rows corresponding to a list of question_usage ids.

param: int[] $qubaids the question_usage ids of the quiz_attempts to load.
return: array quiz attempts, with added user name fields.

base_url()   X-Ref
Get the URL of the front page of the report that lists all the questions.

return: moodle_url the URL.

list_questions_url($includeauto = null)   X-Ref
Get the URL of the front page of the report that lists all the questions.

param: bool $includeauto if not given, use the current setting, otherwise,
return: moodle_url the URL.

grade_question_url($slot, $questionid, $grade, $page = true)   X-Ref
Get the URL to grade a batch of question attempts.

param: int $slot
param: int $questionid
param: string $grade
param: int|bool $page = true, link to current page. false = omit page.
return: moodle_url

format_count_for_table($counts, $type, $gradestring)   X-Ref
Renders the contents of one cell of the table on the index view.

param: stdClass $counts counts of different types of attempt for this slot.
param: string $type the type of count to format.
param: string $gradestring get_string identifier for the grading link text, if required.
return: string HTML.

display_index($includeauto)   X-Ref
Display the report front page which summarises the number of attempts to grade.

param: bool $includeauto whether to show automatically-graded questions.

display_grading_interface($slot, $questionid, $grade,$pagesize, $page, $shownames, $showidnumbers, $order, $counts)   X-Ref
Display the UI for grading attempts at one question.

param: int $slot identifies which question to grade.
param: int $questionid identifies which question to grade.
param: string $grade type of attempts to grade.
param: int $pagesize number of questions to show per page.
param: int $page current page number.
param: bool $shownames whether student names should be shown.
param: bool $showidnumbers wither student idnumbers should be shown.
param: string $order preferred order of attempts.
param: stdClass $counts object that stores the number of each type of attempt.

validate_submitted_marks()   X-Ref
When saving a grading page, are all the submitted marks valid?

return: bool true if all valid, else false.

process_submitted_data()   X-Ref
Save all submitted marks to the database.


get_question_state_summary($slots)   X-Ref
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

param: array $slots A list of slots for the questions you want to konw about.
return: array The array keys are slot,qestionid. The values are objects with

get_usage_ids_where_question_in_state($summarystate, $slot,$questionid = null, $orderby = 'random', $page = 0, $pagesize = null)   X-Ref
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.

param: int $slot The slot for the questions you want to konw about.
param: int $questionid (optional) Only return attempts that were of this specific question.
param: string $summarystate 'all', 'needsgrading', 'autograded' or 'manuallygraded'.
param: string $orderby 'random', 'date', 'student' or 'idnumber'.
param: int $page implements paging of the results.
param: int $pagesize implements paging of the results. null = all.
return: array with two elements, an array of usage ids, and a count of the total number.

print_header_and_tabs($cm, $course, $quiz, $reportmode = 'overview')   X-Ref
Initialise some parts of $PAGE and start output.

param: object $cm the course_module information.
param: object $course the course settings.
param: object $quiz the quiz settings.
param: string $reportmode the report name.

get_question_heading($attempt, $shownames, $showidnumbers)   X-Ref
Get question heading.

param: object $attempt an instance of quiz_attempt.
param: bool $shownames True to show the question name.
param: bool $showidnumbers True to show the question id number.
return: string The string text for the question heading.