diff --git a/edit_drawlines_form.php b/edit_drawlines_form.php index db6ae7b..5d800cd 100644 --- a/edit_drawlines_form.php +++ b/edit_drawlines_form.php @@ -315,5 +315,4 @@ protected function get_per_line_fields(MoodleQuickForm $mform, string $label, ar $mform->setType('zoneend', PARAM_RAW_TRIMMED); return $repeated; } - } diff --git a/lang/en/qtype_drawlines.php b/lang/en/qtype_drawlines.php index 7a31398..7abe145 100644 --- a/lang/en/qtype_drawlines.php +++ b/lang/en/qtype_drawlines.php @@ -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'; diff --git a/questiontype.php b/questiontype.php index 85834f0..c6d5ece 100644 --- a/questiontype.php +++ b/questiontype.php @@ -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) { @@ -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); } } diff --git a/tests/questiontype_test.php b/tests/questiontype_test.php index 1a08c6d..3a29337 100644 --- a/tests/questiontype_test.php +++ b/tests/questiontype_test.php @@ -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. */