Using empty grades in calculation

Re: Using empty grades in calculation

by Ago Luberg -
Number of replies: 0

As I understand, "exclude empty grade" only works for aggregation?

Anyway, my situation is as follows:

I have 2 homeworks, which are required to get a better grade. Grades are 0..5. If you do both homeworks, you can get "5" (if you have enough points). If you do only one, you can get maximum of "4". If you don't do any, you can get max "3". I have made a separate category "maximum grade", which should point out the maximum possible grade.

If a student hasn't done a homework, there will be an empty grade ("-"). I have used the formula:

= 3 + HW1 + HW2

where HW1 and HW2 both are grades wither 0 or 1.

This works in case a student has skipped one HW (then I get "4" as the result). But if both are undone, then I get "-" as the result (instead of "3" what I would like).

Is it somehow possible to get 3 there? Or may-be there is some function which I could use, for example ifempty(X, 0)  (in case X is empty, use 0).