Sakai 12 auto truncation of score and rounding

47 Views Asked by At

I have install Sakai version 12, I encountered the following problem: The input score for the question was 0.525 but after clicking the Save button the score became 0.53. I tried to reconfigure the sakai.properties file at line gradebook.class.average.decimal.places and assignment.grading.decimals but failed. I have attached the picture, expect anyone to help me. Thanks! Picture 1: http://prntscr.com/j36o75 Picture 2: http://prntscr.com/j36ogy Picture 3: http://prntscr.com/j36on1 Picture 4: http://prntscr.com/j36ork

1

There are 1 best solutions below

0
jonespm On

From your pictures it looks like you're referring to Tests & Quizzes rather than assignment. It looks like T&Q (Samigo) is hardcoded to only be 2 decimal places. From what I can see Gradebook is also hardcoded for individual grade items to be 2 decimal places.

You'd have to submit a feature request on Sakai's Jira or a Pull Request to allow these values to be configured. There may be some loss in precision if too many decimal places are supported.

samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/evaluation/TotalScoresBean.java
359:      String newmax= ContextUtil.getRoundedValue(maxScore, 2);

samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/evaluation/AgentResults.java
241:           String newscore = ContextUtil.getRoundedValue(totalAutoScore.replace(',', '.'), 2);
270:                String newscore = ContextUtil.getRoundedValue(
296:              String newscore = ContextUtil.getRoundedValue(finalScore.replace(',', '.'), 2);

samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java
1253:      String newscore= ContextUtil.getRoundedValue(rawScore, 2);
1272:         String newscore= ContextUtil.getRoundedValue(rawScore, 2);

samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBeanie.java
382:      String newscore= ContextUtil.getRoundedValue(rawScore, 2);

samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/util/ContextUtil.java
334:  public static String getRoundedValue(String orig, int maxdigit) {
336:    return getRoundedValue(origdouble, maxdigit);
338:  public static String getRoundedValue(Double orig, int maxdigit) {