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 @javascript
2
Feature: Set a quiz to be marked complete when the student uses all attempts allowed
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 receives a passing grade, or completed_fail if they use all attempts without passing
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 | completionattemptsexhausted |
27
      | quiz     | Test quiz name | C1     | quiz1    | 2        | 5.00      | 2          | 1                  | 1                   | 1                           |
28
    And quiz "Test quiz name" contains the following questions:
29
      | question       | page |
30
      | First question | 1    |
31
    And user "student1" has attempted "Test quiz name" with responses:
32
      | slot | response |
33
      |   1  | False    |
34
 
35
  Scenario Outline: Student attempts the quiz - pass and fails
36
    When I am on the "Course 1" course page logged in as student1
37
    And the "Receive a grade" completion condition of "Test quiz name" is displayed as "done"
38
    And the "Receive a passing grade" completion condition of "Test quiz name" is displayed as "failed"
39
    And the "Receive a pass grade or complete all available attempts" completion condition of "Test quiz name" is displayed as "todo"
40
    And I follow "Test quiz name"
41
    And I press "Re-attempt quiz"
42
    And I set the field "<answer>" to "1"
43
    And I press "Finish attempt ..."
44
    And I press "Submit all and finish"
45
    And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
46
    And I am on "Course 1" course homepage
47
    Then 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 "<passcompletionexpected>"
49
    And the "Receive a pass grade or complete all available attempts" completion condition of "Test quiz name" is displayed as "done"
50
    And I click on "Test quiz name" "link" in the "region-main" "region"
51
    And the "Receive a grade" completion condition of "Test quiz name" is displayed as "done"
52
    And the "Receive a passing grade" completion condition of "Test quiz name" is displayed as "<passcompletionexpected>"
53
    And the "Receive a pass grade or complete all available attempts" completion condition of "Test quiz name" is displayed as "done"
54
    And I log out
55
    And I am on the "Test quiz name" "quiz activity" page logged in as teacher1
56
    And "Test quiz name" should have the "Receive a pass grade or complete all available attempts" completion condition
57
    And I am on "Course 1" course homepage
58
    And I navigate to "Reports" in current page administration
59
    And I click on "Activity completion" "link"
60
    And "<expectedactivitycompletion>" "icon" should exist in the "Student 1" "table_row"
61
 
62
    Examples:
63
      | answer | passcompletionexpected | expectedactivitycompletion                 |
64
      | False  | failed                 | Completed (did not achieve pass grade)     |
65
      | True   | done                   | Completed (achieved pass grade)            |