Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
@core @core_course
2
Feature: Reset course
3
  In order to reuse a course
4
  As a teacher
5
  I need to clear all user data and reset the course to its initial state
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 | format | numsections |
14
      | Course 1 | C1        | topics | 2           |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | teacher1 | C1     | editingteacher |
18
      | student1 | C1     | student        |
19
    And the following "activity" exists:
20
      | activity                            | assign               |
21
      | course                              | C1                   |
22
      | name                                | Test assignment name |
23
      | assignsubmission_onlinetext_enabled | 1                    |
24
      | assignsubmission_file_enabled       | 0                    |
25
      | submissiondrafts                    | 0                    |
26
    And the following "mod_assign > submissions" exist:
27
      | assign                | user      | onlinetext                   |
28
      | Test assignment name  | student1  | I'm the student1 submission  |
29
 
30
  Scenario: Reset course select and deselect buttons
31
    When I am on the "Course 1" "reset" page logged in as "teacher1"
32
    Then I should see "Collapse all"
33
    And the field "Events" matches value "1"
34
    And the field "All notes" matches value "1"
35
    And the field "All comments" matches value "0"
36
    And the field "Completion data" matches value "0"
37
    And the field "All submissions" matches value "1"
38
    And the field "All user overrides" matches value "1"
39
    And the field "All group overrides" matches value "1"
40
    # Check fields are unchecked when Deselect all is clicked
41
    And I click on "Deselect all" "button"
42
    And the field "Events" matches value "0"
43
    And the field "All notes" matches value "0"
44
    And the field "All comments" matches value "0"
45
    And the field "Completion data" matches value "0"
46
    And the field "All submissions" matches value "0"
47
    And the field "All user overrides" matches value "0"
48
    And the field "All group overrides" matches value "0"
49
    # Check default fields are checked again when Select default is clicked
50
    And I click on "Select default" "button"
51
    And the field "Events" matches value "1"
52
    And the field "All notes" matches value "1"
53
    And the field "All comments" matches value "0"
54
    And the field "Completion data" matches value "0"
55
    And the field "All submissions" matches value "1"
56
    And the field "All user overrides" matches value "1"
57
    And the field "All group overrides" matches value "1"
58
 
59
  @javascript
60
  Scenario: Reset course with default settings
61
    Given I am on the "Course 1" "reset" page logged in as "teacher1"
62
    When I click on "Reset course" "button"
63
    And I click on "Reset course" "button" in the "Reset course?" "dialogue"
64
    Then I should see "Done" in the "All notes" "table_row"
65
    And I should see "Done" in the "All local role assignments" "table_row"
66
    And I should see "Done" in the "All submissions" "table_row"
67
    And I click on "Continue" "button"
68
    # Check that you're redirected to the course page.
69
    And I should not see "Reset course"
70
    # Check the course has been reset.
71
    And I navigate to course participants
72
    And I should see "Teacher 1"
73
    And I should not see "Student 1"
74
    And I am on the "Test assignment name" "assign activity" page
75
    And I should see "0" in the "Submitted" "table_row"