Moodle allows you to keep the highest grade(s) from a group of activities/items in the gradebook. The activities/items must all be of equal value and within the same category.
Warning: Do not apply this option until the end of the semester. Also, before using the Keep highest grade function, fill any empty cell with zeros. Otherwise, those cells will not be counted as a score when used with the Exclude Empty Grades option.
Keeping the highest grade(s)
Start on the site home page.
Find the Administration block:
Click Gradebook setup (Moodle 3.2).
Make a category and move all appropriate items into the category.
Reminder: all items must be of the same point value.
Click the Edit link in the Action column for the category, and choose Edit Settings from the drop-down menu.
On the Edit Category page enter the value in the Keep the highest textbox (i.e. in the screenshot below, the number 2 indicates that the grade category should calculate only the 2 highest grade items within the category.)
Click the Save changes button.
The category total adjusts and displays the sum of the included items. The category total line includes text indicating the dropping or keeping of X items.