See http://docs.moodle.org/en/Development:Grades#Calculated_grade_items
We need a function that can parse a calculation string like
(SUM(forum2, code444, quiz44) / 3) + 40
and apply it to all the grade_grades_final values for the grade_items references, returning an array of results.