WeBWorK Main Forum

decimal accuracy in scoring files

decimal accuracy in scoring files

by Gavin LaRose -
Number of replies: 0
Hi all,

It appears (line 528 in Scoring.pm: $scoringData[7+$user][$totalsColumn] = sprintf("%.1f",$userStatusTotals{$user}) if $scoringItems->{setTotals};) that the default format for set scores in scoring files is one decimal digit of accuracy.

I'm noting, however, that this is confusing: Perl's sprintf() routine is rounding a score of 2.25 to 2.2, which I don't particularly like. I could live with 0.66666 being displayed as 0.66, but rendering 2.25 as 2.2 (0.66666 as 0.6) seems a bit inaccurate.

So, (a) is there a reason why this shouldn't be set to %.2f (or even %.3f)?, and (b) would it make sense to make this the default in the CVS distribution?

Thanks,
Gavin