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: Several attempts in a quiz
3
  As a student
4
  In order to demonstrate what I know
5
  I need to be able to attempt quizzes and sometimes take multiple attempts
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username  | firstname | lastname | email                |
10
      | student1  | Student   | One      | student1@example.com |
11
      | student2  | Student   | One      | student2@example.com |
12
      | teacher   | Teacher   | One      | teacher@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
      | student1 | C1     | student |
19
      | student2 | C1     | student |
20
      | teacher  | C1     | teacher |
21
    And the following "question categories" exist:
22
      | contextlevel | reference | name           |
23
      | Course       | C1        | Test questions |
24
    And the following "questions" exist:
25
      | questioncategory | qtype     | name | questiontext    |
26
      | Test questions   | truefalse | TF1  | First question  |
27
      | Test questions   | truefalse | TF2  | Second question |
28
    And the following "activities" exist:
29
      | activity | name   | intro              | course | idnumber | preferredbehaviour | navmethod  |
30
      | quiz     | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  | free       |
31
    And quiz "Quiz 1" contains the following questions:
32
      | question | page | requireprevious |
33
      | TF1      | 1    | 1               |
34
      | TF2      | 2    | 1               |
35
    # Add some attempts
36
    And user "student1" has attempted "Quiz 1" with responses:
37
      | slot | response |
38
      | 1    | True     |
39
      | 2    | False    |
40
    And user "student2" has attempted "Quiz 1" with responses:
41
      | slot | response |
42
      | 1    | True     |
43
      | 2    | True     |
44
    # Add a second attempt by student1
45
    And user "student1" has attempted "Quiz 1" with responses:
46
      | slot | response |
47
      | 1    | False    |
48
      | 2    | False    |
49
 
50
  @javascript
51
  Scenario: The redo question buttons are visible after 2 attempts are preset for student1.
52
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student1"
53
    Then "Re-attempt quiz" "button" should exist
54
    And I should see "Finished" in the "Attempt 1" "list_item"
55
    And I should see "1.00/2.00" in the "Attempt 1" "list_item"
56
    And I should see "Finished" in the "Attempt 2" "list_item"
57
    And I should see "0.00/2.00" in the "Attempt 2" "list_item"