use of org.asqatasun.webapp.dto.CriterionResult in project Asqatasun by Asqatasun.
the class CriterionResultFactory method getCriterionResult.
/**
* @param criterionStatistics
* @return
*/
public CriterionResult getCriterionResult(CriterionStatistics criterionStatistics) {
CriterionResult criterionResult = new CriterionResult();
criterionResult.setCriterion(criterionStatistics.getCriterion());
criterionResult.setCriterionCode(criterionStatistics.getCriterion().getCode());
criterionResult.setLevelCode(criterionDataService.getCriterionLevel(criterionStatistics.getCriterion()).getCode());
criterionResult.setResult(criterionStatistics.getCriterionResult().toString());
criterionResult.setResultCode(setResultToLowerCase(criterionStatistics.getCriterionResult()));
return criterionResult;
}
use of org.asqatasun.webapp.dto.CriterionResult in project Asqatasun by Asqatasun.
the class CriterionResultFactory method prepareThemeResultMap.
/**
* @param criterionStatList
* @return
*/
private Map<Theme, List<CriterionResult>> prepareThemeResultMap(List<CriterionStatistics> criterionStatList) {
// Map that associates a list of results with a theme
Map<Theme, List<CriterionResult>> criterionResultMap = new LinkedHashMap<>();
sortCollection(criterionStatList);
for (CriterionStatistics crs : criterionStatList) {
CriterionResult testResult = getCriterionResult(crs);
Theme theme = crs.getCriterion().getTheme();
if (criterionResultMap.containsKey(theme)) {
criterionResultMap.get(theme).add(testResult);
} else {
List<CriterionResult> criterionResultList = new ArrayList<>();
criterionResultList.add(testResult);
criterionResultMap.put(theme, criterionResultList);
}
}
return criterionResultMap;
}
Aggregations