Skip to content

Commit cb13bba

Browse files
nexterdaymarxjohnson
authored andcommitted
MDL-74836 theme: Display activity header on secure layouts
1 parent 2b337b4 commit cb13bba

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
@mod_quiz @quizaccess @quizaccess_seb
2+
Feature: View the activity header when Safe Exam Browser is required
3+
In order to correctly identify the quiz when Safe Exam Browser is required
4+
As a student
5+
I need to be able to see the quiz information in the activity header
6+
7+
Background:
8+
Given the following "users" exist:
9+
| username | firstname | lastname | email |
10+
| student1 | Sam1 | Student1 | 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+
| student1 | C1 | student |
17+
And the following "question categories" exist:
18+
| contextlevel | reference | name |
19+
| Course | C1 | Test questions |
20+
And the following "questions" exist:
21+
| questioncategory | qtype | name | questiontext |
22+
| Test questions | truefalse | TF1 | TF question |
23+
And the following "activity" exists:
24+
| activity | quiz |
25+
| course | C1 |
26+
| idnumber | 00001 |
27+
| name | Test quiz name |
28+
| intro | Test quiz description |
29+
| seb_requiresafeexambrowser | 1 |
30+
| grade | 10 |
31+
And quiz "Test quiz name" contains the following questions:
32+
| question | page |
33+
| TF1 | 1 |
34+
35+
Scenario: Quiz description is displayed when Safe Exam Browser is required
36+
When I am on the "Test quiz name" "quiz activity" page logged in as student1
37+
Then I should see "Launch Safe Exam Browser"
38+
And I should see "Test quiz description"

theme/boost/layout/secure.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,11 @@
3636
'hasblocks' => $hasblocks
3737
];
3838

39+
if (empty($PAGE->layout_options['noactivityheader'])) {
40+
$header = $PAGE->activityheader;
41+
$renderer = $PAGE->get_renderer('core');
42+
$templatecontext['headercontent'] = $header->export_for_template($renderer);
43+
}
44+
3945
echo $OUTPUT->render_from_template('theme_boost/secure', $templatecontext);
4046

theme/boost/templates/secure.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
<section id="region-main" {{#hasblocks}}class="has-blocks"{{/hasblocks}} aria-label="{{#str}}content{{/str}}">
6464

6565
{{{ output.course_content_header }}}
66+
{{#headercontent}}
67+
{{> core/activity_header }}
68+
{{/headercontent}}
6669
{{{ output.main_content }}}
6770
{{{ output.course_content_footer }}}
6871

theme/classic/layout/secure.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,11 @@
4242
'bodyattributes' => $bodyattributes
4343
];
4444

45+
if (empty($PAGE->layout_options['noactivityheader'])) {
46+
$header = $PAGE->activityheader;
47+
$renderer = $PAGE->get_renderer('core');
48+
$templatecontext['headercontent'] = $header->export_for_template($renderer);
49+
}
50+
4551
echo $OUTPUT->render_from_template('theme_classic/secure', $templatecontext);
4652

theme/classic/templates/secure.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
<div class="card">
7676
<div class="card-body">
7777
{{{ output.course_content_header }}}
78+
{{#headercontent}}
79+
{{> core/activity_header }}
80+
{{/headercontent}}
7881
{{{ output.main_content }}}
7982
{{{ output.course_content_footer }}}
8083
</div>

0 commit comments

Comments
 (0)