The Excluded setting in the grade book allows you to exclude a grade for an individual student from being included in their grade aggregation.
NOTE: Excluded DOES NOT work when using Natural weighting.
Step 1: In your course in Moodle open your grade book by selecting Grades from the Navigation block menu.
Step 2: Click the Turn editing on button in the upper right of the screen.
Step 3: Locate the student you need to set an exclusion for and scroll across the grade book to the activity you wish to exclude from their grade. Click the Edit grade icon that looks like a gear for the activity.
Step 4: Click in the box for Excluded to select it.
Step 5: Scroll down and click the Save changes button at the bottom.