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: In a lesson activity, teacher can edit a cluster page
3
  In order to modify an existing lesson and change navigation
4
  As a teacher
5
  I need to edit cluster pages in the lesson
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
    And the following "activities" exist:
20
      | activity | name                | course | idnumber |
21
      | lesson   | Lesson with cluster | C1     | lesson1  |
22
    And the following "mod_lesson > pages" exist:
23
      | lesson              | qtype        | title            | content                    |
24
      | Lesson with cluster | content      | First page name  | First page contents        |
25
      | Lesson with cluster | cluster      | Cluster          | Cluster                    |
26
      | Lesson with cluster | multichoice  | Question 1       | Question from cluster      |
27
      | Lesson with cluster | multichoice  | Question 2       | Question from cluster      |
28
      | Lesson with cluster | endofcluster | End of cluster   | End of cluster             |
29
      | Lesson with cluster | content      | Second page name | Content page after cluster |
30
    And the following "mod_lesson > answers" exist:
31
      | page             | answer           | response | jumpto                           | score |
32
      | First page name  | Next page        |          | Next page                        | 0     |
33
      | Cluster          |                  |          | Unseen question within a cluster | 0     |
34
      | Question 1       | Correct answer   | Good     | Cluster                          | 1     |
35
      | Question 1       | Incorrect answer | Bad      | This page                        | 0     |
36
      | Question 2       | Correct answer   | Good     | Cluster                          | 1     |
37
      | Question 2       | Incorrect answer | Bad      | This page                        | 0     |
38
      | End of cluster   |                  |          | Next page                        | 0     |
39
      | Second page name | Next page        |          | Next page                        | 0     |
40
 
41
  Scenario: Edit lesson cluster page
42
    Given I am on the "Lesson with cluster" "lesson activity" page logged in as teacher1
43
    And I press "Edit lesson"
44
    And I select edit type "Expanded"
45
    And I click on "//th[normalize-space(.)='Cluster']/descendant::a[3]" "xpath_element"
46
    When I set the following fields to these values:
47
      | Page title | Modified name |
48
      | Page contents | Modified contents |
49
    And I press "Save page"
50
    Then I should see "Modified name"
51
    And I click on "//th[normalize-space(.)='Modified name']/descendant::a[3]" "xpath_element"
52
    And I should see "Unseen question within a cluster"
53
    And I press "Cancel"
54
    And I click on "//th[normalize-space(.)='End of cluster']/descendant::a[3]" "xpath_element"
55
    And I set the following fields to these values:
56
      | Page title | Modified end |
57
      | Page contents | Modified end contents |
58
      | id_jumpto_0 | Second page name |
59
    And I press "Save page"
60
    And I should see "Modified end"
61
    And I am on the "Lesson with cluster" "lesson activity" page logged in as student1
62
    And I should see "First page contents"
63
    And I press "Next page"
64
    And I should see "Question from cluster"
65
    And I set the following fields to these values:
66
      | Correct answer | 1 |
67
    And I press "Submit"
68
    And I should see "Good"
69
    And I press "Continue"
70
    And I should see "Question from cluster"
71
    And I set the following fields to these values:
72
      | Correct answer | 1 |
73
    And I press "Submit"
74
    And I should see "Good"
75
    And I press "Continue"
76
    And I should see "Content page after cluster"
77
    And I press "Next page"
78
    And I should see "Congratulations - end of lesson reached"
79
    And I should see "Your score is 2 (out of 2)."