Skip to content

Commit

Permalink
adjust keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobasco99 committed Jun 13, 2024
1 parent 2276719 commit 56dd935
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public Response calculateNextAction(String intent, String message, String messag
if (participantDone){
System.out.println("participant done");
response.put("message", completedSurvey);
response.put("intent", "Ende");
response.put("contextOn", false);
Context.get().monitorEvent(MonitoringEvent.RESPONSE_SENDING.toString());
return Response.ok().entity(response).build();
}
Expand Down Expand Up @@ -379,6 +379,7 @@ private Response AskNextQuestion(String surveyDoneString, boolean firstMessage){
JSONArray answerOptions = this.currentSurvey.getQuestionByQid(nextId, this.language).getAnswerOptionsForRest();
response.put("message", msg);
response.put("interactiveElements", answerOptions);
response.put("contextOn", true);
} else {
response.put("text", messageText);
}
Expand Down Expand Up @@ -429,6 +430,7 @@ private void handleRestful(boolean firstMessage, JSONObject response, String nex
JSONArray answerOptions = this.currentSurvey.getQuestionByQid(nextId, this.language).getAnswerOptionsForRest();
response.put("message", msg);
response.put("interactiveElements", answerOptions);
response.put("contextOn", true);
} else {
response.put("text", skipText + messageText);
}
Expand Down Expand Up @@ -2134,7 +2136,7 @@ public Response surveyDone(String surveyDoneString){
// No questions remaining, survey done.
this.completedsurvey = true;
SurveyHandlerServiceQueries.updateParticipantInDB(this, this.currentSurvey.database);
response.put("intent", "Ende");
response.put("contextOn", false);
response.put("message", surveyDoneString); //+ currParticipant.getEmail() + currParticipant.getUnaskedQuestions() + currParticipant.getSkippedQuestions()
Context.get().monitorEvent(MonitoringEvent.RESPONSE_SENDING.toString());
return Response.ok().entity(response).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ public Response nextQuestion(String input) {
if (Objects.isNull(currSurvey) || !setUp){
deleteSurvey(surveyID);
System.out.println("ERROR: Could not set up survey, still null.");
response.put("text", "ERROR: Could not set up survey. Reason unknown.");
response.put("message", "ERROR: Could not set up survey. Reason unknown.");
Context.get().monitorEvent(MonitoringEvent.RESPONSE_SENDING.toString());
return Response.ok().entity(response).build();
}
Expand Down Expand Up @@ -1434,7 +1434,7 @@ public Response nextQuestion(String input) {
// no unfinished survey left
String completedSurvey = SurveyHandlerService.texts.get("completedSurveyDE");
response.put("message", completedSurvey);
response.put("intent", "Ende");
response.put("contextOn", false);
Context.get().monitorEvent(MonitoringEvent.RESPONSE_SENDING.toString());
return Response.ok().entity(response).build();
}
Expand All @@ -1449,7 +1449,7 @@ public Response nextQuestion(String input) {
} catch (ParseException e) {
e.printStackTrace();
}
response.put("text", "Something went wrong in Next Question try block.");
response.put("message", "Something went wrong in Next Question try block.");
return Response.ok().entity(response).build();
}

Expand Down Expand Up @@ -2076,7 +2076,7 @@ else if (!adminmail.equals(senderEmail)) {
Survey currSurvey = getSurveyBySurveyID(surveyID);

if(Objects.isNull(currSurvey)){
response.put("text", "Please initiate the setup of the survey first.");
response.put("message", "Please initiate the setup of the survey first.");
Context.get().monitorEvent(MonitoringEvent.RESPONSE_SENDING.toString());
return Response.ok().entity(response).build();
}
Expand Down Expand Up @@ -2122,7 +2122,7 @@ else if (!adminmail.equals(senderEmail)) {
System.out.println("response id: " + pa.getSurveyResponseID());
} catch (Exception e){
System.out.println("ERROR in sending results to LimeSurvey");
response.put("text", surveyResponseID);
response.put("message", surveyResponseID);
Context.get().monitorEvent(MonitoringEvent.RESPONSE_SENDING.toString());
return Response.ok().entity(response).build();
}
Expand Down

0 comments on commit 56dd935

Please sign in to comment.