Skip to content

Commit

Permalink
Tidying up some codecher issues ...
Browse files Browse the repository at this point in the history
  • Loading branch information
mkassaei committed Jun 4, 2024
1 parent 239cfbc commit 531f20b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
11 changes: 7 additions & 4 deletions edit_drawlines_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public static function file_picker_options(): array {
return $filepickeroptions;
}

#[\Override]
protected function definition_inner($mform) {

$this->set_current_settings();
Expand Down Expand Up @@ -107,7 +106,13 @@ protected function definition_inner($mform) {
$this->add_interactive_settings(true, true);
}

#[\Override]
/**
* 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) {
$mform = $this->_form;

Expand All @@ -125,7 +130,6 @@ protected function get_hint_fields($withclearwrong = false, $withshownumpartscor
return [$repeated, $repeatedoptions];
}

#[\Override]
public function data_preprocessing($question) {
$question = parent::data_preprocessing($question);
$question = $this->data_preprocessing_options($question);
Expand Down Expand Up @@ -212,7 +216,6 @@ protected function data_preprocessing_hints($question, $withclearwrong = false,
return $question;
}

#[\Override]
public function validation($data, $files) {
$errors = parent::validation($data, $files);
$bgimagesize = $this->get_image_size_in_draft_area($data['bgimage']);
Expand Down
17 changes: 16 additions & 1 deletion tests/questiontype_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @package qtype_drawlines
* @copyright 2024 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers\qtype_drawlines
* @covers \qtype_drawlines
*/
class questiontype_test extends \advanced_testcase {
/** @var qtype_drawlines instance of the question type class to test. */
Expand All @@ -46,14 +46,23 @@ protected function tearDown(): void {
$this->qtype = null;
}

/**
* @covers \question_type::name
*/
public function test_name(): void {
$this->assertEquals($this->qtype->name(), 'drawlines');
}

/**
* @covers \question_type::can_analyse_responses
*/
public function test_can_analyse_responses(): void {
$this->assertTrue($this->qtype->can_analyse_responses());
}

/**
* @covers \qtype_drawlines::make_line
*/
public function test_make_line(): void {
$this->resetAfterTest();

Expand All @@ -76,6 +85,9 @@ public function test_make_line(): void {
}
}

/**
* @covers \qtype_drawlines::get_question_options
*/
public function test_get_question_options(): void {
global $DB;

Expand Down Expand Up @@ -109,6 +121,9 @@ public function test_get_question_options(): void {
};
}

/**
* @covers \qtype_drawlines::save_lines
*/
public function test_save_lines(): void {
global $DB;

Expand Down

0 comments on commit 531f20b

Please sign in to comment.