Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12135

Add back tabs to gradebook 1.9 to make more user friendly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • 1.9
    • Gradebook
    • None
    • MOODLE_19_STABLE

      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.

        1. TabsAdded to Gradebook 1.9.jpg
          97 kB
          Gary Anderson

            dougiamas Martin Dougiamas
            ganderson Gary Anderson (Inactive)
            Nicolas Martignoni Nicolas Martignoni
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.