Skip to content

Commit

Permalink
change exception handling getting question in advance in a one-way quiz
Browse files Browse the repository at this point in the history
  • Loading branch information
ritosilva committed Nov 29, 2023
1 parent cda393d commit 07c1074
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,12 +484,11 @@ public StatementQuestionDto getQuestionForQuizAnswer(Integer questionId, Stateme
try {
quizAnswer.checkCanGetQuestion(questionId);
} catch (TutorException te) {
for (Teacher teacher : quizAnswer.getQuiz().getCourseExecution().getTeachers()) {
mailer.sendSimpleMail(mailUsername, teacher.getEmail(),
Mailer.QUIZZES_TUTOR_SUBJECT + " Alert", "The following behavior was detected but the student *was not able* to answer questions out of the predefined order: " + te.getMessage());
}

throw te;
mailer.sendSimpleMail(mailUsername, "rito.silva@tecnico.ulisboa.pt",
Mailer.QUIZZES_TUTOR_SUBJECT + " Alert", "In course "
+ quizAnswer.getQuiz().getCourseExecution().getCourse().getName()
+ ", the following behavior was detected but the student *was not able* to answer questions out of the predefined order: "
+ te.getMessage());
}
Question question = questionRepository.findById(questionId)
.orElseThrow(() -> new TutorException(QUESTION_NOT_FOUND, questionId));
Expand Down
2 changes: 1 addition & 1 deletion fraud-service/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ certifi==2023.11.17
cffi==1.14.3
chardet==3.0.4
click==8.1.7
cryptography==41.0.5
cryptography==41.0.6
cycler==0.10.0
Flask==2.3.2
idna==2.10
Expand Down

0 comments on commit 07c1074

Please sign in to comment.