attempt.feature 3.97 KB
Newer Older
0815-xyz's avatar
0815-xyz committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@mod @mod_adaptivequiz
Feature: Attempt an adaptive quiz
  In order to demonstrate what I know using the adaptive quiz strategy
  As a student
  I need to be able to attempt an adaptive quiz

  Background:
    Given the following "users" exist:
      | username | firstname | lastname    | email                       |
      | teacher1 | John      | The Teacher | johntheteacher@example.com  |
      | student1 | Peter     | The Student | peterthestudent@example.com |
    And the following "courses" exist:
      | fullname | shortname | category |
      | Course 1 | C1        | 0        |
    And the following "course enrolments" exist:
      | user     | course | role           |
      | teacher1 | C1     | editingteacher |
      | student1 | C1     | student        |
    And the following "question categories" exist:
      | contextlevel | reference | name                    |
      | Course       | C1        | Adaptive Quiz Questions |
    And the following "questions" exist:
      | questioncategory        | qtype     | name | questiontext    |
      | Adaptive Quiz Questions | truefalse | Q1   | First question  |
      | Adaptive Quiz Questions | truefalse | Q2   | Second question |
    And the following "core_question > Tags" exist:
      | question | tag    |
      | Q1       | adpq_1 |
      | Q2       | adpq_2 |
    And the following "activity" exists:
      | activity          | adaptivequiz            |
      | idnumber          | adaptivequiz1           |
      | course            | C1                      |
      | name              | Adaptive Quiz           |
      | startinglevel     | 1                       |
      | lowestlevel       | 1                       |
      | highestlevel      | 2                       |
      | minimumquestions  | 1                       |
      | maximumquestions  | 2                       |
      | standarderror     | 25                      |
      | questionpoolnamed | Adaptive Quiz Questions |
      | attempts          | 1                       |

  @javascript
  Scenario: Attempt an adaptive quiz
    When I am on the "adaptivequiz1" "Activity" page logged in as "student1"
    And I click on "Start attempt" "link"
    Then I should see "First question"

  @javascript
  Scenario: A student cannot attempt an adaptive quiz if no more attempts are allowed
    Given I am on the "adaptivequiz1" "Activity" page logged in as "student1"
    And I click on "Start attempt" "link"
    And I click on "True" "radio" in the "First question" "question"
    And I press "Submit answer"
    And I click on "True" "radio" in the "Second question" "question"
    And I press "Submit answer"
    And I press "Continue"
    When I am on the "adaptivequiz1" "Activity" page
    Then "Start attempt" "link" should not be visible
    And I should see "No more attempts allowed at this activity"

  @javascript
  Scenario: Return to a started attempt
    Given the following "questions" exist:
      | questioncategory        | qtype     | name | questiontext    |
      | Adaptive Quiz Questions | truefalse | Q3   | Third question  |
      | Adaptive Quiz Questions | truefalse | Q4   | Fourth question |
    And the following "core_question > Tags" exist:
      | question | tag    |
      | Q3       | adpq_2 |
      | Q4       | adpq_3 |
    And I am on the "adaptivequiz1" "Activity" page logged in as "teacher1"
    And I click on "Settings" "link"
    And I set the following fields to these values:
      | Highest level of difficulty  | 3 |
      | Minimum number of questions  | 1 |
      | Maximum number of questions  | 3 |
    And I click on "Save and return to course" "button"
    And I log out
    When I am on the "adaptivequiz1" "Activity" page logged in as "student1"
    And I click on "Start attempt" "link"
    And I click on "True" "radio"
    And I press "Submit answer"
    And I am on the "adaptivequiz1" "Activity" page
    And I click on "Start attempt" "link"
    And I click on "True" "radio"
    And I press "Submit answer"
    Then I should see "Fourth question"