Quiz And Survey Master (Formerly Quiz Master Next) - Version 7.1.2

Version Description

(September 04, 2020) = * Bug: Fixed admin results page to make it compatible with new variable %QUESTIONS_ANSWERS_DEFAULT%. * Bug: Fixed issues with %QUESTIONS_ANSWERS_DEFAULT% variable in quiz result while using point based quiz. * Bug: Fixed validation issue on front end while using Deselect Answer option. * Bug: Fixed issues with inline results when there is extra spacing between words. * Enhancement: Added feature to show the uploaded file into media library for File Upload question type.

Download this release

Release Info

Developer expresstech
Plugin Icon 128x128 Quiz And Survey Master (Formerly Quiz Master Next)
Version 7.1.2
Comparing to
See all releases

Code changes from version 7.1.1 to 7.1.2

css/qsm-admin.css CHANGED
@@ -1195,7 +1195,7 @@ h3.addon_category_name {
1195
  box-shadow: none;
1196
  color: #666666;
1197
  padding: 10px 15px;
1198
- width: auto;
1199
  height: auto;
1200
  }
1201
  .global-sub-text{
@@ -1650,9 +1650,17 @@ td.scheduled_time_start {
1650
  .response-inner-wrap .inside .qmn_question_answer.qmn_question_answer_incorrect{
1651
  background-image: url(../assets/wrong.png);
1652
  }
 
 
 
 
1653
  .response-inner-wrap .inside .qmn_question_answer.qmn_question_answer_correct{
1654
  background-image: url(../assets/right.png);
1655
  }
 
 
 
 
1656
  .old_template_result_wrap{
1657
  padding: 15px;
1658
  background: #fff;
1195
  box-shadow: none;
1196
  color: #666666;
1197
  padding: 10px 15px;
1198
+ width: 100%;
1199
  height: auto;
1200
  }
1201
  .global-sub-text{
1650
  .response-inner-wrap .inside .qmn_question_answer.qmn_question_answer_incorrect{
1651
  background-image: url(../assets/wrong.png);
1652
  }
1653
+ .response-inner-wrap .inside .qsm-add-border-bottom.qmn_question_answer.qmn_question_answer_incorrect,
1654
+ .response-inner-wrap .inside .qsm-remove-border-bottom.qmn_question_answer.qmn_question_answer_incorrect{
1655
+ background-image: none;
1656
+ }
1657
  .response-inner-wrap .inside .qmn_question_answer.qmn_question_answer_correct{
1658
  background-image: url(../assets/right.png);
1659
  }
1660
+ .response-inner-wrap .inside .qsm-add-border-bottom.qmn_question_answer.qmn_question_answer_correct,
1661
+ .response-inner-wrap .inside .qsm-remove-border-bottom.qmn_question_answer.qmn_question_answer_correct{
1662
+ background-image: none;
1663
+ }
1664
  .old_template_result_wrap{
1665
  padding: 15px;
1666
  background: #fff;
js/qsm-quiz.js CHANGED
@@ -1319,6 +1319,7 @@ jQuery(function() {
1319
  jQuery('.qsm-deselect-answer').click(function(e){
1320
  e.preventDefault();
1321
  jQuery(this).parents('.quiz_section').find('input[type="radio"]').prop('checked', false);
 
1322
  });
1323
 
1324
  //Submit the form on popup click
1319
  jQuery('.qsm-deselect-answer').click(function(e){
1320
  e.preventDefault();
1321
  jQuery(this).parents('.quiz_section').find('input[type="radio"]').prop('checked', false);
1322
+ jQuery(this).parents('.quiz_section').find('input[type="radio"][value="No Answer Provided"]').prop('checked', true);
1323
  });
1324
 
1325
  //Submit the form on popup click
mlw_quizmaster2.php CHANGED
@@ -2,14 +2,14 @@
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
- * Version: 7.1.1
6
  * Author: ExpressTech
7
  * Author URI: https://quizandsurveymaster.com/
8
  * Plugin URI: https://expresstech.io/
9
  * Text Domain: quiz-master-next
10
  *
11
  * @author QSM Team
12
- * @version 7.1.1
13
  * @package QSM
14
  */
15
 
@@ -37,7 +37,7 @@ class MLWQuizMasterNext {
37
  * @var string
38
  * @since 4.0.0
39
  */
40
- public $version = '7.1.1';
41
 
42
  /**
43
  * QSM Alert Manager Object
@@ -273,7 +273,7 @@ class MLWQuizMasterNext {
273
  public function setup_admin_menu() {
274
  if ( function_exists( 'add_menu_page' ) ) {
275
  global $qsm_quiz_list_page;
276
- $qsm_dashboard_page = add_menu_page( 'Quiz And Survey Master', __( 'Quiz And Survey Master', 'quiz-master-next' ), 'edit_posts', 'qsm_dashboard', 'qsm_generate_dashboard_page', 'dashicons-feedback' );
277
  add_submenu_page( 'qsm_dashboard', __( 'Dashboard', 'quiz-master-next' ), __( 'Dashboard', 'quiz-master-next' ), 'edit_posts', 'qsm_dashboard', 'qsm_generate_dashboard_page' );
278
  $qsm_quiz_list_page = add_submenu_page( 'qsm_dashboard', __( 'Quizzes/Surveys', 'quiz-master-next' ), __( 'Quizzes/Surveys', 'quiz-master-next' ), 'edit_posts', 'mlw_quiz_list', 'qsm_generate_quizzes_surveys_page' );
279
  add_action("load-$qsm_quiz_list_page", 'qsm_generate_quizzes_surveys_page_screen_options');
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
+ * Version: 7.1.2
6
  * Author: ExpressTech
7
  * Author URI: https://quizandsurveymaster.com/
8
  * Plugin URI: https://expresstech.io/
9
  * Text Domain: quiz-master-next
10
  *
11
  * @author QSM Team
12
+ * @version 7.1.2
13
  * @package QSM
14
  */
15
 
37
  * @var string
38
  * @since 4.0.0
39
  */
40
+ public $version = '7.1.2';
41
 
42
  /**
43
  * QSM Alert Manager Object
273
  public function setup_admin_menu() {
274
  if ( function_exists( 'add_menu_page' ) ) {
275
  global $qsm_quiz_list_page;
276
+ $qsm_dashboard_page = add_menu_page( 'Quiz And Survey Master', __( 'QSM', 'quiz-master-next' ), 'edit_posts', 'qsm_dashboard', 'qsm_generate_dashboard_page', 'dashicons-feedback' );
277
  add_submenu_page( 'qsm_dashboard', __( 'Dashboard', 'quiz-master-next' ), __( 'Dashboard', 'quiz-master-next' ), 'edit_posts', 'qsm_dashboard', 'qsm_generate_dashboard_page' );
278
  $qsm_quiz_list_page = add_submenu_page( 'qsm_dashboard', __( 'Quizzes/Surveys', 'quiz-master-next' ), __( 'Quizzes/Surveys', 'quiz-master-next' ), 'edit_posts', 'mlw_quiz_list', 'qsm_generate_quizzes_surveys_page' );
279
  add_action("load-$qsm_quiz_list_page", 'qsm_generate_quizzes_surveys_page_screen_options');
php/admin/admin-results-details-page.php CHANGED
@@ -11,7 +11,8 @@ function qsm_generate_result_details() {
11
  return;
12
  }
13
  global $mlwQuizMasterNext;
14
- wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ), array(), $mlwQuizMasterNext->version );
 
15
  wp_enqueue_script( 'math_jax', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' );
16
  $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'results';
17
  $tab_array = $mlwQuizMasterNext->pluginHelper->get_results_tabs();
11
  return;
12
  }
13
  global $mlwQuizMasterNext;
14
+ wp_enqueue_style( 'qsm_common_style', plugins_url( '../../css/common.css', __FILE__ ) );
15
+ wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ), array(), $mlwQuizMasterNext->version );
16
  wp_enqueue_script( 'math_jax', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' );
17
  $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'results';
18
  $tab_array = $mlwQuizMasterNext->pluginHelper->get_results_tabs();
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -121,6 +121,21 @@ class QMNQuizManager {
121
  $json['message'] = __('File not uploaded', 'quiz-master-next');
122
  echo json_encode($json);
123
  }else{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  $json['type']= 'success';
125
  $json['message'] = __( 'File uploaded successfully', 'quiz-master-next' );
126
  $json['file_url'] = $file_url;
@@ -142,9 +157,12 @@ class QMNQuizManager {
142
  public function qsm_remove_file_fd_question(){
143
  $file_url = isset($_POST['file_url']) ? sanitize_text_field($_POST['file_url']) : '';
144
  $upload_dir = wp_upload_dir();
145
- $uploaded_path = $upload_dir['path'];
146
  if($file_url && stristr( $file_url, 'qsmfileupload_' ) && file_exists( $uploaded_path . '/' . $file_url ) ){
 
 
147
  wp_delete_file( $uploaded_path . '/' . $file_url );
 
148
  $json['type']= 'success';
149
  $json['message'] = __( 'File removed successfully', 'quiz-master-next' );
150
  echo json_encode($json);
@@ -164,10 +182,10 @@ class QMNQuizManager {
164
  public function qsm_get_question_quick_result(){
165
  global $wpdb;
166
  $question_id = isset($_POST['question_id']) ? intval($_POST['question_id']) : 0;
167
- $answer = isset($_POST['answer']) ? sanitize_text_field($_POST['answer']) : '';
168
  $question_array = $wpdb->get_row( "SELECT answer_array FROM {$wpdb->prefix}mlw_questions WHERE question_id = ($question_id)", 'ARRAY_A' );
169
  $answer_array = unserialize($question_array['answer_array']);
170
- $got_ans = false;
171
  if($answer_array && $got_ans === false){
172
  foreach ($answer_array as $key => $value) {
173
  if($value[0] == $answer && $value[2] == 1){
@@ -1144,6 +1162,8 @@ class QMNQuizManager {
1144
  $qmn_array_for_variables['parameters'] = $results_array['parameters'];
1145
  }
1146
  $results_array['hidden_questions'] = $qmn_array_for_variables['hidden_questions'];
 
 
1147
  $serialized_results = serialize($results_array);
1148
 
1149
  // Inserts the responses in the database.
@@ -1917,6 +1937,44 @@ class QMNQuizManager {
1917
  $allowed_html = wp_kses_allowed_html( 'post' );
1918
  return do_shortcode( wp_kses( $editor_text, $allowed_html ) );
1919
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1920
  }
1921
 
1922
  global $qmnQuizManager;
121
  $json['message'] = __('File not uploaded', 'quiz-master-next');
122
  echo json_encode($json);
123
  }else{
124
+ // Prepare an array of post data for the attachment.
125
+ $attachment = array(
126
+ 'guid' => $upload_dir['url'] . '/' . basename( $file ),
127
+ 'post_mime_type' => $validate_file['type'],
128
+ 'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $file_name ) ),
129
+ 'post_content' => '',
130
+ 'post_status' => 'inherit'
131
+ );
132
+ // Insert the attachment.
133
+ $attach_id = wp_insert_attachment( $attachment, $file, 0 );
134
+ if( $attach_id ){
135
+ require_once( ABSPATH . 'wp-admin/includes/image.php' );
136
+ $attach_data = wp_generate_attachment_metadata( $attach_id, $file );
137
+ wp_update_attachment_metadata( $attach_id, $attach_data );
138
+ }
139
  $json['type']= 'success';
140
  $json['message'] = __( 'File uploaded successfully', 'quiz-master-next' );
141
  $json['file_url'] = $file_url;
157
  public function qsm_remove_file_fd_question(){
158
  $file_url = isset($_POST['file_url']) ? sanitize_text_field($_POST['file_url']) : '';
159
  $upload_dir = wp_upload_dir();
160
+ $uploaded_path = $upload_dir['path'];
161
  if($file_url && stristr( $file_url, 'qsmfileupload_' ) && file_exists( $uploaded_path . '/' . $file_url ) ){
162
+ $attachment_url = $upload_dir['url'] . '/' . $file_url;
163
+ $attachment_id = $this->qsm_get_attachment_id_from_url($attachment_url);
164
  wp_delete_file( $uploaded_path . '/' . $file_url );
165
+ wp_delete_attachment( $attachment_id );
166
  $json['type']= 'success';
167
  $json['message'] = __( 'File removed successfully', 'quiz-master-next' );
168
  echo json_encode($json);
182
  public function qsm_get_question_quick_result(){
183
  global $wpdb;
184
  $question_id = isset($_POST['question_id']) ? intval($_POST['question_id']) : 0;
185
+ $answer = isset( $_POST['answer'] ) ? sanitize_textarea_field( $_POST['answer'] ) : '';
186
  $question_array = $wpdb->get_row( "SELECT answer_array FROM {$wpdb->prefix}mlw_questions WHERE question_id = ($question_id)", 'ARRAY_A' );
187
  $answer_array = unserialize($question_array['answer_array']);
188
+ $got_ans = false;
189
  if($answer_array && $got_ans === false){
190
  foreach ($answer_array as $key => $value) {
191
  if($value[0] == $answer && $value[2] == 1){
1162
  $qmn_array_for_variables['parameters'] = $results_array['parameters'];
1163
  }
1164
  $results_array['hidden_questions'] = $qmn_array_for_variables['hidden_questions'];
1165
+ $results_array['total_possible_points'] = $qmn_array_for_variables['total_possible_points'];
1166
+ $results_array['total_attempted_questions'] = $qmn_array_for_variables['total_attempted_questions'];
1167
  $serialized_results = serialize($results_array);
1168
 
1169
  // Inserts the responses in the database.
1937
  $allowed_html = wp_kses_allowed_html( 'post' );
1938
  return do_shortcode( wp_kses( $editor_text, $allowed_html ) );
1939
  }
1940
+
1941
+ /**
1942
+ * Get attachment id from attachment url
1943
+ *
1944
+ * @since 7.1.2
1945
+ *
1946
+ * @global obj $wpdb
1947
+ * @param url $attachment_url
1948
+ * @return int
1949
+ */
1950
+ public function qsm_get_attachment_id_from_url( $attachment_url = '' ) {
1951
+
1952
+ global $wpdb;
1953
+ $attachment_id = false;
1954
+
1955
+ // If there is no url, return.
1956
+ if ( '' == $attachment_url )
1957
+ return;
1958
+
1959
+ // Get the upload directory paths
1960
+ $upload_dir_paths = wp_upload_dir();
1961
+
1962
+ // Make sure the upload path base directory exists in the attachment URL, to verify that we're working with a media library image
1963
+ if ( false !== strpos( $attachment_url, $upload_dir_paths['baseurl'] ) ) {
1964
+
1965
+ // If this is the URL of an auto-generated thumbnail, get the URL of the original image
1966
+ $attachment_url = preg_replace( '/-\d+x\d+(?=\.(jpg|jpeg|png|gif)$)/i', '', $attachment_url );
1967
+
1968
+ // Remove the upload path base directory from the attachment URL
1969
+ $attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url );
1970
+
1971
+ // Finally, run a custom database query to get the attachment ID from the modified attachment URL
1972
+ $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $attachment_url ) );
1973
+
1974
+ }
1975
+
1976
+ return $attachment_id;
1977
+ }
1978
  }
1979
 
1980
  global $qmnQuizManager;
php/template-variables.php CHANGED
@@ -489,12 +489,14 @@ function mlw_qmn_variable_question_answers( $content, $mlw_quiz_array ) {
489
  $mlw_question_answer_display = str_replace( "%QUESTION%" , '<b>' . htmlspecialchars_decode($answer[0], ENT_QUOTES) . '</b>', $mlw_question_answer_display);
490
  }
491
  $mlw_question_answer_display = qsm_question_title_func($mlw_question_answer_display);
492
- $extra_border_bottom_class = '';
493
  if( strpos( $mlw_question_answer_display, '%USER_ANSWERS_DEFAULT%') !== false ){
494
  $extra_border_bottom_class = 'qsm-add-border-bottom';
495
  $show_two_option_questions = array(
496
  3,12,5,7,14
497
- );
 
 
498
  if( isset( $answer['id'] ) && isset( $questions[ $answer['id'] ] ) && !empty( $questions[ $answer['id'] ] ) ){
499
  $total_answers = isset( $questions[ $answer['id'] ][ 'answers' ] ) ? $questions[ $answer['id'] ][ 'answers' ] : array();
500
  $question_with_answer_text = '';
@@ -502,32 +504,100 @@ function mlw_qmn_variable_question_answers( $content, $mlw_quiz_array ) {
502
  if( isset($answer['question_type']) && in_array( $answer['question_type'], $show_two_option_questions) ){
503
  $do_show_wrong = true;
504
  foreach( $total_answers as $single_answer ){
505
- if( isset( $single_answer[2] ) && $single_answer[2] == 1 && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] ){
506
- $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
507
- $do_show_wrong = false;
508
- }
509
- }
510
- if( $do_show_wrong ){
511
- $question_with_answer_text .= '<span class="qsm-text-wrong-option">'. htmlspecialchars_decode($answer[1], ENT_QUOTES) .'</span>';
512
- foreach( $total_answers as $single_answer ){
513
- if( isset( $single_answer[2] ) && $single_answer[2] == 1 ){
514
  $question_with_answer_text .= '<span class="qsm-text-correct-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
515
- break;
516
  }
517
  }
518
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
  } else {
520
- foreach ( $total_answers as $single_answer ) {
521
- if( isset( $single_answer[2] ) && $single_answer[2] == 1 && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] ){
522
- $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
523
- }else if( isset( $single_answer[2] ) && $single_answer[2] == 1 ){
524
- $question_with_answer_text .= '<span class="qsm-text-correct-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
525
- }else if( htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] && $single_answer[2] !== 1 ){
526
- $question_with_answer_text .= '<span class="qsm-text-wrong-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
527
- }else{
528
- $question_with_answer_text .= '<span class="qsm-text-simple-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
529
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  }
 
 
531
  }
532
  }
533
  }
@@ -551,7 +621,7 @@ function mlw_qmn_variable_question_answers( $content, $mlw_quiz_array ) {
551
  $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($answer_4, ENT_QUOTES), $mlw_question_answer_display);
552
  $mlw_question_answer_display = wp_kses_post( $mlw_question_answer_display );
553
  if( $total_question_cnt == $qsm_question_cnt){
554
- $extra_border_bottom_class = '';
555
  }
556
  $display .= "<div class='qmn_question_answer $extra_border_bottom_class $question_answer_class'>".apply_filters('qmn_variable_question_answers', $mlw_question_answer_display, $mlw_quiz_array).'</div>';
557
  $qsm_question_cnt++;
489
  $mlw_question_answer_display = str_replace( "%QUESTION%" , '<b>' . htmlspecialchars_decode($answer[0], ENT_QUOTES) . '</b>', $mlw_question_answer_display);
490
  }
491
  $mlw_question_answer_display = qsm_question_title_func($mlw_question_answer_display);
492
+ $extra_border_bottom_class = '';
493
  if( strpos( $mlw_question_answer_display, '%USER_ANSWERS_DEFAULT%') !== false ){
494
  $extra_border_bottom_class = 'qsm-add-border-bottom';
495
  $show_two_option_questions = array(
496
  3,12,5,7,14
497
+ );
498
+ $form_type = isset( $mlw_quiz_array['form_type'] ) ? $mlw_quiz_array['form_type'] : 0;
499
+ $quiz_system = isset( $mlw_quiz_array['quiz_system'] ) ? $mlw_quiz_array['quiz_system'] : 0;
500
  if( isset( $answer['id'] ) && isset( $questions[ $answer['id'] ] ) && !empty( $questions[ $answer['id'] ] ) ){
501
  $total_answers = isset( $questions[ $answer['id'] ][ 'answers' ] ) ? $questions[ $answer['id'] ][ 'answers' ] : array();
502
  $question_with_answer_text = '';
504
  if( isset($answer['question_type']) && in_array( $answer['question_type'], $show_two_option_questions) ){
505
  $do_show_wrong = true;
506
  foreach( $total_answers as $single_answer ){
507
+ if( $form_type == 0 && ( $quiz_system == 0 || $quiz_system == 3 ) ){
508
+ if( isset( $single_answer[2] ) && $single_answer[2] == 1 && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] ){
509
+ $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
510
+ $do_show_wrong = false;
511
+ }
512
+ }else{
513
+ if( isset( $single_answer[2] ) && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] ){
 
 
514
  $question_with_answer_text .= '<span class="qsm-text-correct-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
515
+ $do_show_wrong = false;
516
  }
517
  }
518
+ }
519
+ if( $do_show_wrong ){
520
+ if( $form_type == 0 && ( $quiz_system == 0 || $quiz_system == 3 ) ){
521
+ $user_given_answer = $answer[1] == '' ? __('No answer provided', 'quiz-master-next') : $answer[1];
522
+ $question_with_answer_text .= '<span class="qsm-text-wrong-option">'. htmlspecialchars_decode($user_given_answer, ENT_QUOTES) .'</span>';
523
+ foreach( $total_answers as $single_answer ){
524
+ if( isset( $single_answer[2] ) && $single_answer[2] == 1 ){
525
+ $question_with_answer_text .= '<span class="qsm-text-correct-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
526
+ break;
527
+ }
528
+ }
529
+ } else {
530
+ $user_given_answer = $answer[1] == '' ? __('No answer provided', 'quiz-master-next') : $answer[1];
531
+ $question_with_answer_text .= '<span class="qsm-text-simple-option">'. htmlspecialchars_decode($user_given_answer, ENT_QUOTES) .'</span>';
532
+ }
533
+ }
534
+ } else if( isset($answer['question_type']) && $answer['question_type'] == 11 ){
535
+ $file_extension = substr($answer[1], -4);
536
+ if($file_extension == '.jpg' || $file_extension == 'jepg' || $file_extension == '.png' || $file_extension == '.gif'){
537
+ $question_with_answer_text .= "<span class='$user_answer_class'><img src='$answer[1]'/></span>";
538
+ }else{
539
+ $question_with_answer_text .= "<span class='$user_answer_class'>".trim( htmlspecialchars_decode($answer[1], ENT_QUOTES) ).'</span>';
540
+ }
541
  } else {
542
+ if( $form_type == 0 && ( $quiz_system == 0 || $quiz_system == 3 ) ){
543
+ if( isset($answer['question_type']) && ( $answer['question_type'] == 4 || $answer['question_type'] == 10 ) ){
544
+ $user_selected_answer = htmlspecialchars_decode($answer[1], ENT_QUOTES);
545
+ foreach ( $total_answers as $single_answer ) {
546
+ $current_answer_text = $single_answer[0];
547
+ if( isset( $single_answer[2] ) && $single_answer[2] == 1 && preg_match("/\b$current_answer_text\b/", $user_selected_answer) ){
548
+ $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
549
+ }else if( isset( $single_answer[2] ) && $single_answer[2] == 1 ){
550
+ $question_with_answer_text .= '<span class="qsm-text-correct-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
551
+ }else if( preg_match("/\b$current_answer_text\b/", $user_selected_answer) && $single_answer[2] !== 1 ){
552
+ $question_with_answer_text .= '<span class="qsm-text-wrong-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
553
+ }else{
554
+ $question_with_answer_text .= '<span class="qsm-text-simple-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
555
+ }
556
+ }
557
+ } else {
558
+ foreach ( $total_answers as $single_answer ) {
559
+ if( isset( $single_answer[2] ) && $single_answer[2] == 1 && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] ){
560
+ $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
561
+ }else if( isset( $single_answer[2] ) && $single_answer[2] == 1 ){
562
+ $question_with_answer_text .= '<span class="qsm-text-correct-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
563
+ }else if( htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] && $single_answer[2] !== 1 ){
564
+ $question_with_answer_text .= '<span class="qsm-text-wrong-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
565
+ }else{
566
+ $question_with_answer_text .= '<span class="qsm-text-simple-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
567
+ }
568
+ }
569
+ }
570
+ } else {
571
+ if( isset($answer['question_type']) && ( $answer['question_type'] == 4 || $answer['question_type'] == 10 ) ){
572
+ $user_selected_answer = htmlspecialchars_decode($answer[1], ENT_QUOTES);
573
+ foreach ( $total_answers as $single_answer ) {
574
+ if( strpos( $user_selected_answer, $single_answer[0]) !== false ){
575
+ $question_with_answer_text .= '<span class="qsm-text-correct-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
576
+ }else{
577
+ $question_with_answer_text .= '<span class="qsm-text-simple-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
578
+ }
579
+ }
580
+ } else {
581
+ foreach ( $total_answers as $single_answer ) {
582
+ if( htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] ){
583
+ $question_with_answer_text .= '<span class="qsm-text-correct-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
584
+ }else{
585
+ $question_with_answer_text .= '<span class="qsm-text-simple-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
586
+ }
587
+ }
588
+ }
589
+ }
590
+ }
591
+ } else {
592
+ if( isset($answer['question_type']) && $answer['question_type'] == 11 ){
593
+ $file_extension = substr($answer[1], -4);
594
+ if($file_extension == '.jpg' || $file_extension == 'jepg' || $file_extension == '.png' || $file_extension == '.gif'){
595
+ $question_with_answer_text .= "<span class='$user_answer_class'><img src='$answer[1]'/></span>";
596
+ }else{
597
+ $question_with_answer_text .= "<span class='$user_answer_class'>".trim( htmlspecialchars_decode($answer[1], ENT_QUOTES) ).'</span>';
598
  }
599
+ } else {
600
+ $question_with_answer_text .= '<span class="qsm-user-answer-text">' . htmlspecialchars_decode($answer[1], ENT_QUOTES) . '</span>';
601
  }
602
  }
