1 |
efrain |
1 |
@mod @mod_assign
|
|
|
2 |
Feature: In an assignment, students can add and edit text online
|
|
|
3 |
In order to complete my submissions online
|
|
|
4 |
As a student
|
|
|
5 |
I need to submit my assignment editing an online form
|
|
|
6 |
|
|
|
7 |
@javascript
|
|
|
8 |
Scenario: Submit a text online and edit the submission
|
|
|
9 |
Given the following "courses" exist:
|
|
|
10 |
| fullname | shortname | category | groupmode |
|
|
|
11 |
| Course 1 | C1 | 0 | 1 |
|
|
|
12 |
And the following "users" exist:
|
|
|
13 |
| username | firstname | lastname | email |
|
|
|
14 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
15 |
| student1 | Student | 1 | student1@example.com |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
And the following "activity" exists:
|
|
|
21 |
| activity | assign |
|
|
|
22 |
| course | C1 |
|
|
|
23 |
| name | Test assignment name |
|
|
|
24 |
| intro | Submit your online text |
|
|
|
25 |
| submissiondrafts | 0 |
|
|
|
26 |
| assignsubmission_onlinetext_enabled | 1 |
|
|
|
27 |
| assignsubmission_onlinetext_wordlimit_enabled | 1 |
|
|
|
28 |
| assignsubmission_onlinetext_wordlimit | 10 |
|
|
|
29 |
| assignsubmission_file_enabled | 0 |
|
|
|
30 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
31 |
When I press "Add submission"
|
|
|
32 |
And I set the following fields to these values:
|
|
|
33 |
| Online text | This is more than 10 words. 1 2 3 4 5 6 7 8 9 10. |
|
|
|
34 |
And I press "Save changes"
|
|
|
35 |
Then I should see "Please review your submission and try again."
|
|
|
36 |
And I set the following fields to these values:
|
|
|
37 |
| Online text | I'm the student first submission |
|
|
|
38 |
And I press "Save changes"
|
|
|
39 |
Then I should see "Submitted for grading"
|
|
|
40 |
And I should see "I'm the student first submission"
|
|
|
41 |
And I should see "Not graded"
|
|
|
42 |
And I press "Edit submission"
|
|
|
43 |
And I set the following fields to these values:
|
|
|
44 |
| Online text | I'm the student second submission |
|
|
|
45 |
And I press "Save changes"
|
|
|
46 |
Then I should see "Submitted for grading"
|
|
|
47 |
And I should see "I'm the student second submission"
|
|
|
48 |
And I should not see "I'm the student first submission"
|
|
|
49 |
|
|
|
50 |
@javascript
|
|
|
51 |
Scenario: Auto-draft save online text submission
|
|
|
52 |
Given the following "courses" exist:
|
|
|
53 |
| fullname | shortname | category | groupmode |
|
|
|
54 |
| Course 1 | C1 | 0 | 1 |
|
|
|
55 |
And the following "users" exist:
|
|
|
56 |
| username | firstname | lastname | email |
|
|
|
57 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
58 |
| student1 | Student | 1 | student1@example.com |
|
|
|
59 |
And the following "course enrolments" exist:
|
|
|
60 |
| user | course | role |
|
|
|
61 |
| teacher1 | C1 | editingteacher |
|
|
|
62 |
| student1 | C1 | student |
|
|
|
63 |
And the following "activity" exists:
|
|
|
64 |
| activity | assign |
|
|
|
65 |
| course | C1 |
|
|
|
66 |
| name | Test assignment name |
|
|
|
67 |
| intro | Submit your online text |
|
|
|
68 |
| submissiondrafts | 0 |
|
|
|
69 |
| assignsubmission_onlinetext_enabled | 1 |
|
|
|
70 |
| assignsubmission_file_enabled | 0 |
|
|
|
71 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
72 |
When I press "Add submission"
|
|
|
73 |
And I set the following fields to these values:
|
|
|
74 |
| Online text | text submission |
|
|
|
75 |
# Wait for the draft auto save.
|
|
|
76 |
And I wait "2" seconds
|
|
|
77 |
And I am on the "Test assignment name" Activity page
|
|
|
78 |
When I press "Add submission"
|
|
|
79 |
# Confirm draft was restored.
|
|
|
80 |
Then the field "Online text" matches value "text submission"
|