1 |
efrain |
1 |
@mod @mod_choice @core_completion
|
|
|
2 |
Feature: Automatic completion in the choice activity
|
|
|
3 |
In order for me to know what to do to complete the choice activity
|
|
|
4 |
As a student
|
|
|
5 |
I need to be able to see the completion requirements of the choice activity
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "course" exists:
|
|
|
13 |
| fullname | Course 1 |
|
|
|
14 |
| shortname | C1 |
|
|
|
15 |
| category | 0 |
|
|
|
16 |
| enablecompletion | 1 |
|
|
|
17 |
And the following "activity" exists:
|
|
|
18 |
| activity | choice |
|
|
|
19 |
| name | What to drink? |
|
|
|
20 |
| intro | Friday drinks, anyone? |
|
|
|
21 |
| course | C1 |
|
|
|
22 |
| idnumber | choice1 |
|
|
|
23 |
| completion | 2 |
|
|
|
24 |
| completionview | 1 |
|
|
|
25 |
| completionsubmit | 1 |
|
|
|
26 |
And the following "course enrolments" exist:
|
|
|
27 |
| user | course | role |
|
|
|
28 |
| student1 | C1 | student |
|
|
|
29 |
| teacher1 | C1 | editingteacher |
|
|
|
30 |
|
|
|
31 |
Scenario: Viewing a choice activity with automatic completion as a student
|
|
|
32 |
When I am on the "What to drink?" "choice activity" page logged in as student1
|
|
|
33 |
Then the "View" completion condition of "What to drink?" is displayed as "done"
|
|
|
34 |
And the "Make a choice" completion condition of "What to drink?" is displayed as "todo"
|
|
|
35 |
And I set the field "Beer" to "1"
|
|
|
36 |
And I press "Save my choice"
|
|
|
37 |
And the "View" completion condition of "What to drink?" is displayed as "done"
|
|
|
38 |
And the "Make a choice" completion condition of "What to drink?" is displayed as "done"
|
|
|
39 |
|
|
|
40 |
Scenario: Viewing a choice activity with automatic completion as a teacher
|
|
|
41 |
When I am on the "What to drink?" "choice activity" page logged in as teacher1
|
|
|
42 |
Then "What to drink?" should have the "View" completion condition
|
|
|
43 |
And "What to drink?" should have the "Make a choice" completion condition
|
|
|
44 |
|
|
|
45 |
@javascript
|
|
|
46 |
Scenario: Overriding automatic choice completion for a user
|
|
|
47 |
Given I am on the "Course 1" course page logged in as teacher1
|
|
|
48 |
And I navigate to "Reports" in current page administration
|
|
|
49 |
And I click on "Activity completion" "link"
|
|
|
50 |
And I click on "Student 1, What to drink?: Not completed" "link"
|
|
|
51 |
And I press "Save changes"
|
|
|
52 |
And I log out
|
|
|
53 |
When I am on the "What to drink?" "choice activity" page logged in as student1
|
|
|
54 |
Then the "View" completion condition of "What to drink?" overridden by "Teacher 1" is displayed as "done"
|
|
|
55 |
And the "Make a choice" completion condition of "What to drink?" overridden by "Teacher 1" is displayed as "done"
|