Skip to content
Snippets Groups Projects
Commit a3419b64 authored by uhensler's avatar uhensler
Browse files

OO-5304: Show nothing instead of "null" if no survey responses

parent 25ddb705
No related branches found
No related tags found
No related merge requests found
...@@ -295,6 +295,10 @@ public class StringHelper { ...@@ -295,6 +295,10 @@ public class StringHelper {
return s != null? s: ""; return s != null? s: "";
} }
public static String toStringOrBlank(Long value) {
return value != null? String.valueOf(value): "";
}
public static int count(String s, char character) { public static int count(String s, char character) {
int count = 0; int count = 0;
......
...@@ -132,15 +132,15 @@ public abstract class RubricBarChartsController extends FormBasicController { ...@@ -132,15 +132,15 @@ public abstract class RubricBarChartsController extends FormBasicController {
private List<StatisticRow> getStatisticRows(SliderStatistic sliderStatistic) { private List<StatisticRow> getStatisticRows(SliderStatistic sliderStatistic) {
List<StatisticRow> rows = new ArrayList<>(); List<StatisticRow> rows = new ArrayList<>();
if (rubric.isNoResponseEnabled()) { if (rubric.isNoResponseEnabled()) {
rows.add(new StatisticRow(translate("rubric.report.number.no.responses.title"), String.valueOf(sliderStatistic.getNumberOfNoResponses()))); rows.add(new StatisticRow(translate("rubric.report.number.no.responses.title"), StringHelper.toStringOrBlank(sliderStatistic.getNumberOfNoResponses())));
} }
rows.add(new StatisticRow(translate("rubric.report.number.responses.title"), String.valueOf(sliderStatistic.getNumberOfResponses()))); rows.add(new StatisticRow(translate("rubric.report.number.responses.title"), StringHelper.toStringOrBlank(sliderStatistic.getNumberOfResponses())));
rows.add(new StatisticRow(translate("rubric.report.median.title"), EvaluationFormFormatter.formatDouble(sliderStatistic.getMedian()))); rows.add(new StatisticRow(translate("rubric.report.median.title"), EvaluationFormFormatter.formatDouble(sliderStatistic.getMedian())));
rows.add(new StatisticRow(translate("rubric.report.variance.title"), EvaluationFormFormatter.formatDouble(sliderStatistic.getVariance()))); rows.add(new StatisticRow(translate("rubric.report.variance.title"), EvaluationFormFormatter.formatDouble(sliderStatistic.getVariance())));
rows.add(new StatisticRow(translate("rubric.report.sdtdev.title"), EvaluationFormFormatter.formatDouble(sliderStatistic.getStdDev()))); rows.add(new StatisticRow(translate("rubric.report.sdtdev.title"), EvaluationFormFormatter.formatDouble(sliderStatistic.getStdDev())));
return rows; return rows;
} }
@Override @Override
protected void formOK(UserRequest ureq) { protected void formOK(UserRequest ureq) {
// //
......
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