From 178bed033a20e64ec3d85db9b8fc03c3f07303c0 Mon Sep 17 00:00:00 2001 From: Mathew May Date: Tue, 27 Feb 2024 12:57:06 +0800 Subject: [PATCH] MDL-79863 qtype_ordering: Remove PHPDocs from overridden blocks --- .../classes/output/correct_response.php | 7 - .../type/ordering/classes/output/feedback.php | 16 +- .../output/formulation_and_controls.php | 16 +- .../classes/output/num_parts_correct.php | 7 - .../classes/output/renderable_base.php | 9 +- .../output/specific_grade_detail_feedback.php | 7 - .../ordering/classes/privacy/provider.php | 9 +- .../classes/question_hint_ordering.php | 6 - question/type/ordering/edit_ordering_form.php | 39 ----- question/type/ordering/question.php | 153 +----------------- question/type/ordering/questiontype.php | 119 -------------- question/type/ordering/renderer.php | 59 ------- 12 files changed, 18 insertions(+), 429 deletions(-) diff --git a/question/type/ordering/classes/output/correct_response.php b/question/type/ordering/classes/output/correct_response.php index 95aaa0161dc..f654bee237f 100644 --- a/question/type/ordering/classes/output/correct_response.php +++ b/question/type/ordering/classes/output/correct_response.php @@ -24,13 +24,6 @@ namespace qtype_ordering\output; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class correct_response extends renderable_base { - - /** - * Based on the question and step state, create an array for the correct response. - * - * @param \renderer_base $output renderer to be used to render the action bar elements. - * @return array - */ public function export_for_template(\renderer_base $output): array { $data = []; diff --git a/question/type/ordering/classes/output/feedback.php b/question/type/ordering/classes/output/feedback.php index 759452ec4e2..f865f96b216 100644 --- a/question/type/ordering/classes/output/feedback.php +++ b/question/type/ordering/classes/output/feedback.php @@ -29,9 +29,6 @@ use question_display_options; */ class feedback extends renderable_base { - /** @var question_display_options $options The question options. */ - protected $options; - /** * Define the feedback with options for display. * @@ -39,17 +36,14 @@ class feedback extends renderable_base { * @param question_display_options $options Controls what should and should not be displayed * via question_display_options but unit tests are fickle. */ - public function __construct(question_attempt $qa, question_display_options $options) { + public function __construct( + question_attempt $qa, + /** @var question_display_options The question display options. */ + protected question_display_options $options + ) { parent::__construct($qa); - $this->options = $options; } - /** - * Build the feedback array which is used to render the feedback. - * - * @param renderer_base $output renderer to be used to render the feedback elements. - * @return array - */ public function export_for_template(renderer_base $output): array { global $PAGE; diff --git a/question/type/ordering/classes/output/formulation_and_controls.php b/question/type/ordering/classes/output/formulation_and_controls.php index b09d76b8970..800e4964cd7 100644 --- a/question/type/ordering/classes/output/formulation_and_controls.php +++ b/question/type/ordering/classes/output/formulation_and_controls.php @@ -28,26 +28,20 @@ use question_display_options; */ class formulation_and_controls extends renderable_base { - /** @var question_display_options $options The question options. */ - protected $options; - /** * Construct the rendarable as we also need to pass the question options. * * @param question_attempt $qa The question attempt object. * @param question_display_options $options The question options. */ - public function __construct(question_attempt $qa, question_display_options $options) { - $this->options = $options; + public function __construct( + question_attempt $qa, + /** @var question_display_options The question display options. */ + protected question_display_options $options + ) { parent::__construct($qa); } - /** - * Export the question based on the question attempt and the question display options. - * - * @param \renderer_base $output renderer to be used to render the action bar elements. - * @return array - */ public function export_for_template(\renderer_base $output): array { global $PAGE; diff --git a/question/type/ordering/classes/output/num_parts_correct.php b/question/type/ordering/classes/output/num_parts_correct.php index 854c534d01f..a27b612d8bd 100644 --- a/question/type/ordering/classes/output/num_parts_correct.php +++ b/question/type/ordering/classes/output/num_parts_correct.php @@ -24,13 +24,6 @@ namespace qtype_ordering\output; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class num_parts_correct extends renderable_base { - - /** - * Based on the latest step, get the number of correct, partial, and incorrect parts of the question. - * - * @param \renderer_base $output The output renderer. - * @return array - */ public function export_for_template(\renderer_base $output): array { list($numright, $numpartial, $numincorrect) = $this->qa->get_question()->get_num_parts_right( diff --git a/question/type/ordering/classes/output/renderable_base.php b/question/type/ordering/classes/output/renderable_base.php index 383695bcbd5..926144c770a 100644 --- a/question/type/ordering/classes/output/renderable_base.php +++ b/question/type/ordering/classes/output/renderable_base.php @@ -29,15 +29,14 @@ use question_attempt; */ abstract class renderable_base implements templatable, renderable { - /** @var question_attempt $qa The question attempt object. */ - protected $qa; - /** * The class constructor. * * @param question_attempt $qa The question attempt object. */ - public function __construct(question_attempt $qa) { - $this->qa = $qa; + public function __construct( + /** @var question_attempt The question attempt object. */ + protected question_attempt $qa, + ) { } } diff --git a/question/type/ordering/classes/output/specific_grade_detail_feedback.php b/question/type/ordering/classes/output/specific_grade_detail_feedback.php index 55662f91c7a..983fe70d57e 100644 --- a/question/type/ordering/classes/output/specific_grade_detail_feedback.php +++ b/question/type/ordering/classes/output/specific_grade_detail_feedback.php @@ -26,13 +26,6 @@ use qtype_ordering_question; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class specific_grade_detail_feedback extends renderable_base { - - /** - * Based on the current state and the question options, generate the feedback. - * - * @param \renderer_base $output renderer to be used to render the action bar elements. - * @return array - */ public function export_for_template(\renderer_base $output): array { $data = []; diff --git a/question/type/ordering/classes/privacy/provider.php b/question/type/ordering/classes/privacy/provider.php index 0f77ab9729c..f95d77022d7 100644 --- a/question/type/ordering/classes/privacy/provider.php +++ b/question/type/ordering/classes/privacy/provider.php @@ -23,16 +23,9 @@ namespace qtype_ordering\privacy; * @copyright 2013 Gordon Bateson (gordon.bateson@gmail.com) * @author rdebleu@eWallah.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @codeCoverageIgnore A null provider so no special handling for us. */ class provider implements \core_privacy\local\metadata\null_provider { - - /** - * Get the language string identifier with the component's language - * file to explain why this plugin stores no data. - * - * @return string - * @codeCoverageIgnore A null provider so no special handling for us. - */ public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/question/type/ordering/classes/question_hint_ordering.php b/question/type/ordering/classes/question_hint_ordering.php index a884a10a268..f6c2fc5e430 100644 --- a/question/type/ordering/classes/question_hint_ordering.php +++ b/question/type/ordering/classes/question_hint_ordering.php @@ -50,12 +50,6 @@ class question_hint_ordering extends question_hint_with_parts { $this->highlightresponse = $highlightresponse; } - /** - * Create a basic hint from a row loaded from the question_hints table in the database. - * - * @param object $row With property options as well as hint, shownumcorrect and clearwrong set. - * @return question_hint_ordering - */ public static function load_from_record($row): question_hint_ordering { global $DB; diff --git a/question/type/ordering/edit_ordering_form.php b/question/type/ordering/edit_ordering_form.php index f5e6570c35a..6a9c94b6b36 100644 --- a/question/type/ordering/edit_ordering_form.php +++ b/question/type/ordering/edit_ordering_form.php @@ -44,11 +44,6 @@ class qtype_ordering_edit_form extends question_edit_form { /** Number of answers to add on demand */ const NUM_ITEMS_ADD = 1; - /** - * qtype is plugin name without leading "qtype_" - * - * @return string - */ public function qtype(): string { return 'ordering'; } @@ -62,11 +57,6 @@ class qtype_ordering_edit_form extends question_edit_form { return 'qtype_ordering'; } - /** - * Add question-type specific form fields. - * - * @param MoodleQuickForm $mform the form being built. - */ public function definition_inner($mform): void { // Cache this plugins name. @@ -275,13 +265,6 @@ class qtype_ordering_edit_form extends question_edit_form { } } - /** - * Create the form elements required by one hint. - * - * @param string $withclearwrong Whether this quesiton type uses the 'Clear wrong' option on hints. - * @param string $withshownumpartscorrect Whether this quesiton type uses the 'Show num parts correct' option on hints. - * @return array Form field elements for one hint. - */ protected function get_hint_fields($withclearwrong = false, $withshownumpartscorrect = false): array { $mform = $this->_form; @@ -308,12 +291,6 @@ class qtype_ordering_edit_form extends question_edit_form { return [$repeated, $repeatedoptions]; } - /** - * Perform any preprocessing needed on the data passed to {@see set_data()} - * before it is used to initialise the form. - * @param object $question the data being passed to the form. - * @return stdClass $question the modified data. - */ public function data_preprocessing($question): stdClass { $question = parent::data_preprocessing($question); @@ -377,14 +354,6 @@ class qtype_ordering_edit_form extends question_edit_form { return $question; } - /** - * Perform the necessary preprocessing for the hint fields. - * - * @param object $question The data being passed to the form. - * @param bool $withclearwrong Clear wrong hints. - * @param bool $withshownumpartscorrect Show number correct. - * @return stdClass The modified data. - */ protected function data_preprocessing_hints($question, $withclearwrong = false, $withshownumpartscorrect = false): stdClass { if (empty($question->hints)) { return $question; @@ -399,14 +368,6 @@ class qtype_ordering_edit_form extends question_edit_form { return $question; } - /** - * Form validation - * - * @param array $data array of ("fieldname"=>value) of submitted data - * @param array $files array of uploaded files "element_name"=>tmp_file_path - * @return array of "element_name"=>"error_description" if there are errors, - * or an empty array if everything is OK (true allowed for backwards compatibility too). - */ public function validation($data, $files): array { $errors = []; $plugin = 'qtype_ordering'; diff --git a/question/type/ordering/question.php b/question/type/ordering/question.php index 2b8944be5a2..8ed6afee37c 100644 --- a/question/type/ordering/question.php +++ b/question/type/ordering/question.php @@ -104,22 +104,6 @@ class qtype_ordering_question extends question_graded_automatically { /** @var array of scored for every item */ protected $itemscores = []; - /** - * Start a new attempt at this question, storing any information that will - * be needed later in the step. - * - * This is where the question can do any initialisation required on a - * per-attempt basis. For example, this is where the multiple choice - * question type randomly shuffles the choices (if that option is set). - * - * Any information about how the question has been set up for this attempt - * should be stored in the $step, by calling $step->set_qt_var(...). - * - * @param question_attempt_step $step The first step of the {@see question_attempt} - * being started. Can be used to store state. - * @param int $variant which variant of this question to start. Will be between - * 1 and {@see get_num_variants()} inclusive. - */ public function start_attempt(question_attempt_step $step, $variant) { $countanswers = count($this->answers); @@ -168,33 +152,11 @@ class qtype_ordering_question extends question_graded_automatically { $step->set_qt_var('_currentresponse', implode(',', $this->currentresponse)); } - /** - * When an in-progress {@see question_attempt} is re-loaded from the - * database, this method is called so that the question can re-initialise - * its internal state as needed by this attempt. - * - * For example, the multiple choice question type needs to set the order - * of the choices to the order that was set up when start_attempt was called - * originally. All the information required to do this should be in the - * $step object, which is the first step of the question_attempt being loaded. - * - * @param question_attempt_step $step The first step of the {@see question_attempt} - * being loaded. - */ public function apply_attempt_state(question_attempt_step $step) { $this->currentresponse = array_filter(explode(',', $step->get_qt_var('_currentresponse'))); $this->correctresponse = array_filter(explode(',', $step->get_qt_var('_correctresponse'))); } - /** - * When a question is updated to a new version, this method is called to - * check whether the question can be regraded with the new version. - * - * @param question_definition $otherversion The new version of the question. - * @return string|null If the question can be regraded, this method should return null. - * If the question cannot be regraded, this method should return a string - * explaining why not. - */ public function validate_can_regrade_with_other_version(question_definition $otherversion): ?string { $basemessage = parent::validate_can_regrade_with_other_version($otherversion); if ($basemessage) { @@ -208,22 +170,11 @@ class qtype_ordering_question extends question_graded_automatically { return null; } - /** - * Update the attempt state data for a new version of the question. - * - * This method is called when a question is updated to a new version, and - * the question_attempt_step data needs to be updated to reflect the new - * version of the question. - * - * @param question_attempt_step $oldstep The step data for the old version of the question. - * @param question_definition $otherversion The new version of the question. - * @return array An array of key-value pairs to be merged into the step data. - */ public function update_attempt_state_data_for_new_version( - question_attempt_step $oldstep, question_definition $otherversion) { - parent::update_attempt_state_data_for_new_version($oldstep, $otherversion); + question_attempt_step $oldstep, question_definition $oldquestion) { + parent::update_attempt_state_data_for_new_version($oldstep, $oldquestion); - $mapping = array_combine(array_keys($otherversion->answers), array_keys($this->answers)); + $mapping = array_combine(array_keys($oldquestion->answers), array_keys($this->answers)); $oldorder = explode(',', $oldstep->get_qt_var('_currentresponse')); $neworder = []; @@ -243,30 +194,11 @@ class qtype_ordering_question extends question_graded_automatically { ]; } - /** - * What data may be included in the form submission when a student submits - * this question in its current state? - * - * This information is used in calls to optional_param. The parameter name - * has {@see question_attempt::get_field_prefix()} automatically prepended. - * - * @return array|string variable name => PARAM_... constant, or, as a special case - * that should only be used in unavoidable, the constant question_attempt::USE_RAW_DATA - * meaning take all the raw submitted data belonging to this question. - */ public function get_expected_data() { $name = $this->get_response_fieldname(); return [$name => PARAM_TEXT]; } - /** - * What data would need to be submitted to get this question correct. - * If there is more than one correct answer, this method should just - * return one possibility. If it is not possible to compute a correct - * response, this method should return null. - * - * @return array|null parameter name => value. - */ public function get_correct_response() { $correctresponse = $this->correctresponse; foreach ($correctresponse as $position => $answerid) { @@ -277,12 +209,6 @@ class qtype_ordering_question extends question_graded_automatically { return [$name => implode(',', $correctresponse)]; } - /** - * Produce a plain text summary of a response. - * - * @param array $response a response, as might be passed to {@see grade_response()}. - * @return string a plain text summary of that response, that could be used in reports. - */ public function summarise_response(array $response) { $name = $this->get_response_fieldname(); $items = []; @@ -306,14 +232,6 @@ class qtype_ordering_question extends question_graded_automatically { return implode('; ', array_filter($items)); } - /** - * Categorise the student's response according to the categories defined by - * get_possible_responses. - * - * @param array $response a response, as might be passed to {@see grade_response()}. - * @return array subpartid => {@see question_classified_response} objects. - * returns an empty array if no analysis is possible. - */ public function classify_response(array $response) { $this->update_current_response($response); $fraction = 1 / count($this->correctresponse); @@ -349,68 +267,23 @@ class qtype_ordering_question extends question_graded_automatically { return $classifiedresponse; } - /** - * Used by many of the behaviours, to work out whether the student's - * response to the question is complete. That is, whether the question attempt - * should move to the COMPLETE or INCOMPLETE state. - * - * @param array $response responses, as returned by - * {@see question_attempt_step::get_qt_data()}. - * @return bool whether this response is a complete answer to this question. - */ public function is_complete_response(array $response) { return true; } - /** - * Use by many of the behaviours to determine whether the student - * has provided enough of an answer for the question to be graded automatically, - * or whether it must be considered aborted. - * - * @param array $response responses, as returned by - * {@see question_attempt_step::get_qt_data()}. - * @return bool whether this response can be graded. - */ public function is_gradable_response(array $response) { return true; } - /** - * In situations where is_gradable_response() returns false, this method - * should generate a description of what the problem is. - * - * @param array $response - * @return string the message - */ public function get_validation_error(array $response) { return ''; } - /** - * Use by many of the behaviours to determine whether the student's - * response has changed. This is normally used to determine that a new set - * of responses can safely be discarded. - * - * @param array $old the responses previously recorded for this question, - * as returned by {@see question_attempt_step::get_qt_data()} - * @param array $new the new responses, in the same format. - * @return bool whether the two sets of responses are the same - that is - * whether the new set of responses can safely be discarded. - */ public function is_same_response(array $old, array $new) { $name = $this->get_response_fieldname(); return (isset($old[$name]) && isset($new[$name]) && $old[$name] == $new[$name]); } - /** - * Grade a response to the question, returning a fraction between - * get_min_fraction() and get_max_fraction(), and the corresponding {@see question_state} - * right, partial or wrong. - * - * @param array $response responses, as returned by - * {@see question_attempt_step::get_qt_data()}. - * @return array (float, integer) the fraction, and the state. - */ public function grade_response(array $response) { $this->update_current_response($response); @@ -506,17 +379,6 @@ class qtype_ordering_question extends question_graded_automatically { ]; } - /** - * Checks whether the user has permission to access a particular file. - * - * @param question_attempt $qa the question attempt being displayed. - * @param question_display_options $options the options that control display of the question. - * @param string $component the name of the component we are serving files for. - * @param string $filearea the name of the file area. - * @param array $args the remaining bits of the file path. - * @param bool $forcedownload whether the user must be forced to download the file. - * @return bool true if the user can access this file. - */ public function check_file_access($qa, $options, $component, $filearea, $args, $forcedownload) { if ($component == 'question') { if ($filearea == 'answer') { @@ -533,15 +395,6 @@ class qtype_ordering_question extends question_graded_automatically { return parent::check_file_access($qa, $options, $component, $filearea, $args, $forcedownload); } - /** - * Checks whether the user has permission to access a particular file. - * - * @param question_attempt $qa the question attempt being displayed. - * @param question_display_options $options the options that control display of the question. - * @param string $filearea the name of the file area. - * @param array $args the remaining bits of the file path. - * @return bool whether access to the file should be allowed. - */ protected function check_combined_feedback_file_access($qa, $options, $filearea, $args = null) { $state = $qa->get_state(); if (! $state->is_finished()) { diff --git a/question/type/ordering/questiontype.php b/question/type/ordering/questiontype.php index 11a1e02e3a7..51838cac778 100644 --- a/question/type/ordering/questiontype.php +++ b/question/type/ordering/questiontype.php @@ -32,22 +32,12 @@ class qtype_ordering extends question_type { public array $feedbackfields = ['correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback']; /** - * @return bool whether the question_answers.answer field needs to have - * restore_decode_content_links_worker called on it. * @CodeCoverageIgnore */ public function has_html_answers(): bool { return true; } - /** - * If your question type has a table that extends the question table, and - * you want the base class to automatically save, backup and restore the extra fields, - * override this method to return an array where the first element is the table name, - * and the subsequent entries are the column names (apart from id and questionid). - * - * @return array extra fields - */ public function extra_question_fields(): array { return [ 'qtype_ordering_options', @@ -56,11 +46,6 @@ class qtype_ordering extends question_type { ]; } - /** - * Initialise the common question_definition fields. - * @param question_definition $question the question_definition we are creating. - * @param object $questiondata the question data loaded from the database. - */ protected function initialise_question_instance(question_definition $question, $questiondata): void { global $CFG; @@ -74,15 +59,6 @@ class qtype_ordering extends question_type { $this->initialise_combined_feedback($question, $questiondata, true); } - /** - * Saves question-type specific options - * - * This is called by {@see save_question()} to save the question-type specific data - * - * @param object $question This holds the information from the editing form, - * it is not a standard question object. - * @return bool|stdClass $result->error or $result->notice - */ public function save_question_options($question): bool|stdClass { global $DB; @@ -227,13 +203,6 @@ class qtype_ordering extends question_type { return true; } - /** - * Count number of hints on the form. - * - * @param object $formdata The data from the form. - * @param bool $withparts Whether to take into account clearwrong and shownumcorrect options. - * @return int Count of hints on the form. - */ protected function count_hints_on_form($formdata, $withparts): int { $numhints = parent::count_hints_on_form($formdata, $withparts); @@ -244,69 +213,19 @@ class qtype_ordering extends question_type { return $numhints; } - /** - * Determine if the hint with specified number is not empty and should be saved. - * Overload if you use custom hint controls. - * - * @param object $formdata the data from the form. - * @param int $number number of hint under question. - * @param bool $withparts whether to take into account clearwrong and shownumcorrect options. - * @return bool is this particular hint data empty. - */ protected function is_hint_empty_in_form_data($formdata, $number, $withparts): bool { return parent::is_hint_empty_in_form_data($formdata, $number, $withparts) && empty($formdata->hintoptions[$number]); } - /** - * Save additional question type data into the hint optional field. - * Overload if you use custom hint information. - * @param object $formdata the data from the form. - * @param int $number number of hint to get options from. - * @param bool $withparts whether question have parts. - * @return bool value to save into the options field of question_hints table. - */ protected function save_hint_options($formdata, $number, $withparts): bool { return !empty($formdata->hintoptions[$number]); } - /** - * Create a question_hint, or an appropriate subclass for this question, from a row loaded from the database. - * - * @param object $hint The DB row from the question hints table. - * @return question_hint_ordering Hints of question from record. - */ protected function make_hint($hint): question_hint_ordering { return question_hint_ordering::load_from_record($hint); } - /** - * This method should return all the possible types of response that are - * recognised for this question. - * - * The question is modelled as comprising one or more subparts. For each - * subpart, there are one or more classes that that students response - * might fall into, each of those classes earning a certain score. - * - * For example, in a shortanswer question, there is only one subpart, the - * text entry field. The response the student gave will be classified according - * to which of the possible $question->options->answers it matches. - * - * For the matching question type, there will be one subpart for each - * question stem, and for each stem, each of the possible choices is a class - * of student's response. - * - * A response is an object with two fields, ->responseclass is a string - * presentation of that response, and ->fraction, the credit for a response - * in that class. - * - * Array keys have no specific meaning, but must be unique, and must be - * the same if this function is called repeatedly. - * - * @param object $questiondata the question definition data. - * @return array keys are subquestionid, values are arrays of possible - * responses to that subquestion. - */ public function get_possible_responses($questiondata): array { $responseclasses = []; $itemcount = count($questiondata->options->answers); @@ -343,18 +262,6 @@ class qtype_ordering extends question_type { return ($value || $value === '0'); } - /** - * Loads the question type specific options for the question. - * - * This function loads any question type specific options for the - * question from the database into the question object. This information - * is placed in the $question->options field. A question type is - * free, however, to decide on an internal structure of the options field. - * @return bool Indicates success or failure. - * @param object $question The question object for the question. This object - * should be updated to include the question type - * specific information (it is passed by reference). - */ public function get_question_options($question): bool { global $DB, $OUTPUT; @@ -376,12 +283,6 @@ class qtype_ordering extends question_type { return true; } - /** - * Deletes the question-type specific data when a question is deleted. - * - * @param int $questionid The id of question being deleted. - * @param int $contextid the context this quesiotn belongs to. - */ public function delete_question($questionid, $contextid): void { global $DB; $DB->delete_records('qtype_ordering_options', ['questionid' => $questionid]); @@ -651,14 +552,6 @@ class qtype_ordering extends question_type { return $output; } - /** - * Exports question to XML format - * - * @param object $question - * @param qformat_xml $format - * @param string $extra (optional, default=null) - * @return string XML representation of question - */ public function export_to_xml($question, qformat_xml $format, $extra = null): string { global $CFG; require_once($CFG->dirroot.'/question/type/ordering/question.php'); @@ -696,18 +589,6 @@ class qtype_ordering extends question_type { return $output; } - /** - * Imports question from the Moodle XML format - * - * Imports question using information from extra_question_fields function - * If some of you fields contains id's you'll need to reimplement this - * - * @param array $data - * @param qtype_ordering $question (or null) - * @param qformat_xml $format - * @param null $extra (optional, default=null) - * @return object|bool New question object - */ public function import_from_xml($data, $question, qformat_xml $format, $extra = null): object|bool { global $CFG; require_once($CFG->dirroot.'/question/type/ordering/question.php'); diff --git a/question/type/ordering/renderer.php b/question/type/ordering/renderer.php index a6c41661458..d6ee93b3ce5 100644 --- a/question/type/ordering/renderer.php +++ b/question/type/ordering/renderer.php @@ -29,35 +29,12 @@ use qtype_ordering\output\specific_grade_detail_feedback; */ class qtype_ordering_renderer extends qtype_with_combined_feedback_renderer { - /** - * Generate the display of the formulation part of the question. This is the - * area that contains the question text, and the controls for students to - * input their answers. Some question types also embed bits of feedback, for - * example ticks and crosses, in this area. - * - * @param question_attempt $qa the question attempt to display. - * @param question_display_options $options controls what should and should not be displayed. - * @return string HTML fragment. - * @throws moodle_exception - * @codeCoverageIgnore - */ public function formulation_and_controls(question_attempt $qa, question_display_options $options): string { $formulationandcontrols = new formulation_and_controls($qa, $options); return $this->output->render_from_template('qtype_ordering/formulation_and_controls', $formulationandcontrols->export_for_template($this->output)); } - /** - * Generate the display of the outcome part of the question. This is the - * area that contains the various forms of feedback. This function generates - * the content of this area belonging to the question type. - * - * @param question_attempt $qa The question attempt to display. - * @param question_display_options $options Controls what should and should not be displayed. - * @return string HTML fragment. - * @throws moodle_exception - * @codeCoverageIgnore - */ public function feedback(question_attempt $qa, question_display_options $options): string { $feedback = new feedback($qa, $options); return $this->output->render_from_template('qtype_ordering/feedback', @@ -70,7 +47,6 @@ class qtype_ordering_renderer extends qtype_with_combined_feedback_renderer { * @param question_attempt $qa The question attempt to display. * @return string Output grade detail of the response. * @throws moodle_exception - * @codeCoverageIgnore */ public function specific_grade_detail_feedback(question_attempt $qa): string { $specificgradedetailfeedback = new specific_grade_detail_feedback($qa); @@ -78,28 +54,10 @@ class qtype_ordering_renderer extends qtype_with_combined_feedback_renderer { $specificgradedetailfeedback->export_for_template($this->output)); } - /** - * Generate the specific feedback. This is feedback that varies according to - * the response the student gave. - * - * @param question_attempt $qa The question attempt to display. - * @return string HTML fragment. - * @codeCoverageIgnore - */ public function specific_feedback(question_attempt $qa): string { return $this->combined_feedback($qa); } - /** - * Generate an automatic description of the correct response to this question. - * Not all question types can do this. If it is not possible, this method - * should just return an empty string. - * - * @param question_attempt $qa the question attempt to display. - * @return string HTML fragment. - * @throws moodle_exception - * @codeCoverageIgnore - */ public function correct_response(question_attempt $qa): string { $correctresponse = new correct_response($qa); @@ -107,29 +65,12 @@ class qtype_ordering_renderer extends qtype_with_combined_feedback_renderer { $correctresponse->export_for_template($this->output)); } - /** - * Generate a brief statement of how many sub-parts of this question the - * student got correct|partial|incorrect. - * - * @param question_attempt $qa The question attempt to display. - * @return string HTML fragment. - * @throws moodle_exception - * @codeCoverageIgnore - */ protected function num_parts_correct(question_attempt $qa): string { $numpartscorrect = new num_parts_correct($qa); return $this->output->render_from_template('qtype_ordering/num_parts_correct', $numpartscorrect->export_for_template($this->output)); } - /** - * Return an appropriate icon (green tick, red cross, etc.) for a grade. - * Note: Strict typing the params here breaks code eval as the parent function is not strictly typed. - * - * @param float $fraction The fraction of the maximum grade that was awarded. - * @param bool $selected Deprecated: size option. - * @return string html fragment. - */ public function feedback_image($fraction, $selected = true): string { return parent::feedback_image($fraction); }