Skip to content

Commit

Permalink
use constants for "completion" settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Glutamat42 committed Sep 2, 2024
1 parent fae9b6a commit 4dbdce5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/external/external_test_helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static function create_course_with_test_questions(testing_data_generator
$generator->enrol_user($user->id, $course->id);

// create adleradaptivity module
$adleradaptivity_module = $generator->create_module('adleradaptivity', ['course' => $course->id, 'completion' => 2]);
$adleradaptivity_module = $generator->create_module('adleradaptivity', ['course' => $course->id, 'completion' => COMPLETION_TRACKING_AUTOMATIC]);
$adleradaptivity_task = $adleradaptivity_generator->create_mod_adleradaptivity_task($adleradaptivity_module->id, ['required_difficulty' => $task_required ? 100 : null]);
$adleradaptivity_task2 = $adleradaptivity_generator->create_mod_adleradaptivity_task($adleradaptivity_module->id, ['required_difficulty' => null, 'uuid' => 'uuid2', 'name' => 'task2']);
$adleradaptivity_question = $adleradaptivity_generator->create_mod_adleradaptivity_question($adleradaptivity_task->id);
Expand Down
6 changes: 3 additions & 3 deletions tests/lib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public function test_delete_instance() {
// Create a course.
$course = $this->getDataGenerator()->create_course(['enablecompletion' => 1]);

$adleradaptivity_module1 = $generator->create_module('adleradaptivity', ['course' => $course->id, 'completion' => 2]);
$adleradaptivity_module2 = $generator->create_module('adleradaptivity', ['course' => $course->id, 'completion' => 2]);
$adleradaptivity_module1 = $generator->create_module('adleradaptivity', ['course' => $course->id, 'completion' => COMPLETION_TRACKING_AUTOMATIC]);
$adleradaptivity_module2 = $generator->create_module('adleradaptivity', ['course' => $course->id, 'completion' => COMPLETION_TRACKING_AUTOMATIC]);


// Ensure that the instances were created.
Expand Down Expand Up @@ -92,7 +92,7 @@ public function test_delete_complex_instance($withAttempt) {
$complex_adleradaptivity_module = external_test_helpers::create_course_with_test_questions($generator);

// Create a second, trivial module instance.
$trivial_adleradaptivity_module = $generator->create_module('adleradaptivity', ['course' => $complex_adleradaptivity_module['course']->id, 'completion' => 2]);
$trivial_adleradaptivity_module = $generator->create_module('adleradaptivity', ['course' => $complex_adleradaptivity_module['course']->id, 'completion' => COMPLETION_TRACKING_AUTOMATIC]);

// If withAttempt is true, create an attempt.
if ($withAttempt) {
Expand Down

0 comments on commit 4dbdce5

Please sign in to comment.