1 |
efrain |
1 |
@core @core_completion
|
|
|
2 |
Feature: Backup and restore the activity with the completion
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "courses" exist:
|
|
|
6 |
| fullname | shortname | category | enablecompletion |
|
|
|
7 |
| Course 1 | C1 | 0 | 1 |
|
|
|
8 |
And the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student1 | Student | First | student1@example.com |
|
|
|
11 |
| student2 | Student | Second | student2@example.com |
|
|
|
12 |
And the following "course enrolments" exist:
|
|
|
13 |
| user | course | role |
|
|
|
14 |
| student1 | C1 | student |
|
|
|
15 |
| student2 | C1 | student |
|
|
|
16 |
And the following "activity" exists:
|
|
|
17 |
| activity | assign |
|
|
|
18 |
| course | C1 |
|
|
|
19 |
| idnumber | a1 |
|
|
|
20 |
| name | Test assignment name |
|
|
|
21 |
| intro | Submit your online text |
|
|
|
22 |
| assignsubmission_onlinetext_enabled | 1 |
|
|
|
23 |
| assignsubmission_file_enabled | 0 |
|
|
|
24 |
| completion | 2 |
|
|
|
25 |
| completionview | 1 |
|
|
|
26 |
| completionusegrade | 1 |
|
|
|
27 |
| gradepass | 50 |
|
|
|
28 |
| completionpassgrade | 1 |
|
|
|
29 |
And the following config values are set as admin:
|
|
|
30 |
| enableasyncbackup | 0 |
|
|
|
31 |
And I am on the "Test assignment name" "assign activity" page logged in as student1
|
|
|
32 |
And I log out
|
|
|
33 |
|
|
|
34 |
@javascript @_file_upload
|
|
|
35 |
Scenario: Restore the legacy assignment with completion condition.
|
|
|
36 |
Given I am on the "Course 1" "restore" page logged in as "admin"
|
|
|
37 |
And I press "Manage course backups"
|
|
|
38 |
And I upload "completion/tests/fixtures/legacy_course_completion.mbz" file to "Files" filemanager
|
|
|
39 |
And I press "Save changes"
|
|
|
40 |
And I restore "legacy_course_completion.mbz" backup into a new course using this options:
|
|
|
41 |
| Schema | Course name | Course 2 |
|
|
|
42 |
| Schema | Course short name | C2 |
|
|
|
43 |
When I am on the "Course 2" course page logged in as student1
|
|
|
44 |
Then the "View" completion condition of "Test assignment name" is displayed as "done"
|
|
|
45 |
And I am on the "Course 2" course page logged in as student2
|
|
|
46 |
And the "View" completion condition of "Test assignment name" is displayed as "todo"
|
|
|
47 |
|
|
|
48 |
@javascript @_file_upload
|
|
|
49 |
Scenario: Backup and restore the assignment with the viewed and not-viewed completion condition
|
|
|
50 |
Given I am on the "Course 1" course page logged in as admin
|
|
|
51 |
And I backup "Course 1" course using this options:
|
|
|
52 |
| Confirmation | Filename | test_backup.mbz |
|
|
|
53 |
And I restore "test_backup.mbz" backup into a new course using this options:
|
|
|
54 |
| Schema | Course name | Course 2 |
|
|
|
55 |
| Schema | Course short name | C2 |
|
|
|
56 |
When I am on the "Course 2" course page logged in as student1
|
|
|
57 |
Then the "View" completion condition of "Test assignment name" is displayed as "done"
|
|
|
58 |
And I am on the "Course 2" course page logged in as student2
|
|
|
59 |
And the "View" completion condition of "Test assignment name" is displayed as "todo"
|