Skip to content
Permalink
Browse files

Add check to avoid errors when no degree of certainty question is in …

…the quiz
  • Loading branch information...
ywarnier committed Jul 17, 2018
1 parent 79f5bca commit 148a4217b15db16f0bee709c9af2c7869af4369d
Showing with 15 additions and 5 deletions.
  1. +15 −5 main/exercise/exercise_submit.php
@@ -791,11 +791,21 @@
header('Location: exercise_reminder.php?'.$params);
exit;
} else {
// Certainty grade question
// We send an email to the student before redirection to the result page
MultipleAnswerTrueFalseDegreeCertainty::sendQuestionCertaintyNotification(
$user_id, $objExercise, $exe_id
);
$certaintyQuestionPresent = false;
foreach ($questionList as $questionId) {
$question = Question::read($questionId);
if ($question->type == MULTIPLE_ANSWER_TRUE_FALSE_DEGREE_CERTAINTY) {
$certaintyQuestionPresent = true;
break;
}
}
if ($certaintyQuestionPresent) {
// Certainty grade question
// We send an email to the student before redirection to the result page
MultipleAnswerTrueFalseDegreeCertainty::sendQuestionCertaintyNotification(
$user_id, $objExercise, $exe_id
);
}
header("Location: exercise_result.php?"
.api_get_cidreq()

0 comments on commit 148a421

Please sign in to comment.
You can’t perform that action at this time.