Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@qtype @qtype_numerical
2
Feature: Test creating a Numerical question
3
  As a teacher
4
  In order to test my students
5
  I need to be able to create a Numerical question
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username |
10
      | teacher  |
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 |
17
    And the following "language customisations" exist:
18
      | component       | stringid | value |
19
      | core_langconfig | decsep   | #     |
20
 
21
  Scenario: Create a Numerical question
22
    When I am on the "Course 1" "core_question > course question bank" page logged in as teacher
23
    And I add a "Numerical" question filling the form with:
24
      | Question name                      | Numerical-001                          |
25
      | Question text                      | What is the average of 4, 5, 6 and 10? |
26
      | Default mark                       | 1                                      |
27
      | General feedback                   | The average is 6.25                    |
28
      | id_answer_0                        | 6.25                                   |
29
      | id_tolerance_0                     | 0.05                                   |
30
      | id_fraction_0                      | 100%                                   |
31
      | id_answer_1                        | 2#25                                   |
32
      | id_tolerance_1                     | 0#05                                   |
33
      | id_fraction_1                      | 0%                                     |
34
      | id_answer_2                        | 5,1                                    |
35
      | id_tolerance_2                     | 0                                      |
36
      | id_fraction_2                      | 100%                                   |
37
    Then I should see "Numerical-001"
38
 
39
  @javascript
40
  Scenario: Create a Numerical question with required units
41
    When I am on the "Course 1" "core_question > course question bank" page logged in as teacher
42
    And I add a "Numerical" question filling the form with:
43
      | Question name                      | Numerical-002                               |
44
      | Question text                      | How many meter is 1m + 20cm + 50mm?         |
45
      | Default mark                       | 1                                           |
46
      | General feedback                   | The correct answer is 1.25m                 |
47
      | id_answer_0                        | 1.25                                        |
48
      | id_tolerance_0                     | 0                                           |
49
      | id_fraction_0                      | 100%                                        |
50
      | id_answer_1                        | 125                                         |
51
      | id_tolerance_1                     | 0                                           |
52
      | id_fraction_1                      | 0%                                          |
53
      | id_answer_2                        | 1250                                        |
54
      | id_tolerance_2                     | 0                                           |
55
      | id_fraction_2                      | 0%                                          |
56
      | id_unitrole                        | The unit must be given, and will be graded. |
57
      | id_unitpenalty                     | 0.15                                        |
58
      | id_unitgradingtypes                | as a fraction (0-1) of the question grade   |
59
      | id_unitsleft                       | on the right, for example 1.00cm or 1.00km  |
60
      | id_multichoicedisplay              | a drop-down menu                            |
61
      | id_unit_0                          | m                                           |
62
    Then I should see "Numerical-002"
63
    # Checking that the next new question form displays user preferences settings.
64
    And I press "Create a new question ..."
65
    And I set the field "item_qtype_numerical" to "1"
66
    And I click on "Add" "button" in the "Choose a question type to add" "dialogue"
67
    And the following fields match these values:
68
      | id_unitrole                        | The unit must be given, and will be graded. |
69
      | id_unitpenalty                     | 0#15                                        |
70
      | id_unitgradingtypes                | as a fraction (0-1) of the question grade   |
71
      | id_multichoicedisplay              | a drop-down menu                            |
72
      | id_unitsleft                       | on the right, for example 1.00cm or 1.00km  |
73
 
74
  Scenario: Create a Numerical question with optional units
75
    Given I am on the "Course 1" "core_question > course question bank" page logged in as teacher
76
    # Add the numerical question with optional units.
77
    And I add a "Numerical" question filling the form with:
78
      | Question name    | Numerical Question (optional)              |
79
      | Question text    | How many meter is 1m + 20cm + 50mm?        |
80
      | Default mark     | 1                                          |
81
      | General feedback | The correct answer is 1.25m                |
82
      | id_answer_0      | 1.25                                       |
83
      | id_tolerance_0   | 0                                          |
84
      | id_fraction_0    | 100%                                       |
85
      | id_answer_1      | 125                                        |
86
      | id_tolerance_1   | 0                                          |
87
      | id_fraction_1    | 0%                                         |
88
      | id_unitrole      | Units are optional.                        |
89
      | id_unitsleft     | on the right, for example 1.00cm or 1.00km |
90
      | id_unit_0        | m                                          |
91
    # Confirm that the numerical question with optional units is added successfully.
92
    When I choose "Edit question" action for "Numerical Question (optional)" in the question bank
93
    Then the following fields match these values:
94
      | Question name    | Numerical Question (optional)                                                                          |
95
      | Question text    | How many meter is 1m + 20cm + 50mm?                                                                    |
96
      | Default mark     | 1                                                                                                      |
97
      | General feedback | The correct answer is 1.25m                                                                            |
98
      | id_unitrole      | Units are optional. If a unit is entered, it is used to convert the response to Unit 1 before grading. |
99
      | id_unitsleft     | on the right, for example 1.00cm or 1.00km                                                             |
100
      | id_unit_0        | m                                                                                                      |