Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_quiz
2
Feature: Set a quiz to be interactive with multiple tries
3
  In order to attempt an interactive quiz multiple times
4
  As a teacher
5
  I should be able to set how questions behave to interactive with multiple tries
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | student1 | Student   | One      | student1@example.com |
11
      | teacher1 | Teacher   | One      | teacher1@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
      | student1 | C1     | student        |
18
      | teacher1 | C1     | editingteacher |
19
    And the following "question categories" exist:
20
      | contextlevel | reference | name           |
21
      | Course       | C1        | Test questions |
22
    And the following "questions" exist:
23
      | questioncategory | qtype       | name | questiontext    | template    | hint1  | hint2  | shuffleanswers |
24
      | Test questions   | multichoice | MC1  | First question  | one_of_four | Hint 1 | Hint 2 | 0              |
25
      | Test questions   | multichoice | MC2  | Second question | one_of_four | Hint 1 | Hint 2 | 0              |
26
    And the following "activities" exist:
27
      | activity | name   | course | preferredbehaviour     | specificfeedbackduring |
28
      | quiz     | Quiz 1 | C1     | interactive            | 1                      |
29
    And quiz "Quiz 1" contains the following questions:
30
      | question | page |
31
      | MC1      | 1    |
32
      | MC2      | 2    |
33
 
34
  @javascript
35
  Scenario: Attempt an interactive quiz with multiple tries
36
    Given I am on the "Quiz 1" "quiz activity" page logged in as student1
37
    And I press "Attempt quiz"
38
    # Answer the question incorrectly.
39
    And I click on "Two" "qtype_multichoice > Answer" in the "Question 1" "question"
40
    When I press "Check"
41
    # Confirm that correct feedback is displayed.
42
    Then I should see "That is not right at all."
43
    And I should see "Hint 1."
44
    # Confirm answer cannot be changed after checking your answer.
45
    And I should not see "Clear my choice"
46
    And "Check" "button" should not be visible
47
    # Attempt question again.
48
    And I press "Try again"
49
    And I should see "Clear my choice"
50
    # Answer the question correctly.
51
    And I click on "One" "qtype_multichoice > Answer" in the "Question 1" "question"
52
    And I press "Check"
53
    # Confirm correct feedback is displayed.
54
    And I should see "Well done!"
55
    And I should see "The correct answer is: One"
56
    And I should not see "Hint 1."
57
    And "Try again" "button" should not be visible
58
    And I press "Next page"
59
    # Answer question incorrectly.
60
    And I click on "Two" "qtype_multichoice > Answer" in the "Question 2" "question"
61
    And I press "Check"
62
    # Confirm Hint 1 is displayed.
63
    And I should see "Hint 1."
64
    And I press "Try again"
65
    # Answer question incorrectly again.
66
    And I click on "Three" "qtype_multichoice > Answer" in the "Question 2" "question"
67
    And I press "Check"
68
    # Confirm Hint 2 is displayed.
69
    And I should see "Hint 2."
70
    And I press "Try again"
71
    # Answer question incorrectly again.
72
    And I click on "Four" "qtype_multichoice > Answer" in the "Question 2" "question"
73
    And I press "Check"
74
    # Confirm you can no longer re-attempt the question.
75
    And I should not see "Try again"