Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-738

Gradebook Replacement



    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9, 1.9.1, 1.9.2
    • Fix Version/s: None
    • Component/s: Patch: LSU gradebook
    • Labels:
    • Environment:
      Requires php5
    • Database:
    • Affected Branches:


      Latest documentation can be found at: http://docs.moodle.org/en/grade/report/simple_grader/index

      Please let us know what we can do to make this system better.
      Install instructions follow.

      A full featured simple grader report requires the simple tree, anonymous grade block, a slight modification to the existing theme's header.html, and a slight modification to lib/grade/grade_item.php.

      • Once the simple grader has been installed, editing the header.html should consist of adding the following lines in the 'head' element:

      <?php $filenamejs = "$CFG->dirroot/grade/report/simple_grader/lib/menufixer.php";
      if (file_exists($filenamejs))

      { include($filenamejs); }


      • The modification in grade_item.php is simply changing:

      var $aggregationcoef = 0;


      var $aggregationcoef = 1;

      • Add a check for Simple Grader report to gradelib, located in {MOODLE_ROOT}/lib/gradelib.php:

        At the very beginning of the function grade_regrade_final_grade, you must add code that calculates core modules correctly. So, the code below must be added right under the function declaration line which looks something like:

        function grade_regrade_final_grades($courseid, $userid=null, $updated_item=null) {
        // Check for Simple Grader Report
        global $CFG;

        $exists = file_exists($CFG->dirroot. '/grade/report/simple_grader/lib/simple_gradelib.php');
        if ($exists) { require_once($CFG->dirroot . '/grade/report/simple_grader/lib/simple_gradelib.php'); return simple_grade_regrade_final_grades($courseid, $userid, $updated_item); }

        * Add a similar check in {MOODLE_ROOT}

        /grade/import/lib.php around line 55 in function grade_import_commit add the following:

      $use_function = false;
      $file = $CFG->dirroot . '/grade/report/simple_grader/lib/simple_gradelib.php';
      if (file_exists($file))

      { require_once($file); $use_function = true; }

      Then jump to around line 82:

      // insert each individual grade to this new grade item
      foreach ($grades as $grade) {
      if ($use_function){
      if(!simple_update_final_grade($grade->userid, $gradeitem, 2, $grade->finalgrade, 'import', $grade->feedback, FORMAT_MOODLE))

      { $failed = true; break 2; }

      } else if (!$gradeitem->update_final_grade($grade->userid, $grade->finalgrade, 'import', $grade->feedback, FORMAT_MOODLE))

      { $failed = true; break 2; }


      And lastly around line 125:

      // make the grades array for update_grade
      foreach ($grades as $grade) {
      if (!$importfeedback)

      { $grade->feedback = false; // ignore it }

      if ($use_function){
      if(!simple_update_final_grade($grade->userid, $gradeitem, 2, $grade->finalgrade, 'import', $grade->feedback))

      { $failed = true; break 2; }

      } else if (!$gradeitem->update_final_grade($grade->userid, $grade->finalgrade, 'import', $grade->feedback))

      { $failed = 1; break 2; }


      • Denying access to the original grader report. Fortunately, this can be done in Moodle, defining capabilities.

      With the Site Administration block navigate to Users->Permissions->Define Roles. For every role, change the gradereport/grader:view to "Not Set"

      This will deny access to the original gradebook.

      Note: in order to get help files to make sense in the simple tree, make sure that the help files location in simple_tree/lang/en_utf8/help/grade/ are moved into core.


        1. CONTRIB-738.diff
          542 kB
          Anthony Borrow
        2. import_mymathlab.png
          109 kB
          Anthony Borrow
        3. LSU_gradebook.diff
          527 kB
          Anthony Borrow
        4. LSU_gradebook.diff
          527 kB
          Anthony Borrow
        5. quick_edit.png
          178 kB
          Anthony Borrow



            aborrow Anthony Borrow
            rrusso Robert Russo
            Component watchers:
            Robert Russo
            1 Vote for this issue
            3 Start watching this issue