Skip to content
Snippets Groups Projects
Commit 998c5e97 authored by Tom Käsler's avatar Tom Käsler
Browse files

fix sessionFeature (move responsibility to session object)

parent b51f5dc1
Branches
Tags
No related merge requests found
...@@ -2108,7 +2108,6 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware ...@@ -2108,7 +2108,6 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware
@Override @Override
public SessionInfo importSession(User user, ImportExportSession importSession) { public SessionInfo importSession(User user, ImportExportSession importSession) {
final Session session = this.saveSession(user, importSession.generateSessionEntity(user)); final Session session = this.saveSession(user, importSession.generateSessionEntity(user));
sessionService.changeSessionFeatures(session.getKeyword(), importSession.getSessionFeature());
List<Document> questions = new ArrayList<Document>(); List<Document> questions = new ArrayList<Document>();
// We need to remember which answers belong to which question. // We need to remember which answers belong to which question.
// The answers need a questionId, so we first store the questions to get the IDs. // The answers need a questionId, so we first store the questions to get the IDs.
......
...@@ -45,7 +45,7 @@ public class ImportExportSession { ...@@ -45,7 +45,7 @@ public class ImportExportSession {
private List<Motd> motds; private List<Motd> motds;
private SessionFeature sessionFeature; private SessionFeature sessionFeature = new SessionFeature();
private SessionInfo sessionInfo; private SessionInfo sessionInfo;
...@@ -53,7 +53,6 @@ public class ImportExportSession { ...@@ -53,7 +53,6 @@ public class ImportExportSession {
questions = new ArrayList<ImportExportQuestion>(); questions = new ArrayList<ImportExportQuestion>();
feedbackQuestions = new ArrayList<InterposedQuestion>(); feedbackQuestions = new ArrayList<InterposedQuestion>();
motds = new ArrayList<Motd>(); motds = new ArrayList<Motd>();
sessionFeature = null;
sessionInfo = null; sessionInfo = null;
} }
...@@ -132,6 +131,7 @@ public class ImportExportSession { ...@@ -132,6 +131,7 @@ public class ImportExportSession {
s.setActive(session.isActive()); s.setActive(session.isActive());
s.setName(session.getName()); s.setName(session.getName());
s.setShortName(session.getShortName()); s.setShortName(session.getShortName());
s.setFeatures(session.getSessionFeature());
// public pool // public pool
if (session.getPublicPool() != null) { if (session.getPublicPool() != null) {
// overwrite name and shortname // overwrite name and shortname
...@@ -236,6 +236,8 @@ public class ImportExportSession { ...@@ -236,6 +236,8 @@ public class ImportExportSession {
private PublicPool publicPool; private PublicPool publicPool;
private SessionFeature sessionFeature;
@ApiModelProperty(required = true, value = "used to display short name") @ApiModelProperty(required = true, value = "used to display short name")
public String getName() { public String getName() {
return name; return name;
...@@ -271,6 +273,14 @@ public class ImportExportSession { ...@@ -271,6 +273,14 @@ public class ImportExportSession {
public void setPublicPool(PublicPool publicPool) { public void setPublicPool(PublicPool publicPool) {
this.publicPool = publicPool; this.publicPool = publicPool;
} }
public SessionFeature getSessionFeature() {
return this.sessionFeature;
}
public void setSessionFeature(SessionFeature sF) {
this.sessionFeature = sF;
}
} }
public static class PublicPool { public static class PublicPool {
......
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