Skip to content
Snippets Groups Projects
Commit 0247140b authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Fix answer migration handling for serialization

The format for answers is now set based on the content's format.
parent 8f0ec8f5
Branches
No related merge requests found
Pipeline #20469 passed with warnings with stages
in 2 minutes and 2 seconds
...@@ -229,12 +229,16 @@ public class FromV2Migrator { ...@@ -229,12 +229,16 @@ public class FromV2Migrator {
} }
public de.thm.arsnova.model.Answer migrate(final Answer from, final de.thm.arsnova.model.Content content) { public de.thm.arsnova.model.Answer migrate(final Answer from, final de.thm.arsnova.model.Content content) {
de.thm.arsnova.model.Answer answer;
if (content instanceof ChoiceQuestionContent) { if (content instanceof ChoiceQuestionContent) {
ChoiceQuestionContent choiceQuestionContent = (ChoiceQuestionContent) content; ChoiceQuestionContent choiceQuestionContent = (ChoiceQuestionContent) content;
return migrate(from, choiceQuestionContent.getOptions(), choiceQuestionContent.isMultiple()); answer = migrate(from, choiceQuestionContent.getOptions(), choiceQuestionContent.isMultiple());
} else { } else {
return migrate(from); answer = migrate(from);
} }
answer.setFormat(content.getFormat());
return answer;
} }
public ChoiceAnswer migrate(final Answer from, final List<ChoiceQuestionContent.AnswerOption> options, final boolean multiple) { public ChoiceAnswer migrate(final Answer from, final List<ChoiceQuestionContent.AnswerOption> options, final boolean multiple) {
......
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