-
New Feature
-
Resolution: Fixed
-
Minor
-
None
-
1.9, 1.9.1, 1.9.2
-
None
-
Requires php5
-
Any
-
MOODLE_19_STABLE
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))
?>
- The modification in grade_item.php is simply changing:
var $aggregationcoef = 0;
to:
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))
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))
} else if (!$gradeitem->update_final_grade($grade->userid, $grade->finalgrade, 'import', $grade->feedback, FORMAT_MOODLE))
}
And lastly around line 125:
....
// make the grades array for update_grade
foreach ($grades as $grade) {
if (!$importfeedback)
if ($use_function){
if(!simple_update_final_grade($grade->userid, $gradeitem, 2, $grade->finalgrade, 'import', $grade->feedback))
} else if (!$gradeitem->update_final_grade($grade->userid, $grade->finalgrade, 'import', $grade->feedback))
}
- 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.