diff --git a/php/classes/class-qmn-quiz-manager.php b/php/classes/class-qmn-quiz-manager.php index c1992c9be..a603d6a6a 100644 --- a/php/classes/class-qmn-quiz-manager.php +++ b/php/classes/class-qmn-quiz-manager.php @@ -998,7 +998,7 @@ public function display_pages( $options, $quiz_data ) { if ( ( 1 == $options->randomness_order || 2 == $options->randomness_order ) && is_array( $pages ) ) { shuffle( $pages ); $question_list_array = array(); - foreach( $pages as &$question_ids ){ + foreach ( $pages as &$question_ids ) { shuffle( $question_ids ); $question_list_array = array_merge($question_list_array, $question_ids); } @@ -1896,7 +1896,6 @@ public function submit_results( $qmn_quiz_options, $qmn_array_for_variables ) { * @return array The results of the user's score */ public static function check_answers( $options, $quiz_data ) { - global $mlwQuizMasterNext; $new_questions = array(); // Load the pages and questions @@ -2135,7 +2134,13 @@ public static function check_answers( $options, $quiz_data ) { } } } + foreach ( $question_data as $questiontype ) { + if ( 11 == $questiontype['question_type'] ) { + $total_questions = $total_questions - 1; + } + } + // Calculate Total Percent Score And Average Points Only If Total Questions Doesn't Equal Zero To Avoid Division By Zero Error if ( 0 !== $total_questions ) { $total_score = round( ( ( $total_correct / ( $total_questions - count( $hidden_questions ) ) ) * 100 ), 2 ); diff --git a/php/question-types/qsm-question-type-file-upload.php b/php/question-types/qsm-question-type-file-upload.php index 6dcd9be0c..74a2da6c8 100644 --- a/php/question-types/qsm-question-type-file-upload.php +++ b/php/question-types/qsm-question-type-file-upload.php @@ -52,7 +52,6 @@ function qmn_file_upload_review( $id, $question, $answers ) { $return_array['user_text'] = ($file_url) ? '' . __( 'Click here to view', 'quiz-master-next' ) . '' : __( 'No file uploaded', 'quiz-master-next' ); $return_array['correct_text'] = ! empty( $correct_text_array ) ? implode( ', ', $correct_text_array ) : ''; $return_array['correct'] = $current_question->get_answer_status( 'url' ); - $return_array['points'] = $current_question->get_points(); $return_array['user_answer'] = $user_text_array; $return_array['correct_answer'] = $correct_text_array; /**