mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00

Issue: Teachers can edit grader report preferences (including switches for quickgrading and quickfeedback), but do not have access to the "Turn editing on/off" button, so they can't do quickgrading. Solutions: 1.Decouple the quickgrading and quickfeedback modes from the editing mode, and turn them on/off through the preferences page. New capability: moodle/grade:edit * preferences: don't show quickgrading if no capability grade:edit * If quickgrading is switched off as a preference and user doesn't have manage cap, show edit icons around grades when in editing mode
19 lines
836 B
PHP
19 lines
836 B
PHP
<?php // $Id$
|
|
$row = $tabs = array();
|
|
$tabcontext = get_context_instance(CONTEXT_COURSE, $COURSE->id);
|
|
$row[] = new tabobject('graderreport',
|
|
$CFG->wwwroot.'/grade/report/grader/index.php?id='.$courseid,
|
|
get_string('modulename', 'gradereport_grader'));
|
|
if (has_capability('moodle/grade:manage',$tabcontext ) ||
|
|
has_capability('moodle/grade:edit', $tabcontext) ||
|
|
has_capability('gradereport/grader:view', $tabcontext)) {
|
|
$row[] = new tabobject('preferences',
|
|
$CFG->wwwroot.'/grade/report/grader/preferences.php?id='.$courseid,
|
|
get_string('preferences'));
|
|
}
|
|
|
|
$tabs[] = $row;
|
|
echo '<div class="gradedisplay">';
|
|
print_tabs($tabs, $currenttab);
|
|
echo '</div>';
|
|
?>
|