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

Version Description

(October 26, 2020) = * Bug: Fixed logic addon rules not being copied while duplicating quiz. * Bug: Fixed vietnamese accents and special characters not being recognized in quiz result page. * Bug: Fixed apostrophe and double quotes not working with Dropdown question type. * Bug: Fixed apostrophe being marked as incorrect for %USER_ANSWERS_DEFAULT% template variable. * Bug: Fixed question's answers being case sensitive while using %USER_ANSWERS_DEFAULT% template variable. * Bug: Fixed HTML codes appearing in email while using rich answer type. * Bug: Fixed Polar question type scoring being rounded off to integers incorrectly. * Bug: Fixed timer not appearing while using retaking a quiz on result page.

Download this release

Release Info

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

Code changes from version 7.1.4 to 7.1.5

css/common.css CHANGED
@@ -231,9 +231,6 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
231
  z-index: 1;
232
  margin-bottom: 15px;
233
  }
234
- .qmn_quiz_container.qsm_auto_pagination_enabled .quiz_section:not(.quiz_begin) {
235
- display: none;
236
- }
237
  .quiz_section input[type="text"].qmn_fill_blank{
238
  display: inline-block;
239
  }
231
  z-index: 1;
232
  margin-bottom: 15px;
233
  }
 
 
 
234
  .quiz_section input[type="text"].qmn_fill_blank{
235
  display: inline-block;
236
  }
js/qsm-quiz.js CHANGED
@@ -310,7 +310,7 @@ var QSMPageTimer;
310
  jQuery(document).trigger('qsm_init_progressbar_after', [quizID, qmn_quiz_data]);
311
  }
312
  QSM.goToPage( quizID, 1 );
313
- $quizForm.find( '.qsm-pagination .qsm-next' ).on( 'click', function( event ) {
314
  jQuery(document).trigger('qsm_next_button_click_before', [quizID]);
315
  event.preventDefault();
316
  QSM.nextPage( quizID );
@@ -901,82 +901,61 @@ function qmnNextSlide( pagination, go_to_top, quiz_form_id ) {
901
  jQuery(document).trigger('qsm_next_button_click_before', [quiz_form_id]);
902
  var quiz_id = +jQuery( quiz_form_id ).find( '.qmn_quiz_id' ).val();
903
  var $container = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' );
904
- var slide_number = +$container.find( '.slide_number_hidden' ).val();
905
- var previous = +$container.find( '.previous_amount_hidden' ).val();
906
  var section_totals = +$container.find( '.total_sections_hidden' ).val();
907
  if(pagination == 1){
908
  section_totals = section_totals - 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
909
  }
910
- jQuery( quiz_form_id + " .quiz_section" ).hide();
911
- for ( var i = 0; i < pagination; i++ ) {
912
- if (i === 0 && previous === 1 && slide_number > 1) {
913
- slide_number = slide_number + pagination;
914
- } else {
915
- slide_number++;
916
- }
917
- if (slide_number < 1) {
918
- slide_number = 1;
919
- }
920
- $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
921
- if (qmn_quiz_data[ quiz_id ].first_page) {
922
- if (slide_number > 1) {
923
- $container.find(".mlw_qmn_quiz_link.mlw_previous").show();
924
- }
925
- } else {
926
- if (slide_number > pagination) {
927
- $container.find(".mlw_qmn_quiz_link.mlw_previous").show();
928
- }
929
- }
930
- if (slide_number == section_totals) {
931
- $container.find(".mlw_qmn_quiz_link.mlw_next").hide();
932
- $container.find(".g-recaptcha").show();
933
- if(pagination == 1){
934
- jQuery(quiz_form_id + " .quiz_section.quiz_end").show();
935
- }
936
- }
937
- if (slide_number < section_totals) {
938
- $container.find(".mlw_qmn_quiz_link.mlw_next").show();
939
- $container.find(".g-recaptcha").hide();
940
- }
941
- jQuery(quiz_form_id + " .quiz_section.slide" + slide_number).show();
942
- if( jQuery(quiz_form_id + " .quiz_section.quiz_end").is(':visible') ){
943
- var button_width = jQuery( quiz_form_id + ' .qsm-submit-btn' ).width();
944
- var progress_width = jQuery( quiz_form_id ).parent().find('.qmn_pagination').width();
945
- jQuery( quiz_form_id ).parent().find('.qmn_pagination').css('width', progress_width - button_width - 40 );
946
- }else{
947
- jQuery( quiz_form_id ).parent().find('.qmn_pagination').css('width', '100%' );
948
- }
949
- if (1 == jQuery(quiz_form_id + " .quiz_section.slide" + slide_number).data('prevbtn')) {
950
- $container.find(".mlw_qmn_quiz_link.mlw_previous").hide();
951
- }
952
- }
953
-
954
- jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find( '.slide_number_hidden' ).val( slide_number );
955
- jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find( '.previous_amount_hidden' ).val( 0 );
956
-
957
- qmnUpdatePageNumber( 1, quiz_form_id );
958
- if (go_to_top == 1 && qmn_quiz_data[ quiz_id ].disable_scroll_next_previous_click != 1 ) {
959
- qsmScrollTo( $container );
960
- }
961
- var page_number = slide_number - pagination;
962
- var hiddem_page_number = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val();
963
- if(hiddem_page_number > 0){
964
- page_number = parseInt(hiddem_page_number) + 1;
965
- }
966
- var total_questions = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('[class*="question-section-id-"]').length;
967
- var total_page_number = Math.ceil(total_questions / pagination);
968
- jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val( page_number );
969
  if(page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
970
- if( page_number <= total_page_number ){
971
- jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').text('').text( page_number + ' out of ' + total_page_number);
 
972
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').show();
973
  }else{
974
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
975
  }
976
  }else{
977
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
978
- }
979
- qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number);
980
  jQuery(document).trigger('qsm_next_button_click_after', [quiz_form_id]);
981
  }
982
 
@@ -987,59 +966,31 @@ function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
987
  var slide_number = +$container.find( '.slide_number_hidden' ).val();
988
  var previous = +$container.find( '.previous_amount_hidden' ).val();
989
  var section_totals = +$container.find( '.total_sections_hidden' ).val();
990
-
991
- jQuery( quiz_form_id + " .quiz_section" ).hide();
 
992
  jQuery( quiz_form_id + " .g-recaptcha" ).hide();
993
-
994
- for (var i = 0; i < pagination; i++) {
995
- if (i === 0 && previous === 0) {
996
- slide_number = slide_number - pagination;
997
- } else {
998
- slide_number--;
999
- }
1000
- if (slide_number < 1) {
1001
- slide_number = 1;
1002
- }
1003
-
1004
- $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
1005
-
1006
- if ( qmn_quiz_data[ quiz_id ].first_page ) {
1007
- if (slide_number > 1) {
1008
- $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
1009
- }
1010
- } else {
1011
- if (slide_number > pagination) {
1012
- $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
1013
- }
1014
- }
1015
- if (slide_number == section_totals) {
1016
- $container.find( ".mlw_qmn_quiz_link.mlw_next" ).hide();
1017
- }
1018
- if (slide_number < section_totals) {
1019
- $container.find( ".mlw_qmn_quiz_link.mlw_next" ).show();
1020
- }
1021
- jQuery( quiz_form_id + " .quiz_section.slide" + slide_number ).show();
1022
- if (1 == jQuery(quiz_form_id + " .quiz_section.slide" + slide_number).data('prevbtn')) {
1023
- $container.find(".mlw_qmn_quiz_link.mlw_previous").hide();
1024
- }
1025
- }
1026
-
1027
- qmnUpdatePageNumber( -1, quiz_form_id );
1028
-
1029
- jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find( '.slide_number_hidden' ).val( slide_number );
1030
- jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find( '.previous_amount_hidden' ).val( 0 );
1031
-
1032
  if (go_to_top == 1 && qmn_quiz_data[ quiz_id ].disable_scroll_next_previous_click != 1 ) {
1033
  qsmScrollTo( $container );
1034
  }
1035
- var hiddem_page_number = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val();
1036
- var page_number = parseInt(hiddem_page_number) - 1;
1037
- var total_questions = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('[class*="question-section-id-"]').length;
1038
- var total_page_number = Math.ceil(total_questions / pagination);
1039
- if(hiddem_page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
1040
- if( page_number <= total_page_number ){
1041
- jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').text('').text( page_number + ' out of ' + total_page_number);
1042
- if(page_number == 0){
1043
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
1044
  }else{
1045
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').show();
@@ -1048,10 +999,9 @@ function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
1048
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
1049
  }
1050
  }
1051
- jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val( page_number );
1052
  jQuery( quiz_form_id ).parent().find('.qmn_pagination').css('width', '100%' );
1053
- qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number);
1054
- jQuery(document).trigger('qsm_previous_button_click_after', [quiz_form_id]);
1055
  }
1056
 
1057
  /**
@@ -1061,15 +1011,13 @@ function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
1061
  * @param {int} total_page_number
1062
  * @returns Change progress bar on next and previous button click
1063
  */
