complex course total calculations

complex course total calculations

by gana pathmanathan -
Number of replies: 1

i would like to perform the following calculation for course total.

there are two categories of grade items, graded items and ungraded items. graded items may receive a mark of either 0,1,3,5 and ungraded items may recieve either a 1 or 0.

the course total should be an average of all the graded items.

however if any item (graded or ungraded) receives a 0, the course total will be 0

if any item has no grade submitted the course total will also remain blank or have something to indicate that not all items have been submitted and assessed.

is this too complicated for moodle at a user level. is it something that must be done at a programmer level.

thanks in advance.

Gana

In reply to gana pathmanathan

Re: complex course total calculations

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The basic idea is to use a calculation like this:


Give each of the graded items id numbers like [[a]], [[b]], [[c]], ...
Give the category total of the graded items category an idnumber like [[gradedaverage]]

Then use this calculation for the course total:

= [[gradedaverage]] * min(1, [[a]], [[b]], [[c]], ...)


The idea is that if all the individual grades are 1 or greater the min part is 1, and the total is [[gradedaverage]]. If any of the individual grades is 0, then the min is 0, and so the course total is 0.