Basic formulas

With grading formulas you can set up a custom calculation for module and edition grades. When you write a formula, there are a few variables available. For a module these will correspond to the grades of the assignments. For an editions these will correspond to the grades of the modules.

You can apply several operations on those variables. Available operations are:

Conditions

Sometimes, you might want to give a different score based on a condition. For example, the students might have to get higher than a 6 for assignment 1, then assignment 2 will be their final score, otherwise they get a 1.0. You can achieve this using if: assignment_2 if assignment_1 > 6.0 else 1.0

> is one of the relational operators. There are several of those as well:

You might want to check for multiple conditions. For example to check whether a score is between some values, let's say 1 and 5. In that case you can use and, in which case both conditions need to be true. So: 5.0 if assignment_1 >= 1 and assignment_1 <= 5 else assignment_1. The other thing you could do is check if either one condition is true, i.e. the first condition, the second, or both. Then you can use or.

Functions

There are some functions available for you to use. These can be used to make some operations easier and more concise. These functions are:

Special values

You can use the special values PASSED and FAILED to check if the students passed an assignment. These correspond to the values 1.0 and 0.0 respectively. So writing 10.0 if assignment = PASSED else 1.0 is equivalent to 10.0 if assignment = 1.0 else 1.0, but might be slightly more clear. You can also use these values to make the entire module or edition pass/fail, in addition to setting the grade type to 'Pass / Fail'.

There are special versions of the assignment variables available as well: one for checking if a score was created by a script and one for only human-made scores. You can put `_isScript` or `_noScript` directly after the assignment name respectively. So as an example: `assignment_1 / 2.0 if assignment_1_isScript else assignment_1` awards the student half points if their score was script graded and full points if it was human graded. `assignment_1_noScript` on the other hand, awards the student no points if their score was script graded.