forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-79863 qtype_ordering: Update comments and remove unused functions
- Loading branch information
1 parent
d0a9505
commit 7dda680
Showing
10 changed files
with
20 additions
and
64 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
namespace qtype_ordering\output; | ||
|
||
/** | ||
* Renderable class for the description of the correct response to a given question attempt. | ||
* Create an array for the correct response based on the question and current step state. | ||
* | ||
* @package qtype_ordering | ||
* @copyright 2023 Mihail Geshoski <[email protected]> | ||
|
@@ -26,7 +26,7 @@ | |
class correct_response extends renderable_base { | ||
|
||
/** | ||
* Export the data for the mustache template. | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
use question_display_options; | ||
|
||
/** | ||
* Renderable class for the displaying the formulation and controls of the question. | ||
* Create the question formulation, controls ready for output. | ||
* | ||
* @package qtype_ordering | ||
* @copyright 2023 Ilya Tregubov <[email protected]> | ||
|
@@ -32,7 +32,7 @@ class formulation_and_controls extends renderable_base { | |
protected $options; | ||
|
||
/** | ||
* The class constructor. | ||
* 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. | ||
|
@@ -43,7 +43,7 @@ public function __construct(question_attempt $qa, question_display_options $opti | |
} | ||
|
||
/** | ||
* Export the data for the mustache template. | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
namespace qtype_ordering\output; | ||
|
||
/** | ||
* Renderable class for the statement of how many sub-parts of the question the student got correct|partial|incorrect. | ||
* Generate the number of correct, partial, and incorrect parts of the question ready for output | ||
* | ||
* @package qtype_ordering | ||
* @copyright 2023 Ilya Tregubov <[email protected]> | ||
|
@@ -26,7 +26,7 @@ | |
class num_parts_correct extends renderable_base { | ||
|
||
/** | ||
* Export the data for the mustache template. | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
use qtype_ordering_question; | ||
|
||
/** | ||
* Renderable class for the displaying the grade detail of the response. | ||
* Generate the grade feedback when the grading should be shown. | ||
* | ||
* @package qtype_ordering | ||
* @copyright 2023 Ilya Tregubov <[email protected]> | ||
|
@@ -28,7 +28,7 @@ | |
class specific_grade_detail_feedback extends renderable_base { | ||
|
||
/** | ||
* Export the data for the mustache template. | ||
* 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ | |
* @package qtype_ordering | ||
* @copyright 2013 Gordon Bateson ([email protected]) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* @codeCoverageIgnore Edit form is covered via behat and mocked in units. | ||
*/ | ||
class qtype_ordering_edit_form extends question_edit_form { | ||
|
||
|
@@ -92,7 +91,6 @@ public function definition_inner($mform): void { | |
// Field for selectcount. | ||
$name = 'selectcount'; | ||
$label = get_string($name, $plugin); | ||
|
||
$mform->addElement('text', $name, $label, ['size' => 2]); | ||
$mform->setDefault($name, qtype_ordering_question::MIN_SUBSET_ITEMS); | ||
$mform->setType($name, PARAM_INT); | ||
|
@@ -117,26 +115,26 @@ public function definition_inner($mform): void { | |
$mform->addHelpButton($name, $name, $plugin); | ||
$mform->setDefault($name, $this->get_default_value($name, 1)); | ||
|
||
// Field for numberingstyle. | ||
$name = 'numberingstyle'; | ||
$label = get_string($name, $plugin); | ||
$options = qtype_ordering_question::get_numbering_styles(); | ||
$mform->addElement('select', $name, $label, $options); | ||
$mform->addHelpButton($name, $name, $plugin); | ||
$mform->setDefault($name, $this->get_default_value($name, qtype_ordering_question::NUMBERING_STYLE_DEFAULT)); | ||
|
||
$elements = []; | ||
$options = []; | ||
|
||
$mform->addElement('header', 'answersheader', get_string('draggableitems', $plugin)); | ||
$mform->setExpanded('answersheader', true); | ||
|
||
// Field for the answers. | ||
$elements = []; | ||
$options = []; | ||
$name = 'answer'; | ||
$elements[] = $mform->createElement('editor', $name, get_string('draggableitemno', $plugin), | ||
$this->get_editor_attributes(), $this->get_editor_options()); | ||
$elements[] = $mform->createElement('submit', $name . 'removeeditor', get_string('removeeditor', $plugin), | ||
['onclick' => 'skipClientValidation = true;']); | ||
$options[$name] = ['type' => PARAM_RAW]; | ||
|
||
$this->add_repeat_elements($mform, $name, $elements, $options); | ||
|
||
// Adjust HTML editor and removal buttons. | ||
|
@@ -467,17 +465,6 @@ public function validation($data, $files): array { | |
return $errors; | ||
} | ||
|
||
/** | ||
* Given a preference item name, returns the full | ||
* preference name of that item for this plugin | ||
* | ||
* @param string $name Item name | ||
* @return string full preference name | ||
*/ | ||
protected function get_my_preference_name(string $name): string { | ||
return $this->plugin_name()."_$name"; | ||
} | ||
|
||
/** | ||
* Get array of countable item types | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters