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

Version Description

(April 29, 2021) = * Bug: Fixed the issue with Facebook share. * Bug: Fixed issue with timer starting on intro page. * Bug: Fixed pagination issue with multiple quizzes on same page. * Bug: Fixed issue with tiny-mce causing conflict with other plugins. * Bug: Fixed the issue of logic rules not being copied when duplicating quiz. * Feature: Added rich textbox for correct answer information. * Feature: Added additional condition for Email template for different answers.

Download this release

Release Info

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

Code changes from version 7.1.15 to 7.1.16

css/qsm-admin-question.css CHANGED
@@ -673,7 +673,7 @@ a.import-button.button.disable_import::before {
673
  text-align: center;
674
  margin: 0 0 20px 0;
675
  }
676
-
677
  .qsm-show-question-desc-box{
678
  display: inline-block;
679
  margin-bottom: 10px !important;
@@ -707,10 +707,11 @@ a#qsm-category-add-toggle {
707
  #qsm-question-id{
708
  float: right;
709
  }
710
-
711
  .qsm-show-question-desc-box{
712
  background: #fff;
713
  }
 
714
  .qsm-show-question-desc-box span.dashicons{
715
  line-height: 29px;
716
  }
673
  text-align: center;
674
  margin: 0 0 20px 0;
675
  }
676
+ .qsm-show-correct-info-box,
677
  .qsm-show-question-desc-box{
678
  display: inline-block;
679
  margin-bottom: 10px !important;
707
  #qsm-question-id{
708
  float: right;
709
  }
710
+ .qsm-show-correct-info-box,
711
  .qsm-show-question-desc-box{
712
  background: #fff;
713
  }
714
+ .qsm-show-correct-info-box span.dashicons,
715
  .qsm-show-question-desc-box span.dashicons{
716
  line-height: 29px;
717
  }
js/qsm-admin-emails.js CHANGED
@@ -100,6 +100,7 @@ var QSMAdminEmails;
100
  };
101
  wp.editor.initialize( 'email-template-' + QSMAdminEmails.total, settings );
102
  }
 
103
  },
104
  newEmail: function() {
105
  var conditions = [{
100
  };
101
  wp.editor.initialize( 'email-template-' + QSMAdminEmails.total, settings );
102
  }
103
+ jQuery(document).trigger('qsm_after_add_email_block', [conditions, to, subject, content, replyTo]);
104
  },
105
  newEmail: function() {
106
  var conditions = [{
js/qsm-admin-question.js CHANGED
@@ -357,100 +357,93 @@ var import_button;
357
  );
358
  },
359
  saveQuestion: function( questionID, CurrentElement ) {
360
- QSMAdmin.displayAlert( 'Saving question...', 'info' );
361
- var model = QSMQuestion.questions.get( questionID );
362
- var hint = $( '#hint' ).val();
363
- var name = wp.editor.getContent( 'question-text' );
364
- //Save new question title
365
- var question_title = $('#question_title').val();
366
- if(name == '' && question_title == ''){
367
- alert('Enter Question title or description');
368
- return false;
369
- }
370
- var advanced_option = {};
371
- var answerInfo = $( '#correct_answer_info' ).val();
372
- var type = $( "#question_type" ).val();
373
- var comments = $( "#comments" ).val();
374
- advanced_option['required'] = $(".questionElements input[name='required']").is(":checked") ? 0 : 1;
375
- var category = $( ".category-radio:checked" ).val();
376
- var autofill = $( "#hide_autofill" ).val();
377
- var limit_text = $( "#limit_text" ).val();
378
- var limit_multiple_response = $( "#limit_multiple_response" ).val();
379
- var file_upload_limit = $( "#file_upload_limit" ).val();
380
- var type_arr = [];
381
- $.each($("input[name='file_upload_type[]']:checked"), function(){
382
- type_arr.push($(this).val());
383
- });
384
- if ( 'new_category' == category ) {
385
- category = $( '#new_category' ).val();
386
  }
387
- if ( ! category ) {
388
  category = '';
389
  }
390
- var answerType = $('#change-answer-editor').val();
391
  var answers = [];
392
- var $answers = jQuery( '.answers-single');
393
- _.each( $answers, function( answer ) {
394
- var $answer = jQuery( answer );
395
- var answer = '';
396
- if(answerType == 'rich'){
397
- var ta_id = $answer.find('textarea').attr('id')
398
- answer = wp.editor.getContent( ta_id );
399
- }else{
400
- answer = $answer.find( '.answer-text' ).val().trim();
401
- answer = $.QSMSanitize( answer );
402
- }
403
-
404
- var points = $answer.find( '.answer-points' ).val();
405
  var correct = 0;
406
- if ( $answer.find( '.answer-correct' ).prop( 'checked' ) ) {
407
  correct = 1;
408
  }
409
- answers.push( [ answer, points, correct ] );
410
- });
411
- $('.questionElements .advanced-content > .qsm-row ').each(function(){
412
- if( $(this).find('input[type="text"]').length > 0){
413
- var element_id = $(this).find('input[type="text"]').attr('id');
414
- advanced_option[element_id] = $(this).find('input[type="text"]').val();
415
- } else if( $(this).find('input[type="number"]').length > 0 ){
416
- var element_id = $(this).find('input[type="number"]').attr('id');
417
- advanced_option[element_id] = $(this).find('input[type="number"]').val();
418
- }else if( $(this).find('select').length > 0 ){
419
- var element_id = $(this).find('select').attr('id');
420
- advanced_option[element_id] = $(this).find('select').val();
421
- } else if( $(this).find('input[type="checkbox"]').length > 0 ){
422
- var element_id = $(this).find('input[type="checkbox"]').attr('name');
423
- var multi_value = $(this).find('input[type="checkbox"]:checked').map(function() { return this.value;}).get().join(',');
424
- element_id = element_id.replace('[]','');
425
- advanced_option[element_id] = multi_value;
426
- }
427
- });
428
- model.save(
429
- {
430
- type: type,
431
- name: name,
432
- question_title: question_title,
433
- answerInfo: answerInfo,
434
- comments: comments,
435
- hint: hint,
436
- category: category,
437
- //required: required,
438
- answers: answers,
439
- answerEditor: answerType,
440
- //autofill: autofill,
441
- //limit_text: limit_text,
442
- //limit_multiple_response: limit_multiple_response,
443
- //file_upload_limit: file_upload_limit,
444
- //file_upload_type: type_arr.join(","),
445
- other_settings: advanced_option
446
- },
447
- {
448
- headers: { 'X-WP-Nonce': qsmQuestionSettings.nonce },
449
- success: QSMQuestion.saveSuccess,
450
- error: QSMAdmin.displayError,
451
- type: 'POST'
452
- }
453
- );
454
  //CurrentElement.parents('.questionElements').slideUp('slow');
455
  },
456
  saveSuccess: function( model ) {
@@ -488,149 +481,153 @@ var import_button;
488
  tinyMCE.get( textarea_id ).setContent( anser );
489
  }
490
  },
