[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/quiz/tests/behat/ -> editing_set_marks_no_attempts.feature (source)

   1  @mod @mod_quiz
   2  Feature: In order to create a quiz that awards marks the way I want
   3    As a teacher
   4    I must be able to set the marks I want on the Edit quiz page.
   5  
   6    Background:
   7      Given the following "users" exist:
   8        | username | firstname | lastname | email                |
   9        | teacher1 | T1        | Teacher1 | teacher1@example.com |
  10      And the following "courses" exist:
  11        | fullname | shortname | category |
  12        | Course 1 | C1        | 0        |
  13      And the following "course enrolments" exist:
  14        | user     | course | role           |
  15        | teacher1 | C1     | editingteacher |
  16      And the following "activities" exist:
  17        | activity   | name   | course | idnumber | grade | decimalpoints | questiondecimalpoints |
  18        | quiz       | Quiz 1 | C1     | quiz1    | 20    | 2             | -1                    |
  19      And I log in as "teacher1"
  20      And I follow "Course 1"
  21      And I add a "True/False" question to the "Quiz 1" quiz with:
  22        | Question name | First question |
  23        | Question text | Answer me      |
  24        | Default mark  | 2.0            |
  25      And I add a "True/False" question to the "Quiz 1" quiz with:
  26        | Question name | Second question |
  27        | Question text | Answer again    |
  28        | Default mark  | 3.0             |
  29  
  30    @javascript
  31    Scenario: Set the max mark for a question.
  32      When I set the max mark for question "First question" to "7.0"
  33      Then I should see "7.00"
  34      And I should see "3.00"
  35      And I should see "Total of marks: 10.00"
  36  
  37      When I follow "Edit maximum mark"
  38      And I wait until "li input[name=maxmark]" "css_element" exists
  39      And I take focus off "li input[name=maxmark]" "css_element"
  40      Then I should see "7.00"
  41      And I should see "3.00"
  42      And I should see "Total of marks: 10.00"
  43      And "li input[name=maxmark]" "css_element" should not exist
  44  
  45    @javascript
  46    Scenario: Set the overall Maximum grade.
  47      When I set the field "maxgrade" to "10.0"
  48      And I press "savechanges"
  49      Then the field "maxgrade" matches value "10.00"
  50      And I should see "2.00"
  51      And I should see "3.00"
  52      And I should see "Total of marks: 5.00"
  53  
  54    @javascript
  55    Scenario: Verify the number of decimal places shown is what the quiz settings say it should be.
  56      # Then the field "maxgrade" matches value "20.00" -- with exact match on decimal places.
  57      Then "//input[@name = 'maxgrade' and @value = '20.00']" "xpath_element" should exist
  58      And I should see "2.00"
  59      And I should see "3.00"
  60      And I should see "Total of marks: 5.00"
  61      And I should not see "2.000"
  62      And I should not see "3.000"
  63      And I should not see "Total of marks: 5.000"
  64      When I follow "Edit settings"
  65      And I set the following fields to these values:
  66        | Decimal places in grades | 3 |
  67        | Decimal places in question grades | 5 |
  68      And I press "Save and display"
  69      And I follow "Edit quiz"
  70      # Then the field "maxgrade" matches value "20.000" -- with exact match on decimal places.
  71      Then "//input[@name = 'maxgrade' and @value = '20.000']" "xpath_element" should exist
  72      And I should see "2.00000"
  73      And I should see "3.00000"
  74      And I should see "Total of marks: 5.000"
  75      And I should not see "2.000000"
  76      And I should not see "3.000000"
  77      And I should not see "Total of marks: 5.0000"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1