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: Preview a quiz as a teacher
3
  In order to verify my quizzes are ready for my students
4
  As a teacher
5
  I need to be able to preview them
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email               |
10
      | teacher  | Teacher   | One      | teacher@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname | category |
13
      | Course 1 | C1        | 0        |
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
16
      | teacher  | C1     | editingteacher |
1441 ariadna 17
    And the following "activities" exist:
18
      | activity   | name    | intro              | course | idnumber |
19
      | quiz       | Quiz 1  | Quiz 1 description | C1     | quiz1    |
1 efrain 20
    And the following "question categories" exist:
1441 ariadna 21
      | contextlevel    | reference | name           |
22
      | Activity module | quiz1     | Test questions |
1 efrain 23
    And the following "questions" exist:
24
      | questioncategory | qtype       | name  | questiontext    |
25
      | Test questions   | truefalse   | TF1   | First question  |
26
      | Test questions   | truefalse   | TF2   | Second question |
27
    And quiz "Quiz 1" contains the following questions:
28
      | question | page | maxmark |
29
      | TF1      | 1    |         |
30
      | TF2      | 1    | 3.0     |
31
    And user "teacher" has attempted "Quiz 1" with responses:
32
      | slot | response |
33
      |   1  | True     |
34
      |   2  | False    |
35
 
36
  @javascript
37
  Scenario: Review the quiz attempt
38
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher"
39
    And I follow "Review"
1441 ariadna 40
    And "Attempt 1 summary" "table" should exist
1 efrain 41
    Then I should see "25.00 out of 100.00"
42
    And I should see "v1 (latest)" in the "Question 1" "question"
43
    And I follow "Finish review"
44
    And "Review" "link" in the "Attempt 1" "list_item" should be visible
1441 ariadna 45
    And "Attempt 1 summary" "table" should exist
1 efrain 46
 
47
  @javascript
48
  Scenario: Review the quiz attempt with custom decimal separator
49
    Given the following "language customisations" exist:
50
      | component       | stringid | value |
51
      | core_langconfig | decsep   | #     |
52
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher"
53
    And I follow "Review"
54
    Then I should see "1#00/4#00"
55
    And I should see "25#00 out of 100#00"
56
    And I should see "Mark 1#00 out of 1#00"
57
    And I follow "Finish review"
58
    And "Review" "link" in the "Attempt 1" "list_item" should be visible
59
 
60
  Scenario: Preview the quiz
61
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher"
62
    When I press "Preview quiz"
63
    Then I should see "Question 1"
64
    And I should see "v1 (latest)" in the "Question 1" "question"
65
    And "Start a new preview" "button" should exist
66
 
67
  Scenario: Teachers should see a notice if the quiz is not available to students
68
    Given the following "activities" exist:
69
      | activity   | name   | course | timeclose     |
70
      | quiz       | Quiz 2 | C1     | ##yesterday## |
71
    And quiz "Quiz 2" contains the following questions:
72
      | question | page | maxmark |
73
      | TF1      | 1    |         |
74
      | TF2      | 1    | 3.0     |
75
    When I am on the "Quiz 2" "mod_quiz > View" page logged in as "admin"
76
    And I should see "This quiz is currently not available."
77
    And I press "Preview quiz"
78
    Then I should see "if this were a real attempt, you would be blocked" in the ".alert-warning" "css_element"
79
 
80
  Scenario: Admins should be able to preview a quiz
81
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "admin"
82
    When I press "Preview quiz"
83
    Then I should see "Question 1"
84
    And "Start a new preview" "button" should exist
85
 
86
  @javascript
87
  Scenario: Teacher responses should be cleared after updating the question too much in the preview.
88
    Given the following "activities" exist:
89
      | activity | name   | course |
90
      | quiz     | Quiz 3 | C1     |
91
    And the following "questions" exist:
92
      | questioncategory | qtype       | name             | questiontext |
93
      | Test questions   | multichoice | Multi-choice-002 | one_of_four  |
94
    And quiz "Quiz 3" contains the following questions:
95
      | question         | page |
96
      | Multi-choice-002 | 1    |
97
    When I am on the "Quiz 3" "mod_quiz > View" page logged in as "teacher"
98
    And I press "Preview quiz"
99
    And I should see "one_of_four"
100
    And I should see "v1 (latest)"
101
    And I click on "One" "qtype_multichoice > Answer"
102
    And I click on "Two" "qtype_multichoice > Answer"
103
    And I press "Finish attempt ..."
104
    And I press "Return to attempt"
105
    And I click on "Edit question" "link" in the "Question 1" "question"
106
    And I set the field "Question text" to "one_of_four version 2"
107
    And I set the field "Choice 4" to ""
108
    And I press "id_submitbutton"
109
    Then I should see "one_of_four version 2"
110
    And I should see "v2 (latest)"
111
    And I should see "One"
112
    And I should see "Two"
113
    And I should see "Three"
114
    And I should not see "Four"
115
    And "input[type=checkbox][name$=choice0]:checked" "css_element" should not exist
116
    And "input[type=checkbox][name$=choice1]:checked" "css_element" should not exist
117
    And "input[type=checkbox][name$=choice2]:checked" "css_element" should not exist