491
- openEditPopup: function( questionID, CurrentElement ) {
492
- if( CurrentElement.parents('.question').next('.questionElements').length > 0 ){
493
- if( CurrentElement.parents('.question').next('.questionElements').is(":visible") ){
494
- CurrentElement.parents('.question').next('.questionElements').slideUp('slow');
495
- $( '.questions' ).sortable('enable');+
496
- $( '.page' ).sortable('enable');
497
- }else{
498
- CurrentElement.parents('.question').next('.questionElements').slideDown('slow');
499
- }
500
- return;
501
- }else{
502
- $('.questions .questionElements').slideDown('slow');
503
- $('.questions .questionElements').remove();
504
- }
505
- //Copy and remove popup div
506
- var questionElements = $('#modal-1-content').html();
507
- $('#modal-1-content').children().remove();
508
- CurrentElement.parents('.question').after( "<div style='display: none;' class='questionElements'>"+ questionElements +"</div>" );
509
-
510
- //Show question id on question edit screen
511
- $( '#qsm-question-id' ).text( 'ID: ' + questionID );
512
  QSMQuestion.prepareCategories();
513
  QSMQuestion.processCategories();
514
- var question = QSMQuestion.questions.get( questionID );
515
- var questionText = QSMQuestion.prepareQuestionText( question.get( 'name' ) );
516
- $( '#edit_question_id' ).val( questionID );
517
- var question_editor = ''
518
- if(qsmQuestionSettings.qsm_user_ve === 'true'){
519
- var question_content = 'question-text';
520
- wp.editor.remove( question_content );
521
- QSMQuestion.prepareEditor();
522
- question_editor = tinyMCE.get( 'question-text' );
523
- }
524
- if( questionText != '' && questionText != null ){
525
- jQuery('.qsm-show-question-desc-box').hide();
526
- jQuery('.qsm-show-question-desc-box').next('.qsm-row').show();
527
- }
528
  if ($('#wp-question-text-wrap').hasClass('html-active')) {
529
- jQuery( "#question-text" ).val( questionText );
530
- } else if ( question_editor ) {
531
-
532
- tinyMCE.get( 'question-text' ).setContent( questionText );
533
  } else {
534
- jQuery( "#question-text" ).val( questionText );
535
  }
536
-
537
- $( '#answers' ).empty();
538
- var answers = question.get( 'answers' );
539
- var answerEditor = question.get( 'answerEditor' );
540
- if( answerEditor === null || typeof answerEditor === "undefined" ){
541
- answerEditor = 'text';
542
- }
543
- //Check autofill setting
544
- var disableAutofill = question.get( 'autofill' );
545
- if( disableAutofill === null || typeof disableAutofill === "undefined" ){
546
- disableAutofill = '0';
547
- }
548
- //Get text limit value
549
- var get_limit_text = question.get( 'limit_text' );
550
- if( get_limit_text === null || typeof get_limit_text === "undefined" ){
551
- get_limit_text = '0';
552
- }
553
- //Get limit multiple response value
554
- var get_limit_mr = question.get( 'limit_multiple_response' );
555
- if( get_limit_mr === null || typeof get_limit_mr === "undefined" ){
556
- get_limit_mr = '0';
557
- }
558
- //Get file upload limit
559
- var get_limit_fu = question.get( 'file_upload_limit' );
560
- if( get_limit_fu === null || typeof get_limit_fu === "undefined" ){
561
- get_limit_fu = '0';
562
- }
563
- //Get checked question type
564
- var get_file_upload_type = question.get( 'file_upload_type' );
565
- $("input[name='file_upload_type[]']:checkbox").attr("checked",false);
566
- if( get_file_upload_type === null || typeof get_file_upload_type === "undefined" ){
567
- }else{
568
- var fut_arr = get_file_upload_type.split(",");
569
- $.each(fut_arr,function(i){
570
- $("input[name='file_upload_type[]']:checkbox[value='"+ fut_arr[i] +"']").attr("checked","true");
571
- });
572
- }
573
- var al = 0;
574
- _.each( answers, function( answer ) {
575
- answer.push(al + 1);
576
- answer.push(questionID);
577
- answer.push(answerEditor);
578
- QSMQuestion.addNewAnswer( answer );
579
- al++;
 
 
 
 
 
 
 
580
  });
581
- //get new question type
582
- var get_question_title = question.get( 'question_title' );
583
- if( get_question_title === null || typeof get_question_title === "undefined" ){
584
- get_question_title = '';
585
- }
586
-
587
- //Hide the question settings based on question type
588
  $('.qsm_hide_for_other').hide();
589
- if( $('.qsm_show_question_type_' + question.get('type')).length > 0 ){
590
- $('.qsm_show_question_type_' + question.get('type')).show();
591
  }
592
- qsm_hide_show_question_desc( question.get('type') );
593
- $( '#hint' ).val( question.get( 'hint' ) );
594
- $( '#correct_answer_info' ).val( question.get( 'answerInfo' ) );
595
- $( "#question_type" ).val( question.get( 'type' ) );
596
- $( "#comments" ).val( question.get( 'comments' ) );
597
- //Changed checked logic based on new structure for required.
598
- $("input#required[value='" + question.get( 'required' ) + "']").prop('checked', true);
599
-
600
- $( "#hide_autofill" ).val( disableAutofill );
601
- $( "#limit_text" ).val( get_limit_text );
602
- $( "#limit_multiple_response" ).val( get_limit_mr );
603
- $( "#file_upload_limit" ).val( get_limit_fu );
604
- $( "#change-answer-editor" ).val( answerEditor );
605
- $( ".category-radio" ).removeAttr( 'checked' );
606
- $( "#edit-question-id" ).text('').text(questionID);
607
- $( "#question_title" ).val( get_question_title );
608
- if ( 0 !== question.get( 'category' ).length ) {
609
- $( ".category-radio" ).val( [question.get( 'category' )] );
610
- }
611
- //Append extra settings
612
- var all_setting = question.get('settings');
613
- if( all_setting === null || typeof all_setting === "undefined" ){
614
- }else{
615
- $.each(all_setting, function( index, value ) {
616
- if($('#' + index + '_area').length > 0){
617
- if($('#' + index + '_area').find('input[type="checkbox"]').length > 1){
618
- var fut_arr = value.split(",");
619
- $.each(fut_arr,function(i){
620
- $(".questionElements input[name='"+ index +"[]']:checkbox[value='"+ fut_arr[i] +"']").attr("checked","true").prop('checked', true);
621
- });
622
- }else{
623
- if( value != null)
624
- $('#' + index).val(value);
625
- }
626
- }
627
- });
628
- }
629
- CurrentElement.parents('.question').next('.questionElements').slideDown('slow');
630
- $('#modal-1-content').html( questionElements );
631
  //MicroModal.show( 'modal-1' );
632
- $( '.questions' ).sortable('disable');
633
- $( '.page' ).sortable('disable');
634
  },
635
  openEditPagePopup: function( pageID ) {
636
  var page = QSMQuestion.qpages.get(pageID);
@@ -648,16 +645,17 @@ var import_button;
648
  prepareQuestionText: function( question ) {
649
  return jQuery('<textarea />').html( question ).text();
650
  },
651
- prepareEditor: function() {
652
  var settings = {
653
  mediaButtons: true,
654
- tinymce: {
655
- forced_root_block : '',
656
  toolbar1: 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,charmap,undo,redo'
657
  },
658
- quicktags: true,
659
  };
660
- wp.editor.initialize( 'question-text', settings );
 
661
  }
662
  };
663
 
@@ -980,6 +978,18 @@ var import_button;
980
  }
981
  $(this).next('.qsm-row').slideDown();
982
  }
 
 
 
 
 
 
 
 
 
 
 
 
983
  });
984
  });
985
  var decodeEntities = (function () {
357
  );
358
  },
