Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_quiz @core_completion
2
Feature: Set a quiz to be marked complete when the student passes
3
  In order to ensure a student has learned the material before being marked complete
4
  As a teacher
5
  I need to set a quiz to complete when the student recieves a passing grade
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | student1 | Student   | 1        | student1@example.com |
11
      | teacher1 | Teacher   | 1        | teacher1@example.com |
12
    And the following "courses" exist:
13
      | fullname | shortname | category | enablecompletion |
14
      | Course 1 | C1        | 0        | 1                |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | teacher1 | C1     | editingteacher |
18
      | student1 | C1     | student        |
19
    And the following "question categories" exist:
20
      | contextlevel | reference | name           |
21
      | Course       | C1        | Test questions |
22
    And the following "questions" exist:
23
      | questioncategory | qtype     | name           | questiontext              |
24
      | Test questions   | truefalse | First question | Answer the first question |
25
    And the following "activities" exist:
26
      | activity | name           | course | idnumber | attempts | gradepass | completion | completionusegrade | completionpassgrade | completionview |
27
      | quiz     | Test quiz name | C1     | quiz1    | 4        | 5.00      | 2          | 1                  | 1                   | 1              |
28
    And quiz "Test quiz name" contains the following questions:
29
      | question       | page |
30
      | First question | 1    |
31
 
32
  @javascript
33
  Scenario: student1 passes on the first try
34
    When I log in as "student1"
35
    And I am on "Course 1" course homepage
36
    And the "Receive a grade" completion condition of "Test quiz name" is displayed as "todo"
37
    And the "Receive a passing grade" completion condition of "Test quiz name" is displayed as "todo"
38
    And the "View" completion condition of "Test quiz name" is displayed as "todo"
39
    And user "student1" has attempted "Test quiz name" with responses:
40
      | slot | response |
41
      |   1  | True     |
42
    And I follow "Test quiz name"
43
    Then the "Receive a grade" completion condition of "Test quiz name" is displayed as "done"
44
    And the "Receive a passing grade" completion condition of "Test quiz name" is displayed as "done"
45
    And the "View" completion condition of "Test quiz name" is displayed as "done"
46
    And I am on "Course 1" course homepage
47
    And the "Receive a grade" completion condition of "Test quiz name" is displayed as "done"
48
    And the "Receive a passing grade" completion condition of "Test quiz name" is displayed as "done"
49
    And the "View" completion condition of "Test quiz name" is displayed as "done"
50
    And I log out
51
    And I log in as "teacher1"
52
    And I am on "Course 1" course homepage
53
    And I navigate to "Reports" in current page administration
54
    And I click on "Activity completion" "link"
55
    And "Completed" "icon" should exist in the "Student 1" "table_row"
56
 
57
  Scenario Outline: Verify that gradepass, together with completionpassgrade are validated correctly
58
    Given the following "language customisations" exist:
59
      | component       | stringid | value    |
60
      | core_langconfig | decsep   | <decsep> |
61
    And the following "activity" exist:
62
      | activity | name                             | course | idnumber | gradepass  | completion | completionpassgrade   |
63
      | quiz     | Oh, grades, passgrades and floats| C1     | ohgrades | <gradepass>| 2          | <completionpassgrade> |
64
    When  I am on the "ohgrades" "quiz activity editing" page logged in as "teacher1"
65
    And I expand all fieldsets
66
    And I set the field "Grade to pass" to "<gradepass>"
67
    And I set the field "Add requirements" to "1"
68
    And I set the field "Receive a grade" to "1"
69
    And I set the field "<completionpassgrade>" to "1"
70
    And I press "Save and display"
71
    Then I should see "<seen>"
72
    And I should not see "<notseen>"
73
 
74
    Examples:
75
      | gradepass | completionpassgrade | decsep | seen                  | notseen          | outcome        |
76
      |           | Any grade           | .      | method: Highest       | Save and display | ok             |
77
      |           | Passing grade       | .      | does not have a valid | method: Highest  | completion-err |
78
      | 0         | Any grade           | .      | method: Highest       | Save and display | ok             |
79
      | 0         | Passing grade       | .      | does not have a valid | method: Highest  | completion-err |
80
      | aaa       | Any grade           | .      | must enter a number   | method: Highest  | number-err     |
81
      | aaa       | Passing grade       | .      | must enter a number   | method: Highest  | number-err     |
82
      | 200       | Any grade           | .      | can not be greater    | method: Highest  | grade-big-err  |
83
      | 200       | Passing grade       | .      | can not be greater    | method: Highest  | grade-big-err  |
84
      | 5.55      | Any grade           | .      | 5.55 out of 100       | Save and display | ok             |
85
      | 5.55      | Passing grade       | .      | 5.55 out of 100       | Save and display | ok             |
86
      | 5#55      | Any grade           | .      | must enter a number   | method: Highest  | number-err     |
87
      | 5#55      | Passing grade       | .      | must enter a number   | method: Highest  | number-err     |
88
      | 5#55      | Any grade           | #      | 5#55 out of 100       | Save and display | ok             |
89
      | 5#55      | Passing grade       | #      | 5#55 out of 100       | Save and display | ok             |