From eb9d83f750c419216232f1c2c02e9b5a0db7cd32 Mon Sep 17 00:00:00 2001 From: Vibina Date: Wed, 20 Sep 2023 12:06:13 +0530 Subject: [PATCH] removed the template variable of unattempted answered --- php/admin/functions.php | 1 - php/template-variables.php | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/php/admin/functions.php b/php/admin/functions.php index 097b444f0..18d95720a 100644 --- a/php/admin/functions.php +++ b/php/admin/functions.php @@ -854,7 +854,6 @@ function qsm_text_template_variable_list() { '%AMOUNT_CORRECT%' => __( 'The number of correct answers the user had', 'quiz-master-next' ), '%AMOUNT_INCORRECT%' => __( 'The number of incorrect answers the user had', 'quiz-master-next' ), '%AMOUNT_ATTEMPTED%' => __( 'The number of questions are attempted', 'quiz-master-next' ), - '%AMOUNT_UNATTEMPTED%' => __( 'The number of questions are not attempted', 'quiz-master-next' ), '%TOTAL_QUESTIONS%' => __( 'The total number of questions in the quiz', 'quiz-master-next' ), '%CORRECT_SCORE%' => __( 'Score for the quiz when using correct answers', 'quiz-master-next' ), '%USER_NAME%' => __( 'The name the user entered before the quiz', 'quiz-master-next' ), diff --git a/php/template-variables.php b/php/template-variables.php index 38cb6ccde..5d9036002 100644 --- a/php/template-variables.php +++ b/php/template-variables.php @@ -49,7 +49,6 @@ add_filter( 'mlw_qmn_template_variable_results_page', 'qsm_variable_single_answer', 20, 2 ); add_filter( 'mlw_qmn_template_variable_results_page', 'qsm_variable_total_possible_points', 10, 2 ); add_filter( 'mlw_qmn_template_variable_results_page', 'qsm_variable_total_attempted_questions', 10, 2 ); -add_filter( 'mlw_qmn_template_variable_results_page', 'qsm_variable_total_unattempted_questions', 10, 2 ); add_filter( 'mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_user_full_name', 10, 2 ); add_filter( 'mlw_qmn_template_variable_results_page', 'qsm_variable_poll_result', 10, 3 ); add_filter( 'qmn_end_results', 'qsm_variable_poll_result', 10, 3 ); @@ -188,22 +187,6 @@ function qsm_variable_total_attempted_questions( $content, $mlw_quiz_array ) { $content = str_replace( '%AMOUNT_ATTEMPTED%', $total_attempted_questions, $content ); return $content; } -/** - * Function to get the count of not answered questions or not attempted questions - * - * @since 8.1.16 - * - * @param string $content - * @param array $mlw_quiz_array - * @return string $content - */ -function qsm_variable_total_unattempted_questions( $content, $mlw_quiz_array ) { - $total_attempted_questions = isset( $mlw_quiz_array['total_attempted_questions'] ) ? $mlw_quiz_array['total_attempted_questions'] : 0; - $total_questions = isset( $mlw_quiz_array['total_questions'] ) ? $mlw_quiz_array['total_questions'] : 0; - $total_unattempted_questions = $total_questions - $total_attempted_questions; - $content = str_replace( '%AMOUNT_UNATTEMPTED%', $total_unattempted_questions, $content ); - return $content; -} /** * Show poll result *