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 delete question answers and
3
branch table contents
4
  In order to modify an existing lesson
5
  As a teacher
6
  I need to question answers and branch table contents in the lesson
7
 
8
  Background:
9
    Given the following "users" exist:
10
      | username | firstname | lastname | email |
11
      | teacher1 | Teacher | 1 | teacher1@example.com |
12
      | student1 | Student | 1 | student1@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
    And the following "activities" exist:
21
      | activity   | name             | course | idnumber    |
22
      | lesson     | Test lesson name | C1     | lesson1     |
23
    And the following "mod_lesson > pages" exist:
24
      | lesson           | qtype   | title                 | content             |
25
      | Test lesson name | content | First page name       | First page contents |
26
      | Test lesson name | numeric | Hardest question ever | 1 + 1?              |
27
    And the following "mod_lesson > answers" exist:
28
      | page                  | answer        | response         | jumpto          | score |
29
      | First page name       | Next page     |                  | Next page       | 0     |
30
      | First page name       | Previous page |                  | Previous page   | 0     |
31
      | Hardest question ever | 2             | Correct answer   | End of lesson   | 1     |
32
      | Hardest question ever | 1             | Incorrect answer | First page name | 0     |
33
    And I am on the "Test lesson name" "lesson activity" page logged in as teacher1
34
    And I press "Edit lesson"
35
    And I select edit type "Expanded"
36
 
37
  Scenario: Edit lesson content page
38
    Given I click on "//th[normalize-space(.)='First page name']/descendant::a[3]" "xpath_element"
39
    When I set the following fields to these values:
40
      | id_answer_editor_1 | |
41
    And I press "Save page"
42
    And I should not see "Previous page"
43
    And I am on the "Test lesson name" "lesson activity" page logged in as student1
44
    Then I should see "First page contents"
45
    And I should not see "Previous page"
46
    And I press "Next page"
47
    And I should see "1 + 1?"
48
    And I set the following fields to these values:
49
      | Your answer | 2 |
50
    And I press "Submit"
51
    And I should see "Correct answer"
52
    And I should not see "Incorrect answer"
53
    And I press "Continue"
54
    And I should see "Congratulations - end of lesson reached"
55
    And I should see "Your score is 1 (out of 1)."
56
 
57
  Scenario: Edit lesson question page
58
    Given I click on "//th[normalize-space(.)='Hardest question ever']/descendant::a[3]" "xpath_element"
59
    When I set the following fields to these values:
60
      | id_answer_editor_1 | |
61
    And I press "Save page"
62
    And I should not see "Incorrect answer"
63
    And I am on the "Test lesson name" "lesson activity" page logged in as student1
64
    Then I should see "First page contents"
65
    And I press "Next page"
66
    And I should see "1 + 1?"
67
    And I set the following fields to these values:
68
      | Your answer | 1 |
69
    And I press "Submit"
70
    And I should not see "Incorrect answer"
71
    And I should see "Congratulations - end of lesson reached"
72
    And I should see "Your score is 0 (out of 1)."