Removed duplicate capability moodle/course:managequestions MDL-6610
This commit is contained in:
@@ -117,7 +117,7 @@ class block_admin extends block_list {
|
||||
}
|
||||
|
||||
/// Manage questions
|
||||
if (has_capability('moodle/course:managequestions', $context)) {
|
||||
if (has_capability('moodle/question:manage', $context)) {
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/question/edit.php?courseid='.$this->instance->pageid.'&clean=true">'.get_string('questions', 'quiz').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/questions.gif" alt="" />';
|
||||
}
|
||||
|
||||
@@ -102,7 +102,6 @@ $string['course:managescales'] = 'Manage scales';
|
||||
$string['course:managegroups'] = 'Manage groups';
|
||||
$string['course:managefiles'] = 'Manage files';
|
||||
$string['course:managemetacourse'] = 'Manage metacourse';
|
||||
$string['course:managequestions'] = 'Manage questions';
|
||||
$string['course:reset'] = 'Reset course';
|
||||
$string['course:sectionvisibility'] = 'Control section visibility';
|
||||
$string['course:viewhiddensections'] = 'View hidden sections';
|
||||
|
||||
@@ -629,22 +629,6 @@ $moodle_capabilities = array(
|
||||
)
|
||||
),
|
||||
|
||||
'moodle/course:managequestions' => array(
|
||||
|
||||
'riskbitmask' => RISK_XSS,
|
||||
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
'legacy' => array(
|
||||
'guest' => CAP_PREVENT,
|
||||
'student' => CAP_PREVENT,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'coursecreator' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
|
||||
'moodle/course:manageactivities' => array(
|
||||
|
||||
'riskbitmask' => RISK_XSS,
|
||||
|
||||
@@ -106,7 +106,7 @@ function question_category_menu($courseid, $published=false) {
|
||||
$publish = "OR publish = '1'";
|
||||
}
|
||||
|
||||
if (!has_capability('moodle/course:managequestions', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
|
||||
if (!has_capability('moodle/question:manage', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
|
||||
$categories = get_records_select("question_categories", "course = '$courseid' $publish", 'parent, sortorder, name ASC');
|
||||
} else {
|
||||
$categories = get_records_select("question_categories", '', 'parent, sortorder, name ASC');
|
||||
|
||||
+1
-1
@@ -183,7 +183,7 @@
|
||||
print_heading_with_help($txt->importquestions, "import", "quiz");
|
||||
|
||||
/// Get all the existing categories now
|
||||
if (has_capability('moodle/course:managequestions', get_context_instance(CONTEXT_SYSTEM, SITEID))) { // the admin can import into all categories
|
||||
if (has_capability('moodle/question:manage', get_context_instance(CONTEXT_SYSTEM, SITEID))) { // the admin can import into all categories
|
||||
if (!$categories = get_records_select("question_categories", "course = '{$course->id}' OR publish = '1'", "parent, sortorder, name ASC")) {
|
||||
error("Could not find any question categories!"); // Something is really wrong
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
// Check user admin
|
||||
require_login();
|
||||
require_capability('moodle/course:managequestions', get_context_instance(CONTEXT_SYSTEM, SITEID));
|
||||
require_capability('moodle/question:manage', get_context_instance(CONTEXT_SYSTEM, SITEID));
|
||||
|
||||
if (!$site = get_site()) {
|
||||
error('Site isn\'t defined!');
|
||||
|
||||
Reference in New Issue
Block a user