Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_lesson
2
Feature: Lesson reset
3
  In order to reuse past lessons
4
  As a teacher
5
  I need to remove all previous data.
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | teacher1 | Tina | Teacher1 | teacher1@example.com |
11
      | student1 | Sam1 | Student1 | student1@example.com |
12
      | student2 | Sam2 | Student2 | student2@example.com |
13
    And the following "courses" exist:
14
      | fullname | shortname | category |
15
      | Course 1 | C1 | 0 |
16
    And the following "course enrolments" exist:
17
      | user | course | role |
18
      | teacher1 | C1 | editingteacher |
19
      | student1 | C1 | student |
20
      | student2 | C1 | student |
21
    And the following "groups" exist:
22
      | name    | course | idnumber |
23
      | Group 1 | C1     | G1       |
24
      | Group 2 | C1     | G2       |
25
    And the following "activities" exist:
26
      | activity | name             | course | idnumber |
27
      | lesson   | Test lesson name | C1     | lesson1  |
28
    And the following "mod_lesson > page" exist:
29
      | lesson           | qtype     | title                 | content             |
30
      | Test lesson name | truefalse | True/false question 1 | Cat is an amphibian |
31
    And the following "mod_lesson > answers" exist:
32
      | page                  | answer    | response | jumpto    | score |
33
      | True/false question 1 | False     | Correct  | Next page | 1     |
34
      | True/false question 1 | True      | Wrong    | This page | 0     |
35
 
36
  Scenario: Use course reset to clear all attempt data
37
    When I am on the "Test lesson name" "lesson activity" page logged in as student1
38
    And I should see "Cat is an amphibian"
39
    And I set the following fields to these values:
40
      | False | 1 |
41
    And I press "Submit"
42
    And I press "Continue"
43
    And I should see "Congratulations - end of lesson reached"
44
    And I am on the "Test lesson name" "lesson activity" page logged in as teacher1
45
    And I navigate to "Reports" in current page administration
46
    And I should see "Sam1 Student1"
47
    And I am on the "Course 1" "reset" page
48
    And I set the following fields to these values:
49
        | Delete all lesson attempts | 1  |
50
    And I press "Reset course"
51
    And I press "Continue"
52
    And I am on the "Test lesson name" "lesson activity" page
53
    And I navigate to "Reports" in current page administration
54
    Then I should see "No attempts have been made on this lesson"
55
 
56
  @javascript
57
  Scenario: Use course reset to remove user overrides.
58
    When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
59
    And I navigate to "Overrides" in current page administration
60
    And I follow "Add user override"
61
    And I set the following fields to these values:
62
        | Override user    | Student1  |
63
        | Re-takes allowed | 1 |
64
    And I press "Save"
65
    And I should see "Sam1 Student1"
66
    And I am on the "Course 1" "reset" page
67
    And I set the following fields to these values:
68
        | Delete all user overrides | 1  |
69
    And I press "Reset course"
70
    And I press "Continue"
71
    And I am on the "Test lesson name" "lesson activity" page
72
    And I navigate to "Overrides" in current page administration
73
    Then I should not see "Sam1 Student1"
74
 
75
  Scenario: Use course reset to remove group overrides.
76
    When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
77
    And I navigate to "Overrides" in current page administration
78
    And I select "Group overrides" from the "jump" singleselect
79
    And I follow "Add group override"
80
    And I set the following fields to these values:
81
        | Override group   | Group 1  |
82
        | Re-takes allowed | 1 |
83
    And I press "Save"
84
    And I should see "Group 1"
85
    And I am on the "Course 1" "reset" page
86
    And I set the following fields to these values:
87
        | Delete all group overrides | 1  |
88
    And I press "Reset course"
89
    And I press "Continue"
90
    And I am on the "Test lesson name" "lesson activity" page
91
    And I navigate to "Overrides" in current page administration
92
    And I select "Group overrides" from the "jump" singleselect
93
    Then I should not see "Group 1"