Skip to content

Commit

Permalink
replace moodle_core_repository->get_course_by_course_id with moodle c…
Browse files Browse the repository at this point in the history
…ore function get_course
  • Loading branch information
Glutamat42 committed May 6, 2024
1 parent f4cc004 commit a979147
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
9 changes: 0 additions & 9 deletions classes/local/db/moodle_core_repository.php

This file was deleted.

5 changes: 1 addition & 4 deletions classes/local/output/pages/view_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use invalid_parameter_exception;
use local_logging\logger;
use mod_adleradaptivity\local\db\adleradaptivity_repository;
use mod_adleradaptivity\local\db\moodle_core_repository;
use moodle_exception;
use moodle_page;
use question_engine;
Expand All @@ -41,7 +40,6 @@ class view_page {
private adleradaptivity_question_repository $question_repository;
private adleradaptivity_attempt_repository $adleradaptivity_attempt_repository;
private adleradaptivity_repository $adleradaptivity_repository;
private moodle_core_repository $moodle_core_repository;
private logger $logger;

/**
Expand Down Expand Up @@ -93,7 +91,6 @@ private function setup_instance_variables(): void {
$this->task_repository = new adleradaptivity_task_repository();
$this->question_repository = new adleradaptivity_question_repository();
$this->adleradaptivity_attempt_repository = new adleradaptivity_attempt_repository();
$this->moodle_core_repository = new moodle_core_repository();
$this->adleradaptivity_repository = new adleradaptivity_repository();

$this->logger = new logger('mod_adleradaptivity', 'view_page.php');
Expand Down Expand Up @@ -191,7 +188,7 @@ private function process_request_parameters(): array {
}

$cm = get_coursemodule_from_id('adleradaptivity', $cmid, 0, false, MUST_EXIST);
$course = $this->moodle_core_repository->get_course_by_course_id($cm->course);
$course = get_course($cm->course);
$module_instance = $this->adleradaptivity_repository->get_instance_by_instance_id($cm->instance);
return array($attempt_id, $cm, $course, $module_instance);
}
Expand Down

0 comments on commit a979147

Please sign in to comment.