359
  saveQuestion: function( questionID, CurrentElement ) {
360
+ QSMAdmin.displayAlert('Saving question...', 'info');
361
+ var model = QSMQuestion.questions.get(questionID);
362
+ var hint = $('#hint').val();
363
+ var name = wp.editor.getContent('question-text');
364
+ //Save new question title
365
+ var question_title = $('#question_title').val();
366
+ if (name == '' && question_title == '') {
367
+ alert('Enter Question title or description');
368
+ return false;
369
+ }
370
+ var advanced_option = {};
371
+ var answerInfo = wp.editor.getContent('correct_answer_info');
372
+ var type = $("#question_type").val();
373
+ var comments = $("#comments").val();
374
+ advanced_option['required'] = $(".questionElements input[name='required']").is(":checked") ? 0 : 1;
375
+ var category = $(".category-radio:checked").val();
376
+ var autofill = $("#hide_autofill").val();
377
+ var limit_text = $("#limit_text").val();
378
+ var limit_multiple_response = $("#limit_multiple_response").val();
379
+ var file_upload_limit = $("#file_upload_limit").val();
380
+ var type_arr = [];
381
+ $.each($("input[name='file_upload_type[]']:checked"), function () {
382
+ type_arr.push($(this).val());
383
+ });
384
+ if ('new_category' == category) {
385
+ category = $('#new_category').val();
386
  }
387
+ if (!category) {
388
  category = '';
389
  }
390
+ var answerType = $('#change-answer-editor').val();
391
  var answers = [];
392
+ var $answers = jQuery('.answers-single');
393
+ _.each($answers, function (answer) {
394
+ var $answer = jQuery(answer);
395
+ var answer = '';
396
+ if (answerType == 'rich') {
397
+ var ta_id = $answer.find('textarea').attr('id')
398
+ answer = wp.editor.getContent(ta_id);
399
+ } else {
400
+ answer = $answer.find('.answer-text').val().trim();
401
+ answer = $.QSMSanitize(answer);
402
+ }
403
+
404
+ var points = $answer.find('.answer-points').val();
405
  var correct = 0;
406
+ if ($answer.find('.answer-correct').prop('checked')) {
407
  correct = 1;
408
  }
409
+ answers.push([answer, points, correct]);
410
+ });
411
+ $('.questionElements .advanced-content > .qsm-row ').each(function () {
412
+ if ($(this).find('input[type="text"]').length > 0) {
413
+ var element_id = $(this).find('input[type="text"]').attr('id');
414
+ advanced_option[element_id] = $(this).find('input[type="text"]').val();
415
+ } else if ($(this).find('input[type="number"]').length > 0) {
416
+ var element_id = $(this).find('input[type="number"]').attr('id');
417
+ advanced_option[element_id] = $(this).find('input[type="number"]').val();
418
+ } else if ($(this).find('select').length > 0) {
419
+ var element_id = $(this).find('select').attr('id');
420
+ advanced_option[element_id] = $(this).find('select').val();
421
+ } else if ($(this).find('input[type="checkbox"]').length > 0) {
422
+ var element_id = $(this).find('input[type="checkbox"]').attr('name');
423
+ var multi_value = $(this).find('input[type="checkbox"]:checked').map(function () {
424
+ return this.value;
425
+ }).get().join(',');
426
+ element_id = element_id.replace('[]', '');
427
+ advanced_option[element_id] = multi_value;
428
+ }
429
+ });
430
+ model.save({
431
+ type: type,
432
+ name: name,
433
+ question_title: question_title,
434
+ answerInfo: answerInfo,
435
+ comments: comments,
436
+ hint: hint,
437
+ category: category,
438
+ answers: answers,
439
+ answerEditor: answerType,
440
+ other_settings: advanced_option
441
+ }, {
442
+ headers: {'X-WP-Nonce': qsmQuestionSettings.nonce},
443
+ success: QSMQuestion.saveSuccess,
444
+ error: QSMAdmin.displayError,
445
+ type: 'POST'
446
+ });
 
 
 
 
 
 
 
447
  //CurrentElement.parents('.questionElements').slideUp('slow');
448
  },
449
  saveSuccess: function( model ) {
481
  tinyMCE.get( textarea_id ).setContent( anser );
482
  }
483
  },
