Commit 8e29b846 authored by Kevin Robert's avatar Kevin Robert
Browse files

UNOTOPLYS-319 : Correction de la sérialisation

parent bc19954c
package com.unantes.orientactive.converter.bean;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.unantes.orientactive.export.ExportableItem;
import com.unantes.orientactive.web.api.model.ChoiceAPI;
import com.unantes.orientactive.web.api.model.MultipleChoiceItemAPI;
......@@ -65,6 +66,7 @@ public class MultipleChoiceItem extends AbstractQuestion implements ExportableIt
}
}
@JsonIgnore
@Override
public List<String> getExportAnswersLabels(List<String> answers) {
return answers.stream().map(this::getLabelForValue).collect(Collectors.toList());
......@@ -74,6 +76,7 @@ public class MultipleChoiceItem extends AbstractQuestion implements ExportableIt
return choices.stream().filter(choice -> choice.getValue().equals(code)).findFirst().orElseThrow().getLabel();
}
@JsonIgnore
@Override
public String getExportQuestionLabel() {
if (StringUtils.isBlank(shortLabel)) {
......@@ -82,6 +85,7 @@ public class MultipleChoiceItem extends AbstractQuestion implements ExportableIt
return shortLabel;
}
@JsonIgnore
@Override
public String getExportQuestionReference() {
return reference;
......
package com.unantes.orientactive.converter.bean;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.unantes.orientactive.export.ExportableItem;
import com.unantes.orientactive.web.api.model.OpenQuestionItemAPI;
import org.apache.commons.lang3.StringUtils;
......@@ -33,6 +34,7 @@ public class OpenQuestion extends Item implements ExportableItem {
super();
}
@JsonIgnore
@Override
public OpenQuestionItemAPI convertToApiBean() {
final OpenQuestionItemAPI openQuestionItemAPI = new OpenQuestionItemAPI();
......@@ -43,12 +45,14 @@ public class OpenQuestion extends Item implements ExportableItem {
return openQuestionItemAPI;
}
@JsonIgnore
@Override
public List<String> getExportAnswersLabels(List<String> answers) {
// On n'a pas de code, la réponse est directement la valeur à exporter.
return answers;
}
@JsonIgnore
@Override
public String getExportQuestionLabel() {
if (StringUtils.isBlank(shortLabel)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment