Skip to content

Commit

Permalink
Sorting out the coder checker errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mkassaei committed May 31, 2024
1 parent 37e1ed2 commit a69bb8e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
1 change: 0 additions & 1 deletion edit_drawlines_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,5 +315,4 @@ protected function get_per_line_fields(MoodleQuickForm $mform, string $label, ar
$mform->setType('zoneend', PARAM_RAW_TRIMMED);
return $repeated;
}

}
4 changes: 2 additions & 2 deletions lang/en/qtype_drawlines.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@
$string['type_help'] = 'You can choose whether the line doesn’t have a beginning or end (line), has one or more ends (right, left, and double arrows), or it only matters that the line intersects specific points on the graph (intersect points).';

$string['zonecoordinates'] = 'x,y;r (where x,y are the coordinates of the centre of the circle and r is the radius)';
$string['zonestart'] = 'Start zone coordinates'; // Coordinatare are in 'xcenter,ycenter;radius'.
$string['zoneend'] = 'End zone coordinates'; // Coordinatare are in 'xcenter,ycenter;radius'.
$string['zonestart'] = 'Start zone coordinates';
$string['zoneend'] = 'End zone coordinates';
17 changes: 5 additions & 12 deletions questiontype.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,9 @@ protected function delete_files($questionid, $contextid) {
parent::delete_files($questionid, $contextid);
$this->delete_files_in_combined_feedback($questionid, $contextid);
$this->delete_files_in_hints($questionid, $contextid);


$fs = get_file_storage();

parent::delete_files($questionid, $contextid);
$this->delete_files_in_row_feedback($questionid, $contextid);
$this->delete_files_in_hints($questionid, $contextid);
$fs->delete_area_files($contextid, 'question', 'correctfeedback', $questionid);
$fs->delete_area_files($contextid, 'question', 'partiallycorrectfeedback', $questionid);
$fs->delete_area_files($contextid, 'question', 'incorrectfeedback', $questionid);
$fs->delete_area_files($contextid, 'question', 'correctfeedback', $questionid);
$fs->delete_area_files($contextid, 'question', 'partiallycorrectfeedback', $questionid);
$fs->delete_area_files($contextid, 'question', 'incorrectfeedback', $questionid);
}

public function export_to_xml($question, qformat_xml $format, $extra = null) {
Expand Down Expand Up @@ -296,12 +289,12 @@ public function import_from_xml($data, $question, qformat_xml $format, $extra=nu
$dragindex = $dragno - 1;
$question->drags[$dragindex] = [];
$question->drags[$dragindex]['label'] =
$format->getpath($dragxml, array('#', 'text', 0, '#'), '', true);
$format->getpath($dragxml, ['#', 'text', 0, '#'], '', true);
if (array_key_exists('infinite', $dragxml['#'])) {
$question->drags[$dragindex]['noofdrags'] = 0; // Means infinite in the form.
} else {
// Defaults to 1 if 'noofdrags' not set.
$question->drags[$dragindex]['noofdrags'] = $format->getpath($dragxml, array('#', 'noofdrags', 0, '#'), 1);
$question->drags[$dragindex]['noofdrags'] = $format->getpath($dragxml, ['#', 'noofdrags', 0, '#'], 1);
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/questiontype_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +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
*/
class questiontype_test extends \advanced_testcase {
/** @var qtype_drawlines instance of the question type class to test. */
Expand Down

0 comments on commit a69bb8e

Please sign in to comment.