Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
11 efrain 1
@qtype @qtype_ordering
2
Feature: Complete an Ordering question attempt
3
  As a learner
4
  In order pass a quiz with ordering question types
5
  I need to submit an attempt and be graded
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | Teacher   | 1        | teacher1@moodle.com  |
11
      | student1 | Student   | 1        | student1@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
      | teacher1 | C1     | editingteacher |
18
      | student1 | C1     | student        |
19
    And the following "question categories" exist:
20
      | contextlevel | reference | name           |
21
      | Course       | C1        | Test questions |
22
    # Layouttype is a finicky setting afaik, so we'll just leave it vertical for now.
23
    And the following "questions" exist:
24
      | questioncategory | qtype    | name         | template | layouttype | selecttype | selectcount | gradingtype | showgrading | numberingstyle |
25
      | Test questions   | ordering | ordering-001 | moodle   | 0          | 0          | 3           | -1          | 1           | none           |
26
      | Test questions   | ordering | ordering-002 | moodle   | 0          | 0          | 3           | 1           | 0           | abc            |
27
      | Test questions   | ordering | ordering-003 | moodle   | 0          | 1          | 6           | 2           | 1           | ABCD           |
28
      | Test questions   | ordering | ordering-004 | moodle   | 0          | 2          | 6           | 3           | 0           | 123            |
29
      | Test questions   | ordering | ordering-005 | moodle   | 0          | 0          | 3           | 4           | 1           | iii            |
30
      | Test questions   | ordering | ordering-006 | moodle   | 0          | 0          | 3           | 5           | 0           | IIII           |
31
      | Test questions   | ordering | ordering-007 | moodle   | 0          | 0          | 3           | 6           | 1           | abc            |
32
      | Test questions   | ordering | ordering-008 | moodle   | 0          | 0          | 3           | 7           | 0           | abc            |
33
    And the following "activities" exist:
34
      | activity | name   | intro       | course | idnumber | maxmarksduring | marksduring | maxmarksimmediately | marksimmediately | preferredbehaviour |
35
      | quiz     | Quiz 1 | Quiz 1 test | C1     | quiz1    | 1              | 1           | 1                   | 1                | immediatefeedback  |
36
 
37
  @javascript
38
  Scenario Outline: As a student I can partially answer the question and get different grades and feedback.
39
    Given quiz "Quiz 1" contains the following questions:
40
      | question   | page | maxmark |
41
      | <question> | 1    | 2.00    |
42
    And I am on the "Quiz 1" "quiz activity" page logged in as "student1"
43
    When I click on "Attempt quiz" "button"
44
    And I wait until the page is ready
45
    # Confirm the appropriate styling class is applied to the list items.
46
    And I should see "Modular" in the "<styling>" "css_element"
47
    # DnD the items in the semi-correct order and then submit.
48
    And I drag "Environment" to space "1" in the ordering question
49
    And I drag "Learning" to space "2" in the ordering question
50
    And I drag "Oriented" to space "3" in the ordering question
51
    And I drag "Dynamic" to space "4" in the ordering question
52
    And I drag "Object" to space "5" in the ordering question
53
    And I drag "Modular" to space "6" in the ordering question
54
    And I press "Finish attempt ..."
55
    And I press "Submit all and finish"
56
    And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
57
    # Confirm the attempt was graded correctly.
58
    Then I should see "Finished" in the "Status" "table_row"
59
    And I should see "Question 1" in the ".info" "css_element"
60
    And I should see "<state>" in the ".info" "css_element"
61
    And I should see "<mark>" in the ".info" "css_element"
62
    And I change window size to "large"
63
    # Confirm that the grade details shows some of the formula as behat does not like /.
64
    And I should <expect> "<gradedetails>"
65
    And I should see "<correct>"
66
    And I should see "<partial>"
67
    And I should see "<incorrect>"
68
    And I should <expect> "<type>"
69
    And I log out
70
    And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
71
    And the following should exist in the "user-grades" table:
72
      | -1-       | -2-                  | -3-     |
73
      | Student 1 | student1@example.com | <grade> |
74
    Examples:
75
      | question     | styling        | state             | mark                  | grade | expect  | gradedetails      | correct          | partial                    |  incorrect         | type                                         |
