Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_quiz
2
Feature: Quiz availability can be set
3
  In order to see quiz availability
4
  As a teacher
5
  I need to be able to set quiz opening and closing times
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | Teacher   | One      | teacher1@example.com |
11
      | student1 | Student   | One      | student1@example.com |
12
    And the following "courses" exist:
13
      | fullname | shortname |
14
      | Course 1 | C1        |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | teacher1 | C1     | editingteacher |
18
      | student1 | C1     | student        |
1441 ariadna 19
    And the following "activities" exist:
20
      | activity   | name    | course | idnumber |
21
      | qbank      | Qbank 1 | C1     | qbank1   |
1 efrain 22
    And the following "question categories" exist:
1441 ariadna 23
      | contextlevel    | reference | name           |
24
      | Activity module | qbank1    | Test questions |
1 efrain 25
    And the following "questions" exist:
26
      | questioncategory | qtype     | name | questiontext    |
27
      | Test questions   | truefalse | TF1  | First question  |
28
 
29
  Scenario Outline: Set quiz opening time while closing time is disabled
30
    Given the following "activities" exist:
31
      | activity | course | name   | timeopen   |
32
      | quiz     | C1     | Quiz 1 | <timeopen> |
33
    And quiz "Quiz 1" contains the following questions:
34
      | question | page | maxmark |
35
      | TF1      | 1    | 2       |
36
    When I am on the "Quiz 1" "quiz activity" page logged in as student1
37
    # Confirm display as student depending on case.
38
    Then I should see "<opentext>:"
39
    And I should see "<timeopen>%A, %d %B %Y, %I:%M##"
40
    And I should not see "Close:"
41
    And I <quizavailability> see "This quiz is currently not available."
42
    And "Attempt quiz" "button" <attemptvisibility> exist
43
 
44
    Examples:
45
      | opentext | timeopen      | attemptvisibility | quizavailability |
46
      # Case 1 - open is set to future date, close is disabled.
47
      | Opens    | ##tomorrow##  | should not        | should           |
48
      # Case 4 - open is set to past date, close is disabled.
49
      | Opened   | ##yesterday## | should           | should not        |
50
 
51
  Scenario Outline: Set quiz closing time while opening time is disabled
52
    Given the following "activities" exist:
53
      | activity | course | name   | timeclose   |
54
      | quiz     | C1     | Quiz 1 | <timeclose> |
55
    And quiz "Quiz 1" contains the following questions:
56
      | question | page | maxmark |
57
      | TF1      | 1    | 2       |
58
    When I am on the "Quiz 1" "quiz activity" page logged in as student1
59
    # Confirm display as student depending on case.
60
    Then I should see "<closetext>:"
61
    And I should see "<timeclose>%A, %d %B %Y, %I:%M##"
62
    And I <quizavailability> see "This quiz is currently not available."
63
    And "Attempt quiz" "button" <attemptvisibility> exist
64
 
65
    Examples:
66
      | closetext | timeclose      | attemptvisibility | quizavailability |
67
      # Case 2 - open is disabled, close is set to past date.
68
      | Closed    | ##yesterday##  | should not        | should not       |
69
      # Case 5 - open is disabled, close is set to future date.
70
      | Closes    | ##tomorrow##   | should            | should not       |
71
 
72
  Scenario Outline: Set quiz opening and closing times
73
    Given the following "activities" exist:
74
      | activity | course | name   | timeopen   | timeclose   |
75
      | quiz     | C1     | Quiz 1 | <timeopen> | <timeclose> |
76
    And quiz "Quiz 1" contains the following questions:
77
      | question | page | maxmark |
78
      | TF1      | 1    | 2       |
79
    When I am on the "Quiz 1" "quiz activity" page logged in as student1
80
    # Confirm display as student depending on case.
81
    Then I should see "<opentext>:"
82
    And I should see "<timeopen>%A, %d %B %Y, %I:%M##"
83
    And I should see "<closetext>:"
84
    And I should see "<timeclose>%A, %d %B %Y, %I:%M##"
85
    And I <quizavailability> see "This quiz is currently not available."
86
    And "Attempt quiz" "button" <attemptvisibility> exist
87
 
88
    Examples:
89
      | opentext | timeopen        | closetext | timeclose      | attemptvisibility | quizavailability |
90
      # Case 6 - open and close are set to past date.
91
      | Opened   | ##3 days ago## | Closed     | ##yesterday##  | should not        | should not       |
92
      # Case 7 - open is set to past date, close is set to future date.
93
      | Opened   | ##yesterday##  | Closes     | ##tomorrow##   | should            | should not       |
94
      # Case 8 - open and close are set to future date
95
      | Opens    | ##tomorrow##   | Closes     | ##+2 days##    | should not        | should           |
96
 
97
  Scenario: Quiz time open and time close are disabled
98
    # Case 3 - both open and close are disabled.
99
    Given the following "activities" exist:
100
      | activity | course | name   |
101
      | quiz     | C1     | Quiz 1 |
102
    And quiz "Quiz 1" contains the following questions:
103
      | question | page | maxmark |
104
      | TF1      | 1    | 2       |
105
    When I am on the "Quiz 1" "quiz activity" page logged in as student1
106
    Then I should not see "Opens"
107
    And I should not see "Opened"
108
    And I should not see "Closes"
109
    And I should not see "Closed"
110
    And I should not see "This quiz is currently not available."
111
    And "Attempt quiz" "button" should exist
112
 
113
  @javascript
114
  Scenario Outline: Timer is displayed when quiz closes in less than an hour
115
    Given the following "activities" exist:
116
      | activity | course | name   | timeclose   |
117
      | quiz     | C1     | Quiz 1 | <closedate> |
118
    And quiz "Quiz 1" contains the following questions:
119
      | question | page |
120
      | TF1      | 1    |
121
    And I am on the "Quiz 1" "quiz activity" page logged in as "teacher1"
122
    When I press "Preview quiz"
123
    # Confirm timer visibility for teacher
124
    Then I <timervisibility> see "Time left"
125
    And I am on the "Quiz 1" "quiz activity" page logged in as "student1"
126
    And I press "Attempt quiz"
127
    # Confirm timer visibility for student
128
    And I <timervisibility> see "Time left"
129
 
130
    Examples:
131
      | closedate           | timervisibility |
132
      # Case 1 - closedate is < 1hr, the timer is visible
133
      | ##now +10 minutes## | should          |
134
      # Case 2 - closedate is > 1hr, the timer is not visible
135
      | ##now +2 hours##    | should not      |