Quiz performance points
There are several ways to give learner points based on their performance in a quiz. This page outlines three different methods of calculating points:
- Method 1: Points exactly equal to the grade
- Method 2: Points for getting a passing (or minimum) grade
- Method 3: Different points for different grades (advanced)
Performance-based gamification can have a negative effect on learners, especially those experiencing difficulties. Failure to receive the points can be perceived as a penalty and can compromise their overall motivation.
Method 1: Points equal to grade
This method will award points that exactly match the grade a learner receives.
For example, a learner obtaining a grade of 10/100 will receive 10 points. If they re-attempt the quiz and obtain a grade of 60/100, they will be awarded an additional 50 points. Learners who obtain a lower grade will not be negatively affected, and previously awarded points will remain intact.
To set this up, navigate to Grade rules and add the condition 'Specific grade item' targeting the quiz in question. For more details about grade rules, please view the grade rules page.
Method 2: Points for a passing grade
This method will award a certain number of points once a learner meets the quiz's passing grade.
For example, a learner will need to obtain a grade of 80% or above to be considered as having passed the quiz. When they do, we want to award them 100 points. Achieving a higher score than 80% will not yield more points. All learners meeting the passing grade will get the same number of points.
To set this up, the quiz needs a passing grade and completion criteria, and XP must be configured to award points upon completion of the quiz. Here is how to do this, assuming a passing grade of 80 and 100 points to award.
Quiz setup
Navigate to the quiz, and edit its settings.
In the 'Grade' section, set the Grade to pass to 80. Note that the grade to pass is not a percentage, it is the required grade. By default, quizzes have a maximum grade of 10, so the passing grade must not exceed 10. You can view and change the maximum grade from the 'Questions' page.

In 'Completion conditions', set the quiz to be marked as completed when the learner receives a passing grade. To ensure this works as intended, no other conditions should be added.

XP setup
Once our quiz has been set up, we must configure XP to award points upon completion of the activity.
Navigate to XP's 'Completion rules' and add the condition Specific activity. Choose the relevant quiz and set it to 100 points.

That's it. Now anyone completing the quiz will earn 100 points, and to complete the activity, they must obtain a minimum grade of 80.
Method 3: Points as per thresholds (advanced)
This method allows different points to be awarded for different grades. It is an advanced feature that requires a good understanding of Moodle's gradebook and the Excel-like formulas used in calculated grade items.
The following setup example assumes the following grade thresholds:
- 100 points if the grade is 80 or more
- 50 points if the grade is 50 or more
- 0 points, if the grade if below 50
Example setup
First, we must ensure that our quiz was given an ID number. Navigate to the quiz settings and take note of the 'ID number' field under the 'Common module settings' section. If it is empty, add a value to it. In our example, it will be xp-quiz
. This ID number must be unique among all activities.

Next, navigate to the Gradebook setup page and add a grade item. This grade item will be used to calculate the number of points to award in XP. In our example, we name this grade item 'XP points for quiz' and give it a weight of 0 so that it does not contribute to the learner's overall course grade.

Next, select Edit calculation from the menu of the grade item we just created. Enter the following formula in the text field. Note that if your quiz ID number is not xp-quiz
, you will need to make some adjustments. The formula also assumes that the quiz's maximum grade is 100 rather than the default 10.
=IF([[xp-quiz]]>=80, 100, IF([[xp-quiz]] >= 50, 50, 0))
Finally, navigate to XP's Grade rules and add a new 'Specific grade item' condition targeting the grade item we just created. For more details about grade rules, please view the grade rules page.

That's it! Now, whenever a grade is obtained in the quiz, the calculated grade item will compute a grade of 0, 50, or 100. Then XP will award points according to the calculated grade item.