76
      | ordering-001 | .numberingnone | Incorrect         | Mark 0.00 out of 2.00 | 0.00  | see     | not right at all. |                  |                            |                    | All or nothing                               |
77
      | ordering-002 | .numberingabc  | Partially correct | Mark 0.40 out of 2.00 | 20.00 | not see | Grade details:    | Correct items: 1 |                            | Incorrect items: 4 | Absolute position                            |
78
      | ordering-003 | .numberingABCD | Partially correct | Mark 0.33 out of 2.00 | 16.67 | see     | 6 = 17%           | Correct items: 1 |                            | Incorrect items: 5 | Relative to the next item (including last)   |
79
      | ordering-004 | .numbering123  | Partially correct | Mark 0.33 out of 2.00 | 16.67 | not see | Grade details:    |                  | Partially correct items: 2 | Incorrect items: 4 | Relative to the next item (excluding last)   |
80
      | ordering-005 | .numberingiii  | Partially correct | Mark 0.13 out of 2.00 | 6.67  | see     | 30 = 7%           |                  | Partially correct items: 2 | Incorrect items: 4 | Relative to ALL the previous and next items  |
81
      | ordering-006 | .numberingIIII | Partially correct | Mark 0.67 out of 2.00 | 33.33 | not see | Grade details:    | Correct items: 2 |                            | Incorrect items: 4 | Relative to both the previous and next items |
82
      | ordering-007 | .numberingabc  | Partially correct | Mark 0.67 out of 2.00 | 33.33 | see     | 6 = 33%           | Correct items: 2 |                            | Incorrect items: 4 | Longest contiguous subset                    |
83
      | ordering-008 | .numberingabc  | Partially correct | Mark 0.93 out of 2.00 | 46.67 | not see | Grade details:    | Correct items: 2 | Partially correct items: 2 | Incorrect items: 2 | Longest ordered subset                       |
84
 
85
  @javascript
86
  Scenario: As a student I can get hints when attempting the question.
87
    And the following "activities" exist:
88
      | activity | name   | intro       | course | preferredbehaviour |
89
      | quiz     | Quiz 2 | Quiz 2 test | C1     | interactive        |
90
    Given quiz "Quiz 2" contains the following questions:
91
      | question     | page | maxmark |
92
      | ordering-003 | 1    | 2.00    |
93
    And I am on the "Quiz 2" "quiz activity" page logged in as "student1"
94
    When I click on "Attempt quiz" "button"
95
    And I change window size to "large"
96
    And I wait until the page is ready
97
    And I drag "Environment" to space "1" in the ordering question
98
    And I drag "Learning" to space "2" in the ordering question
99
    And I drag "Dynamic" to space "3" in the ordering question
100
    And I drag "Oriented" to space "4" in the ordering question
101
    And I drag "Object" to space "5" in the ordering question
102
    And I drag "Modular" to space "6" in the ordering question
103
    And I press "Check"
104
    Then I should see "That is not right at all."
105
    And I should see "Hint 1"
106
    # Attempt question again.
107
    And I press "Try again"
108
    And I wait until the page is ready
109
    # DnD the items in the correct order and then submit.
110
    And I drag "Environment" to space "1" in the ordering question
111
    And I drag "Learning" to space "2" in the ordering question
112
    And I drag "Dynamic" to space "3" in the ordering question
113
    And I drag "Oriented" to space "4" in the ordering question
114
    And I drag "Object" to space "5" in the ordering question
115
    And I drag "Modular" to space "6" in the ordering question
116
    And I press "Check"
117
    And I should see "That is not right at all."
118
    And I should see "Hint 2"
119
    # Attempt question again with correct answers.
120
    And I press "Try again"
121
    And I wait until the page is ready
122
    # DnD the items in the correct order and then submit.
123
    And I drag "Modular" to space "1" in the ordering question
124
    And I drag "Object" to space "2" in the ordering question
125
    And I drag "Oriented" to space "3" in the ordering question
126
    And I drag "Dynamic" to space "4" in the ordering question
127
    And I drag "Learning" to space "5" in the ordering question
128
    And I drag "Environment" to space "6" in the ordering question
129
    And I press "Check"
130
    And I should see "Well done!"