******************************** * INSTALLTION NOTES * ******************************** For a full installation of the simple grader, you will need the following: A) The Grade Features block. Copy the contents blocks/anonymous_grade to {MOODLE_ROOT}/blocks/anonymous_grade. 1) As an admin, click the Notifications link, and have Moodle build the tables needed for extra grade features. 2) Once the block successfully installs, navigate to the config page of the Grade Features block. The quickest way to get there is through the Site Administration Block Modules->Blocks->Grade Features, and click on "Enable Extra Grade Features". At the configuration page, you should be presented a couple of checkboxes, and select boxes. For now, check the "Enable Extra Grade Features" and "Extra Credit for Weighted and Simple Weighted Mean" checkboxes. Save Changes, and you're through setting up the Grade Features block. B) Copy the contents of grade/edit/simple_tree to {MOODLE_ROOT}/grade/edit/simple_tree C) Copy the contents of grade/edit/custom_letters to {MOODLE_ROOT}/grade/edit/custom_letters D) Copy the contents of grade/report/simple_grader tp {MOODLE_ROOT}/grade/report/simple_grader. After copying the files into their respective locations, there are some "post-installation" steps required to make your Moodle instance use the gradebook appropriately. The two methods of doing so are addressed below: 1) Patching the source via Linux-style patch (reccomended) 2) Manually changing the source ******************************** * POST INSTALLTION via * * Linux-style patch * ******************************** The patch can be found in the simple_grade directory named gradebook.patch. Execute the following commands in the terminal: cd {MOODLE_ROOT}; patch p0 <{MOODLE_ROOT}/grade/report/simple_grader/gradebook.patch You should see that the patch command patched about 5 files. That's it! ******************************** * POST INSTALLATION * * THESE MUST BE DONE! * ******************************** In order to take advantage of all the features of Simple Grader, some minor changes outside the report must take place. A) Change the function in {MOODLE_ROOT}/grade/lib.php print_grade_plugin_selector on line 397. //Changing this to simple tree, rather than worrying about javascript to fix this //$url = 'edit/tree/index.php?id='.$courseid; $url = 'edit/simple_tree/index.php?id='.$courseid; ... And then further in the function for custom letter //Changing this to custom_letter, rather than worrying about javascript to fix this //$url = 'edit/letter/index.php?id='.$courseid; $url = 'edit/custom_letter/index.php?id='.$courseid; B) Some core changes must take place in order for the calcucation to be affected across the board. NOTE: These core change notes can also be found in README.txt 1) The default aggregation coefficient must be set to 1 in {MOODLE_ROOT}/lib/grade/grade_item.php Around line 197: var $aggregationcoef = 0; => var $aggregationcoef = 1; Note: The line number may not be exact in your version, but it should be close. The new gradebook treats everything that has an aggregation coefficient of 0 to be an extra credit grade. Originally, Sums with an aggregation of 0 were considered real, and 1 were extra credit, but Weighted Mean, would not share the same logic. 2) 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); } // End check for Simple Grader Report The new gradebook allows for more richly calculated methods than the original gradebook, and when a mod's grade was submitted, it would run through the original's function 3) Check for simple_grader in {MOODLE_ROOT}/grade/report/index.php towards the end of the file. Change the following lines from: if (empty($last)) { if (in_array('grader', $reports)) { $last = 'grader'; } to: if (empty($last)) { if (in_array('simple_grader', $reports)) { $last = 'simple_grader'; } This is required if you plan to replace the original gradebook. Ideally, the admin would disable the original gradebook, and apply this change so that teachers would route to the new gradebook, as opposed to their user report. 4) 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; } } Unfortunately, this is the biggest core change. Import uses gradeitem->update_final_grade, and all occurences of grade_import_commit must be changed to use the new system. C) 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. Once you've completed the changes, your system is now setup with a simpler, more featureful gradebook.