Thursday, October 04, 2018

Dealing with empty Moodle Grades

In Moodle grade calculations, there aren't any conditionals, so it gets a bit tricky to handle intermediate grades for categories that use an original calculation.  For many of my classes where there is a midterm and a final, I give an extra incentive for improving your grade from the midterm to the final: the total Exam portion of the grade is:
  • 50%-50% between the midterm and the final,  if the final grade is worse, or
  • 25% midterm and 75% final grade,  if the final is higher
Since the final exam grade was empty until the very end of the semester, that grade was calculated as a zero.  This caused the Total Exam grade to always be half of the midterm grade, causing the overall course grade to be lower than expected.  I didn't want to change the calculations mid-semester and risk a calculation error, so I left it the way it was, despite some student complaints.

This isn't a problem if I just used regular averages, since you can choose to exclude empty grades there. Indeed, that seems to be the only way you can have Moodle differentiate between zeroes and empty scores.

To solve the problem nicely, I created another Grade Category, "Actual Exam Grade" that would display the correct overall exam grade.  I added two new Grade Items to that, "Exams Average" and "Weighted Exams".  (I didn't hide either of them.)

For "Weighted Exams", I set my own calculation formula by choosing Edit Calculation (for the item) on the Gradebook Setup page.  I named the midterm and final fields "midterm" and "final" (shocking) then set the formula to be

=.25*[[midterm]] + .75*[[final]]

This grade will be really bad before the final is done, but that's okay.

For the "Exams Average" item, I needed to take the average of the exams, but just use the midterm grade if the final wasn't entered yet.  You can't do that in a formula, but you can do that in a category, so I first changed the original exams category to just calculate the average, but exclude blank grades.  The changes I needed to make were:
  1. In the Gradebook Setup, in the Exams category, for the Exams total, choose Edit Calculation.
  2. To kill the calculation (and open up the option to choose a basic operation), delete the formula entered from before and choose "Save changes".
  3. Go up to the top of the category and choose "Edit Settings".
  4. Choose the aggregation option "Mean of grades", then save the changes.
Now go to Edit Calculation for the "Exams Average" item you created before.  In there, first name the category total (I used "examAvg" because I don't like spaces in variables), then change the formula for the item to simply

=[[examAvg]]

After saving those changes, go to Edit Settings for the Actual Exam Grade category and change the aggregation to Highest Grade.  Save that and you should be all done.

If you don't want to read all the exposition up there, here are all the steps put simply (and in a slightly different order).
  1. Create a new category, "Actual Exam Grade".  Set the aggregation to "Highest Grade".
  2. Add two grade items to it, "Exams Average" and "Weighted Exams"
  3. Edit Calculation for "Weighted Exams".  Name the midterm and final and set the formula to  =.25*[[midterm]] + .75*[[final]]
  4. In Exams Total, choose Edit Calculation.  Then delete the formula and save it.
  5. Change the aggregation for the Exams category to "Mean of grades".
  6. Edit Calculation for "Exams Average".  Name the Exams category to "examAvg", then set the formula to  =[[examAvg]]

0 Comments:

Post a Comment

<< Home