Skip to content

Commit

Permalink
logging and keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobasco99 committed Jun 26, 2024
1 parent f96f2e3 commit 2160fce
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,9 @@ public Response calcNextResponse(String intent, String message, String buttonInt
}

if(!skipped){
System.out.println("not skipped");
if(intent.equals(buttonIntent)){
System.out.println("button answer recognized");
res = newButtonAnswer(newAnswer, lastQuestion, token, message, surveyDoneString, submitButton);
}
else if(lastQuestion.isBlocksQuestion() && SurveyHandlerService.messenger.equals(Messenger.TELEGRAM)){
Expand All @@ -1394,6 +1396,7 @@ else if(!this.currentSubquestionAnswers.isEmpty() && lastQuestion.getType().equa
res = newButtonAnswer(newAnswer, lastQuestion, token, message, surveyDoneString, submitButton);
}
} else {
System.out.println("text answer recognized");
res = newTextAnswer(newAnswer, lastQuestion, message);
}
}
Expand All @@ -1409,6 +1412,8 @@ else if(res == Response.noContent().build()){
return res;
}
else if(res != null){
System.out.println("not asking next question, but send specific response");
System.out.println(res);
// not asking next question, but send specific response
return res;
}
Expand Down Expand Up @@ -1768,6 +1773,7 @@ public Response newTextAnswer(Answer newAnswer, Question lastQuestion, String me

// Check if it is a text answer for button questions in rocket chat
if(lastQuestion.isBlocksQuestion() && (SurveyHandlerService.messenger.equals(Messenger.ROCKETCHAT) || SurveyHandlerService.messenger.equals(Messenger.RESTFUL))){
System.out.println("handle rc");
return handleRocketChat(newAnswer, lastQuestion, message, response, check, messageId, messageTs);
}

Expand Down Expand Up @@ -1880,10 +1886,12 @@ private Response handleRocketChat(Answer newAnswer, Question lastQuestion, Strin
// remove "."
message = message.substring(0,1);
} catch (Exception e){
System.out.println("Error parsing");
}
}
if(!lastQuestion.answerIsPlausible(message, check)){
response.put("message", lastQuestion.reasonAnswerNotPlausible());
response.put("channel", channel);
Context.get().monitorEvent(MonitoringEvent.RESPONSE_SENDING.toString());
return Response.ok().entity(response).build();
}
Expand Down

0 comments on commit 2160fce

Please sign in to comment.