# Difference between revisions of "Grade calculations"

Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: Grade calculations.

## Enabling Calculations

To enable calculations for you gradebook:

1. Login as teacher or other user with permission to edit grades.
2. Go to course.
4. Click the "Turn Editing On" button on the top right corner.
5. Click the "Show Calculations" icon on the middle top.
6. Click the little calculator symbol under Course Total column which will bring you to the calculations page.
"Show Calculations" Icon
Little Calculator Symbol

## Assigning ID Numbers

ID numbers are similar to nicknames for each grade item. In a calculation, instead of referring back to a whole assignment name, we can substitute it for it's ID number which becomes a lot easier. Think of it as substituting 143 as X and then using X for various math problems.

ID numbers on the bottom of the page. Use simple to remember numbers or variables like 1, X, or Quiz1. Remember to click "Add id numbers"!

## Understanding Calculation Functions

Click the yellow question mark next to the word "Calculation". This will bring a pop-up explaining the various functions that can be used in calculations and how to use them.

Every calculation must start with an equal sign (=). Following is a list of the functions supported by the calculation. The comma (,) character is used to separate arguments within function brackets. The comma can also be used to separate different functions.

• 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
• mod(dividend, divisor): Calculates the remainder of a division
• pi(): Returns the value of the number Pi
• power(base, power): Raises a number to the power of another
• round(number, count): Rounds a number to a predefined accuracy
• sum([[item1]], [[item2]]...): Returns the sum of all arguments

A number of mathematical functions is also supported:

• sin
• sinh
• arcsin
• asin
• arcsinh
• asinh
• cos
• cosh
• arccos
• acos
• arccosh
• acosh
• tan
• tanh
• arctan
• atan
• arctanh
• atanh
• sqrt
• abs
• ln
• log
• exp

Example calculation

Back on the calculations page, start typing the various functions and the ID numbers chosen for your calculation.
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}