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 editing a Numerical question
3
  As a teacher
4
  In order to be able to update my Numerical question
5
  I need to edit them
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 "question categories" exist:
18
      | contextlevel | reference | name           |
19
      | Course       | C1        | Test questions |
20
    And the following "questions" exist:
21
      | questioncategory | qtype     | name                  | template |
22
      | Test questions   | numerical | Numerical for editing | pi       |
23
 
24
  Scenario: Edit a Numerical question when using a custom decimal separator
25
    Given the following "language customisations" exist:
26
      | component       | stringid | value |
27
      | core_langconfig | decsep   | #     |
28
    When I am on the "Numerical for editing" "core_question > edit" page logged in as teacher
29
    And the field "id_answer_0" matches value "3#14"
30
    And I set the following fields to these values:
31
      | Question name | |
32
    And I press "id_submitbutton"
33
    And I should see "You must supply a value here."
34
    And I set the following fields to these values:
35
      | Question name | Edited Numerical name |
36
    And I press "id_submitbutton"
37
    Then I should see "Edited Numerical name"
38
    And I choose "Edit question" action for "Edited Numerical name" in the question bank
39
    And I set the following fields to these values:
40
      | id_answer_1    | 3#141592 |
41
      | id_tolerance_1 | 0#005    |
42
      | id_answer_2    | 3.05     |
43
      | id_tolerance_2 | 0.005    |
44
      | id_answer_3    | 3,01     |
45
    And I press "id_submitbutton"
46
    And I should see "Edited Numerical name"
47
 
48
  Scenario: Edit a Numerical question with very small answer
49
    When I am on the "Numerical for editing" "core_question > edit" page logged in as teacher
50
    And I set the following fields to these values:
51
      | id_answer_0    | 0.00000123456789 |
52
      | id_tolerance_1 | 0.0000123456789  |
53
    And I press "id_submitbutton"
54
    And I choose "Edit question" action for "Numerical for editing" in the question bank
55
    Then the following fields match these values:
56
      | id_answer_0    | 0.00000123456789 |
57
      | id_tolerance_1 | 0.0000123456789  |
58
 
59
  Scenario: Edit a Numerical question with optional units
60
    Given I am on the "Numerical for editing" "core_question > edit" page logged in as teacher
61
    # Edit the existing numerical question, changing the unit to optional.
62
    And I set the following fields to these values:
63
      | Question name    | Numerical Question (optional)              |
64
      | Question text    | How many meter is 1m + 20cm + 50mm?        |
65
      | Default mark     | 1                                          |
66
      | General feedback | The correct answer is 1.25m                |
67
      | id_answer_0      | 1.25                                       |
68
      | id_tolerance_0   | 0                                          |
69
      | id_fraction_0    | 100%                                       |
70
      | id_answer_1      | 125                                        |
71
      | id_tolerance_1   | 0                                          |
72
      | id_fraction_1    | 0%                                         |
73
      | id_unitrole      | Units are optional.                        |
74
      | id_unitsleft     | on the right, for example 1.00cm or 1.00km |
75
      | id_unit_0        | m                                          |
76
    And I press "submitbutton"
77
    When I choose "Edit question" action for "Numerical Question (optional)" in the question bank
78
    # Confirm that the numerical question with optional unit is updated accordingly.
79
    Then the following fields match these values:
80
      | Question name    | Numerical Question (optional)                                                                          |
81
      | Question text    | How many meter is 1m + 20cm + 50mm?                                                                    |
82
      | Default mark     | 1                                                                                                      |
83
      | General feedback | The correct answer is 1.25m                                                                            |
84
      | id_unitrole      | Units are optional. If a unit is entered, it is used to convert the response to Unit 1 before grading. |
85
      | id_unitsleft     | on the right, for example 1.00cm or 1.00km                                                             |
86
      | id_unit_0        | m                                                                                                      |