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

Version Description

(April 20, 2019) = * Massive UI update * Closed Enhancement: Support for Image and Rich answers (Issue #146)

Download this release

Release Info

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

Code changes from version 6.2.2 to 6.3.0

css/qsm-admin-question.css CHANGED
@@ -85,7 +85,7 @@
85
  margin-bottom: 5px;
86
  }
87
 
88
- .answers-single div {
89
  margin-left: 5px;
90
  }
91
 
@@ -312,4 +312,17 @@ from { transform: translateY(15%); }
312
  margin: 1.5em;
313
  overflow: hidden;
314
  text-indent: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  }
85
  margin-bottom: 5px;
86
  }
87
 
88
+ .answers-single > div {
89
  margin-left: 5px;
90
  }
91
 
312
  margin: 1.5em;
313
  overflow: hidden;
314
  text-indent: 100%;
315
+ }
316
+
317
+ /**
318
+ * Css for change-answer-editor-label
319
+ */
320
+ .change-answer-editor-label{
321
+ display: inline-block;
322
+ float: right;
323
+ font-size: 14px;
324
+ font-weight: normal !important;
325
+ }
326
+ .change-answer-editor-label > #change-answer-editor{
327
+ width: auto;
328
  }
css/qsm-admin.css CHANGED
@@ -2,8 +2,13 @@
2
  Quizzes/Surveys Page
3
  *********************/
4
 
5
- .qsm-quizes-page .widefat td {
6
  font-size: 16px !important;
 
 
 
 
 
7
  }
8
 
9
  .qsm-quizzes-page-content {
@@ -593,4 +598,64 @@ from { transform: translateY(15%); }
593
  .qsm-popup-slide .qsm-popup__container,
594
  .qsm-popup-slide .qsm-popup__overlay {
595
  will-change: transform;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
596
  }
2
  Quizzes/Surveys Page
3
  *********************/
4
 
5
+ /*.qsm-quizes-page .widefat td {
6
  font-size: 16px !important;
7
+ }*/
8
+
9
+ span.qsm-quiz-name {
10
+ font-size: 14px;
11
+ font-weight: 600;
12
  }
13
 
14
  .qsm-quizzes-page-content {
598
  .qsm-popup-slide .qsm-popup__container,
599
  .qsm-popup-slide .qsm-popup__overlay {
600
  will-change: transform;
601
+ }
602
+
603
+ /**
604
+ * Shortcode accordion
605
+ */
606
+ .sc-opener{
607
+ position: relative;
608
+ font-size: 14px !important;
609
+ margin-bottom: 10px;
610
+ cursor: pointer;
611
+ }
612
+ .sc-opener span.dashicons{
613
+ position: relative;
614
+ top: 2px;
615
+ margin-right: 5px;
616
+ }
617
+ .sc-content{
618
+ display: none;
619
+ }
620
+ .quiz-preview-link{
621
+ margin-left: 10px;
622
+ position: relative;
623
+ top: 3px;
624
+ }
625
+
626
+ #show-advanced-option{
627
+ font-size: 16px;
628
+ cursor: pointer;
629
+ color: #0073aa;
630
+ margin-bottom: 15px;
631
+ }
632
+
633
+ .remove-ads-adv-link{
634
+ text-align: center;
635
+ }
636
+
637
+ .remove-ads-adv-link a{
638
+ background: #1DD969;
639
+ text-align: center;
640
+ color: #fff;
641
+ padding: 3px 10px;
642
+ border-radius: 5px;
643
+ display: inline-block;
644
+ text-decoration: none;
645
+ font-size: 13px;
646
+ font-weight: bold;
647
+ margin-bottom: 10px;
648
+ }
649
+
650
+ .help-decide a.remove-adv-button{
651
+ background: #1DD969;
652
+ text-align: center;
653
+ color: #fff;
654
+ padding: 3px 10px;
655
+ border-radius: 5px;
656
+ display: inline-block;
657
+ text-decoration: none;
658
+ font-size: 13px;
659
+ font-weight: bold;
660
+ margin-left: 10px;
661
  }
js/admin.js CHANGED
@@ -52,5 +52,14 @@ var QSMAdmin;
52
  $( '#qmn_check_all' ).change( function() {
53
  $( '.qmn_delete_checkbox' ).prop( 'checked', jQuery( '#qmn_check_all' ).prop( 'checked' ) );
54
  });
 
 
 
 
 
 
 
 
 
55
  });
56
  }(jQuery));
52
  $( '#qmn_check_all' ).change( function() {
53
  $( '.qmn_delete_checkbox' ).prop( 'checked', jQuery( '#qmn_check_all' ).prop( 'checked' ) );
54
  });
55
+
56
+ $( '.edit-quiz-name' ).click( function(e){
57
+ e.preventDefault();
58
+ MicroModal.show( 'modal-3' );
59
+ });
60
+ $( '#edit-name-button' ).on( 'click', function( event ) {
61
+ event.preventDefault();
62
+ $( '#edit-name-form' ).submit();
63
+ });
64
  });
65
  }(jQuery));
js/qsm-admin-question.js CHANGED
@@ -249,18 +249,26 @@ var QSMQuestion;
249
  if ( ! category ) {
250
  category = '';
251
  }
 
252
  var answers = [];
253
  var $answers = jQuery( '.answers-single');
