Skip to content
Snippets Groups Projects
Commit d0698f95 authored by wiepke's avatar wiepke
Browse files

fix survey commit

parent 322ec431
No related branches found
No related tags found
No related merge requests found
package unipotsdam.gf.modules.group.preferences.survey;
public enum GroupWorkContext {
FL,
DOTA,
OVERWATCH,
fl,
dota,
overwatch,
}
......@@ -93,10 +93,10 @@ public class SurveyMapper {
String discordIdString = "(optional) Enter your discord ID!";
switch (groupWorkContext) {
case FL:
case fl:
break;
case DOTA:
case OVERWATCH:
case dota:
case overwatch:
LocalizedText discordQuestion =
new LocalizedText("" + discordIdString, "(optional) Geben Sie ihre Discord ID ein!");
addGeneralQuestion(DISCORDID, discordQuestion, generalDetails);
......
......@@ -47,7 +47,8 @@ public class SurveyView {
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Path("/data/project/{projectId}")
public SurveyData getSurveyData(@PathParam("projectId") String projectId) throws Exception {
return surveyMapper.getItemsFromDB(GroupWorkContext.DOTA, true, new Project(projectId));
// TODO change context to dynamic
return surveyMapper.getItemsFromDB(GroupWorkContext.dota, true, new Project(projectId));
}
@GET
......
......@@ -49,7 +49,7 @@ public class ProjectDAO {
project.setAuthorEmail("julian.dehne@uni-potsdam.de");
}
if (project.getGroupWorkContext() == null) {
project.setGroupWorkContext(GroupWorkContext.FL);
project.setGroupWorkContext(GroupWorkContext.fl);
}
connect.connect();
String mysqlRequest =
......@@ -238,7 +238,10 @@ public class ProjectDAO {
connect.issueSelectStatement(query, projectContext, Phase.GroupFormation);
boolean next = vereinfachtesResultSet.next();
String result = vereinfachtesResultSet.getString("name");
String result = null;
if (next) {
result = vereinfachtesResultSet.getString("name");
}
connect.close();
......
......@@ -95,7 +95,6 @@ CREATE TABLE `projects` (
`isSurvey` tinyint(1),
`context` varchar(100)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE projects ADD issurvey BOOLEAN NULL;
CREATE TABLE `projectuser` (
`projectName` varchar(100) NOT NULL,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment