Calculations

Calculations for the gradebook follow the pattern of formulas/functions in popular spreadsheet programs. They start with an equal (=) 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.

Following is a list of the functions supported by the calculation. The comma (,) character is used to separate arguments within function brackets.

A number of mathematical functions is also supported:

You can include the values of other grade items by using their idnumber as references in your formulas. The idnumber is surrounded by two matching pairs of angle brackets, to avoid confusing the calculation parser when the idnumber contains uncommon characters. For example, if you have a grade item with Quiz.3 as idnumber, you will refer to this item as [[Quiz.3]] in your calculation.

Below the calculation field is an arborescence of your course with its grade categories and grade items. Next to each item or category's total is displayed the idnumber you can use in your calculation (already surrounded with angle brackets). However, since the idnumber is optional, some items may not yet have one. These items without an idnumber have instead a form field which lets you enter the idnumber directly, so that you can use it in your calculation without having to leave the page. This form doesn't let you edit existing idnumbers though, you will have to go and edit the grade item directly if you want to do that.

As soon as you have assigned the idnumbers you need, you can press "add idnumbers", and the page will reload and show you the same arborescence with the idnumbers you have just assigned. You are then free to use these references in your calculation.

Here is a list of practical examples of calculations you may use in your gradebook:

輔助說明檔案的索引
以正體中文語言顯示輔助說明