Skip to content

Commit 027c6e5

Browse files
Fix coding style issues and remove redundant function
1 parent 59bbac3 commit 027c6e5

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

combinable/multichoice/renderer.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,7 @@
3131
class qtype_combined_multichoice_embedded_renderer extends qtype_renderer
3232
implements qtype_combined_subquestion_renderer_interface {
3333

34-
/**
35-
* Renders a sub-question.
36-
*
37-
* @param question_attempt $qa The question attempt.
38-
* @param question_display_options $options Display options for the question.
39-
* @param qtype_combined_combinable_base $subq The sub-question being rendered.
40-
* @param int $placeno The placement number of the sub-question.
41-
*/
34+
#[\Override]
4235
public function subquestion(question_attempt $qa,
4336
question_display_options $options,
4437
qtype_combined_combinable_base $subq,

tests/form_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ public function test_form_validation(): void {
7676
if (qtype_combined_test_helper::plugin_is_installed('mod_qbank')) {
7777
$qbank = $gen->create_module('qbank', ['course' => $course->id]);
7878
$context = \context_module::instance($qbank->cmid);
79-
$contexts = qtype_combined_test_helper::question_edit_contexts($context);
79+
$contexts = $this->get_question_edit_contexts($context);
8080
$category = question_get_default_category($context->id, true);
8181
} else {
8282
// TODO: remove this once Moodle 5.0 is the lowest supported version.
83-
$contexts = qtype_combined_test_helper::question_edit_contexts(\context_course::instance($course->id));
83+
$contexts = $this->get_question_edit_contexts(\context_course::instance($course->id));
8484
$category = question_make_default_categories($contexts->all());
8585
}
8686

tests/helper.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -847,19 +847,4 @@ public static function plugin_is_installed(string $plugin): bool {
847847
}
848848
return true;
849849
}
850-
851-
/**
852-
* Retrieve the context object.
853-
* @param \context $context the current context.
854-
*
855-
* @return question_edit_contexts The context object.
856-
*/
857-
public static function question_edit_contexts(\context $context): object {
858-
if (class_exists('\core_question\local\bank\question_edit_contexts')) {
859-
$contexts = new \core_question\local\bank\question_edit_contexts($context);
860-
} else {
861-
$contexts = new \question_edit_contexts($context);
862-
}
863-
return $contexts;
864-
}
865850
}

0 commit comments

Comments
 (0)