Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_quiz
2
Feature: Edit quiz marks with attempts
3
  In order to create a quiz that awards marks the way I want
4
  As a teacher
5
  I must be able to set the marks I want on the Edit quiz page (even after the quiz has been attempted).
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | T1        | Teacher1 | teacher1@example.com |
11
      | student1 | S1        | Student1 | 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   | course | idnumber | grade | decimalpoints | questiondecimalpoints |
21
      | quiz       | Quiz 1 | C1     | quiz1    | 20    | 2             | -1                    |
22
    And I log in as "teacher1"
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 am on the "Quiz 1" "mod_quiz > View" page logged in as "student1"
33
    And I press "Attempt quiz"
34
    And I log out
35
    And I log in as "teacher1"
36
    And I am on the "Quiz 1" "mod_quiz > Edit" page
37
 
38
  @javascript
39
  Scenario: Set the max mark for a question.
40
    When I set the max mark for question "First question" to "7.0"
41
    Then I should see "7.00"
42
    And I should see "3.00"
43
    And I should see "Total of marks: 10.00"
44
 
45
    When I follow "Edit maximum mark"
46
    And I press the escape key
47
    Then I should see "7.00"
48
    And I should see "3.00"
49
    And I should see "Total of marks: 10.00"
50
    And "li input[name=maxmark]" "css_element" should not exist
51
 
52
  @javascript
53
  Scenario: Set the overall Maximum grade.
54
    When I set the field "maxgrade" to "10.0"
55
    And I press "savechanges"
56
    Then the field "maxgrade" matches value "10.00"
57
    And I should see "2.00"
58
    And I should see "3.00"
59
    And I should see "Total of marks: 5.00"
60
 
61
  @javascript
62
  Scenario: Verify the number of decimal places shown is what the quiz settings say it should be.
63
    Given I change window size to "large"
64
    # Then the field "maxgrade" matches value "20.00" -- with exact match on decimal places.
65
    And "//input[@name = 'maxgrade' and @value = '20.00']" "xpath_element" should exist
66
    And I should see "2.00"
67
    And I should see "3.00"
68
    And I should see "Total of marks: 5.00"
69
    And I should not see "2.000"
70
    And I should not see "3.000"
71
    And I should not see "Total of marks: 5.000"
72
    When I am on the "Quiz 1" "quiz activity editing" page
73
    And I set the following fields to these values:
74
      | Decimal places in grades | 3 |
75
      | Decimal places in marks for questions | 5 |
76
    And I press "Save and display"
77
    And I am on the "Quiz 1" "mod_quiz > Edit" page
78
    # Then the field "maxgrade" matches value "20.000" -- with exact match on decimal places.
79
    Then "//input[@name = 'maxgrade' and @value = '20.000']" "xpath_element" should exist
80
    And I should see "2.00000"
81
    And I should see "3.00000"
82
    And I should see "Total of marks: 5.000"
83
    And I should not see "2.000000"
84
    And I should not see "3.000000"
85
    And I should not see "Total of marks: 5.0000"