Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.9
-
Fix Version/s: None
-
Component/s: Gradebook
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE
Description
While the pull-down menu to get to new gradebook forms in 1.9 show that flexible, the tabs of earlier version were intuitive and went to what was important and common. I recommend adding them back and here is the patch:
1. Create /grade/tabs.php with this content:
<?php
$row = $tabs = array();
$tabcontext = get_context_instance(CONTEXT_COURSE, $COURSE->id);
if (has_capability('moodle/grade:manage',$tabcontext ) ||
has_capability('moodle/grade:edit', $tabcontext) ||
has_capability('gradereport/grader:view', $tabcontext)) {
$row[] = new tabobject('graderreport',
$CFG->wwwroot.'/grade/report/grader/index.php?id='.$courseid,
get_string('modulename', 'gradereport_grader'));
$row[] = new tabobject('preferences',
$CFG->wwwroot.'/grade/report/grader/preferences.php?id='.$courseid,
get_string('myreportpreferences', 'grades'));
$row[] = new tabobject('report',
$CFG->wwwroot.'/grade/report/user/index.php?id='.$courseid,
get_string('report', 'grades'));
$row[] = new tabobject('categoriesanditems',
$CFG->wwwroot.'/grade/edit/tree/index.php?id='.$courseid,
get_string('categoriesanditems', 'grades'));
$tabs[] = $row;
echo '<div class="gradedisplay">';
print_tabs($tabs, $currenttab);
echo '</div>';
}
?>
2. After print_heading(get_string('categoriesedit', 'grades')); in /grade/edit/tree/index.php, add:
$currenttab = 'categoriesanditems';
include($CFG->dirroot.'/grade/tabs.php');
3. Replace the line require('tabs.php'); in grade/report/grader/index.php with
$currenttab = 'graderreport';
include($CFG->dirroot.'/grade/tabs.php');
4. Replace line include('tab.php'); in grade/report/grader/preference.php with
$currenttab = 'preferences';
include($CFG->dirroot.'/grade/tabs.php');
5. After print_grade_plugin_selector($courseid, 'report', 'user'); in /grade/report/user/index.php add
// Add tabs
$currenttab = 'report';
include($CFG->dirroot.'/grade/tabs.php');
Note that I use include rather than require because it does not give a fatal error when tabs.php fails to load.
Attachments
Issue Links
| This issue will help resolve: | ||||
| MDL-18004 | Tabs navigation for gradebook |
|
|
|
Makes navigation easier and user interfact more intuitive