Skip to content

Commit

Permalink
removed the template variable of unattempted answered
Browse files Browse the repository at this point in the history
  • Loading branch information
vibina-et committed Sep 20, 2023
1 parent 265719a commit eb9d83f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion php/admin/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
Expand Down
17 changes: 0 additions & 17 deletions php/template-variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit eb9d83f

Please sign in to comment.