Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_lesson
2
Feature: In a lesson activity, if custom scoring is not enabled, student should see
3
  some informations at the end of lesson: questions answered, correct answers, grade, score
4
 
5
  Background:
6
    Given the following "users" exist:
7
      | username | firstname | lastname | email |
8
      | teacher1 | Teacher | 1 | teacher1@example.com |
9
      | student1 | Student | 1 | student1@example.com |
10
    And the following "scales" exist:
11
      | name       | scale                          |
12
      | Test Scale | Disappointing, Good, Excellent |
13
    And the following "courses" exist:
14
      | fullname | shortname | category |
15
      | Course 1 | C1 | 0 |
16
    And the following "course enrolments" exist:
17
      | user | course | role |
18
      | teacher1 | C1 | editingteacher |
19
      | student1 | C1 | student |
20
    And the following "activities" exist:
21
      | activity   | name             | course | idnumber  |
22
      | lesson     | Test lesson name | C1     | lesson1   |
23
    And the following "mod_lesson > pages" exist:
24
      | lesson           | qtype   | title                 | content             |
25
      | Test lesson name | content | First page name       | First page contents |
26
      | Test lesson name | numeric | Hardest question ever | 1 + 1?              |
27
    And the following "mod_lesson > answers" exist:
28
      | page                  | answer    | response         | jumpto    | score |
29
      | First page name       | Next page |                  | Next page | 0     |
30
      | Hardest question ever | 2         | Correct answer   | Next page | 1     |
31
      | Hardest question ever | 1         | Incorrect answer | This page | 0     |
32
    And I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
33
    And I set the following fields to these values:
34
      | Maximum grade  | 75 |
35
      | Custom scoring | No    |
36
    And I press "Save and display"
37
 
38
  Scenario: Informations at end of lesson if custom scoring not enabled
39
    Given I am on the "Test lesson name" "lesson activity" page logged in as student1
40
    And I should see "First page contents"
41
    When I press "Next page"
42
    And I should see "1 + 1?"
43
    And I set the following fields to these values:
44
      | Your answer | 1 |
45
    And I press "Submit"
46
    And I should see "Incorrect answer"
47
    And I press "Continue"
48
    Then I should see "Congratulations - end of lesson reached"
49
    And I should see "Number of questions answered: 1"
50
    And I should see "Number of correct answers: 0"
51
    And I should see "Your score is 0 (out of 1)."
52
    And I should see "Your current grade is 0.0 out of 75"
53
 
54
  Scenario: Informations at end of lesson if custom scoring not enabled with custom decimal separator
55
    Given the following "language customisations" exist:
56
      | component       | stringid | value |
57
      | core_langconfig | decsep   | #     |
58
    And I am on the "Test lesson name" "lesson activity" page logged in as student1
59
    And I should see "First page contents"
60
    When I press "Next page"
61
    And I should see "1 + 1?"
62
    And I set the following fields to these values:
63
      | Your answer | 1 |
64
    And I press "Submit"
65
    And I should see "Incorrect answer"
66
    And I press "Continue"
67
    Then I should see "Congratulations - end of lesson reached"
68
    And I should see "Number of questions answered: 1"
69
    And I should see "Number of correct answers: 0"
70
    And I should see "Your score is 0 (out of 1)."
71
    And I should see "Your current grade is 0#0 out of 75"
72
 
73
  Scenario: Current grade is displayed at end of lesson when grade type is set to scale
74
    Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
75
    And I set the field "grade[modgrade_type]" to "Scale"
76
    And I set the field "Scale" to "Test Scale"
77
    And I press "Save and return to course"
78
    When I am on the "Test lesson name" "lesson activity" page logged in as student1
79
    And I press "Next page"
80
    And I should see "1 + 1?"
81
    And I set the following fields to these values:
82
      | Your answer | 2 |
83
    And I press "Submit"
84
    And I press "Continue"
85
    Then I should see "Congratulations - end of lesson reached"
86
    And I should see "Your score is 1 (out of 1)."
87
    And I should see "Your current grade is Excellent"
88
 
89
  Scenario: Verify lesson summary with grade type set to none
90
    Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
91
    # Since by default the grade type is point, change it to None.
92
    And I set the field "grade[modgrade_type]" to "None"
93
    And I press "Save and return to course"
94
    # Answer the question incorrectly.
95
    When I am on the "Test lesson name" "lesson activity" page logged in as student1
96
    And I press "Next page"
97
    And I set the following fields to these values:
98
      | Your answer | 1 |
99
    And I press "Submit"
100
    And I press "Continue"
101
    # Confirm the information displayed at the end of lesson when grade type is set to None.
102
    Then I should see "Congratulations - end of lesson reached"
103
    And I should see "Number of questions answered: 1"
104
    And I should see "Number of correct answers: 0"
105
    And I should see "Your score is 0 (out of 1)."
106
    And I should not see "Your current grade is 0.0 out of 75"