Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-30802 question nav: fix questions link in front page course.

  • Loading branch information...
commit c9882b747ace093a1c9a9980a16648a728158b15 1 parent ddb7ae2
@timhunt timhunt authored
Showing with 4 additions and 18 deletions.
  1. +4 −18 lib/navigationlib.php
View
22 lib/navigationlib.php
@@ -3250,7 +3250,7 @@ protected function load_course_settings($forceopen = false) {
}
// Questions
- require_once($CFG->dirroot.'/question/editlib.php');
+ require_once($CFG->libdir . '/questionlib.php');
question_extend_settings_navigation($coursenode, $coursecontext)->trim_if_empty();
if (has_capability('moodle/course:update', $coursecontext)) {
@@ -3952,23 +3952,9 @@ protected function load_front_page_settings($forceopen = false) {
$frontpage->add(get_string('restore'), $url, self::TYPE_SETTING, null, null, new pix_icon('i/restore', ''));
}
- // Manage questions
- $questioncaps = array('moodle/question:add',
- 'moodle/question:editmine',
- 'moodle/question:editall',
- 'moodle/question:viewmine',
- 'moodle/question:viewall',
- 'moodle/question:movemine',
- 'moodle/question:moveall');
- if (has_any_capability($questioncaps, $this->context)) {
- $questionlink = $CFG->wwwroot.'/question/edit.php';
- } else if (has_capability('moodle/question:managecategory', $this->context)) {
- $questionlink = $CFG->wwwroot.'/question/category.php';
- }
- if (isset($questionlink)) {
- $url = new moodle_url($questionlink, array('courseid'=>$course->id));
- $frontpage->add(get_string('questions','quiz'), $url, self::TYPE_SETTING, null, null, new pix_icon('i/questions', ''));
- }
+ // Questions
+ require_once($CFG->libdir . '/questionlib.php');
+ question_extend_settings_navigation($frontpage, $coursecontext)->trim_if_empty();
// Manage files
if ($course->legacyfiles == 2 and has_capability('moodle/course:managefiles', $this->context)) {
Please sign in to comment.
Something went wrong with that request. Please try again.