1 |
efrain |
1 |
@mod @mod_quiz @core_completion @javascript
|
|
|
2 |
Feature: Set a quiz to be marked complete when the student completes a minimum amount of attempts
|
|
|
3 |
In order to ensure a student has completed the quiz before being marked complete
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to set a quiz to complete when the student completes a certain amount of attempts
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student1 | Student | 1 | student1@example.com |
|
|
|
11 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category | enablecompletion |
|
|
|
14 |
| Course 1 | C1 | 0 | 1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "question categories" exist:
|
|
|
20 |
| contextlevel | reference | name |
|
|
|
21 |
| Course | C1 | Test questions |
|
|
|
22 |
And the following "questions" exist:
|
|
|
23 |
| questioncategory | qtype | name | questiontext |
|
|
|
24 |
| Test questions | truefalse | First question | Answer the first question |
|
|
|
25 |
And the following "activities" exist:
|
|
|
26 |
| activity | name | course | idnumber | completion | completionminattemptsenabled | completionminattempts |
|
|
|
27 |
| quiz | Test quiz name | C1 | quiz1 | 2 | 1 | 2 |
|
|
|
28 |
And quiz "Test quiz name" contains the following questions:
|
|
|
29 |
| question | page |
|
|
|
30 |
| First question | 1 |
|
|
|
31 |
And user "student1" has attempted "Test quiz name" with responses:
|
|
|
32 |
| slot | response |
|
|
|
33 |
| 1 | False |
|
|
|
34 |
|
|
|
35 |
Scenario: student1 uses up both attempts without passing
|
|
|
36 |
When I am on the "Course 1" course page logged in as teacher1
|
|
|
37 |
And "Completed: Test quiz name" "icon" should not exist in the "Test quiz name" "list_item"
|
|
|
38 |
And I log out
|
|
|
39 |
And I am on the "Course 1" course page logged in as student1
|
|
|
40 |
And the "Make attempts: 2" completion condition of "Test quiz name" is displayed as "todo"
|
|
|
41 |
And I click on "Test quiz name" "link" in the "region-main" "region"
|
|
|
42 |
And I press "Re-attempt quiz"
|
|
|
43 |
And I set the field "False" to "1"
|
|
|
44 |
And I press "Finish attempt ..."
|
|
|
45 |
And I press "Submit all and finish"
|
|
|
46 |
And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
|
|
|
47 |
And I am on "Course 1" course homepage
|
|
|
48 |
Then the "Make attempts: 2" completion condition of "Test quiz name" is displayed as "done"
|
|
|
49 |
And I click on "Test quiz name" "link" in the "region-main" "region"
|
|
|
50 |
And the "Make attempts: 2" completion condition of "Test quiz name" is displayed as "done"
|
|
|
51 |
And I log out
|
|
|
52 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
53 |
And I click on "Test quiz name" "link" in the "region-main" "region"
|
|
|
54 |
And "Test quiz name" should have the "Make attempts: 2" completion condition
|
|
|
55 |
And I am on "Course 1" course homepage
|
|
|
56 |
And I navigate to "Reports" in current page administration
|
|
|
57 |
And I click on "Activity completion" "link"
|
|
|
58 |
And "Completed" "icon" should exist in the "Student 1" "table_row"
|