conditional in grade calculation

conditional in grade calculation

by Aaron Naiman -
Number of replies: 0
Dear Moodlers,

Hi. I would like to implement a grade with a condition in it.

E.g., say I want the grade to be 75% the final, and 25% the homework, unless the student did not pass the final with a grade of, say, 50 (out of 100).

It would be nice if there was a conditional in the grade calculation, like:

if(condition, then-clause, else-clause)

or alternatively the question-mark-colon format:

(condition ? then-clause: else-clause)

But not.

Alternatively, I thought about using a step function, e.g.:

step(FinalGrade - 50)

but I do not find that either.

And, there is no sign function (sign() or sgn()).

So far, all I have is to use abs() for getting to the sign function:

((FinalGrade - 50) / abs(FinalGrade - 50) + 1) / 2

which is somewhat ugly. smile

Any other suggestions?

BTW, I only have access to Moodle 1.9.7, so no Conditional Activities (yet).

Thanx,

Aaron