603
  }
621
  $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($answer_4, ENT_QUOTES), $mlw_question_answer_display);
622
  $mlw_question_answer_display = wp_kses_post( $mlw_question_answer_display );
623
  if( $total_question_cnt == $qsm_question_cnt){
624
+ $extra_border_bottom_class = 'qsm-remove-border-bottom';
625
  }
626
  $display .= "<div class='qmn_question_answer $extra_border_bottom_class $question_answer_class'>".apply_filters('qmn_variable_question_answers', $mlw_question_answer_display, $mlw_quiz_array).'</div>';
627
  $qsm_question_cnt++;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: quiz, survey, lead, test, score, exam, questionnaire, question,wordpress q
4
  Requires at least: 4.9
5
  Tested up to: 5.5.1
6
  Requires PHP: 5.4
7
- Stable tag: 7.1.1
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -135,6 +135,13 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
135
 
136
  == Changelog ==
137
 
 
 
 
 
 
 
 
138
  = 7.1.1 (September 02, 2020) =
139
  * Bug: Fixed problem with questions on front end while using random questions option.
140
  * Bug: Fixed submit button overlapping issue with progress bar for auto pagination.
4
  Requires at least: 4.9
5
  Tested up to: 5.5.1
6
  Requires PHP: 5.4
7
+ Stable tag: 7.1.2
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
135
 
136
  == Changelog ==
137
 
138
+ = 7.1.2 (September 04, 2020) =
139
+ * Bug: Fixed admin results page to make it compatible with new variable %QUESTIONS_ANSWERS_DEFAULT%.
140
+ * Bug: Fixed issues with %QUESTIONS_ANSWERS_DEFAULT% variable in quiz result while using point based quiz.
141
+ * Bug: Fixed validation issue on front end while using Deselect Answer option.
142
+ * Bug: Fixed issues with inline results when there is extra spacing between words.
143
+ * Enhancement: Added feature to show the uploaded file into media library for File Upload question type.
144
+
145
  = 7.1.1 (September 02, 2020) =
146
  * Bug: Fixed problem with questions on front end while using random questions option.
147
  * Bug: Fixed submit button overlapping issue with progress bar for auto pagination.