Grade Calculation: Replace lowest exam score with final exam score if the final exam is higher than the lowest exam

Grade Calculation: Replace lowest exam score with final exam score if the final exam is higher than the lowest exam

by Ryan Hazen -
Number of replies: 0

Hi all,

This is a solution for the following scenario. I thought it worth sharing:

The teacher wants to replace the lowest exam score for a semester with the final exam score if the final exam is higher than the lowest exam score. The idea is that students who improve on the content in the final exam can recover some credit for an earlier exam by performing well on this final.

Here is how to accomplish this in Moodle 3.7:

Create the grade items, either as manual grade items, assignments, quizzes, or any other graded activity. We will call them Exam 1, Exam 2, Exam 3, and Final Exam. 

Put exams 1, 2, and 3 in their own categories. 

Edit the calculation for these three categories. Make sure you remember to put in the IDs for the grade items in this step. In the calculations below the IDs are EXAM1, EXAM2, EXAM3, and FINALEXAM.

For the Category containing Exam 1, put this in the grade calculation box:

=if(AND(EXAM1<=min(EXAM1,EXAM2,EXAM3),FINALEXAM>EXAM1),FINALEXAM,EXAM1)

For the Category containing Exam 2, put this in the grade calculation box:

=if(AND(EXAM2<=min(EXAM1,EXAM2,EXAM3),EXAM2<EXAM1,FINALEXAM>EXAM2),FINALEXAM,EXAM2)

For the Category containing Exam 3, put this in the grade calculation box:

=if(AND(EXAM3<=min(EXAM1,EXAM2,EXAM3),EXAM3<EXAM1,EXAM3<EXAM2,FINALEXAM>EXAM3),FINALEXAM,EXAM3)

The gradebook setup page looks like this. Everything here is contained in a category called "Exam Tests":

Screenshot of the gradebook with Exams 1, 2, and 3 in separate categories.

Open the editing for the category calculations is here:

Screenshot of the gradebook with Exams 1, 2, and 3 in separate categories and edit category Exam 1 menu expanded.

Input the custom calculations above in the box at the top. Don't forget to specify the Grade item IDS where the arrows are in the following image:

Screenshot of grade calculation screen with calculation and grade ID fields highlighted.

It's worked under every scenario I can think of. Let me know if you try it!

Thanks!