Commit | Line | Data |
---|---|---|
db3686d5 RM |
1 | @mod @mod_quiz |
2 | Feature: Set a quiz to be marked complete when the student uses all attempts allowed | |
3 | In order to ensure a student has learned the material before being marked complete | |
4 | As a teacher | |
5 | I need to set a quiz to complete when the student receives a passing grade, or completed_fail if they use all attempts without passing | |
6 | ||
7 | Background: | |
8 | Given the following "users" exist: | |
83cd293a TH |
9 | | username | firstname | lastname | email | |
10 | | student1 | Student | 1 | student1@example.com | | |
11 | | teacher1 | Teacher | 1 | teacher1@example.com | | |
db3686d5 | 12 | And the following "courses" exist: |
83cd293a TH |
13 | | fullname | shortname | category | enablecompletion | |
14 | | Course 1 | C1 | 0 | 1 | | |
db3686d5 | 15 | And the following "course enrolments" exist: |
83cd293a TH |
16 | | user | course | role | |
17 | | teacher1 | C1 | editingteacher | | |
18 | | student1 | C1 | student | | |
345c6a1a | 19 | And the following config values are set as admin: |
83cd293a TH |
20 | | enablecompletion | 1 | |
21 | | grade_item_advanced | hiddenuntil | | |
22 | And the following "question categories" exist: | |
23 | | contextlevel | reference | name | | |
24 | | Course | C1 | Test questions | | |
25 | And the following "questions" exist: | |
26 | | questioncategory | qtype | name | questiontext | | |
27 | | Test questions | truefalse | First question | Answer the first question | | |
28 | And the following "activities" exist: | |
29 | | activity | name | course | idnumber | attempts | gradepass | completion | completionattemptsexhausted | | |
30 | | quiz | Test quiz name | C1 | quiz1 | 2 | 5.00 | 2 | 1 | | |
31 | And quiz "Test quiz name" contains the following questions: | |
32 | | question | page | | |
33 | | First question | 1 | | |
db3686d5 RM |
34 | |
35 | Scenario: student1 uses up both attempts without passing | |
83cd293a | 36 | When I log in as "student1" |
db3686d5 RM |
37 | And I follow "Course 1" |
38 | And "//img[contains(@alt, 'Not completed: Test quiz name')]" "xpath_element" should exist in the "li.modtype_quiz" "css_element" | |
39 | And I follow "Test quiz name" | |
40 | And I press "Attempt quiz now" | |
db3686d5 RM |
41 | And I set the field "False" to "1" |
42 | And I press "Next" | |
db3686d5 RM |
43 | And I press "Submit all and finish" |
44 | And I follow "C1" | |
45 | And "//img[contains(@alt, 'Not completed: Test quiz name')]" "xpath_element" should exist in the "li.modtype_quiz" "css_element" | |
46 | And I follow "Test quiz name" | |
47 | And I press "Re-attempt quiz" | |
db3686d5 RM |
48 | And I set the field "False" to "1" |
49 | And I press "Next" | |
db3686d5 RM |
50 | And I press "Submit all and finish" |
51 | And I follow "C1" | |
83cd293a | 52 | Then "//img[contains(@alt, 'Completed: Test quiz name')]" "xpath_element" should exist in the "li.modtype_quiz" "css_element" |
db3686d5 RM |
53 | And I log out |
54 | And I log in as "teacher1" | |
55 | And I follow "Course 1" | |
83cd293a TH |
56 | And I navigate to "Activity completion" node in "Course administration > Reports" |
57 | And "//img[contains(@title,'Test quiz name') and @alt='Completed']" "xpath_element" should exist in the "Student 1" "table_row" |