The following example is taken from MoodleFormulas.org ↗ :
An "official" question counts for 4 points.The following three possibilities are considered:
- If the student's score is greater than or equal to 3 (75 %), the quiz is passed and the attempt can be completed immediately. The final score remains as it is.
- If the student gets less than 2 (50 %), he/she fails the quiz. The final score remains as it is. The student must continue his studies and may try again later.
- If the score is between 2 and 3 (between 50 % and 75 %), a catch-up question is presented to the student. If the student fails the catch-up question, the final score remains unchanged. If the student passes the catch-up question, the final
grade is set to 3 (75%).
Since the marks must be adjusted, they are hidden during and after the attempt, with the exception of the mark for the official question. In order to easily adjust the total score for the quiz, the catch-up question is marked on 6, for a round figure
temporary total of 10. The final grade of the quiz is displayed by a grade item in the gradebook, with a formula that multiplies the temporary score by 2.5 if it is less than 4 and sets it to 7.5 otherwise:
Calculation = if(quiz_id<=4,quiz_id*2.5,7.5)