1064
- function qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number){
1065
  if ( '1' == qmn_quiz_data[ quiz_id ].progress_bar ) {
1066
- var total_questions = jQuery( '#quizForm' + quiz_id ).closest( '.qmn_quiz_container' ).find('.quiz_section').length - 1;
1067
- var pagination = qmn_quiz_data[quiz_id].pagination.amount;
1068
- total_page_number = Math.ceil(total_questions / pagination);
1069
- if(pagination === 1){
1070
- total_page_number = total_page_number - 1;
1071
- }
1072
- var animate_value = page_number / total_page_number;
1073
  if( animate_value <= 1){
1074
  qmn_quiz_data[ quiz_id ].bar.animate( animate_value );
1075
  var old_text = jQuery( '#qsm_progress_bar_' + quiz_id ).find( '.progressbar-text' ).text().replace(' %', '');
@@ -1097,18 +1045,12 @@ function qmnUpdatePageNumber( amount, quiz_form_id ) {
1097
  }
1098
 
1099
  function qmnInitPagination( quiz_id ) {
1100
- var qmn_section_total = +qmn_quiz_data[quiz_id].pagination.total_questions + 1;
1101
- if ( qmn_quiz_data[quiz_id].pagination.section_comments === '0' ) {
1102
- qmn_section_total += 1;
1103
- }
1104
  var qmn_total_pages = Math.ceil( qmn_section_total / +qmn_quiz_data[quiz_id].pagination.amount );
1105
- if ( qmn_quiz_data[quiz_id].first_page ) {
1106
- qmn_total_pages += 1;
1107
- qmn_section_total += 1;
1108
- }
1109
-
1110
- jQuery( '#quizForm' + quiz_id + ' .quiz_section' ).hide();
1111
- jQuery( '#quizForm' + quiz_id + ' .quiz_section' ).append( "<br />" );
1112
  jQuery( '#quizForm' + quiz_id ).closest( '.qmn_quiz_container' ).append( '<div class="qmn_pagination border margin-bottom"></div>' );
1113
  jQuery( '#quizForm' + quiz_id ).closest( '.qmn_quiz_container' ).find( '.qmn_pagination' ).append( '<input type="hidden" value="0" name="slide_number" class="slide_number_hidden" />')
1114
  .append( '<input type="hidden" value="0" name="current_page" class="current_page_hidden" />')
@@ -1154,9 +1096,10 @@ function qmnInitPagination( quiz_id ) {
1154
  jQuery(document).trigger('qsm_init_progressbar_after', [quiz_id, qmn_quiz_data]);
1155
  }
1156
 
1157
- jQuery(".mlw_next").click(function(event) {
1158
- event.preventDefault();
1159
  var quiz_id = +jQuery( this ).closest( '.qmn_quiz_container' ).find( '.qmn_quiz_id' ).val();
 
1160
  if ( qmnValidatePage( 'quizForm' + quiz_id ) ) {
1161
  qmnNextSlide( qmn_quiz_data[quiz_id].pagination.amount, 1, '#quizForm' + quiz_id );
1162
  }
@@ -1225,20 +1168,18 @@ jQuery(function() {
1225
  },
1226
  success: function (response) {
1227
  parent_div.replaceWith(response);
1228
-
1229
- if( qmn_quiz_data[ quiz_id ].timer_limit_val > 0 ){
1230
- // Restart the timer for retake quiz.
1231
- setInterval( qmnTimeTakenTimer, 1000 );
1232
-
1233
- // Reset the timer clock on retake quiz.
1234
- QSM.initTimer( quiz_id );
1235
- }
1236
-
1237
- QSM.initPagination( quiz_id );
1238
  },
1239
  error: function (errorThrown) {
1240
- console.log( 'error' );
1241
- alert( );
1242
  }
1243
  });
1244
  });
310
  jQuery(document).trigger('qsm_init_progressbar_after', [quizID, qmn_quiz_data]);
311
  }
312
  QSM.goToPage( quizID, 1 );
313
+ $quizForm.find( '.qsm-pagination .qsm-next' ).on( 'click', function( event ) {
314
  jQuery(document).trigger('qsm_next_button_click_before', [quizID]);
315
  event.preventDefault();
316
  QSM.nextPage( quizID );
901
  jQuery(document).trigger('qsm_next_button_click_before', [quiz_form_id]);
902
  var quiz_id = +jQuery( quiz_form_id ).find( '.qmn_quiz_id' ).val();
903
  var $container = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' );
904
+ var slide_number = +$container.find( '.slide_number_hidden' ).val();
905
+ var page_number = +$container.find( '.current_page_hidden' ).val();
906
  var section_totals = +$container.find( '.total_sections_hidden' ).val();
907
  if(pagination == 1){
908
  section_totals = section_totals - 1;
909
+ }
910
+ var total_pages = $container.find( '.total_pages_hidden' ).val();
911
+
912
+ jQuery( quiz_form_id + " .qsm-auto-page-row" ).hide();
913
+ if( page_number >= total_pages ){
914
+ alert('Next page not found.');
915
+ $container.find( ".mlw_next" ).hide();
916
+ jQuery( quiz_form_id + " .qsm-auto-page-row.quiz_end" ).show();
917
+ return true;
918
+ }
919
+ if( slide_number == 0 && page_number == 0 ){
920
+ jQuery( quiz_form_id + " .qsm-auto-page-row.quiz_begin" ).show();
921
+ $container.find( ".mlw_previous" ).hide();
922
+ $container.find( '.current_page_hidden' ).val( '1' );
923
+ } else if( total_pages == parseInt( page_number ) + 1 ){ //Last page
924
+ $container.find( ".mlw_next" ).hide();
925
+ jQuery( quiz_form_id + " .qsm-auto-page-row.quiz_end" ).show();
926
+ $container.find( '.slide_number_hidden' ).val( parseInt( slide_number ) + 1 );
927
+ $container.find( '.current_page_hidden' ).val( parseInt( page_number ) + 1 );
928
+ $container.find( ".mlw_previous" ).show();
929
+ $container.find( '.g-recaptcha' ).show();
930
+ }else if( slide_number >=0 && page_number >= 1 ){
931
+ $container.find( '.qsm-auto-page-row.qsm-apc-' + page_number ).show();
932
+ $container.find( '.slide_number_hidden' ).val( parseInt( slide_number ) + 1 );
933
+ $container.find( '.current_page_hidden' ).val( parseInt( page_number ) + 1 );
934
+ $container.find( ".mlw_previous" ).show();
935
+ }
936
+ if( jQuery(quiz_form_id + " .quiz_section.quiz_end").is(':visible') ){
937
+ var button_width = jQuery( quiz_form_id + ' .qsm-submit-btn' ).width();
938
+ var progress_width = jQuery( quiz_form_id ).parent().find('.qmn_pagination').width();
939
+ jQuery( quiz_form_id ).parent().find('.qmn_pagination').css('width', progress_width - button_width - 40 );
940
+ }else{
941
+ jQuery( quiz_form_id ).parent().find('.qmn_pagination').css('width', '100%' );
942
+ }
943
+ if (go_to_top == 1 && qmn_quiz_data[ quiz_id ].disable_scroll_next_previous_click != 1 ) {
944
+ qsmScrollTo( $container );
945
  }
946
+ //Show the page counts
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
947
  if(page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
948
+ var actual_pages = total_pages - 2;
949
+ if( page_number <= actual_pages ){
950
+ jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').text('').text( page_number + qmn_ajax_object.out_of_text + actual_pages);
951
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').show();
952
  }else{
953
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
954
  }
955
  }else{
956
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
957
+ }
958
+ qmnInitProgressbarOnClick(quiz_id, page_number, total_pages);
959
  jQuery(document).trigger('qsm_next_button_click_after', [quiz_form_id]);
960
  }
961
 
966
  var slide_number = +$container.find( '.slide_number_hidden' ).val();
967
  var previous = +$container.find( '.previous_amount_hidden' ).val();
968
  var section_totals = +$container.find( '.total_sections_hidden' ).val();
969
+ var page_number = +$container.find( '.current_page_hidden' ).val();
970
+ var total_pages = $container.find( '.total_pages_hidden' ).val();
971
+ jQuery( quiz_form_id + " .qsm-auto-page-row" ).hide();
972
  jQuery( quiz_form_id + " .g-recaptcha" ).hide();
973
+ var slide_original_val = parseInt( slide_number ) - 1;
974
+ if( slide_original_val == 0 ){
975
+ $container.find( ".mlw_next" ).show();
976
+ jQuery( quiz_form_id + " .qsm-auto-page-row.quiz_begin" ).show();
977
+ $container.find( '.slide_number_hidden' ).val( slide_original_val );
978
+ $container.find( '.current_page_hidden' ).val( parseInt( page_number ) - 1 );
979
+ $container.find( ".mlw_previous" ).hide();
980
+ } else {
981
+ $container.find( '.qsm-auto-page-row.qsm-apc-' + slide_original_val ).show();
982
+ $container.find( '.slide_number_hidden' ).val( slide_original_val );
983
+ $container.find( '.current_page_hidden' ).val( parseInt( page_number ) - 1 );
984
+ $container.find( ".mlw_next" ).show();
985
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
986
  if (go_to_top == 1 && qmn_quiz_data[ quiz_id ].disable_scroll_next_previous_click != 1 ) {
987
  qsmScrollTo( $container );
988
  }
989
+ if(page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
990
+ var actual_pages = total_pages - 2;
991
+ if( slide_original_val <= actual_pages ){
992
+ jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').text('').text( slide_original_val + qmn_ajax_object.out_of_text + actual_pages);
993
+ if(slide_original_val == 0){
 
 
 
994
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
995
  }else{
996
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').show();
999
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
1000
  }
1001
  }
 
1002
  jQuery( quiz_form_id ).parent().find('.qmn_pagination').css('width', '100%' );
1003
+ qmnInitProgressbarOnClick(quiz_id, slide_original_val, total_pages);
1004
+ jQuery(document).trigger('qsm_auto_previous_button_click_after', [quiz_form_id]);
1005
  }
1006
 
1007
  /**
1011
  * @param {int} total_page_number
1012
  * @returns Change progress bar on next and previous button click
1013
  */
1014
+ function qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number){
1015
  if ( '1' == qmn_quiz_data[ quiz_id ].progress_bar ) {
1016
+ var qmn_total_questions = qmn_quiz_data[quiz_id].pagination.total_questions;
1017
+ var pagination = qmn_quiz_data[quiz_id].pagination.amount;
1018
+ total_page_number = Math.ceil(qmn_total_questions / pagination);
1019
+ total_page_number = total_page_number + 1; //Increase for quiz end section
1020
+ var animate_value = page_number / total_page_number;
 
 
1021
  if( animate_value <= 1){
1022
  qmn_quiz_data[ quiz_id ].bar.animate( animate_value );
1023
  var old_text = jQuery( '#qsm_progress_bar_' + quiz_id ).find( '.progressbar-text' ).text().replace(' %', '');
1045
  }
1046
 
1047
  function qmnInitPagination( quiz_id ) {
1048
+ var qmn_section_total = +qmn_quiz_data[quiz_id].pagination.total_questions;
 
 
 
1049
  var qmn_total_pages = Math.ceil( qmn_section_total / +qmn_quiz_data[quiz_id].pagination.amount );
1050
+
1051
+ qmn_total_pages = qmn_total_pages + 1; //quiz begin
1052
+ qmn_total_pages = qmn_total_pages + 1; //quiz end
1053
+
 
 
 
1054
  jQuery( '#quizForm' + quiz_id ).closest( '.qmn_quiz_container' ).append( '<div class="qmn_pagination border margin-bottom"></div>' );
1055
  jQuery( '#quizForm' + quiz_id ).closest( '.qmn_quiz_container' ).find( '.qmn_pagination' ).append( '<input type="hidden" value="0" name="slide_number" class="slide_number_hidden" />')
1056
  .append( '<input type="hidden" value="0" name="current_page" class="current_page_hidden" />')
1096
  jQuery(document).trigger('qsm_init_progressbar_after', [quiz_id, qmn_quiz_data]);
1097
  }
1098
 
1099
+ jQuery(".mlw_next").click(function(event) {
1100
+ event.preventDefault();
1101
  var quiz_id = +jQuery( this ).closest( '.qmn_quiz_container' ).find( '.qmn_quiz_id' ).val();
1102
+ jQuery(document).trigger('qsm_auto_next_button_click_before', [quiz_id]);
1103
  if ( qmnValidatePage( 'quizForm' + quiz_id ) ) {
1104
  qmnNextSlide( qmn_quiz_data[quiz_id].pagination.amount, 1, '#quizForm' + quiz_id );
1105
  }
1168
  },
1169
  success: function (response) {
1170
  parent_div.replaceWith(response);
1171
+ //Reload the timer and pagination
1172
+ QSM.init();
1173
+ qmnInit();
1174
+ QSM.initTimer( quiz_id );
1175
+ jQuery("input[name='timer_ms']").each(function(){
1176
+ var timems = qsmTimeInMS();
1177
+ jQuery(this).val(timems);
1178
+ });
1179
+ setInterval( qmnTimeTakenTimer, 1000 );
 
1180
  },
1181
  error: function (errorThrown) {
1182
+ console.log( 'error' );
 
1183
  }
1184
  });
1185
  });
lang/quiz-master-next.pot CHANGED
@@ -9,7 +9,7 @@ msgid ""
9
  msgstr ""
10
  "Project-Id-Version: PACKAGE VERSION\n"
11
  "Report-Msgid-Bugs-To: \n"
12
- "POT-Creation-Date: 2020-10-05 17:35+0530\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -19,106 +19,106 @@ msgstr ""
19
  "Content-Transfer-Encoding: 8bit\n"
20
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
21
 
22
- #: mlw_quizmaster2.php:206 php/admin/settings-page.php:170
23
  msgid "Quizzes & Surveys"
24
  msgstr ""
25
 
26
- #: mlw_quizmaster2.php:231 mlw_quizmaster2.php:232 mlw_quizmaster2.php:233
27
  #: php/classes/class-qsm-install.php:51
28
  msgid "Quiz"
29
  msgstr ""
30
 
31
- #: mlw_quizmaster2.php:234 php/admin/quizzes-page.php:226
32
  msgid "Add New"
33
  msgstr ""
34
 
35
- #: mlw_quizmaster2.php:235
36
  msgid "Add New Quiz"
37
  msgstr ""
38
 
39
- #: mlw_quizmaster2.php:236
40
  msgid "New Quiz"
41
  msgstr ""
42
 
43
- #: mlw_quizmaster2.php:237
44
  msgid "Edit Quiz"
45
  msgstr ""
46
 
47
- #: mlw_quizmaster2.php:238
48
  msgid "View Quiz"
49
  msgstr ""
50
 
51
- #: mlw_quizmaster2.php:239
52
  msgid "All Quizzes"
53
  msgstr ""
54
 
55
- #: mlw_quizmaster2.php:240
56
  msgid "Search Quizzes"
57
  msgstr ""
58
 
59
- #: mlw_quizmaster2.php:241
60
  msgid "Parent Quiz:"
61
  msgstr ""
62
 
63
- #: mlw_quizmaster2.php:242
64
  msgid "No Quiz Found"
65
  msgstr ""
66
 
67
- #: mlw_quizmaster2.php:243
68
  msgid "No Quiz Found In Trash"
69
  msgstr ""
70
 
71
- #: mlw_quizmaster2.php:276
72
  msgid "QSM"
73
  msgstr ""
74
 
75
- #: mlw_quizmaster2.php:277
76
  msgid "Dashboard"
77
  msgstr ""
78
 
79
- #: mlw_quizmaster2.php:278 php/admin/quizzes-page.php:225
80
- #: php/classes/class-qsm-install.php:1747
81
  msgid "Quizzes/Surveys"
82
  msgstr ""
83
 
84
- #: mlw_quizmaster2.php:280 mlw_quizmaster2.php:283
85
  #: php/admin/addons-page.php:98
86
  msgid "Settings"
87
  msgstr ""
88
 
89
- #: mlw_quizmaster2.php:281 php/admin/quizzes-page.php:616
90
  msgid "Results"
91
  msgstr ""
92
 
93
- #: mlw_quizmaster2.php:282
94
  msgid "Result Details"
95
  msgstr ""
96
 
97
- #: mlw_quizmaster2.php:284 php/admin/tools-page.php:37
98
  msgid "Tools"
99
  msgstr ""
100
 
101
- #: mlw_quizmaster2.php:285
102
  msgid "Stats"
103
  msgstr ""
104
 
105
- #: mlw_quizmaster2.php:286
106
  msgid "Addon Settings"
107
  msgstr ""
108
 
109
- #: mlw_quizmaster2.php:287
110
  msgid "Get a Free Addon"
111
  msgstr ""
112
 
113
- #: mlw_quizmaster2.php:287
114
  msgid "Get a Free Addon!"
115
  msgstr ""
116
 
117
- #: mlw_quizmaster2.php:288
118
  msgid "QSM About"
119
  msgstr ""
120
 
121
- #: mlw_quizmaster2.php:289
122
  msgid "Help"
123
  msgstr ""
124
 
@@ -253,65 +253,65 @@ msgstr ""
253
  msgid "File Upload"
254
  msgstr ""
255
 
256
- #: php/question-types.php:206
257
  msgid "Date"
258
  msgstr ""
259
 
260
- #: php/question-types.php:278
261
  msgid "Horizontal Multiple Choice"
262
  msgstr ""
263
 
264
- #: php/question-types.php:387
265
  msgid "Drop Down"
266
  msgstr ""
267
 
268
- #: php/question-types.php:413
269
  msgid "Please select your answer"
270
  msgstr ""
271
 
272
- #: php/question-types.php:485
273
  msgid "Short Answer"
274
  msgstr ""
275
 
276
- #: php/question-types.php:563
277
  msgid "Multiple Response"
278
  msgstr ""
279
 
280
- #: php/question-types.php:668
281
  msgid "Paragraph"
282
  msgstr ""
283
 
284
- #: php/question-types.php:750
285
  msgid "Text/HTML Section"
286
  msgstr ""
287
 
288
- #: php/question-types.php:784
289
  msgid "Number"
290
  msgstr ""
291
 
292
- #: php/question-types.php:867
293
  msgid "Opt-in"
294
  msgstr ""
295
 
296
- #: php/question-types.php:912
297
  msgid "Captcha"
298
  msgstr ""
299
 
300
- #: php/question-types.php:971
301
  msgid "Horizontal Multiple Response"
302
  msgstr ""
303
 
304
- #: php/question-types.php:1088
305
  msgid ""
306
  "For fill in the blank types, use %BLANK% to represent where to put the text "
307
  "box in your text."
308
  msgstr ""
309
 
310
- #: php/question-types.php:1093
311
  msgid "Fill In The Blank"
312
  msgstr ""
313
 
314
- #: php/question-types.php:1184
315
  msgid "Polar"
316
  msgstr ""
317
 
@@ -330,7 +330,7 @@ msgstr ""
330
  msgid "No quiz found"
331
  msgstr ""
332
 
333
- #: php/template-variables.php:878 php/template-variables.php:887
334
  msgid "No answer provided"
335
  msgstr ""
336
 
@@ -790,7 +790,7 @@ msgstr ""
790
  #: php/admin/options-page-option-tab.php:28
791
  #: php/admin/options-page-questions-tab.php:278
792
  #: php/admin/options-page-text-tab.php:30
793
- #: php/classes/class-qsm-install.php:1760
794
  msgid "View Documentation"
795
  msgstr ""
796
 
@@ -1441,12 +1441,11 @@ msgstr ""
1441
  #: php/classes/class-qsm-install.php:393 php/classes/class-qsm-install.php:413
1442
  #: php/classes/class-qsm-install.php:434 php/classes/class-qsm-install.php:455
1443
  #: php/classes/class-qsm-install.php:474 php/classes/class-qsm-install.php:493
1444
- #: php/classes/class-qsm-install.php:513 php/classes/class-qsm-install.php:533
1445
- #: php/classes/class-qsm-install.php:553 php/classes/class-qsm-install.php:572
1446
- #: php/classes/class-qsm-install.php:592 php/classes/class-qsm-install.php:611
1447
- #: php/classes/class-qsm-install.php:707 php/classes/class-qsm-install.php:731
1448
- #: php/classes/class-qsm-install.php:755 php/classes/class-qsm-install.php:778
1449
- #: php/classes/class-qsm-install.php:801
1450
  msgid "Yes"
1451
  msgstr ""
1452
 
@@ -1491,12 +1490,12 @@ msgstr ""
1491
  #: php/classes/class-qsm-install.php:397 php/classes/class-qsm-install.php:417
1492
  #: php/classes/class-qsm-install.php:438 php/classes/class-qsm-install.php:459
1493
  #: php/classes/class-qsm-install.php:478 php/classes/class-qsm-install.php:497
1494
- #: php/classes/class-qsm-install.php:517 php/classes/class-qsm-install.php:537
1495
- #: php/classes/class-qsm-install.php:557 php/classes/class-qsm-install.php:576
1496
- #: php/classes/class-qsm-install.php:596 php/classes/class-qsm-install.php:615
1497
- #: php/classes/class-qsm-install.php:711 php/classes/class-qsm-install.php:727
1498
- #: php/classes/class-qsm-install.php:751 php/classes/class-qsm-install.php:774
1499
- #: php/classes/class-qsm-install.php:797
1500
  msgid "No"
1501
  msgstr ""
1502
 
@@ -2069,8 +2068,8 @@ msgstr ""
2069
 
2070
  #: php/classes/class-qmn-quiz-creator.php:205
2071
  #: php/classes/class-qmn-quiz-creator.php:268
2072
- #: php/classes/class-qmn-quiz-creator.php:478
2073
- #: php/classes/class-qmn-quiz-creator.php:551
2074
  #, php-format
2075
  msgid ""
2076
  "There has been an error in this action. Please share this with the "
@@ -2091,7 +2090,7 @@ msgid ""
2091
  "Please try again."
2092
  msgstr ""
2093
 
2094
- #: php/classes/class-qmn-quiz-creator.php:472
2095
  msgid "Your quiz or survey has been duplicated successfully."
2096
  msgstr ""
2097
 
@@ -2119,33 +2118,39 @@ msgstr ""
2119
  msgid "File not removed"
2120
  msgstr ""
2121
 
2122
- #: php/classes/class-qmn-quiz-manager.php:202
2123
  msgid "Correct Info: "
2124
  msgstr ""
2125
 
2126
- #: php/classes/class-qmn-quiz-manager.php:249
2127
- #: php/classes/class-qmn-quiz-manager.php:262
2128
  msgid "It appears that this quiz is not set up correctly"
2129
  msgstr ""
2130
 
2131
- #: php/classes/class-qmn-quiz-manager.php:554
2132
  msgid "Limit of choice is reached."
2133
  msgstr ""
2134
 
2135
- #: php/classes/class-qmn-quiz-manager.php:1242
2136
- #: php/classes/class-qsm-install.php:529
 
 
 
 
 
 
2137
  msgid "Retake Quiz"
2138
  msgstr ""
2139
 
2140
- #: php/classes/class-qmn-quiz-manager.php:1409
2141
  msgid "Click here to view"
2142
  msgstr ""
2143
 
2144
- #: php/classes/class-qmn-quiz-manager.php:1870
2145
  msgid "Not collected"
2146
  msgstr ""
2147
 
2148
- #: php/classes/class-qmn-quiz-manager.php:1880
2149
  msgid "Unknown"
2150
  msgstr ""
2151
 
@@ -2436,275 +2441,283 @@ msgstr ""
2436
  msgid "Show correct answer inline"
2437
  msgstr ""
2438
 
2439
- #: php/classes/class-qsm-install.php:522
 
 
 
 
 
 
 
 
2440
  msgid "Show correct user info when inline result is enabled."
2441
  msgstr ""
2442
 
2443
- #: php/classes/class-qsm-install.php:542
2444
  msgid "Show a button on result page to retake the quiz"
2445
  msgstr ""
2446
 
2447
- #: php/classes/class-qsm-install.php:549
2448
  msgid "Show current page number"
2449
  msgstr ""
2450
 
2451
- #: php/classes/class-qsm-install.php:568
2452
  msgid "Deselect Answer"
2453
  msgstr ""
2454
 
2455
- #: php/classes/class-qsm-install.php:581
2456
  msgid ""
2457
  "Users are able deselect an answer and leave it blank. Works with Multiple "
2458
  "Choice and Horizintal Multiple Choice questions only"
2459
  msgstr ""
2460
 
2461
- #: php/classes/class-qsm-install.php:588
2462
  msgid "Disable description on quiz result page?"
2463
  msgstr ""
2464
 
2465
- #: php/classes/class-qsm-install.php:607
2466
  msgid "Disable scroll on next and previous button click?"
2467
  msgstr ""
2468
 
2469
- #: php/classes/class-qsm-install.php:626
2470
  msgid "Quiz Animation"
2471
  msgstr ""
2472
 
2473
- #: php/classes/class-qsm-install.php:630
2474
  msgid "bounce"
2475
  msgstr ""
2476
 
2477
- #: php/classes/class-qsm-install.php:634
2478
  msgid "flash"
2479
  msgstr ""
2480
 
2481
- #: php/classes/class-qsm-install.php:638
2482
  msgid "pulse"
2483
  msgstr ""
2484
 
2485
- #: php/classes/class-qsm-install.php:642
2486
  msgid "rubberBand"
2487
  msgstr ""
2488
 
2489
- #: php/classes/class-qsm-install.php:646
2490
  msgid "shake"
2491
  msgstr ""
2492
 
2493
- #: php/classes/class-qsm-install.php:650
2494
  msgid "swing"
2495
  msgstr ""
2496
 
2497
- #: php/classes/class-qsm-install.php:654
2498
  msgid "tada"
2499
  msgstr ""
2500
 
2501
- #: php/classes/class-qsm-install.php:658
2502
  msgid "wobble"
2503
  msgstr ""
2504
 
2505
- #: php/classes/class-qsm-install.php:662
2506
  msgid "jello"
2507
  msgstr ""
2508
 
2509
- #: php/classes/class-qsm-install.php:666
2510
  msgid "heartBeat"
2511
  msgstr ""
2512
 
2513
- #: php/classes/class-qsm-install.php:670
2514
  msgid "No animation"
2515
  msgstr ""
2516
 
2517
- #: php/classes/class-qsm-install.php:681
2518
  msgid "Logo URL"
2519
  msgstr ""
2520
 
2521
- #: php/classes/class-qsm-install.php:684
2522
  msgid ""
2523
  "Enter the url of an image which will be used as logo while sharing on "
2524
  "facebook."
2525
  msgstr ""
2526
 
2527
- #: php/classes/class-qsm-install.php:685
2528
  msgid "If left blank, this will default to QSM logo"
2529
  msgstr ""
2530
 
2531
- #: php/classes/class-qsm-install.php:692
2532
- #: php/classes/class-qsm-install.php:1106
2533
  msgid "Show Legacy Options"
2534
  msgstr ""
2535
 
2536
- #: php/classes/class-qsm-install.php:695
2537
- #: php/classes/class-qsm-install.php:1109
2538
  msgid ""
2539
  "All the legacy options are deprecated and will be removed in upcoming version"
2540
  msgstr ""
2541
 
2542
- #: php/classes/class-qsm-install.php:703
2543
  msgid "Social Sharing Buttons"
2544
  msgstr ""
2545
 
2546
- #: php/classes/class-qsm-install.php:716
2547
  msgid ""
2548
  "Please use the new template variables instead.%FACEBOOK_SHARE% %TWITTER_SHARE"
2549
  "%"
2550
  msgstr ""
2551
 
2552
- #: php/classes/class-qsm-install.php:723
2553
  msgid "Ask user's name"
2554
  msgstr ""
2555
 
2556
- #: php/classes/class-qsm-install.php:735 php/classes/class-qsm-install.php:759
2557
- #: php/classes/class-qsm-install.php:782 php/classes/class-qsm-install.php:805
2558
  msgid "Require"
2559
  msgstr ""
2560
 
2561
- #: php/classes/class-qsm-install.php:747
2562
  msgid "Ask user's business"
2563
  msgstr ""
2564
 
2565
- #: php/classes/class-qsm-install.php:770
2566
  msgid "Ask user's email"
2567
  msgstr ""
2568
 
2569
- #: php/classes/class-qsm-install.php:793
2570
  msgid "Ask user's phone"
2571
  msgstr ""
2572
 
2573
- #: php/classes/class-qsm-install.php:816
2574
  msgid "Message Displayed Before Quiz"
2575
  msgstr ""
2576
 
2577
- #: php/classes/class-qsm-install.php:829
2578
  msgid "Message Displayed Before Comments Box If Enabled"
2579
  msgstr ""
2580
 
2581
- #: php/classes/class-qsm-install.php:842
2582
  msgid "Message Displayed At End Of Quiz (Leave Blank To Omit Text Section)"
2583
  msgstr ""
2584
 
2585
- #: php/classes/class-qsm-install.php:855
2586
  msgid "Message Displayed If User Has Tried Quiz Too Many Times"
2587
  msgstr ""
2588
 
2589
- #: php/classes/class-qsm-install.php:868
2590
  msgid ""
2591
  "Message Displayed If User Is Not Logged In And Quiz Requires Users To Be "
2592
  "Logged In"
2593
  msgstr ""
2594
 
2595
- #: php/classes/class-qsm-install.php:881
2596
  msgid "Message Displayed If Date Is Outside Scheduled Timeframe"
2597
  msgstr ""
2598
 
2599
- #: php/classes/class-qsm-install.php:894
2600
  msgid "Message Displayed If The Limit Of Total Entries Has Been Reached"
2601
  msgstr ""
2602
 
2603
- #: php/classes/class-qsm-install.php:907
2604
  msgid "Results Page %QUESTIONS_ANSWERS% Text"
2605
  msgstr ""
2606
 
2607
- #: php/classes/class-qsm-install.php:925
2608
  msgid "%QUESTIONS_ANSWERS_EMAIL% Text"
2609
  msgstr ""
2610
 
2611
- #: php/classes/class-qsm-install.php:941
2612
  msgid "Twitter Sharing Text"
2613
  msgstr ""
2614
 
2615
- #: php/classes/class-qsm-install.php:960
2616
  msgid "Facebook Sharing Text"
2617
  msgstr ""
2618
 
2619
- #: php/classes/class-qsm-install.php:979
2620
  msgid "Buttons"
2621
  msgstr ""
2622
 
2623
- #: php/classes/class-qsm-install.php:987
2624
  msgid "Submit Button"
2625
  msgstr ""
2626
 
2627
- #: php/classes/class-qsm-install.php:996
2628
  msgid "Previous button"
2629
  msgstr ""
2630
 
2631
- #: php/classes/class-qsm-install.php:1005
2632
  msgid "Next button"
2633
  msgstr ""
2634
 
2635
- #: php/classes/class-qsm-install.php:1014
2636
  msgid "Validation Messages"
2637
  msgstr ""
2638
 
2639
- #: php/classes/class-qsm-install.php:1023
2640
  msgid "All required fields"
2641
  msgstr ""
2642
 
2643
- #: php/classes/class-qsm-install.php:1032
2644
  msgid "Invalid email"
2645
  msgstr ""
2646
 
2647
- #: php/classes/class-qsm-install.php:1041
2648
  msgid "Invalid number"
2649
  msgstr ""
2650
 
2651
- #: php/classes/class-qsm-install.php:1050
2652
  msgid "Invalid Captcha"
2653
  msgstr ""
2654
 
2655
- #: php/classes/class-qsm-install.php:1059
2656
  msgid "Other"
2657
  msgstr ""
2658
 
2659
- #: php/classes/class-qsm-install.php:1068
2660
  msgid "Comments field"
2661
  msgstr ""
2662
 
2663
- #: php/classes/class-qsm-install.php:1077
2664
  msgid "Hint Text"
2665
  msgstr ""
2666
 
2667
- #: php/classes/class-qsm-install.php:1086
2668
  msgid "Correct answer message"
2669
  msgstr ""
2670
 
2671
- #: php/classes/class-qsm-install.php:1089
2672
  msgid "Text to show when the selected option is correct answer."
2673
  msgstr ""
2674
 
2675
- #: php/classes/class-qsm-install.php:1096
2676
  msgid "Incorrect answer message"
2677
  msgstr ""
2678
 
2679
- #: php/classes/class-qsm-install.php:1099
2680
  msgid "Text to show when the selected option is wrong answer."
2681
  msgstr ""
2682
 
2683
- #: php/classes/class-qsm-install.php:1117
2684
  msgid "Name field"
2685
  msgstr ""
2686
 
2687
- #: php/classes/class-qsm-install.php:1126
2688
  msgid "Business field"
2689
  msgstr ""
2690
 
2691
- #: php/classes/class-qsm-install.php:1135
2692
  msgid "Email field"
2693
  msgstr ""
2694
 
2695
- #: php/classes/class-qsm-install.php:1144
2696
  msgid "Phone number field"
2697
  msgstr ""
2698
 
2699
- #: php/classes/class-qsm-install.php:1760
2700
  msgid "Documentation"
2701
  msgstr ""
2702
 
2703
- #: php/classes/class-qsm-install.php:1761
2704
  msgid "Create Support Ticket"
2705
  msgstr ""
2706
 
2707
- #: php/classes/class-qsm-install.php:1761
2708
  msgid "Support"
2709
  msgstr ""
2710
 
9
  msgstr ""
10
  "Project-Id-Version: PACKAGE VERSION\n"
11
  "Report-Msgid-Bugs-To: \n"
12
+ "POT-Creation-Date: 2020-10-22 11:51+0530\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15
  "Language-Team: LANGUAGE <LL@li.org>\n"
19
  "Content-Transfer-Encoding: 8bit\n"
20
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
21
 
22
+ #: mlw_quizmaster2.php:214 php/admin/settings-page.php:170
23
  msgid "Quizzes & Surveys"
24
  msgstr ""
25
 
26
+ #: mlw_quizmaster2.php:239 mlw_quizmaster2.php:240 mlw_quizmaster2.php:241
27
  #: php/classes/class-qsm-install.php:51
28
  msgid "Quiz"
29
  msgstr ""
30
 
31
+ #: mlw_quizmaster2.php:242 php/admin/quizzes-page.php:226
32
  msgid "Add New"
33
  msgstr ""
34
 
35
+ #: mlw_quizmaster2.php:243
36
  msgid "Add New Quiz"
37
  msgstr ""
38
 
39
+ #: mlw_quizmaster2.php:244
40
  msgid "New Quiz"
41
  msgstr ""
42
 
43
+ #: mlw_quizmaster2.php:245
44
  msgid "Edit Quiz"
45
  msgstr ""
46
 
47
+ #: mlw_quizmaster2.php:246
48
  msgid "View Quiz"
49
  msgstr ""
50
 
51
+ #: mlw_quizmaster2.php:247
52
  msgid "All Quizzes"
53
  msgstr ""
54
 
55
+ #: mlw_quizmaster2.php:248
56
  msgid "Search Quizzes"
57
  msgstr ""
58
 
59
+ #: mlw_quizmaster2.php:249
60
  msgid "Parent Quiz:"
61
  msgstr ""
62
 
63
+ #: mlw_quizmaster2.php:250
64
  msgid "No Quiz Found"
65
  msgstr ""
66
 
67
+ #: mlw_quizmaster2.php:251
68
  msgid "No Quiz Found In Trash"
69
  msgstr ""
70
 
71
+ #: mlw_quizmaster2.php:284
72
  msgid "QSM"
73
  msgstr ""
74
 
75
+ #: mlw_quizmaster2.php:285
76
  msgid "Dashboard"
77
  msgstr ""
78
 
79
+ #: mlw_quizmaster2.php:286 php/admin/quizzes-page.php:225
80
+ #: php/classes/class-qsm-install.php:1751
81
  msgid "Quizzes/Surveys"
82
  msgstr ""
83
 
84
+ #: mlw_quizmaster2.php:288 mlw_quizmaster2.php:291
85
  #: php/admin/addons-page.php:98
86
  msgid "Settings"
87
  msgstr ""
88
 
89
+ #: mlw_quizmaster2.php:289 php/admin/quizzes-page.php:616
90
  msgid "Results"
91
  msgstr ""
92
 
93
+ #: mlw_quizmaster2.php:290
94
  msgid "Result Details"
95
  msgstr ""
96
 
97
+ #: mlw_quizmaster2.php:292 php/admin/tools-page.php:37
98
  msgid "Tools"
99
  msgstr ""
100
 
101
+ #: mlw_quizmaster2.php:293
102
  msgid "Stats"
103
  msgstr ""
104
 
105
+ #: mlw_quizmaster2.php:294
106
  msgid "Addon Settings"
107
  msgstr ""
108
 
109
+ #: mlw_quizmaster2.php:295
110
  msgid "Get a Free Addon"
111
  msgstr ""
112
 
113
+ #: mlw_quizmaster2.php:295
114
  msgid "Get a Free Addon!"
115
  msgstr ""
116
 
117
+ #: mlw_quizmaster2.php:296
118
  msgid "QSM About"
119
  msgstr ""
120
 
121
+ #: mlw_quizmaster2.php:297
122
  msgid "Help"
123
  msgstr ""
124
 
253
  msgid "File Upload"
254
  msgstr ""
255
 
256
+ #: php/question-types.php:208
257
  msgid "Date"
258
  msgstr ""
259
 
260
+ #: php/question-types.php:280
261
  msgid "Horizontal Multiple Choice"
262
  msgstr ""
263
 
264
+ #: php/question-types.php:390
265
  msgid "Drop Down"
266
  msgstr ""
267
 
268
+ #: php/question-types.php:416
269
  msgid "Please select your answer"
270
  msgstr ""
271
 
272
+ #: php/question-types.php:489
273
  msgid "Short Answer"
274
  msgstr ""
275
 
276
+ #: php/question-types.php:567
277
  msgid "Multiple Response"
278
  msgstr ""
279
 
280
+ #: php/question-types.php:674
281
  msgid "Paragraph"
282
  msgstr ""
283
 
284
+ #: php/question-types.php:756
285
  msgid "Text/HTML Section"
286
  msgstr ""
287
 
288
+ #: php/question-types.php:790
289
  msgid "Number"
290
  msgstr ""
291
 
292
+ #: php/question-types.php:873
293
  msgid "Opt-in"
294
  msgstr ""
295
 
296
+ #: php/question-types.php:918
297
  msgid "Captcha"
298
  msgstr ""
299
 
300
+ #: php/question-types.php:977
301
  msgid "Horizontal Multiple Response"
302
  msgstr ""
303
 
304
+ #: php/question-types.php:1096
305
  msgid ""
306
  "For fill in the blank types, use %BLANK% to represent where to put the text "
307
  "box in your text."
308
  msgstr ""
309
 
310
+ #: php/question-types.php:1101
311
  msgid "Fill In The Blank"
312
  msgstr ""
313
 
314
+ #: php/question-types.php:1192
315
  msgid "Polar"
316
  msgstr ""
317
 
330
  msgid "No quiz found"
331
  msgstr ""
332
 
333
+ #: php/template-variables.php:879 php/template-variables.php:888
334
  msgid "No answer provided"
335
  msgstr ""
336
 
790
  #: php/admin/options-page-option-tab.php:28
791
  #: php/admin/options-page-questions-tab.php:278
792
  #: php/admin/options-page-text-tab.php:30
793
+ #: php/classes/class-qsm-install.php:1764
794
  msgid "View Documentation"
795
  msgstr ""
796
 
1441
  #: php/classes/class-qsm-install.php:393 php/classes/class-qsm-install.php:413
1442
  #: php/classes/class-qsm-install.php:434 php/classes/class-qsm-install.php:455
1443
  #: php/classes/class-qsm-install.php:474 php/classes/class-qsm-install.php:493
1444
+ #: php/classes/class-qsm-install.php:537 php/classes/class-qsm-install.php:557
1445
+ #: php/classes/class-qsm-install.php:576 php/classes/class-qsm-install.php:596
1446
+ #: php/classes/class-qsm-install.php:615 php/classes/class-qsm-install.php:711
1447
+ #: php/classes/class-qsm-install.php:735 php/classes/class-qsm-install.php:759
1448
+ #: php/classes/class-qsm-install.php:782 php/classes/class-qsm-install.php:805
 
1449
  msgid "Yes"
1450
  msgstr ""
1451
 
1490
  #: php/classes/class-qsm-install.php:397 php/classes/class-qsm-install.php:417
1491
  #: php/classes/class-qsm-install.php:438 php/classes/class-qsm-install.php:459
1492
  #: php/classes/class-qsm-install.php:478 php/classes/class-qsm-install.php:497
1493
+ #: php/classes/class-qsm-install.php:521 php/classes/class-qsm-install.php:541
1494
+ #: php/classes/class-qsm-install.php:561 php/classes/class-qsm-install.php:580
1495
+ #: php/classes/class-qsm-install.php:600 php/classes/class-qsm-install.php:619
1496
+ #: php/classes/class-qsm-install.php:715 php/classes/class-qsm-install.php:731
1497
+ #: php/classes/class-qsm-install.php:755 php/classes/class-qsm-install.php:778
1498
+ #: php/classes/class-qsm-install.php:801
1499
  msgid "No"
1500
  msgstr ""
1501
 
2068
 
2069
  #: php/classes/class-qmn-quiz-creator.php:205
2070
  #: php/classes/class-qmn-quiz-creator.php:268
2071
+ #: php/classes/class-qmn-quiz-creator.php:479
2072
+ #: php/classes/class-qmn-quiz-creator.php:564
2073
  #, php-format
2074
  msgid ""
2075
  "There has been an error in this action. Please share this with the "
2090
  "Please try again."
2091
  msgstr ""
2092
 
2093
+ #: php/classes/class-qmn-quiz-creator.php:473
2094
  msgid "Your quiz or survey has been duplicated successfully."
2095
  msgstr ""
2096
 
2118
  msgid "File not removed"
2119
  msgstr ""
2120
 
2121
+ #: php/classes/class-qmn-quiz-manager.php:207
2122
  msgid "Correct Info: "
2123
  msgstr ""
2124
 
2125
+ #: php/classes/class-qmn-quiz-manager.php:254
2126
+ #: php/classes/class-qmn-quiz-manager.php:267
2127
  msgid "It appears that this quiz is not set up correctly"
2128
  msgstr ""
2129
 
2130
+ #: php/classes/class-qmn-quiz-manager.php:559
2131
  msgid "Limit of choice is reached."
2132
  msgstr ""
2133
 
2134
+ #: php/classes/class-qmn-quiz-manager.php:559
2135
+ #: php/classes/class-qmn-quiz-manager.php:783
2136
+ #: php/classes/class-qmn-quiz-manager.php:949
2137
+ msgid " out of "
2138
+ msgstr ""
2139
+
2140
+ #: php/classes/class-qmn-quiz-manager.php:1253
2141
+ #: php/classes/class-qsm-install.php:533
2142
  msgid "Retake Quiz"
2143
  msgstr ""
2144
 
2145
+ #: php/classes/class-qmn-quiz-manager.php:1420
2146
  msgid "Click here to view"
2147
  msgstr ""
2148
 
2149
+ #: php/classes/class-qmn-quiz-manager.php:1885
2150
  msgid "Not collected"
2151
  msgstr ""
2152
 
2153
+ #: php/classes/class-qmn-quiz-manager.php:1895
2154
  msgid "Unknown"
2155
  msgstr ""
2156
 
2441
  msgid "Show correct answer inline"
2442
  msgstr ""
2443
 
2444
+ #: php/classes/class-qsm-install.php:513
2445
+ msgid "Yes When answer is correct"
2446
+ msgstr ""
2447
+
2448
+ #: php/classes/class-qsm-install.php:517
2449
+ msgid "Yes Independent of correct/incorrect"
2450
+ msgstr ""
2451
+
2452
+ #: php/classes/class-qsm-install.php:526
2453
  msgid "Show correct user info when inline result is enabled."
2454
  msgstr ""
2455
 
2456
+ #: php/classes/class-qsm-install.php:546
2457
  msgid "Show a button on result page to retake the quiz"
2458
  msgstr ""
2459
 
2460
+ #: php/classes/class-qsm-install.php:553
2461
  msgid "Show current page number"
2462
  msgstr ""
2463
 
2464
+ #: php/classes/class-qsm-install.php:572
2465
  msgid "Deselect Answer"
2466
  msgstr ""
2467
 
2468
+ #: php/classes/class-qsm-install.php:585
2469
  msgid ""
2470
  "Users are able deselect an answer and leave it blank. Works with Multiple "
2471
  "Choice and Horizintal Multiple Choice questions only"
2472
  msgstr ""
2473
 
2474
+ #: php/classes/class-qsm-install.php:592
2475
  msgid "Disable description on quiz result page?"
2476
  msgstr ""
2477
 
2478
+ #: php/classes/class-qsm-install.php:611
2479
  msgid "Disable scroll on next and previous button click?"
2480
  msgstr ""
2481
 
2482
+ #: php/classes/class-qsm-install.php:630
2483
  msgid "Quiz Animation"
2484
  msgstr ""
2485
 
2486
+ #: php/classes/class-qsm-install.php:634
2487
  msgid "bounce"
2488
  msgstr ""
2489
 
2490
+ #: php/classes/class-qsm-install.php:638
2491
  msgid "flash"
2492
  msgstr ""
2493
 
2494
+ #: php/classes/class-qsm-install.php:642
2495
  msgid "pulse"
2496
  msgstr ""
2497
 
2498
+ #: php/classes/class-qsm-install.php:646
2499
  msgid "rubberBand"
2500
  msgstr ""
2501
 
2502
+ #: php/classes/class-qsm-install.php:650
2503
  msgid "shake"
2504
  msgstr ""
2505
 
2506
+ #: php/classes/class-qsm-install.php:654
2507
  msgid "swing"
2508
  msgstr ""
2509
 
2510
+ #: php/classes/class-qsm-install.php:658
2511
  msgid "tada"
2512
  msgstr ""
2513
 
2514
+ #: php/classes/class-qsm-install.php:662
2515
  msgid "wobble"
2516
  msgstr ""
2517
 
2518
+ #: php/classes/class-qsm-install.php:666
2519
  msgid "jello"
2520
  msgstr ""
2521
 
2522
+ #: php/classes/class-qsm-install.php:670
2523
  msgid "heartBeat"
2524
  msgstr ""
2525
 
2526
+ #: php/classes/class-qsm-install.php:674
2527
  msgid "No animation"
2528
  msgstr ""
2529
 
2530
+ #: php/classes/class-qsm-install.php:685
2531
  msgid "Logo URL"
2532
  msgstr ""
2533
 
2534
+ #: php/classes/class-qsm-install.php:688
2535
  msgid ""
2536
  "Enter the url of an image which will be used as logo while sharing on "
2537
  "facebook."
2538
  msgstr ""
2539
 
2540
+ #: php/classes/class-qsm-install.php:689
2541
  msgid "If left blank, this will default to QSM logo"
2542
  msgstr ""
2543
 
2544
+ #: php/classes/class-qsm-install.php:696
2545
+ #: php/classes/class-qsm-install.php:1110
2546
  msgid "Show Legacy Options"
2547
  msgstr ""
2548
 
2549
+ #: php/classes/class-qsm-install.php:699
2550
+ #: php/classes/class-qsm-install.php:1113
2551
  msgid ""
2552
  "All the legacy options are deprecated and will be removed in upcoming version"
2553
  msgstr ""
2554
 
2555
+ #: php/classes/class-qsm-install.php:707
2556
  msgid "Social Sharing Buttons"
2557
  msgstr ""
2558
 
2559
+ #: php/classes/class-qsm-install.php:720
2560
  msgid ""
2561
  "Please use the new template variables instead.%FACEBOOK_SHARE% %TWITTER_SHARE"
2562
  "%"
2563
  msgstr ""
2564
 
2565
+ #: php/classes/class-qsm-install.php:727
2566
  msgid "Ask user's name"
2567
  msgstr ""
2568
 
2569
+ #: php/classes/class-qsm-install.php:739 php/classes/class-qsm-install.php:763
2570
+ #: php/classes/class-qsm-install.php:786 php/classes/class-qsm-install.php:809
2571
  msgid "Require"
2572
  msgstr ""
2573
 
2574
+ #: php/classes/class-qsm-install.php:751
2575
  msgid "Ask user's business"
2576
  msgstr ""
2577
 
2578
+ #: php/classes/class-qsm-install.php:774
2579
  msgid "Ask user's email"
2580
  msgstr ""
2581
 
2582
+ #: php/classes/class-qsm-install.php:797
2583
  msgid "Ask user's phone"
2584
  msgstr ""
2585
 
2586
+ #: php/classes/class-qsm-install.php:820
2587
  msgid "Message Displayed Before Quiz"
2588
  msgstr ""
2589
 
2590
+ #: php/classes/class-qsm-install.php:833
2591
  msgid "Message Displayed Before Comments Box If Enabled"
2592
  msgstr ""
2593
 
2594
+ #: php/classes/class-qsm-install.php:846
2595
  msgid "Message Displayed At End Of Quiz (Leave Blank To Omit Text Section)"
2596
  msgstr ""
2597
 
2598
+ #: php/classes/class-qsm-install.php:859
2599
  msgid "Message Displayed If User Has Tried Quiz Too Many Times"
2600
  msgstr ""
2601
 
2602
+ #: php/classes/class-qsm-install.php:872
2603
  msgid ""
2604
  "Message Displayed If User Is Not Logged In And Quiz Requires Users To Be "
2605
  "Logged In"
2606
  msgstr ""
2607
 
2608
+ #: php/classes/class-qsm-install.php:885
2609
  msgid "Message Displayed If Date Is Outside Scheduled Timeframe"
2610
  msgstr ""
2611
 
2612
+ #: php/classes/class-qsm-install.php:898
2613
  msgid "Message Displayed If The Limit Of Total Entries Has Been Reached"
2614
  msgstr ""
2615
 
2616
+ #: php/classes/class-qsm-install.php:911
2617
  msgid "Results Page %QUESTIONS_ANSWERS% Text"
2618
  msgstr ""
2619
 
2620
+ #: php/classes/class-qsm-install.php:929
2621
  msgid "%QUESTIONS_ANSWERS_EMAIL% Text"
2622
  msgstr ""
2623
 
2624
+ #: php/classes/class-qsm-install.php:945
2625
  msgid "Twitter Sharing Text"
2626
  msgstr ""
2627
 
2628
+ #: php/classes/class-qsm-install.php:964
2629
  msgid "Facebook Sharing Text"
2630
  msgstr ""
2631
 
2632
+ #: php/classes/class-qsm-install.php:983
2633
  msgid "Buttons"
2634
  msgstr ""
2635
 
2636
+ #: php/classes/class-qsm-install.php:991
2637
  msgid "Submit Button"
2638
  msgstr ""
2639
 
2640
+ #: php/classes/class-qsm-install.php:1000
2641
  msgid "Previous button"
2642
  msgstr ""
2643
 
2644
+ #: php/classes/class-qsm-install.php:1009
2645
  msgid "Next button"
2646
  msgstr ""
2647
 
2648
+ #: php/classes/class-qsm-install.php:1018
2649
  msgid "Validation Messages"
2650
  msgstr ""
2651
 
2652
+ #: php/classes/class-qsm-install.php:1027
2653
  msgid "All required fields"
2654
  msgstr ""
2655
 
2656
+ #: php/classes/class-qsm-install.php:1036
2657
  msgid "Invalid email"
2658
  msgstr ""
2659
 
2660
+ #: php/classes/class-qsm-install.php:1045
2661
  msgid "Invalid number"
2662
  msgstr ""
2663
 
2664
+ #: php/classes/class-qsm-install.php:1054
2665
  msgid "Invalid Captcha"
2666
  msgstr ""
2667
 
2668
+ #: php/classes/class-qsm-install.php:1063
2669
  msgid "Other"
2670
  msgstr ""
2671
 
2672
+ #: php/classes/class-qsm-install.php:1072
2673
  msgid "Comments field"
2674
  msgstr ""
2675
 
2676
+ #: php/classes/class-qsm-install.php:1081
2677
  msgid "Hint Text"
2678
  msgstr ""
2679
 
2680
+ #: php/classes/class-qsm-install.php:1090
2681
  msgid "Correct answer message"
2682
  msgstr ""
2683
 
2684
+ #: php/classes/class-qsm-install.php:1093
2685
  msgid "Text to show when the selected option is correct answer."
2686
  msgstr ""
2687
 
2688
+ #: php/classes/class-qsm-install.php:1100
2689
  msgid "Incorrect answer message"
2690
  msgstr ""
2691
 
2692
+ #: php/classes/class-qsm-install.php:1103
2693
  msgid "Text to show when the selected option is wrong answer."
2694
  msgstr ""
2695
 
2696
+ #: php/classes/class-qsm-install.php:1121
2697
  msgid "Name field"
2698
  msgstr ""
2699
 
2700
+ #: php/classes/class-qsm-install.php:1130
2701
  msgid "Business field"
2702
  msgstr ""
2703
 
2704
+ #: php/classes/class-qsm-install.php:1139
2705
  msgid "Email field"
2706
  msgstr ""
2707
 
2708
+ #: php/classes/class-qsm-install.php:1148
2709
  msgid "Phone number field"
2710
  msgstr ""
2711
 
2712
+ #: php/classes/class-qsm-install.php:1764
2713
  msgid "Documentation"
2714
  msgstr ""
2715
 
2716
+ #: php/classes/class-qsm-install.php:1765
2717
  msgid "Create Support Ticket"
2718
  msgstr ""
2719
 
2720
+ #: php/classes/class-qsm-install.php:1765
2721
  msgid "Support"
2722
  msgstr ""
2723
 
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.4
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.4
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.4';
41
 
42
  /**
43
  * QSM Alert Manager Object
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
+ * Version: 7.1.5
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.5
13
  * @package QSM
14
  */
15
 
37
  * @var string
38
  * @since 4.0.0
39
  */
40
+ public $version = '7.1.5';
41
 
42
  /**
43
  * QSM Alert Manager Object
php/admin/admin-results-page.php CHANGED
@@ -22,11 +22,11 @@ function qsm_generate_admin_results_page() {
22
  $tab_array = $mlwQuizMasterNext->pluginHelper->get_admin_results_tabs();
23
 
24
  ?>
25
- <div class="wrap">
26
- <h2><?php esc_html_e( 'Quiz Results', 'quiz-master-next' ); ?></h2>
27
  <?php $mlwQuizMasterNext->alertManager->showAlerts(); ?>
28
  <?php qsm_show_adverts(); ?>
29
- <h2 class="nav-tab-wrapper">
30
  <?php
31
  // Cycles through the tabs and creates the navigation.
32
  foreach ( $tab_array as $tab ) {
@@ -36,22 +36,23 @@ function qsm_generate_admin_results_page() {
36
  }
37
  $tab_url = "?page=mlw_quiz_results&tab={$tab['slug']}";
38
  ?>
39
- <a href="<?php echo esc_url_raw( $tab_url ); ?>" class="nav-tab <?php echo esc_attr( $active_class ); ?>"><?php echo esc_html( $tab['title'] ); ?></a>
 
40
  <?php
41
  }
42
  ?>
43
- </h2>
44
- <div class="result-page-wrapper">
45
- <?php
46
- // Locates the active tab and calls its content function.
47
- foreach ( $tab_array as $tab ) {
48
- if ( $active_tab == $tab['slug'] ) {
49
- call_user_func( $tab['function'] );
 
50
  }
51
- }
52
- ?>
53
- </div>
54
- </div>
55
 
56
  <?php
57
 
@@ -67,6 +68,7 @@ function qsm_results_overview_tab() {
67
  global $mlwQuizMasterNext;
68
  $mlwQuizMasterNext->pluginHelper->register_admin_results_tab( __( 'Quiz Results', 'quiz-master-next' ), 'qsm_results_overview_tab_content' );
69
  }
 
70
  add_action( 'plugins_loaded', 'qsm_results_overview_tab' );
71
 
72
  /**
@@ -81,7 +83,7 @@ function qsm_results_overview_tab_content() {
81
  global $mlwQuizMasterNext;
82
 
83
  // If nonce is correct, delete results.
84
- if ( isset( $_POST['delete_results_nonce'] ) && wp_verify_nonce( $_POST['delete_results_nonce'], 'delete_results') ) {
85
 
86
  // Variables from delete result form.
87
  $mlw_delete_results_id = intval( $_POST['result_id'] );
@@ -108,41 +110,41 @@ function qsm_results_overview_tab_content() {
108
  $mlwQuizMasterNext->alertManager->newAlert( sprintf( __( 'There was an error when deleting this result. Error from WordPress: %s', 'quiz-master-next' ), $error ), 'error' );
109
  $mlwQuizMasterNext->log_manager->add( 'Error deleting result', "Tried {$wpdb->last_query} but got $error.", 0, 'error' );
110
  } else {
111
- $mlwQuizMasterNext->alertManager->newAlert( __('Your results has been deleted successfully.','quiz-master-next' ), 'success');
112
  $mlwQuizMasterNext->audit_manager->new_audit( "Results Has Been Deleted From: $mlw_delete_results_name" );
113
-
114
  }
115
  }
116
 
117
  // Check if bulk delete has been selected. If so, verify nonce.
118
- if ( isset( $_POST["bulk_delete"] ) && wp_verify_nonce( $_POST['bulk_delete_nonce'], 'bulk_delete') ) {
119
 
120
  // Ensure the POST variable is an array
121
  if ( isset( $_POST["delete_results"] ) && is_array( $_POST["delete_results"] ) ) {
122
 
123
  // Cycle through the POST array which should be an array of the result ids of the results the user wishes to delete
124
- foreach( $_POST["delete_results"] as $result ) {
125
 
126
  // Santize by ensuring the value is an int
127
  $result_id = intval( $result );
128
- if(isset($_POST['bulk_permanent_delete']) && $_POST['bulk_permanent_delete'] == 1){
129
- $wpdb->delete(
130
- $wpdb->prefix."mlw_results",
131
- array( 'result_id' => $result_id )
132
- );
133
- }else{
134
- $wpdb->update(
135
- $wpdb->prefix."mlw_results",
136
- array(
137
- 'deleted' => 1,
138
- ),
139
- array( 'result_id' => $result_id ),
140
- array(
141
- '%d'
142
- ),
143
- array( '%d' )
144
- );
145
- }
146
  }
147
 
148
  $mlwQuizMasterNext->audit_manager->new_audit( "Results Have Been Bulk Deleted" );
@@ -150,9 +152,9 @@ function qsm_results_overview_tab_content() {
150
  }
151
 
152
  // Prepares the SQL to retrieve the results.
153
- $table_limit = 40;
154
- $search_phrase_sql = '';
155
- $order_by_sql = 'ORDER BY result_id DESC';
156
  if ( isset( $_GET['qsm_search_phrase'] ) && ! empty( $_GET['qsm_search_phrase'] ) ) {
157
  // Sanitizes the search phrase and then uses $wpdb->prepare to properly escape the queries after using $wpdb->esc_like.
158
  $sanitized_search_phrase = sanitize_text_field( $_GET['qsm_search_phrase'] );
@@ -202,45 +204,50 @@ function qsm_results_overview_tab_content() {
202
  } else {
203
  $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE deleted = '0' $search_phrase_sql $order_by_sql LIMIT %d, %d", $result_begin, $table_limit ) );
204
  }
205
-
206
  wp_enqueue_script( 'jquery' );
207
  wp_enqueue_script( 'jquery-ui-core' );
208
  wp_enqueue_script( 'jquery-ui-dialog' );
209
  wp_enqueue_script( 'jquery-ui-button' );
210
  wp_enqueue_script( 'qmn_admin_js', plugins_url( '../../js/admin.js', __FILE__ ) );
211
  wp_enqueue_style( 'qmn_jquery_redmond_theme', plugins_url( '../../css/jquery-ui.css', __FILE__ ) );
212
- wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ), array() );
213
  ?>
214
- <script type="text/javascript">
215
- var $j = jQuery.noConflict();
216
- function deleteResults(id,quizName){
217
- $j("#delete_dialog").dialog({
218
- autoOpen: false,
219
- buttons: {
220
- Cancel: function() {
221
- $j(this).dialog('close');
222
- }
223
- }
224
- });
225
- $j("#delete_dialog").dialog('open');
226
- var idHidden = document.getElementById("result_id");
227
- var idHiddenName = document.getElementById("delete_quiz_name");
228
- idHidden.value = id;
229
- idHiddenName.value = quizName;
230
- };
231
- </script>
232
- <div class="tablenav top">
233
- <div class="alignleft actions bulkactions">
234
- <a id="result_bulkaction" href="javascript: void(0);" onclick="if( confirm('Are you sure?') ){ document.bulk_delete_form.submit(); }" class="button action">Bulk Delete</a>&nbsp;&nbsp;&nbsp;
235
- <a href="javascript: void(0);" onclick="if( confirm('Are you sure?') ){ document.getElementById('bulk_permanent_delete').value = '1'; document.bulk_delete_form.submit(); }" class="button action">Bulk Permanent Delete</a>
236
- </div>
237
- <div class="tablenav-pages">
238
- <span class="displaying-num"><?php echo sprintf(_n('One result', '%s results', $qsm_results_count, 'quiz-master-next' ), number_format_i18n($qsm_results_count)); ?></span>
239
- <span class="pagination-links">
 
 
 
 
 
240
  <?php
241
  $mlw_qmn_previous_page = 0;
242
- $mlw_current_page = $result_page+1;
243
- $mlw_total_pages = ceil( $qsm_results_count / $table_limit );
244
 
245
  $url_query_string = '';
246
  if ( isset( $_GET['quiz_id'] ) && ! empty( $_GET['quiz_id'] ) ) {
@@ -251,164 +258,181 @@ function qsm_results_overview_tab_content() {
251
  $url_query_string .= "&&qsm_search_phrase=$sanitized_search_phrase";
252
  }
253
 
254
- if ( isset( $_GET['qmn_order_by'] ) && !empty( $_GET['qmn_order_by'] ) ) {
255
  $url_query_string .= "&&qmn_order_by=$order_by";
256
  }
257
 
258
  if ( $result_page > 0 ) {
259
  $mlw_qmn_previous_page = $result_page - 2;
260
  ?>
261
- <a class="prev-page button" href="<?php echo esc_url_raw( "?page=mlw_quiz_results&&qsm_results_page=$mlw_qmn_previous_page$url_query_string" ); ?>"><</a>
262
- <span class="paging-input"><?php echo esc_html( $mlw_current_page ); ?> of <?php echo esc_html( $mlw_total_pages ); ?></span>
 
263
  <?php
264
  if ( $results_left > $table_limit ) {
265
  ?>
266
- <a class="next-page button" href="<?php echo esc_url_raw( "?page=mlw_quiz_results&&qsm_results_page=$result_page$url_query_string" ); ?>">></a>
 
267
  <?php
268
  }
269
  } elseif ( 0 == $result_page ) {
270
  if ( $results_left > $table_limit ) {
271
  ?>
272
- <span class="paging-input"><?php echo esc_html( $mlw_current_page ); ?> of <?php echo esc_html( $mlw_total_pages ); ?></span>
273
- <a class="next-page button" href="<?php echo esc_url_raw( "?page=mlw_quiz_results&&qsm_results_page=$result_page$url_query_string" ); ?>">></a>
 
274
  <?php
275
  }
276
  } elseif ( $results_left < $table_limit ) {
277
  $mlw_qmn_previous_page = $result_page - 2;
278
  ?>
279
- <a class="prev-page button" href="<?php echo esc_url_raw( "?page=mlw_quiz_results&&qsm_results_page=$mlw_qmn_previous_page$url_query_string" ); ?>"><</a>
280
- <span class="paging-input"><?php echo esc_html( $mlw_current_page ); ?> of <?php echo esc_html( $mlw_total_pages ); ?></span>
281
- <a class="next-page button" href="<?php echo esc_url_raw( "?page=mlw_quiz_results&&qsm_results_page=$result_page$url_query_string" ); ?>">></a>
 
 
282
  <?php
283
  }
284
  ?>
285
  </span>
286
- <br class="clear">
287
- </div>
288
- <form action='' method="get">
289
- <?php
290
- if ( isset( $_GET['quiz_id'] ) ) {
291
- ?>
292
- <input type="hidden" name="quiz_id" value="<?php echo esc_attr( intval( $_GET['quiz_id'] ) ); ?>" />
293
- <?php
294
- }
295
- ?>
296
- <input type="hidden" name="page" value="mlw_quiz_results">
297
- <p class="search-box">
298
- <label for="qsm_search_phrase"><?php esc_html_e( 'Search Results', 'quiz-master-next' ); ?></label>
299
- <input type="search" id="qsm_search_phrase" name="qsm_search_phrase" value="">
300
- <label for="qmn_order_by"><?php esc_html_e( 'Order By', 'quiz-master-next' ); ?></label>
301
- <select id="qmn_order_by" name="qmn_order_by">
302
- <option value="quiz_name"><?php esc_html_e( 'Quiz Name', 'quiz-master-next' ); ?></option>
303
- <option value="name"><?php esc_html_e( 'User Name', 'quiz-master-next' ); ?></option>
304
- <option value="point_score"><?php esc_html_e( 'Points', 'quiz-master-next' ); ?></option>
305
- <option value="correct_score"><?php esc_html_e( 'Correct Percent', 'quiz-master-next' ); ?></option>
306
- <option value="default"><?php esc_html_e( 'Default (Time)', 'quiz-master-next' ); ?></option>
307
- </select>
308
- <button class="button"><?php esc_html_e( 'Search Results', 'quiz-master-next' ); ?></button>
309
- </p>
310
- </form>
311
- </div>
312
-
313
- <form action="" method="post" name="bulk_delete_form">
314
- <input type="hidden" name="bulk_delete" value="confirmation" />
315
- <input type="hidden" name="bulk_permanent_delete" id="bulk_permanent_delete" value="0" />
316
- <?php wp_nonce_field( 'bulk_delete','bulk_delete_nonce' ); ?>
317
- <table class=widefat>
318
- <thead>
319
- <tr>
320
- <th><input type="checkbox" id="qmn_check_all" /></th>
321
- <th><?php esc_html_e( 'Quiz Name','quiz-master-next' ); ?></th>
322
- <th><?php esc_html_e( 'Score','quiz-master-next' ); ?></th>
323
- <th><?php esc_html_e( 'Time To Complete','quiz-master-next' ); ?></th>
324
- <th><?php esc_html_e( 'Name','quiz-master-next' ); ?></th>
325
- <th><?php esc_html_e( 'Business','quiz-master-next' ); ?></th>
326
- <th><?php esc_html_e( 'Email','quiz-master-next' ); ?></th>
327
- <th><?php esc_html_e( 'Phone','quiz-master-next' ); ?></th>
328
- <th><?php esc_html_e( 'User','quiz-master-next' ); ?></th>
329
- <th><?php esc_html_e( 'Time Taken','quiz-master-next' ); ?></th>
330
- <th><?php esc_html_e( 'IP Address','quiz-master-next' ); ?></th>
331
- </tr>
332
- </thead>
333
- <?php
 
 
 
 
 
 
334
  $quotes_list = "";
335
- $display = "";
336
- $alternate = "";
337
- if($mlw_quiz_data){
338
- foreach ( $mlw_quiz_data as $mlw_quiz_info ) {
339
- if ( $alternate ) {
340
- $alternate = '';
341
- } else {
342
- $alternate = ' class="alternate"';
343
- }
344
- $mlw_complete_time = '';
345
- $mlw_qmn_results_array = @unserialize($mlw_quiz_info->quiz_results);
346
- $hidden_questions = isset($mlw_qmn_results_array['hidden_questions']) ? count($mlw_qmn_results_array['hidden_questions']): 0;
347
- if ( is_array( $mlw_qmn_results_array ) ) {
348
- $mlw_complete_hours = floor($mlw_qmn_results_array[0] / 3600);
349
- if ( $mlw_complete_hours > 0 ) {
350
- $mlw_complete_time .= "$mlw_complete_hours hours ";
351
  }
352
- $mlw_complete_minutes = floor(($mlw_qmn_results_array[0] % 3600) / 60);
353
- if ( $mlw_complete_minutes > 0 ) {
354
- $mlw_complete_time .= "$mlw_complete_minutes minutes ";
 
 
 
 
 
 
 
 
 
 
 
355
  }
356
- $mlw_complete_seconds = $mlw_qmn_results_array[0] % 60;
357
- $mlw_complete_time .= "$mlw_complete_seconds seconds";
358
- }
359
-
360
- $out_of_q = $mlw_quiz_info->total - $hidden_questions;
361
- $quotes_list .= "<tr{$alternate}>";
362
- $quotes_list .= "<td><input type='checkbox' class='qmn_delete_checkbox' name='delete_results[]' value='".$mlw_quiz_info->result_id. "' /></td>";
363
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_name . "</span><div class='row-actions'><span style='color:green;font-size:16px;'><a href='admin.php?page=qsm_quiz_result_details&&result_id=".$mlw_quiz_info->result_id."'>View</a> | <a style='color: red;' onclick=\"deleteResults('".$mlw_quiz_info->result_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='#'>Delete</a></span></div></td>";
364
- $form_type = isset( $mlw_quiz_info->form_type ) ? $mlw_quiz_info->form_type : 0;
365
- if( $form_type == 1 || $form_type == 2 ){
366
- $quotes_list .= "<td><span style='font-size:16px;'>".__('Not Graded','quiz-master-next' )."</span></td>";
367
- } else {
368
- if ( $mlw_quiz_info->quiz_system == 0 ) {
369
- $quotes_list .= "<td class='post-title column-title'><span style='font-size:16px;'>" . $mlw_quiz_info->correct ." out of ".$out_of_q." or ".$mlw_quiz_info->correct_score."%</span></td>";
370
- }
371
- if ( $mlw_quiz_info->quiz_system == 1 ) {
372
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->point_score . " Points</span></td>";
373
- }
374
- if ( $mlw_quiz_info->quiz_system == 3 ) {
375
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->correct ." out of ".$out_of_q." or ".$mlw_quiz_info->correct_score."%</span><br/><span style='font-size:16px;'>" . $mlw_quiz_info->point_score . " Points</span></td>";
376
- }
377
- }
378
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_complete_time ."</span></td>";
379
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->name ."</span></td>";
380
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->business ."</span></td>";
381
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->email ."</span></td>";
382
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->phone ."</span></td>";
383
- if ( 0 == $mlw_quiz_info->user ) {
384
- $quotes_list .= "<td><span style='font-size:16px;'>Visitor</span></td>";
385
- } else {
386
- $quotes_list .= "<td><span style='font-size:16px;'><a href='user-edit.php?user_id=" . $mlw_quiz_info->user ."'>" . $mlw_quiz_info->user ."</a></span></td>";
 
 
 
 
 
387
  }
388
- $date = date_i18n( get_option( 'date_format' ), strtotime( $mlw_quiz_info->time_taken ) );
389
- $time = date( "h:i:s A", strtotime( $mlw_quiz_info->time_taken ) );
390
- $quotes_list .= "<td><span style='font-size:16px;'><abbr title='$date $time'>$date</abbr></span></td>";
391
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->user_ip . "</span></td>";
392
- $quotes_list .= "</tr>";
393
- }
394
- }else{
395
- $quotes_list .= "<tr{$alternate}><td colspan='12' style='text-align: center;'>". __('No record found.','quiz-master-next') ."</td></tr>";
396
- }
397
  $display .= "<tbody id=\"the-list\">{$quotes_list}</tbody>";
398
  echo $display;
399
  ?>
400
- </table>
401
- </form>
402
-
403
- <div id="delete_dialog" title="Delete Results?" style="display:none;">
404
- <h3><b><?php esc_html_e( 'Are you sure you want to delete these results?','quiz-master-next' ); ?></b></h3>
405
- <form action='' method='post'>
406
- <?php wp_nonce_field( 'delete_results','delete_results_nonce' ); ?>
407
- <input type='hidden' id='result_id' name='result_id' value='' />
408
- <input type='hidden' id='delete_quiz_name' name='delete_quiz_name' value='' />
409
- <p class='submit'><input type='submit' class='button-primary' value='<?php esc_html_e( 'Delete Results','quiz-master-next' ); ?>' /></p>
410
- </form>
411
- </div>
412
- <?php
 
413
  }
 
414
  ?>
22
  $tab_array = $mlwQuizMasterNext->pluginHelper->get_admin_results_tabs();
23
 
24
  ?>
25
+ <div class="wrap">
26
+ <h2><?php esc_html_e( 'Quiz Results', 'quiz-master-next' ); ?></h2>
27
  <?php $mlwQuizMasterNext->alertManager->showAlerts(); ?>
28
  <?php qsm_show_adverts(); ?>
29
+ <h2 class="nav-tab-wrapper">
30
  <?php
31
  // Cycles through the tabs and creates the navigation.
32
  foreach ( $tab_array as $tab ) {
36
  }
37
  $tab_url = "?page=mlw_quiz_results&tab={$tab['slug']}";
38
  ?>
39
+ <a href="<?php echo esc_url_raw( $tab_url ); ?>"
40
+ class="nav-tab <?php echo esc_attr( $active_class ); ?>"><?php echo esc_html( $tab['title'] ); ?></a>
41
  <?php
42
  }
43
  ?>
44
+ </h2>
45
+ <div class="result-page-wrapper">
46
+ <?php
47
+ // Locates the active tab and calls its content function.
48
+ foreach ( $tab_array as $tab ) {
49
+ if ( $active_tab == $tab['slug'] ) {
50
+ call_user_func( $tab['function'] );
51
+ }
52
  }
53
+ ?>
54
+ </div>
55
+ </div>
 
56
 
57
  <?php
58
 
68
  global $mlwQuizMasterNext;
69
  $mlwQuizMasterNext->pluginHelper->register_admin_results_tab( __( 'Quiz Results', 'quiz-master-next' ), 'qsm_results_overview_tab_content' );
70
  }
71
+
72
  add_action( 'plugins_loaded', 'qsm_results_overview_tab' );
73
 
74
  /**
83
  global $mlwQuizMasterNext;
84
 
85
  // If nonce is correct, delete results.
86
+ if ( isset( $_POST['delete_results_nonce'] ) && wp_verify_nonce( $_POST['delete_results_nonce'], 'delete_results' ) ) {
87
 
88
  // Variables from delete result form.
89
  $mlw_delete_results_id = intval( $_POST['result_id'] );
110
  $mlwQuizMasterNext->alertManager->newAlert( sprintf( __( 'There was an error when deleting this result. Error from WordPress: %s', 'quiz-master-next' ), $error ), 'error' );
111
  $mlwQuizMasterNext->log_manager->add( 'Error deleting result', "Tried {$wpdb->last_query} but got $error.", 0, 'error' );
112
  } else {
113
+ $mlwQuizMasterNext->alertManager->newAlert( __( 'Your results has been deleted successfully.', 'quiz-master-next' ), 'success' );
114
  $mlwQuizMasterNext->audit_manager->new_audit( "Results Has Been Deleted From: $mlw_delete_results_name" );
115
+
116
  }
117
  }
118
 
119
  // Check if bulk delete has been selected. If so, verify nonce.
120
+ if ( isset( $_POST["bulk_delete"] ) && wp_verify_nonce( $_POST['bulk_delete_nonce'], 'bulk_delete' ) ) {
121
 
122
  // Ensure the POST variable is an array
123
  if ( isset( $_POST["delete_results"] ) && is_array( $_POST["delete_results"] ) ) {
124
 
125
  // Cycle through the POST array which should be an array of the result ids of the results the user wishes to delete
126
+ foreach ( $_POST["delete_results"] as $result ) {
127
 
128
  // Santize by ensuring the value is an int
129
  $result_id = intval( $result );
130
+ if ( isset( $_POST['bulk_permanent_delete'] ) && $_POST['bulk_permanent_delete'] == 1 ) {
131
+ $wpdb->delete(
132
+ $wpdb->prefix . "mlw_results",
133
+ array( 'result_id' => $result_id )
134
+ );
135
+ } else {
136
+ $wpdb->update(
137
+ $wpdb->prefix . "mlw_results",
138
+ array(
139
+ 'deleted' => 1,
140
+ ),
141
+ array( 'result_id' => $result_id ),
142
+ array(
143
+ '%d'
144
+ ),
145
+ array( '%d' )
146
+ );
147
+ }
148
  }
149
 
150
  $mlwQuizMasterNext->audit_manager->new_audit( "Results Have Been Bulk Deleted" );
152
  }
153
 
154
  // Prepares the SQL to retrieve the results.
155
+ $table_limit = 40;
156
+ $search_phrase_sql = '';
157
+ $order_by_sql = 'ORDER BY result_id DESC';
158
  if ( isset( $_GET['qsm_search_phrase'] ) && ! empty( $_GET['qsm_search_phrase'] ) ) {
159
  // Sanitizes the search phrase and then uses $wpdb->prepare to properly escape the queries after using $wpdb->esc_like.
160
  $sanitized_search_phrase = sanitize_text_field( $_GET['qsm_search_phrase'] );
204
  } else {
205
  $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE deleted = '0' $search_phrase_sql $order_by_sql LIMIT %d, %d", $result_begin, $table_limit ) );
206
  }
207
+
208
  wp_enqueue_script( 'jquery' );
209
  wp_enqueue_script( 'jquery-ui-core' );
210
  wp_enqueue_script( 'jquery-ui-dialog' );
211
  wp_enqueue_script( 'jquery-ui-button' );
212
  wp_enqueue_script( 'qmn_admin_js', plugins_url( '../../js/admin.js', __FILE__ ) );
213
  wp_enqueue_style( 'qmn_jquery_redmond_theme', plugins_url( '../../css/jquery-ui.css', __FILE__ ) );
214
+ wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ), array() );
215
  ?>
216
+ <script type="text/javascript">
217
+ var $j = jQuery.noConflict();
218
+
219
+ function deleteResults(id, quizName) {
220
+ $j("#delete_dialog").dialog({
221
+ autoOpen: false,
222
+ buttons: {
223
+ Cancel: function () {
224
+ $j(this).dialog('close');
225
+ }
226
+ }
227
+ });
228
+ $j("#delete_dialog").dialog('open');
229
+ var idHidden = document.getElementById("result_id");
230
+ var idHiddenName = document.getElementById("delete_quiz_name");
231
+ idHidden.value = id;
232
+ idHiddenName.value = quizName;
233
+ };
234
+ </script>
235
+ <div class="tablenav top">
236
+ <div class="alignleft actions bulkactions">
237
+ <a id="result_bulkaction" href="javascript: void(0);"
238
+ onclick="if( confirm('Are you sure?') ){ document.bulk_delete_form.submit(); }" class="button action">Bulk
239
+ Delete</a>&nbsp;&nbsp;&nbsp;
240
+ <a href="javascript: void(0);"
241
+ onclick="if( confirm('Are you sure?') ){ document.getElementById('bulk_permanent_delete').value = '1'; document.bulk_delete_form.submit(); }"
242
+ class="button action">Bulk Permanent Delete</a>
243
+ </div>
244
+ <div class="tablenav-pages">
245
+ <span class="displaying-num"><?php echo sprintf( _n( 'One result', '%s results', $qsm_results_count, 'quiz-master-next' ), number_format_i18n( $qsm_results_count ) ); ?></span>
246
+ <span class="pagination-links">
247
  <?php
248
  $mlw_qmn_previous_page = 0;
249
+ $mlw_current_page = $result_page + 1;
250
+ $mlw_total_pages = ceil( $qsm_results_count / $table_limit );
251
 
252
  $url_query_string = '';
253
  if ( isset( $_GET['quiz_id'] ) && ! empty( $_GET['quiz_id'] ) ) {
258
  $url_query_string .= "&&qsm_search_phrase=$sanitized_search_phrase";
259
  }
260
 
261
+ if ( isset( $_GET['qmn_order_by'] ) && ! empty( $_GET['qmn_order_by'] ) ) {
262
  $url_query_string .= "&&qmn_order_by=$order_by";
263
  }
264
 
265
  if ( $result_page > 0 ) {
266
  $mlw_qmn_previous_page = $result_page - 2;
267
  ?>
268
+ <a class="prev-page button"
269
+ href="<?php echo esc_url_raw( "?page=mlw_quiz_results&&qsm_results_page=$mlw_qmn_previous_page$url_query_string" ); ?>"><</a>
270
+ <span class="paging-input"><?php echo esc_html( $mlw_current_page ); ?> of <?php echo esc_html( $mlw_total_pages ); ?></span>
271
  <?php
272
  if ( $results_left > $table_limit ) {
273
  ?>
274
+ <a class="next-page button"
275
+ href="<?php echo esc_url_raw( "?page=mlw_quiz_results&&qsm_results_page=$result_page$url_query_string" ); ?>">></a>
276
  <?php
277
  }
278
  } elseif ( 0 == $result_page ) {
279
  if ( $results_left > $table_limit ) {
280
  ?>
281
+ <span class="paging-input"><?php echo esc_html( $mlw_current_page ); ?> of <?php echo esc_html( $mlw_total_pages ); ?></span>
282
+ <a class="next-page button"
283
+ href="<?php echo esc_url_raw( "?page=mlw_quiz_results&&qsm_results_page=$result_page$url_query_string" ); ?>">></a>
284
  <?php
285
  }
286
  } elseif ( $results_left < $table_limit ) {
287
  $mlw_qmn_previous_page = $result_page - 2;
288
  ?>
289
+ <a class="prev-page button"
290
+ href="<?php echo esc_url_raw( "?page=mlw_quiz_results&&qsm_results_page=$mlw_qmn_previous_page$url_query_string" ); ?>"><</a>
291
+ <span class="paging-input"><?php echo esc_html( $mlw_current_page ); ?> of <?php echo esc_html( $mlw_total_pages ); ?></span>
292
+ <a class="next-page button"
293
+ href="<?php echo esc_url_raw( "?page=mlw_quiz_results&&qsm_results_page=$result_page$url_query_string" ); ?>">></a>
294
  <?php
295
  }
296
  ?>
297
  </span>
298
+ <br class="clear">
299
+ </div>
300
+ <form action='' method="get">
301
+ <?php
302
+ if ( isset( $_GET['quiz_id'] ) ) {
303
+ ?>
304
+ <input type="hidden" name="quiz_id" value="<?php echo esc_attr( intval( $_GET['quiz_id'] ) ); ?>"/>
305
+ <?php
306
+ }
307
+ ?>
308
+ <input type="hidden" name="page" value="mlw_quiz_results">
309
+ <p class="search-box">
310
+ <label for="qsm_search_phrase"><?php esc_html_e( 'Search Results', 'quiz-master-next' ); ?></label>
311
+ <input type="search" id="qsm_search_phrase" name="qsm_search_phrase" value="">
312
+ <label for="qmn_order_by"><?php esc_html_e( 'Order By', 'quiz-master-next' ); ?></label>
313
+ <select id="qmn_order_by" name="qmn_order_by">
314
+ <option value="quiz_name"><?php esc_html_e( 'Quiz Name', 'quiz-master-next' ); ?></option>
315
+ <option value="name"><?php esc_html_e( 'User Name', 'quiz-master-next' ); ?></option>
316
+ <option value="point_score"><?php esc_html_e( 'Points', 'quiz-master-next' ); ?></option>
317
+ <option value="correct_score"><?php esc_html_e( 'Correct Percent', 'quiz-master-next' ); ?></option>
318
+ <option value="default"><?php esc_html_e( 'Default (Time)', 'quiz-master-next' ); ?></option>
319
+ </select>
320
+ <button class="button"><?php esc_html_e( 'Search Results', 'quiz-master-next' ); ?></button>
321
+ </p>
322
+ </form>
323
+ </div>
324
+
325
+ <form action="" method="post" name="bulk_delete_form">
326
+ <input type="hidden" name="bulk_delete" value="confirmation"/>
327
+ <input type="hidden" name="bulk_permanent_delete" id="bulk_permanent_delete" value="0"/>
328
+ <?php wp_nonce_field( 'bulk_delete', 'bulk_delete_nonce' ); ?>
329
+ <table class=widefat>
330
+ <thead>
331
+ <tr>
332
+ <th><input type="checkbox" id="qmn_check_all"/></th>
333
+ <th><?php esc_html_e( 'Quiz Name','quiz-master-next' ); ?></th>
334
+ <?php
335
+ $table_heading_displays = '';
336
+ $table_heading_displays .= '<th>' . esc_html__( 'Score', 'quiz-master-next' ) . '</th>';
337
+ $table_heading_displays .= '<th>' . esc_html__( 'Time To Complete', 'quiz-master-next' ) . '</th>';
338
+ $table_heading_displays .= '<th>' . esc_html__( 'Name', 'quiz-master-next' ) . '</th>';
339
+ $table_heading_displays .= '<th>' . esc_html__( 'Business', 'quiz-master-next' ) . '</th>';
340
+ $table_heading_displays .= '<th>' . esc_html__( 'Email', 'quiz-master-next' ) . '</th>';
341
+ $table_heading_displays .= '<th>' . esc_html__( 'Phone', 'quiz-master-next' ) . '</th>';
342
+ $table_heading_displays .= '<th>' . esc_html__( 'User', 'quiz-master-next' ) . '</th>';
343
+ $table_heading_displays .= '<th>' . esc_html__( 'Time Taken', 'quiz-master-next' ) . '</th>';
344
+ $table_heading_displays .= '<th>' . esc_html__( 'IP Address', 'quiz-master-next' ) . '</th>';
345
+
346
+ $table_heading_displays = apply_filters('mlw_qmn_admin_results_page_headings', $table_heading_displays);
347
+ echo $table_heading_displays;
348
+ ?>
349
+ </tr>
350
+ </thead>
351
+ <?php
352
  $quotes_list = "";
353
+ $display = "";
354
+ $alternate = "";
355
+ if ( $mlw_quiz_data ) {
356
+ foreach ( $mlw_quiz_data as $mlw_quiz_info ) {
357
+ $quiz_result_item = '';
358
+ $quiz_result_item_inner = '';
359
+ if ( $alternate ) {
360
+ $alternate = '';
361
+ } else {
362
+ $alternate = ' class="alternate"';
 
 
 
 
 
 
363
  }
364
+ $mlw_complete_time = '';
365
+ $mlw_qmn_results_array = @unserialize( $mlw_quiz_info->quiz_results );
366
+ $hidden_questions = isset( $mlw_qmn_results_array['hidden_questions'] ) ? count( $mlw_qmn_results_array['hidden_questions'] ) : 0;
367
+ if ( is_array( $mlw_qmn_results_array ) ) {
368
+ $mlw_complete_hours = floor( $mlw_qmn_results_array[0] / 3600 );
369
+ if ( $mlw_complete_hours > 0 ) {
370
+ $mlw_complete_time .= "$mlw_complete_hours hours ";
371
+ }
372
+ $mlw_complete_minutes = floor( ( $mlw_qmn_results_array[0] % 3600 ) / 60 );
373
+ if ( $mlw_complete_minutes > 0 ) {
374
+ $mlw_complete_time .= "$mlw_complete_minutes minutes ";
375
+ }
376
+ $mlw_complete_seconds = $mlw_qmn_results_array[0] % 60;
377
+ $mlw_complete_time .= "$mlw_complete_seconds seconds";
378
  }
379
+
380
+ $out_of_q = $mlw_quiz_info->total - $hidden_questions;
381
+ $quiz_result_item .= "<tr{$alternate}>";
382
+ $quiz_result_item .= "<td><input type='checkbox' class='qmn_delete_checkbox' name='delete_results[]' value='" . $mlw_quiz_info->result_id . "' /></td>";
383
+ $quiz_result_item .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_name . "</span><div class='row-actions'><span style='color:green;font-size:16px;'><a href='admin.php?page=qsm_quiz_result_details&&result_id=" . $mlw_quiz_info->result_id . "'>View</a> | <a style='color: red;' onclick=\"deleteResults('" . $mlw_quiz_info->result_id . "','" . esc_js( $mlw_quiz_info->quiz_name ) . "')\" href='#'>Delete</a></span></div></td>";
384
+ $form_type = isset( $mlw_quiz_info->form_type ) ? $mlw_quiz_info->form_type : 0;
385
+ if ( $form_type == 1 || $form_type == 2 ) {
386
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'>" . __( 'Not Graded', 'quiz-master-next' ) . "</span></td>";
387
+ } else {
388
+ if ( $mlw_quiz_info->quiz_system == 0 ) {
389
+ $quiz_result_item_inner .= "<td class='post-title column-title'><span style='font-size:16px;'>" . $mlw_quiz_info->correct . " out of " . $out_of_q . " or " . $mlw_quiz_info->correct_score . "%</span></td>";
390
+ }
391
+ if ( $mlw_quiz_info->quiz_system == 1 ) {
392
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->point_score . " Points</span></td>";
393
+ }
394
+ if ( $mlw_quiz_info->quiz_system == 3 ) {
395
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->correct . " out of " . $out_of_q . " or " . $mlw_quiz_info->correct_score . "%</span><br/><span style='font-size:16px;'>" . $mlw_quiz_info->point_score . " Points</span></td>";
396
+ }
397
+ }
398
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'>" . $mlw_complete_time . "</span></td>";
399
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->name . "</span></td>";
400
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->business . "</span></td>";
401
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->email . "</span></td>";
402
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->phone . "</span></td>";
403
+ if ( 0 == $mlw_quiz_info->user ) {
404
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'>Visitor</span></td>";
405
+ } else {
406
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'><a href='user-edit.php?user_id=" . $mlw_quiz_info->user . "'>" . $mlw_quiz_info->user . "</a></span></td>";
407
+ }
408
+ $date = date_i18n( get_option( 'date_format' ), strtotime( $mlw_quiz_info->time_taken ) );
409
+ $time = date( "h:i:s A", strtotime( $mlw_quiz_info->time_taken ) );
410
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'><abbr title='$date $time'>$date</abbr></span></td>";
411
+ $quiz_result_item_inner .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->user_ip . "</span></td>";
412
+ $quiz_result_item .= apply_filters('mlw_qmn_admin_results_page_result', $quiz_result_item_inner, $mlw_quiz_info);
413
+ $quiz_result_item .= "</tr>";
414
+ $quotes_list .= $quiz_result_item;
415
  }
416
+ } else {
417
+ $quotes_list .= "<tr{$alternate}><td colspan='12' style='text-align: center;'>" . __( 'No record found.', 'quiz-master-next' ) . "</td></tr>";
418
+ }
 
 
 
 
 
 
419
  $display .= "<tbody id=\"the-list\">{$quotes_list}</tbody>";
420
  echo $display;
421
  ?>
422
+ </table>
423
+ </form>
424
+
425
+ <div id="delete_dialog" title="Delete Results?" style="display:none;">
426
+ <h3><b><?php esc_html_e( 'Are you sure you want to delete these results?', 'quiz-master-next' ); ?></b></h3>
427
+ <form action='' method='post'>
428
+ <?php wp_nonce_field( 'delete_results', 'delete_results_nonce' ); ?>
429
+ <input type='hidden' id='result_id' name='result_id' value=''/>
430
+ <input type='hidden' id='delete_quiz_name' name='delete_quiz_name' value=''/>
431
+ <p class='submit'><input type='submit' class='button-primary'
432
+ value='<?php esc_html_e( 'Delete Results', 'quiz-master-next' ); ?>'/></p>
433
+ </form>
434
+ </div>
435
+ <?php
436
  }
437
+
438
  ?>
php/classes/class-qmn-quiz-creator.php CHANGED
@@ -457,6 +457,7 @@ class QMNQuizCreator {
457
  //Update quiz settings
458
  $update_quiz_settings = unserialize($mlw_qmn_duplicate_data->quiz_settings);
459
  $update_pages = unserialize($update_quiz_settings['pages']);
 
460
 
461
  if ( false != $results ) {
462
  $current_user = wp_get_current_user();
@@ -545,7 +546,19 @@ class QMNQuizCreator {
545
  $update_pages[$pages_key][$pages_k_q] = $wpdb->insert_id;
546
  }
547
  }
548
- }
 
 
 
 
 
 
 
 
 
 
 
 
549
  if ($question_results == false)
550
  {
551
  $mlwQuizMasterNext->alertManager->newAlert(sprintf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0020'), 'error');
@@ -553,6 +566,7 @@ class QMNQuizCreator {
553
  }
554
  }
555
  $update_quiz_settings['pages'] = serialize($update_pages);
 
556
  $wpdb->update(
557
  $wpdb->prefix . "mlw_quizzes",
558
  array(
457
  //Update quiz settings
458
  $update_quiz_settings = unserialize($mlw_qmn_duplicate_data->quiz_settings);
459
  $update_pages = unserialize($update_quiz_settings['pages']);
460
+ $logic_rules = isset( $update_quiz_settings['logic_rules'] ) ? unserialize(unserialize($update_quiz_settings['logic_rules'])) : array();
461
 
462
  if ( false != $results ) {
463
  $current_user = wp_get_current_user();
546
  $update_pages[$pages_key][$pages_k_q] = $wpdb->insert_id;
547
  }
548
  }
549
+ }
550
+ // Fixed Rules Questions with new question ids
551
+ if( $logic_rules ){
552
+ foreach ($logic_rules as $logic_key => $logic_value) {
553
+ foreach ($logic_value as $logic_cond_k => $logic_cond) {
554
+ foreach($logic_cond as $l_cond_k => $logic_val) {
555
+ if($logic_val['question'] == $mlw_question->question_id) {
556
+ $logic_rules[$logic_key][$logic_cond_k][$l_cond_k]['question'] = $wpdb->insert_id;
557
+ }
558
+ }
559
+ }
560
+ }
561
+ }
562
  if ($question_results == false)
563
  {
564
  $mlwQuizMasterNext->alertManager->newAlert(sprintf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0020'), 'error');
566
  }
567
  }
568
  $update_quiz_settings['pages'] = serialize($update_pages);
569
+ $update_quiz_settings['logic_rules'] = serialize(serialize($logic_rules));
570
  $wpdb->update(
571
  $wpdb->prefix . "mlw_quizzes",
572
  array(
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -556,7 +556,7 @@ class QMNQuizManager {
556
  wp_enqueue_style('qsm_model_css', plugins_url('../../css/qsm-admin.css', __FILE__));
557
  wp_enqueue_script('qsm_model_js', plugins_url('../../js/micromodal.min.js', __FILE__));
558
  wp_enqueue_script('qsm_quiz', plugins_url('../../js/qsm-quiz.js', __FILE__), array('wp-util', 'underscore', 'jquery', 'jquery-ui-tooltip', 'progress-bar'), $mlwQuizMasterNext->version);
559
- wp_localize_script('qsm_quiz', 'qmn_ajax_object', array('ajaxurl' => admin_url('admin-ajax.php'), 'enable_quick_result_mc' => isset($options->enable_quick_result_mc) ? $options->enable_quick_result_mc : '','enable_result_after_timer_end' => isset($options->enable_result_after_timer_end) ? $options->enable_result_after_timer_end : '', 'quick_result_correct_text' => $options->quick_result_correct_answer_text, 'quick_result_wrong_text' => $options->quick_result_wrong_answer_text, 'multicheckbox_limit_reach' => __('Limit of choice is reached.', 'quiz-master-next'), 'enable_quick_correct_answer_info' => isset($options->enable_quick_correct_answer_info) ? $options->enable_quick_correct_answer_info : 0 ));
560
  wp_enqueue_script( 'math_jax', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' );
561
  global $qmn_total_questions;
562
  $qmn_total_questions = 0;
@@ -780,7 +780,7 @@ class QMNQuizManager {
780
  ?>
781
  <span class="pages_count">
782
  <?php
783
- $text_c = $pages_count . ' out of ' .$total_pages_count;
784
  echo apply_filters('qsm_total_pages_count',$text_c,$pages_count,$total_pages_count);
785
  ?>
786
  </span>
@@ -861,7 +861,7 @@ class QMNQuizManager {
861
  global $mlw_qmn_section_count;
862
  $mlw_qmn_section_count += 1;
863
  $animation_effect = isset($qmn_quiz_options->quiz_animation) && $qmn_quiz_options->quiz_animation != '' ? ' animated ' . $qmn_quiz_options->quiz_animation : '';
864
- $section_display .= "<div class='quiz_section $animation_effect quiz_begin slide$mlw_qmn_section_count'>";
865
 
866
  $message_before = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_before, ENT_QUOTES));
867
  $message_before = apply_filters('mlw_qmn_template_variable_quiz_page', $message_before, $qmn_array_for_variables);
@@ -898,20 +898,27 @@ class QMNQuizManager {
898
  $question_id_list = '';
899
  $animation_effect = isset($qmn_quiz_options->quiz_animation) && $qmn_quiz_options->quiz_animation != '' ? ' animated ' . $qmn_quiz_options->quiz_animation : '';
900
  $enable_pagination_quiz = isset($qmn_quiz_options->enable_pagination_quiz) && $qmn_quiz_options->enable_pagination_quiz ? $qmn_quiz_options->enable_pagination_quiz : 0;
901
- $pagination_optoin = $qmn_quiz_options->pagination;
902
  if($enable_pagination_quiz && $pagination_optoin){
903
  $total_pages_count = count($qmn_quiz_questions);
904
  $total_pagination = ceil($total_pages_count / $pagination_optoin);
905
  }
906
  $pages_count = 1;
 
907
  foreach ($qmn_quiz_questions as $mlw_question) {
 
 
 
 
 
 
 
 
 
908
  $question_id_list .= $mlw_question->question_id . "Q";
909
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
910
- $style = '';
911
- if( $mlw_qmn_section_count != 1 && $pagination_optoin > 0 ){
912
- $style = "style='display: none;'";
913
- }
914
- $question_display .= "<div class='quiz_section {$animation_effect} question-section-id-{$mlw_question->question_id} slide{$mlw_qmn_section_count}' {$style}>";
915
 
916
  $question_display .= $mlwQuizMasterNext->pluginHelper->display_question($mlw_question->question_type_new, $mlw_question->question_id, $qmn_quiz_options);
917
 
@@ -930,11 +937,16 @@ class QMNQuizManager {
930
  $question_display .= "<br /><br />";
931
  }
932
  $question_display .= "</div>";
 
 
 
 
 
933
  $pages_count++;
934
  }
935
  if($enable_pagination_quiz){
936
  $question_display .= "<span class='pages_count' style='display: none;'>";
937
- $text_c = $pages_count . ' out of ' .$total_pagination;
938
  $question_display .= apply_filters('qsm_total_pages_count',$text_c,$pages_count,$total_pages_count);
939
  $question_display .= "</span>";
940
  }
@@ -958,7 +970,7 @@ class QMNQuizManager {
958
  $comment_display = '';
959
  if (0 == $qmn_quiz_options->comment_section) {
960
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
961
- $comment_display .= "<div class='quiz_section slide" . $mlw_qmn_section_count . "'>";
962
  $message_comments = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_comment, ENT_QUOTES));
963
  $message_comments = apply_filters('mlw_qmn_template_variable_quiz_page', $message_comments, $qmn_array_for_variables);
964
  $comment_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text'>$message_comments</label><br />";
@@ -989,7 +1001,7 @@ class QMNQuizManager {
989
  if( $pagination_optoin > 0 ){
990
  $style = "style='display: none;'";
991
  }
992
- $section_display .= "<div class='quiz_section slide$mlw_qmn_section_count quiz_end' {$style}>";
993
  if (!empty($qmn_quiz_options->message_end_template)) {
994
  $message_end = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_end_template, ENT_QUOTES));
995
  $message_end = apply_filters('mlw_qmn_template_variable_quiz_page', $message_end, $qmn_array_for_variables);
@@ -1442,6 +1454,7 @@ class QMNQuizManager {
1442
  }
1443
  $user_answer = $results_array["user_text"];
1444
  $correct_answer = $results_array["correct_text"];
 
1445
 
1446
  if( trim( $user_answer ) != '' ){
1447
  if( $user_answer != 'No Answer Provided' ){
@@ -1473,7 +1486,8 @@ class QMNQuizManager {
1473
  "points" => $answer_points,
1474
  "category" => $question['category'],
1475
  "question_type" => $question['question_type_new'],
1476
- "question_title" => isset( $question['settings']['question_title'] ) ? $question['settings']['question_title'] : ''
 
1477
  ), $options, $quiz_data);
1478
  }
1479
  break;
@@ -1529,6 +1543,7 @@ class QMNQuizManager {
1529
  }
1530
  $user_answer = $results_array["user_text"];
1531
  $correct_answer = $results_array["correct_text"];
 
1532
  if( trim( $user_answer ) != '' ){
1533
  if( $user_answer != 'No Answer Provided' ){
1534
  $attempted_question++;
@@ -1558,7 +1573,8 @@ class QMNQuizManager {
1558
  "points" => $answer_points,
1559
  "category" => $question['category'],
1560
  "question_type" => $question['question_type_new'],
1561
- "question_title" => isset( $question['settings']['question_title'] ) ? $question['settings']['question_title'] : ''
 
1562
  ), $options, $quiz_data);
1563
  }
1564
  break;
556
  wp_enqueue_style('qsm_model_css', plugins_url('../../css/qsm-admin.css', __FILE__));
557
  wp_enqueue_script('qsm_model_js', plugins_url('../../js/micromodal.min.js', __FILE__));
558
  wp_enqueue_script('qsm_quiz', plugins_url('../../js/qsm-quiz.js', __FILE__), array('wp-util', 'underscore', 'jquery', 'jquery-ui-tooltip', 'progress-bar'), $mlwQuizMasterNext->version);
559
+ wp_localize_script('qsm_quiz', 'qmn_ajax_object', array('ajaxurl' => admin_url('admin-ajax.php'), 'enable_quick_result_mc' => isset($options->enable_quick_result_mc) ? $options->enable_quick_result_mc : '','enable_result_after_timer_end' => isset($options->enable_result_after_timer_end) ? $options->enable_result_after_timer_end : '', 'quick_result_correct_text' => $options->quick_result_correct_answer_text, 'quick_result_wrong_text' => $options->quick_result_wrong_answer_text, 'multicheckbox_limit_reach' => __('Limit of choice is reached.', 'quiz-master-next'), 'enable_quick_correct_answer_info' => isset($options->enable_quick_correct_answer_info) ? $options->enable_quick_correct_answer_info : 0, 'out_of_text' => __(' out of ', 'quiz-master-next') ));
560
  wp_enqueue_script( 'math_jax', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' );
561
  global $qmn_total_questions;
562
  $qmn_total_questions = 0;
780
  ?>
781
  <span class="pages_count">
782
  <?php
783
+ $text_c = $pages_count . __(' out of ', 'quiz-master-next') .$total_pages_count;
784
  echo apply_filters('qsm_total_pages_count',$text_c,$pages_count,$total_pages_count);
785
  ?>
786
  </span>
861
  global $mlw_qmn_section_count;
862
  $mlw_qmn_section_count += 1;
863
  $animation_effect = isset($qmn_quiz_options->quiz_animation) && $qmn_quiz_options->quiz_animation != '' ? ' animated ' . $qmn_quiz_options->quiz_animation : '';
864
+ $section_display .= "<div class='qsm-auto-page-row quiz_section $animation_effect quiz_begin'>";
865
 
866
  $message_before = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_before, ENT_QUOTES));
867
  $message_before = apply_filters('mlw_qmn_template_variable_quiz_page', $message_before, $qmn_array_for_variables);
898
  $question_id_list = '';
899
  $animation_effect = isset($qmn_quiz_options->quiz_animation) && $qmn_quiz_options->quiz_animation != '' ? ' animated ' . $qmn_quiz_options->quiz_animation : '';
900
  $enable_pagination_quiz = isset($qmn_quiz_options->enable_pagination_quiz) && $qmn_quiz_options->enable_pagination_quiz ? $qmn_quiz_options->enable_pagination_quiz : 0;
901
+ $pagination_optoin = $qmn_quiz_options->pagination;
902
  if($enable_pagination_quiz && $pagination_optoin){
903
  $total_pages_count = count($qmn_quiz_questions);
904
  $total_pagination = ceil($total_pages_count / $pagination_optoin);
905
  }
906
  $pages_count = 1;
907
+ $current_page_number = 1;
908
  foreach ($qmn_quiz_questions as $mlw_question) {
909
+ if( $pagination_optoin == 1 ){
910
+ $question_display .='<div class="qsm-auto-page-row qsm-apc-' . $current_page_number . '" style="display: none;">';
911
+ $current_page_number++;
912
+ }else{
913
+ if ($pages_count % $pagination_optoin == 1 || $pages_count == 1) { // beginning of the row or first.
914
+ $question_display .='<div class="qsm-auto-page-row qsm-apc-' . $current_page_number . '" style="display: none;">';
915
+ $current_page_number++;
916
+ }
917
+ }
918
  $question_id_list .= $mlw_question->question_id . "Q";
919
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
920
+
921
+ $question_display .= "<div class='quiz_section {$animation_effect} question-section-id-{$mlw_question->question_id} slide{$mlw_qmn_section_count}'>";
 
 
 
922
 
923
  $question_display .= $mlwQuizMasterNext->pluginHelper->display_question($mlw_question->question_type_new, $mlw_question->question_id, $qmn_quiz_options);
924
 
937
  $question_display .= "<br /><br />";
938
  }
939
  $question_display .= "</div>";
940
+ if( $pagination_optoin == 1 ){
941
+ $question_display .= '</div><!-- .qsm-auto-page-row -->';
942
+ }else if ($pages_count % $pagination_optoin == 0 || $pages_count == count($qmn_quiz_questions)) { // end of the row or last
943
+ $question_display .= '</div><!-- .qsm-auto-page-row -->';
944
+ }
945
  $pages_count++;
946
  }
947
  if($enable_pagination_quiz){
948
  $question_display .= "<span class='pages_count' style='display: none;'>";
949
+ $text_c = $current_page_number . __(' out of ', 'quiz-master-next') .$total_pagination;
950
  $question_display .= apply_filters('qsm_total_pages_count',$text_c,$pages_count,$total_pages_count);
951
  $question_display .= "</span>";
952
  }
970
  $comment_display = '';
971
  if (0 == $qmn_quiz_options->comment_section) {
972
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
973
+ $comment_display .= "<div class='quiz_section quiz_end qsm-auto-page-row qsm-quiz-comment-section slide" . $mlw_qmn_section_count . "' style='display: none;'>";
974
  $message_comments = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_comment, ENT_QUOTES));
975
  $message_comments = apply_filters('mlw_qmn_template_variable_quiz_page', $message_comments, $qmn_array_for_variables);
976
  $comment_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text'>$message_comments</label><br />";
1001
  if( $pagination_optoin > 0 ){
1002
  $style = "style='display: none;'";
1003
  }
1004
+ $section_display .= "<div class='qsm-auto-page-row quiz_section quiz_end' {$style}>";
1005
  if (!empty($qmn_quiz_options->message_end_template)) {
1006
  $message_end = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_end_template, ENT_QUOTES));
1007
  $message_end = apply_filters('mlw_qmn_template_variable_quiz_page', $message_end, $qmn_array_for_variables);
1454
  }
1455
  $user_answer = $results_array["user_text"];
1456
  $correct_answer = $results_array["correct_text"];
1457
+ $user_compare_text = isset( $results_array["user_compare_text"] ) ? $results_array["user_compare_text"] : '';
1458
 
1459
  if( trim( $user_answer ) != '' ){
1460
  if( $user_answer != 'No Answer Provided' ){
1486
  "points" => $answer_points,
1487
  "category" => $question['category'],
1488
  "question_type" => $question['question_type_new'],
1489
+ "question_title" => isset( $question['settings']['question_title'] ) ? $question['settings']['question_title'] : '',
1490
+ "user_compare_text" => $user_compare_text
1491
  ), $options, $quiz_data);
1492
  }
1493
  break;
1543
  }
1544
  $user_answer = $results_array["user_text"];
1545
  $correct_answer = $results_array["correct_text"];
1546
+ $user_compare_text = isset( $results_array["user_compare_text"] ) ? $results_array["user_compare_text"] : '';
1547
  if( trim( $user_answer ) != '' ){
1548
  if( $user_answer != 'No Answer Provided' ){
1549
  $attempted_question++;
1573
  "points" => $answer_points,
1574
  "category" => $question['category'],
1575
  "question_type" => $question['question_type_new'],
1576
+ "question_title" => isset( $question['settings']['question_title'] ) ? $question['settings']['question_title'] : '',
1577
+ "user_compare_text" => $user_compare_text
1578
  ), $options, $quiz_data);
1579
  }
1580
  break;
php/classes/class-qsm-emails.php CHANGED
@@ -166,6 +166,7 @@ class QSM_Emails {
166
  $content = str_replace( "\n", '<br>', $content );
167
  $content = str_replace( '<br/>', '<br>', $content );
168
  $content = str_replace( '<br />', '<br>', $content );
 
169
 
170
  // Prepares our from name and email.
171
  $settings = (array) get_option( 'qmn-settings' );
166
  $content = str_replace( "\n", '<br>', $content );
167
  $content = str_replace( '<br/>', '<br>', $content );
168
  $content = str_replace( '<br />', '<br>', $content );
169
+ $content = html_entity_decode( $content );
170
 
171
  // Prepares our from name and email.
172
  $settings = (array) get_option( 'qmn-settings' );
php/classes/class-qsm-fields.php CHANGED
@@ -79,12 +79,28 @@ class QSM_Fields {
79
  <form action="" method="post">
80
  <?php wp_nonce_field( 'save_settings','save_settings_nonce' ); ?>
81
  <button class="button-primary"><?php _e('Save Changes', 'quiz-master-next'); ?></button>
82
- <table class="form-table" style="width: 100%;">
83
  <?php
84
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  // Cycles through each field
86
- foreach ( $fields as $field ) {
87
-
88
  // Generate the field
89
  QSM_Fields::generate_field( $field, $settings[ $field["id"] ] );
90
  }
79
  <form action="" method="post">
80
  <?php wp_nonce_field( 'save_settings','save_settings_nonce' ); ?>
81
  <button class="button-primary"><?php _e('Save Changes', 'quiz-master-next'); ?></button>
82
+ <table class="form-table" style="width: 100%;">
83
  <?php
84
+ $array_before_legacy = array();
85
+ foreach ( $fields as $key => $field ) {
86
+ if( isset( $field['legacy_option'] ) && $field['legacy_option'] == 0 ){
87
+ $array_before_legacy[] = $field;
88
+ unset( $fields[ $key ] );
89
+ }
90
+ }
91
+ $key = array_search('legacy_options', array_column($fields, 'id'));
92
+ if( isset( $fields[ $key ] ) && !empty( $array_before_legacy ) ){
93
+ $i = 1;
94
+ $array_before_legacy = array_reverse($array_before_legacy);
95
+ foreach ( $array_before_legacy as $bl_value ){
96
+ $fields = array_slice($fields, 0, $key, true) +
97
+ array( 'lo_' . $i => $bl_value ) +
98
+ array_slice($fields, $key, count($fields) - $key, true);
99
+ $i++;
100
+ }
101
+ }
102
  // Cycles through each field
103
+ foreach ( $fields as $field ) {
 
104
  // Generate the field
105
  QSM_Fields::generate_field( $field, $settings[ $field["id"] ] );
106
  }
php/question-types.php CHANGED
@@ -124,7 +124,7 @@ function qmn_multiple_choice_display($id, $question, $answers)
124
  }else{
125
  $question_display .= "<div class='qmn_mc_answer_wrap' id='question".$id."-".str_replace(" ","-",esc_attr($answer[0]))."'>";
126
  }
127
- $question_display .= "<input type='radio' class='qmn_quiz_radio' name='question".$id."' id='question".$id."_".$mlw_answer_total."' value='". trim( htmlentities(esc_attr($answer[0])) ) ."' /> <label for='question".$id."_".$mlw_answer_total."'>". trim( htmlspecialchars_decode($answer[0], ENT_QUOTES) ) ."</label>";
128
  $question_display .= "</div>";
129
  }
130
  }
@@ -457,7 +457,8 @@ function qmn_drop_down_review($id, $question, $answers)
457
  }
458
  foreach($answers as $answer)
459
  {
460
- if ( $mlw_user_answer == esc_attr( $answer[0] ) )
 
461
  {
462
  $return_array["points"] = $answer[1];
463
  $return_array["user_text"] = strval(htmlspecialchars_decode($answer[0], ENT_QUOTES));
@@ -622,7 +623,8 @@ function qmn_multiple_response_review($id, $question, $answers)
622
  'points' => 0,
623
  'correct' => 'incorrect',
624
  'user_text' => '',
625
- 'correct_text' => ''
 
626
  );
627
  $user_correct = 0;
628
  $total_correct = 0;
@@ -635,6 +637,7 @@ function qmn_multiple_response_review($id, $question, $answers)
635
  {
636
  $return_array["points"] += $answer[1];
637
  $return_array["user_text"] .= sanitize_textarea_field( strval(htmlspecialchars_decode($answer[0], ENT_QUOTES)) ) .".";
 
638
  if ($answer[2] == 1)
639
  {
640
  $user_correct += 1;
@@ -1031,7 +1034,8 @@ function qmn_horizontal_multiple_response_review($id, $question, $answers)
1031
  'points' => 0,
1032
  'correct' => 'incorrect',
1033
  'user_text' => '',
1034
- 'correct_text' => ''
 
1035
  );
1036
  $user_correct = 0;
1037
  $total_correct = 0;
@@ -1044,6 +1048,7 @@ function qmn_horizontal_multiple_response_review($id, $question, $answers)
1044
  {
1045
  $return_array["points"] += $answer[1];
1046
  $return_array["user_text"] .= strval(htmlspecialchars_decode($answer[0], ENT_QUOTES)).".";
 
1047
  if ($answer[2] == 1)
1048
  {
1049
  $user_correct += 1;
@@ -1217,7 +1222,7 @@ function qmn_polar_display($id, $question, $answers) {
1217
  $font_weight_lc = 'left-polar-title';
1218
  $font_weight_rc = 'right-polar-title';
1219
  }
1220
- $total_answer = count($answers);
1221
  ?>
1222
  <script type="text/javascript">
1223
  (function($) {
@@ -1232,7 +1237,7 @@ function qmn_polar_display($id, $question, $answers) {
1232
  max: <?php echo $answers[1][1]; ?>,
1233
  <?php } ?>
1234
  step: 1,
1235
- value: <?php echo ceil($check_point/2); ?>,
1236
  change: function( event, ui ) {
1237
  $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.qmn_polar').val(ui.value);
1238
  if(ui.value == <?php echo $answers[0][1]; ?>){
@@ -1255,7 +1260,7 @@ function qmn_polar_display($id, $question, $answers) {
1255
  create: function( event, ui ) {
1256
  $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.left-polar-title').css('font-weight','400');
1257
  $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.right-polar-title').css('font-weight','400');
1258
- $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.qmn_polar').val(<?php echo ceil($check_point/2); ?>);
1259
  }
1260
  });
1261
  var maxHeight = Math.max.apply(null, $(".question-section-id-<?php echo $id; ?> .question-type-polar-s > div").map(function (){
124
  }else{
125
  $question_display .= "<div class='qmn_mc_answer_wrap' id='question".$id."-".str_replace(" ","-",esc_attr($answer[0]))."'>";
126
  }
127
+ $question_display .= "<input type='radio' class='qmn_quiz_radio' name='question".$id."' id='question".$id."_".$mlw_answer_total."' value='". trim( htmlspecialchars_decode($answer[0], ENT_QUOTES) ) ."' /> <label for='question".$id."_".$mlw_answer_total."'>". trim( htmlspecialchars_decode($answer[0], ENT_QUOTES) ) ."</label>";
128
  $question_display .= "</div>";
129
  }
130
  }
457
  }
458
  foreach($answers as $answer)
459
  {
460
+ $answers_loop = trim( stripslashes( htmlspecialchars_decode($answer[0], ENT_QUOTES) ) );
461
+ if ( $mlw_user_answer == $answers_loop )
462
  {
463
  $return_array["points"] = $answer[1];
464
  $return_array["user_text"] = strval(htmlspecialchars_decode($answer[0], ENT_QUOTES));
623
  'points' => 0,
624
  'correct' => 'incorrect',
625
  'user_text' => '',
626
+ 'correct_text' => '',
627
+ 'user_compare_text' => ''
628
  );
629
  $user_correct = 0;
630
  $total_correct = 0;
637
  {
638
  $return_array["points"] += $answer[1];
639
  $return_array["user_text"] .= sanitize_textarea_field( strval(htmlspecialchars_decode($answer[0], ENT_QUOTES)) ) .".";
640
+ $return_array["user_compare_text"] .= sanitize_textarea_field( strval(htmlspecialchars_decode($answer[0], ENT_QUOTES)) ) ."=====";
641
  if ($answer[2] == 1)
642
  {
643
  $user_correct += 1;
1034
  'points' => 0,
1035
  'correct' => 'incorrect',
1036
  'user_text' => '',
1037
+ 'correct_text' => '',
1038
+ 'user_compare_text' => ''
1039
  );
1040
  $user_correct = 0;
1041
  $total_correct = 0;
1048
  {
1049
  $return_array["points"] += $answer[1];
1050
  $return_array["user_text"] .= strval(htmlspecialchars_decode($answer[0], ENT_QUOTES)).".";
1051
+ $return_array["user_compare_text"] .= sanitize_textarea_field( strval(htmlspecialchars_decode($answer[0], ENT_QUOTES)) ) ."=====";
1052
  if ($answer[2] == 1)
1053
  {
1054
  $user_correct += 1;
1222
  $font_weight_lc = 'left-polar-title';
1223
  $font_weight_rc = 'right-polar-title';
1224
  }
1225
+ $total_answer = count($answers);
1226
  ?>
1227
  <script type="text/javascript">
1228
  (function($) {
1237
  max: <?php echo $answers[1][1]; ?>,
1238
  <?php } ?>
1239
  step: 1,
1240
+ value: <?php echo $check_point/2; ?>,
1241
  change: function( event, ui ) {
1242
  $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.qmn_polar').val(ui.value);
1243
  if(ui.value == <?php echo $answers[0][1]; ?>){
1260
  create: function( event, ui ) {
1261
  $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.left-polar-title').css('font-weight','400');
1262
  $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.right-polar-title').css('font-weight','400');
1263
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.qmn_polar').val(<?php echo $check_point/2; ?>);
1264
  }
1265
  });
1266
  var maxHeight = Math.max.apply(null, $(".question-section-id-<?php echo $id; ?> .question-type-polar-s > div").map(function (){
php/template-variables.php CHANGED
@@ -431,7 +431,7 @@ function mlw_qmn_variable_question_answers( $content, $mlw_quiz_array ) {
431
 
432
  // Cycles through each answer in the responses.
433
  $total_question_cnt = count( $mlw_quiz_array['question_answers_array'] );
434
- $qsm_question_cnt = 1;
435
  foreach ( $mlw_quiz_array['question_answers_array'] as $answer ) {
436
  if(in_array($answer['id'],$hidden_questions)) {
437
  continue;
@@ -859,16 +859,17 @@ function qsm_questions_answers_shortcode_to_text($mlw_quiz_array, $qmn_question_
859
  if (isset($answer['id']) && isset($questions[$answer['id']]) && !empty($questions[$answer['id']])) {
860
  $total_answers = isset($questions[$answer['id']]['answers']) ? $questions[$answer['id']]['answers'] : array();
861
  if ($total_answers) {
862
- if (isset($answer['question_type']) && in_array($answer['question_type'], $show_two_option_questions)) {
863
  $do_show_wrong = true;
864
  foreach ($total_answers as $single_answer) {
 
865
  if ($form_type == 0 && ( $quiz_system == 0 || $quiz_system == 3 )) {
866
- if (isset($single_answer[2]) && $single_answer[2] == 1 && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0]) {
867
- $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
868
  $do_show_wrong = false;
869
  }
870
  } else {
871
- if (isset($single_answer[2]) && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0]) {
872
  $question_with_answer_text .= '<span class="qsm-text-correct-option">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
873
  $do_show_wrong = false;
874
  }
@@ -898,15 +899,26 @@ function qsm_questions_answers_shortcode_to_text($mlw_quiz_array, $qmn_question_
898
  }
899
  } else {
900
  if ($form_type == 0 && ( $quiz_system == 0 || $quiz_system == 3 )) {
901
- if (isset($answer['question_type']) && ( $answer['question_type'] == 4 || $answer['question_type'] == 10 )) {
902
  $user_selected_answer = htmlspecialchars_decode($answer[1], ENT_QUOTES);
 
903
  foreach ($total_answers as $single_answer) {
904
- $current_answer_text = $single_answer[0];
905
- if (isset($single_answer[2]) && $single_answer[2] == 1 && preg_match("/\b$current_answer_text\b/", $user_selected_answer)) {
 
 
 
 
 
 
 
 
 
 
906
  $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
907
  } else if (isset($single_answer[2]) && $single_answer[2] == 1) {
908
  $question_with_answer_text .= '<span class="qsm-text-correct-option">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
909
- } else if (preg_match("/\b$current_answer_text\b/", $user_selected_answer) && $single_answer[2] !== 1) {
910
  $question_with_answer_text .= '<span class="qsm-text-wrong-option">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
911
  } else {
912
  $question_with_answer_text .= '<span class="qsm-text-simple-option">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
431
 
432
  // Cycles through each answer in the responses.
433
  $total_question_cnt = count( $mlw_quiz_array['question_answers_array'] );
434
+ $qsm_question_cnt = 1;
435
  foreach ( $mlw_quiz_array['question_answers_array'] as $answer ) {
436
  if(in_array($answer['id'],$hidden_questions)) {
437
  continue;
859
  if (isset($answer['id']) && isset($questions[$answer['id']]) && !empty($questions[$answer['id']])) {
860
  $total_answers = isset($questions[$answer['id']]['answers']) ? $questions[$answer['id']]['answers'] : array();
861
  if ($total_answers) {
862
+ if (isset($answer['question_type']) && in_array($answer['question_type'], $show_two_option_questions)) {
863
  $do_show_wrong = true;
864
  foreach ($total_answers as $single_answer) {
865
+ $current_answer_zero = trim( htmlspecialchars_decode($single_answer[0], ENT_QUOTES) );
866
  if ($form_type == 0 && ( $quiz_system == 0 || $quiz_system == 3 )) {
867
+ if (isset($single_answer[2]) && $single_answer[2] == 1 && strcasecmp( htmlspecialchars_decode($answer[1], ENT_QUOTES), $current_answer_zero ) == 0 ) {
868
+ $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">' . htmlspecialchars_decode($answer[1], ENT_QUOTES) . '</span>';
869
  $do_show_wrong = false;
870
  }
871
  } else {
872
+ if ( isset($single_answer[2]) && strcasecmp( htmlspecialchars_decode($answer[1], ENT_QUOTES), $current_answer_zero ) == 0 ) {
873
  $question_with_answer_text .= '<span class="qsm-text-correct-option">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
874
  $do_show_wrong = false;
875
  }
899
  }
900
  } else {
901
  if ($form_type == 0 && ( $quiz_system == 0 || $quiz_system == 3 )) {
902
+ if (isset($answer['question_type']) && ( $answer['question_type'] == 4 || $answer['question_type'] == 10 )) {
903
  $user_selected_answer = htmlspecialchars_decode($answer[1], ENT_QUOTES);
904
+ $new_array_user_answer = isset( $answer['user_compare_text'] ) ? explode('=====', $answer['user_compare_text']) : array();
905
  foreach ($total_answers as $single_answer) {
906
+ $current_answer_text = trim( stripslashes( htmlspecialchars_decode($single_answer[0], ENT_QUOTES) ) );
907
+ $is_answer_correct = false;
908
+ if( $new_array_user_answer ){
909
+ foreach( $new_array_user_answer as $new_array_value ){
910
+ $new_array_value = trim( stripslashes( htmlspecialchars_decode($new_array_value, ENT_QUOTES) ) );
911
+ if( $current_answer_text == $new_array_value ){
912
+ $is_answer_correct = true;
913
+ break;
914
+ }
915
+ }
916
+ }
917
+ if (isset($single_answer[2]) && $single_answer[2] == 1 && $is_answer_correct ) {
918
  $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
919
  } else if (isset($single_answer[2]) && $single_answer[2] == 1) {
920
  $question_with_answer_text .= '<span class="qsm-text-correct-option">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
921
+ } else if ( $is_answer_correct && $single_answer[2] !== 1) {
922
  $question_with_answer_text .= '<span class="qsm-text-wrong-option">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
923
  } else {
924
  $question_with_answer_text .= '<span class="qsm-text-simple-option">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
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.4
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -135,6 +135,16 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
135
 
136
  == Changelog ==
137
 
 
 
 
 
 
 
 
 
 
 
138
  = 7.1.4 (October 06, 2020) =
139
  * Bug: Fixed point score issues when answer type is Rich Answer with HTML tags.
140
  * Enhancement: Added JS hook for quiz to enhance JS event.
4
  Requires at least: 4.9
5
  Tested up to: 5.5.1
6
  Requires PHP: 5.4
7
+ Stable tag: 7.1.5
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
135
 
136
  == Changelog ==
137
 
138
+ = 7.1.5 (October 26, 2020) =
139
+ * Bug: Fixed logic addon rules not being copied while duplicating quiz.
140
+ * Bug: Fixed vietnamese accents and special characters not being recognized in quiz result page.
141
+ * Bug: Fixed apostrophe and double quotes not working with Dropdown question type.
142
+ * Bug: Fixed apostrophe being marked as incorrect for %USER_ANSWERS_DEFAULT% template variable.
143
+ * Bug: Fixed question's answers being case sensitive while using %USER_ANSWERS_DEFAULT% template variable.
144
+ * Bug: Fixed HTML codes appearing in email while using rich answer type.
145
+ * Bug: Fixed Polar question type scoring being rounded off to integers incorrectly.
146
+ * Bug: Fixed timer not appearing while using retaking a quiz on result page.
147
+
148
  = 7.1.4 (October 06, 2020) =
149
  * Bug: Fixed point score issues when answer type is Rich Answer with HTML tags.
150
  * Enhancement: Added JS hook for quiz to enhance JS event.