1 |
efrain |
1 |
@block @block_section_links
|
|
|
2 |
Feature: The Section links block can be configured to display section name in addition to section number
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "course" exists:
|
|
|
6 |
| fullname | Course 1 |
|
|
|
7 |
| shortname | C1 |
|
|
|
8 |
| category | 0 |
|
|
|
9 |
| numsections | 10 |
|
|
|
10 |
| coursedisplay | 1 |
|
|
|
11 |
| initsections | 1 |
|
|
|
12 |
And the following "activities" exist:
|
|
|
13 |
| activity | name | course | idnumber | section |
|
|
|
14 |
| assign | First assignment | C1 | assign1 | 7 |
|
|
|
15 |
And the following "users" exist:
|
|
|
16 |
| username | firstname | lastname | email |
|
|
|
17 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
18 |
| student1 | Student | 1 | student1@example.com |
|
|
|
19 |
And the following "course enrolments" exist:
|
|
|
20 |
| user | course | role |
|
|
|
21 |
| teacher1 | C1 | editingteacher |
|
|
|
22 |
| student1 | C1 | student |
|
|
|
23 |
And the following config values are set as admin:
|
|
|
24 |
| showsectionname | 1 | block_section_links |
|
|
|
25 |
| unaddableblocks | | theme_boost|
|
|
|
26 |
And the following "blocks" exist:
|
|
|
27 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
28 |
| section_links | Course | C1 | course-view-* | side-pre |
|
|
|
29 |
|
|
|
30 |
Scenario: Student can see section name under the Section links block
|
|
|
31 |
When I am on the "Course 1" course page logged in as student1
|
|
|
32 |
Then I should see "7: Section 7" in the "Section links" "block"
|
|
|
33 |
And I follow "7: Section 7"
|
|
|
34 |
And I should see "First assignment"
|
|
|
35 |
|
|
|
36 |
Scenario: Teacher can configure existing Section links block to display section number or section name
|
|
|
37 |
Given I log in as "teacher1"
|
|
|
38 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
39 |
When I configure the "Section links" block
|
|
|
40 |
And I set the following fields to these values:
|
|
|
41 |
| Display section name | No |
|
|
|
42 |
And I click on "Save changes" "button"
|
|
|
43 |
Then I should not see "7: Section 7" in the "Section links" "block"
|
|
|
44 |
And I should see "7" in the "Section links" "block"
|
|
|
45 |
And I follow "7"
|
|
|
46 |
And I should see "First assignment"
|