254
  _.each( $answers, function( answer ) {
255
  var $answer = jQuery( answer );
256
- var answer = $answer.find( '.answer-text' ).val();
 
 
 
 
 
 
 
257
  var points = $answer.find( '.answer-points' ).val();
258
  var correct = 0;
259
  if ( $answer.find( '.answer-correct' ).prop( 'checked' ) ) {
260
  correct = 1;
261
  }
262
  answers.push( [ answer, points, correct ] );
263
- });
264
  model.save(
265
  {
266
  type: type,
@@ -271,6 +279,7 @@ var QSMQuestion;
271
  category: category,
272
  required: required,
273
  answers: answers,
 
274
  },
275
  {
276
  headers: { 'X-WP-Nonce': qsmQuestionSettings.nonce },
@@ -289,8 +298,24 @@ var QSMQuestion;
289
  setTimeout( QSMQuestion.removeNew, 250 );
290
  },
291
  addNewAnswer: function( answer ) {
292
- var answerTemplate = wp.template( 'single-answer' );
293
- $( '#answers' ).append( answerTemplate( { answer: answer[0], points: answer[1], correct: answer[2] } ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  },
295
  openEditPopup: function( questionID ) {
296
  QSMQuestion.prepareCategories();
@@ -298,7 +323,7 @@ var QSMQuestion;
298
  var question = QSMQuestion.questions.get( questionID );
299
  var questionText = QSMQuestion.prepareQuestionText( question.get( 'name' ) );
300
  $( '#edit_question_id' ).val( questionID );
301
- var question_editor = tinyMCE.get( 'question-text' );
302
  if ($('#wp-question-text-wrap').hasClass('html-active')) {
303
  jQuery( "#question-text" ).val( questionText );
304
  } else if ( question_editor ) {
@@ -309,14 +334,24 @@ var QSMQuestion;
309
 
310
  $( '#answers' ).empty();
311
  var answers = question.get( 'answers' );
 
 
 
 
 
312
  _.each( answers, function( answer ) {
313
- QSMQuestion.addNewAnswer( answer );
 
 
 
 
314
  });
315
  $( '#hint' ).val( question.get( 'hint' ) );
316
  $( '#correct_answer_info' ).val( question.get( 'answerInfo' ) );
317
  $( "#question_type" ).val( question.get( 'type' ) );
318
  $( "#comments" ).val( question.get( 'comments' ) );
319
  $( "#required" ).val( question.get( 'required' ) );
 
320
  $( ".category-radio" ).removeAttr( 'checked' );
321
  if ( 0 !== question.get( 'category' ).length ) {
322
  $( ".category-radio" ).val( [question.get( 'category' )] );
@@ -392,8 +427,11 @@ var QSMQuestion;
392
  });
393
  $( '#new-answer-button' ).on( 'click', function( event ) {
394
  event.preventDefault();
395
- var answer = [ '', '', 0 ];
396
- QSMQuestion.addNewAnswer( answer );
 
 
 
397
  });
398
 
399
  $( '.qsm-popup-bank' ).on( 'click', '.import-button', function( event) {
@@ -405,7 +443,21 @@ var QSMQuestion;
405
  event.preventDefault();
406
  QSMQuestion.savePages();
407
  });
408
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  // Adds event handlers for searching questions
410
  $( '#question_search' ).on( 'keyup', function() {
411
  $( '.question' ).each(function() {
@@ -442,5 +494,19 @@ var QSMQuestion;
442
  });
443
  QSMQuestion.prepareEditor();
444
  QSMQuestion.loadQuestions();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  });
446
  }(jQuery));
249
  if ( ! category ) {
250
  category = '';
251
  }
252
+ var answerType = $('#change-answer-editor').val();
253
  var answers = [];
254
  var $answers = jQuery( '.answers-single');
255
  _.each( $answers, function( answer ) {
256
  var $answer = jQuery( answer );
257
+ var answer = '';
258
+ if(answerType == 'rich'){
259
+ var ta_id = $answer.find('textarea').attr('id')
260
+ answer = wp.editor.getContent( ta_id );
261
+ }else{
262
+ answer = $answer.find( '.answer-text' ).val();
263
+ }
264
+
265
  var points = $answer.find( '.answer-points' ).val();
266
  var correct = 0;
267
  if ( $answer.find( '.answer-correct' ).prop( 'checked' ) ) {
268
  correct = 1;
269
  }
270
  answers.push( [ answer, points, correct ] );
271
+ });
272
  model.save(
273
  {
274
  type: type,
279
  category: category,
280
  required: required,
281
  answers: answers,
282
+ answer_editor: answerType,
283
  },
284
  {
285
  headers: { 'X-WP-Nonce': qsmQuestionSettings.nonce },
298
  setTimeout( QSMQuestion.removeNew, 250 );
299
  },
300
  addNewAnswer: function( answer ) {
301
+ var answerTemplate = wp.template( 'single-answer' );
302
+ $( '#answers' ).append( answerTemplate( { answer: answer[0], points: answer[1], correct: answer[2], count: answer[3], question_id: answer[4], answerType: answer[5] } ) );
303
+ if(answer[5] == 'rich'){
304
+ var textarea_id = 'answer-' + answer[4] + '-' + answer[3];
305
+ wp.editor.remove( textarea_id );
306
+ var settings = {
307
+ mediaButtons: true,
308
+ tinymce: {
309
+ forced_root_block : '',
310
+ toolbar1: 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,charmap,undo,redo'
311
+ },
312
+ quicktags: true,
313
+ };
314
+ wp.editor.initialize( textarea_id, settings );
315
+ var anser = QSMQuestion.prepareQuestionText(answer[0]);
316
+ $( textarea_id ).val(anser);
317
+ tinyMCE.get( textarea_id ).setContent( anser );
318
+ }
319
  },
320
  openEditPopup: function( questionID ) {
321
  QSMQuestion.prepareCategories();
323
  var question = QSMQuestion.questions.get( questionID );
324
  var questionText = QSMQuestion.prepareQuestionText( question.get( 'name' ) );
325
  $( '#edit_question_id' ).val( questionID );
326
+ var question_editor = tinyMCE.get( 'question-text' );
327
  if ($('#wp-question-text-wrap').hasClass('html-active')) {
328
  jQuery( "#question-text" ).val( questionText );
329
  } else if ( question_editor ) {
334
 
335
  $( '#answers' ).empty();
336
  var answers = question.get( 'answers' );
337
+ var answerEditor = question.get( 'answerEditor' );
338
+ if( answerEditor === null || typeof answerEditor === "undefined" ){
339
+ answerEditor = 'text';
340
+ }
341
+ var al = 0;
342
  _.each( answers, function( answer ) {
343
+ answer.push(al + 1);
344
+ answer.push(questionID);
345
+ answer.push(answerEditor);
346
+ QSMQuestion.addNewAnswer( answer );
347
+ al++;
348
  });
349
  $( '#hint' ).val( question.get( 'hint' ) );
350
  $( '#correct_answer_info' ).val( question.get( 'answerInfo' ) );
351
  $( "#question_type" ).val( question.get( 'type' ) );
352
  $( "#comments" ).val( question.get( 'comments' ) );
353
  $( "#required" ).val( question.get( 'required' ) );
354
+ $( "#change-answer-editor" ).val( answerEditor );
355
  $( ".category-radio" ).removeAttr( 'checked' );
356
  if ( 0 !== question.get( 'category' ).length ) {
357
  $( ".category-radio" ).val( [question.get( 'category' )] );
427
  });
428
  $( '#new-answer-button' ).on( 'click', function( event ) {
429
  event.preventDefault();
430
+ var answer_length = $( '#answers' ).find('.answers-single').length;
431
+ var question_id = $('#edit_question_id').val();
432
+ var answerType = $('#change-answer-editor').val();
433
+ var answer = [ '', '', 0, answer_length + 1, question_id, answerType];
434
+ QSMQuestion.addNewAnswer( answer );
435
  });
436
 
437
  $( '.qsm-popup-bank' ).on( 'click', '.import-button', function( event) {
443
  event.preventDefault();
444
  QSMQuestion.savePages();
445
  });
446
+
447
+ $( document ).on( 'change', '#change-answer-editor', function( event ) {
448
+ var newVal = $(this).val();
449
+ if(confirm('All answer will be reset, Do you want to still continue?')){
450
+ $('#answers').find( '.answers-single' ).remove();
451
+ }else{
452
+ if(newVal == 'rich'){
453
+ $(this).val('text');
454
+ }else{
455
+ $(this).val('rich');
456
+ }
457
+ return false;
458
+ }
459
+ });
460
+
461
  // Adds event handlers for searching questions
462
  $( '#question_search' ).on( 'keyup', function() {
463
  $( '.question' ).each(function() {
494
  });
495
  QSMQuestion.prepareEditor();
496
  QSMQuestion.loadQuestions();
497
+
498
+ /**
499
+ * Hide/show advanced option
500
+ */
501
+ $(document).on('click','#show-advanced-option',function(){
502
+ var $this = $(this);
503
+ $(this).next('div.advanced-content').slideToggle('slow',function(){
504
+ if ($(this).is(':visible')) {
505
+ $this.text('').html('Hide advance options «');
506
+ } else {
507
+ $this.text('').html('Show advance options »');
508
+ }
509
+ });
510
+ });
511
  });
512
  }(jQuery));
js/qsm-admin.js CHANGED
@@ -26,7 +26,8 @@ var QSMQuizzesSurveys;
26
  'postID': quizData.postID,
27
  'views': quizData.views,
28
  'taken': quizData.taken,
29
- 'lastActivity': quizData.lastActivity
 
30
  };
31
  var row = $( template( values ) );
32
  $( '#the-list' ).append( row );
@@ -105,10 +106,6 @@ var QSMQuizzesSurveys;
105
  event.preventDefault();
106
  $( '#new-quiz-form' ).submit();
107
  });
108
- $( '#edit-name-button' ).on( 'click', function( event ) {
109
- event.preventDefault();
110
- $( '#edit-name-form' ).submit();
111
- });
112
  $( '#duplicate-quiz-button' ).on( 'click', function( event ) {
113
  event.preventDefault();
114
  $( '#duplicate-quiz-form' ).submit();
@@ -118,5 +115,20 @@ var QSMQuizzesSurveys;
118
  $( '#delete-quiz-form' ).submit();
119
  });
120
  QSMQuizzesSurveys.load();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  });
122
  }(jQuery));
26
  'postID': quizData.postID,
27
  'views': quizData.views,
28
  'taken': quizData.taken,
29
+ 'lastActivity': quizData.lastActivity,
30
+ 'lastActivityDateTime': quizData.lastActivityDateTime
31
  };
32
  var row = $( template( values ) );
33
  $( '#the-list' ).append( row );
106
  event.preventDefault();
107
  $( '#new-quiz-form' ).submit();
108
  });
 
 
 
 
109
  $( '#duplicate-quiz-button' ).on( 'click', function( event ) {
110
  event.preventDefault();
111
  $( '#duplicate-quiz-form' ).submit();
115
  $( '#delete-quiz-form' ).submit();
116
  });
117
  QSMQuizzesSurveys.load();
