Skip to content

Commit

Permalink
Merge pull request #2535 from QuizandSurveyMaster/bug-fatal-error-rou…
Browse files Browse the repository at this point in the history
…nd-must-int-tep-var-400

Resolve Fatal error issue when score is empty
  • Loading branch information
zubairraeen authored Apr 27, 2024
2 parents c469981 + f1da290 commit 151ff38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/template-variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,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;
Expand Down

0 comments on commit 151ff38

Please sign in to comment.