diff --git a/main/exercise/exercise_result.php b/main/exercise/exercise_result.php index e83231ba2a..2dc09e7e76 100755 --- a/main/exercise/exercise_result.php +++ b/main/exercise/exercise_result.php @@ -273,6 +273,12 @@ if (!empty($notifications)) { MessageManager::send_message($currentUserId, $subject, $content); } + // Subject for notifications + $subject = sprintf(get_lang('WrongAttemptXInCourseX'), $attemptCountToSend, $courseInfo['title']); + if ($exercisePassed) { + $subject = sprintf(get_lang('ExerciseValidationInCourseX'), $courseInfo['title']); + } + $extraFieldData = $exerciseExtraFieldValue->get_values_by_handler_and_field_variable( $objExercise->iId, 'notifications' @@ -362,7 +368,7 @@ if (!empty($notifications)) { $objExercise->iId, $attempt['content'] ); - if ($extraFieldData && isset($extraFieldData['value'])) { + if ($extraFieldData && isset($extraFieldData['value']) && !empty($extraFieldData['value'])) { $content = $extraFieldData['value']; } }