Skip to content
Snippets Groups Projects
Commit 805e968e authored by srosse's avatar srosse
Browse files

OO-4419: calculate the radius with double to prevent losing precision

parent cec62ea3
No related branches found
No related tags found
No related merge requests found
...@@ -110,7 +110,7 @@ public class MatchStatisticsController extends BasicController { ...@@ -110,7 +110,7 @@ public class MatchStatisticsController extends BasicController {
@Override @Override
protected void event(UserRequest ureq, Component source, Event event) { protected void event(UserRequest ureq, Component source, Event event) {
//
} }
private void renderMatch() { private void renderMatch() {
...@@ -206,15 +206,15 @@ public class MatchStatisticsController extends BasicController { ...@@ -206,15 +206,15 @@ public class MatchStatisticsController extends BasicController {
return 0; return 0;
} }
long val = 0; double val = 0;
if(statistics.getNumOfCorrect() > 0) { if(statistics.getNumOfCorrect() > 0) {
val = statistics.getNumOfCorrect(); val = statistics.getNumOfCorrect();
} else if(statistics.getNumOfIncorrect() > 0) { } else if(statistics.getNumOfIncorrect() > 0) {
val = statistics.getNumOfIncorrect(); val = statistics.getNumOfIncorrect();
} }
long point = ref / max; double point = (double)ref / (double)max;
return point * val; return Math.round(point * val);
} }
public long getRelativeBorder(int ref) { public long getRelativeBorder(int ref) {
...@@ -223,7 +223,7 @@ public class MatchStatisticsController extends BasicController { ...@@ -223,7 +223,7 @@ public class MatchStatisticsController extends BasicController {
} }
public long getRelativeMargin(int ref) { public long getRelativeMargin(int ref) {
long val = this.getRelative(ref); long val = getRelative(ref);
return val == 0 ? ref : (ref - val) / 2; return val == 0 ? ref : (ref - val) / 2;
} }
} }
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
<table class="table matchInteraction score"> <table class="table matchInteraction score">
<thead> <thead>
<tr> <tr>
<th></th> <td></td>
#foreach($targetChoice in $targetChoices) #foreach($targetChoice in $targetChoices)
<th>$r.render(${targetChoice.getSummary()})</th> <th scope='col'>$r.render(${targetChoice.getSummary()})</th>
#end #end
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
#foreach($sourceChoice in $sourceChoices) #foreach($sourceChoice in $sourceChoices)
<tr> <tr>
<th>$r.render(${sourceChoice.getSummary()})</th> <th scope='row'>$r.render(${sourceChoice.getSummary()})</th>
#foreach($targetChoice in $targetChoices) #foreach($targetChoice in $targetChoices)
<td> <td>
#set($scoreWrapper = $r.get("${sourceChoice.getChoiceIdentifier().toString()}-${targetChoice.getChoiceIdentifier().toString()}")) #set($scoreWrapper = $r.get("${sourceChoice.getChoiceIdentifier().toString()}-${targetChoice.getChoiceIdentifier().toString()}"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment