1 |
efrain |
1 |
@core @core_course
|
|
|
2 |
Feature: Add activities to courses
|
|
|
3 |
In order to provide tools for students learning
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to add activites to a course
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | format |
|
|
|
10 |
| Course 1 | Course 1 | topics |
|
|
|
11 |
|
|
|
12 |
Scenario: Add an activity to a course
|
|
|
13 |
Given I log in as "admin"
|
|
|
14 |
When I add a data activity to course "Course 1" section "3" and I fill the form with:
|
|
|
15 |
| Name | Test name |
|
|
|
16 |
| Description | Test database description |
|
|
|
17 |
| ID number | TESTNAME |
|
|
|
18 |
| Allow comments on entries | Yes |
|
|
|
19 |
| Force language | English |
|
|
|
20 |
Then I should not see "Adding a new"
|
|
|
21 |
And I am on the "Test name" "data activity editing" page
|
|
|
22 |
And the following fields match these values:
|
|
|
23 |
| Name | Test name |
|
|
|
24 |
| ID number | TESTNAME |
|
|
|
25 |
| Allow comments on entries | Yes |
|
|
|
26 |
| Force language | English ‎(en)‎ |
|
|
|
27 |
|
|
|
28 |
Scenario: Add an activity supplying only the name
|
|
|
29 |
Given I log in as "admin"
|
|
|
30 |
When I add a data activity to course "Course 1" section "3" and I fill the form with:
|
|
|
31 |
| Name | Test name |
|
|
|
32 |
Then I should see "Test name"
|
|
|
33 |
|
|
|
34 |
Scenario: Set activity description to required then add an activity supplying only the name
|
|
|
35 |
Given the following config values are set as admin:
|
|
|
36 |
| requiremodintro | 1 |
|
|
|
37 |
And I log in as "admin"
|
|
|
38 |
And I add a data activity to course "Course 1" section "3" and I fill the form with:
|
|
|
39 |
| Name | Test name |
|
|
|
40 |
Then I should see "Required"
|
|
|
41 |
|
|
|
42 |
Scenario: The activity description should use the user's preferred editor on creation
|
|
|
43 |
Given the following "user preferences" exist:
|
|
|
44 |
| user | preference | value |
|
|
|
45 |
| admin | htmleditor | textarea |
|
|
|
46 |
And I am logged in as admin
|
|
|
47 |
When I add a data activity to course "Course 1" section "3"
|
|
|
48 |
Then the field "Description format" matches value "0"
|
|
|
49 |
|
|
|
50 |
Scenario: The activity description should preserve the format used once edited (markdown version)
|
|
|
51 |
Given the following "activities" exist:
|
|
|
52 |
| activity | name | intro | introformat | course |
|
|
|
53 |
| assign | A4 | Desc 4 | 4 | Course 1 |
|
|
|
54 |
And the following "user preferences" exist:
|
|
|
55 |
| user | preference | value |
|
|
|
56 |
| admin | htmleditor | textarea |
|
|
|
57 |
And I am logged in as admin
|
|
|
58 |
When I am on the "A4" "assign activity editing" page
|
|
|
59 |
Then the field "Description format" matches value "4"
|
|
|
60 |
|
|
|
61 |
Scenario: The activity description should preserve the format used once edited (plain text version)
|
|
|
62 |
Given the following "activities" exist:
|
|
|
63 |
| activity | name | intro | introformat | course |
|
|
|
64 |
| assign | A2 | Desc 2 | 2 | Course 1 |
|
|
|
65 |
And the following "user preferences" exist:
|
|
|
66 |
| user | preference | value |
|
|
|
67 |
| admin | htmleditor | textarea |
|
|
|
68 |
And I am logged in as admin
|
|
|
69 |
When I am on the "A2" "assign activity editing" page
|
|
|
70 |
Then the field "Description format" matches value "2"
|