1 |
efrain |
1 |
@mod @mod_questionnaire
|
|
|
2 |
Feature: Numeric questions can specify a maximum number of digits
|
|
|
3 |
If three or less, the "don't use thousands separator message" should not be displayed.
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to specify 3 or less in the max digits in the numeric question fields
|
|
|
6 |
|
|
|
7 |
Background: Add a numeric question to a questionnaire with a max digits and nb decimals specified
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.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 "activities" exist:
|
|
|
20 |
| activity | name | description | course | idnumber |
|
|
|
21 |
| questionnaire | Test questionnaire | Test questionnaire description | C1 | questionnaire0 |
|
|
|
22 |
| questionnaire | Test questionnaire2 | Test questionnaire description | C1 | questionnaire1 |
|
|
|
23 |
And I log in as "teacher1"
|
|
|
24 |
And I am on "Course 1" course homepage
|
|
|
25 |
And I follow "Test questionnaire"
|
|
|
26 |
And I navigate to "Questions" in current page administration
|
|
|
27 |
And I add a "Numeric" question and I fill the form with:
|
|
|
28 |
| Question Name | Q1 |
|
|
|
29 |
| Yes | y |
|
|
|
30 |
| Max. digits allowed | 3 |
|
|
|
31 |
| Question Text | Enter no more than three digits |
|
|
|
32 |
Then I should see "position 1"
|
|
|
33 |
And I should see "[Numeric] (Q1)"
|
|
|
34 |
And I should see "Enter no more than three digits"
|
|
|
35 |
And I am on "Course 1" course homepage
|
|
|
36 |
And I follow "Test questionnaire2"
|
|
|
37 |
And I navigate to "Questions" in current page administration
|
|
|
38 |
And I add a "Numeric" question and I fill the form with:
|
|
|
39 |
| Question Name | Q1 |
|
|
|
40 |
| Yes | y |
|
|
|
41 |
| Max. digits allowed | 4 |
|
|
|
42 |
| Question Text | Enter no more than four digits |
|
|
|
43 |
Then I should see "position 1"
|
|
|
44 |
And I should see "[Numeric] (Q1)"
|
|
|
45 |
And I should see "Enter no more than four digits"
|
|
|
46 |
And I log out
|
|
|
47 |
|
|
|
48 |
@javascript
|
|
|
49 |
Scenario: Student must enter no more than six digits and decimal points.
|
|
|
50 |
And I log in as "student1"
|
|
|
51 |
And I am on "Course 1" course homepage
|
|
|
52 |
And I follow "Test questionnaire"
|
|
|
53 |
And I navigate to "Answer the questions..." in current page administration
|
|
|
54 |
Then I should see "Enter no more than three digits"
|
|
|
55 |
And I should not see "Do not use thousands separators."
|
|
|
56 |
And I am on "Course 1" course homepage
|
|
|
57 |
And I follow "Test questionnaire2"
|
|
|
58 |
And I navigate to "Answer the questions..." in current page administration
|
|
|
59 |
Then I should see "Enter no more than four digits"
|
|
|
60 |
And I should see "Do not use thousands separators."
|