Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_questionnaire
2
Feature: Numeric questions can specify a maximum number of digits, and minimum number of decimal places
3
  In order to force a limit on digits and require decimal places
4
  As a teacher
5
  I need to specify the max digits and number of decimal places 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
    And I log in as "teacher1"
23
    And I am on "Course 1" course homepage
24
    And I follow "Test questionnaire"
25
    And I navigate to "Questions" in current page administration
26
    And I add a "Numeric" question and I fill the form with:
27
      | Question Name | Q1 |
28
      | Yes | y |
29
      | Max. digits allowed | 6 |
30
      | Nb of decimal digits | 2 |
31
      | Question Text | Enter no more than six digits including the decimal point |
32
    Then I should see "position 1"
33
    And I should see "[Numeric] (Q1)"
34
    And I should see "Enter no more than six digits including the decimal point"
35
    And I log out
36
 
37
  @javascript
38
  Scenario: Student must enter no more than six digits and decimal points.
39
    And I log in as "student1"
40
    And I am on "Course 1" course homepage
41
    And I follow "Test questionnaire"
42
    And I navigate to "Answer the questions..." in current page administration
43
    Then I should see "Enter no more than six digits including the decimal point"
44
    And I set the field "Enter no more than six digits including the decimal point" to "1.23456"
45
    And I press "Submit questionnaire"
46
    Then I should see "Thank you for completing this Questionnaire."
47
    And I press "Continue"
48
    Then I should see "View your response(s)"
49
    And I should see "Test questionnaire"
50
    And I should see "Enter no more than six digits including the decimal point"
51
    And I should see "1.2345"