diff --git a/src/main/java/de/thm/arsnova/dao/CouchDBDao.java b/src/main/java/de/thm/arsnova/dao/CouchDBDao.java index 9fd7da02f3e1b2c05abe6bbb45c23b86ed64ecbe..5f2781d8e668e9cf9e82f5a484b7eeb99e06c2b5 100644 --- a/src/main/java/de/thm/arsnova/dao/CouchDBDao.java +++ b/src/main/java/de/thm/arsnova/dao/CouchDBDao.java @@ -982,7 +982,11 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware a.setAbstentionCount(abstentionCount); a.setQuestionId(d.getJSONObject().getJSONArray("key").getString(0)); final String answerText = d.getJSONObject().getJSONArray("key").getString(1); + final String answerSubject = d.getJSONObject().getJSONArray("key").getString(2); + final boolean successfulFreeTextAnswer = d.getJSONObject().getJSONArray("key").getBoolean(3); a.setAnswerText("null".equals(answerText) ? null : answerText); + a.setAnswerSubject("null".equals(answerSubject) ? null : answerSubject); + a.setSuccessfulFreeTextAnswer(successfulFreeTextAnswer); answers.add(a); } return answers; @@ -2167,6 +2171,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware answerDoc.put("timestamp", a.getTimestamp()); answerDoc.put("piRound", a.getPiRound()); answerDoc.put("abstention", a.isAbstention()); + answerDoc.put("successfulFreeTextAnswer", a.isSuccessfulFreeTextAnswer()); // we do not store the user's name answerDoc.put("user", ""); answers.add(answerDoc); diff --git a/src/main/java/de/thm/arsnova/entities/transport/Answer.java b/src/main/java/de/thm/arsnova/entities/transport/Answer.java index 4b321430a85ff7ba9f4ba93fc05c120b10dab9f4..3fe6675ab20cfc1f3e96694ad433dec8ff7ac550 100644 --- a/src/main/java/de/thm/arsnova/entities/transport/Answer.java +++ b/src/main/java/de/thm/arsnova/entities/transport/Answer.java @@ -55,6 +55,7 @@ public class Answer implements Serializable { answerText = a.getAnswerText(); answerImage = a.getAnswerImage(); abstention = a.isAbstention(); + successfulFreeTextAnswer = a.isSuccessfulFreeTextAnswer(); } @ApiModelProperty(required = true, value = "used to display text answer") @@ -99,6 +100,7 @@ public class Answer implements Serializable { this.freeTextScore = freeTextScore; } + @ApiModelProperty(required = true, value = "successfulFreeTextAnswer") public final boolean isSuccessfulFreeTextAnswer() { return this.successfulFreeTextAnswer; } @@ -132,6 +134,7 @@ public class Answer implements Serializable { // calculate learning progress value after all properties are set theAnswer.setQuestionValue(question.calculateValue(theAnswer)); theAnswer.setAnswerImage(this.getAnswerImage()); + theAnswer.setSuccessfulFreeTextAnswer(this.isSuccessfulFreeTextAnswer()); if ("freetext".equals(question.getQuestionType())) { theAnswer.setPiRound(0); diff --git a/src/main/java/de/thm/arsnova/entities/transport/ImportExportSession.java b/src/main/java/de/thm/arsnova/entities/transport/ImportExportSession.java index b6c22898acc69781ce744835b77c110315c0d0cb..fcd1126e1047869bd8f5d1f4a973b53212f2dac6 100644 --- a/src/main/java/de/thm/arsnova/entities/transport/ImportExportSession.java +++ b/src/main/java/de/thm/arsnova/entities/transport/ImportExportSession.java @@ -209,6 +209,12 @@ public class ImportExportSession { setTextAnswerEnabled(q.isTextAnswerEnabled()); setHint(q.getHint()); setSolution(q.getSolution()); + setCorrectAnswer(q.getCorrectAnswer()); + setFixedAnswer(q.isFixedAnswer()); + setIgnoreCaseSensitive(q.isIgnoreCaseSensitive()); + setIgnorePunctuation(q.isIgnorePunctuation()); + setIgnoreWhitespaces(q.isIgnoreWhitespaces()); + setRating(q.getRating()); } @ApiModelProperty(required = true, value = " used to display answers")