Skip to content

Commit

Permalink
MDL-79863 qtype_ordering: Remove PHPDocs from overridden blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocolate-lightning committed Apr 5, 2024
1 parent 460e3b5 commit 178bed0
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 429 deletions.
7 changes: 0 additions & 7 deletions question/type/ordering/classes/output/correct_response.php
Expand Up @@ -24,13 +24,6 @@
* @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 = [];
Expand Down
16 changes: 5 additions & 11 deletions question/type/ordering/classes/output/feedback.php
Expand Up @@ -29,27 +29,21 @@
*/
class feedback extends renderable_base {

/** @var question_display_options $options The question options. */
protected $options;

/**
* Define the feedback with options for display.
*
* @param question_attempt $qa The question attempt object.
* @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;

Expand Down
16 changes: 5 additions & 11 deletions question/type/ordering/classes/output/formulation_and_controls.php
Expand Up @@ -28,26 +28,20 @@
*/
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;

Expand Down
7 changes: 0 additions & 7 deletions question/type/ordering/classes/output/num_parts_correct.php
Expand Up @@ -24,13 +24,6 @@
* @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(
Expand Down
9 changes: 4 additions & 5 deletions question/type/ordering/classes/output/renderable_base.php
Expand Up @@ -29,15 +29,14 @@
*/
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,
) {
}
}
Expand Up @@ -26,13 +26,6 @@
* @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 = [];
Expand Down
9 changes: 1 addition & 8 deletions question/type/ordering/classes/privacy/provider.php
Expand Up @@ -23,16 +23,9 @@
* @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';
}
Expand Down
6 changes: 0 additions & 6 deletions question/type/ordering/classes/question_hint_ordering.php
Expand Up @@ -50,12 +50,6 @@ public function __construct(int $id, string $hint, int $hintformat, bool $shownu
$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;

Expand Down
39 changes: 0 additions & 39 deletions question/type/ordering/edit_ordering_form.php
Expand Up @@ -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';
}
Expand All @@ -62,11 +57,6 @@ public function plugin_name(): string {
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.
Expand Down Expand Up @@ -275,13 +265,6 @@ protected function adjust_html_editors(MoodleQuickForm $mform, string $name): vo
}
}

/**
* 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;

Expand All @@ -308,12 +291,6 @@ protected function get_hint_fields($withclearwrong = false, $withshownumpartscor
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);
Expand Down Expand Up @@ -377,14 +354,6 @@ public function data_preprocessing($question): stdClass {
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;
Expand All @@ -399,14 +368,6 @@ protected function data_preprocessing_hints($question, $withclearwrong = false,
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';
Expand Down

0 comments on commit 178bed0

Please sign in to comment.