-
Notifications
You must be signed in to change notification settings - Fork 3
/
backup_user_data.feature
65 lines (63 loc) · 2.96 KB
/
backup_user_data.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@local_recyclebin
Feature: Backup user data
As a teacher
I want user data to be backed up when I delete a course module
So that I can recover student content
Background: Course with teacher and student exist.
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher@asd.com |
| student1 | Student | 1 | student@asd.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
@javascript
Scenario: Delete and restore a quiz.
Given I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Quiz" to section "1" and I fill the form with:
| Name | Quiz 1 |
| Description | Test quiz description |
And I add a "True/False" question to the "Quiz 1" quiz with:
| Question name | TF1 |
| Question text | First question |
| General feedback | Thank you, this is the general feedback |
| Correct answer | False |
| Feedback for the response 'True'. | So you think it is true |
| Feedback for the response 'False'. | So you think it is false |
And I add a "True/False" question to the "Quiz 1" quiz with:
| Question name | TF2 |
| Question text | Second question |
| General feedback | Thank you, this is the general feedback |
| Correct answer | False |
| Feedback for the response 'True'. | So you think it is true |
| Feedback for the response 'False'. | So you think it is false |
And I log out
And I log in as "student1"
And I follow "Course 1"
And I follow "Quiz 1"
And I press "Attempt quiz now"
And I click on "True" "radio" in the "First question" "question"
And I click on "False" "radio" in the "Second question" "question"
And I press "Next"
And I press "Submit all and finish"
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
Then I should see "5.00 out of 10.00"
Given I log out
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I delete "Quiz 1" activity
And I follow "Recycle bin"
And I follow "Restore"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I follow "Grades"
Then "Quiz 1" row "Grade" column of "user-grade" table should contain "5"
And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50"