From f1da290bc2f486cd653e29192a3db9fad1208859 Mon Sep 17 00:00:00 2001 From: dev-krunal Date: Thu, 4 Apr 2024 12:33:20 +0530 Subject: [PATCH] Resolve Fatal error issue when score is empty --- php/template-variables.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/template-variables.php b/php/template-variables.php index 9dbcc19e4..8b27e67e3 100644 --- a/php/template-variables.php +++ b/php/template-variables.php @@ -396,7 +396,7 @@ function mlw_qmn_variable_total_questions( $content, $mlw_quiz_array ) { } function mlw_qmn_variable_correct_score( $content, $mlw_quiz_array ) { - $correct_score = isset( $mlw_quiz_array['total_score'] ) ? $mlw_quiz_array['total_score'] : ''; + $correct_score = isset( $mlw_quiz_array['total_score'] ) ? $mlw_quiz_array['total_score'] : 0; $correct_score = qsm_is_allow_score_roundoff() ? round( $correct_score ) : round( $correct_score, 2 ); $content = str_replace( '%CORRECT_SCORE%', $correct_score, $content ); return $content;