1 |
efrain |
1 |
@mod @mod_lesson @_file_upload
|
|
|
2 |
Feature: In a lesson activity, teacher can add an essay question
|
|
|
3 |
As a teacher
|
|
|
4 |
I need to add an essay question in a lesson and grade student attempts
|
|
|
5 |
|
|
|
6 |
Scenario: questions with essay question
|
|
|
7 |
Given the following "users" exist:
|
|
|
8 |
| username | firstname | lastname | email |
|
|
|
9 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
10 |
| student1 | Student | 1 | 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 | feedback |
|
|
|
20 |
| lesson | Test lesson name | C1 | lesson1 | 1 |
|
|
|
21 |
And the following "mod_lesson > page" exist:
|
|
|
22 |
| lesson | qtype | title | content |
|
|
|
23 |
| Test lesson name | essay | Essay question | <p>Please write a story about a <b>frog</b>.</p> |
|
|
|
24 |
And the following "mod_lesson > answer" exist:
|
|
|
25 |
| page | jumpto | score |
|
|
|
26 |
| Essay question | Next page | 1 |
|
|
|
27 |
When I am on the "Test lesson name" "lesson activity" page logged in as student1
|
|
|
28 |
Then I should see "Please write a story about a frog."
|
|
|
29 |
And I set the field "Your answer" to "<p>Once upon a time there was a little <b>green</b> frog."
|
|
|
30 |
And I press "Submit"
|
|
|
31 |
And I should see "Your answer"
|
|
|
32 |
And I should see "Once upon a time there was a little green frog."
|
|
|
33 |
And I should not see "<b>"
|
|
|
34 |
And I press "Continue"
|
|
|
35 |
And I should see "Congratulations - end of lesson reached"
|
|
|
36 |
And I should see "You earned 0 out of 0 for the automatically graded questions."
|
|
|
37 |
And I should see "Your 1 essay question(s) will be graded and added into your final score at a later date."
|
|
|
38 |
And I should see "Your current grade without the essay question(s) is 0 out of 1."
|
|
|
39 |
And I am on the "Test lesson name" "lesson activity" page logged in as teacher1
|
|
|
40 |
And I grade lesson essays
|
|
|
41 |
And I should see "Student 1"
|
|
|
42 |
And I should see "Essay question"
|
|
|
43 |
And I follow "Essay question"
|
|
|
44 |
And I should see "Student 1's response"
|
|
|
45 |
And I should see "Once upon a time there was a little green frog."
|
|
|
46 |
And I set the following fields to these values:
|
|
|
47 |
| Your comments | <p>Well <b>done</b>.</p> |
|
|
|
48 |
| Essay score | 1 |
|
|
|
49 |
And I press "Save changes"
|
|
|
50 |
And I should see "Changes saved"
|
|
|
51 |
And I navigate to "Reports" in current page administration
|
|
|
52 |
And I should see "Student 1"
|
|
|
53 |
And I click on ".lesson-attempt-link" "css_element" in the "Student 1" "table_row"
|
|
|
54 |
And I should see "Essay: Essay question"
|
|
|
55 |
And I should see "Please write a story about a frog."
|
|
|
56 |
And I should see "Once upon a time there was a little green frog."
|
|
|
57 |
And I should see "Well done."
|
|
|
58 |
And I should not see "<b>"
|