Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed the template variable of unattempted answered #2355

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading