How To: Create Custom Grade Formulas in the Moodle

A grade formula is a calculation used to determine grades that is based on other grade items and numeric calculations. Instructors can use the Calculation tool in the Moodle Gradebook to create their own formulas as an alternative to Moodle's preset calculations.

This page describes the process of creating a custom grade formula. First you will assign ID values to columns in the gradebook (used to identify items in your formula), then you will input the custom formula.

If you need help with assistance with Moodle grading or the Moodle gradebook, contact the Office of Instructional Design (InstructionalDesign@northcentral.edu).

Opening the Edit Calculation page

To open the edit calculation page in Moodle:

  1. In the Administration block, under Course Administration, click Gradebook setup. The gradebook will open to the Gradebook setup page.
  2. Locate the item for which you would like to create a calculation, and under Actions (at far right), click Edit, and from the drop-down menu select Edit Calculation Icon Edit Calculation. The Edit calculation page will open.

    Note: The Edit Calculation icon will only be available next to category totals, manually created grade items, and the Course total.

Assigning column ID numbers

To use existing grade items in a custom formula, you must first assign ID Numbers (short text labels), which are used as variables in the text of the formula. Columns are referenced in a formula by placing double square brackets ( [[...]] ) around the ID Number. For example, if you have a grade item with the ID Number "Quiz3", you will refer to this item as "[[Quiz3]]" in the formula.

  1. On the Edit Calculation page, below the Calculation field, is a list of all grade items. Enter an ID number value for each grade item you want to use in the formula. Values can include text, spaces, and numbers, however short names are strongly recommended (i.e., "Quiz3", "Exam 1", etc.).
    Note: If a grade item already has an ID number (surrounded with double square brackets) instead of an input field, you can use this ID number in your formula. 
  2. After you have entered ID numbers, check them carefully; you will only have one chance to save them.
  3. To save your ID numbers, click Add ID numbers (at bottom). The page will refresh to show an updated list of grade items and corresponding ID numbers.

Formula basics

Custom formulas for the Moodle gradebook follow the pattern of formulas/functions in popular spreadsheet programs. Formulas start with an equals (=) sign, and use common mathematical operators and functions to produce a single numerical output. This output is then used as the computed value for the grade item you are editing.

Note: There are no logical conditional (IF, AND, OR) statements in the Calculator tool.

Common calculation functions and operations include the following:

  • average([[item1]], [[item2]]...): Returns the average of a sample
  • max([[item1]], [[item2]]...): Returns the maximum value in a list of arguments
  • min([[item1]], [[item2]]...): Returns the minimum value in a list of arguments
  • round([[item1]], count): Rounds a number to a predefined accuracy. For example, "round([[item1]], 2)" will round the value of "item1" to the second decimal place.
  • sum([[item1]], [[item2]]...): Returns the sum of all arguments
  • an asterisk (*) multiplies two items: [[item1]]*[[item2]]
  • forward slash (/) divides items: [[item1]]/[[item2]]

For a full list of functions, see Grade calculations.

Setting a grade calculation

In the Calculation box, start by entering an equals sign (=).

  1. Choose a function; Example: =sum()
  2. Plug in your ID numbers enclosed in double square brackets, for example =sum([[item1]][[item2]][[item3]])
  3. Separate each ID number with a comma, for example =sum([[item1]],[[item2]],[[item3]])
  4. Click Save Changes (below the Calculation box).

Getting assistance with grades

If you need help with assistance with Moodle grading or the Moodle gradebook, contact the Office of Instructional Design (InstructionalDesign@northcentral.edu).

Details

Article ID: 87035
Created
Sun 9/15/19 6:45 PM
Modified
Sun 9/15/19 8:26 PM
Audience
Faculty