Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_questionnaire
2
Feature: Public questionnaires gather all instance responses in one master course, but not in the instance courses.
3
  When teachers view a course instance they will not see any student responses.
4
  When teachers view the main public course questionnaire, they will see all instances' responses.
5
 
6
  Background: Add a public questionnaire and use it in two different course.
7
    Given the following "users" exist:
8
      | username | firstname | lastname | email |
9
      | teacher1 | Teacher | 1 | teacher1@example.com |
10
      | teacher2 | Teacher | 2 | teacher2@example.com |
11
      | teacher3 | Teacher | 3 | teacher3@example.com |
12
      | student1 | Student | 1 | student1@example.com |
13
      | student2 | Student | 2 | student2@example.com |
14
    And the following "courses" exist:
15
      | fullname | shortname | category |
16
      | Course 1 | C1 | 0 |
17
      | Course 2 | C2 | 0 |
18
      | Course 3 | C3 | 0 |
19
    And the following "course enrolments" exist:
20
      | user | course | role |
21
      | teacher1 | C1 | manager |
22
      | teacher2 | C2 | editingteacher |
23
      | student1 | C2 | student |
24
      | teacher3 | C3 | editingteacher |
25
      | student2 | C3 | student |
26
    And the following "activities" exist:
27
      | activity | name | description | course | idnumber |
28
      | questionnaire | Public questionnaire | Anonymous questionnaire description | C1 | questionnaire0 |
29
 
30
    And I log in as "teacher1"
31
    And I am on "Course 1" course homepage
32
    And I follow "Public questionnaire"
33
    And I navigate to "Advanced settings" in current page administration
34
    And I set the field "realm" to "public"
35
    And I press "Save and display"
36
    And I navigate to "Questions" in current page administration
37
    And I add a "Numeric" question and I fill the form with:
38
      | Question Name | Q1 |
39
      | Yes | y |
40
      | Question Text | Enter a number |
41
    And I log out
42
 
43
    And I log in as "teacher2"
44
    And I am on "Course 2" course homepage with editing mode on
45
    And I add a "Questionnaire" to section "1" and I fill the form with:
46
      | Name | Questionnaire instance 1 |
47
      | Description | Description |
48
      | Use public | Public questionnaire [Course 1] |
49
    Then I should see "Questionnaire instance 1"
50
    And I log out
51
 
52
    And I log in as "teacher3"
53
    And I am on "Course 3" course homepage with editing mode on
54
    And I add a "Questionnaire" to section "1" and I fill the form with:
55
      | Name | Questionnaire instance 2 |
56
      | Description | Description |
57
      | Use public | Public questionnaire [Course 1] |
58
    Then I should see "Questionnaire instance 2"
59
    And I log out
60
 
61
    And I am on the "Questionnaire instance 1" "mod_questionnaire > view" page logged in as "student1"
62
    And I follow "Questionnaire instance 1"
63
    And I navigate to "Answer the questions..." in current page administration
64
    Then I should see "Questionnaire instance 1"
65
    And I set the field "Enter a number" to "1"
66
    And I press "Submit questionnaire"
67
    Then I should see "Thank you for completing this Questionnaire."
68
    And I log out
69
 
70
    And I am on the "Questionnaire instance 2" "mod_questionnaire > view" page logged in as "student2"
71
    And I should see "Answer the questions..."
72
    And I navigate to "Answer the questions..." in current page administration
73
    Then I should see "Questionnaire instance 2"
74
    And I set the field "Enter a number" to "2"
75
    And I press "Submit questionnaire"
76
    Then I should see "Thank you for completing this Questionnaire."
77
    And I log out
78
 
79
  @javascript
80
  Scenario: Teacher should not see responses for a questionnaire using a public instance
81
    And I am on the "Questionnaire instance 1" "mod_questionnaire > view" page logged in as "teacher2"
82
    And I should not see "View your response(s)"
83
    And I should not see "View all responses"
84
    And I log out
85
 
86
  # Scenario: Teacher in course with main public questionnaire should see all responses
87
    And I am on the "Public questionnaire" "mod_questionnaire > view" page logged in as "teacher1"
88
    Then I should see "View all responses"
89
    And I navigate to "View all responses" in current page administration
90
    Then I should see "Responses: 2"