1 |
efrain |
1 |
@mod @mod_choice
|
|
|
2 |
Feature: Teacher can choose whether to allow students to change their choice response
|
|
|
3 |
In order to allow students to change their choice
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to enable the option to change the choice
|
|
|
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 "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
|
|
|
20 |
Scenario: Change a choice response as a student
|
|
|
21 |
Given the following "activity" exists:
|
|
|
22 |
| activity | choice |
|
|
|
23 |
| course | C1 |
|
|
|
24 |
| idnumber | Choice name |
|
|
|
25 |
| name | Choice name |
|
|
|
26 |
| intro | Choice Description |
|
|
|
27 |
| section | 1 |
|
|
|
28 |
| option | Option 1, Option 2 |
|
|
|
29 |
| allowupdate | 0 |
|
|
|
30 |
When I am on the "Course 1" course page logged in as student1
|
|
|
31 |
And I choose "Option 1" from "Choice name" choice activity
|
|
|
32 |
And I should see "Your selection: Option 1"
|
|
|
33 |
And I should see "Your choice has been saved"
|
|
|
34 |
Then "Save my choice" "button" should not exist
|
|
|
35 |
|
|
|
36 |
Scenario: Change a choice response as a student
|
|
|
37 |
Given the following "activity" exists:
|
|
|
38 |
| activity | choice |
|
|
|
39 |
| course | C1 |
|
|
|
40 |
| idnumber | Choice name |
|
|
|
41 |
| name | Choice name |
|
|
|
42 |
| intro | Choice Description |
|
|
|
43 |
| section | 1 |
|
|
|
44 |
| option | Option 1, Option 2 |
|
|
|
45 |
| allowupdate | 1 |
|
|
|
46 |
When I am on the "Course 1" course page logged in as student1
|
|
|
47 |
And I choose "Option 1" from "Choice name" choice activity
|
|
|
48 |
And I should see "Your selection: Option 1"
|
|
|
49 |
And I should see "Your choice has been saved"
|
|
|
50 |
Then I should see "Your selection: Option 1"
|
|
|
51 |
And "Save my choice" "button" should exist
|
|
|
52 |
And "Remove my choice" "link" should exist
|
|
|
53 |
And I set the field "Option 2" to "1"
|
|
|
54 |
And I press "Save my choice"
|
|
|
55 |
And I should see "Your choice has been saved"
|
|
|
56 |
And I should see "Your selection: Option 2"
|