Gradebook calculations - BEST function

Gradebook calculations - BEST function

by Henning Bostelmann -
Number of replies: 4
Picture of Core developers Picture of Plugin developers

Hello,

with this post I'd like to collect some feedback regarding MDL-44508. This is about an improvement in grade calculations.

In our Moodle installation, we quite frequently use coursework marks computed as "best 3 out of 5 assignments" or similar. This kind of total can be computed, for example, via the gradebook user interface ("keep the best 3" in a category total). However, being a Maths department, we like to do our computations with gradebook formulas instead (where the "best out of" computation might be only one part of the story).

To that end, we've added an additional function "BEST" to evalmath.php, which computes the average of the best n of a series of marks. For example, with A1, A2, ... A5 being the identifiers of some gradebook columns, the formula

 = BEST(3, [ [A1] ], [ [A2] ], [ [A3] ], [ [A4] ], [ [A5] ])

would give the "best 3 out of 5" computation.

As another example,

BEST(3, 10, 20, 40, 30)

gives 30 (namely, the average of 20, 30, 40).

My question is whether anyone else finds this feature useful, and whether you think it should be integrated into Moodle (again, MDL-44508 is the place to cast your vote).

Best wishes
  Henning

 

In reply to Henning Bostelmann

Re: Gradebook calculations - BEST function

by Bob Puffer -

How does this differ from using SWM and keeping the highest three items?

In reply to Bob Puffer

Re: Gradebook calculations - BEST function

by Henning Bostelmann -
Picture of Core developers Picture of Plugin developers

It works on the level of gradebook formulas, not on the level of the "all grade items" interface.

Of course, the formula might contain more intricate computations that involve "best" only as a part of it, like

ROUND(BEST(3, [ [A1] ],[ [A2] ],[ [A3] ],[ [A4] ],[ [A5] ]) * 7 + 4*[ [ B ] ])

or similar.

In reply to Henning Bostelmann

Re: Gradebook calculations - BEST function

by Doug Moody -

Two comments...

First, if you use the formula =BEST (3....) just be aware that someone might ask for the best 3 out of 5, but then not put in 5 identifiers. YOu need formula error checking to guard against wrong syntax.

Secondly, how is this any different than in quizzes where "keep highest" is chosen? I let students take a quiz as many times as they want, and moodle automatically throws away the lowest scores and records that in the gradebook.

In reply to Doug Moody

Re: Gradebook calculations - BEST function

by Henning Bostelmann -
Picture of Core developers Picture of Plugin developers

Hi Doug, thanks for your comments.

>> First, if you use the formula =BEST (3....) just be aware that someone might ask for the best 3 out of 5, but then not put in 5 identifiers. YOu need formula error checking to guard against wrong syntax. <<

Yes, indeed. In this case, the function will pad the list of input data with zeros. That is, BEST(5,1,2,3,4) gives 2. (That's already in the code, in fact there is a unit test for it.)

>> Secondly, how is this any different than in quizzes where "keep highest" is chosen?

It's the same principle, of course. But what I propose aggregates grades from several gradebook columns (which could be quizzes, or assignments, or anything else) rather than aggregating within one quiz.