Monday, November 26, 2012

Tweaking a core file....

One of my vendors is adding functionality *back to our moodle 2.3 gradebook.  The functionality used to be in the older version of moodle involving a category grading issue.  This is what our vendor said in response to my internal customer...

 "basically, the standard moodle package code isn't respecting the  "drop x number of scores option in categories.  So, in the case of 'ungraded' category, you should be able to put up tp 20 items in that category and not have them affect the final score.  This isn't what is happening on your system.  We have added code to the end of the php file to check if there are any drop x number of scores categories with an entry of something other than 0. If there are, we recalculate the 'final score' based on the dropped grades."

Ok, our vendor has experience with this version of moodle and this specific feature and have a developer that added a function to the core file to check for this. The developer sent me back the file located at /lib/grade/grade_category.php, with the extra function included.

Steps to update core file:

  1. I saved the updated vendor file to my special  /server download folder at the server root
  2. browsed to the folder where the file exist, 
  3. renamed the existing file grade_category.php to grade_categories_priorToVendorTweak.php
  4. copied the updated file grade_category.php to the /lib/grade folder.
Be very careful when touching core files, RENAME THE FILE BEFORE YOU TOUCH OR REPLACE THEM, JUST IN CASE THERE IS A PROBLEM.

I also updated my upgrade notes to remind me that when I do an upgrade to moodle 2.3.3 next month, that I will have to account for this tweak to a core file.  When I do the upgrade, I will lose this tweak and have to update the file again.

No comments:

Post a Comment