use of org.olat.modules.forms.EvaluationFormResponse in project OpenOLAT by OpenOLAT.
the class EvaluationFormController method forgeRubric.
private EvaluationFormElementWrapper forgeRubric(Rubric element) {
EvaluationFormElementWrapper wrapper = new EvaluationFormElementWrapper(element);
List<Slider> sliders = element.getSliders();
List<SliderWrapper> sliderWrappers = new ArrayList<>(sliders.size());
for (Slider slider : sliders) {
String responseIdentifier = slider.getId();
EvaluationFormResponse response = identifierToResponses.get(responseIdentifier);
SliderType type = element.getSliderType();
SliderWrapper sliderWrapper = null;
if (type == SliderType.discrete) {
sliderWrapper = forgeDiscreteRadioButtons(slider, element, response);
} else if (type == SliderType.discrete_slider) {
sliderWrapper = forgeDiscreteSlider(slider, element, response);
} else if (type == SliderType.continuous) {
sliderWrapper = forgeContinuousSlider(slider, element, response);
}
if (sliderWrapper != null) {
sliderWrappers.add(sliderWrapper);
}
}
wrapper.setSliders(sliderWrappers);
return wrapper;
}
use of org.olat.modules.forms.EvaluationFormResponse in project OpenOLAT by OpenOLAT.
the class EvaluationFormController method saveNumericalResponse.
private void saveNumericalResponse(BigDecimal numericalValue, String stringuifiedReponse, String responseIdentifier) {
if (evaluator == null || readOnly)
return;
EvaluationFormResponse response = identifierToResponses.get(responseIdentifier);
if (response == null) {
response = evaluationFormManager.createResponseForPortfolioEvaluation(responseIdentifier, numericalValue, stringuifiedReponse, session);
} else {
response = evaluationFormManager.updateResponseForPortfolioEvaluation(numericalValue, stringuifiedReponse, response);
}
updateCache(responseIdentifier, response);
}
use of org.olat.modules.forms.EvaluationFormResponse in project OpenOLAT by OpenOLAT.
the class CompareEvaluationsFormController method loadResponses.
private void loadResponses() {
flc.contextPut("messageNotDone", Boolean.FALSE);
List<Identity> evaluatorIdentities = evaluators.stream().map(evaluator -> evaluator.getIdentity()).collect(Collectors.toList());
List<EvaluationFormResponse> responses = evaluationFormManager.getResponsesFromPortfolioEvaluation(evaluatorIdentities, anchor, EvaluationFormSessionStatus.done);
for (EvaluationFormResponse response : responses) {
List<EvaluationFormResponse> responseList = identifierToResponses.get(response.getResponseIdentifier());
if (responseList == null) {
responseList = new ArrayList<>();
identifierToResponses.put(response.getResponseIdentifier(), responseList);
}
responseList.add(response);
}
}
use of org.olat.modules.forms.EvaluationFormResponse in project OpenOLAT by OpenOLAT.
the class CompareEvaluationsFormController method forgeTextInput.
private List<EvaluationFormElementWrapper> forgeTextInput(TextInput element) {
List<EvaluationFormResponse> responses = identifierToResponses.get(element.getId());
if (responses == null) {
// in review - selbstreview ??
return new ArrayList<>();
}
List<EvaluationFormElementWrapper> inputWrappers = new ArrayList<>(responses.size());
for (EvaluationFormResponse response : responses) {
if (StringHelper.containsNonWhitespace(response.getStringuifiedResponse())) {
String initialValue = response.getStringuifiedResponse();
if (initialValue != null) {
initialValue = Formatter.stripTabsAndReturns(initialValue).toString();
}
Identity evaluator = response.getSession().getIdentity();
String legend = getLegend(evaluator);
String color = evaluatorToColors.get(evaluator);
TextInputWrapper textInputWrapper = new TextInputWrapper(legend, color, initialValue, null);
EvaluationFormElementWrapper wrapper = new EvaluationFormElementWrapper(element);
wrapper.setTextInputWrapper(textInputWrapper);
inputWrappers.add(wrapper);
}
}
return inputWrappers;
}
use of org.olat.modules.forms.EvaluationFormResponse in project OpenOLAT by OpenOLAT.
the class CompareEvaluationsFormController method forgeFileUpload.
private List<EvaluationFormElementWrapper> forgeFileUpload(UserRequest ureq, FileUpload element) {
List<EvaluationFormResponse> responses = identifierToResponses.get(element.getId());
if (responses == null) {
return new ArrayList<>();
}
List<EvaluationFormElementWrapper> fileUploadWrappers = new ArrayList<>(responses.size());
for (EvaluationFormResponse response : responses) {
if (response.getFileResponse() != null) {
FileUploadCompareWrapper fileUploadWrapper = createFileUploadCompareWrapper(ureq, element, response);
EvaluationFormElementWrapper wrapper = new EvaluationFormElementWrapper(element);
wrapper.setFileUploadCompareWrapper(fileUploadWrapper);
fileUploadWrappers.add(wrapper);
}
}
return fileUploadWrappers;
}
Aggregations