Merge branch 'MDL-53778' of https://github.com/stronk7/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 27 Jun 2019 00:35:56 +0000 (08:35 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Thu, 27 Jun 2019 00:35:56 +0000 (08:35 +0800)
mod/quiz/tests/behat/completion_condition_attempts_used.feature
mod/quiz/tests/behat/completion_condition_passing_grade.feature
mod/quiz/tests/lib_test.php

index 7e87610..370c963 100644 (file)
@@ -25,8 +25,8 @@ Feature: Set a quiz to be marked complete when the student uses all attempts all
       | questioncategory | qtype     | name           | questiontext              |
       | Test questions   | truefalse | First question | Answer the first question |
     And the following "activities" exist:
-      | activity   | name           | course | idnumber | attempts | gradepass | completion | completionattemptsexhausted |
-      | quiz       | Test quiz name | C1     | quiz1    | 2        | 5.00      | 2          | 1                           |
+      | activity | name           | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpass | completionattemptsexhausted |
+      | quiz     | Test quiz name | C1     | quiz1    | 2        | 5.00      | 2          | 1                  | 1              | 1                           |
     And quiz "Test quiz name" contains the following questions:
       | question       | page |
       | First question | 1    |
index 668c563..d5ec91b 100644 (file)
@@ -25,8 +25,8 @@ Feature: Set a quiz to be marked complete when the student passes
       | questioncategory | qtype     | name           | questiontext              |
       | Test questions   | truefalse | First question | Answer the first question |
     And the following "activities" exist:
-      | activity   | name           | course | idnumber | attempts | gradepass | completion | completionpass |
-      | quiz       | Test quiz name | C1     | quiz1    | 4        | 5.00      | 2          | 1              |
+      | activity | name           | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpass |
+      | quiz     | Test quiz name | C1     | quiz1    | 4        | 5.00      | 2          | 1                  | 1              |
     And quiz "Test quiz name" contains the following questions:
       | question       | page |
       | First question | 1    |
index bf82227..df77dee 100644 (file)
@@ -166,6 +166,7 @@ class mod_quiz_lib_testcase extends advanced_testcase {
                       'questionsperpage' => 0,
                       'sumgrades' => 1,
                       'completion' => COMPLETION_TRACKING_AUTOMATIC,
+                      'completionusegrade' => 1,
                       'completionpass' => 1);
         $quiz = $quizgenerator->create_instance($data);
         $cm = get_coursemodule_from_id('quiz', $quiz->cmid);
@@ -880,14 +881,14 @@ class mod_quiz_lib_testcase extends advanced_testcase {
         $quiz1 = $this->getDataGenerator()->create_module('quiz', [
             'course' => $course->id,
             'completion' => 2,
+            'completionusegrade' => 1,
             'completionattemptsexhausted' => 1,
             'completionpass' => 1
         ]);
         $quiz2 = $this->getDataGenerator()->create_module('quiz', [
             'course' => $course->id,
             'completion' => 2,
-            'completionattemptsexhausted' => 0,
-            'completionpass' => 0
+            'completionusegrade' => 0
         ]);
         $cm1 = cm_info::create(get_coursemodule_from_instance('quiz', $quiz1->id));
         $cm2 = cm_info::create(get_coursemodule_from_instance('quiz', $quiz2->id));