118
+ $(document).on('click','.sc-opener',function(){
119
+ var $this = $(this);
120
+ var shortcode_text = $this.next('.sc-content').text();
121
+ $('#sc-shortcode-model-text').val(shortcode_text);
122
+ MicroModal.show( 'modal-6' );
123
+ });
124
+ $(document).on('click','#sc-copy-shortcode', function(){
125
+
126
+ var copyText = document.getElementById("sc-shortcode-model-text");
127
+
128
+ copyText.select();
129
+ /* Copy the text inside the text field */
130
+ document.execCommand("copy");
131
+
132
+ });
133
  });
134
  }(jQuery));
js/qsm-quiz.js CHANGED
@@ -381,7 +381,7 @@ function qmnValidation( element, quiz_form_id ) {
381
  var empty_error = qmn_quiz_data[ quiz_id ].error_messages.empty;
382
  var incorrect_error = qmn_quiz_data[ quiz_id ].error_messages.incorrect;
383
  qmnResetError( quiz_form_id );
384
- jQuery( element ).each(function(){
385
  if ( jQuery( this ).attr( 'class' )) {
386
  if( jQuery( this ).attr( 'class' ).indexOf( 'mlwEmail' ) > -1 && this.value !== "" ) {
387
  var x = this.value;
@@ -398,6 +398,7 @@ function qmnValidation( element, quiz_form_id ) {
398
  qmnDisplayError( number_error, jQuery( this ), quiz_form_id );
399
  result = false;
400
  }
 
401
  if( jQuery( this ).attr( 'class' ).indexOf( 'mlwRequiredText' ) > -1 && this.value === "" ) {
402
  qmnDisplayError( empty_error, jQuery( this ), quiz_form_id );
403
  result = false;
@@ -430,6 +431,13 @@ function qmnValidation( element, quiz_form_id ) {
430
  result = false;
431
  }
432
  }
 
 
 
 
 
 
 
433
  }
434
  }
435
  });
381
  var empty_error = qmn_quiz_data[ quiz_id ].error_messages.empty;
382
  var incorrect_error = qmn_quiz_data[ quiz_id ].error_messages.incorrect;
383
  qmnResetError( quiz_form_id );
384
+ jQuery( element ).each(function(){
385
  if ( jQuery( this ).attr( 'class' )) {
386
  if( jQuery( this ).attr( 'class' ).indexOf( 'mlwEmail' ) > -1 && this.value !== "" ) {
387
  var x = this.value;
398
  qmnDisplayError( number_error, jQuery( this ), quiz_form_id );
399
  result = false;
400
  }
401
+
402
  if( jQuery( this ).attr( 'class' ).indexOf( 'mlwRequiredText' ) > -1 && this.value === "" ) {
403
  qmnDisplayError( empty_error, jQuery( this ), quiz_form_id );
404
  result = false;
431
  result = false;
432
  }
433
  }
434
+ //Google recaptcha validation
435
+ if( jQuery( this ).attr( 'class' ).indexOf( 'g-recaptcha-response' ) > -1 ) {
436
+ if(grecaptcha.getResponse() == "") {
437
+ alert('ReCaptcha is missing');
438
+ result = false;
439
+ }
440
+ }
441
  }
442
  }
443
  });
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: 6.2.2
6
  * Author: QSM Team
7
- * Author URI: https://www.quizandsurveymaster.com/
8
- * Plugin URI: https://www.quizandsurveymaster.com/
9
  * Text Domain: quiz-master-next
10
  *
11
  * @author QSM Team
12
- * @version 6.2.2
13
  * @package QSM
14
  */
15
 
