Moodle

Add back tabs to gradebook 1.9 to make more user friendly

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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.

Issue Links

Activity

Hide
Gary Anderson added a comment -

Makes navigation easier and user interfact more intuitive

Show
Gary Anderson added a comment - Makes navigation easier and user interfact more intuitive
Hide
Martin Dougiamas added a comment -

Hmm ... the idea with our change was to completely separate

  • settings that affect everyone looking at the grades
  • preferences that govern how a report appears to ME

In older versions these were mixed and not clear.

I think we won't be making this change in the standard reports but the beauty of the new gradebook plugins is that you can make your own new custom report plugin as you like it, and disable the original one using capabilities.

Thanks very much for the suggestion though!

Show
Martin Dougiamas added a comment - Hmm ... the idea with our change was to completely separate
  • settings that affect everyone looking at the grades
  • preferences that govern how a report appears to ME
In older versions these were mixed and not clear. I think we won't be making this change in the standard reports but the beauty of the new gradebook plugins is that you can make your own new custom report plugin as you like it, and disable the original one using capabilities. Thanks very much for the suggestion though!
Hide
Nicolas Martignoni added a comment -

Closing per Martin comment.

Show
Nicolas Martignoni added a comment - Closing per Martin comment.
Hide
Petr Škoda (skodak) added a comment -

We can not construct the tabs because several reports might want to include the "Edit" tab for categories and items. Maybe a button instead.

Show
Petr Škoda (skodak) added a comment - We can not construct the tabs because several reports might want to include the "Edit" tab for categories and items. Maybe a button instead.

People

Dates

  • Created:
    Updated:
    Resolved: