There are three problems with the sum aggregation within categories. The first is that if you are dropping low or high scores, the scores are dropped from the sum correctly, but not from the total possible (making percentages wrong). Secondly, extra credit points could be dropped as the lowest grades (they should never be dropped). Thirdly, a blank grade (ungraded) is not included in the sum even if aggregating all items is chosen unless drop low is also checked. It should be included whether or not drop low is checked. I have attached a revised version of grade_category.php which has changes to the functions sum_grades and apply_limit_rules which fix these problems.