Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion classes/output/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,8 @@ public function teacherdash() {
$userlinksdesc = get_string('userlinks_desc', 'theme_fordson');
$qbank = get_string('qbank', 'theme_fordson');
$qbankdesc = get_string('qbank_desc', 'theme_fordson');
$cbank = get_string('cbank', 'theme_fordson');
$cbankdesc = get_string('cbank_desc', 'theme_fordson');
$badges = get_string('badges', 'theme_fordson');
$badgesdesc = get_string('badges_desc', 'theme_fordson');
$coursemanage = get_string('coursemanage', 'theme_fordson');
Expand Down Expand Up @@ -1329,6 +1331,11 @@ public function teacherdash() {
$qexportlink = new moodle_url('/question/export.php', array(
'courseid' => $PAGE->course->id
));
// Content Bank.
$cbankaddtitle = get_string('contentbank', 'moodle');
$cbankaddlink = new moodle_url('/contentbank/index.php', array(
'contextid' => $context->id
));
// Manage course.
$courseadmintitle = get_string('courseadministration', 'moodle');
$courseadminlink = new moodle_url('/course/admin.php', array(
Expand Down Expand Up @@ -1516,6 +1523,7 @@ public function teacherdash() {
$studentcoursemanage = get_string('courseadministration', 'moodle');
// Permissionchecks for teacher access.
$hasquestionpermission = has_capability('moodle/question:add', $context);
$hascontentbankpermission = has_capability('contenttype/h5p:access', $context);
$hasbadgepermission = has_capability('moodle/badges:awardbadge', $context);
$hascoursepermission = has_capability('moodle/backup:backupcourse', $context);
$hasuserpermission = has_capability('moodle/course:viewhiddenactivities', $context);
Expand All @@ -1537,7 +1545,9 @@ public function teacherdash() {
'qbanktitle' => $qbank,
'activitylinkstitle' => $activitylinkstitle,
'activitylinkstitle_desc' => $activitylinkstitle_desc,
'qbankdesc' => $qbankdesc,
'qbankdesc' => $qbankdesc,
'cbanktitle' => $cbank,
'cbankdesc' => $cbankdesc,
'badgestitle' => $badges,
'badgesdesc' => $badgesdesc,
'coursemanagetitle' => $coursemanage,
Expand All @@ -1558,6 +1568,7 @@ public function teacherdash() {
'editcog'=> $editcog,
'teacherdash' => array(
'hasquestionpermission' => $hasquestionpermission,
'hascontentbankpermission' => $hascontentbankpermission,
'hasbadgepermission' => $hasbadgepermission,
'hascoursepermission' => $hascoursepermission,
'hasuserpermission' => $hasuserpermission
Expand Down Expand Up @@ -1717,6 +1728,11 @@ public function teacherdash() {
'title' => $badgeaddtitle,
'url' => $badgeaddlink
) ,
array(
'hascbanklinks' => $cbankaddtitle,
'title' => $cbankaddtitle,
'url' => $cbankaddlink
) ,
) ,
];
// Attach easy enrollment links if active.
Expand Down
2 changes: 2 additions & 0 deletions lang/en/theme_fordson.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@
//teacher and student dashboard slider
$string['userlinks'] = 'User Links';
$string['userlinks_desc'] = 'Manage your students';
$string['cbank'] = 'Content Bank';
$string['cbank_desc'] = 'Manage interactive content';
$string['qbank'] = 'Question Bank';
$string['qbank_desc'] = 'Create and organize quiz questions';
$string['badges'] = 'Badges';
Expand Down
13 changes: 13 additions & 0 deletions templates/teacherdash.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@
{{/dashlinks}}
</div>
{{/hasquestionpermission}}
{{#hascontentbankpermission}}
<div class="dashtitle">
<h3><i class="fa fa-paint-brush dashicon"></i>{{{cbanktitle}}}</h3>
<p>{{{cbankdesc}}}</p>
</div>
<div class="list-group">
{{#dashlinks}}
{{#hascbanklinks}}
<a href="{{{url}}}" class="list-group-item">{{{title}}}</a>
{{/hascbanklinks}}
{{/dashlinks}}
</div>
{{/hascontentbankpermission}}
{{#hasbadgepermission}}
<div class="dashtitle">
<h3><i class="fa fa-trophy dashicon"></i>{{{badgestitle}}}</h3>
Expand Down