[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/quiz/tests/behat/ -> editing_set_marks_with_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 (even after the quiz has been attempted).
   5  
   6    Background:
   7      Given the following "users" exist:
   8        | username | firstname | lastname | email                |
   9        | teacher1 | T1        | Teacher1 | teacher1@example.com |
  10        | student1 | S1        | Student1 | student1@example.com |
  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        | teacher1 | C1     | editingteacher |
  17        | student1 | C1     | student        |
  18      And the following "activities" exist:
  19        | activity   | name   | course | idnumber | grade | decimalpoints | questiondecimalpoints |
  20        | quiz       | Quiz 1 | C1     | quiz1    | 20    | 2             | -1                    |
  21      And I log in as "teacher1"
  22      And I follow "Course 1"
  23      And I add a "True/False" question to the "Quiz 1" quiz with:
  24        | Question name | First question |
  25        | Question text | Answer me      |
  26        | Default mark  | 2.0            |
  27      And I add a "True/False" question to the "Quiz 1" quiz with:
  28        | Question name | Second question |
  29        | Question text | Answer again    |
  30        | Default mark  | 3.0             |
  31      And I log out
  32      And I log in as "student1"
  33      And I follow "Course 1"
  34      And I follow "Quiz 1"
  35      And I press "Attempt quiz now"
  36      And I log out
  37      And I log in as "teacher1"
  38      And I follow "Course 1"
  39      And I follow "Quiz 1"
  40      And I navigate to "Edit quiz" node in "Quiz administration"
  41  
  42    @javascript
  43    Scenario: Set the max mark for a question.
  44      When I set the max mark for question "First question" to "7.0"
  45      Then I should see "7.00"
  46      And I should see "3.00"
  47      And I should see "Total of marks: 10.00"
  48  
  49      When I follow "Edit maximum mark"
  50      And I wait until "li input[name=maxmark]" "css_element" exists
  51      And I take focus off "li input[name=maxmark]" "css_element"
  52      Then I should see "7.00"
  53      And I should see "3.00"
  54      And I should see "Total of marks: 10.00"
  55      And "li input[name=maxmark]" "css_element" should not exist
  56  
  57    @javascript
  58    Scenario: Set the overall Maximum grade.
  59      When I set the field "maxgrade" to "10.0"
  60      And I press "savechanges"
  61      Then the field "maxgrade" matches value "10.00"
  62      And I should see "2.00"
  63      And I should see "3.00"
  64      And I should see "Total of marks: 5.00"
  65  
  66    @javascript
  67    Scenario: Verify the number of decimal places shown is what the quiz settings say it should be.
  68      # Then the field "maxgrade" matches value "20.00" -- with exact match on decimal places.
  69      Then "//input[@name = 'maxgrade' and @value = '20.00']" "xpath_element" should exist
  70      And I should see "2.00"
  71      And I should see "3.00"
  72      And I should see "Total of marks: 5.00"
  73      And I should not see "2.000"
  74      And I should not see "3.000"
  75      And I should not see "Total of marks: 5.000"
  76      When I follow "Edit settings"
  77      And I set the following fields to these values:
  78        | Decimal places in grades | 3 |
  79        | Decimal places in question grades | 5 |
  80      And I press "Save and display"
  81      And I follow "Edit quiz"
  82      # Then the field "maxgrade" matches value "20.000" -- with exact match on decimal places.
  83      Then "//input[@name = 'maxgrade' and @value = '20.000']" "xpath_element" should exist
  84      And I should see "2.00000"
  85      And I should see "3.00000"
  86      And I should see "Total of marks: 5.000"
  87      And I should not see "2.000000"
  88      And I should not see "3.000000"
  89      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