484
+ openEditPopup: function (questionID, CurrentElement) {
485
+ if (CurrentElement.parents('.question').next('.questionElements').length > 0) {
486
+ if (CurrentElement.parents('.question').next('.questionElements').is(":visible")) {
487
+ CurrentElement.parents('.question').next('.questionElements').slideUp('slow');
488
+ $('.questions').sortable('enable');
489
+ $('.page').sortable('enable');
490
+ } else {
491
+ CurrentElement.parents('.question').next('.questionElements').slideDown('slow');
492
+ }
493
+ return;
494
+ } else {
495
+ $('.questions .questionElements').slideDown('slow');
496
+ $('.questions .questionElements').remove();
497
+ }
498
+ //Copy and remove popup div
499
+ var questionElements = $('#modal-1-content').html();
500
+ $('#modal-1-content').children().remove();
501
+ CurrentElement.parents('.question').after("<div style='display: none;' class='questionElements'>" + questionElements + "</div>");
502
+
503
+ //Show question id on question edit screen
504
+ $('#qsm-question-id').text('ID: ' + questionID);
505
  QSMQuestion.prepareCategories();
506
  QSMQuestion.processCategories();
507
+ var question = QSMQuestion.questions.get(questionID);
508
+ var questionText = QSMQuestion.prepareQuestionText(question.get('name'));
509
+ $('#edit_question_id').val(questionID);
510
+ var answerInfo = question.get('answerInfo');
511
+ var CAI_editor = '';
512
+ var question_editor = ''
513
+ if (qsmQuestionSettings.qsm_user_ve === 'true') {
514
+ wp.editor.remove('question-text');
515
+ wp.editor.remove('correct_answer_info');
516
+ QSMQuestion.prepareEditor();
517
+ question_editor = tinyMCE.get('question-text');
518
+ CAI_editor = tinyMCE.get('correct_answer_info');
519
+ }
 
520
  if ($('#wp-question-text-wrap').hasClass('html-active')) {
521
+ jQuery("#question-text").val(questionText);
522
+ } else if (question_editor) {
523
+ tinyMCE.get('question-text').setContent(questionText);
 
524
  } else {
525
+ jQuery("#question-text").val(questionText);
526
  }
527
+ if ($('#wp-correct_answer_info-wrap').hasClass('html-active')) {
528
+ jQuery("#correct_answer_info").val(answerInfo);
529
+ } else if (CAI_editor) {
530
+ tinyMCE.get('correct_answer_info').setContent(answerInfo);
531
+ } else {
532
+ jQuery("#correct_answer_info").val(answerInfo);
533
+ }
534
+
535
+ $('#answers').empty();
536
+ var answers = question.get('answers');
537
+ var answerEditor = question.get('answerEditor');
538
+ if (answerEditor === null || typeof answerEditor === "undefined") {
539
+ answerEditor = 'text';
540
+ }
541
+ //Check autofill setting
542
+ var disableAutofill = question.get('autofill');
543
+ if (disableAutofill === null || typeof disableAutofill === "undefined") {
544
+ disableAutofill = '0';
545
+ }
546
+ //Get text limit value
547
+ var get_limit_text = question.get('limit_text');
548
+ if (get_limit_text === null || typeof get_limit_text === "undefined") {
549
+ get_limit_text = '0';
550
+ }
551
+ //Get limit multiple response value
552
+ var get_limit_mr = question.get('limit_multiple_response');
553
+ if (get_limit_mr === null || typeof get_limit_mr === "undefined") {
554
+ get_limit_mr = '0';
555
+ }
556
+ //Get file upload limit
557
+ var get_limit_fu = question.get('file_upload_limit');
558
+ if (get_limit_fu === null || typeof get_limit_fu === "undefined") {
559
+ get_limit_fu = '0';
560
+ }
561
+ //Get checked question type
562
+ var get_file_upload_type = question.get('file_upload_type');
563
+ $("input[name='file_upload_type[]']:checkbox").attr("checked", false);
564
+ if (get_file_upload_type === null || typeof get_file_upload_type === "undefined") {
565
+ } else {
566
+ var fut_arr = get_file_upload_type.split(",");
567
+ $.each(fut_arr, function (i) {
568
+ $("input[name='file_upload_type[]']:checkbox[value='" + fut_arr[i] + "']").attr("checked", "true");
569
+ });
570
+ }
571
+ var al = 0;
572
+ _.each(answers, function (answer) {
573
+ answer.push(al + 1);
574
+ answer.push(questionID);
575
+ answer.push(answerEditor);
576
+ QSMQuestion.addNewAnswer(answer);
577
+ al++;
578
  });
579
+ //get new question type
580
+ var get_question_title = question.get('question_title');
581
+ if (get_question_title === null || typeof get_question_title === "undefined") {
582
+ get_question_title = '';
583
+ }
584
+
585
+ //Hide the question settings based on question type
586
  $('.qsm_hide_for_other').hide();
587
+ if ($('.qsm_show_question_type_' + question.get('type')).length > 0) {
588
+ $('.qsm_show_question_type_' + question.get('type')).show();
589
  }
590
+ qsm_hide_show_question_desc(question.get('type'));
591
+ $('#hint').val(question.get('hint'));
592
+ $("#question_type").val(question.get('type'));
593
+ $("#comments").val(question.get('comments'));
594
+ //Changed checked logic based on new structure for required.
595
+ $("input#required[value='" + question.get('required') + "']").prop('checked', true);
596
+
597
+ $("#hide_autofill").val(disableAutofill);
598
+ $("#limit_text").val(get_limit_text);
599
+ $("#limit_multiple_response").val(get_limit_mr);
600
+ $("#file_upload_limit").val(get_limit_fu);
601
+ $("#change-answer-editor").val(answerEditor);
602
+ $(".category-radio").removeAttr('checked');
603
+ $("#edit-question-id").text('').text(questionID);
604
+ $("#question_title").val(get_question_title);
605
+ if (0 !== question.get('category').length) {
606
+ $(".category-radio").val([question.get('category')]);
607
+ }
608
+ //Append extra settings
609
+ var all_setting = question.get('settings');
610
+ if (all_setting === null || typeof all_setting === "undefined") {
611
+ } else {
612
+ $.each(all_setting, function (index, value) {
613
+ if ($('#' + index + '_area').length > 0) {
614
+ if ($('#' + index + '_area').find('input[type="checkbox"]').length > 1) {
615
+ var fut_arr = value.split(",");
616
+ $.each(fut_arr, function (i) {
617
+ $(".questionElements input[name='" + index + "[]']:checkbox[value='" + fut_arr[i] + "']").attr("checked", "true").prop('checked', true);
618
+ });
619
+ } else {
620
+ if (value != null)
621
+ $('#' + index).val(value);
622
+ }
623
+ }
624
+ });
625
+ }
626
+ CurrentElement.parents('.question').next('.questionElements').slideDown('slow');
627
+ $('#modal-1-content').html(questionElements);
 
628
  //MicroModal.show( 'modal-1' );
629
+ $('.questions').sortable('disable');
630
+ $('.page').sortable('disable');
631
  },
632
  openEditPagePopup: function( pageID ) {
633
  var page = QSMQuestion.qpages.get(pageID);
645
  prepareQuestionText: function( question ) {
646
  return jQuery('<textarea />').html( question ).text();
647
  },
648
+ prepareEditor: function () {
649
  var settings = {
650
  mediaButtons: true,
651
+ tinymce: {
652
+ forced_root_block: '',
653
  toolbar1: 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,charmap,undo,redo'
654
  },
655
+ quicktags: true,
656
  };
657
+ wp.editor.initialize('question-text', settings);
658
+ wp.editor.initialize('correct_answer_info', settings);
659
  }
660
  };
661
 
978
  }
979
  $(this).next('.qsm-row').slideDown();
980
  }
981
+ });
982
+
983
+ //Hide/show correct answer info
984
+ $( document ).on('click', '.qsm-show-correct-info-box', function(e){
985
+ e.preventDefault();
986
+ if( $(this).next('.qsm-row').is(':visible') ){
987
+ $(this).html('').html('<span class="dashicons dashicons-plus-alt2"></span> ' + qsmQuestionSettings.show_correct_info_text);
988
+ $(this).next('.qsm-row').slideUp();
989
+ }else{
990
+ $(this).hide();
991
+ $(this).next('.qsm-row').slideDown();
992
+ }
993
  });
994
  });
995
  var decodeEntities = (function () {
js/qsm-admin-results.js CHANGED
@@ -95,6 +95,7 @@ var QSMAdminResults;
95
  quicktags: true,
96
  };
97
  wp.editor.initialize( 'results-page-' + QSMAdminResults.total, settings );
 
98
  },
