Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / lang / en_utf8 / help / grade / calculation.html
blob8856eb949e1eb796b06cdc3432c1f915b389aaf7
1 <h1>Calculations</h1>
2 <!-- TRANSLATORS BEWARE!! The comma (,) sign used in the calculations may be a semi-colon (;)
3 in your language. Please use whichever is used in your spreadsheet application. -->
5 <p>Calculations for the gradebook follow the pattern of formulas/functions in popular
6 spreadsheet programs. They start with an equal (=) sign, and use common mathematical
7 operators and functions to produce a single numerical output. This output is then
8 used as the computed value for the grade item you are editing.</p>
10 <p>Following is a list of the functions supported by the calculation. The comma (,)
11 character is used to separate arguments within function brackets.</p>
13 <ul>
14 <li><strong>average</strong>([[item1]], [[item2]]...): Returns the average of a sample</li>
15 <li><strong>max</strong>([[item1]], [[item2]]...): Returns the maximum value in a list of arguments</li>
16 <li><strong>min</strong>([[item1]], [[item2]]...): Returns the minimum value in a list of arguments</li>
17 <li><strong>mod</strong>(dividend, divisor): Calculates the remainder of a division</li>
18 <li><strong>pi</strong>(): Returns the value of the number Pi</li>
19 <li><strong>power</strong>(base, power): Raises a number to the power of another</li>
20 <li><strong>round</strong>(number, count): Rounds a number to a predefined accuracy</li>
21 <li><strong>sum</strong>([[item1]], [[item2]]...): Returns the sum of all arguments</li>
22 </ul>
24 <p>A number of mathematical functions is also supported:</p>
25 <ul>
26 <li>sin</li><li>sinh</li><li>arcsin</li><li>asin</li><li>arcsinh</li><li>asinh</li>
27 <li>cos</li><li>cosh</li><li>arccos</li><li>acos</li><li>arccosh</li><li>acosh</li>
28 <li>tan</li><li>tanh</li><li>arctan</li><li>atan</li><li>arctanh</li><li>atanh</li>
29 <li>sqrt</li><li>abs</li><li>ln</li><li>log</li><li>exp</li>
30 </ul>
32 <p>You can include the values of other grade items by using their idnumber as references
33 in your formulas. The idnumber is surrounded by two matching pairs of angle brackets,
34 to avoid confusing the calculation parser when the idnumber contains uncommon characters.
35 For example, if you have a grade item with Quiz.3 as idnumber, you will refer to this
36 item as [[Quiz.3]] in your calculation. </p>
38 <p>Below the calculation field is an arborescence of your course with its grade categories
39 and grade items. Next to each item or category's total is displayed the idnumber you can
40 use in your calculation (already surrounded with angle brackets). However, since the
41 idnumber is optional, some items may not yet have one. These items without an idnumber
42 have instead a form field which lets you enter the idnumber directly, so that you can use
43 it in your calculation without having to leave the page. This form doesn't let you edit
44 existing idnumbers though, you will have to go and edit the grade item directly if you
45 want to do that.</p>
47 <p>As soon as you have assigned the idnumbers you need, you can press "add idnumbers", and
48 the page will reload and show you the same arborescence with the idnumbers you have just
49 assigned. You are then free to use these references in your calculation.</p>
51 <p>Here is a list of practical examples of calculations you may use in your gradebook:</p>
53 <ul>
54 <li>=average([[Quiz.1]], [[Quiz.4]], [[Assignment.1]])</li>
55 <li>=average(max([[Quiz.1]], [[Quiz.4]], [[Assignment.1]]), min([[Quiz.1]], [[Quiz.4]], [[Assignment.1]]))</li>
56 </ul>