@@ -34,7 +34,7 @@ class MLWQuizMasterNext {
34
  * @var string
35
  * @since 4.0.0
36
  */
37
- public $version = '6.2.2';
38
 
39
  /**
40
  * QSM Alert Manager Object
@@ -269,15 +269,15 @@ class MLWQuizMasterNext {
269
  public function setup_admin_menu() {
270
  if ( function_exists( 'add_menu_page' ) ) {
271
  add_menu_page( 'Quiz And Survey Master', __( 'Quizzes/Surveys', 'quiz-master-next' ), 'moderate_comments', __FILE__, 'qsm_generate_quizzes_surveys_page', 'dashicons-feedback' );
272
- add_submenu_page( __FILE__, __( 'Settings', 'quiz-master-next' ), __( 'Settings', 'quiz-master-next' ), 'moderate_comments', 'mlw_quiz_options', 'qsm_generate_quiz_options' );
273
  add_submenu_page( __FILE__, __( 'Results', 'quiz-master-next' ), __( 'Results', 'quiz-master-next' ), 'moderate_comments', 'mlw_quiz_results', 'qsm_generate_admin_results_page' );
274
- add_submenu_page( __FILE__, __( 'Result Details', 'quiz-master-next' ), __( 'Result Details', 'quiz-master-next' ), 'moderate_comments', 'qsm_quiz_result_details', 'qsm_generate_result_details' );
275
  add_submenu_page( __FILE__, __( 'Settings', 'quiz-master-next' ), __( 'Settings', 'quiz-master-next' ), 'manage_options', 'qmn_global_settings', array( 'QMNGlobalSettingsPage', 'display_page' ) );
276
  add_submenu_page( __FILE__, __( 'Tools', 'quiz-master-next' ), __( 'Tools', 'quiz-master-next' ), 'manage_options', 'qsm_quiz_tools', 'qsm_generate_quiz_tools' );
277
  add_submenu_page( __FILE__, __( 'Stats', 'quiz-master-next' ), __( 'Stats', 'quiz-master-next' ), 'moderate_comments', 'qmn_stats', 'qmn_generate_stats_page' );
278
  add_submenu_page( __FILE__, __( 'Addon Settings', 'quiz-master-next' ), __( 'Addon Settings', 'quiz-master-next' ), 'moderate_comments', 'qmn_addons', 'qmn_addons_page' );
279
  add_submenu_page( __FILE__, __( 'QSM About', 'quiz-master-next' ), __( 'QSM About', 'quiz-master-next' ), 'moderate_comments', 'qsm_about_page', 'qsm_generate_about_page' );
280
- add_submenu_page( __FILE__, __( 'Help', 'quiz-master-next' ), __( 'Help', 'quiz-master-next' ), 'moderate_comments', 'qsm_quiz_help', 'qsm_generate_help_page' );
281
  }
282
  }
283
 
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
+ * Version: 6.3.0
6
  * Author: QSM Team
7
+ * Author URI: https://quizandsurveymaster.com/
8
+ * Plugin URI: https://quizandsurveymaster.com/
9
  * Text Domain: quiz-master-next
10
  *
11
  * @author QSM Team
12
+ * @version 6.3.0
13
  * @package QSM
14
  */
15
 
34
  * @var string
35
  * @since 4.0.0
36
  */
37
+ public $version = '6.3.0';
38
 
39
  /**
40
  * QSM Alert Manager Object
269
  public function setup_admin_menu() {
270
  if ( function_exists( 'add_menu_page' ) ) {
271
  add_menu_page( 'Quiz And Survey Master', __( 'Quizzes/Surveys', 'quiz-master-next' ), 'moderate_comments', __FILE__, 'qsm_generate_quizzes_surveys_page', 'dashicons-feedback' );
272
+ add_submenu_page( NULL, __( 'Settings', 'quiz-master-next' ), __( 'Settings', 'quiz-master-next' ), 'moderate_comments', 'mlw_quiz_options', 'qsm_generate_quiz_options' );
273
  add_submenu_page( __FILE__, __( 'Results', 'quiz-master-next' ), __( 'Results', 'quiz-master-next' ), 'moderate_comments', 'mlw_quiz_results', 'qsm_generate_admin_results_page' );
274
+ add_submenu_page( NULL, __( 'Result Details', 'quiz-master-next' ), __( 'Result Details', 'quiz-master-next' ), 'moderate_comments', 'qsm_quiz_result_details', 'qsm_generate_result_details' );
275
  add_submenu_page( __FILE__, __( 'Settings', 'quiz-master-next' ), __( 'Settings', 'quiz-master-next' ), 'manage_options', 'qmn_global_settings', array( 'QMNGlobalSettingsPage', 'display_page' ) );
276
  add_submenu_page( __FILE__, __( 'Tools', 'quiz-master-next' ), __( 'Tools', 'quiz-master-next' ), 'manage_options', 'qsm_quiz_tools', 'qsm_generate_quiz_tools' );
277
  add_submenu_page( __FILE__, __( 'Stats', 'quiz-master-next' ), __( 'Stats', 'quiz-master-next' ), 'moderate_comments', 'qmn_stats', 'qmn_generate_stats_page' );
278
  add_submenu_page( __FILE__, __( 'Addon Settings', 'quiz-master-next' ), __( 'Addon Settings', 'quiz-master-next' ), 'moderate_comments', 'qmn_addons', 'qmn_addons_page' );
279
  add_submenu_page( __FILE__, __( 'QSM About', 'quiz-master-next' ), __( 'QSM About', 'quiz-master-next' ), 'moderate_comments', 'qsm_about_page', 'qsm_generate_about_page' );
280
+ add_submenu_page( __FILE__, __( 'Help', 'quiz-master-next' ), __( 'Help', 'quiz-master-next' ), 'moderate_comments', 'qsm_quiz_help', 'qsm_generate_help_page' );
281
  }
282
  }
283
 
php/admin/options-page-questions-tab.php CHANGED
@@ -145,36 +145,46 @@ function qsm_options_questions_tab_content() {
145
 
146
  </div>
147
  <a href="#" class="button" id="new-answer-button"><?php _e( 'Add New Answer!', 'quiz-master-next'); ?></a>
 
 
 
 
 
 
 
148
  </div>
149
- <div id="correct_answer_area" class="qsm-row">
 
 
150
  <label><?php _e( 'Correct Answer Info', 'quiz-master-next' ); ?></label>
151
  <input type="text" name="correct_answer_info" value="" id="correct_answer_info" />
152
- </div>
153
- <div id="hint_area" class="qsm-row">
154
- <label><?php _e( 'Hint', 'quiz-master-next' ); ?></label>
155
- <input type="text" name="hint" value="" id="hint"/>
156
- </div>
157
- <div id="comment_area" class="qsm-row">
158
- <label><?php _e( 'Comment Field', 'quiz-master-next' ); ?></label>
159
- <select name="comments" id="comments">
160
- <option value="0"><?php _e('Small Text Field', 'quiz-master-next'); ?></option>
161
- <option value="2"><?php _e('Large Text Field', 'quiz-master-next'); ?></option>
162
- <option value="1" selected="selected"><?php _e('None', 'quiz-master-next'); ?></option>
163
- <select>
164
- </div>
165
- <div id="required_area" class="qsm-row">
166
- <label><?php _e( 'Required?', 'quiz-master-next' ); ?></label>
167
- <select name="required" id="required">
168
- <option value="0" selected="selected"><?php _e( 'Yes', 'quiz-master-next' ); ?></option>
169
- <option value="1"><?php _e( 'No', 'quiz-master-next' ); ?></option>
170
- </select>
171
- </div>
172
- <div id="category_area" class="qsm-row">
173
- <label><?php _e( 'Category', 'quiz-master-next' ); ?></label>
174
- <div id="categories">
175
- <input type="radio" name="category" class="category-radio" id="new_category_new" value="new_category"><label for="new_category_new">New: <input type='text' id='new_category' value='' /></label>
176
- </div>
177
- </div>
 
178
  </main>
179
  <footer class="qsm-popup__footer">
180
  <button id="save-popup-button" class="qsm-popup__btn qsm-popup__btn-primary">Save Question</button>
@@ -233,7 +243,13 @@ function qsm_options_questions_tab_content() {
233
  <script type="text/template" id="tmpl-single-answer">
234
  <div class="answers-single">
235
  <div><a href="#" class="delete-answer-button"><span class="dashicons dashicons-trash"></span></a></div>
236
- <div class="answer-text-div"><input type="text" class="answer-text" value="{{data.answer}}" placeholder="Your answer"/></div>
 
 
 
 
 
 
237
  <div><input type="text" class="answer-points" value="{{data.points}}" placeholder="Points"/></div>
238
  <div><input type="checkbox" class="answer-correct" value="1" <# if ( 1 == data.correct ) { #> checked="checked"/> <# } #></div>
239
  </div>
145
 
146
  </div>
147
  <a href="#" class="button" id="new-answer-button"><?php _e( 'Add New Answer!', 'quiz-master-next'); ?></a>
148
+ <label class="change-answer-editor-label">
149
+ <?php _e( 'Answers Type: ', 'quiz-master-next' ); ?>
150
+ <select id="change-answer-editor">
151
+ <option value="text">Text Answers</option>
152
+ <option value="rich">Rich Answers</option>
153
+ </select>
154
+ </label>
155
  </div>
156
+ <p id="show-advanced-option">Show advance options &raquo;</p>
157
+ <div class="advanced-content" style="display: none;">
158
+ <div id="correct_answer_area" class="qsm-row">
159
  <label><?php _e( 'Correct Answer Info', 'quiz-master-next' ); ?></label>
160
  <input type="text" name="correct_answer_info" value="" id="correct_answer_info" />
161
+ </div>
162
+ <div id="hint_area" class="qsm-row">
163
+ <label><?php _e( 'Hint', 'quiz-master-next' ); ?></label>
164
+ <input type="text" name="hint" value="" id="hint"/>
165
+ </div>
166
+ <div id="comment_area" class="qsm-row">
167
+ <label><?php _e( 'Comment Field', 'quiz-master-next' ); ?></label>
168
+ <select name="comments" id="comments">
169
+ <option value="0"><?php _e('Small Text Field', 'quiz-master-next'); ?></option>
170
+ <option value="2"><?php _e('Large Text Field', 'quiz-master-next'); ?></option>
171
+ <option value="1" selected="selected"><?php _e('None', 'quiz-master-next'); ?></option>
172
+ <select>
173
+ </div>
174
+ <div id="required_area" class="qsm-row">
175
+ <label><?php _e( 'Required?', 'quiz-master-next' ); ?></label>
176
+ <select name="required" id="required">
177
+ <option value="0" selected="selected"><?php _e( 'Yes', 'quiz-master-next' ); ?></option>
178
+ <option value="1"><?php _e( 'No', 'quiz-master-next' ); ?></option>
179
+ </select>
180
+ </div>
181
+ <div id="category_area" class="qsm-row">
182
+ <label><?php _e( 'Category', 'quiz-master-next' ); ?></label>
183
+ <div id="categories">
184
+ <input type="radio" name="category" class="category-radio" id="new_category_new" value="new_category"><label for="new_category_new">New: <input type='text' id='new_category' value='' /></label>
185
+ </div>
186
+ </div>
187
+ </div>
188
  </main>
189
  <footer class="qsm-popup__footer">
190
  <button id="save-popup-button" class="qsm-popup__btn qsm-popup__btn-primary">Save Question</button>
243
  <script type="text/template" id="tmpl-single-answer">
244
  <div class="answers-single">
245
  <div><a href="#" class="delete-answer-button"><span class="dashicons dashicons-trash"></span></a></div>
246
+ <div class="answer-text-div">
247
+ <# if ( 'rich' == data.answerType ) { #>
248
+ <textarea id="answer-{{data.question_id}}-{{data.count}}"></textarea>
249
+ <# } else { #>
250
+ <input type="text" class="answer-text" value="{{data.answer}}" placeholder="Your answer"/>
251
+ <# } #>
252
+ </div>
253
  <div><input type="text" class="answer-points" value="{{data.points}}" placeholder="Points"/></div>
254
  <div><input type="checkbox" class="answer-correct" value="1" <# if ( 1 == data.correct ) { #> checked="checked"/> <# } #></div>
255
  </div>
php/admin/quiz-options-page.php CHANGED
@@ -48,13 +48,22 @@ function qsm_generate_quiz_options() {
48
  wp_enqueue_script( 'jquery-effects-explode' );
49
 
50
  wp_enqueue_script( 'qmn_admin_js', plugins_url( '../../js/admin.js', __FILE__ ), array( 'backbone', 'underscore', 'wp-util' ), $mlwQuizMasterNext->version, true );
 
51
  wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ), array(), $mlwQuizMasterNext->version );
52
  wp_enqueue_style( 'qmn_jquery_redmond_theme', plugins_url( '../../css/jquery-ui.css', __FILE__ ) );
53
  wp_enqueue_script( 'math_jax', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' );
 
 
 
 
 
 
 
54
  ?>
55
- <div class="wrap">
56
  <div class='mlw_quiz_options'>
57
- <h1><?php echo $quiz_name; ?></h1>
 
58
  <?php
59
  // Puts all output from tab into ob_get_contents below.
60
  ob_start();
@@ -110,6 +119,28 @@ function qsm_generate_quiz_options() {
110
  echo $mlw_output;
111
  ?>
112
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  </div>
114
 
115
  <!-- Backbone Views -->
48
  wp_enqueue_script( 'jquery-effects-explode' );
49
 
50
  wp_enqueue_script( 'qmn_admin_js', plugins_url( '../../js/admin.js', __FILE__ ), array( 'backbone', 'underscore', 'wp-util' ), $mlwQuizMasterNext->version, true );
51
+ wp_enqueue_script( 'micromodal_script', plugins_url( '../../js/micromodal.min.js', __FILE__ ) );
52
  wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ), array(), $mlwQuizMasterNext->version );
53
  wp_enqueue_style( 'qmn_jquery_redmond_theme', plugins_url( '../../css/jquery-ui.css', __FILE__ ) );
54
  wp_enqueue_script( 'math_jax', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' );
55
+
56
+ // Edit Quiz Name.
57
+ if ( isset( $_POST['qsm_edit_name_quiz_nonce'] ) && wp_verify_nonce( $_POST['qsm_edit_name_quiz_nonce'], 'qsm_edit_name_quiz' ) ) {
58
+ $quiz_id = intval( $_POST['edit_quiz_id'] );
59
+ $quiz_name = htmlspecialchars( stripslashes( $_POST['edit_quiz_name'] ), ENT_QUOTES );
60
+ $mlwQuizMasterNext->quizCreator->edit_quiz_name( $quiz_id, $quiz_name );
61
+ }
62
  ?>
63
+ <div class="wrap">
64
  <div class='mlw_quiz_options'>
65
+ <h1 style="display: inline-block;"><?php echo $quiz_name; ?></h1>
66
+ <a style="display: inline-block;margin-top: 10px;margin-bottom: 15px;margin-left: 10px;" hre="#" class="edit-quiz-name button button-primary">Edit Name</a>
67
  <?php
68
  // Puts all output from tab into ob_get_contents below.
69
  ob_start();
119
  echo $mlw_output;
120
  ?>
121
  </div>
122
+ <div class="qsm-popup qsm-popup-slide" id="modal-3" aria-hidden="false">
123
+ <div class="qsm-popup__overlay" tabindex="-1" data-micromodal-close="">
124
+ <div class="qsm-popup__container" role="dialog" aria-modal="true" aria-labelledby="modal-3-title">
125
+ <header class="qsm-popup__header">
126
+ <h2 class="qsm-popup__title" id="modal-3-title">Edit Name</h2>
127
+ <a class="qsm-popup__close" aria-label="Close modal" data-micromodal-close=""></a>
128
+ </header>
129
+ <main class="qsm-popup__content" id="modal-3-content">
130
+ <form action='' method='post' id="edit-name-form">
131
+ <label><?php _e( 'Name', 'quiz-master-next' ); ?></label>
132
+ <input type="text" id="edit_quiz_name" name="edit_quiz_name" value="<?php echo $quiz_name; ?>" />
133
+ <input type="hidden" id="edit_quiz_id" name="edit_quiz_id" value="<?php echo isset($_GET['quiz_id']) ? $_GET['quiz_id'] : ''; ?>" />
134
+ <?php wp_nonce_field( 'qsm_edit_name_quiz', 'qsm_edit_name_quiz_nonce' ); ?>
135
+ </form>
136
+ </main>
137
+ <footer class="qsm-popup__footer">
138
+ <button id="edit-name-button" class="qsm-popup__btn qsm-popup__btn-primary">Edit</button>
139
+ <button class="qsm-popup__btn" data-micromodal-close="" aria-label="Close this dialog window">Cancel</button>
140
+ </footer>
141
+ </div>
142
+ </div>
143
+ </div>
144
  </div>
145
 
146
  <!-- Backbone Views -->
php/admin/quizzes-page.php CHANGED
@@ -43,13 +43,6 @@ function qsm_generate_quizzes_surveys_page() {
43
  $mlwQuizMasterNext->quizCreator->delete_quiz( $quiz_id, $quiz_name );
44
  }
45
 
46
- // Edit Quiz Name.
47
- if ( isset( $_POST['qsm_edit_name_quiz_nonce'] ) && wp_verify_nonce( $_POST['qsm_edit_name_quiz_nonce'], 'qsm_edit_name_quiz' ) ) {
48
- $quiz_id = intval( $_POST['edit_quiz_id'] );
49
- $quiz_name = htmlspecialchars( stripslashes( $_POST['edit_quiz_name'] ), ENT_QUOTES );
50
- $mlwQuizMasterNext->quizCreator->edit_quiz_name( $quiz_id, $quiz_name );
51
- }
52
-
53
  // Duplicate Quiz.
54
  if ( isset( $_POST['qsm_duplicate_quiz_nonce'] ) && wp_verify_nonce( $_POST['qsm_duplicate_quiz_nonce'], 'qsm_duplicate_quiz' ) ) {
55
  $quiz_id = intval( $_POST['duplicate_quiz_id'] );
@@ -133,7 +126,8 @@ function qsm_generate_quizzes_surveys_page() {
133
  'postID' => $post_to_quiz_array[ $quiz->quiz_id ]['id'],
134
  'views' => $quiz->quiz_views,
135
  'taken' => $quiz->quiz_taken,
136
- 'lastActivity' => $activity_date . ' ' . $activity_time,
 
137
  );
138
  }
139
  $total_count = count( $quiz_json_array );
@@ -168,9 +162,7 @@ function qsm_generate_quizzes_surveys_page() {
168
  <thead>
169
  <tr>
170
  <th><?php esc_html_e( 'Name', 'quiz-master-next' ); ?></th>
171
- <th><?php esc_html_e( 'URL', 'quiz-master-next' ); ?></th>
172
  <th><?php esc_html_e( 'Shortcode', 'quiz-master-next' ); ?></th>
173
- <th><?php esc_html_e( 'Link Shortcode', 'quiz-master-next' ); ?></th>
174
  <th><?php esc_html_e( 'Views/Taken', 'quiz-master-next' ); ?></th>
175
  <th><?php esc_html_e( 'Last Modified', 'quiz-master-next' ); ?></th>
176
  </tr>
@@ -181,9 +173,7 @@ function qsm_generate_quizzes_surveys_page() {
181
  <tfoot>
182
  <tr>
183
  <th><?php esc_html_e( 'Name', 'quiz-master-next' ); ?></th>
184
- <th><?php esc_html_e( 'URL', 'quiz-master-next' ); ?></th>
185
  <th><?php esc_html_e( 'Shortcode', 'quiz-master-next' ); ?></th>
186
- <th><?php esc_html_e( 'Link Shortcode', 'quiz-master-next' ); ?></th>
187
  <th><?php esc_html_e( 'Views/Taken', 'quiz-master-next' ); ?></th>
188
  <th><?php esc_html_e( 'Last Modified', 'quiz-master-next' ); ?></th>
189
  </tr>
@@ -195,11 +185,11 @@ function qsm_generate_quizzes_surveys_page() {
195
  ?>
196
  <div class="qsm-news-ads">
197
  <h3 class="qsm-news-ads-title"><?php esc_html_e( 'QSM News', 'quiz-master-next' ); ?></h3>
198
- <div class="qsm-info-widget">
199
  <h3>Keep your WordPress site healthy and secure!</h3>
200
  <p>Easily monitor your WordPress sites to ensure they stay up, healthy, and secure with our new WordPress plugin, WP Health!</p>
201
  <a target="_blank" href="http://bit.ly/2Mr2SqC" class="button-primary"><?php esc_html_e( 'Learn More', 'quiz-master-next' ); ?></a>
202
- </div>
203
  <div class="qsm-info-widget">
204
  <h3><?php esc_html_e( 'Subscribe to our newsletter!', 'quiz-master-next' ); ?></h3>
205
  <p><?php esc_html_e( 'Join our mailing list to learn about our newest features, receive email-only promotions, receive tips and guides, and more!', 'quiz-master-next' ); ?></p>
@@ -233,6 +223,9 @@ function qsm_generate_quizzes_surveys_page() {
233
  <?php
234
  }
235
  ?>
 
 
 
236
  </div>
237
  <?php
238
  }
@@ -285,30 +278,6 @@ function qsm_generate_quizzes_surveys_page() {
285
  </div>
286
  </div>
287
 
288
- <!-- Popup for edit quiz name -->
289
- <div class="qsm-popup qsm-popup-slide" id="modal-3" aria-hidden="true">
290
- <div class="qsm-popup__overlay" tabindex="-1" data-micromodal-close>
291
- <div class="qsm-popup__container" role="dialog" aria-modal="true" aria-labelledby="modal-3-title">
292
- <header class="qsm-popup__header">
293
- <h2 class="qsm-popup__title" id="modal-3-title"><?php _e( 'Edit Name', 'quiz-master-next' ); ?></h2>
294
- <a class="qsm-popup__close" aria-label="Close modal" data-micromodal-close></a>
295
- </header>
296
- <main class="qsm-popup__content" id="modal-3-content">
297
- <form action='' method='post' id="edit-name-form">
298
- <label><?php _e( 'Name', 'quiz-master-next' ); ?></label>
299
- <input type="text" id="edit_quiz_name" name="edit_quiz_name" />
300
- <input type="hidden" id="edit_quiz_id" name="edit_quiz_id" />
301
- <?php wp_nonce_field( 'qsm_edit_name_quiz', 'qsm_edit_name_quiz_nonce' ); ?>
302
- </form>
303
- </main>
304
- <footer class="qsm-popup__footer">
305
- <button id="edit-name-button" class="qsm-popup__btn qsm-popup__btn-primary"><?php _e('Edit', 'quiz-master-next'); ?></button>
306
- <button class="qsm-popup__btn" data-micromodal-close aria-label="Close this dialog window"><?php _e('Cancel', 'quiz-master-next'); ?></button>
307
- </footer>
308
- </div>
309
- </div>
310
- </div>
311
-
312
  <!-- Popup for duplicate quiz -->
313
  <div class="qsm-popup qsm-popup-slide" id="modal-4" aria-hidden="true">
314
  <div class="qsm-popup__overlay" tabindex="-1" data-micromodal-close>
@@ -358,6 +327,22 @@ function qsm_generate_quizzes_surveys_page() {
358
  </div>
359
  </div>
360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  <!-- Templates -->
362
  <script type="text/template" id="tmpl-no-quiz">
363
  <h2><?php _e( 'You do not have any quizzes or surveys. Click "Add New" to get started.', 'quiz-master-next' ); ?></h2>
@@ -368,29 +353,29 @@ function qsm_generate_quizzes_surveys_page() {
368
  <script type="text/template" id="tmpl-quiz-row">
369
  <tr class="qsm-quiz-row" data-id="{{ data.id }}">
370
  <td class="post-title column-title">
371
- <span class="qsm-quiz-name">{{ data.name }}</span> <a class="qsm-edit-name" href="#"><?php _e( 'Edit Name', 'quiz-master-next' ); ?></a>
372
  <div class="row-actions">
373
- <a class="qsm-action-link" href="admin.php?page=mlw_quiz_options&&quiz_id={{ data.id }}"><?php _e( 'Edit', 'quiz-master-next' ); ?></a> |
374
- <a class="qsm-action-link" href="admin.php?page=mlw_quiz_results&&quiz_id={{ data.id }}"><?php _e( 'Results', 'quiz-master-next' ); ?></a> |
375
- <a class="qsm-action-link qsm-action-link-duplicate" href="#"><?php _e( 'Duplicate', 'quiz-master-next' ); ?></a> |
376
- <a class="qsm-action-link qsm-action-link-delete" href="#"><?php _e( 'Delete', 'quiz-master-next' ); ?></a>
 
377
  </div>
378
  </td>
379
  <td>
380
- <a href="{{ data.link }}"><?php _e( 'View Quiz/Survey', 'quiz-master-next' ); ?></a>
381
- <div class="row-actions">
382
- <a class="qsm-action-link" href="post.php?post={{ data.postID }}&action=edit"><?php _e( 'Edit Post Settings', 'quiz-master-next' ); ?></a>
383
- </div>
384
- </td>
385
- <td>[qsm quiz={{ data.id }}]</td>
386
- <td>[qsm_link id={{ data.id }}]<?php _e( 'Click here', 'quiz-master-next' ); ?>[/qsm_link]</td>
387
  <td>
388
  {{ data.views }}/{{ data.taken }}
389
  <div class="row-actions">
390
- <a class="qsm-action-link qsm-action-link-reset" href="#"><?php _e( 'Reset', 'quiz-master-next' ); ?></a>
 
391
  </div>
392
  </td>
393
- <td>{{ data.lastActivity }}</td>
394
  </tr>
395
  </script>
396
  </div>
43
  $mlwQuizMasterNext->quizCreator->delete_quiz( $quiz_id, $quiz_name );
44
  }
45
 
 
 
 
 
 
 
 
46
  // Duplicate Quiz.
47
  if ( isset( $_POST['qsm_duplicate_quiz_nonce'] ) && wp_verify_nonce( $_POST['qsm_duplicate_quiz_nonce'], 'qsm_duplicate_quiz' ) ) {
48
  $quiz_id = intval( $_POST['duplicate_quiz_id'] );
126
  'postID' => $post_to_quiz_array[ $quiz->quiz_id ]['id'],
127
  'views' => $quiz->quiz_views,
128
  'taken' => $quiz->quiz_taken,
129
+ 'lastActivity' => $activity_date,
130
+ 'lastActivityDateTime' => $activity_date . ' ' .$activity_time,
131
  );
132
  }
133
  $total_count = count( $quiz_json_array );
162
  <thead>
163
  <tr>
164
  <th><?php esc_html_e( 'Name', 'quiz-master-next' ); ?></th>
 
165
  <th><?php esc_html_e( 'Shortcode', 'quiz-master-next' ); ?></th>
 
166
  <th><?php esc_html_e( 'Views/Taken', 'quiz-master-next' ); ?></th>
167
  <th><?php esc_html_e( 'Last Modified', 'quiz-master-next' ); ?></th>
168
  </tr>
173
  <tfoot>
174
  <tr>
175
  <th><?php esc_html_e( 'Name', 'quiz-master-next' ); ?></th>
 
176
  <th><?php esc_html_e( 'Shortcode', 'quiz-master-next' ); ?></th>
 
177
  <th><?php esc_html_e( 'Views/Taken', 'quiz-master-next' ); ?></th>
178
  <th><?php esc_html_e( 'Last Modified', 'quiz-master-next' ); ?></th>
179
  </tr>
185
  ?>
186
  <div class="qsm-news-ads">
187
  <h3 class="qsm-news-ads-title"><?php esc_html_e( 'QSM News', 'quiz-master-next' ); ?></h3>
188
+ <!-- <div class="qsm-info-widget">
189
  <h3>Keep your WordPress site healthy and secure!</h3>
190
  <p>Easily monitor your WordPress sites to ensure they stay up, healthy, and secure with our new WordPress plugin, WP Health!</p>
191
  <a target="_blank" href="http://bit.ly/2Mr2SqC" class="button-primary"><?php esc_html_e( 'Learn More', 'quiz-master-next' ); ?></a>
192
+ </div>-->
193
  <div class="qsm-info-widget">
194
  <h3><?php esc_html_e( 'Subscribe to our newsletter!', 'quiz-master-next' ); ?></h3>
195
  <p><?php esc_html_e( 'Join our mailing list to learn about our newest features, receive email-only promotions, receive tips and guides, and more!', 'quiz-master-next' ); ?></p>
223
  <?php
224
  }
225
  ?>
226
+ <div class="remove-ads-adv-link">
227
+ <a target="_blank" href="https://quizandsurveymaster.com/downloads/advertisement-gone/"><span class="dashicons dashicons-no-alt"></span> Remove Ads</a>
228
+ </div>
229
  </div>
230
  <?php
231
  }
278
  </div>
279
  </div>
280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  <!-- Popup for duplicate quiz -->
282
  <div class="qsm-popup qsm-popup-slide" id="modal-4" aria-hidden="true">
283
  <div class="qsm-popup__overlay" tabindex="-1" data-micromodal-close>
327
  </div>
328
  </div>
329
 
330
+ <!-- Popup for delete quiz -->
331
+ <div class="qsm-popup qsm-popup-slide" id="modal-6" aria-hidden="true">
332
+ <div class="qsm-popup__overlay" tabindex="-1" data-micromodal-close>
333
+ <div class="qsm-popup__container" role="dialog" aria-modal="true" aria-labelledby="modal-5-title">
334
+ <header class="qsm-popup__header">
335
+ <h2 class="qsm-popup__title" id="modal-5-title"><?php _e( 'Shortcode', 'quiz-master-next' ); ?></h2>
336
+ <a class="qsm-popup__close" aria-label="Close modal" data-micromodal-close></a>
337
+ </header>
338
+ <main class="qsm-popup__content" id="modal-5-content">
339
+ <input type="text" value="" id="sc-shortcode-model-text" style="width: 72%;padding: 5px;">
340
+ <button class="button button-primary" id="sc-copy-shortcode">Copy Shortcode</button>
341
+ </main>
342
+ </div>
343
+ </div>
344
+ </div>
345
+
346
  <!-- Templates -->
347
  <script type="text/template" id="tmpl-no-quiz">
348
  <h2><?php _e( 'You do not have any quizzes or surveys. Click "Add New" to get started.', 'quiz-master-next' ); ?></h2>
353
  <script type="text/template" id="tmpl-quiz-row">
354
  <tr class="qsm-quiz-row" data-id="{{ data.id }}">
355
  <td class="post-title column-title">
356
+ <a class="row-title" href="admin.php?page=mlw_quiz_options&&quiz_id={{ data.id }}" aria-label="{{ data.name }}">{{ data.name }}</a><a target="_blank" class="quiz-preview-link" href="{{ data.link }}"><span class="dashicons dashicons-external"></span></a>
357
  <div class="row-actions">
358
+ <a class="qsm-action-link" href="admin.php?page=mlw_quiz_options&&quiz_id={{ data.id }}"><?php _e( 'Edit', 'quiz-master-next' ); ?></a> |
359
+ <a class="qsm-action-link" href="post.php?post={{ data.postID }}&action=edit"><?php _e( 'Post Settings', 'quiz-master-next' ); ?></a> |
360
+ <a class="qsm-action-link qsm-action-link-duplicate" href="#"><?php _e( 'Duplicate', 'quiz-master-next' ); ?></a> |
361
+ <a class="qsm-action-link qsm-action-link-delete" href="#"><?php _e( 'Delete', 'quiz-master-next' ); ?></a> |
362
+ <a class="qsm-action-link" target="_blank" href="{{ data.link }}"><?php _e( 'Preview', 'quiz-master-next' ); ?></a>
363
  </div>
364
  </td>
365
  <td>
366
+ <p class="sc-opener"><span class="dashicons dashicons-editor-contract"></span> Embed</p>
367
+ <div class="sc-content">[qsm quiz={{ data.id }}]</div>
368
+ <p class="sc-opener"><span class="dashicons dashicons-admin-links"></span> Link</p>
369
+ <div class="sc-content">[qsm_link id={{ data.id }}]<?php _e( 'Click here', 'quiz-master-next' ); ?>[/qsm_link]</div>
370
+ </td>
 
 
371
  <td>
372
  {{ data.views }}/{{ data.taken }}
373
  <div class="row-actions">
374
+ <a class="qsm-action-link qsm-action-link-reset" href="#"><?php _e( 'Reset', 'quiz-master-next' ); ?></a> |
375
+ <a class="qsm-action-link" href="admin.php?page=mlw_quiz_results&&quiz_id={{ data.id }}"><?php _e( 'Results', 'quiz-master-next' ); ?></a>
376
  </div>
377
  </td>
378
+ <td><abbr title="{{ data.lastActivityDateTime }}">{{ data.lastActivity }}</abbr></td>
379
  </tr>
380
  </script>
381
  </div>
php/adverts-generate.php CHANGED
@@ -29,8 +29,8 @@ function qsm_show_adverts() {
29
  switch ( $rand_int ) {
30
  case 0:
31
  // WP Health.
32
- $ad_text = 'Want to make sure your site is healthy, secure, and live? Check out our new free WordPress plugin: <a href="https://wordpress.org/plugins/my-wp-health-check/" target="_blank">WP Health</a>!';
33
- break;
34
  case 1:
35
  // Continued development 1.
36
  $ad_text = 'Are you finding this plugin very beneficial? Please consider checking out our premium addons which help support continued development of this plugin. Visit our <a href="http://quizandsurveymaster.com/addons/?utm_source=qsm-plugin-ads&utm_medium=plugin&utm_content=continued-development-1&utm_campaign=qsm_plugin">Addon Store</a> for details!';
@@ -49,7 +49,7 @@ function qsm_show_adverts() {
49
  }
50
  ?>
51
  <div class="help-decide">
52
- <p><?php echo $ad_text; ?></p>
53
  </div>
54
  <?php
55
  }
29
  switch ( $rand_int ) {
30
  case 0:
31
  // WP Health.
32
+ // $ad_text = 'New content for ad.';
33
+ // break;
34
  case 1:
35
  // Continued development 1.
36
  $ad_text = 'Are you finding this plugin very beneficial? Please consider checking out our premium addons which help support continued development of this plugin. Visit our <a href="http://quizandsurveymaster.com/addons/?utm_source=qsm-plugin-ads&utm_medium=plugin&utm_content=continued-development-1&utm_campaign=qsm_plugin">Addon Store</a> for details!';
49
  }
50
  ?>
51
  <div class="help-decide">
52
+ <p><?php echo $ad_text . ' <a class="remove-adv-button" target="_blank" href="https://quizandsurveymaster.com/downloads/advertisement-gone/"><span class="dashicons dashicons-no-alt"></span> Remove Ads</a>'; ?></p>
53
  </div>
54
  <?php
55
  }
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -312,6 +312,7 @@ class QMNQuizManager {
312
  $mlw_qmn_section_count = 0;
313
 
314
  $quiz_display .= "<div class='qsm-quiz-container qmn_quiz_container mlw_qmn_quiz'>";
 
315
  $quiz_display .= "<form name='quizForm{$quiz_data['quiz_id']}' id='quizForm{$quiz_data['quiz_id']}' action='' method='post' class='qsm-quiz-form qmn_quiz_form mlw_quiz_form' novalidate >";
316
  $quiz_display .= "<div name='mlw_error_message' id='mlw_error_message' class='qsm-error-message qmn_error_message_section'></div>";
317
  $quiz_display .= "<span id='mlw_top_of_quiz'></span>";
@@ -333,14 +334,17 @@ class QMNQuizManager {
333
  $quiz_display = apply_filters( 'qmn_after_comment_section', $quiz_display, $options, $quiz_data );
334
  $quiz_display .= $this->display_end_section( $options, $quiz_data );
335
  }
336
-
337
  $quiz_display .= "<div name='mlw_error_message_bottom' id='mlw_error_message_bottom' class='qsm-error-message qmn_error_message_section'></div>";
338
  $quiz_display .= "<input type='hidden' name='total_questions' id='total_questions' value='$qmn_total_questions'/>";
339
  $quiz_display .= "<input type='hidden' name='timer' id='timer' value='0'/>";
340
  $quiz_display .= "<input type='hidden' class='qmn_quiz_id' name='qmn_quiz_id' id='qmn_quiz_id' value='{$quiz_data['quiz_id']}'/>";
341
  $quiz_display .= "<input type='hidden' name='complete_quiz' value='confirmation' />";
 
 
 
342
  $quiz_display = apply_filters( 'qmn_end_quiz_form', $quiz_display, $options, $quiz_data );
343
- $quiz_display .= '</form>';
344
  $quiz_display .= '</div>';
345
 
346
  $quiz_display = apply_filters( 'qmn_end_quiz', $quiz_display, $options, $quiz_data );
@@ -712,6 +716,7 @@ class QMNQuizManager {
712
  'quiz_id' => $options->quiz_id,
713
  'quiz_name' => $options->quiz_name,
714
  'quiz_system' => $options->system,
 
715
  );
716
  echo json_encode( $this->submit_results( $options, $data ) );
717
  die();
@@ -798,7 +803,7 @@ class QMNQuizManager {
798
  htmlspecialchars( stripslashes( $qmn_array_for_variables['comments'] ), ENT_QUOTES ),
799
  'contact' => $contact_responses,
800
  );
801
- $results_array = apply_filters( 'qsm_results_array', $results_array, $qmn_array_for_variables );
802
  $serialized_results = serialize( $results_array );
803
 
804
  // Inserts the responses in the database.
312
  $mlw_qmn_section_count = 0;
313
 
314
  $quiz_display .= "<div class='qsm-quiz-container qmn_quiz_container mlw_qmn_quiz'>";
315
+ $quiz_display .= apply_filters('qsm_display_before_form', $quiz_display);
316
  $quiz_display .= "<form name='quizForm{$quiz_data['quiz_id']}' id='quizForm{$quiz_data['quiz_id']}' action='' method='post' class='qsm-quiz-form qmn_quiz_form mlw_quiz_form' novalidate >";
317
  $quiz_display .= "<div name='mlw_error_message' id='mlw_error_message' class='qsm-error-message qmn_error_message_section'></div>";
318
  $quiz_display .= "<span id='mlw_top_of_quiz'></span>";
334
  $quiz_display = apply_filters( 'qmn_after_comment_section', $quiz_display, $options, $quiz_data );
335
  $quiz_display .= $this->display_end_section( $options, $quiz_data );
336
  }
337
+ $quiz_display = apply_filters( 'qmn_before_error_message', $quiz_display, $options, $quiz_data );
338
  $quiz_display .= "<div name='mlw_error_message_bottom' id='mlw_error_message_bottom' class='qsm-error-message qmn_error_message_section'></div>";
339
  $quiz_display .= "<input type='hidden' name='total_questions' id='total_questions' value='$qmn_total_questions'/>";
340
  $quiz_display .= "<input type='hidden' name='timer' id='timer' value='0'/>";
341
  $quiz_display .= "<input type='hidden' class='qmn_quiz_id' name='qmn_quiz_id' id='qmn_quiz_id' value='{$quiz_data['quiz_id']}'/>";
342
  $quiz_display .= "<input type='hidden' name='complete_quiz' value='confirmation' />";
343
+ if(isset($_GET['payment_id']) && $_GET['payment_id'] != ''){
344
+ $quiz_display .= "<input type='hidden' name='main_payment_id' value='". $_GET['payment_id'] ."' />";
345
+ }
346
  $quiz_display = apply_filters( 'qmn_end_quiz_form', $quiz_display, $options, $quiz_data );
347
+ $quiz_display .= '</form>';
348
  $quiz_display .= '</div>';
349
 
350
  $quiz_display = apply_filters( 'qmn_end_quiz', $quiz_display, $options, $quiz_data );
716
  'quiz_id' => $options->quiz_id,
717
  'quiz_name' => $options->quiz_name,
718
  'quiz_system' => $options->system,
719
+ 'quiz_payment_id' => isset($_POST['main_payment_id']) ? $_POST['main_payment_id'] : ''
720
  );
721
  echo json_encode( $this->submit_results( $options, $data ) );
722
  die();
803
  htmlspecialchars( stripslashes( $qmn_array_for_variables['comments'] ), ENT_QUOTES ),
804
  'contact' => $contact_responses,
805
  );
806
+ $results_array = apply_filters( 'qsm_results_array', $results_array, $qmn_array_for_variables );
807
  $serialized_results = serialize( $results_array );
808
 
809
  // Inserts the responses in the database.
php/classes/class-qsm-emails.php CHANGED
@@ -188,9 +188,10 @@ class QSM_Emails {
188
  }
189
 
190
  // Prepares our headers.
191
- $headers = array(
192
- 'From: ' . $from_name . ' <' . $from_email . '>',
193
- );
 
194
  if ( is_email( $user_email ) && true === $reply_to ) {
195
  $name = sanitize_text_field( $response_data['user_name'] );
196
  $headers[] = 'Reply-To: ' . $name . ' <' . $user_email . '>';
188
  }
189
 
190
  // Prepares our headers.
191
+ $headers = array();
192
+ if ( is_email( $from_email ) ) {
193
+ $headers[] = 'From: ' . $from_name . ' <' . $from_email . '>';
194
+ }
195
  if ( is_email( $user_email ) && true === $reply_to ) {
196
  $name = sanitize_text_field( $response_data['user_name'] );
197
  $headers[] = 'Reply-To: ' . $name . ' <' . $user_email . '>';
php/rest-api.php CHANGED
@@ -224,6 +224,7 @@ function qsm_rest_get_questions( WP_REST_Request $request ) {
224
  'required' => $question['settings']['required'],
225
  'answers' => $question['answers'],
226
  'page' => $question['page'],
 
227
  );
228
  }
229
  return $question_array;
@@ -261,6 +262,7 @@ function qsm_rest_create_question( WP_REST_Request $request ) {
261
  );
262
  $settings = array(
263
  'required' => $request['required'],
 
264
  );
265
  $intial_answers = $request['answers'];
266
  $answers = array();
@@ -314,6 +316,7 @@ function qsm_rest_save_question( WP_REST_Request $request ) {
314
  );
315
  $settings = array(
316
  'required' => $request['required'],
 
317
  );
318
  $intial_answers = $request['answers'];
319
  $answers = array();
224
  'required' => $question['settings']['required'],
225
  'answers' => $question['answers'],
226
  'page' => $question['page'],
227
+ 'answerEditor' => $question['settings']['answerEditor'],
228
  );
229
  }
230
  return $question_array;
262
  );
263
  $settings = array(
264
  'required' => $request['required'],
265
+ 'answerEditor' => 'text'
266
  );
267
  $intial_answers = $request['answers'];
268
  $answers = array();
316
  );
317
  $settings = array(
318
  'required' => $request['required'],
319
+ 'answerEditor' => $request['answer_editor']
320
  );
321
  $intial_answers = $request['answers'];
322
  $answers = array();
readme.txt CHANGED
@@ -1,14 +1,14 @@
1
- === Quiz And Survey Master (Formerly Quiz Master Next) ===
2
  Contributors: quizsurvey
3
  Tags: quiz, survey, lead, test, score, exam, questionnaire, question
4
  Requires at least: 4.9
5
  Tested up to: 5.1.1
6
  Requires PHP: 5.4
7
- Stable tag: 6.2.2
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Easily and quickly add unlimited quizzes and surveys to your website.
12
 
13
  == Description ==
14
 
@@ -111,6 +111,14 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
111
 
112
  == Changelog ==
113
 
 
 
 
 
 
 
 
 
114
  = 6.2.1 (February 20, 2019) =
115
  * Fixes cut off submit button on mobile phone issue
116
  * Switches "Frank Corso" with "QSM Team" in relevant places
1
+ === Quiz And Survey Master - Best Quiz Plugin for WordPress ===
2
  Contributors: quizsurvey
3
  Tags: quiz, survey, lead, test, score, exam, questionnaire, question
4
  Requires at least: 4.9
5
  Tested up to: 5.1.1
6
  Requires PHP: 5.4
7
+ Stable tag: 6.3.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Native quiz and surveys for your WordPress site. Easily and quickly add unlimited quizzes and surveys to your website. Customizable and professional quizzes are now at your finger tips.
12
 
13
  == Description ==
14
 
111
 
112
  == Changelog ==
113
 
114
+ = 6.3.0 (April 20, 2019) =
115
+ * Massive UI update
116
+ * Closed Enhancement: Support for Image and Rich answers
117
+ ([Issue #146](https://github.com/QuizandSurveyMaster/quiz_master_next/issues/146))
118
+
119
+ = 6.2.2 (March 14, 2019) =
120
+ * Security update as suggested by WordPress team.
121
+
122
  = 6.2.1 (February 20, 2019) =
123
  * Fixes cut off submit button on mobile phone issue
124
  * Switches "Frank Corso" with "QSM Team" in relevant places