99
  newResultsPage: function() {
100
  var conditions = [{
95
  quicktags: true,
96
  };
97
  wp.editor.initialize( 'results-page-' + QSMAdminResults.total, settings );
98
+ jQuery(document).trigger('qsm_after_add_result_block', [conditions, page, redirect]);
99
  },
100
  newResultsPage: function() {
101
  var conditions = [{
js/qsm-quiz.js CHANGED
@@ -23,11 +23,26 @@ var QSMPageTimer;
23
  _.each( qmn_quiz_data, function( quiz ) {
24
  quizID = parseInt( quiz.quiz_id );
25
  QSM.initPagination( quizID );
 
 
 
 
 
 
 
 
26
  if (qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')) {
 
 
 
27
  QSMPageTimer.endPageTimer(quizID, true);
28
  }
29
  if ( quiz.hasOwnProperty( 'timer_limit' ) && 0 != quiz.timer_limit ) {
 
 
 
30
  QSM.initTimer( quizID );
 
31
  }
32
  });
33
  }
@@ -104,8 +119,16 @@ var QSMPageTimer;
104
  * @param int quizID The ID of the quiz.
105
  */
106
  activateTimer: function( quizID ) {
107
-
108
- jQuery(document).trigger('qsm_activate_time_before', [quizID, qmn_quiz_data]);
 
 
 
 
 
 
 
 
109
  // Gets our form.
110
  var $timer = QSM.getTimer( quizID );
111
 
@@ -268,7 +291,7 @@ var QSMPageTimer;
268
  var $quizForm = QSM.getQuizForm( quizID );
269
  if ( 0 < $quizForm.children( '.qsm-page' ).length ) {
270
  $quizForm.children( '.qsm-page' ).hide();
271
- template = wp.template( 'qsm-pagination' );
272
  $quizForm.append( template() );
273
  if( $quizForm.find( '.qsm-pagination > .current_page_hidden' ).length == 0){
274
  $quizForm.find( '.qsm-pagination' ).append( '<input type="hidden" value="0" name="current_page" class="current_page_hidden" />');
@@ -595,7 +618,20 @@ var QSMPageTimer;
595
  qmnInit();
596
 
597
  // Call main initialization.
598
- QSM.init();
 
 
 
 
 
 
 
 
 
 
 
 
 
599
  });
600
 
601
  jQuery("input[name='timer_ms']").each(function(){
@@ -1395,3 +1431,4 @@ jQuery(function() {
1395
  });
1396
 
1397
  var qsmTimerInterval = setInterval( qmnTimeTakenTimer, 1000 );
 
23
  _.each( qmn_quiz_data, function( quiz ) {
24
  quizID = parseInt( quiz.quiz_id );
25
  QSM.initPagination( quizID );
26
+
27
+ if(quiz.hasOwnProperty('pagination') || quiz.qpages.hasOwnProperty(2)){
28
+ qsmEndTimeTakenTimer();
29
+ jQuery( '#timer' ).val(0);
30
+ jQuery("input[name='timer_ms']").val(0);
31
+ quizType = 'paginated';
32
+ }
33
+
34
  if (qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')) {
35
+ qsmEndTimeTakenTimer();
36
+ jQuery( '#timer' ).val(0);
37
+ jQuery("input[name='timer_ms']").val(0);
38
  QSMPageTimer.endPageTimer(quizID, true);
39
  }
40
  if ( quiz.hasOwnProperty( 'timer_limit' ) && 0 != quiz.timer_limit ) {
41
+ qsmEndTimeTakenTimer();
42
+ jQuery( '#timer' ).val(0);
43
+ jQuery("input[name='timer_ms']").val(0);
44
  QSM.initTimer( quizID );
45
+ quizType = 'timer';
46
  }
47
  });
48
  }
119
  * @param int quizID The ID of the quiz.
120
  */
121
  activateTimer: function( quizID ) {
122
+ timer_ms = jQuery("input[name='timer_ms']").val();
123
+ if(timer_ms == 0){
124
+ qsmTimerInterval = setInterval( qmnTimeTakenTimer, 1000 );
125
+ jQuery("input[name='timer_ms']").each(function(){
126
+ var timems = qsmTimeInMS();
127
+ jQuery(this).val(timems);
128
+ });
129
+ }
130
+
131
+ jQuery(document).trigger('qsm_activate_time_before', [quizID, qmn_quiz_data]);
132
  // Gets our form.
133
  var $timer = QSM.getTimer( quizID );
134
 
291
  var $quizForm = QSM.getQuizForm( quizID );
292
  if ( 0 < $quizForm.children( '.qsm-page' ).length ) {
293
  $quizForm.children( '.qsm-page' ).hide();
294
+ template = wp.template( 'qsm-pagination-'+quizID );
295
  $quizForm.append( template() );
296
  if( $quizForm.find( '.qsm-pagination > .current_page_hidden' ).length == 0){
297
  $quizForm.find( '.qsm-pagination' ).append( '<input type="hidden" value="0" name="current_page" class="current_page_hidden" />');
618
  qmnInit();
619
 
620
  // Call main initialization.
621
+ qsminstance = QSM.init();
622
+
623
+ jQuery(".qsm-quiz-container").on("click", ".mlw_next", function(){
624
+ if(quizType == 'paginated'){
625
+ timer_ms = jQuery("input[name='timer_ms']").val();
626
+ if(timer_ms == 0){
627
+ qsmTimerInterval = setInterval( qmnTimeTakenTimer, 1000 );
628
+ jQuery("input[name='timer_ms']").each(function(){
629
+ var timems = qsmTimeInMS();
630
+ jQuery(this).val(timems);
631
+ });
632
+ }
633
+ }
634
+ });
635
  });
636
 
637
  jQuery("input[name='timer_ms']").each(function(){
1431
  });
1432
 
1433
  var qsmTimerInterval = setInterval( qmnTimeTakenTimer, 1000 );
1434
+ var quizType = 'default';
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.15
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.15
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.15';
41
 
42
  /**
43
  * QSM Alert Manager Object
@@ -188,6 +188,8 @@ class MLWQuizMasterNext {
188
  add_action( 'admin_head', array( $this, 'admin_head' ), 900 );
189
  add_action( 'init', array( $this, 'register_quiz_post_types' ) );
190
  add_action('plugins_loaded', array(&$this, 'qsm_load_textdomain'));
 
 
191
  }
192
 
193
  /**
@@ -197,6 +199,17 @@ class MLWQuizMasterNext {
197
  load_plugin_textdomain( 'quiz-master-next', false, dirname(plugin_basename(__FILE__)) . '/lang/');
198
  }
199
 
 
 
 
 
 
 
 
 
 
 
 
200
  /**
201
  * Creates Custom Quiz Post Type
202
  *
@@ -313,6 +326,21 @@ class MLWQuizMasterNext {
313
  remove_submenu_page( 'quiz-master-next/mlw_quizmaster2.php', 'mlw_quiz_options' );
314
  remove_submenu_page( 'quiz-master-next/mlw_quizmaster2.php', 'qsm_quiz_result_details' );
315
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  }
317
 
318
  global $mlwQuizMasterNext;
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
+ * Version: 7.1.16
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.16
13
  * @package QSM
14
  */
15
 
37
  * @var string
38
  * @since 4.0.0
39
  */
40
+ public $version = '7.1.16';
41
 
42
  /**
43
  * QSM Alert Manager Object
188
  add_action( 'admin_head', array( $this, 'admin_head' ), 900 );
189
  add_action( 'init', array( $this, 'register_quiz_post_types' ) );
190
  add_action('plugins_loaded', array(&$this, 'qsm_load_textdomain'));
191
+ add_action('admin_enqueue_scripts', array($this, 'qsm_admin_scripts_style'));
192
+ add_action('admin_init', array($this, 'qsm_overide_old_setting_options'));
193
  }
194
 
195
  /**
199
  load_plugin_textdomain( 'quiz-master-next', false, dirname(plugin_basename(__FILE__)) . '/lang/');
200
  }
201
 
202
+ /**
203
+ * Loads admin scripts and style
204
+ *
205
+ * @since 7.1.16
206
+ */
207
+ public function qsm_admin_scripts_style($hook_prefix){
208
+ if($hook_prefix == 'admin_page_mlw_quiz_options'){
209
+ wp_enqueue_script( 'wp-tinymce' );
210
+ }
211
+ }
212
+
213
  /**
214
  * Creates Custom Quiz Post Type
215
  *
326
  remove_submenu_page( 'quiz-master-next/mlw_quizmaster2.php', 'mlw_quiz_options' );
327
  remove_submenu_page( 'quiz-master-next/mlw_quizmaster2.php', 'qsm_quiz_result_details' );
328
  }
329
+ /**
330
+ * Overide Old Quiz Settings Options
331
+ * @since 7.1.16
332
+ * @return void
333
+ */
334
+ public function qsm_overide_old_setting_options()
335
+ {
336
+ $settings = (array) get_option( 'qmn-settings' );
337
+ $facebook_app_id = $settings['facebook_app_id'];
338
+ if($facebook_app_id == '483815031724529')
339
+ {
340
+ $settings['facebook_app_id'] = '594986844960937';
341
+ update_option( 'qmn-settings', $settings );
342
+ }
343
+ }
344
  }
345
 
346
  global $mlwQuizMasterNext;
php/admin/options-page-email-tab.php CHANGED
@@ -101,20 +101,20 @@ function qsm_options_emails_tab_content() {
101
  <option value="score" <# if (data.criteria == 'score') { #>selected<# } #>><?php _e('Correct score percentage', 'quiz-master-next'); ?></option>
102
  <?php do_action( 'qsm_email_condition_criteria' ); ?>
103
  </select>
 
104
  <select class="email-condition-operator">
105
- <option value="equal" <# if (data.operator == 'equal') { #>selected<# } #>><?php _e('is equal to', 'quiz-master-next'); ?></option>
106
- <option value="not-equal" <# if (data.operator == 'not-equal') { #>selected<# } #>><?php _e('is not equal to', 'quiz-master-next'); ?></option>
107
- <option value="greater-equal" <# if (data.operator == 'greater-equal') { #>selected<# } #>><?php _e('is greater than or equal to', 'quiz-master-next'); ?></option>
108
- <option value="greater" <# if (data.operator == 'greater') { #>selected<# } #>><?php _e('is greater than', 'quiz-master-next'); ?></option>
109
- <option value="less-equal" <# if (data.operator == 'less-equal') { #>selected<# } #>><?php _e('is less than or equal to', 'quiz-master-next'); ?></option>
110
- <option value="less" <# if (data.operator == 'less') { #>selected<# } #>><?php _e('is less than', 'quiz-master-next'); ?></option>
111
  <?php do_action( 'qsm_email_condition_operator' ); ?>
112
  </select>
113
- <input type="text" class="email-condition-value" value="{{ data.value }}">
114
  <?php do_action('qsm_email_condition_value'); ?>
115
  </div>
116
  </script>
117
-
118
  <!--Template popup-->
119
  <div class="qsm-popup qsm-popup-slide" id="show-all-variable" aria-hidden="false">
120
  <div class="qsm-popup__overlay" tabindex="-1" data-micromodal-close="">
101
  <option value="score" <# if (data.criteria == 'score') { #>selected<# } #>><?php _e('Correct score percentage', 'quiz-master-next'); ?></option>
102
  <?php do_action( 'qsm_email_condition_criteria' ); ?>
103
  </select>
104
+ <?php do_action('qsm_email_extra_condition_fields'); ?>
105
  <select class="email-condition-operator">
106
+ <option class="default_operator" value="equal" <# if (data.operator == 'equal') { #>selected<# } #>><?php _e('is equal to', 'quiz-master-next'); ?></option>
107
+ <option class="default_operator" value="not-equal" <# if (data.operator == 'not-equal') { #>selected<# } #>><?php _e('is not equal to', 'quiz-master-next'); ?></option>
108
+ <option class="default_operator" value="greater-equal" <# if (data.operator == 'greater-equal') { #>selected<# } #>><?php _e('is greater than or equal to', 'quiz-master-next'); ?></option>
109
+ <option class="default_operator" value="greater" <# if (data.operator == 'greater') { #>selected<# } #>><?php _e('is greater than', 'quiz-master-next'); ?></option>
110
+ <option class="default_operator" value="less-equal" <# if (data.operator == 'less-equal') { #>selected<# } #>><?php _e('is less than or equal to', 'quiz-master-next'); ?></option>
111
+ <option class="default_operator" value="less" <# if (data.operator == 'less') { #>selected<# } #>><?php _e('is less than', 'quiz-master-next'); ?></option>
112
  <?php do_action( 'qsm_email_condition_operator' ); ?>
113
  </select>
114
+ <input type="text" class="email-condition-value condition-default-value" value="{{ data.value }}">
115
  <?php do_action('qsm_email_condition_value'); ?>
116
  </div>
117
  </script>
 
118
  <!--Template popup-->
119
  <div class="qsm-popup qsm-popup-slide" id="show-all-variable" aria-hidden="false">
120
  <div class="qsm-popup__overlay" tabindex="-1" data-micromodal-close="">
php/admin/options-page-questions-tab.php CHANGED
@@ -67,6 +67,7 @@ function qsm_options_questions_tab_content() {
67
  'quiz_system' => $quiz_system,
68
  'hide_desc_text' => __('Less Description', 'quiz-master-next'),
69
  'show_desc_text' => __('Add Description', 'quiz-master-next'),
 
70
  'question_bank_nonce' => wp_create_nonce("delete_question_question_bank_nonce"),
71
  'single_question_nonce' => wp_create_nonce("delete_question_from_database")
72
  );
@@ -167,6 +168,7 @@ function qsm_options_questions_tab_content() {
167
  <div class="qsm-row" style="display: none;">
168
  <textarea placeholder="<?php _e('Add your description here', 'quiz-master-next'); ?>" id="question-text"></textarea>
169
  </div>
 
170
  <div class="qsm-row" style="margin-bottom: 0;">
171
  <?php
172
  $description_arr = array(
@@ -244,6 +246,9 @@ function qsm_options_questions_tab_content() {
244
  <a href="#" class="button" id="new-answer-button"><span class="dashicons dashicons-plus"></span> <?php _e( 'Add New Answer!', 'quiz-master-next'); ?></a>
245
  </div>
246
  </div>
 
 
 
247
  <?php
248
  $answer_area_option = array(
249
  'correct_answer_info' => array(
@@ -259,6 +264,7 @@ function qsm_options_questions_tab_content() {
259
  echo qsm_display_question_option($qo_key, $single_answer_option);
260
  }
261
  ?>
 
262
  <?php do_action('qsm_question_form_fields', $quiz_id);?>
263
  </div>
264
  <div id="postbox-container-1" class="postbox-container">
67
  'quiz_system' => $quiz_system,
68
  'hide_desc_text' => __('Less Description', 'quiz-master-next'),
69
  'show_desc_text' => __('Add Description', 'quiz-master-next'),
70
+ 'show_correct_info_text' => __('Add Correct Answer Info', 'quiz-master-next'),
71
  'question_bank_nonce' => wp_create_nonce("delete_question_question_bank_nonce"),
72
  'single_question_nonce' => wp_create_nonce("delete_question_from_database")
73
  );
168
  <div class="qsm-row" style="display: none;">
169
  <textarea placeholder="<?php _e('Add your description here', 'quiz-master-next'); ?>" id="question-text"></textarea>
170
  </div>
171
+ <hr/>
172
  <div class="qsm-row" style="margin-bottom: 0;">
173
  <?php
174
  $description_arr = array(
246
  <a href="#" class="button" id="new-answer-button"><span class="dashicons dashicons-plus"></span> <?php _e( 'Add New Answer!', 'quiz-master-next'); ?></a>
247
  </div>
248
  </div>
249
+ <hr style="margin-bottom:25px;">
250
+ <a href="#" class="qsm-show-correct-info-box button button-default"><span class="dashicons dashicons-plus-alt2"></span> <?php _e('Add Correct Answer Info', 'quiz-master-next'); ?></a>
251
+ <div class="qsm-row" style="display: none;">
252
  <?php
253
  $answer_area_option = array(
254
  'correct_answer_info' => array(
264
  echo qsm_display_question_option($qo_key, $single_answer_option);
265
  }
266
  ?>
267
+ </div>
268
  <?php do_action('qsm_question_form_fields', $quiz_id);?>
269
  </div>
270
  <div id="postbox-container-1" class="postbox-container">
php/admin/options-page-results-page-tab.php CHANGED
@@ -93,16 +93,18 @@ function qsm_options_results_tab_content() {
93
  <option value="score" <# if (data.criteria == 'score') { #>selected<# } #>><?php _e('Correct score percentage', 'quiz-master-next'); ?></option>
94
  <?php do_action( 'qsm_results_page_condition_criteria' ); ?>
95
  </select>
 
96
  <select class="results-page-condition-operator">
97
- <option value="equal" <# if (data.operator == 'equal') { #>selected<# } #>><?php _e('is equal to', 'quiz-master-next'); ?></option>
98
- <option value="not-equal" <# if (data.operator == 'not-equal') { #>selected<# } #>><?php _e('is not equal to', 'quiz-master-next'); ?></option>
99
- <option value="greater-equal" <# if (data.operator == 'greater-equal') { #>selected<# } #>><?php _e('is greater than or equal to', 'quiz-master-next'); ?></option>
100
- <option value="greater" <# if (data.operator == 'greater') { #>selected<# } #>><?php _e('is greater than', 'quiz-master-next'); ?></option>
101
- <option value="less-equal" <# if (data.operator == 'less-equal') { #>selected<# } #>><?php _e('is less than or equal to', 'quiz-master-next'); ?></option>
102
- <option value="less" <# if (data.operator == 'less') { #>selected<# } #>><?php _e('is less than', 'quiz-master-next'); ?></option>
103
  <?php do_action( 'qsm_results_page_condition_operator' ); ?>
104
  </select>
105
- <input type="text" class="results-page-condition-value" value="{{ data.value }}">
 
106
  </div>
107
  </script>
108
  <!--Template popup-->
93
  <option value="score" <# if (data.criteria == 'score') { #>selected<# } #>><?php _e('Correct score percentage', 'quiz-master-next'); ?></option>
94
  <?php do_action( 'qsm_results_page_condition_criteria' ); ?>
95
  </select>
96
+ <?php do_action('qsm_results_page_extra_condition_fields'); ?>
97
  <select class="results-page-condition-operator">
98
+ <option class="default_operator" value="equal" <# if (data.operator == 'equal') { #>selected<# } #>><?php _e('is equal to', 'quiz-master-next'); ?></option>
99
+ <option class="default_operator" value="not-equal" <# if (data.operator == 'not-equal') { #>selected<# } #>><?php _e('is not equal to', 'quiz-master-next'); ?></option>
100
+ <option class="default_operator" value="greater-equal" <# if (data.operator == 'greater-equal') { #>selected<# } #>><?php _e('is greater than or equal to', 'quiz-master-next'); ?></option>
101
+ <option class="default_operator" value="greater" <# if (data.operator == 'greater') { #>selected<# } #>><?php _e('is greater than', 'quiz-master-next'); ?></option>
102
+ <option class="default_operator" value="less-equal" <# if (data.operator == 'less-equal') { #>selected<# } #>><?php _e('is less than or equal to', 'quiz-master-next'); ?></option>
103
+ <option class="default_operator" value="less" <# if (data.operator == 'less') { #>selected<# } #>><?php _e('is less than', 'quiz-master-next'); ?></option>
104
  <?php do_action( 'qsm_results_page_condition_operator' ); ?>
105
  </select>
106
+ <input type="text" class="results-page-condition-value condition-default-value" value="{{ data.value }}">
107
+ <?php do_action('qsm_results_page_condition_value'); ?>
108
  </div>
109
  </script>
110
  <!--Template popup-->
php/admin/quiz-options-page.php CHANGED
@@ -57,7 +57,6 @@ function qsm_generate_quiz_options() {
57
  wp_enqueue_script( 'jquery-ui-tabs' );
58
  wp_enqueue_script( 'jquery-effects-blind' );
59
  wp_enqueue_script( 'jquery-effects-explode' );
60
- wp_enqueue_script( 'wp-tinymce' );
61
 
62
  wp_enqueue_script( 'qmn_admin_js', plugins_url( '../../js/admin.js', __FILE__ ), array( 'backbone', 'underscore', 'wp-util' ), $mlwQuizMasterNext->version, true );
63
  wp_enqueue_script( 'micromodal_script', plugins_url( '../../js/micromodal.min.js', __FILE__ ) );
57
  wp_enqueue_script( 'jquery-ui-tabs' );
58
  wp_enqueue_script( 'jquery-effects-blind' );
59
  wp_enqueue_script( 'jquery-effects-explode' );
 
60
 
61
  wp_enqueue_script( 'qmn_admin_js', plugins_url( '../../js/admin.js', __FILE__ ), array( 'backbone', 'underscore', 'wp-util' ), $mlwQuizMasterNext->version, true );
62
  wp_enqueue_script( 'micromodal_script', plugins_url( '../../js/micromodal.min.js', __FILE__ ) );
php/admin/settings-page.php CHANGED
@@ -136,7 +136,7 @@ class QMNGlobalSettingsPage {
136
  */
137
  public function facebook_app_id() {
138
  $settings = (array) get_option( 'qmn-settings' );
139
- $facebook_app_id = '483815031724529';
140
  if (isset($settings['facebook_app_id']))
141
  {
142
  $facebook_app_id = esc_attr( $settings['facebook_app_id'] );
136
  */
137
  public function facebook_app_id() {
138
  $settings = (array) get_option( 'qmn-settings' );
139
+ $facebook_app_id = '594986844960937';
140
  if (isset($settings['facebook_app_id']))
141
  {
142
  $facebook_app_id = esc_attr( $settings['facebook_app_id'] );
php/classes/class-qmn-quiz-creator.php CHANGED
@@ -327,7 +327,8 @@ class QMNQuizCreator {
327
  global $mlwQuizMasterNext;
328
  global $wpdb;
329
  $current_user = wp_get_current_user();
330
- $table_name = $wpdb->prefix . "mlw_quizzes";
 
331
  $mlw_qmn_duplicate_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table_name WHERE quiz_id=%d", $quiz_id ) );
332
  $quiz_settings = unserialize( $mlw_qmn_duplicate_data->quiz_settings );
333
  if( $is_duplicating_questions == 0 ){
@@ -457,8 +458,19 @@ 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
- $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();
464
  $quiz_post = array(
@@ -566,7 +578,25 @@ class QMNQuizCreator {
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(
327
  global $mlwQuizMasterNext;
328
  global $wpdb;
329
  $current_user = wp_get_current_user();
330
+ $table_name = $wpdb->prefix . "mlw_quizzes";
331
+ $logic_table = $wpdb->prefix. "mlw_logic";
332
  $mlw_qmn_duplicate_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table_name WHERE quiz_id=%d", $quiz_id ) );
333
  $quiz_settings = unserialize( $mlw_qmn_duplicate_data->quiz_settings );
334
  if( $is_duplicating_questions == 0 ){
458
  //Update quiz settings
459
  $update_quiz_settings = unserialize($mlw_qmn_duplicate_data->quiz_settings);
460
  $update_pages = unserialize($update_quiz_settings['pages']);
461
+ //get logic data from logic table first or else from quiz_settings
462
+ $query = $wpdb->prepare("SELECT * FROM $logic_table WHERE quiz_id = %d", $quiz_id);
463
+ $logic_data = $wpdb->get_results($query);
464
+ $logic_rules = [];
465
+ if(sizeof($logic_data) > 0){
466
+ foreach ($logic_data as $data) {
467
+ $logic_rules[] = unserialize($data->logic);
468
+ }
469
+ } else {
470
+ $logic_rules = isset( $update_quiz_settings['logic_rules'] ) ? unserialize(unserialize($update_quiz_settings['logic_rules'])) : array();
471
+ }
472
 
473
+
474
  if ( false != $results ) {
475
  $current_user = wp_get_current_user();
476
  $quiz_post = array(
578
  }
579
  }
580
  $update_quiz_settings['pages'] = serialize($update_pages);
581
+ //saves data in logic table first or else in quiz_settings
582
+ foreach($logic_rules as $logic_data){
583
+ $data = array(
584
+ $mlw_new_id,
585
+ serialize($logic_data),
586
+ );
587
+ $value_array[] = stripslashes($wpdb->prepare("(%d, %s)", $data));
588
+ }
589
+ $values = implode(',', $value_array);
590
+ $query = "INSERT INTO $logic_table (quiz_id, logic) VALUES ";
591
+ $query .= $values;
592
+ $saved = $wpdb->query($query);
593
+ if($saved != FALSE){
594
+ update_option("logic_rules_quiz_$mlw_new_id", date(time()));
595
+ $update_quiz_settings['logic_rules'] = '';
596
+ } else {
597
+ $update_quiz_settings['logic_rules'] = serialize(serialize($logic_rules));
598
+ }
599
+
600
  $wpdb->update(
601
  $wpdb->prefix . "mlw_quizzes",
602
  array(
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -853,7 +853,7 @@ class QMNQuizManager {
853
  do_action('qsm_after_all_section');
854
  ?>
855
  <!-- View for pagination -->
856
- <script type="text/template" id="tmpl-qsm-pagination">
857
  <div class="qsm-pagination qmn_pagination border margin-bottom">
858
  <a class="qsm-btn qsm-previous qmn_btn mlw_qmn_quiz_link mlw_previous" href="#"><?php echo esc_html($options->previous_button_text); ?></a>
859
  <span class="qmn_page_message"></span>
@@ -943,7 +943,8 @@ class QMNQuizManager {
943
  $current_page_number++;
944
  }
945
  }
946
- }
 
947
  $question_id_list .= $mlw_question->question_id . "Q";
948
  $question_display .= "<div class='quiz_section {$animation_effect} question-section-id-{$mlw_question->question_id} slide{$mlw_qmn_section_count}'>";
949
  $question_display .= $mlwQuizMasterNext->pluginHelper->display_question($mlw_question->question_type_new, $mlw_question->question_id, $qmn_quiz_options);
@@ -1677,7 +1678,7 @@ class QMNQuizManager {
1677
  $social_display = '';
1678
  if ($qmn_quiz_options->social_media == 1) {
1679
  $settings = (array) get_option('qmn-settings');
1680
- $facebook_app_id = '483815031724529';
1681
  if (isset($settings['facebook_app_id'])) {
1682
  $facebook_app_id = esc_js($settings['facebook_app_id']);
1683
  }
853
  do_action('qsm_after_all_section');
854
  ?>
855
  <!-- View for pagination -->
856
+ <script type="text/template" id="tmpl-qsm-pagination-<?php echo $options->quiz_id;?>">
857
  <div class="qsm-pagination qmn_pagination border margin-bottom">
858
  <a class="qsm-btn qsm-previous qmn_btn mlw_qmn_quiz_link mlw_previous" href="#"><?php echo esc_html($options->previous_button_text); ?></a>
859
  <span class="qmn_page_message"></span>
943
  $current_page_number++;
944
  }
945
  }
946
+ $question_display .= apply_filters('qsm_auto_page_begin_row', '', ($current_page_number - 1), $qmn_quiz_options, $qmn_quiz_questions);
947
+ }
948
  $question_id_list .= $mlw_question->question_id . "Q";
949
  $question_display .= "<div class='quiz_section {$animation_effect} question-section-id-{$mlw_question->question_id} slide{$mlw_qmn_section_count}'>";
950
  $question_display .= $mlwQuizMasterNext->pluginHelper->display_question($mlw_question->question_type_new, $mlw_question->question_id, $qmn_quiz_options);
1678
  $social_display = '';
1679
  if ($qmn_quiz_options->social_media == 1) {
1680
  $settings = (array) get_option('qmn-settings');
1681
+ $facebook_app_id = '594986844960937';
1682
  if (isset($settings['facebook_app_id'])) {
1683
  $facebook_app_id = esc_js($settings['facebook_app_id']);
1684
  }
php/classes/class-qsm-install.php CHANGED
@@ -741,7 +741,7 @@ class QSM_Install {
741
  'help' => __('If left blank, this will default to QSM logo', 'quiz-master-next')
742
  );
743
  $mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_options' );
744
-
745
  //Setting for animation
746
  $field_array = array(
747
  'id' => 'legacy_options',
741
  'help' => __('If left blank, this will default to QSM logo', 'quiz-master-next')
742
  );
743
  $mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_options' );
744
+ do_action('qsm_extra_setting_fields');
745
  //Setting for animation
746
  $field_array = array(
747
  'id' => 'legacy_options',
php/shortcodes.php CHANGED
@@ -112,7 +112,7 @@ add_action('wp_enqueue_scripts', 'qsm_load_main_scripts');
112
  function qsm_generate_fb_header_metadata() {
113
  if (isset($_GET['result_id']) && $_GET['result_id'] != '') {
114
  $settings = (array) get_option('qmn-settings');
115
- $facebook_app_id = '483815031724529';
116
  if (isset($settings['facebook_app_id'])) {
117
  $facebook_app_id = esc_js($settings['facebook_app_id']);
118
  }
112
  function qsm_generate_fb_header_metadata() {
113
  if (isset($_GET['result_id']) && $_GET['result_id'] != '') {
114
  $settings = (array) get_option('qmn-settings');
115
+ $facebook_app_id = '594986844960937';
116
  if (isset($settings['facebook_app_id'])) {
117
  $facebook_app_id = esc_js($settings['facebook_app_id']);
118
  }
php/template-variables.php CHANGED
@@ -235,7 +235,7 @@ function mlw_qmn_variable_social_share($content, $mlw_quiz_array) {
235
  }
236
  if (false !== strpos($content, '%FACEBOOK_SHARE%')) {
237
  $settings = (array) get_option('qmn-settings');
238
- $facebook_app_id = '483815031724529';
239
  if (isset($settings['facebook_app_id'])) {
240
  $facebook_app_id = esc_js($settings['facebook_app_id']);
241
  }
235
  }
236
  if (false !== strpos($content, '%FACEBOOK_SHARE%')) {
237
  $settings = (array) get_option('qmn-settings');
238
+ $facebook_app_id = '594986844960937';
239
  if (isset($settings['facebook_app_id'])) {
240
  $facebook_app_id = esc_js($settings['facebook_app_id']);
241
  }
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.7
6
  Requires PHP: 5.4
7
- Stable tag: 7.1.15
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -140,6 +140,15 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
140
 
141
  == Changelog ==
142
 
 
 
 
 
 
 
 
 
 
143
  = 7.1.15 (April 13, 2021) =
144
  * Bug: Fixed SQL errors due to which questions were disappearing from some old quizzes.
145
  * Bug: Fixed [qsm_result] shortcode format in results page.
4
  Requires at least: 4.9
5
  Tested up to: 5.7
6
  Requires PHP: 5.4
7
+ Stable tag: 7.1.16
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
140
 
141
  == Changelog ==
142
 
143
+ = 7.1.16 (April 29, 2021) =
144
+ * Bug: Fixed the issue with Facebook share.
145
+ * Bug: Fixed issue with timer starting on intro page.
146
+ * Bug: Fixed pagination issue with multiple quizzes on same page.
147
+ * Bug: Fixed issue with tiny-mce causing conflict with other plugins.
148
+ * Bug: Fixed the issue of logic rules not being copied when duplicating quiz.
149
+ * Feature: Added rich textbox for correct answer information.
150
+ * Feature: Added additional condition for Email template for different answers.
151
+
152
  = 7.1.15 (April 13, 2021) =
153
  * Bug: Fixed SQL errors due to which questions were disappearing from some old quizzes.
154
  * Bug: Fixed [qsm_result] shortcode format in results page.