Using a Rounding Function in a Moodle Gradebook Calculation


Instructors can use grade calculations to round the total of a category to the nearest whole number.

This article provides guidance on using gradebook calculations to round the course total.

Preparing the Gradebook for the Calculation

To do this, a gradebook category will be created that contains all the current contents of the gradebook, calculating the actual total grade before rounding, and then the course total will use a calculation to round that grade.

Creating a Pre-rounding Grade Category

The pre-rounding grade category will contain the entire gradebook as-is, and calculate the course total before rounding is applied. When creating this category:

To create this gradebook category, follow the instructions in the "Adding a Moodle Gradebook Category" article.

Moving Items Into the Pre-rounding Category

Every grade that is currently in the gradebook will need to be moved into the pre-rounding category, with the structure of the course maintained. This means that if weighted categories were created to organize specific grade items, such as exams, homework, or more, then those categories should be moved into the pre-rounding category without changing their weights or composition.

To move grade items into the newly created pre-rounding category, follow the instructions in the "Rearranging Grade Items in Moodle's Gradebook" article.

Adding a Gradebook Calculation with the Round Function

To create the calculation, follow the instructions in the "Editing Gradebook Calculations in Moodle" article.

Below is the specific function syntax for rounding category total, followed by an example.

Grade calculation syntax

=round([[ID number of the grade category for the unrounded grade]], number of decimal places)

Example of a true rounding calculation

=round([[PreliminaryTotal]],0)

The pre-rounding course total has been given the ID number PreliminaryTotal and the desired number of decimal places is zero, so 0 is used.

Additional Resources

Changing the Number of Decimal Places Displayed in the Moodle Gradebook (DELTA Knowledge Base)

Handling Differences Between Moodle Displayed Grades and Actual Grades (DELTA Knowledge Base)

Rounding Moodle Course Total With Calculation Video Walkthrough (DELTA LearnTech Walkthrough Recording)

For additional assistance, please contact the LearnTech Help Desk at learntech@ncsu.edu or (919) 513-7094, or via the Get Help form on the DELTA Knowledge Base.