Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SIGPUBLIC
unantes-orientation-active
Commits
8e29b846
Commit
8e29b846
authored
Sep 28, 2021
by
Kevin Robert
Browse files
UNOTOPLYS-319 : Correction de la sérialisation
parent
bc19954c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/unantes/orientactive/converter/bean/MultipleChoiceItem.java
View file @
8e29b846
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
;
...
...
src/main/java/com/unantes/orientactive/converter/bean/OpenQuestion.java
View file @
8e29b846
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
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment