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

Version Description

(July 26, 2022) = * Feature: Added option to enable/disable case sensitive answer for fill-in blank question * Feature: Added option to enable/disable MathJax * Feature: Added option to enable/disable emails notifications * Feature: Added option to set images size for image type answers * Feature: Added %ANSWER_X% variables to show user's answer to a specific question * Feature: Added translation support for all Javascript string messages * Feature: Added image answer support for polar question type * Bug: Fixed display issue with leaderboard customization block * Bug: Fixed issue with questions count in quiz list page * Bug: Fixed issue with %QUESTION_ANSWER_X% variables * Bug: Fixed issue while deleting/duplicating old quizzes * Bug: Fixed issue with timer while using pagination * Enhancement: Improved UI for image type answers options

Download this release

Release Info

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

Code changes from version 8.0.2 to 8.0.3

Files changed (51) hide show
  1. css/admin-dashboard.css +1 -27
  2. css/common.css +80 -52
  3. css/qsm-admin-question.css +4 -1
  4. css/qsm-admin.css +17 -0
  5. js/qsm-admin.js +2264 -2146
  6. js/qsm-common.js +0 -14
  7. js/qsm-quiz.js +146 -129
  8. lang/quiz-master-next.pot +2236 -1172
  9. mlw_quizmaster2.php +74 -8
  10. php/admin/about-page.php +2 -5
  11. php/admin/addons-page.php +2 -4
  12. php/admin/admin-dashboard.php +42 -57
  13. php/admin/admin-results-details-page.php +5 -0
  14. php/admin/functions.php +57 -34
  15. php/admin/options-page-contact-tab.php +1 -0
  16. php/admin/options-page-email-tab.php +8 -1
  17. php/admin/options-page-questions-tab.php +45 -17
  18. php/admin/options-page-style-tab.php +21 -5
  19. php/admin/quiz-options-page.php +9 -9
  20. php/admin/quizzes-page.php +7 -10
  21. php/admin/settings-page.php +30 -9
  22. php/classes/class-qmn-background-process.php +2 -2
  23. php/classes/class-qmn-plugin-helper.php +30 -17
  24. php/classes/class-qmn-quiz-creator.php +3 -8
  25. php/classes/class-qmn-quiz-manager.php +57 -40
  26. php/classes/class-qsm-contact-manager.php +21 -18
  27. php/classes/class-qsm-emails.php +8 -36
  28. php/classes/class-qsm-fields.php +11 -5
  29. php/classes/class-qsm-install.php +73 -9
  30. php/classes/class-qsm-migrate.php +63 -0
  31. php/classes/class-qsm-results-pages.php +8 -5
  32. php/classes/class-qsm-settings.php +6 -5
  33. php/classes/class-qsm-tracking.php +1 -1
  34. php/classes/question-types/class-question-review-fill-in-blanks.php +28 -16
  35. php/question-types/qsm-question-title.php +1 -1
  36. php/question-types/qsm-question-type-fill-in-the-blanks.php +3 -0
  37. php/question-types/qsm-question-type-multiple-choice-horizontal.php +10 -1
  38. php/question-types/qsm-question-type-multiple-choice.php +10 -1
  39. php/question-types/qsm-question-type-multiple-response-horizontal.php +10 -1
  40. php/question-types/qsm-question-type-multiple-response.php +10 -1
  41. php/question-types/qsm-question-type-polar.php +50 -5
  42. php/rest-api.php +6 -0
  43. php/template-variables.php +159 -43
  44. php/template-variables/qsm-tempvar-question-answers.php +8 -1
  45. readme.txt +16 -1
  46. templates/qmn_amethyst.css +24 -6
  47. templates/qmn_base.css +25 -6
  48. templates/qmn_emerald.css +24 -6
  49. templates/qmn_gray.css +24 -6
  50. templates/qmn_primary.css +24 -25
  51. templates/qmn_turquoise.css +24 -6
css/admin-dashboard.css CHANGED
@@ -276,13 +276,6 @@ ul.popuar-addon-ul::after {
276
  box-sizing: border-box;
277
  }
278
 
279
- #model-wizard .qsm-popup__content .quiz_name {
280
- width: 100%;
281
- padding: 5px 10px 5px 10px;
282
- border-radius: 0;
283
- border: 1px solid #dfd4d4;
284
- }
285
-
286
  #model-wizard .qsm-popup__content .quiz_name.qsm-required {
287
  border-color: #ff0000;
288
  outline: none !important;
@@ -440,13 +433,6 @@ ul.popuar-addon-ul::after {
440
  float: left;
441
  }
442
 
443
- #model-wizard #quiz_settings .input-group:nth-child(5),
444
- #model-wizard #quiz_settings .input-group:nth-child(6),
445
- #model-wizard #quiz_settings .input-group:nth-child(8),
446
- #model-wizard #quiz_settings .input-group:nth-child(10) {
447
- display: none;
448
- }
449
-
450
  #new-quiz-form {
451
  display: inline-block;
452
  width: 100%;
@@ -600,18 +586,6 @@ ul.popuar-addon-ul::after {
600
  opacity: 0.1;
601
  }
602
 
603
- .qsm-badge {
604
- background: linear-gradient(225deg, #344ad6, #42d96b);
605
- z-index: 9999;
606
- position: absolute;
607
- color: #fff;
608
- right: 5px;
609
- top: 5px;
610
- border-radius: 10px;
611
- padding: 0 10px;
612
- text-transform: uppercase;
613
- }
614
-
615
  #accordion .ui-accordion-header-icon {
616
  position: absolute;
617
  right: 24px;
@@ -848,12 +822,12 @@ h2.hndle.ui-sortable-handle {
848
  }
849
 
850
  #model-wizard .qsm-new-menu-elements input[type="text"],
 
851
  #model-wizard .qsm-new-menu-elements select {
852
  width: 60%;
853
  max-width: 100%;
854
  height: 35px;
855
  border: solid 1px #dddddd;
856
- box-shadow: 0px 0px 5px rgba(10, 10, 10, 0.3);
857
  border-radius: 0;
858
  }
859
 
276
  box-sizing: border-box;
277
  }
278
 
 
 
 
 
 
 
 
279
  #model-wizard .qsm-popup__content .quiz_name.qsm-required {
280
  border-color: #ff0000;
281
  outline: none !important;
433
  float: left;
434
  }
435
 
 
 
 
 
 
 
 
436
  #new-quiz-form {
437
  display: inline-block;
438
  width: 100%;
586
  opacity: 0.1;
587
  }
588
 
 
 
 
 
 
 
 
 
 
 
 
 
589
  #accordion .ui-accordion-header-icon {
590
  position: absolute;
591
  right: 24px;
822
  }
823
 
824
  #model-wizard .qsm-new-menu-elements input[type="text"],
825
+ #model-wizard .qsm-new-menu-elements input[type="number"],
826
  #model-wizard .qsm-new-menu-elements select {
827
  width: 60%;
828
  max-width: 100%;
829
  height: 35px;
830
  border: solid 1px #dddddd;
 
831
  border-radius: 0;
832
  }
833
 
css/common.css CHANGED
@@ -13,9 +13,6 @@
13
  .MJXc-display{
14
  display: inline-block !important;
15
  }
16
- body .quiz_section .mlw_qmn_question{
17
- display: inline-block;
18
- }
19
 
20
  body .quiz_section .qsm_contact_div .mlw_qmn_question{
21
  display: block;
@@ -31,36 +28,39 @@ body .quiz_section .qsm_contact_div .mlw_qmn_question{
31
  line-height: 20px;
32
  }
33
 
34
- .question-type-polar-s{
35
- display: inline-block !important;
36
- position: relative;
 
 
37
  width: 100%;
 
 
 
 
 
 
 
38
  }
 
39
  .question-type-polar-s br{
40
  display: none;
41
  }
42
  .question-type-polar-s .left-polar-title{
43
- width: 25%;
44
- position: absolute;
45
- left: 0;
46
- top: 50%;
47
- transform: translateY(-50%);
48
- line-height: normal;
49
  }
50
  .question-type-polar-s .slider-main-wrapper{
51
- width: 45%;
52
- position: absolute;
53
- left: 50%;
54
- top: 50%;
55
- transform: translate(-50%,-50%);
56
  }
57
  .question-type-polar-s .right-polar-title{
58
- width: 25%;
59
- position: absolute;
60
- right: 0;
61
- top: 50%;
62
- transform: translateY(-50%);
63
- line-height: normal;
64
  }
65
  .question-type-polar-s .ui-widget-content{
66
  background: #A5A5A5;
@@ -133,9 +133,18 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
133
  background-color: #808080 !important;
134
  opacity: 0.9;
135
  }
136
- .qsm-quiz-container .qsm-contact-type-checkbox input{
137
- display: inline-block;
 
 
138
  }
 
 
 
 
 
 
 
139
  .mlw_qmn_question_number{
140
  font-weight: bold;
141
  }
@@ -301,14 +310,7 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
301
  .question-type-polar-s .slider-main-wrapper,
302
  .question-type-polar-s .right-polar-title{
303
  width: 100%;
304
- position: relative;
305
- top: auto;
306
- left: auto;
307
- right: auto;
308
- bottom: auto;
309
- transform: none;
310
  margin-bottom: 30px;
311
- float: left;
312
  }
313
  .question-type-polar-s{
314
  height: auto !important;
@@ -318,34 +320,60 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
318
  body .quiz_section .qmn_accept_answers label{
319
  font-size: 14px !important;
320
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  }
322
  .qsm_tooltip {
323
- position: relative;
324
- display: inline-block;
 
325
  }
326
 
327
  .qsm_tooltip .qsm_tooltiptext{
328
- visibility: hidden;
329
- width: 120px;
330
- background-color: black;
331
- color: #fff;
332
- text-align: center;
333
- border-radius: 6px;
334
- padding: 5px 0;
335
 
336
- /* Position the tooltip */
337
- position: absolute;
338
- z-index: 1;
339
- bottom: 100%;
340
- left: 50%;
341
- margin-left: -60px;
342
  }
343
  .qsm_tooltip .qsm_tooltiptext a{
344
- background-color: black !important;
345
- color: #fff!important;
346
  }
347
  .qsm_tooltip:hover .qsm_tooltiptext {
348
- visibility: visible;
 
 
 
 
 
 
 
 
 
 
 
349
  }
350
  .qsm_quiz_processing_box {
351
  display: inline-block;
@@ -358,5 +386,5 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
358
  margin: 10px 0;
359
  }
360
  .qsm-text-correct-option.not-opted {
361
- color: #6f7479;
362
- }
13
  .MJXc-display{
14
  display: inline-block !important;
15
  }
 
 
 
16
 
17
  body .quiz_section .qsm_contact_div .mlw_qmn_question{
18
  display: block;
28
  line-height: 20px;
29
  }
30
 
31
+ div .quiz_section .question-type-polar-s,
32
+ .qsm_questions_answers_section .mlw_qmn_question .question-type-polar-s,
33
+ .qsm-quiz-container .mlw_qmn_question .question-type-polar-s{
34
+ display: inline-flex;
35
+ flex-wrap: wrap;
36
  width: 100%;
37
+ align-content: space-between;
38
+ align-items: center;
39
+ }
40
+
41
+ .question-type-polar-s img {
42
+ max-width: 100%;
43
+ object-fit: cover;
44
  }
45
+
46
  .question-type-polar-s br{
47
  display: none;
48
  }
49
  .question-type-polar-s .left-polar-title{
50
+ width: auto;
51
+ max-width: 25%;
 
 
 
 
52
  }
53
  .question-type-polar-s .slider-main-wrapper{
54
+ width: calc(50% - 20px);
55
+ padding-left: 10px;
56
+ padding-right: 10px;
 
 
57
  }
58
  .question-type-polar-s .right-polar-title{
59
+ width: auto;
60
+ max-width: 25%;
61
+ }
62
+ .question-type-polar-s .qsm_image_caption{
63
+ display: block;
 
64
  }
65
  .question-type-polar-s .ui-widget-content{
66
  background: #A5A5A5;
133
  background-color: #808080 !important;
134
  opacity: 0.9;
135
  }
136
+ .qsm-quiz-container select,
137
+ .qsm-quiz-container input[type=checkbox],
138
+ .qsm-quiz-container input[type=radio]{
139
+ cursor: pointer;
140
  }
141
+ .qsm-quiz-container .qsm-contact-type-checkbox{
142
+ display: flex;
143
+ align-items: center;
144
+ flex-wrap: nowrap;
145
+ align-content: center;
146
+ }
147
+ .qsm-quiz-container .qsm-contact-type-checkbox input{margin: 0 5px 0 3px;}
148
  .mlw_qmn_question_number{
149
  font-weight: bold;
150
  }
310
  .question-type-polar-s .slider-main-wrapper,
311
  .question-type-polar-s .right-polar-title{
312
  width: 100%;
 
 
 
 
 
 
313
  margin-bottom: 30px;
 
314
  }
315
  .question-type-polar-s{
316
  height: auto !important;
320
  body .quiz_section .qmn_accept_answers label{
321
  font-size: 14px !important;
322
  }
323
+ .question-type-polar-s .left-polar-title {
324
+ order: 1;
325
+ max-width: calc(50% - 10px);
326
+ padding-right: 10px;
327
+ }
328
+ .question-type-polar-s .right-polar-title {
329
+ order: 2;
330
+ max-width: calc(50% - 10px);
331
+ text-align: right;
332
+ padding-left: 10px;
333
+ }
334
+ .question-type-polar-s .slider-main-wrapper{
335
+ order: 3;
336
+ }
337
  }
338
  .qsm_tooltip {
339
+ position: relative;
340
+ display: inline-block;
341
+ cursor: pointer;
342
  }
343
 
344
  .qsm_tooltip .qsm_tooltiptext{
345
+ visibility: hidden;
346
+ width: 120px;
347
+ background-color: black;
348
+ color: #fff;
349
+ text-align: center;
350
+ border-radius: 6px;
351
+ padding: 5px 0;
352
 
353
+ /* Position the tooltip */
354
+ position: absolute;
355
+ z-index: 1;
356
+ bottom: 100%;
357
+ left: 50%;
358
+ margin-left: -60px;
359
  }
360
  .qsm_tooltip .qsm_tooltiptext a{
361
+ background-color: black !important;
362
+ color: #fff!important;
363
  }
364
  .qsm_tooltip:hover .qsm_tooltiptext {
365
+ visibility: visible;
366
+ }
367
+ body .ui-tooltip, body .ui-tooltip.ui-widget-content{
368
+ box-shadow: none;
369
+ background: #222;
370
+ color: #fff;
371
+ border-radius: 6px;
372
+ box-sizing: border-box;
373
+ padding: 6px 10px;
374
+ font-size: 14px;
375
+ line-height: 22px;
376
+ text-align: justify;
377
  }
378
  .qsm_quiz_processing_box {
379
  display: inline-block;
386
  margin: 10px 0;
387
  }
388
  .qsm-text-correct-option.not-opted {
389
+ color: #6f7479;
390
+ }
css/qsm-admin-question.css CHANGED
@@ -54,7 +54,7 @@
54
  }
55
  .modal-7-table tr td, .modal-8-table tr td {
56
  vertical-align: top;
57
- padding: 0 10px 5px 0
58
  }
59
  #modal-8 footer {
60
  margin-top: 15px;
@@ -308,6 +308,9 @@
308
  margin: 10px 0 0;
309
  text-decoration: none;
310
  }
 
 
 
311
  .questionElements .qsm-row>label {
312
  position: relative;
313
  }
54
  }
55
  .modal-7-table tr td, .modal-8-table tr td {
56
  vertical-align: top;
57
+ padding: 0 10px 5px 0
58
  }
59
  #modal-8 footer {
60
  margin-top: 15px;
308
  margin: 10px 0 0;
309
  text-decoration: none;
310
  }
311
+ input#image_size-width {
312
+ margin-left: 6px;
313
+ }
314
  .questionElements .qsm-row>label {
315
  position: relative;
316
  }
css/qsm-admin.css CHANGED
@@ -1177,6 +1177,12 @@ tr .qsm-opt-desc {
1177
  margin-top: 5px;
1178
  display: block;
1179
  }
 
 
 
 
 
 
1180
  #quiz_settings_wrapper .qsm-opt-desc {
1181
  display: none !important;
1182
  }
@@ -2230,6 +2236,17 @@ input#duplicate_questions {
2230
  #qsm-global-default-popup .qsm-popup__footer button{
2231
  margin: 0 5px;
2232
  }
 
 
 
 
 
 
 
 
 
 
 
2233
  /** Quiz Contact Tab Style **/
2234
  .contact-form-builder-wrap{
2235
  display: flex;
1177
  margin-top: 5px;
1178
  display: block;
1179
  }
1180
+ .form-table .send_email .qsm-opt-tr, .form-table .send_email td {
1181
+ padding-top: 0;
1182
+ }
1183
+ .form-table .store_responses .qsm-opt-tr, .form-table .store_responses td {
1184
+ padding-bottom: 0;
1185
+ }
1186
  #quiz_settings_wrapper .qsm-opt-desc {
1187
  display: none !important;
1188
  }
2236
  #qsm-global-default-popup .qsm-popup__footer button{
2237
  margin: 0 5px;
2238
  }
2239
+ .qsm-badge {
2240
+ background: linear-gradient(225deg, #344ad6, #42d96b);
2241
+ z-index: 9999;
2242
+ position: absolute;
2243
+ color: #fff;
2244
+ right: 5px;
2245
+ top: 5px;
2246
+ border-radius: 10px;
2247
+ padding: 0 10px;
2248
+ text-transform: uppercase;
2249
+ }
2250
  /** Quiz Contact Tab Style **/
2251
  .contact-form-builder-wrap{
2252
  display: flex;
js/qsm-admin.js CHANGED
@@ -10,13 +10,13 @@ var QSMAdmin;
10
  * Catches an error from a jQuery function (i.e. $.ajax())
11
  */
12
  displayjQueryError: function (jqXHR, textStatus, errorThrown) {
13
- QSMAdmin.displayAlert('Error: ' + errorThrown + '! Please try again.', 'error');
14
  },
15
  /**
16
  * Catches an error from a BackBone function (i.e. model.save())
17
  */
18
  displayError: function (jqXHR, textStatus, errorThrown) {
19
- QSMAdmin.displayAlert('Error: ' + errorThrown.errorThrown + '! Please try again.', 'error');
20
  },
21
  /**
22
  * Displays an alert within the "Quiz Settings" page
@@ -45,348 +45,366 @@ var QSMAdmin;
45
  }
46
  };
47
  $(function () {
48
- $('.qsm-tab').on('click', function (event) {
49
- event.preventDefault();
50
- QSMAdmin.selectTab($(this));
51
- });
52
-
53
- //show set global default potion popup
54
- $(document).on('click', '#qsm-blobal-settings', function () {
55
- MicroModal.show('qsm-global-default-popup');
56
- });
57
 
58
- $('#qmn_check_all').change(function () {
59
- $('.qmn_delete_checkbox').prop('checked', jQuery('#qmn_check_all').prop('checked'));
60
- });
 
61
 
62
- $('.edit-quiz-name').click(function (e) {
63
- e.preventDefault();
64
- MicroModal.show('modal-3');
65
- });
66
- $('#edit-name-button').on('click', function (event) {
67
- event.preventDefault();
68
- $('#edit-name-form').submit();
69
- });
70
- $('#sendySignupForm').submit(function (e) {
71
 
72
- e.preventDefault();
73
- var $form = $(this),
74
- name = $form.find('input[name="name"]').val(),
75
- email = $form.find('input[name="email"]').val(),
76
- action = 'qsm_send_data_sendy';
77
- $form.find('#submit').attr('disabled', true);
78
- $.post(ajaxurl, { name: name, email: email, nonce: qsmAdminObject.saveNonce, action: action },
79
- function (data) {
80
- if (data) {
81
- $("#status").text('');
82
- if (data == "Some fields are missing.") {
83
- $("#status").text("Please fill in your name and email.");
84
- $("#status").css("color", "red");
85
- } else if (data == "Invalid email address.") {
86
- $("#status").text("Your email address is invalid.");
87
- $("#status").css("color", "red");
88
- } else if (data == "Invalid list ID.") {
89
- $("#status").text("Your list ID is invalid.");
90
- $("#status").css("color", "red");
91
- } else if (data == "Already subscribed.") {
92
- $("#status").text("You're already subscribed!");
93
- $("#status").css("color", "red");
94
- } else {
95
- $("#status").text("Thanks, you are now subscribed to our mailing list!");
96
- $("#status").css("color", "green");
97
- }
98
- $form.find('#submit').attr('disabled', false);
99
- } else {
100
- alert("Sorry, unable to subscribe. Please try again later!");
101
- }
102
- }
103
- );
104
- });
105
- jQuery('.category_selection_random').change(function () {
106
- var checked_data = jQuery(this).val().toString();
107
- jQuery('.catergory_comma_values').val(checked_data);
108
- });
109
- jQuery('.row-actions-c > .rtq-delete-result').click(function (e) {
110
- e.preventDefault();
111
- var $this = jQuery(this);
112
- if (confirm('are you sure?')) {
113
- var action = 'qsm_dashboard_delete_result';
114
- var result_id = jQuery(this).data('result_id');
115
- $.post(ajaxurl, { result_id: result_id, action: action },
116
  function (data) {
117
- if (data == 'failed') {
118
- alert('Error to delete the result!');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  } else {
120
- $this.parents('li').slideUp();
121
- $this.parents('li').remove();
122
  }
123
  }
124
  );
125
- }
126
- });
127
- jQuery('.load-quiz-wizard').click(function (e) {
128
- e.preventDefault();
129
- MicroModal.show('model-wizard');
130
- var height = jQuery(".qsm-wizard-template-section").css("height");
131
- jQuery(".qsm-wizard-setting-section").css("height", height);
132
- if (jQuery("#accordion").length > 0) {
133
- var icons = {
134
- header: "iconClosed", // custom icon class
135
- activeHeader: "iconOpen" // custom icon class
136
- };
137
- jQuery("#accordion").accordion({
138
- collapsible: true,
139
- icons: icons,
140
- heightStyle: "content"
141
- });
142
- jQuery('#accordion h3.ui-accordion-header').next().slideDown();
143
- jQuery('.template-list .template-list-inner:first-child').trigger('click');
144
- }
145
- });
146
- //Get quiz options
147
- jQuery('.template-list-inner').click(function () {
148
- var action = 'qsm_wizard_template_quiz_options';
149
- var settings = jQuery(this).data('settings');
150
- var addons = jQuery(this).data('addons');
151
- jQuery('.template-list .template-list-inner').removeClass('selected-quiz-template');
152
- jQuery(this).addClass('selected-quiz-template');
153
- jQuery('#quiz_settings_wrapper').html('').html('<div class="qsm-spinner-loader"></div>');
154
- jQuery('#recomm_addons_wrapper').html('').html('<div class="qsm-spinner-loader"></div>');
155
- $.post(ajaxurl, { settings: settings, addons: addons, action: action },
156
- function (data) {
157
- var diff_html = data.split('=====');
158
- jQuery('#quiz_settings_wrapper').html('');
159
- jQuery('#quiz_settings_wrapper').html(diff_html[0]);
160
- jQuery('#recomm_addons_wrapper').html('');
161
- jQuery('#recomm_addons_wrapper').html(diff_html[1]);
162
- jQuery("#accordion").accordion();
163
- jQuery('#accordion h3.ui-accordion-header').next().slideDown();
164
- $('#quiz_settings_wrapper select').each(function () {
165
- var name = $(this).attr('name');
166
- var value = $(this).val();
167
- if ($('.' + name + '_' + value).length > 0) {
168
- $('.' + name + '_' + value).show();
169
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  });
 
 
171
  }
172
- );
173
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
 
175
- //Dismiss the welcome panel
176
- jQuery('.qsm-welcome-panel-dismiss').click(function (e) {
177
- e.preventDefault();
178
- jQuery('#welcome_panel').addClass('hidden');
179
- jQuery('#screen-options-wrap').find('#welcome_panel-hide').prop('checked', false);
180
- postboxes.save_state('toplevel_page_qsm_dashboard');
181
- });
182
- //Get the message in text tab
183
- jQuery(document).on('change', '#qsm_question_text_message_id', function () {
184
- var text_id = jQuery(this).val();
185
- jQuery('.qsm-text-main-wrap .qsm-text-tab-message-loader').show();
186
- jQuery.post(ajaxurl, { text_id: text_id, 'quiz_id': qsmTextTabObject.quiz_id, action: 'qsm_get_question_text_message' }, function (response) {
187
- var data = jQuery.parseJSON(response);
188
- if (data.success === true) {
189
- var text_msg = data.text_message;
190
- if ($('#wp-qsm_question_text_message-wrap').hasClass('html-active')) {
191
- jQuery("#qsm_question_text_message").val(text_msg);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  } else {
193
- text_msg = text_msg.replace(/\n/g, "<br>");
194
- tinyMCE.get('qsm_question_text_message').setContent(text_msg);
195
  }
196
- jQuery('.qsm-text-allowed-variables > .qsm-text-variable-wrap').html('').html(data.allowed_variable_text);
197
- jQuery('.qsm-text-main-wrap .qsm-text-tab-message-loader').hide();
 
 
 
 
 
 
 
 
 
 
198
  } else {
199
- console.log(data.message);
200
  }
201
  });
202
- });
203
- //Save the message in text tab
204
- jQuery(document).on('click', '#qsm_save_text_message', function () {
205
- var $this = jQuery(this);
206
- $this.siblings('.spinner').addClass('is-active');
207
- var text_id = jQuery('#qsm_question_text_message_id').val();
208
- var message = wp.editor.getContent('qsm_question_text_message');
209
- jQuery.post(ajaxurl, { text_id: text_id, 'message': message, 'quiz_id': qsmTextTabObject.quiz_id, action: 'qsm_update_text_message' }, function (response) {
210
- var data = jQuery.parseJSON(response);
211
- if (data.success === true) {
212
- //Do nothing
213
- } else {
214
- console.log(data.message);
215
  }
216
- $this.siblings('.spinner').removeClass('is-active');
217
  });
218
- });
219
- //On click append on tiny mce
220
- jQuery(document).on('click', '.qsm-text-allowed-variables button.button', function () {
221
- var content = jQuery(this).text();
222
- if (jQuery('.qsm-question-text-tab .html-active').length > 0) {
223
- var $txt = jQuery("#qsm_question_text_message");
224
- var caretPos = $txt[0].selectionStart;
225
- var textAreaTxt = $txt.val();
226
- var txtToAdd = content;
227
- $txt.val(textAreaTxt.substring(0, caretPos) + txtToAdd + textAreaTxt.substring(caretPos));
228
- } else {
229
- tinyMCE.activeEditor.execCommand('mceInsertContent', false, content);
230
- }
231
- });
232
- //Show all the variable list
233
- jQuery('.qsm-show-all-variable-text').click(function (e) {
234
- e.preventDefault();
235
- MicroModal.show('show-all-variable');
236
- });
237
- //Hide/show tr based on selection
238
- $('.qsm_tab_content select').each(function () {
239
- var name = $(this).attr('name');
240
- var value = $(this).val();
241
- if ($('.' + name + '_' + value).length > 0) {
242
- $('.' + name + '_' + value).show();
243
- }
244
- });
245
- $(document).on('change', '.qsm_tab_content select, #quiz_settings_wrapper select', function () {
246
- var name = $(this).attr('name');
247
- var value = $(this).val();
248
- $('.qsm_hidden_tr').hide();
249
- if ($('.' + name + '_' + value).length > 0) {
250
- $('.' + name + '_' + value).show();
251
- }
252
- });
253
- $(document).on('click', '.qsm_tab_content input[name="system"]', function () {
254
  var name = $(this).attr('name');
255
- var value = $(this).val();
256
- $('.qsm_hidden_tr_gradingsystem').hide();
257
- if (value == 0 || value == 3) {
258
- $('.qsm_hidden_tr_gradingsystem').show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  }
260
- });
261
- $(document).ready(function () {
262
- var system_option = $("input[type=radio][name='system']:checked").val();
263
- $('.qsm_hidden_tr_gradingsystem').hide();
264
- if (system_option == 0 || system_option == 3) {
265
- $('.qsm_hidden_tr_gradingsystem').show();
 
 
 
266
  }
267
- });
268
- if ($('.qsm-text-label-wrapper').length > 0) {
269
- var element_position = $('.qsm-text-label-wrapper').offset().top;
270
- $(window).scroll(function () {
271
- var y_scroll_pos = window.pageYOffset;
272
- var scroll_pos_test = element_position;
273
- if (y_scroll_pos > scroll_pos_test) {
274
- $('.qsm_text_customize_label').fadeOut('slow');
275
  } else {
276
- $('.qsm_text_customize_label').fadeIn('slow');
277
  }
278
  });
279
- }
280
- $(document).on('click', '.qsm_text_customize_label', function () {
281
- $('html, body').animate({
282
- scrollTop: $(".qsm-text-label-wrapper").offset().top - 30
283
- }, 2000);
284
- });
285
- //New template design hide show
286
- var new_template_result_detail = $('.new_template_result_detail:checked').val();
287
- if (new_template_result_detail == 1) {
288
- $('.new_template_result_detail:checked').parents('tr').next('tr').hide();
289
- }
290
- $(document).on('change', '.new_template_result_detail', function () {
291
- if ($(this).val() == 1) {
292
- $(this).parents('tr').next('tr').hide();
293
- } else {
294
- $(this).parents('tr').next('tr').show();
295
- }
296
- });
297
- $(document).on('click', '#show-all-variable .qsm-text-template-span ', function (e) {
298
- e.preventDefault();
299
- let templateSpan = jQuery(this);
300
- let templateVariable= jQuery(this).children('.template-variable');
301
- var $temp = $("<input>");
302
- $("body").append($temp);
303
- $temp.val(templateVariable.text()).select();
304
- document.execCommand("copy");
305
- $temp.remove();
306
- var button_width = templateSpan.width();
307
- var button_txt = templateSpan.html()
308
- templateSpan.css('width', button_width);
309
- templateSpan.text('').html('<span class="popup-copied-des"><span class="dashicons dashicons-yes"></span> Copied!</span>');
310
- setTimeout(function () {
311
- templateSpan.css('width', 'auto');
312
- templateSpan.html(button_txt);
313
- }, 1000);
314
- });
315
- $(document).on('click', ' .qsm-active-addons .no_addons_installed a', function (e) {
316
- $('.qsm-addon-anchor-left .qsm-install-addon a').trigger('click');
317
- });
318
- $(document).on('click', '.qsm-addon-anchor-left .qsm-install-addon a', function (e) {
319
- e.preventDefault();
320
- var href = $(this).attr('href');
321
- $('.qsm-addon-anchor-left .qsm-install-addon').find('a').removeClass('active');
322
- $(this).addClass('active');
323
- $('.qsm-addon-setting-wrap .qsm-primary-acnhor').hide();
324
- $(href).show();
325
- if (href == '#qsm_add_addons') {
326
- $('.qsm-add-addon').css('display', 'inline-block');
327
- } else {
328
- $('.qsm-add-addon').css('display', 'none');
329
- }
330
- });
331
- $(document).on('click', '.qsm-addon-anchor-left .qsm-add-addon a', function (e) {
332
- e.preventDefault();
333
- var href = $(this).attr('href');
334
- $('.qsm-addon-anchor-left .qsm-add-addon').find('a').removeClass('active');
335
- $(this).addClass('active');
336
- $('.qsm-addon-setting-wrap .qsm_popular_addons').hide();
337
- $(href).show();
338
- });
339
 
340
- // opens media library o set featured image for quiz
341
- $(document).on('click', '#set_featured_image', function (e) {
342
- var button = $(this);
343
- e.preventDefault();
344
  custom_uploader = wp.media({
345
- title: 'Set Featured Image',
346
- library: {
347
- type: 'image'
348
- },
349
- button: {
350
- text: 'Use this image' // button label text
351
- },
352
- multiple: false
353
- }).on('select', function () { // it also has "open" and "close" events
354
- var attachment = custom_uploader.state().get('selection').first().toJSON();
355
- button.prev().val(attachment.url);
356
- button.nextAll('.qsm_featured_image_preview').attr('src', attachment.url);
357
- }).open();
358
- });
359
 
360
- $(document).on('change', '.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]', function () {
361
- var value = $(this).val();
362
- if (value == '0' ) {
363
- $('.global_setting_system').parents('tr').show();
364
- $('.global_setting_score_roundoff').parents('tr').show();
365
- }else {
366
- $('.global_setting_system').parents('tr').hide();
367
- $('.global_setting_score_roundoff').parents('tr').hide();
 
 
 
 
 
 
 
 
 
 
368
 
369
- }
370
- });
371
- $(document).on('change', '.global_setting_system input[name="qsm-quiz-settings[system]"]', function () {
372
- var value = $('input[name="qsm-quiz-settings[system]"]:checked').val();
373
- var value1 = $('.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]').val();
374
- if (value != '1' && value1 == '0' ) {
375
- $('.global_setting_score_roundoff').parents('tr').show();
376
- }else {
377
- $('.global_setting_score_roundoff').parents('tr').hide();
378
- }
379
- });
380
- $('.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]').trigger('change');
381
- $('.global_setting_system input[name="qsm-quiz-settings[system]"]').trigger('change');
 
 
 
 
 
 
 
 
 
382
 
383
  });
384
  $(document).on('change', '.global_setting_system input[name="qsm-quiz-settings[system]"]', function () {
385
  var value = $('input[name="qsm-quiz-settings[system]"]:checked').val();
386
  var value1 = $('.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]').val();
387
- if (value != '1' && value1 == '0' ) {
388
  $('.global_setting_score_roundoff').parents('tr').show();
389
- }else {
390
  $('.global_setting_score_roundoff').parents('tr').hide();
391
  }
392
  });
@@ -400,7 +418,7 @@ var QSMAdmin;
400
  deleteResults(qid, qname);
401
  });
402
 
403
- jQuery(document).on('click', '#btn_export', function(e) {
404
  e.preventDefault();
405
  jQuery.ajax({
406
  type: 'POST',
@@ -409,7 +427,7 @@ var QSMAdmin;
409
  action: "qsm_export_data",
410
  nonce: qsm_tools_page.nonce,
411
  },
412
- success: function(response) {
413
  /*
414
  * Make CSV downloadable
415
  */
@@ -435,16 +453,16 @@ var QSMAdmin;
435
  downloadLink.click();
436
  document.body.removeChild(downloadLink);
437
  },
438
- error: function(errorThrown) {
439
  alert(errorThrown);
440
  }
441
  });
442
  });
443
 
444
- jQuery(document).on('click', '#btn_clear_logs', function(e) {
445
  e.preventDefault();
446
- var delete_logs=confirm(qsm_tools_page.qsm_delete_audit_logs);
447
- if ( delete_logs ) {
448
  // your deletion code
449
  jQuery.ajax({
450
  type: 'POST',
@@ -453,10 +471,10 @@ var QSMAdmin;
453
  action: "qsm_clear_audit_data",
454
  nonce: qsm_tools_page.nonce,
455
  },
456
- success: function(response) {
457
  location.reload();
458
  },
459
- error: function(errorThrown) {
460
  alert(errorThrown);
461
  }
462
  });
@@ -467,65 +485,65 @@ var QSMAdmin;
467
  e.preventDefault();
468
  MicroModal.show('qsm_fetch_audit_data');
469
  var qsm_get_setting_data = jQuery(this).attr('data-auditid');
470
- jQuery('.qsm_setting__data').html('<p>'+JSON.stringify(JSON.parse(qsm_get_setting_data), null, 2)+'</p>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  });
472
 
473
- jQuery( document ).on( 'click', '.qsm-toggle-box-handle', function ( e ) {
474
- e.preventDefault();
475
- var parent = jQuery(this).parent('.qsm-toggle-box');
476
- var content = parent.find('.qsm-toggle-box-content');
477
- if (content.is(":visible")) {
478
- content.hide();
479
- parent.removeClass('opened');
480
- } else {
481
- content.show();
482
- parent.addClass('opened');
483
- }
484
- } );
485
-
486
- jQuery( document ).on( 'click', '.qsm-help-tab-handle', function ( e ) {
487
- e.preventDefault();
488
- jQuery('.qsm-help-tab-dropdown-list').toggleClass('opened');
489
- } );
490
-
491
- $( document ).mouseup( function ( e ){
492
- var link = $( ".qsm-help-tab-handle" );
493
- var container = $( ".qsm-help-tab-dropdown-list" );
494
- if ( !link.is( e.target ) && !container.is( e.target ) && container.has( e.target ).length === 0 ) {
495
- container.removeClass('opened');
496
- }
497
- } );
498
 
499
  }(jQuery));
500
 
501
  // result page
502
- jQuery('#results-screen-option-button').on('click', function(event){
503
  event.preventDefault();
504
  MicroModal.show('modal-results-screen-option');
505
  });
506
- jQuery('#save-results-screen-option-button').on('click', function(event){
507
  event.preventDefault();
508
  MicroModal.close('modal-results-screen-option');
509
  jQuery('#results-screen-option-form').submit();
510
  });
511
  function deleteResults(id, quizName) {
512
- jQuery("#delete_dialog").dialog({
513
- autoOpen: false,
514
- buttons: {
515
- Cancel: function() {
516
- $jQuery(this).dialog('close');
517
- }
518
- }
519
- });
520
- jQuery("#delete_dialog").dialog('open');
521
- var idHidden = document.getElementById("result_id");
522
- var idHiddenName = document.getElementById("delete_quiz_name");
523
- idHidden.value = id;
524
- idHiddenName.value = quizName;
525
  }
526
 
527
  //quiz options style tab
528
- jQuery('.quiz_style_tab').click(function(e) {
529
  e.preventDefault();
530
  var current_id = jQuery(this).attr('data-id');
531
  jQuery('.quiz_style_tab').removeClass('current');
@@ -534,43 +552,43 @@ jQuery('.quiz_style_tab').click(function(e) {
534
  jQuery('#' + current_id).show();
535
  });
536
 
537
- if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
538
- if (window.location.href.indexOf('tab=style')> 0 ){
539
  function mlw_qmn_theme(theme) {
540
  document.getElementById('save_quiz_theme').value = theme;
541
  jQuery("div.mlw_qmn_themeBlockActive").toggleClass("mlw_qmn_themeBlockActive");
542
  jQuery("#mlw_qmn_theme_block_" + theme).toggleClass("mlw_qmn_themeBlockActive");
543
  }
544
 
545
- jQuery(document).ready(function() {
546
- jQuery(document).on('click', '.qsm-activate-theme', function() {
547
- jQuery(this).parents('.theme-wrapper').find('input[name=quiz_theme_id]').prop("checked", true);
548
- });
549
- jQuery(document).on('input', '.quiz_featured_image', function() {
550
- jQuery('.qsm_featured_image_preview').attr('src', jQuery(this).val());
551
- });
552
-
553
- jQuery(document).on('click', '.filter-links a', function() {
554
- let current_id = jQuery(this).attr('data-id');
555
- jQuery(this).parents('.filter-links').find('li a').each(function() {
556
- jQuery(this).removeClass('current');
557
  });
558
- jQuery(this).addClass('current');
559
- jQuery(this).parents('#qsm_themes').find('.themes-container').children('div').each(function() {
560
- if (jQuery(this).hasClass(current_id)) {
561
- jQuery(this).show();
562
- } else {
563
- jQuery(this).hide();
564
- }
565
  });
566
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
567
  });
568
 
569
  jQuery(document).ready(function () {
570
  jQuery(document).on('click', '.qsm-customize-color-settings', function (e) {
571
  e.preventDefault();
572
  MicroModal.show('qsm-theme-color-settings');
573
- if( jQuery('.my-color-field').length > 0 ){
574
  jQuery('.my-color-field').wpColorPicker();
575
  }
576
  });
@@ -582,7 +600,7 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
582
  //QSM - Quizzes/Surveys Page
583
 
584
  (function ($) {
585
- if (jQuery('body').hasClass('post-type-qsm_quiz')){
586
 
587
  $('#new_quiz_button_two').on('click', function (event) {
588
  event.preventDefault();
@@ -621,10 +639,10 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
621
  $('#quiz_settings_wrapper').html('').html('<div class="qsm-spinner-loader"></div>');
622
  $('#recomm_addons_wrapper').html('').html('<div class="qsm-spinner-loader"></div>');
623
  $.post(ajaxurl, {
624
- settings: settings,
625
- addons: addons,
626
- action: action
627
- },
628
  function (data) {
629
  var diff_html = data.split('=====');
630
  $('#quiz_settings_wrapper').html('');
@@ -658,21 +676,21 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
658
 
659
  $(document).on('click', '#the-list .qsm-action-link-delete', function (event) {
660
  event.preventDefault();
661
- var dataid = $(this).data('id');
662
- var dataname = $(this).data('name');
663
- $('#delete_quiz_id').val(dataid+'QID');
664
- $('#delete_quiz_name').val(dataname);
665
  MicroModal.show('modal-5');
666
  });
667
  $(document).on('click', '#the-list .qsm-action-link-duplicate', function (event) {
668
  event.preventDefault();
669
- var dataid = $(this).data('id');
670
- $('#duplicate_quiz_id').val(dataid+'QID');
671
  MicroModal.show('modal-4');
672
  });
673
  $(document).on('click', '#the-list .qsm-action-link-reset', function (event) {
674
  event.preventDefault();
675
- var dataid = $(this).data('id');
676
  $('#reset_quiz_id').val(dataid);
677
  MicroModal.show('modal-1');
678
  });
@@ -689,12 +707,12 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
689
  $('#delete-quiz-form').submit();
690
  });
691
 
692
- $( document ).on( 'click', '.post-type-qsm_quiz #doaction, .post-type-qsm_quiz #doaction2', function ( event ) {
693
- event.preventDefault();
694
- if ( $( "#bulk-action-selector-top" ).val() == "delete_pr" || $( "#bulk-action-selector-bottom" ).val() == "delete_pr" ) {
695
- MicroModal.show( 'modal-bulk-delete' );
696
- } else {
697
- $( '#posts-filter' ).submit();
698
  }
699
  });
700
  $(document).on('click', '.qsm-list-shortcode-view', function (e) {
@@ -717,19 +735,19 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
717
  });
718
  $('#bulk-delete-quiz-button').on('click', function (event) {
719
  event.preventDefault();
720
- if($("#bult-delete-quiz-form input[name='qsm_delete_question_from_qb']").is(":checked")){
721
- $("<input>",{
722
- "type":"hidden",
723
  "name": "qsm_delete_question_from_qb",
724
  "value": "1"
725
- } ).appendTo("#posts-filter");
726
  }
727
- if($("#bult-delete-quiz-form input[name='qsm_delete_from_db']").is(":checked")){
728
- $("<input>",{
729
- "type":"hidden",
730
  "name": "qsm_delete_from_db",
731
  "value": "1"
732
- } ).appendTo("#posts-filter");
733
  }
734
  $('#posts-filter').submit();
735
  });
@@ -739,9 +757,9 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
739
  // QSM - Quiz Wizard
740
 
741
  (function ($) {
742
- if (jQuery('body').hasClass('post-type-qsm_quiz') || jQuery('body').hasClass('toplevel_page_qsm_dashboard')){
743
  $('#create-quiz-button').on('click', function (event) {
744
- event.preventDefault();
745
  if ($('#new-quiz-form').find('.quiz_name').val() === '') {
746
  $('#new-quiz-form').find('.quiz_name').addClass('qsm-required');
747
  $('.qsm-wizard-wrap[data-show="quiz_settings"]').trigger('click');
@@ -887,64 +905,64 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
887
  //QSM - Admin Notices for enabling multiple categories in QSM 7.3+
888
 
889
  (function ($) {
890
- $(document).on('click', '.enable-multiple-category', function (e) {
891
- e.preventDefault();
892
- $('.category-action').html('Updating database<span></span>');
893
- $('.category-action').prev().hide();
894
- $('.category-action').prev().prev().hide();
895
- i = 0;
896
- category_interval = setInterval(() => {
897
- if (i % 3 == 0) {
898
- $('.category-action span').html(' .');
899
- } else {
900
- $('.category-action span').append(' .');
901
- }
902
- i++;
903
- }, 500);
904
- $.ajax({
905
- type: "POST",
906
- url: ajaxurl,
907
- data: {
908
- action: 'enable_multiple_categories',
909
- value: 'enable'
910
- },
911
- success: function (r) {
912
- response = JSON.parse(r);
913
- clearInterval(category_interval);
914
- if (response.status) {
915
- $('.category-action').parents('.multiple-category-notice').removeClass('notice-info').addClass('notice-success').html('<p>Database updated successfully.</p>');
916
- } else {
917
- $('.category-action').parents('.multiple-category-notice').removeClass('notice-info').addClass('notice-error').html('Error! Please try again');
918
- }
919
-
920
- }
921
- });
922
- });
923
-
924
- $(document).on('click', '.cancel-multiple-category', function (e) {
925
- e.preventDefault();
926
- $('.category-action').html('');
927
- $.ajax({
928
- type: "POST",
929
- url: ajaxurl,
930
- data: {
931
- action: 'enable_multiple_categories',
932
- value: 'cancel'
933
- },
934
- success: function (status) {
935
- if (status) {
936
- $('.multiple-category-notice').hide();
937
- }
938
- }
939
- });
940
- });
941
- $('.multiple-category-notice').show();
942
  }(jQuery));
943
 
944
  // QSM - Admin Stats Page
945
  (function ($) {
946
  if (jQuery('body').hasClass('qsm_page_qmn_stats')) {
947
- if (window.stats_graph instanceof Chart){
948
  window.stats_graph.destroy();
949
  }
950
  var graph_ctx = document.getElementById("graph_canvas").getContext("2d");
@@ -953,16 +971,17 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
953
  data: {
954
  labels: qsm_admin_stats.labels,
955
  datasets: [{
956
- label: 'Quiz Submissions', // Name the series
957
  data: qsm_admin_stats.value, // Specify the data values array
958
  fill: false,
959
  borderColor: '#2196f3', // Add custom color border (Line)
960
  backgroundColor: '#2196f3', // Add custom color background (Points and Fill)
961
  borderWidth: 1 // Specify bar border width
962
- }]},
963
- options: {
964
- responsive: true, // Instruct chart js to respond nicely.
965
- maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height
 
966
  }
967
  });
968
  }
@@ -973,266 +992,266 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
973
  * QSM - Contact Form
974
  */
975
 
976
- var QSMContact;
977
- (function ($) {
978
- if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
979
- if (window.location.href.indexOf('tab=contact') > 0 ){
980
 
981
  QSMContact = {
982
  load: function () {
983
- if ( $.isArray( qsmContactObject.contactForm ) && qsmContactObject.contactForm.length > 0 ) {
984
- $.each( qsmContactObject.contactForm, function ( i, val ) {
985
- QSMContact.addField( val );
986
- } );
987
- }
988
- },
989
- addField: function ( fieldArray ) {
990
- var template = wp.template( 'contact-form-field' );
991
-
992
- $( '.contact-form' ).append( template( fieldArray ) );
993
-
994
- $( '.contact-form-field' ).each( function () {
995
- QSMContact.hideShowSettings( $( this ) );
996
- } );
997
- setTimeout( QSMContact.removeNew, 250 );
998
- },
999
- removeNew: function () {
1000
- $( '.contact-form-field' ).removeClass( 'new' );
1001
- },
1002
- duplicateField: function ( linkClicked ) {
1003
- var fieldArray = QSMContact.prepareFieldData( linkClicked.parents( '.contact-form-field' ) );
1004
- QSMContact.addField( fieldArray );
1005
- },
1006
- deleteField: function ( field ) {
1007
- var parent = field.parents( '.contact-form-field' );
1008
- parent.addClass( 'deleting' );
1009
- setTimeout( function () {
1010
- parent.remove();
1011
- }, 250 );
1012
- },
1013
- newField: function () {
1014
- var fieldArray = {
1015
- label: '',
1016
- type: 'text',
1017
- answers: [],
1018
- required: false,
1019
- use: '',
1020
- enable: true,
1021
- is_default: false
1022
- };
1023
- jQuery( document ).trigger( 'qsm_add_contact_field', [fieldArray] );
1024
- QSMContact.addField( fieldArray );
1025
- },
1026
- prepareFieldData: function ( field ) {
1027
- var fieldArray = {
1028
- label: field.find( '.label-control' ).val(),
1029
- type: field.find( '.type-control' ).val(),
1030
- required: field.find( '.required-control' ).prop( 'checked' ),
1031
- use: field.find( '.use-control' ).val(),
1032
- enable: field.find( '.enable-control' ).prop( 'checked' ),
1033
- };
1034
- /**
1035
- * Store Other settings
1036
- */
1037
- field.find( '.contact-form-field-settings :input' ).each( function () {
1038
- var inputName = $( this ).attr( 'name' );
1039
- var inputVal = $( this ).val();
1040
- if ( 'checkbox' == $( this ).attr( 'type' ) ) {
1041
- inputVal = $( this ).prop( 'checked' );
1042
- }
1043
- fieldArray[inputName] = inputVal;
1044
- } );
1045
- return fieldArray;
1046
- },
1047
- save: function () {
1048
- QSMContact.displayAlert( 'Saving contact fields...', 'info' );
1049
- var contactFields = $( '.contact-form-field' );
1050
- var contactForm = [];
1051
- var contactEach;
1052
- $.each( contactFields, function ( i, val ) {
1053
- contactEach = QSMContact.prepareFieldData( $( this ) );
1054
- contactForm.push( contactEach );
1055
- } );
1056
-
1057
- var settings = {};
1058
- $('#contactformsettings input').each(function (){
1059
- if ('checkbox' == $(this).attr('type')) {
1060
- settings[$(this).attr('name')] = ($(this).prop( 'checked' ) ? '1' : '0');
1061
- } else {
1062
- settings[$(this).attr('name')] = $(this).val();
1063
- }
1064
- });
1065
-
1066
- var data = {
1067
- action: 'qsm_save_contact',
1068
- contact_form: contactForm,
1069
- settings: settings,
1070
- quiz_id: qsmContactObject.quizID,
1071
- nonce: qsmContactObject.saveNonce,
1072
- };
1073
-
1074
- jQuery.post( ajaxurl, data, function ( response ) {
1075
- QSMContact.saved( JSON.parse( response ) );
1076
- } );
1077
- },
1078
- saved: function ( response ) {
1079
- if ( response.status ) {
1080
- QSMContact.displayAlert( '<strong>Success</strong> Your contact fields have been saved!', 'success' );
1081
- } else {
1082
- QSMContact.displayAlert( '<strong>Error</strong> There was an error encountered when saving your contact fields. Please try again.', 'error' );
1083
- }
1084
- },
1085
- displayAlert: function ( message, type ) {
1086
- QSMContact.clearAlerts();
1087
- $( '.contact-message' ).addClass( 'notice' );
1088
- switch ( type ) {
1089
- case 'info':
1090
- $( '.contact-message' ).addClass( 'notice-info' );
1091
- break;
1092
- case 'error':
1093
- $( '.contact-message' ).addClass( 'notice-error' );
1094
- break;
1095
- case 'success':
1096
- $( '.contact-message' ).addClass( 'notice-success' );
1097
- break;
1098
- default:
1099
- }
1100
- $( '.contact-message' ).append( '<p>' + message + '</p>' );
1101
- },
1102
- clearAlerts: function () {
1103
- $( '.contact-message' ).empty().removeClass().addClass( 'contact-message' );
1104
- },
1105
- hideShowSettings: function ( field ) {
1106
- var type = field.find( '.type-control' ).val();
1107
- if ( field.find( '.required-control' ).prop( 'checked' ) ) {
1108
- field.find( '.field-required-flag' ).show();
1109
- }
1110
- if ( !field.find( '.enable-control' ).prop( 'checked' ) ) {
1111
- field.addClass( 'disabled-field' );
1112
- if ( !$( '.show-disabled-fields' ).prop( 'checked' ) ) {
1113
- field.addClass( 'hidden-field' );
1114
- }
1115
- }
1116
- field.find( '.contact-form-field-settings .contact-form-group:not(.required-option)' ).hide();
1117
- if ( 'text' == type || 'number' == type ) {
1118
- field.find( '.contact-form-field-settings .min-max-option' ).show();
1119
- }
1120
- if ( 'email' == type ) {
1121
- field.find( '.contact-form-field-settings .email-option' ).show();
1122
- }
1123
- jQuery( document ).trigger( 'qsm_contact_field_hide_show_settings', [field, type] );
1124
- }
1125
- };
1126
- $(function() {
1127
- QSMContact.load();
1128
- if ( $( '.contact-form > .contact-form-field' ).length === 0 ) {
1129
- $( '.save-contact' ).hide();
1130
- }
1131
- $( '.add-contact-field' ).on( 'click', function () {
1132
- QSMContact.newField();
1133
- if ( $( '.contact-form > .contact-form-field' ).length === 0 ) {
1134
- $( '.save-contact' ).hide();
1135
- } else {
1136
- $( '.save-contact' ).show();
1137
- }
1138
- } );
1139
- $( '.save-contact' ).on( 'click', function () {
1140
- QSMContact.save();
1141
- } );
1142
- $( '.contact-form' ).on( 'click', '.delete-field', function ( event ) {
1143
- event.preventDefault();
1144
- if ( !$( this ).hasClass( 'disabled' ) ) {
1145
- QSMContact.deleteField( $( this ) );
1146
- }
1147
- return false;
1148
- } );
1149
- $( '.contact-form' ).on( 'click', '.copy-field', function ( event ) {
1150
- event.preventDefault();
1151
- QSMContact.duplicateField( $( this ) );
1152
- } );
1153
- $( '.contact-form' ).on( 'click', '.settings-field', function ( event ) {
1154
- event.preventDefault();
1155
- var target = $( this ).parents( '.contact-form-field' ).find( '.contact-form-field-settings' );
1156
- $( '.contact-form-field-settings' ).not( target ).hide();
1157
- target.toggle();
1158
- } );
1159
- $( '.contact-form' ).on( 'change', '.type-control', function ( event ) {
1160
- event.preventDefault();
1161
- QSMContact.hideShowSettings( $( this ).parents( '.contact-form-field' ) );
1162
- } );
1163
- $( '.contact-form' ).on( 'change', '.required-control', function ( event ) {
1164
- event.preventDefault();
1165
- $( this ).parents( '.contact-form-field' ).find( '.field-required-flag' ).hide();
1166
- if ( $( this ).is( ':checked' ) ) {
1167
- $( this ).parents( '.contact-form-field' ).find( '.field-required-flag' ).show();
1168
- }
1169
- } );
1170
- $( '.contact-form' ).on( 'change', '.enable-control', function ( event ) {
1171
- event.preventDefault();
1172
- $( this ).parents( '.contact-form-field' ).addClass( 'disabled-field' );
1173
- if ( $( this ).is( ':checked' ) ) {
1174
- $( this ).parents( '.contact-form-field' ).removeClass( 'disabled-field' );
1175
- }
1176
- QSMContact.hideShowSettings( $( this ).parents( '.contact-form-field' ) );
1177
- } );
1178
- $( document ).on( 'change', '.show-disabled-fields', function ( event ) {
1179
- event.preventDefault();
1180
- var is_show = $( this ).prop( 'checked' );
1181
- jQuery.post( ajaxurl, { action: 'qsm_show_disabled_contact_fields', show: is_show } );
1182
- if ( is_show ) {
1183
- $( '.contact-form-field' ).removeClass( 'hidden-field' );
1184
- } else {
1185
- $( '.contact-form-field.disabled-field' ).addClass( 'hidden-field' );
1186
- }
1187
- } );
1188
- $( '.contact-form' ).sortable( {
1189
- opacity: 70,
1190
- cursor: 'grabbing',
1191
- handle: 'span.dashicons-move'
1192
- } );
1193
- });
1194
- }
1195
- }
1196
- }(jQuery));
1197
-
1198
- /**
1199
- * QSM - Admin emails
1200
- */
1201
 
 
1202
 
1203
- (function ($) {
1204
- if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
1205
- if (window.location.href.indexOf('tab=emails')> 0 ){
1206
- var QSMAdminEmails;
1207
- QSMAdminEmails = {
1208
- total: 0,
1209
- saveEmails: function() {
1210
- QSMAdmin.displayAlert( 'Saving emails...', 'info' );
1211
- var emails = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1212
  var email = {};
1213
- $( '.qsm-email' ).each( function() {
1214
  var email_content = '';
1215
- if( $( this ).find( '.email-template' ).parent('.wp-editor-container').length > 0 ){
1216
- email_content = wp.editor.getContent( $( this ).find( '.email-template' ).attr( 'id' ) );
1217
  } else {
1218
- email_content = $( this ).find( '.email-template' ).val()
1219
  }
1220
  email = {
1221
  'conditions': [],
1222
- 'to': $( this ).find( '.to-email' ).val(),
1223
- 'subject': $( this ).find( '.subject' ).val(),
1224
  'content': email_content,
1225
- 'replyTo': $( this ).find( '.reply-to' ).prop( 'checked' ),
1226
  };
1227
- $( this ).find( '.email-condition' ).each( function() {
1228
  email.conditions.push({
1229
  'category': $(this).children('.email-condition-category').val(),
1230
- 'criteria': $( this ).children( '.email-condition-criteria' ).val(),
1231
- 'operator': $( this ).children( '.email-condition-operator' ).val(),
1232
- 'value': $( this ).children( '.email-condition-value' ).val()
1233
  });
1234
  });
1235
- emails.push( email );
1236
  });
1237
  var data = {
1238
  'emails': emails,
@@ -1244,68 +1263,68 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
1244
  data: data,
1245
  headers: { 'X-WP-Nonce': qsmEmailsObject.nonce },
1246
  })
1247
- .done(function( results ) {
1248
- if ( results.status ) {
1249
- QSMAdmin.displayAlert( 'Emails were saved!', 'success' );
1250
  } else {
1251
- QSMAdmin.displayAlert( 'There was an error when saving the emails. Please try again.', 'error' );
1252
  }
1253
  })
1254
  .fail(QSMAdmin.displayjQueryError);
1255
  },
1256
- loadEmails: function() {
1257
  $.ajax({
1258
  url: wpApiSettings.root + 'quiz-survey-master/v1/quizzes/' + qsmEmailsObject.quizID + '/emails',
1259
  headers: { 'X-WP-Nonce': qsmEmailsObject.nonce },
1260
  })
1261
- .done(function( emails ) {
1262
- $( '#qsm_emails' ).find( '.qsm-spinner-loader' ).remove();
1263
- emails.forEach( function( email, i, emails ) {
1264
- QSMAdminEmails.addEmail( email.conditions, email.to, email.subject, email.content, email.replyTo );
1265
  });
1266
  QSMAdmin.clearAlerts();
1267
  })
1268
  .fail(QSMAdmin.displayjQueryError);
1269
  },
1270
  addCondition: function ($email, category, criteria, operator, value) {
1271
- var template = wp.template( 'email-condition' );
1272
  $email.find('.email-when-conditions').append(template({
1273
- 'category': category,
1274
- 'criteria': criteria,
1275
- 'operator': operator,
1276
- 'value': value
1277
  }));
1278
  },
1279
- newCondition: function( $email ) {
1280
  QSMAdminEmails.addCondition($email, '', 'score', 'equal', 0);
1281
  },
1282
- addEmail: function( conditions, to, subject, content, replyTo ) {
1283
  QSMAdminEmails.total += 1;
1284
- var template = wp.template( 'email' );
1285
- $( '#qsm_emails' ).append( template( { id: QSMAdminEmails.total, to: to, subject: subject, content: content, replyTo: replyTo } ) );
1286
- conditions.forEach( function( condition, i, conditions) {
1287
  QSMAdminEmails.addCondition(
1288
- $( '.qsm-email:last-child' ),
1289
  condition.category,
1290
  condition.criteria,
1291
  condition.operator,
1292
  condition.value
1293
  );
1294
  });
1295
- if(qsmEmailsObject.qsm_user_ve === 'true'){
1296
- var settings = {
1297
- mediaButtons: true,
1298
- tinymce: {
1299
- forced_root_block : '',
1300
- toolbar1: 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,charmap,undo,redo'
1301
- },
1302
- quicktags: true,
1303
- };
1304
- wp.editor.initialize( 'email-template-' + QSMAdminEmails.total, settings );
1305
- }
1306
  jQuery(document).trigger('qsm_after_add_email_block', [conditions, to, subject, content, replyTo]);
1307
  },
1308
- newEmail: function() {
1309
  var conditions = [{
1310
  'category': '',
1311
  'criteria': 'score',
@@ -1316,33 +1335,33 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
1316
  var subject = 'Quiz Results For %QUIZ_NAME%';
1317
  var content = '%QUESTIONS_ANSWERS_EMAIL%';
1318
  var replyTo = false;
1319
- QSMAdminEmails.addEmail( conditions, to, subject, content, replyTo );
1320
  }
1321
  };
1322
- $(function() {
1323
  QSMAdminEmails.loadEmails();
1324
- $( '.add-new-email' ).on( 'click', function( event ) {
1325
  event.preventDefault();
1326
  QSMAdminEmails.newEmail();
1327
  });
1328
- $( '.save-emails' ).on( 'click', function( event ) {
1329
  event.preventDefault();
1330
  QSMAdminEmails.saveEmails();
1331
  });
1332
- $( '#qsm_emails' ).on( 'click', '.new-condition', function( event ) {
1333
  event.preventDefault();
1334
- $page = $( this ).closest( '.qsm-email' );
1335
- QSMAdminEmails.newCondition( $page );
1336
  });
1337
- $( '#qsm_emails' ).on( 'click', '.delete-email-button', function( event ) {
1338
  event.preventDefault();
1339
- $( this ).closest( '.qsm-email' ).remove();
1340
  });
1341
- $( '#qsm_emails' ).on( 'click', '.delete-condition-button', function( event ) {
1342
  event.preventDefault();
1343
- $( this ).closest( '.email-condition' ).remove();
1344
  });
1345
- });
1346
  }
1347
  }
1348
  }(jQuery));
@@ -1350,613 +1369,875 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
1350
  /**
1351
  * QSM Question Tab
1352
  */
1353
- var QSMQuestion;
1354
- var import_button;
1355
  (function ($) {
1356
- if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
1357
- if (window.location.href.indexOf('tab') == -1 ||window.location.href.indexOf('tab=questions')> 0 ){
1358
-
1359
- $.QSMSanitize = function (input) {
1360
- return input.replace(/<(|\/|[^>\/bi]|\/[^>bi]|[^\/>][^>]+|\/[^>][^>]+)>/g, '');
1361
- };
1362
- QSMQuestion = {
1363
- question: Backbone.Model.extend({
1364
- defaults: {
1365
- id: null,
1366
- quizID: 1,
1367
- type: '0',
1368
- name: '',
1369
- question_title: '',
1370
- answerInfo: '',
1371
- comments: '1',
1372
- hint: '',
1373
- category: '',
1374
- required: 1,
1375
- answers: [],
1376
- page: 0
1377
- }
1378
- }),
1379
- questions: null,
1380
- page: Backbone.Model.extend({
1381
- defaults: {
1382
- id: null,
1383
- quizID: 1,
1384
- pagekey: qsmRandomID(8),
1385
- hide_prevbtn: 0,
1386
- questions: null,
1387
- }
1388
- }),
1389
- qpages: null,
1390
- questionCollection: null,
1391
- pageCollection: null,
1392
- categories: [],
1393
- /**
1394
- * Counts the total number of questions and then updates #total-questions span.
1395
- */
1396
- countTotal: function () {
1397
- var total = 0;
1398
-
1399
- // Cycles through each page.
1400
- _.each(jQuery('.page'), function (page) {
1401
-
1402
- // If page is empty, continue to the next.
1403
- if (0 == jQuery(page).children('.question').length) {
1404
- return;
1405
  }
1406
- // Cycle through each question and add to our total.
1407
- _.each(jQuery(page).children('.question'), function (question) {
1408
- total += 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1409
  });
1410
- });
1411
- $('#total-questions').text(total);
1412
- },
1413
- openQuestionBank: function (pageID) {
1414
- QSMQuestion.loadQuestionBank();
1415
- $('#add-question-bank-page').val(pageID);
1416
- MicroModal.show('modal-2', {
1417
- onClose: function () {
1418
- $('.save-page-button').trigger('click');
 
 
 
 
 
 
 
 
 
 
 
 
 
1419
  }
1420
- });
1421
- },
1422
- loadQuestionBank: function (action = '') {
1423
- if (action == 'change') {
1424
- $('.qb-load-more-wrapper').remove();
1425
- $('#question-bank').find('.question-bank-question').remove();
1426
- $('#question-bank').append('<div style="top: 45px;position: relative;" class="qsm-spinner-loader"></div>');
1427
- } else if ($('.qb-load-more-wrapper').length > 0) {
1428
- $('.qb-load-more-question').hide();
1429
- $('.qb-load-more-wrapper').append('<div class="qsm-spinner-loader"></div>');
1430
- } else {
1431
- $('#question-bank').empty();
1432
- $('#question-bank').append('<div class="qsm-spinner-loader"></div>');
1433
- }
1434
- $.ajax({
1435
- url: wpApiSettings.root + 'quiz-survey-master/v1/bank_questions/0/',
1436
- method: 'GET',
1437
- beforeSend: function (xhr) {
1438
- xhr.setRequestHeader('X-WP-Nonce', qsmQuestionSettings.nonce);
1439
- },
1440
- data: {
1441
- 'quizID': 0,
1442
- 'page': $('#question_back_page_number').length > 0 ? parseInt($('#question_back_page_number').val()) + 1 : 1,
1443
- 'category': $('#question-bank-cat').val(),
1444
- 'search': $('#question-bank-search-input').val()
1445
- },
1446
- success: QSMQuestion.questionBankLoadSuccess
1447
- });
1448
- },
1449
- questionBankLoadSuccess: function (response) {
1450
- var pagination = response.pagination;
1451
- var questions = response.questions;
1452
- if ($('.qb-load-more-wrapper').length > 0) {
1453
- $('.qb-load-more-wrapper').remove();
1454
- } else {
1455
- $('#question-bank').empty();
1456
- }
1457
- for (var i = 0; i < questions.length; i++) {
1458
- QSMQuestion.addQuestionToQuestionBank(questions[i]);
1459
- }
1460
- if (pagination.total_pages > pagination.current_page) {
1461
- var pagination_html = '<div class="qb-load-more-wrapper" style="text-align: center;margin: 20px 0 10px 0;"><input type="hidden" id="question_back_page_number" value="' + pagination.current_page + '"/>';
1462
- pagination_html += '<input type="hidden" id="question_back_total_pages" value="' + pagination.total_pages + '"/>';
1463
- pagination_html += '<a href="javascript:void(0)" class="qb-load-more-question">Load More Questions</a></div>';
1464
- $('#question-bank').append(pagination_html);
1465
- }
1466
- if (pagination.current_page == 1) {
1467
- if ( qsmQuestionSettings.categories.length > 0) {
1468
- var category_arr = qsmQuestionSettings.categories;
1469
- $cat_html = '<option value="">All Categories</option>';
1470
- $.each(category_arr, function (index, value) {
1471
- if (value.category !== '') {
1472
- if (typeof value.cat_id !== 'undefined' && value.cat_id !== '') {
1473
- $cat_html += '<option value="' + value.cat_id + '">' + value.category + '</option>';
1474
- } else {
1475
- $cat_html += '<option value="' + value.category + '">' + value.category + '</option>';
1476
- }
1477
- }
1478
- });
1479
- $('#question-bank-cat').html($cat_html);
1480
- $('#question-bank-cat').val(pagination.category);
1481
- }
1482
- }
1483
- },
1484
- addQuestionToQuestionBank: function (question) {
1485
- var questionText = QSMQuestion.prepareQuestionText(question.name);
1486
- var template = wp.template('single-question-bank-question');
1487
- if (question.question_title !== "undefined" && question.question_title !== "") {
1488
- questionText = question.question_title;
1489
- }
1490
- $('#question-bank').append(template({
1491
- id: question.id,
1492
- question: questionText,
1493
- category: question.category,
1494
- quiz_name: question.quiz_name
1495
- }));
1496
- },
1497
- addQuestionFromQuestionBank: function (questionID) {
1498
- QSMAdmin.displayAlert('Adding question...', 'info');
1499
- var model = new QSMQuestion.question({
1500
- id: questionID
1501
- });
1502
- model.fetch({
1503
- headers: {
1504
- 'X-WP-Nonce': qsmQuestionSettings.nonce
1505
- },
1506
- url: wpApiSettings.root + 'quiz-survey-master/v1/questions/' + questionID,
1507
- success: QSMQuestion.questionBankSuccess,
1508
- error: QSMAdmin.displayError
1509
- });
1510
- },
1511
- questionBankSuccess: function (model) {
1512
- var newModel = _.clone(model.attributes);
1513
- newModel.id = null;
1514
- QSMQuestion.questions.create(
1515
- newModel, {
1516
- headers: {
1517
- 'X-WP-Nonce': qsmQuestionSettings.nonce
1518
  },
1519
- success: QSMQuestion.addNewQuestionFromQuestionBank,
1520
- error: QSMAdmin.displayError
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1521
  }
1522
- );
1523
- },
1524
- prepareCategories: function () {
1525
- QSMQuestion.categories = [];
1526
- QSMQuestion.questions.each(function (question) {
1527
- var category = question.get('category');
1528
- if (0 !== category.length && !_.contains(QSMQuestion.categories, category)) {
1529
- QSMQuestion.categories.push(category);
1530
  }
1531
- });
1532
- },
1533
- processCategories: function () {
1534
- $('.category').remove();
1535
- _.each(QSMQuestion.categories, function (category) {
1536
- QSMQuestion.addCategory(category);
1537
- });
1538
- },
1539
- addCategory: function (category) {
1540
- var template = wp.template('single-category');
1541
- $('#categories').prepend(template({
1542
- category: category
1543
- }));
1544
- },
1545
- loadQuestions: function () {
1546
- QSMAdmin.displayAlert('Loading questions...', 'info');
1547
- QSMQuestion.questions.fetch({
1548
- headers: {
1549
- 'X-WP-Nonce': qsmQuestionSettings.nonce
1550
- },
1551
- data: {
1552
- quizID: qsmQuestionSettings.quizID
1553
- },
1554
- success: QSMQuestion.loadSuccess,
1555
- error: QSMAdmin.displayError
1556
- });
1557
- },
1558
- loadSuccess: function () {
1559
- QSMAdmin.clearAlerts();
1560
- $('.qsm-showing-loader').remove();
1561
- var question;
1562
- _.each(qsmQuestionSettings.qpages, function (page) {
1563
- QSMQuestion.qpages.add(page);
1564
- });
1565
- if (qsmQuestionSettings.pages.length > 0) {
1566
- for (var i = 0; i < qsmQuestionSettings.pages.length; i++) {
1567
- for (var j = 0; j < qsmQuestionSettings.pages[i].length; j++) {
1568
- question = QSMQuestion.questions.get(qsmQuestionSettings.pages[i][j]);
1569
- if( 'undefined' !== typeof question ){
1570
- QSMQuestion.addQuestionToPage(question);
1571
- }
1572
  }
1573
  }
1574
- } else {
1575
- //We have removed this code in 7.0.0 because not allow to delete the single page.
1576
- QSMQuestion.questions.each(QSMQuestion.addQuestionToPage);
1577
- }
1578
- //Create Default pages and one question.
1579
- if (qsmQuestionSettings.pages.length == 0 && QSMQuestion.questions.length == 0) {
1580
- $('.new-page-button').trigger('click');
1581
- $('.questions .new-question-button').trigger('click');
1582
- }
1583
- QSMQuestion.countTotal();
1584
- },
1585
- updateQPage: function (pageID) {
1586
- QSMAdmin.displayAlert('Saving page info', 'info');
1587
- var pageInfo = QSMQuestion.qpages.get(pageID);
1588
- jQuery('#page-options').find(':input, select, textarea').each(function (i, field) {
1589
- pageInfo.set(field.name, field.value);
1590
- });
1591
- },
1592
- savePages: function () {
1593
- QSMAdmin.displayAlert('Saving pages and questions...', 'info');
1594
- var pages = [];
1595
- var qpages = [];
1596
- var pageInfo = null;
1597
- var post_id = jQuery('#edit_quiz_post_id').val();
1598
-
1599
- // Cycles through each page and add page + questions to pages variable
1600
- _.each(jQuery('.page'), function (page) {
1601
-
1602
- // If page is empty, do not add it.
1603
- if (0 == jQuery(page).children('.question').length) {
1604
- return;
1605
  }
1606
- var singlePage = [];
1607
- // Cycle through each question and add to the page.
1608
- _.each(jQuery(page).children('.question'), function (question) {
1609
- singlePage.push(jQuery(question).data('question-id'))
 
 
 
 
 
 
 
1610
  });
1611
- pages.push(singlePage);
1612
- /**
1613
- * Prepare qpages Object
1614
- */
1615
- pageInfo = QSMQuestion.qpages.get(jQuery(page).data('page-id'));
1616
- pageInfo.set('questions', singlePage);
1617
- qpages.push(pageInfo.attributes);
1618
- });
1619
- var data = {
1620
- action: 'qsm_save_pages',
1621
- quiz_id: qsmQuestionSettings.quizID,
1622
- nonce: qsmQuestionSettings.saveNonce,
1623
- pages: pages,
1624
- qpages: qpages,
1625
- post_id: post_id,
1626
- };
1627
-
1628
- jQuery.ajax(ajaxurl, {
1629
- data: data,
1630
- method: 'POST',
1631
- success: QSMQuestion.savePagesSuccess,
1632
- error: QSMAdmin.displayjQueryError
1633
- });
1634
- },
1635
- savePagesSuccess: function () {
1636
- QSMAdmin.displayAlert('Questions and pages were saved!', 'success');
1637
- $('#save-edit-quiz-pages').removeClass('is-active');
1638
- },
1639
- addNewPage: function (pageID) {
1640
- var template = wp.template('page');
1641
- if (typeof pageID == 'undefined' || pageID == '') {
1642
- var newPageID = QSMQuestion.qpages.length + 1;
1643
- var pageID = newPageID;
1644
- var pageInfo = QSMQuestion.qpages.add({
1645
- id: newPageID,
1646
- quizID: qsmQuestionSettings.quizID,
1647
- pagekey: qsmRandomID(8),
1648
- hide_prevbtn: 0
1649
  });
1650
- }
1651
- var pageInfo = QSMQuestion.qpages.get(pageID);
1652
- $('.questions').append(template(pageInfo));
1653
- var page = $('.questions').find('.page').length;
1654
- $('.page:nth-child(' + page + ')').find('.page-number').text('Page ' + page);
1655
- $('.page').sortable({
1656
- items: '.question',
1657
- opacity: 70,
1658
- cursor: 'move',
1659
- handle: 'span.dashicons-move',
1660
- placeholder: "ui-state-highlight",
1661
- connectWith: '.page',
1662
- stop: function (evt, ui) {
1663
- setTimeout(
1664
- function () {
1665
- $('.save-page-button').trigger('click');
1666
- },
1667
- 200
1668
- )
1669
- }
1670
- });
1671
- setTimeout(QSMQuestion.removeNew, 250);
1672
- },
1673
- addNewQuestionFromQuestionBank: function (model) {
1674
- var page = parseInt($('#add-question-bank-page').val(), 10);
1675
- model.set('page', page);
1676
- QSMQuestion.questions.add(model);
1677
- QSMQuestion.addQuestionToPage(model);
1678
- $('.import-button').removeClass('disable_import');
1679
- QSMQuestion.countTotal();
1680
- import_button.html('').html('Add Question');
1681
- import_button.attr("onclick", "return confirm('Are you sure! you want to import this question again?')");
1682
- QSMQuestion.openEditPopup(model.id, $('.question[data-question-id=' + model.id + ']').find('.edit-question-button'));
1683
- $('#save-popup-button').trigger('click');
1684
- },
1685
- addNewQuestion: function (model) {
1686
- var default_answers = parseInt(qsmQuestionSettings.default_answers);
1687
- var count = 0;
1688
- QSMAdmin.displayAlert('Question created!', 'success');
1689
- QSMQuestion.addQuestionToPage(model);
1690
- QSMQuestion.openEditPopup(model.id, $('.question[data-question-id=' + model.id + ']').find('.edit-question-button'));
1691
- QSMQuestion.countTotal();
1692
- if ($('#answers').find('.answers-single').length < default_answers) {
1693
- while(count < default_answers){
1694
- $('#new-answer-button').trigger('click');
1695
- count++;
1696
- }
1697
- }
1698
- $('.save-page-button').trigger('click');
1699
- },
1700
- addQuestionToPage: function (model) {
1701
- var page = model.get('page') + 1;
1702
- var template = wp.template('question');
1703
- var page_exists = $('.page:nth-child(' + page + ')').length;
1704
- var count = 0;
1705
- while (!page_exists) {
1706
- QSMQuestion.addNewPage(page);
1707
- page_exists = $('.page:nth-child(' + page + ')').length;
1708
- count++;
1709
- if (count > 5) {
1710
- page_exists = true;
1711
- console.log('count reached');
1712
- }
1713
- }
1714
- var questionName = QSMQuestion.prepareQuestionText(model.get('name'));
1715
- var new_question_title = model.get('question_title');
1716
- if (new_question_title === null || typeof new_question_title === "undefined" || new_question_title === "") {
1717
- //Do nothing
1718
- } else {
1719
- questionName = new_question_title;
1720
- }
1721
- if (questionName == '') {
1722
- questionName = 'Your new question!';
1723
- }
1724
- $('.page:nth-child(' + page + ')').append(template({
1725
- id: model.id,
1726
- category: model.get('category'),
1727
- question: questionName
1728
- }));
1729
- setTimeout(QSMQuestion.removeNew, 250);
1730
- },
1731
- createQuestion: function (page) {
1732
- QSMAdmin.displayAlert('Creating question...', 'info');
1733
- QSMQuestion.questions.create({
1734
- quizID: qsmQuestionSettings.quizID,
1735
- page: page
1736
- }, {
1737
- headers: {
1738
- 'X-WP-Nonce': qsmQuestionSettings.nonce
1739
- },
1740
- success: QSMQuestion.addNewQuestion,
1741
- error: QSMAdmin.displayError
1742
- });
1743
- },
1744
- duplicateQuestion: function (questionID) {
1745
- QSMAdmin.displayAlert('Duplicating question...', 'info');
1746
- var model = QSMQuestion.questions.get(questionID);
1747
- var newModel = _.clone(model.attributes);
1748
- newModel.id = null;
1749
- QSMQuestion.questions.create(
1750
- newModel, {
1751
  headers: {
1752
  'X-WP-Nonce': qsmQuestionSettings.nonce
1753
  },
1754
- success: QSMQuestion.addNewQuestion,
1755
  error: QSMAdmin.displayError
1756
  }
1757
- );
1758
- },
1759
- saveQuestion: function (questionID, CurrentElement) {
1760
- QSMAdmin.displayAlert('Saving question...', 'info');
1761
- var model = QSMQuestion.questions.get(questionID);
1762
- var hint = $('#hint').val();
1763
- var name = wp.editor.getContent('question-text');
1764
- //Save new question title
1765
- var question_title = $('#question_title').val();
1766
- if (name == '' && question_title == '') {
1767
- alert('Enter Question title or description');
1768
- setTimeout(function () {
1769
- $('#save-edit-question-spinner').removeClass('is-active');
1770
- }, 250);
1771
- return false;
1772
- }
1773
- var advanced_option = {};
1774
- var answerInfo = wp.editor.getContent('correct_answer_info');
1775
- var quizID = parseInt( qsmTextTabObject.quiz_id );
1776
- var type = $("#question_type").val();
1777
- var comments = $("#comments").val();
1778
- advanced_option['required'] = $(".questionElements input[name='required']").is(":checked") ? 0 : 1;
1779
- var category = $(".category-radio:checked").val();
1780
- var limit_text = $("#limit_text").val();
1781
- var limit_multiple_response = $("#limit_multiple_response").val();
1782
- var file_upload_limit = $("#file_upload_limit").val();
1783
- var type_arr = [];
1784
- $.each($("input[name='file_upload_type[]']:checked"), function () {
1785
- type_value = $(this).val().replace(/,/g, '');
1786
- type_arr.push(type_value);
1787
- });
1788
- if ('new_category' == category) {
1789
- category = $('#new_category').val();
1790
- }
1791
- if (!category) {
1792
- category = '';
1793
- }
1794
- var multicategories = [];
1795
- $.each($("input[name='tax_input[qsm_category][]']:checked"), function () {
1796
- multicategories.push($(this).val());
1797
- });
1798
- var featureImageID = $('.qsm-feature-image-id').val();
1799
- var featureImageSrc = $('.qsm-feature-image-src').val();
1800
- var answerType = $('#change-answer-editor').val();
1801
- var matchAnswer = $('#match-answer').val();
1802
-
1803
- var answers = [];
1804
- var $answers = jQuery('.answers-single');
1805
- _.each($answers, function (answer) {
1806
- var $answer = jQuery(answer);
1807
- var answer = '';
1808
- var caption = '';
1809
- if (answerType == 'rich') {
1810
- var ta_id = $answer.find('textarea').attr('id')
1811
- answer = wp.editor.getContent(ta_id);
1812
- } else if (answerType == 'image') {
1813
- answer = $answer.find('.answer-text').val().trim();
1814
- answer = $.QSMSanitize(answer);
1815
- caption = $answer.find('.answer-caption').val().trim();
1816
- caption = $.QSMSanitize(caption);
1817
  } else {
1818
- answer = $answer.find('.answer-text').val().trim();
1819
- answer = $.QSMSanitize(answer);
1820
  }
1821
-
1822
- var points = $answer.find('.answer-points').val();
1823
- var correct = 0;
1824
- if ($answer.find('.answer-correct').prop('checked')) {
1825
- correct = 1;
1826
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1827
 
1828
- if (answerType == 'image') {
1829
- answers.push([answer, points, correct, caption]);
1830
- } else {
1831
- answers.push([answer, points, correct]);
1832
- }
1833
 
1834
- });
1835
- $('.questionElements .advanced-content > .qsm-row:not(.core-option)').each(function () {
1836
- if ($(this).find('input[type="text"]').length > 0) {
1837
- var element_id = $(this).find('input[type="text"]').attr('id');
1838
- advanced_option[element_id] = $(this).find('input[type="text"]').val();
1839
- } else if ($(this).find('input[type="number"]').length > 0) {
1840
- var element_id = $(this).find('input[type="number"]').attr('id');
1841
- advanced_option[element_id] = $(this).find('input[type="number"]').val();
1842
- } else if ($(this).find('select').length > 0) {
1843
- var element_id = $(this).find('select').attr('id');
1844
- advanced_option[element_id] = $(this).find('select').val();
1845
- } else if ($(this).find('input[type="checkbox"]').length > 0) {
1846
- var element_id = $(this).find('input[type="checkbox"]').attr('name');
1847
- var multi_value = $(this).find('input[type="checkbox"]:checked').map(function () {
1848
- return this.value;
1849
- }).get().join(',');
1850
- element_id = element_id.replace('[]', '');
1851
- advanced_option[element_id] = multi_value;
1852
- }
1853
- });
1854
- model.save({
1855
- quizID: quizID,
1856
- type: type,
1857
- name: name,
1858
- question_title: question_title,
1859
- answerInfo: answerInfo,
1860
- comments: comments,
1861
- hint: hint,
1862
- category: category,
1863
- multicategories: multicategories,
1864
- featureImageID: featureImageID,
1865
- featureImageSrc: featureImageSrc,
1866
- answers: answers,
1867
- answerEditor: answerType,
1868
- matchAnswer: matchAnswer,
1869
- other_settings: advanced_option,
1870
- rest_nonce: qsmQuestionSettings.rest_user_nonce
1871
- }, {
1872
- headers: {
1873
- 'X-WP-Nonce': qsmQuestionSettings.nonce
1874
- },
1875
- success: QSMQuestion.saveSuccess,
1876
- error: QSMAdmin.displayError,
1877
- type: 'POST'
1878
- });
1879
- jQuery(document).trigger('qsm_save_question', [questionID, CurrentElement]);
1880
- },
1881
- saveSuccess: function (model) {
1882
- QSMAdmin.displayAlert('Question was saved!', 'success');
1883
- var template = wp.template('question');
1884
- var page = model.get('page') + 1;
1885
- var questionName = model.get('name');
1886
- var new_question_title = model.get('question_title');
1887
- if (new_question_title !== '') {
1888
- questionName = $.QSMSanitize(new_question_title);
1889
- }
1890
- var category = [];
1891
- var multicategories = model.get('multicategories');
1892
- if (multicategories === null || typeof multicategories === "undefined") {
1893
- //No Action Require
1894
- } else {
1895
- $.each(multicategories, function (i, val) {
1896
- category.push($(".qsm-popup__content #qsm_category-" + val + " label:first-child")[0].textContent);
1897
  });
1898
- category = category.filter(item => item);
1899
- }
1900
- $('.question[data-question-id=' + model.id + ']').replaceWith(template({
1901
- id: model.id,
1902
- type: model.get('type'),
1903
- category: category.join(', '),
1904
- question: questionName
1905
- }));
1906
- setTimeout(function () {
1907
- $('#save-edit-question-spinner').removeClass('is-active');
1908
- }, 250);
1909
- setTimeout(QSMQuestion.removeNew, 250);
1910
- },
1911
- addNewAnswer: function (answer, questionType = false) {
1912
- if (!questionType) {
1913
- questionType = $('#question_type').val();
1914
- }
1915
- var answerTemplate = wp.template('single-answer');
1916
- if (answer.length >= 7 && answer[6] == 'image') {
1917
- $('#answers').append(answerTemplate({
1918
- answer: decodeEntities(answer[0]),
1919
- points: answer[1],
1920
- correct: answer[2],
1921
- caption: answer[3],
1922
- count: answer[4],
1923
- question_id: answer[5],
1924
- answerType: answer[6],
1925
- form_type: qsmQuestionSettings.form_type,
1926
- quiz_system: qsmQuestionSettings.quiz_system
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1927
  }));
1928
- } else {
1929
- $('#answers').append(answerTemplate({
1930
- answer: decodeEntities(answer[0]),
1931
- points: answer[1],
1932
- correct: answer[2],
1933
- count: answer[3],
1934
- question_id: answer[4],
1935
- answerType: answer[5],
1936
- form_type: qsmQuestionSettings.form_type,
1937
- quiz_system: qsmQuestionSettings.quiz_system
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1938
  }));
1939
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1940
 
1941
- // show points field only for polar in survey and simple form
1942
- if (qsmQuestionSettings.form_type != 0) {
1943
- if (questionType == 13) {
1944
- $('#answers .answer-points').show();
1945
  } else {
1946
- $('#answers .answer-points').val('').hide();
1947
  }
1948
- }
1949
- if (qsmQuestionSettings.form_type == 0) {
1950
- if (questionType == 14) {
1951
- $('.correct-answer').hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1952
  } else {
1953
- $('.correct-answer').show();
 
 
1954
  }
1955
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1956
 
1957
- if (answer[5] == 'rich' && qsmQuestionSettings.qsm_user_ve === 'true') {
1958
- var textarea_id = 'answer-' + answer[4] + '-' + answer[3];
1959
- wp.editor.remove(textarea_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1960
  var settings = {
1961
  mediaButtons: true,
1962
  tinymce: {
@@ -1965,851 +2246,688 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
1965
  },
1966
  quicktags: true,
1967
  };
1968
- wp.editor.initialize(textarea_id, settings);
1969
- var anser = QSMQuestion.prepareQuestionText(answer[0]);
1970
- $(textarea_id).val(anser);
1971
- tinyMCE.get(textarea_id).setContent(anser);
1972
- }
1973
- },
1974
- openEditPopup: function (questionID, CurrentElement) {
1975
- if (CurrentElement.parents('.question').next('.questionElements').length > 0) {
1976
- if (CurrentElement.parents('.question').next('.questionElements').is(":visible")) {
1977
- CurrentElement.parents('.question').next('.questionElements').slideUp('slow');
1978
- $('.questions').sortable('enable');
1979
- $('.page').sortable('enable');
1980
- CurrentElement.parents('.question').removeClass('opened');
1981
- } else {
1982
- CurrentElement.parents('.question').addClass('opened');
1983
- CurrentElement.parents('.question').next('.questionElements').slideDown('slow');
1984
- }
1985
- return;
1986
- } else {
1987
- CurrentElement.parents('.question').addClass('opened');
1988
- $('.questions .questionElements').slideDown('slow');
1989
- $('.questions .questionElements').remove();
1990
- }
1991
- //Copy and remove popup div
1992
- var questionElements = $('#modal-1-content').html();
1993
- $('#modal-1-content').children().remove();
1994
- CurrentElement.parents('.question').after("<div style='display: none;' class='questionElements'>" + questionElements + "</div>");
1995
-
1996
- //Show question id on question edit screen
1997
- $('#qsm-question-id').text('ID: ' + questionID);
1998
- QSMQuestion.prepareCategories();
1999
- QSMQuestion.processCategories();
2000
- var question = QSMQuestion.questions.get(questionID);
2001
- var questionText = QSMQuestion.prepareQuestionText(question.get('name'));
2002
- $('#edit_question_id').val(questionID);
2003
- var answerInfo = question.get('answerInfo');
2004
- var CAI_editor = '';
2005
- var question_editor = ''
2006
- if (qsmQuestionSettings.qsm_user_ve === 'true') {
2007
- wp.editor.remove('question-text');
2008
- wp.editor.remove('correct_answer_info');
2009
- QSMQuestion.prepareEditor();
2010
- question_editor = tinyMCE.get('question-text');
2011
- CAI_editor = tinyMCE.get('correct_answer_info');
2012
- }
2013
- if ($('#wp-question-text-wrap').hasClass('html-active')) {
2014
- jQuery("#question-text").val(questionText);
2015
- } else if (question_editor) {
2016
- tinyMCE.get('question-text').setContent(questionText);
2017
- } else {
2018
- jQuery("#question-text").val(questionText);
2019
- }
2020
-
2021
- if ($('#wp-correct_answer_info-wrap').hasClass('html-active')) {
2022
- jQuery("#correct_answer_info").val(answerInfo);
2023
- } else if (CAI_editor) {
2024
- tinyMCE.get('correct_answer_info').setContent(answerInfo);
2025
- } else {
2026
- jQuery("#correct_answer_info").val(answerInfo);
2027
- }
2028
-
2029
- $('#answers').empty();
2030
- var answers = question.get('answers');
2031
- var answerEditor = question.get('answerEditor');
2032
- if (answerEditor === null || typeof answerEditor === "undefined") {
2033
- answerEditor = 'text';
2034
- }
2035
- //Get text limit value
2036
- var get_limit_text = question.get('limit_text');
2037
- if (get_limit_text === null || typeof get_limit_text === "undefined") {
2038
- get_limit_text = '0';
2039
- }
2040
- //Get limit multiple response value
2041
- var get_limit_mr = question.get('limit_multiple_response');
2042
- if (get_limit_mr === null || typeof get_limit_mr === "undefined") {
2043
- get_limit_mr = '0';
2044
- }
2045
- //Get file upload limit
2046
- var get_limit_fu = question.get('file_upload_limit');
2047
- if (get_limit_fu === null || typeof get_limit_fu === "undefined") {
2048
- get_limit_fu = '0';
2049
- }
2050
- //Get checked question type
2051
- var multicategories = question.get('multicategories');
2052
- $("input[name='tax_input[qsm_category][]']:checkbox").attr("checked", false);
2053
- if (multicategories === null || typeof multicategories === "undefined") {
2054
- //No Action Require
2055
- } else {
2056
- $.each(multicategories, function (i, val) {
2057
- $("input[name='tax_input[qsm_category][]']:checkbox[value='" + val + "']").attr("checked", "true");
2058
- });
2059
- }
2060
- //Get featured image
2061
- var get_featureImageSrc = question.get('featureImageSrc');
2062
- var get_featureImageID = question.get('featureImageID');
2063
- if (get_featureImageSrc === null || typeof get_featureImageSrc === "undefined") {
2064
- get_featureImageSrc = get_featureImageID = '';
2065
- }
2066
- //Get checked question type
2067
- var get_file_upload_type = question.get('file_upload_type');
2068
- $("input[name='file_upload_type[]']:checkbox").attr("checked", false);
2069
- if (get_file_upload_type === null || typeof get_file_upload_type === "undefined") {} else {
2070
- var fut_arr = get_file_upload_type.split(",");
2071
- $.each(fut_arr, function (i) {
2072
- $("input[name='file_upload_type[]']:checkbox[value='" + fut_arr[i] + "']").attr("checked", "true");
2073
- });
2074
- }
2075
- var al = 0;
2076
- _.each(answers, function (answer) {
2077
- answer.push(al + 1);
2078
- answer.push(questionID);
2079
- answer.push(answerEditor);
2080
- QSMQuestion.addNewAnswer(answer, question.get('type'));
2081
- al++;
2082
- });
2083
- //get new question type
2084
- var get_question_title = question.get('question_title');
2085
- if (get_question_title === null || typeof get_question_title === "undefined") {
2086
- get_question_title = '';
2087
- }
2088
-
2089
- //Hide the question settings based on question type
2090
- $('.qsm_hide_for_other').hide();
2091
- if ($('.qsm_show_question_type_' + question.get('type')).length > 0) {
2092
- $('.qsm_show_question_type_' + question.get('type')).show();
2093
- }
2094
-
2095
- qsm_hide_show_question_desc(question.get('type'));
2096
- $('#hint').val(question.get('hint'));
2097
- $("#question_type").val(question.get('type'));
2098
- $("#comments").val(question.get('comments'));
2099
- //Changed checked logic based on new structure for required.
2100
- $("input#required[value='" + question.get('required') + "']").prop('checked', true);
2101
-
2102
- $("#limit_text").val(get_limit_text);
2103
- $("#limit_multiple_response").val(get_limit_mr);
2104
- $("#file_upload_limit").val(get_limit_fu);
2105
- $("#change-answer-editor").val(answerEditor);
2106
- $(".category-radio").removeAttr('checked');
2107
- $("#edit-question-id").text('').text(questionID);
2108
- $("#question_title").val(get_question_title);
2109
- if (0 !== question.get('category').length) {
2110
- $(".category-radio").val([question.get('category')]);
2111
- }
2112
- //Append feature image
2113
- if (get_featureImageSrc) {
2114
- var button = $('.qsm-feature-image-upl');
2115
- button.html('<img src="' + get_featureImageSrc + '" style="width:150px">');
2116
- button.next('.qsm-feature-image-rmv').show();
2117
- button.next().next('.qsm-feature-image-id').val(get_featureImageID);
2118
- button.next().next().next('.qsm-feature-image-src').val(get_featureImageSrc);
2119
- }
2120
- //Append extra settings
2121
- var all_setting = question.get('settings');
2122
- if (all_setting === null || typeof all_setting === "undefined") {} else {
2123
- $.each(all_setting, function (index, value) {
2124
- if ($('#' + index + '_area').length > 0) {
2125
- if (1 == $('#' + index + '_area').find('input[type=checkbox]').length) {
2126
- $(".questionElements input[name='" + index + "'][value='" + value + "']").attr("checked", "true").prop('checked', true);
2127
- } else if ($('#' + index + '_area').find('input[type=checkbox]').length > 1) {
2128
- var fut_arr = value.split(",");
2129
- $.each(fut_arr, function (i) {
2130
- $(".questionElements input[name='" + index + "[]']:checkbox[value='" + fut_arr[i] + "']").attr("checked", "true").prop('checked', true);
2131
- });
2132
  } else {
2133
- if (value != null) {
2134
- $('#' + index).val(value);
2135
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2136
  }
2137
  }
2138
- if (index == 'matchAnswer') {
2139
- $('#match-answer').val(value);
2140
  }
2141
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2142
  }
2143
- CurrentElement.parents('.question').next('.questionElements').slideDown('slow');
2144
- $('#modal-1-content').html(questionElements);
2145
- //MicroModal.show( 'modal-1' );
2146
- $('.questions').sortable('disable');
2147
- $('.page').sortable('disable');
2148
-
2149
- QSMQuestion.sync_child_parent_category(questionID);
2150
 
2151
- jQuery(document).trigger('qsm_open_edit_popup', [questionID, CurrentElement]);
2152
- },
2153
- openEditPagePopup: function (pageID) {
2154
- var page = QSMQuestion.qpages.get(pageID);
2155
- $('#edit_page_id').val(pageID);
2156
- $("#edit-page-id").text('').text(pageID);
2157
- jQuery('#page-options').find(':input, select, textarea').each(function (i, field) {
2158
- field.value = page.get(field.name);
2159
  });
2160
- MicroModal.show('modal-page-1');
2161
- },
2162
- removeNew: function () {
2163
- $('.page-new').removeClass('page-new');
2164
- $('.question-new').removeClass('question-new');
2165
- },
2166
- prepareQuestionText: function (question) {
2167
- return jQuery('<textarea />').html(question).text();
2168
- },
2169
- prepareEditor: function () {
2170
- var settings = {
2171
- mediaButtons: true,
2172
- tinymce: {
2173
- forced_root_block: '',
2174
- toolbar1: 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,charmap,undo,redo'
2175
- },
2176
- quicktags: true,
2177
- };
2178
- wp.editor.initialize('question-text', settings);
2179
- wp.editor.initialize('correct_answer_info', settings);
2180
- },
2181
- sync_child_parent_category: function (questionID) {
2182
- $('.qsm_category_checklist').find('input').each(function (index, input) {
2183
- $(input).bind('change', function () {
2184
- var checkbox = $(this);
2185
- var is_checked = $(checkbox).is(':checked');
2186
- if (is_checked) {
2187
- $(checkbox).parents('li').children('label').children('input').prop("checked", true);
2188
- } else {
2189
- $(checkbox).parentsUntil('ul').find('input').prop("checked", false);
2190
- }
2191
- jQuery(document).trigger('qsm_sync_child_parent_category', [checkbox, questionID]);
2192
- });
2193
  });
2194
- },
2195
- question_type_change: function (previous_question_val, questionID) {
2196
- //you can override this object
2197
- var ans_type = $('#change-answer-editor').val();
2198
- if (2 == questionID && 'text' !== ans_type){
2199
- $('#change-answer-editor').val('text');
2200
- $('.answers-single').remove();
2201
- }
2202
- }
2203
- };
2204
-
2205
- $(function () {
2206
- QSMQuestion.pageCollection = Backbone.Collection.extend({
2207
- model: QSMQuestion.page
2208
- });
2209
- QSMQuestion.qpages = new QSMQuestion.pageCollection();
2210
- QSMQuestion.questionCollection = Backbone.Collection.extend({
2211
- url: wpApiSettings.root + 'quiz-survey-master/v1/questions',
2212
- model: QSMQuestion.question
2213
- });
2214
- QSMQuestion.questions = new QSMQuestion.questionCollection();
2215
- $('.new-page-button').on('click', function (event) {
2216
- event.preventDefault();
2217
- QSMQuestion.addNewPage();
2218
- });
2219
-
2220
- $('.questions').on('click', '.new-question-button', function (event) {
2221
- event.preventDefault();
2222
- if (jQuery('.questionElements').is(':visible')) {
2223
- $('#save-popup-button').trigger('click');
2224
- }
2225
- QSMQuestion.createQuestion($(this).parents('.page').index());
2226
- });
2227
-
2228
- $('.questions').on('click', '.add-question-bank-button', function (event) {
2229
- event.preventDefault();
2230
- if (jQuery('.questionElements').is(':visible')) {
2231
- $('#save-popup-button').trigger('click');
2232
- }
2233
- QSMQuestion.openQuestionBank($(this).parents('.page').index());
2234
- });
2235
 
2236
- //Show more question on load more
2237
- $(document).on('click', '.qb-load-more-question', function (event) {
2238
- event.preventDefault();
2239
- QSMQuestion.loadQuestionBank();
2240
- });
 
 
2241
 
2242
- //Show category related question
2243
- $(document).on('change', '#question-bank-cat', function (event) {
2244
- event.preventDefault();
2245
- QSMQuestion.loadQuestionBank('change');
2246
- });
 
 
2247
 
2248
- //Show searched question
2249
- $(document).on('submit', '#question-bank-search-form', function (event) {
2250
- event.preventDefault();
2251
- QSMQuestion.loadQuestionBank('change');
2252
- });
2253
 
2254
- $('.questions').on('click', '.edit-question-button', function (event) {
2255
- event.preventDefault();
2256
- $('.qsm-category-filter').trigger('keyup');
2257
- QSMQuestion.openEditPopup($(this).parents('.question').data('question-id'), $(this));
2258
- });
2259
- $('.questions').on('click', '.edit-page-button', function (event) {
2260
- event.preventDefault();
2261
- QSMQuestion.openEditPagePopup($(this).parents('.page').data('page-id'));
2262
- });
2263
 
2264
- $(document).on('click', '.questions .duplicate-question-button', function (event) {
2265
- event.preventDefault();
2266
- QSMQuestion.duplicateQuestion($(this).parents('.question').data('question-id'));
2267
- });
2268
- $('.questions').on('click', '.delete-question-button', function (event) {
2269
- event.preventDefault();
2270
- remove = $(this);
2271
- // opens-up question-delete modal
2272
- MicroModal.show('modal-7');
2273
- $('#unlink-question-button').attr('data-question-iid', $(this).data('question-iid'));
2274
- $('#delete-question-button').attr('data-question-iid', $(this).data('question-iid'));
2275
- });
2276
- // removes question from database
2277
- $('#delete-question-button').click(function (event) {
2278
- event.preventDefault();
2279
- var question_id = $(this).data('question-iid');
2280
- $.ajax({
2281
- url: ajaxurl,
2282
- method: 'POST',
2283
- data: {
2284
- 'action': 'qsm_delete_question_from_database',
2285
- 'question_id': question_id,
2286
- 'nonce': qsmQuestionSettings.single_question_nonce
2287
- },
2288
- success: function (response) {
2289
- // do nothing
2290
- }
2291
  });
2292
- remove.parents('.question').remove();
2293
- QSMQuestion.countTotal();
2294
- $('.save-page-button').trigger('click');
2295
- MicroModal.close('modal-7');
2296
- });
2297
 
2298
- // unlink question from a particular quiz.
2299
- $('#unlink-question-button').click(function (event) {
2300
- event.preventDefault();
2301
- var question_id = $(this).data('question-iid');
2302
- remove.parents('.question').remove();
2303
- QSMQuestion.countTotal();
2304
- $('.save-page-button').trigger('click');
2305
- MicroModal.close('modal-7');
2306
- });
2307
 
2308
- $(document).on('click', '.delete-page-button', function (event) {
2309
- event.preventDefault();
2310
- if (confirm('Are you sure?')) {
2311
- var pageID = $(this).parent().siblings('main').children('#edit_page_id').val();
2312
- $('.page[data-page-id='+pageID+']').remove();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2313
  $('.save-page-button').trigger('click');
 
 
 
 
 
 
 
 
2314
  QSMQuestion.countTotal();
2315
- MicroModal.close('modal-page-1');
2316
- }
2317
- });
2318
- $(document).on('click', '#answers .delete-answer-button', function (event) {
2319
- event.preventDefault();
2320
- $(this).parents('.answers-single').remove();
2321
- });
2322
- $(document).on('click', '#delete-action .deletion', function (event) {
2323
- event.preventDefault();
2324
- $(this).parents('.questionElements').slideUp('slow');
2325
- });
2326
- $(document).on('click', '#save-popup-button', function (event) {
2327
- event.preventDefault();
2328
- questionElements = $(this).parents('.questionElements');
2329
- if (6 == questionElements.find('#question_type').val()) {
2330
- question_description = wp.editor.getContent('question-text').trim();
2331
- if (question_description == '' || question_description == null) {
2332
- alert('Text/HTML Section cannot be empty');
2333
- return false;
2334
  }
2335
- }
2336
- if (14 == questionElements.find('#question_type').val()) {
2337
- question_description = wp.editor.getContent('question-text').trim();
2338
- blanks = question_description.match(/%BLANK%/g);
2339
- options_length = $('.answer-text-div').length
2340
- if ($('#match-answer').val() == 'sequence') {
2341
- if (blanks == null || blanks.length != options_length) {
2342
- $('.modal-8-table').html('Number of <strong>%BLANK%</strong> should be equal to options for sequential matching');
2343
- MicroModal.show('modal-8');
2344
- return false;
2345
- }
2346
- } else {
2347
- if (blanks == null || options_length === 0) {
2348
- $('.modal-8-table').html('Atleast one <strong>%BLANK%</strong> and one option is required.');
2349
- MicroModal.show('modal-8');
 
2350
  return false;
2351
  }
2352
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2353
 
2354
 
2355
- }
2356
- $('#save-edit-question-spinner').addClass('is-active');
2357
- var model_html = $('#modal-1-content').html();
2358
- $('#modal-1-content').children().remove();
2359
-
2360
- QSMQuestion.saveQuestion($(this).parents('.questionElements').children('#edit_question_id').val(), $(this));
2361
- $('.save-page-button').trigger('click');
2362
- $('#modal-1-content').html(model_html);
2363
- });
2364
- $(document).on('click', '#new-answer-button', function (event) {
2365
- event.preventDefault();
2366
- var answer_length = $('#answers').find('.answers-single').length;
2367
- if (answer_length > 1 && $('#question_type').val() == 13) {
2368
- alert('You can not add more than 2 answer for Polar Question type');
2369
- return;
2370
- }
2371
- var question_id = $('#edit_question_id').val();
2372
- var answerType = $('#change-answer-editor').val();
2373
- var answer = ['', '', 0, answer_length + 1, question_id, answerType];
2374
- QSMQuestion.addNewAnswer(answer, 0);
2375
- });
2376
 
2377
- $(document).on('click', '.qsm-popup-bank .import-button', function (event) {
2378
- event.preventDefault();
2379
- $(this).text('').text('Adding Question');
2380
- import_button = $(this);
2381
- $('.import-button').addClass('disable_import');
2382
- QSMQuestion.addQuestionFromQuestionBank($(this).data('question-id'));
2383
- MicroModal.close('modal-2');
2384
- });
 
 
 
 
 
 
 
 
2385
 
2386
- //Click on selected question button.
2387
- $('.qsm-popup-bank').on('click', '#qsm-import-selected-question', function (event) {
2388
- var $total_selction = $('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').length;
2389
- if ($total_selction === 0) {
2390
- alert('No question is selected.');
2391
- } else {
2392
- $.fn.reverse = [].reverse;
2393
- $($('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').parents('.question-bank-question').reverse()).each(function () {
2394
- $(this).find('.import-button').text('').text('Adding Question');
2395
- import_button = $(this).find('.import-button');
2396
- QSMQuestion.countTotal();
2397
- QSMQuestion.addQuestionFromQuestionBank($(this).data('question-id'));
2398
- $(this).find('.import-button').text('').text('Add Question');
2399
- });
2400
  $('.import-button').addClass('disable_import');
2401
- $('#question-bank').find('[name="qsm-question-checkbox[]"]').attr('checked', false);
2402
- MicroModal.close('modal-2');
2403
- }
2404
- });
2405
- //Delete question from question bank
2406
- $('.qsm-popup-bank').on('click', '#qsm-delete-selected-question', function (event) {
2407
- if (confirm('are you sure?')) {
2408
  var $total_selction = $('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').length;
2409
  if ($total_selction === 0) {
2410
- alert('No question is selected.');
2411
  } else {
2412
  $.fn.reverse = [].reverse;
2413
- var question_ids = $($('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').parents('.question-bank-question').reverse()).map(function () {
2414
- return $(this).data('question-id');
2415
- }).get().join(',');
2416
- if (question_ids) {
2417
- $.ajax({
2418
- url: ajaxurl,
2419
- method: 'POST',
2420
- data: {
2421
- 'action': 'qsm_delete_question_question_bank',
2422
- 'question_ids': question_ids,
2423
- 'nonce': qsmQuestionSettings.question_bank_nonce
2424
- },
2425
- success: function (response) {
2426
- var data = jQuery.parseJSON(response);
2427
- if (data.success === true) {
2428
- $('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').parents('.question-bank-question').slideUp('slow');
2429
- alert(data.message);
2430
- } else {
2431
- alert(data.message);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2432
  }
2433
- }
2434
- });
2435
  }
2436
  }
2437
- }
2438
- });
2439
-
2440
- //Select all button.
2441
- $(document).on('change', '.qsm-question-checkbox', function (event) {
2442
- event.preventDefault();
2443
- if ($('.qsm-question-checkbox:checked').length > 0) {
2444
- $('.qsm-question-bank-footer').addClass('opened');
2445
- } else {
2446
- $('.qsm-question-bank-footer').removeClass('opened');
2447
- }
2448
- });
2449
- $(document).on('change', '#qsm_select_all_question', function (event) {
2450
- event.preventDefault();
2451
- $('.qsm-question-checkbox').prop('checked', jQuery('#qsm_select_all_question').prop('checked'));
2452
- if ($('.qsm-question-checkbox:checked').length > 0) {
2453
- $('.qsm-question-bank-footer').addClass('opened');
2454
- } else {
2455
- $('.qsm-question-bank-footer').removeClass('opened');
2456
- }
2457
- });
2458
-
2459
- $('.save-page-button').on('click', function (event) {
2460
- event.preventDefault();
2461
- $('#save-edit-quiz-pages').addClass('is-active');
2462
- QSMQuestion.savePages();
2463
- });
2464
- $('#save-page-popup-button').on('click', function (event) {
2465
- event.preventDefault();
2466
- var pageID = $(this).parent().siblings('main').children('#edit_page_id').val();
2467
- var pageKey = jQuery('#pagekey').val();
2468
- if (pageKey.replace(/^\s+|\s+$/g, "").length == 0) {
2469
- alert('Page Name is required!');
2470
- return false;
2471
- } else if (null == pageKey.match(/^[A-Za-z0-9\-\s]+$/)) {
2472
- alert('Please use only Alphanumeric characters.');
2473
- return false;
2474
- } else {
2475
- QSMQuestion.updateQPage(pageID);
2476
- QSMQuestion.savePages();
2477
- MicroModal.close('modal-page-1');
2478
- }
2479
- });
2480
-
2481
- $(document).on('change', '#change-answer-editor', function (event) {
2482
- var newVal = $(this).val();
2483
- if (confirm('All answer will be reset, Do you want to still continue?')) {
2484
- $('#answers').find('.answers-single').remove();
2485
- } else {
2486
- if (newVal == 'rich') {
2487
- $(this).val('text');
2488
- } else {
2489
- $(this).val('rich');
2490
- }
2491
- return false;
2492
- }
2493
- });
2494
 
2495
- // Adds event handlers for searching questions
2496
- $('#question_search').on('keyup', function () {
2497
- $('.question').each(function () {
2498
- if ($(this).text().toLowerCase().indexOf($('#question_search').val().toLowerCase()) === -1) {
2499
- $(this).hide();
2500
  } else {
2501
- $(this).show();
2502
- $(this).parent('.page').show();
2503
-
2504
  }
2505
  });
2506
- $('.page').each(function () {
2507
- if (0 === $(this).children('.question:visible').length) {
2508
- $(this).hide();
 
 
2509
  } else {
2510
- $(this).show();
2511
  }
2512
  });
2513
- if (0 === $('#question_search').val().length) {
2514
- $('.page').show();
2515
- $('.question').show();
2516
- }
2517
- });
2518
-
2519
- qsm_init_sortable();
2520
 
2521
- if (qsmQuestionSettings.qsm_user_ve === 'true') {
2522
- QSMQuestion.prepareEditor();
2523
- }
2524
- QSMQuestion.loadQuestions();
2525
-
2526
- /**
2527
- * Hide/show advanced option
2528
- */
2529
- $(document).on('click', '#show-advanced-option', function () {
2530
- var $this = $(this);
2531
- $(this).next('div.advanced-content').slideToggle('slow', function () {
2532
- if ($(this).is(':visible')) {
2533
- $this.text('').html('Hide advance options &laquo;');
 
 
2534
  } else {
2535
- $this.text('').html('Show advance options &raquo;');
 
 
2536
  }
2537
  });
2538
- });
2539
 
2540
- //Hide the question settings based on question type
2541
- var previous_question_val;
2542
- $(document).on('focus', '#question_type', function () {
2543
- previous_question_val = this.value;
2544
- })
2545
- $(document).on('change', '#question_type', function() {
2546
- var question_val = $('#question_type').val();
2547
- QSMQuestion.question_type_change(previous_question_val, question_val);
2548
- if (6 == question_val) {
2549
- var question_description = wp.editor.getContent('question-text');
2550
- if (question_description == 'Add description here!') {
2551
- tinyMCE.get('question-text').setContent('');
 
 
 
2552
  }
2553
- }
2554
- if (14 == question_val) {
2555
- $('.correct-answer').hide();
2556
- }
2557
- else{
2558
- $('.correct-answer').show();
2559
- }
2560
-
2561
- // show points field only for polar in survey and simple form
2562
- if (qsmQuestionSettings.form_type != 0) {
2563
  if (13 == question_val) {
2564
- $('.answer-points').show();
2565
- } else {
2566
- $('.answer-points').val('').hide();
2567
  }
2568
- }
2569
 
 
 
 
 
 
 
 
 
2570
 
2571
- $('.qsm_hide_for_other').hide();
2572
- if ($('.qsm_show_question_type_' + question_val).length > 0) {
2573
- $('.qsm_show_question_type_' + question_val).show();
2574
- }
2575
- qsm_hide_show_question_desc(question_val);
2576
- });
 
 
 
 
 
 
 
 
2577
 
2578
- //Add new category
2579
- $(document).on('click', '#qsm-category-add-toggle', function () {
2580
- if ($('#qsm-category-add').is(":visible")) {
2581
- $('.questionElements #new_category_new').attr('checked', false);
2582
- $('#qsm-category-add').slideUp('slow');
2583
- } else {
2584
- $('.questionElements #new_category_new').attr('checked', true).prop('checked', 'checked');
2585
- $('#qsm-category-add').slideDown('slow');
2586
  }
2587
- });
2588
 
2589
- //Hide/show quesion description
2590
- $(document).on('click', '.qsm-show-question-desc-box', function (e) {
2591
- e.preventDefault();
2592
- $(this).hide();
2593
- var question_description = wp.editor.getContent('question-text');
2594
- if (question_description == '' || question_description == null) {
2595
- var questionElements = $(this).parents('.questionElements');
2596
- if (6 == questionElements.find('#question_type').val()) {
2597
- tinyMCE.get('question-text').setContent('');
2598
- } else {
2599
- tinyMCE.get('question-text').setContent('Add description here!');
2600
- }
2601
- }
2602
- $(this).next('.qsm-row').show();
2603
- });
2604
- $(document).on('click', '.qsm-hide-question-desc-box', function (e) {
2605
- e.preventDefault();
2606
- $(this).parents('.qsm-row.qsm-editor-wrap').hide();
2607
- $('.qsm-show-question-desc-box').show();
2608
- });
2609
 
2610
- //Open file upload on feature image
2611
- $('body').on('click', '.qsm-feature-image-upl', function (e) {
2612
- e.preventDefault();
2613
- var button = $(this),
2614
- custom_uploader = wp.media({
2615
- title: 'Insert image',
2616
- library: {
2617
- // uploadedTo : wp.media.view.settings.post.id, // attach to the current post?
2618
- type: 'image'
2619
- },
2620
- button: {
2621
- text: 'Use this image' // button label text
2622
- },
2623
- multiple: false
2624
- }).on('select', function () { // it also has "open" and "close" events
2625
- var attachment = custom_uploader.state().get('selection').first().toJSON();
2626
- button.html('<img src="' + attachment.url + '" style="width:150px">');
2627
- button.next('.qsm-feature-image-rmv').show();
2628
- button.next().next('.qsm-feature-image-id').val(attachment.id);
2629
- button.next().next().next('.qsm-feature-image-src').val(attachment.url);
2630
- }).open();
2631
- });
2632
 
2633
- // on remove button click
2634
- $('body').on('click', '.qsm-feature-image-rmv', function (e) {
2635
- e.preventDefault();
2636
- var button = $(this);
2637
- button.next().val(''); // emptying the hidden field
2638
- button.next().next().val(''); // emptying the hidden field
2639
- button.hide().prev().html('Upload image');
2640
- });
2641
 
2642
- });
2643
- var decodeEntities = (function () {
2644
- //create a new html document (doesn't execute script tags in child elements)
2645
- var doc = document.implementation.createHTMLDocument("");
2646
- var element = doc.createElement('div');
 
 
 
 
2647
 
2648
- function getText(str) {
2649
- element.innerHTML = str;
2650
- str = element.textContent;
2651
- element.textContent = '';
2652
- return str;
2653
- }
 
 
 
 
2654
 
2655
- function decodeHTMLEntities(str) {
2656
- if (str && typeof str === 'string') {
2657
- var x = getText(str);
2658
- while (str !== x) {
2659
- str = x;
2660
- x = getText(x);
 
 
 
 
2661
  }
2662
- return x;
2663
- }
2664
- }
2665
- return decodeHTMLEntities;
2666
- })();
 
 
2667
 
2668
- function qsm_hide_show_question_desc(question_type) {
2669
- $('.question-type-description').hide();
2670
- if ($('#question_type_' + question_type + '_description').length > 0) {
2671
- $('#question_type_' + question_type + '_description').show();
2672
- }
2673
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2674
 
2675
- function qsm_init_sortable() {
2676
- $('.questions').sortable({
2677
- opacity: 70,
2678
- cursor: 'move',
2679
- handle: 'span.dashicons-move',
2680
- placeholder: "ui-state-highlight",
2681
- stop: function (evt, ui) {
2682
- $('.questions > .page').each(function () {
2683
- var page = parseInt($(this).index()) + 1;
2684
- $(this).find('.page-number').text('Page ' + page);
2685
- });
2686
- setTimeout(
2687
- function () {
2688
- $('.save-page-button').trigger('click');
2689
- },
2690
- 200
2691
- )
2692
- }
2693
  });
2694
- $('.page').sortable({
2695
- items: '.question',
2696
- handle: 'span.dashicons-move',
2697
- opacity: 70,
2698
- cursor: 'move',
2699
- placeholder: "ui-state-highlight",
2700
- connectWith: '.page',
2701
- stop: function (evt, ui) {
2702
- setTimeout(
2703
- function () {
2704
- $('.save-page-button').trigger('click');
2705
- },
2706
- 200
2707
- )
 
 
 
 
 
 
 
2708
  }
2709
- });
2710
- }
2711
 
2712
- function qsmRandomID(length) {
2713
- var result = '';
2714
- var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
2715
- var charactersLength = characters.length;
2716
- for (var i = 0; i < length; i++) {
2717
- result += characters.charAt(Math.floor(Math.random() * charactersLength));
2718
  }
2719
- return result;
2720
- }
2721
- $(document).on('keyup', '.qsm-category-filter', function () {
2722
- search_term = $.trim($(this).val());
2723
- if (search_term == '') {
2724
- $('.qsm_category_checklist li').each(function () {
2725
- $(this).show()
 
 
 
 
 
 
 
 
 
 
 
 
2726
  });
2727
- } else {
2728
- search_term = new RegExp(search_term, 'i');
2729
- $('.qsm_category_checklist li').each(function () {
2730
- search_string = $(this).children('label').text();
2731
- result = search_string.search(search_term);
2732
- if (result > -1) {
2733
- $(this).show();
2734
- if ($(this).parent('ul').hasClass('children')) {
2735
- $(this).parents('li').show();
2736
- }
2737
- } else {
2738
- $(this).hide();
 
 
2739
  }
2740
  });
 
2741
 
 
 
 
 
 
 
 
 
2742
  }
2743
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2744
 
2745
- $(document).on('click', '.add-multiple-category', function (e) {
2746
- e.preventDefault();
2747
- MicroModal.show('modal-9', {
2748
- onShow: function () {
2749
- $('#new-category-name').val($('.qsm-category-filter').val());
2750
- $('.qsm-category-filter').val('').trigger('keyup');
2751
- },
2752
- onClose: function () {
2753
- $('#modal-9-content .info').html('');
2754
- $('#new-category-name').val('');
2755
- $('#qsm-parent-category').val(-1);
2756
  }
2757
  });
2758
- });
2759
 
2760
- $(document).on('click', '#save-multi-category-button', function (e) {
2761
- e.preventDefault();
2762
- duplicate = false;
2763
- new_category = $('#new-category-name').val().trim();
2764
- parent_category = $('#qsm-parent-category option:selected').val();
2765
- if (new_category == '') {
2766
- $('#modal-9-content .info').html('Category cannot be empty');
2767
- return false;
2768
- } else {
2769
- $('#qsm-parent-category option').each(function () {
2770
- if ($(this).text().toLowerCase() == new_category.toLowerCase()) {
2771
- duplicate = true;
2772
- $('#modal-9-content .info').html('Category ' + new_category + ' already exists in database');
2773
- return false;
2774
  }
2775
  });
 
2776
 
2777
- if (!duplicate) {
2778
- var new_category_data = {
2779
- action: 'save_new_category',
2780
- name: new_category,
2781
- parent: parent_category
2782
- };
2783
- $('#modal-9-content .info').html('');
2784
- jQuery.ajax(ajaxurl, {
2785
- data: new_category_data,
2786
- method: 'POST',
2787
- success: function (response) {
2788
- result = JSON.parse(response);
2789
- if (result.term_id > 0) {
2790
- $('#qsm-parent-category').append('<option class="level-0" value="' + result.term_id + '">' + new_category + '</option>');
2791
- if (parent_category == -1) {
2792
- $('.qsm_category_checklist').prepend('<li id="qsm_category-' + result.term_id + '"><label class="selectit"><input value="' + result.term_id + '" type="checkbox" checked="checked" name="tax_input[qsm_category][]" id="in-qsm_category-' + result.term_id + '"> ' + new_category + '</label></li>');
2793
- } else {
2794
- if ($('.qsm_category_checklist li#qsm_category-' + parent_category).children('ul').length > 0) {
2795
- $('.qsm_category_checklist li#qsm_category-' + parent_category).children('ul').append('<li id="qsm_category-' + result.term_id + '"><label class="selectit"><input value="' + result.term_id + '" type="checkbox" name="tax_input[qsm_category][]" id="in-qsm_category-' + result.term_id + '"> ' + new_category + '</label></li>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2796
  } else {
2797
- $('.qsm_category_checklist li#qsm_category-' + parent_category).append('<ul class="children"><li id="qsm_category-' + result.term_id + '"><label class="selectit"><input value="' + result.term_id + '" type="checkbox" name="tax_input[qsm_category][]" id="in-qsm_category-' + result.term_id + '"> ' + new_category + '</label></li></ul>')
 
 
 
 
 
 
 
 
2798
  }
2799
- $('.qsm_category_checklist li#qsm_category-' + result.term_id).children('label').children('input').prop('checked', true);
2800
- $('.qsm_category_checklist li#qsm_category-' + result.term_id).parents('li').each(function () {
2801
- $(this).children('label').children('input').prop('checked', true);
2802
- });
2803
  }
2804
- MicroModal.close('modal-9')
2805
  }
2806
- }
2807
- });
2808
  }
2809
- }
2810
- });
2811
  }
2812
- }
2813
  }(jQuery));
2814
 
2815
 
@@ -2818,32 +2936,32 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
2818
  */
2819
 
2820
  (function ($) {
2821
- if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
2822
- if (window.location.href.indexOf('tab=results-pages')> 0 ){
2823
  var QSMAdminResults;
2824
  QSMAdminResults = {
2825
  total: 0,
2826
- saveResults: function() {
2827
- QSMAdmin.displayAlert( 'Saving results pages...', 'info' );
2828
  var pages = [];
2829
  var page = {};
2830
  var redirect_value = '';
2831
- $( '.results-page' ).each( function() {
2832
  page = {
2833
  'conditions': [],
2834
- 'page': wp.editor.getContent( $( this ).find( '.results-page-template' ).attr( 'id' ) ),
2835
  'redirect': false,
2836
  };
2837
- redirect_value = $( this ).find( '.results-page-redirect' ).val();
2838
- if ( '' != redirect_value ) {
2839
  page.redirect = redirect_value;
2840
  }
2841
- $( this ).find( '.results-page-condition' ).each( function() {
2842
  page.conditions.push({
2843
  'category': $(this).children('.results-page-condition-category').val(),
2844
- 'criteria': $( this ).children( '.results-page-condition-criteria' ).val(),
2845
- 'operator': $( this ).children( '.results-page-condition-operator' ).val(),
2846
- 'value': $( this ).children( '.results-page-condition-value' ).val()
2847
  });
2848
  });
2849
  pages.push(page);
@@ -2858,67 +2976,67 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
2858
  data: data,
2859
  headers: { 'X-WP-Nonce': qsmResultsObject.nonce },
2860
  })
2861
- .done(function( results ) {
2862
- if ( results.status ) {
2863
- QSMAdmin.displayAlert( 'Results pages were saved!', 'success' );
2864
- } else {
2865
- QSMAdmin.displayAlert( 'There was an error when saving the results pages. Please try again.', 'error' );
2866
- }
2867
- })
2868
- .fail(QSMAdmin.displayjQueryError);
2869
  },
2870
- loadResults: function() {
2871
  //QSMAdmin.displayAlert( 'Loading results pages...', 'info' );
2872
  $.ajax({
2873
  url: wpApiSettings.root + 'quiz-survey-master/v1/quizzes/' + qsmResultsObject.quizID + '/results',
2874
  headers: { 'X-WP-Nonce': qsmResultsObject.nonce },
2875
  })
2876
- .done(function( pages ) {
2877
- $( '#results-pages' ).find( '.qsm-spinner-loader' ).remove();
2878
- pages.forEach( function( page, i, pages ) {
2879
- QSMAdminResults.addResultsPage( page.conditions, page.page, page.redirect );
2880
  });
2881
  QSMAdmin.clearAlerts();
2882
  })
2883
  .fail(QSMAdmin.displayjQueryError);
2884
  },
2885
  addCondition: function ($page, category, criteria, operator, value) {
2886
- var template = wp.template( 'results-page-condition' );
2887
  $page.find('.results-page-when-conditions').append(template({
2888
- 'category': category,
2889
- 'criteria': criteria,
2890
- 'operator': operator,
2891
- 'value': value
2892
  }));
2893
  },
2894
- newCondition: function( $page ) {
2895
  QSMAdminResults.addCondition($page, '', 'score', 'equal', 0);
2896
  },
2897
  addResultsPage: function (conditions, page, redirect) {
2898
  QSMAdminResults.total += 1;
2899
- var template = wp.template( 'results-page' );
2900
- $( '#results-pages' ).append( template( { id: QSMAdminResults.total, page: page, redirect: redirect } ) );
2901
- conditions.forEach( function( condition, i, conditions) {
2902
  QSMAdminResults.addCondition(
2903
  $('.results-page:last-child'),
2904
- condition.category,
2905
- condition.criteria,
2906
- condition.operator,
2907
- condition.value
2908
  );
2909
  });
2910
  var settings = {
2911
  mediaButtons: true,
2912
- tinymce: {
2913
- forced_root_block : '',
2914
  toolbar1: 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,charmap,undo,redo'
2915
  },
2916
- quicktags: true,
2917
  };
2918
- wp.editor.initialize( 'results-page-' + QSMAdminResults.total, settings );
2919
  jQuery(document).trigger('qsm_after_add_result_block', [conditions, page, redirect]);
2920
  },
2921
- newResultsPage: function() {
2922
  var conditions = [{
2923
  'category': '',
2924
  'criteria': 'score',
@@ -2926,32 +3044,32 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')){
2926
  'value': '0'
2927
  }];
2928
  var page = '%QUESTIONS_ANSWERS%';
2929
- QSMAdminResults.addResultsPage( conditions, page );
2930
  }
2931
  };
2932
- $(function() {
2933
  QSMAdminResults.loadResults();
2934
 
2935
- $( '.add-new-page' ).on( 'click', function( event ) {
2936
  event.preventDefault();
2937
  QSMAdminResults.newResultsPage();
2938
  });
2939
- $( '.save-pages' ).on( 'click', function( event ) {
2940
  event.preventDefault();
2941
  QSMAdminResults.saveResults();
2942
  });
2943
- $( '#results-pages' ).on( 'click', '.new-condition', function( event ) {
2944
  event.preventDefault();
2945
- $page = $( this ).closest( '.results-page' );
2946
- QSMAdminResults.newCondition( $page );
2947
  });
2948
- $( '#results-pages' ).on( 'click', '.delete-page-button', function( event ) {
2949
  event.preventDefault();
2950
- $( this ).closest( '.results-page' ).remove();
2951
  });
2952
- $( '#results-pages' ).on( 'click', '.delete-condition-button', function( event ) {
2953
  event.preventDefault();
2954
- $( this ).closest( '.results-page-condition' ).remove();
2955
  });
2956
  });
2957
  }
10
  * Catches an error from a jQuery function (i.e. $.ajax())
11
  */
12
  displayjQueryError: function (jqXHR, textStatus, errorThrown) {
13
+ QSMAdmin.displayAlert(qsm_admin_messages.error + ': ' + errorThrown + '! ' + qsm_admin_messages.try_again + '.', 'error');
14
  },
15
  /**
16
  * Catches an error from a BackBone function (i.e. model.save())
17
  */
18
  displayError: function (jqXHR, textStatus, errorThrown) {
19
+ QSMAdmin.displayAlert(qsm_admin_messages.error + ': ' + errorThrown.errorThrown + '! ' + qsm_admin_messages.try_again + '.', 'error');
20
  },
21
  /**
22
  * Displays an alert within the "Quiz Settings" page
45
  }
46
  };
47
  $(function () {
48
+ $('.qsm-tab').on('click', function (event) {
49
+ event.preventDefault();
50
+ QSMAdmin.selectTab($(this));
51
+ });
 
 
 
 
 
52
 
53
+ //show set global default potion popup
54
+ $(document).on('click', '#qsm-blobal-settings', function () {
55
+ MicroModal.show('qsm-global-default-popup');
56
+ });
57
 
58
+ $('#qmn_check_all').change(function () {
59
+ $('.qmn_delete_checkbox').prop('checked', jQuery('#qmn_check_all').prop('checked'));
60
+ });
 
 
 
 
 
 
61
 
62
+ $('.edit-quiz-name').click(function (e) {
63
+ e.preventDefault();
64
+ MicroModal.show('modal-3');
65
+ });
66
+ $('#edit-name-button').on('click', function (event) {
67
+ event.preventDefault();
68
+ $('#edit-name-form').submit();
69
+ });
70
+ $('#sendySignupForm').submit(function (e) {
71
+ e.preventDefault();
72
+ var $form = $(this),
73
+ name = $form.find('input[name="name"]').val(),
74
+ email = $form.find('input[name="email"]').val(),
75
+ action = 'qsm_send_data_sendy';
76
+ $form.find('#submit').attr('disabled', true);
77
+ $.post(ajaxurl, { name: name, email: email, nonce: qsmAdminObject.saveNonce, action: action },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  function (data) {
79
+ if (data) {
80
+ $("#status").text('');
81
+ if (data == "Some fields are missing.") {
82
+ $("#status").text(qsm_admin_messages.sendy_signup_validation.required_message);
83
+ $("#status").css("color", "red");
84
+ } else if (data == "Invalid email address.") {
85
+ $("#status").text(qsm_admin_messages.sendy_signup_validation.email_validation);
86
+ $("#status").css("color", "red");
87
+ } else if (data == "Invalid list ID.") {
88
+ $("#status").text(qsm_admin_messages.sendy_signup_validation.list_validation);
89
+ $("#status").css("color", "red");
90
+ } else if (data == "Already subscribed.") {
91
+ $("#status").text(qsm_admin_messages.sendy_signup_validation.already_subscribed);
92
+ $("#status").css("color", "red");
93
+ } else {
94
+ $("#status").text(qsm_admin_messages.sendy_signup_validation.success_message);
95
+ $("#status").css("color", "green");
96
+ }
97
+ $form.find('#submit').attr('disabled', false);
98
  } else {
99
+ alert(qsm_admin_messages.sendy_signup_validation.error_message);
 
100
  }
101
  }
102
  );
103
+ });
104
+ jQuery('.category_selection_random').change(function () {
105
+ var checked_data = jQuery(this).val().toString();
106
+ jQuery('.catergory_comma_values').val(checked_data);
107
+ });
108
+ jQuery('.row-actions-c > .rtq-delete-result').click(function (e) {
109
+ e.preventDefault();
110
+ var $this = jQuery(this);
111
+ if (confirm(qsm_admin_messages.confirm_message)) {
112
+ var action = 'qsm_dashboard_delete_result';
113
+ var result_id = jQuery(this).data('result_id');
114
+ $.post(ajaxurl, { result_id: result_id, action: action },
115
+ function (data) {
116
+ if (data == 'failed') {
117
+ alert(qsm_admin_messages.error_delete_result);
118
+ } else {
119
+ $this.parents('li').slideUp();
120
+ $this.parents('li').remove();
121
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  }
123
+ );
124
+ }
125
+ });
126
+ jQuery('.load-quiz-wizard').click(function (e) {
127
+ e.preventDefault();
128
+ MicroModal.show('model-wizard');
129
+ var height = jQuery(".qsm-wizard-template-section").css("height");
130
+ jQuery(".qsm-wizard-setting-section").css("height", height);
131
+ if (jQuery("#accordion").length > 0) {
132
+ var icons = {
133
+ header: "iconClosed", // custom icon class
134
+ activeHeader: "iconOpen" // custom icon class
135
+ };
136
+ jQuery("#accordion").accordion({
137
+ collapsible: true,
138
+ icons: icons,
139
+ heightStyle: "content"
140
  });
141
+ jQuery('#accordion h3.ui-accordion-header').next().slideDown();
142
+ jQuery('.template-list .template-list-inner:first-child').trigger('click');
143
  }
144
+ });
145
+ //Get quiz options
146
+ jQuery('.template-list-inner').click(function () {
147
+ var action = 'qsm_wizard_template_quiz_options';
148
+ var settings = jQuery(this).data('settings');
149
+ var addons = jQuery(this).data('addons');
150
+ jQuery('.template-list .template-list-inner').removeClass('selected-quiz-template');
151
+ jQuery(this).addClass('selected-quiz-template');
152
+ jQuery('#quiz_settings_wrapper').html('').html('<div class="qsm-spinner-loader"></div>');
153
+ jQuery('#recomm_addons_wrapper').html('').html('<div class="qsm-spinner-loader"></div>');
154
+ $.post(ajaxurl, { settings: settings, addons: addons, action: action },
155
+ function (data) {
156
+ var diff_html = data.split('=====');
157
+ jQuery('#quiz_settings_wrapper').html('');
158
+ jQuery('#quiz_settings_wrapper').html(diff_html[0]);
159
+ jQuery('#recomm_addons_wrapper').html('');
160
+ jQuery('#recomm_addons_wrapper').html(diff_html[1]);
161
+ jQuery("#accordion").accordion();
162
+ jQuery('#accordion h3.ui-accordion-header').next().slideDown();
163
+ $('#quiz_settings_wrapper select').each(function () {
164
+ var name = $(this).attr('name');
165
+ var value = $(this).val();
166
+ if ($('.' + name + '_' + value).length > 0) {
167
+ $('.' + name + '_' + value).show();
168
+ }
169
+ });
170
+ }
171
+ );
172
+ });
173
 
174
+ //Dismiss the welcome panel
175
+ jQuery('.qsm-welcome-panel-dismiss').click(function (e) {
176
+ e.preventDefault();
177
+ jQuery('#welcome_panel').addClass('hidden');
178
+ jQuery('#screen-options-wrap').find('#welcome_panel-hide').prop('checked', false);
179
+ postboxes.save_state('toplevel_page_qsm_dashboard');
180
+ });
181
+ //Get the message in text tab
182
+ jQuery(document).on('change', '#qsm_question_text_message_id', function () {
183
+ var text_id = jQuery(this).val();
184
+ jQuery('.qsm-text-main-wrap .qsm-text-tab-message-loader').show();
185
+ jQuery.post(ajaxurl, { text_id: text_id, 'quiz_id': qsmTextTabObject.quiz_id, action: 'qsm_get_question_text_message' }, function (response) {
186
+ var data = jQuery.parseJSON(response);
187
+ if (data.success === true) {
188
+ var text_msg = data.text_message;
189
+ if ($('#wp-qsm_question_text_message-wrap').hasClass('html-active')) {
190
+ jQuery("#qsm_question_text_message").val(text_msg);
191
+ } else {
192
+ text_msg = text_msg.replace(/\n/g, "<br>");
193
+ tinyMCE.get('qsm_question_text_message').setContent(text_msg);
194
+ }
195
+ jQuery('.qsm-text-allowed-variables > .qsm-text-variable-wrap').html('').html(data.allowed_variable_text);
196
+ jQuery('.qsm-text-main-wrap .qsm-text-tab-message-loader').hide();
197
+ } else {
198
+ console.log(data.message);
199
+ }
200
+ });
201
+ });
202
+ //Save the message in text tab
203
+ jQuery(document).on('click', '#qsm_save_text_message', function () {
204
+ var $this = jQuery(this);
205
+ $this.siblings('.spinner').addClass('is-active');
206
+ var text_id = jQuery('#qsm_question_text_message_id').val();
207
+ var message = wp.editor.getContent('qsm_question_text_message');
208
+ jQuery.post(ajaxurl, { text_id: text_id, 'message': message, 'quiz_id': qsmTextTabObject.quiz_id, action: 'qsm_update_text_message' }, function (response) {
209
+ var data = jQuery.parseJSON(response);
210
+ if (data.success === true) {
211
+ //Do nothing
212
  } else {
213
+ console.log(data.message);
 
214
  }
215
+ $this.siblings('.spinner').removeClass('is-active');
216
+ });
217
+ });
218
+ //On click append on tiny mce
219
+ jQuery(document).on('click', '.qsm-text-allowed-variables button.button', function () {
220
+ var content = jQuery(this).text();
221
+ if (jQuery('.qsm-question-text-tab .html-active').length > 0) {
222
+ var $txt = jQuery("#qsm_question_text_message");
223
+ var caretPos = $txt[0].selectionStart;
224
+ var textAreaTxt = $txt.val();
225
+ var txtToAdd = content;
226
+ $txt.val(textAreaTxt.substring(0, caretPos) + txtToAdd + textAreaTxt.substring(caretPos));
227
  } else {
228
+ tinyMCE.activeEditor.execCommand('mceInsertContent', false, content);
229
  }
230
  });
231
+ //Show all the variable list
232
+ jQuery('.qsm-show-all-variable-text').click(function (e) {
233
+ e.preventDefault();
234
+ MicroModal.show('show-all-variable');
235
+ });
236
+ //Hide/show tr based on selection
237
+ $('.qsm_tab_content select').each(function () {
238
+ var name = $(this).attr('name');
239
+ var value = $(this).val();
240
+ if ($('.' + name + '_' + value).length > 0) {
241
+ $('.' + name + '_' + value).show();
 
 
242
  }
 
243
  });
244
+ $(document).on('change', '.qsm_tab_content select, #quiz_settings_wrapper select', function () {
245
+ var name = $(this).attr('name');
246
+ var value = $(this).val();
247
+ $('.qsm_hidden_tr').hide();
248
+ if ($('.' + name + '_' + value).length > 0) {
249
+ $('.' + name + '_' + value).show();
250
+ }
251
+ });
252
+ $(document).on('click', '.qsm_tab_content input[name="system"]', function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  var name = $(this).attr('name');
254
+ var value = $(this).val();
255
+ $('.qsm_hidden_tr_gradingsystem').hide();
256
+ if (value == 0 || value == 3) {
257
+ $('.qsm_hidden_tr_gradingsystem').show();
258
+ }
259
+ });
260
+ $(document).ready(function () {
261
+ var system_option = $("input[type=radio][name='system']:checked").val();
262
+ $('.qsm_hidden_tr_gradingsystem').hide();
263
+ if (system_option == 0 || system_option == 3) {
264
+ $('.qsm_hidden_tr_gradingsystem').show();
265
+ }
266
+ });
267
+ if ($('.qsm-text-label-wrapper').length > 0) {
268
+ var element_position = $('.qsm-text-label-wrapper').offset().top;
269
+ $(window).scroll(function () {
270
+ var y_scroll_pos = window.pageYOffset;
271
+ var scroll_pos_test = element_position;
272
+ if (y_scroll_pos > scroll_pos_test) {
273
+ $('.qsm_text_customize_label').fadeOut('slow');
274
+ } else {
275
+ $('.qsm_text_customize_label').fadeIn('slow');
276
+ }
277
+ });
278
  }
279
+ $(document).on('click', '.qsm_text_customize_label', function () {
280
+ $('html, body').animate({
281
+ scrollTop: $(".qsm-text-label-wrapper").offset().top - 30
282
+ }, 2000);
283
+ });
284
+ //New template design hide show
285
+ var new_template_result_detail = $('.new_template_result_detail:checked').val();
286
+ if (new_template_result_detail == 1) {
287
+ $('.new_template_result_detail:checked').parents('tr').next('tr').hide();
288
  }
289
+ $(document).on('change', '.new_template_result_detail', function () {
290
+ if ($(this).val() == 1) {
291
+ $(this).parents('tr').next('tr').hide();
 
 
 
 
 
292
  } else {
293
+ $(this).parents('tr').next('tr').show();
294
  }
295
  });
296
+ $(document).on('click', '#show-all-variable .qsm-text-template-span ', function (e) {
297
+ e.preventDefault();
298
+ let templateSpan = jQuery(this);
299
+ let templateVariable = jQuery(this).children('.template-variable');
300
+ var $temp = $("<input>");
301
+ $("body").append($temp);
302
+ $temp.val(templateVariable.text()).select();
303
+ document.execCommand("copy");
304
+ $temp.remove();
305
+ var button_width = templateSpan.width();
306
+ var button_txt = templateSpan.html()
307
+ templateSpan.css('width', button_width);
308
+ templateSpan.text('').html('<span class="popup-copied-des"><span class="dashicons dashicons-yes"></span> ' + qsm_admin_messages.copied + '</span>');
309
+ setTimeout(function () {
310
+ templateSpan.css('width', 'auto');
311
+ templateSpan.html(button_txt);
312
+ }, 1000);
313
+ });
314
+ $(document).on('click', ' .qsm-active-addons .no_addons_installed a', function (e) {
315
+ $('.qsm-addon-anchor-left .qsm-install-addon a').trigger('click');
316
+ });
317
+ $(document).on('click', '.qsm-addon-anchor-left .qsm-install-addon a', function (e) {
318
+ e.preventDefault();
319
+ var href = $(this).attr('href');
320
+ $('.qsm-addon-anchor-left .qsm-install-addon').find('a').removeClass('active');
321
+ $(this).addClass('active');
322
+ $('.qsm-addon-setting-wrap .qsm-primary-acnhor').hide();
323
+ $(href).show();
324
+ if (href == '#qsm_add_addons') {
325
+ $('.qsm-add-addon').css('display', 'inline-block');
326
+ } else {
327
+ $('.qsm-add-addon').css('display', 'none');
328
+ }
329
+ });
330
+ $(document).on('click', '.qsm-addon-anchor-left .qsm-add-addon a', function (e) {
331
+ e.preventDefault();
332
+ var href = $(this).attr('href');
333
+ $('.qsm-addon-anchor-left .qsm-add-addon').find('a').removeClass('active');
334
+ $(this).addClass('active');
335
+ $('.qsm-addon-setting-wrap .qsm_popular_addons').hide();
336
+ $(href).show();
337
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
 
339
+ // opens media library o set featured image for quiz
340
+ $(document).on('click', '#set_featured_image', function (e) {
341
+ var button = $(this);
342
+ e.preventDefault();
343
  custom_uploader = wp.media({
344
+ title: qsm_admin_messages.set_feature_img,
345
+ library: {
346
+ type: 'image'
347
+ },
348
+ button: {
349
+ text: qsm_admin_messages.use_img // button label text
350
+ },
351
+ multiple: false
352
+ }).on('select', function () { // it also has "open" and "close" events
353
+ var attachment = custom_uploader.state().get('selection').first().toJSON();
354
+ button.prev().val(attachment.url);
355
+ button.nextAll('.qsm_featured_image_preview').attr('src', attachment.url);
356
+ }).open();
357
+ });
358
 
359
+ // opens media library o set background image for quiz
360
+ $(document).on('click', '.set_background_image', function (e) {
361
+ let button = $(this);
362
+ e.preventDefault();
363
+ custom_uploader = wp.media({
364
+ title: qsm_admin_messages.set_bg_img,
365
+ library: {
366
+ type: 'image'
367
+ },
368
+ button: {
369
+ text: qsm_admin_messages.use_img // button label text
370
+ },
371
+ multiple: false
372
+ }).on('select', function () { // it also has "open" and "close" events
373
+ let attachment = custom_uploader.state().get('selection').first().toJSON();
374
+ button.prev('.quiz_background_image').val(attachment.url);
375
+ }).open();
376
+ });
377
 
378
+ $(document).on('change', '.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]', function () {
379
+ var value = $(this).val();
380
+ if (value == '0') {
381
+ $('.global_setting_system').parents('tr').show();
382
+ $('.global_setting_score_roundoff').parents('tr').show();
383
+ } else {
384
+ $('.global_setting_system').parents('tr').hide();
385
+ $('.global_setting_score_roundoff').parents('tr').hide();
386
+
387
+ }
388
+ });
389
+ $(document).on('change', '.global_setting_system input[name="qsm-quiz-settings[system]"]', function () {
390
+ var value = $('input[name="qsm-quiz-settings[system]"]:checked').val();
391
+ var value1 = $('.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]').val();
392
+ if (value != '1' && value1 == '0') {
393
+ $('.global_setting_score_roundoff').parents('tr').show();
394
+ } else {
395
+ $('.global_setting_score_roundoff').parents('tr').hide();
396
+ }
397
+ });
398
+ $('.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]').trigger('change');
399
+ $('.global_setting_system input[name="qsm-quiz-settings[system]"]').trigger('change');
400
 
401
  });
402
  $(document).on('change', '.global_setting_system input[name="qsm-quiz-settings[system]"]', function () {
403
  var value = $('input[name="qsm-quiz-settings[system]"]:checked').val();
404
  var value1 = $('.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]').val();
405
+ if (value != '1' && value1 == '0') {
406
  $('.global_setting_score_roundoff').parents('tr').show();
407
+ } else {
408
  $('.global_setting_score_roundoff').parents('tr').hide();
409
  }
410
  });
418
  deleteResults(qid, qname);
419
  });
420
 
421
+ jQuery(document).on('click', '#btn_export', function (e) {
422
  e.preventDefault();
423
  jQuery.ajax({
424
  type: 'POST',
427
  action: "qsm_export_data",
428
  nonce: qsm_tools_page.nonce,
429
  },
430
+ success: function (response) {
431
  /*
432
  * Make CSV downloadable
433
  */
453
  downloadLink.click();
454
  document.body.removeChild(downloadLink);
455
  },
456
+ error: function (errorThrown) {
457
  alert(errorThrown);
458
  }
459
  });
460
  });
461
 
462
+ jQuery(document).on('click', '#btn_clear_logs', function (e) {
463
  e.preventDefault();
464
+ var delete_logs = confirm(qsm_tools_page.qsm_delete_audit_logs);
465
+ if (delete_logs) {
466
  // your deletion code
467
  jQuery.ajax({
468
  type: 'POST',
471
  action: "qsm_clear_audit_data",
472
  nonce: qsm_tools_page.nonce,
473
  },
474
+ success: function (response) {
475
  location.reload();
476
  },
477
+ error: function (errorThrown) {
478
  alert(errorThrown);
479
  }
480
  });
485
  e.preventDefault();
486
  MicroModal.show('qsm_fetch_audit_data');
487
  var qsm_get_setting_data = jQuery(this).attr('data-auditid');
488
+ jQuery('.qsm_setting__data').html('<p>' + JSON.stringify(JSON.parse(qsm_get_setting_data), null, 2) + '</p>');
489
+ });
490
+
491
+ jQuery(document).on('click', '.qsm-toggle-box-handle', function (e) {
492
+ e.preventDefault();
493
+ var parent = jQuery(this).parent('.qsm-toggle-box');
494
+ var content = parent.find('.qsm-toggle-box-content');
495
+ if (content.is(":visible")) {
496
+ content.hide();
497
+ parent.removeClass('opened');
498
+ } else {
499
+ content.show();
500
+ parent.addClass('opened');
501
+ }
502
+ });
503
+
504
+ jQuery(document).on('click', '.qsm-help-tab-handle', function (e) {
505
+ e.preventDefault();
506
+ jQuery('.qsm-help-tab-dropdown-list').toggleClass('opened');
507
  });
508
 
509
+ $(document).mouseup(function (e) {
510
+ var link = $(".qsm-help-tab-handle");
511
+ var container = $(".qsm-help-tab-dropdown-list");
512
+ if (!link.is(e.target) && !container.is(e.target) && container.has(e.target).length === 0) {
513
+ container.removeClass('opened');
514
+ }
515
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
 
517
  }(jQuery));
518
 
519
  // result page
520
+ jQuery('#results-screen-option-button').on('click', function (event) {
521
  event.preventDefault();
522
  MicroModal.show('modal-results-screen-option');
523
  });
524
+ jQuery('#save-results-screen-option-button').on('click', function (event) {
525
  event.preventDefault();
526
  MicroModal.close('modal-results-screen-option');
527
  jQuery('#results-screen-option-form').submit();
528
  });
529
  function deleteResults(id, quizName) {
530
+ jQuery("#delete_dialog").dialog({
531
+ autoOpen: false,
532
+ buttons: {
533
+ Cancel: function () {
534
+ $jQuery(this).dialog('close');
535
+ }
536
+ }
537
+ });
538
+ jQuery("#delete_dialog").dialog('open');
539
+ var idHidden = document.getElementById("result_id");
540
+ var idHiddenName = document.getElementById("delete_quiz_name");
541
+ idHidden.value = id;
542
+ idHiddenName.value = quizName;
543
  }
544
 
545
  //quiz options style tab
546
+ jQuery('.quiz_style_tab').click(function (e) {
547
  e.preventDefault();
548
  var current_id = jQuery(this).attr('data-id');
549
  jQuery('.quiz_style_tab').removeClass('current');
552
  jQuery('#' + current_id).show();
553
  });
554
 
555
+ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')) {
556
+ if (window.location.href.indexOf('tab=style') > 0) {
557
  function mlw_qmn_theme(theme) {
558
  document.getElementById('save_quiz_theme').value = theme;
559
  jQuery("div.mlw_qmn_themeBlockActive").toggleClass("mlw_qmn_themeBlockActive");
560
  jQuery("#mlw_qmn_theme_block_" + theme).toggleClass("mlw_qmn_themeBlockActive");
561
  }
562
 
563
+ jQuery(document).ready(function () {
564
+ jQuery(document).on('click', '.qsm-activate-theme', function () {
565
+ jQuery(this).parents('.theme-wrapper').find('input[name=quiz_theme_id]').prop("checked", true);
 
 
 
 
 
 
 
 
 
566
  });
567
+ jQuery(document).on('input', '.quiz_featured_image', function () {
568
+ jQuery('.qsm_featured_image_preview').attr('src', jQuery(this).val());
 
 
 
 
 
569
  });
570
+
571
+ jQuery(document).on('click', '.filter-links a', function () {
572
+ let current_id = jQuery(this).attr('data-id');
573
+ jQuery(this).parents('.filter-links').find('li a').each(function () {
574
+ jQuery(this).removeClass('current');
575
+ });
576
+ jQuery(this).addClass('current');
577
+ jQuery(this).parents('#qsm_themes').find('.themes-container').children('div').each(function () {
578
+ if (jQuery(this).hasClass(current_id)) {
579
+ jQuery(this).show();
580
+ } else {
581
+ jQuery(this).hide();
582
+ }
583
+ });
584
+ })
585
  });
586
 
587
  jQuery(document).ready(function () {
588
  jQuery(document).on('click', '.qsm-customize-color-settings', function (e) {
589
  e.preventDefault();
590
  MicroModal.show('qsm-theme-color-settings');
591
+ if (jQuery('.my-color-field').length > 0) {
592
  jQuery('.my-color-field').wpColorPicker();
593
  }
594
  });
600
  //QSM - Quizzes/Surveys Page
601
 
602
  (function ($) {
603
+ if (jQuery('body').hasClass('post-type-qsm_quiz')) {
604
 
605
  $('#new_quiz_button_two').on('click', function (event) {
606
  event.preventDefault();
639
  $('#quiz_settings_wrapper').html('').html('<div class="qsm-spinner-loader"></div>');
640
  $('#recomm_addons_wrapper').html('').html('<div class="qsm-spinner-loader"></div>');
641
  $.post(ajaxurl, {
642
+ settings: settings,
643
+ addons: addons,
644
+ action: action
645
+ },
646
  function (data) {
647
  var diff_html = data.split('=====');
648
  $('#quiz_settings_wrapper').html('');
676
 
677
  $(document).on('click', '#the-list .qsm-action-link-delete', function (event) {
678
  event.preventDefault();
679
+ var dataid = $(this).data('id');
680
+ var dataname = $(this).data('name');
681
+ $('#delete_quiz_id').val(dataid + 'QID');
682
+ $('#delete_quiz_name').val(dataname);
683
  MicroModal.show('modal-5');
684
  });
685
  $(document).on('click', '#the-list .qsm-action-link-duplicate', function (event) {
686
  event.preventDefault();
687
+ var dataid = $(this).data('id');
688
+ $('#duplicate_quiz_id').val(dataid + 'QID');
689
  MicroModal.show('modal-4');
690
  });
691
  $(document).on('click', '#the-list .qsm-action-link-reset', function (event) {
692
  event.preventDefault();
693
+ var dataid = $(this).data('id');
694
  $('#reset_quiz_id').val(dataid);
695
  MicroModal.show('modal-1');
696
  });
707
  $('#delete-quiz-form').submit();
708
  });
709
 
710
+ $(document).on('click', '.post-type-qsm_quiz #doaction, .post-type-qsm_quiz #doaction2', function (event) {
711
+ event.preventDefault();
712
+ if ($("#bulk-action-selector-top").val() == "delete_pr" || $("#bulk-action-selector-bottom").val() == "delete_pr") {
713
+ MicroModal.show('modal-bulk-delete');
714
+ } else {
715
+ $('#posts-filter').submit();
716
  }
717
  });
718
  $(document).on('click', '.qsm-list-shortcode-view', function (e) {
735
  });
736
  $('#bulk-delete-quiz-button').on('click', function (event) {
737
  event.preventDefault();
738
+ if ($("#bult-delete-quiz-form input[name='qsm_delete_question_from_qb']").is(":checked")) {
739
+ $("<input>", {
740
+ "type": "hidden",
741
  "name": "qsm_delete_question_from_qb",
742
  "value": "1"
743
+ }).appendTo("#posts-filter");
744
  }
745
+ if ($("#bult-delete-quiz-form input[name='qsm_delete_from_db']").is(":checked")) {
746
+ $("<input>", {
747
+ "type": "hidden",
748
  "name": "qsm_delete_from_db",
749
  "value": "1"
750
+ }).appendTo("#posts-filter");
751
  }
752
  $('#posts-filter').submit();
753
  });
757
  // QSM - Quiz Wizard
758
 
759
  (function ($) {
760
+ if (jQuery('body').hasClass('post-type-qsm_quiz') || jQuery('body').hasClass('toplevel_page_qsm_dashboard')) {
761
  $('#create-quiz-button').on('click', function (event) {
762
+ event.preventDefault();
763
  if ($('#new-quiz-form').find('.quiz_name').val() === '') {
764
  $('#new-quiz-form').find('.quiz_name').addClass('qsm-required');
765
  $('.qsm-wizard-wrap[data-show="quiz_settings"]').trigger('click');
905
  //QSM - Admin Notices for enabling multiple categories in QSM 7.3+
906
 
907
  (function ($) {
908
+ $(document).on('click', '.enable-multiple-category', function (e) {
909
+ e.preventDefault();
910
+ $('.category-action').html('<span>' + qsm_admin_messages.updating_db + '</span>');
911
+ $('.category-action').prev().hide();
912
+ $('.category-action').prev().prev().hide();
913
+ i = 0;
914
+ category_interval = setInterval(() => {
915
+ if (i % 3 == 0) {
916
+ $('.category-action span').html(' .');
917
+ } else {
918
+ $('.category-action span').append(' .');
919
+ }
920
+ i++;
921
+ }, 500);
922
+ $.ajax({
923
+ type: "POST",
924
+ url: ajaxurl,
925
+ data: {
926
+ action: 'enable_multiple_categories',
927
+ value: 'enable'
928
+ },
929
+ success: function (r) {
930
+ response = JSON.parse(r);
931
+ clearInterval(category_interval);
932
+ if (response.status) {
933
+ $('.category-action').parents('.multiple-category-notice').removeClass('notice-info').addClass('notice-success').html('<p>' + qsm_admin_messages.update_db_success + '</p>');
934
+ } else {
935
+ $('.category-action').parents('.multiple-category-notice').removeClass('notice-info').addClass('notice-error').html(qsm_admin_messages.error + '! ' + qsm_admin_messages.try_again);
936
+ }
937
+
938
+ }
939
+ });
940
+ });
941
+
942
+ $(document).on('click', '.cancel-multiple-category', function (e) {
943
+ e.preventDefault();
944
+ $('.category-action').html('');
945
+ $.ajax({
946
+ type: "POST",
947
+ url: ajaxurl,
948
+ data: {
949
+ action: 'enable_multiple_categories',
950
+ value: 'cancel'
951
+ },
952
+ success: function (status) {
953
+ if (status) {
954
+ $('.multiple-category-notice').hide();
955
+ }
956
+ }
957
+ });
958
+ });
959
+ $('.multiple-category-notice').show();
960
  }(jQuery));
961
 
962
  // QSM - Admin Stats Page
963
  (function ($) {
964
  if (jQuery('body').hasClass('qsm_page_qmn_stats')) {
965
+ if (window.stats_graph instanceof Chart) {
966
  window.stats_graph.destroy();
967
  }
968
  var graph_ctx = document.getElementById("graph_canvas").getContext("2d");
971
  data: {
972
  labels: qsm_admin_stats.labels,
973
  datasets: [{
974
+ label: qsm_admin_messages.quiz_submissions, // Name the series
975
  data: qsm_admin_stats.value, // Specify the data values array
976
  fill: false,
977
  borderColor: '#2196f3', // Add custom color border (Line)
978
  backgroundColor: '#2196f3', // Add custom color background (Points and Fill)
979
  borderWidth: 1 // Specify bar border width
980
+ }]
981
+ },
982
+ options: {
983
+ responsive: true, // Instruct chart js to respond nicely.
984
+ maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height
985
  }
986
  });
987
  }
992
  * QSM - Contact Form
993
  */
994
 
995
+ var QSMContact;
996
+ (function ($) {
997
+ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')) {
998
+ if (window.location.href.indexOf('tab=contact') > 0) {
999
 
1000
  QSMContact = {
1001
  load: function () {
1002
+ if ($.isArray(qsmContactObject.contactForm) && qsmContactObject.contactForm.length > 0) {
1003
+ $.each(qsmContactObject.contactForm, function (i, val) {
1004
+ QSMContact.addField(val);
1005
+ });
1006
+ }
1007
+ },
1008
+ addField: function (fieldArray) {
1009
+ var template = wp.template('contact-form-field');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1010
 
1011
+ $('.contact-form').append(template(fieldArray));
1012
 
1013
+ $('.contact-form-field').each(function () {
1014
+ QSMContact.hideShowSettings($(this));
1015
+ });
1016
+ setTimeout(QSMContact.removeNew, 250);
1017
+ },
1018
+ removeNew: function () {
1019
+ $('.contact-form-field').removeClass('new');
1020
+ },
1021
+ duplicateField: function (linkClicked) {
1022
+ var fieldArray = QSMContact.prepareFieldData(linkClicked.parents('.contact-form-field'));
1023
+ QSMContact.addField(fieldArray);
1024
+ },
1025
+ deleteField: function (field) {
1026
+ var parent = field.parents('.contact-form-field');
1027
+ parent.addClass('deleting');
1028
+ setTimeout(function () {
1029
+ parent.remove();
1030
+ }, 250);
1031
+ },
1032
+ newField: function () {
1033
+ var fieldArray = {
1034
+ label: '',
1035
+ type: 'text',
1036
+ answers: [],
1037
+ required: false,
1038
+ use: '',
1039
+ enable: true,
1040
+ is_default: false
1041
+ };
1042
+ jQuery(document).trigger('qsm_add_contact_field', [fieldArray]);
1043
+ QSMContact.addField(fieldArray);
1044
+ },
1045
+ prepareFieldData: function (field) {
1046
+ var fieldArray = {
1047
+ label: field.find('.label-control').val(),
1048
+ type: field.find('.type-control').val(),
1049
+ required: field.find('.required-control').prop('checked'),
1050
+ use: field.find('.use-control').val(),
1051
+ enable: field.find('.enable-control').prop('checked'),
1052
+ };
1053
+ /**
1054
+ * Store Other settings
1055
+ */
1056
+ field.find('.contact-form-field-settings :input').each(function () {
1057
+ var inputName = $(this).attr('name');
1058
+ var inputVal = $(this).val();
1059
+ if ('checkbox' == $(this).attr('type')) {
1060
+ inputVal = $(this).prop('checked');
1061
+ }
1062
+ fieldArray[inputName] = inputVal;
1063
+ });
1064
+ return fieldArray;
1065
+ },
1066
+ save: function () {
1067
+ QSMContact.displayAlert(qsm_admin_messages.saving_contact_fields, 'info');
1068
+ var contactFields = $('.contact-form-field');
1069
+ var contactForm = [];
1070
+ var contactEach;
1071
+ $.each(contactFields, function (i, val) {
1072
+ contactEach = QSMContact.prepareFieldData($(this));
1073
+ contactForm.push(contactEach);
1074
+ });
1075
+
1076
+ var settings = {};
1077
+ $('#contactformsettings input').each(function () {
1078
+ if ('checkbox' == $(this).attr('type')) {
1079
+ settings[$(this).attr('name')] = ($(this).prop('checked') ? '1' : '0');
1080
+ } else {
1081
+ settings[$(this).attr('name')] = $(this).val();
1082
+ }
1083
+ });
1084
+
1085
+ var data = {
1086
+ action: 'qsm_save_contact',
1087
+ contact_form: contactForm,
1088
+ settings: settings,
1089
+ quiz_id: qsmContactObject.quizID,
1090
+ nonce: qsmContactObject.saveNonce,
1091
+ };
1092
+
1093
+ jQuery.post(ajaxurl, data, function (response) {
1094
+ QSMContact.saved(JSON.parse(response));
1095
+ });
1096
+ },
1097
+ saved: function (response) {
1098
+ if (response.status) {
1099
+ QSMContact.displayAlert('<strong>' + qsm_admin_messages.success + '</strong> ' + qsm_admin_messages.contact_fields_saved, 'success');
1100
+ } else {
1101
+ QSMContact.displayAlert('<strong>' + qsm_admin_messages.error + '</strong> ' + qsm_admin_messages.contact_fields_save_error + ' ' + qsm_admin_messages.try_again, 'error');
1102
+ }
1103
+ },
1104
+ displayAlert: function (message, type) {
1105
+ QSMContact.clearAlerts();
1106
+ $('.contact-message').addClass('notice');
1107
+ switch (type) {
1108
+ case 'info':
1109
+ $('.contact-message').addClass('notice-info');
1110
+ break;
1111
+ case 'error':
1112
+ $('.contact-message').addClass('notice-error');
1113
+ break;
1114
+ case 'success':
1115
+ $('.contact-message').addClass('notice-success');
1116
+ break;
1117
+ default:
1118
+ }
1119
+ $('.contact-message').append('<p>' + message + '</p>');
1120
+ },
1121
+ clearAlerts: function () {
1122
+ $('.contact-message').empty().removeClass().addClass('contact-message');
1123
+ },
1124
+ hideShowSettings: function (field) {
1125
+ var type = field.find('.type-control').val();
1126
+ if (field.find('.required-control').prop('checked')) {
1127
+ field.find('.field-required-flag').show();
1128
+ }
1129
+ if (!field.find('.enable-control').prop('checked')) {
1130
+ field.addClass('disabled-field');
1131
+ if (!$('.show-disabled-fields').prop('checked')) {
1132
+ field.addClass('hidden-field');
1133
+ }
1134
+ }
1135
+ field.find('.contact-form-field-settings .contact-form-group:not(.required-option)').hide();
1136
+ if ('text' == type || 'number' == type) {
1137
+ field.find('.contact-form-field-settings .min-max-option').show();
1138
+ }
1139
+ if ('email' == type) {
1140
+ field.find('.contact-form-field-settings .email-option').show();
1141
+ }
1142
+ jQuery(document).trigger('qsm_contact_field_hide_show_settings', [field, type]);
1143
+ }
1144
+ };
1145
+ $(function () {
1146
+ QSMContact.load();
1147
+ if ($('.contact-form > .contact-form-field').length === 0) {
1148
+ $('.save-contact').hide();
1149
+ }
1150
+ $('.add-contact-field').on('click', function () {
1151
+ QSMContact.newField();
1152
+ if ($('.contact-form > .contact-form-field').length === 0) {
1153
+ $('.save-contact').hide();
1154
+ } else {
1155
+ $('.save-contact').show();
1156
+ }
1157
+ });
1158
+ $('.save-contact').on('click', function () {
1159
+ QSMContact.save();
1160
+ });
1161
+ $('.contact-form').on('click', '.delete-field', function (event) {
1162
+ event.preventDefault();
1163
+ if (!$(this).hasClass('disabled')) {
1164
+ QSMContact.deleteField($(this));
1165
+ }
1166
+ return false;
1167
+ });
1168
+ $('.contact-form').on('click', '.copy-field', function (event) {
1169
+ event.preventDefault();
1170
+ QSMContact.duplicateField($(this));
1171
+ });
1172
+ $('.contact-form').on('click', '.settings-field', function (event) {
1173
+ event.preventDefault();
1174
+ var target = $(this).parents('.contact-form-field').find('.contact-form-field-settings');
1175
+ $('.contact-form-field-settings').not(target).hide();
1176
+ target.toggle();
1177
+ });
1178
+ $('.contact-form').on('change', '.type-control', function (event) {
1179
+ event.preventDefault();
1180
+ QSMContact.hideShowSettings($(this).parents('.contact-form-field'));
1181
+ });
1182
+ $('.contact-form').on('change', '.required-control', function (event) {
1183
+ event.preventDefault();
1184
+ $(this).parents('.contact-form-field').find('.field-required-flag').hide();
1185
+ if ($(this).is(':checked')) {
1186
+ $(this).parents('.contact-form-field').find('.field-required-flag').show();
1187
+ }
1188
+ });
1189
+ $('.contact-form').on('change', '.enable-control', function (event) {
1190
+ event.preventDefault();
1191
+ $(this).parents('.contact-form-field').addClass('disabled-field');
1192
+ if ($(this).is(':checked')) {
1193
+ $(this).parents('.contact-form-field').removeClass('disabled-field');
1194
+ }
1195
+ QSMContact.hideShowSettings($(this).parents('.contact-form-field'));
1196
+ });
1197
+ $(document).on('change', '.show-disabled-fields', function (event) {
1198
+ event.preventDefault();
1199
+ var is_show = $(this).prop('checked');
1200
+ jQuery.post(ajaxurl, { action: 'qsm_show_disabled_contact_fields', show: is_show });
1201
+ if (is_show) {
1202
+ $('.contact-form-field').removeClass('hidden-field');
1203
+ } else {
1204
+ $('.contact-form-field.disabled-field').addClass('hidden-field');
1205
+ }
1206
+ });
1207
+ $('.contact-form').sortable({
1208
+ opacity: 70,
1209
+ cursor: 'grabbing',
1210
+ handle: 'span.dashicons-move'
1211
+ });
1212
+ });
1213
+ }
1214
+ }
1215
+ }(jQuery));
1216
+
1217
+ /**
1218
+ * QSM - Admin emails
1219
+ */
1220
+
1221
+
1222
+ (function ($) {
1223
+ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')) {
1224
+ if (window.location.href.indexOf('tab=emails') > 0) {
1225
+ var QSMAdminEmails;
1226
+ QSMAdminEmails = {
1227
+ total: 0,
1228
+ saveEmails: function () {
1229
+ QSMAdmin.displayAlert(qsm_admin_messages.saving_emails, 'info');
1230
+ var emails = [];
1231
  var email = {};
1232
+ $('.qsm-email').each(function () {
1233
  var email_content = '';
1234
+ if ($(this).find('.email-template').parent('.wp-editor-container').length > 0) {
1235
+ email_content = wp.editor.getContent($(this).find('.email-template').attr('id'));
1236
  } else {
1237
+ email_content = $(this).find('.email-template').val()
1238
  }
1239
  email = {
1240
  'conditions': [],
1241
+ 'to': $(this).find('.to-email').val(),
1242
+ 'subject': $(this).find('.subject').val(),
1243
  'content': email_content,
1244
+ 'replyTo': $(this).find('.reply-to').prop('checked'),
1245
  };
1246
+ $(this).find('.email-condition').each(function () {
1247
  email.conditions.push({
1248
  'category': $(this).children('.email-condition-category').val(),
1249
+ 'criteria': $(this).children('.email-condition-criteria').val(),
1250
+ 'operator': $(this).children('.email-condition-operator').val(),
1251
+ 'value': $(this).children('.email-condition-value').val()
1252
  });
1253
  });
1254
+ emails.push(email);
1255
  });
1256
  var data = {
1257
  'emails': emails,
1263
  data: data,
1264
  headers: { 'X-WP-Nonce': qsmEmailsObject.nonce },
1265
  })
1266
+ .done(function (results) {
1267
+ if (results.status) {
1268
+ QSMAdmin.displayAlert(qsm_admin_messages.emails_saved, 'success');
1269
  } else {
1270
+ QSMAdmin.displayAlert(qsm_admin_messages.emails_save_error + ' ' + qsm_admin_messages.try_again, 'error');
1271
  }
1272
  })
1273
  .fail(QSMAdmin.displayjQueryError);
1274
  },
1275
+ loadEmails: function () {
1276
  $.ajax({
1277
  url: wpApiSettings.root + 'quiz-survey-master/v1/quizzes/' + qsmEmailsObject.quizID + '/emails',
1278
  headers: { 'X-WP-Nonce': qsmEmailsObject.nonce },
1279
  })
1280
+ .done(function (emails) {
1281
+ $('#qsm_emails').find('.qsm-spinner-loader').remove();
1282
+ emails.forEach(function (email, i, emails) {
1283
+ QSMAdminEmails.addEmail(email.conditions, email.to, email.subject, email.content, email.replyTo);
1284
  });
1285
  QSMAdmin.clearAlerts();
1286
  })
1287
  .fail(QSMAdmin.displayjQueryError);
1288
  },
1289
  addCondition: function ($email, category, criteria, operator, value) {
1290
+ var template = wp.template('email-condition');
1291
  $email.find('.email-when-conditions').append(template({
1292
+ 'category': category,
1293
+ 'criteria': criteria,
1294
+ 'operator': operator,
1295
+ 'value': value
1296
  }));
1297
  },
1298
+ newCondition: function ($email) {
1299
  QSMAdminEmails.addCondition($email, '', 'score', 'equal', 0);
1300
  },
1301
+ addEmail: function (conditions, to, subject, content, replyTo) {
1302
  QSMAdminEmails.total += 1;
1303
+ var template = wp.template('email');
1304
+ $('#qsm_emails').append(template({ id: QSMAdminEmails.total, to: to, subject: subject, content: content, replyTo: replyTo }));
1305
+ conditions.forEach(function (condition, i, conditions) {
1306
  QSMAdminEmails.addCondition(
1307
+ $('.qsm-email:last-child'),
1308
  condition.category,
1309
  condition.criteria,
1310
  condition.operator,
1311
  condition.value
1312
  );
1313
  });
1314
+ if (qsmEmailsObject.qsm_user_ve === 'true') {
1315
+ var settings = {
1316
+ mediaButtons: true,
1317
+ tinymce: {
1318
+ forced_root_block: '',
1319
+ toolbar1: 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,charmap,undo,redo'
1320
+ },
1321
+ quicktags: true,
1322
+ };
1323
+ wp.editor.initialize('email-template-' + QSMAdminEmails.total, settings);
1324
+ }
1325
  jQuery(document).trigger('qsm_after_add_email_block', [conditions, to, subject, content, replyTo]);
1326
  },
1327
+ newEmail: function () {
1328
  var conditions = [{
1329
  'category': '',
1330
  'criteria': 'score',
1335
  var subject = 'Quiz Results For %QUIZ_NAME%';
1336
  var content = '%QUESTIONS_ANSWERS_EMAIL%';
1337
  var replyTo = false;
1338
+ QSMAdminEmails.addEmail(conditions, to, subject, content, replyTo);
1339
  }
1340
  };
1341
+ $(function () {
1342
  QSMAdminEmails.loadEmails();
1343
+ $('.add-new-email').on('click', function (event) {
1344
  event.preventDefault();
1345
  QSMAdminEmails.newEmail();
1346
  });
1347
+ $('.save-emails').on('click', function (event) {
1348
  event.preventDefault();
1349
  QSMAdminEmails.saveEmails();
1350
  });
1351
+ $('#qsm_emails').on('click', '.new-condition', function (event) {
1352
  event.preventDefault();
1353
+ $page = $(this).closest('.qsm-email');
1354
+ QSMAdminEmails.newCondition($page);
1355
  });
1356
+ $('#qsm_emails').on('click', '.delete-email-button', function (event) {
1357
  event.preventDefault();
1358
+ $(this).closest('.qsm-email').remove();
1359
  });
1360
+ $('#qsm_emails').on('click', '.delete-condition-button', function (event) {
1361
  event.preventDefault();
1362
+ $(this).closest('.email-condition').remove();
1363
  });
1364
+ });
1365
  }
1366
  }
1367
  }(jQuery));
1369
  /**
1370
  * QSM Question Tab
1371
  */
1372
+ var QSMQuestion;
1373
+ var import_button;
1374
  (function ($) {
1375
+ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')) {
1376
+ if (window.location.href.indexOf('tab') == -1 || window.location.href.indexOf('tab=questions') > 0) {
1377
+
1378
+ $.QSMSanitize = function (input) {
1379
+ return input.replace(/<(|\/|[^>\/bi]|\/[^>bi]|[^\/>][^>]+|\/[^>][^>]+)>/g, '');
1380
+ };
1381
+ QSMQuestion = {
1382
+ question: Backbone.Model.extend({
1383
+ defaults: {
1384
+ id: null,
1385
+ quizID: 1,
1386
+ type: '0',
1387
+ name: '',
1388
+ question_title: '',
1389
+ answerInfo: '',
1390
+ comments: '1',
1391
+ hint: '',
1392
+ category: '',
1393
+ required: 1,
1394
+ answers: [],
1395
+ page: 0
1396
+ }
1397
+ }),
1398
+ questions: null,
1399
+ page: Backbone.Model.extend({
1400
+ defaults: {
1401
+ id: null,
1402
+ quizID: 1,
1403
+ pagekey: qsmRandomID(8),
1404
+ hide_prevbtn: 0,
1405
+ questions: null,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1406
  }
1407
+ }),
1408
+ qpages: null,
1409
+ questionCollection: null,
1410
+ pageCollection: null,
1411
+ categories: [],
1412
+ /**
1413
+ * Counts the total number of questions and then updates #total-questions span.
1414
+ */
1415
+ countTotal: function () {
1416
+ var total = 0;
1417
+
1418
+ // Cycles through each page.
1419
+ _.each(jQuery('.page'), function (page) {
1420
+
1421
+ // If page is empty, continue to the next.
1422
+ if (0 == jQuery(page).children('.question').length) {
1423
+ return;
1424
+ }
1425
+ // Cycle through each question and add to our total.
1426
+ _.each(jQuery(page).children('.question'), function (question) {
1427
+ total += 1;
1428
+ });
1429
  });
1430
+ $('#total-questions').text(total);
1431
+ },
1432
+ openQuestionBank: function (pageID) {
1433
+ QSMQuestion.loadQuestionBank();
1434
+ $('#add-question-bank-page').val(pageID);
1435
+ MicroModal.show('modal-2', {
1436
+ onClose: function () {
1437
+ $('.save-page-button').trigger('click');
1438
+ }
1439
+ });
1440
+ },
1441
+ loadQuestionBank: function (action = '') {
1442
+ if (action == 'change') {
1443
+ $('.qb-load-more-wrapper').remove();
1444
+ $('#question-bank').find('.question-bank-question').remove();
1445
+ $('#question-bank').append('<div style="top: 45px;position: relative;" class="qsm-spinner-loader"></div>');
1446
+ } else if ($('.qb-load-more-wrapper').length > 0) {
1447
+ $('.qb-load-more-question').hide();
1448
+ $('.qb-load-more-wrapper').append('<div class="qsm-spinner-loader"></div>');
1449
+ } else {
1450
+ $('#question-bank').empty();
1451
+ $('#question-bank').append('<div class="qsm-spinner-loader"></div>');
1452
  }
1453
+ $.ajax({
1454
+ url: wpApiSettings.root + 'quiz-survey-master/v1/bank_questions/0/',
1455
+ method: 'GET',
1456
+ beforeSend: function (xhr) {
1457
+ xhr.setRequestHeader('X-WP-Nonce', qsmQuestionSettings.nonce);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1458
  },
1459
+ data: {
1460
+ 'quizID': 0,
1461
+ 'page': $('#question_back_page_number').length > 0 ? parseInt($('#question_back_page_number').val()) + 1 : 1,
1462
+ 'category': $('#question-bank-cat').val(),
1463
+ 'search': $('#question-bank-search-input').val()
1464
+ },
1465
+ success: QSMQuestion.questionBankLoadSuccess
1466
+ });
1467
+ },
1468
+ questionBankLoadSuccess: function (response) {
1469
+ var pagination = response.pagination;
1470
+ var questions = response.questions;
1471
+ if ($('.qb-load-more-wrapper').length > 0) {
1472
+ $('.qb-load-more-wrapper').remove();
1473
+ } else {
1474
+ $('#question-bank').empty();
1475
  }
1476
+ for (var i = 0; i < questions.length; i++) {
1477
+ QSMQuestion.addQuestionToQuestionBank(questions[i]);
 
 
 
 
 
 
1478
  }
1479
+ if (pagination.total_pages > pagination.current_page) {
1480
+ var pagination_html = '<div class="qb-load-more-wrapper" style="text-align: center;margin: 20px 0 10px 0;"><input type="hidden" id="question_back_page_number" value="' + pagination.current_page + '"/>';
1481
+ pagination_html += '<input type="hidden" id="question_back_total_pages" value="' + pagination.total_pages + '"/>';
1482
+ pagination_html += '<a href="javascript:void(0)" class="qb-load-more-question">' + qsm_admin_messages.load_more_quetions + '</a></div>';
1483
+ $('#question-bank').append(pagination_html);
1484
+ }
1485
+ if (pagination.current_page == 1) {
1486
+ if (qsmQuestionSettings.categories.length > 0) {
1487
+ var category_arr = qsmQuestionSettings.categories;
1488
+ let $cat_html = '<option value="">' + qsm_admin_messages.all_categories + '</option>';
1489
+ $.each(category_arr, function (index, value) {
1490
+ if (value.category !== '') {
1491
+ if (typeof value.cat_id !== 'undefined' && value.cat_id !== '') {
1492
+ $cat_html += '<option value="' + value.cat_id + '">' + value.category + '</option>';
1493
+ } else {
1494
+ $cat_html += '<option value="' + value.category + '">' + value.category + '</option>';
1495
+ }
1496
+ }
1497
+ });
1498
+ $('#question-bank-cat').html($cat_html);
1499
+ $('#question-bank-cat').val(pagination.category);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1500
  }
1501
  }
1502
+ },
1503
+ addQuestionToQuestionBank: function (question) {
1504
+ var questionText = QSMQuestion.prepareQuestionText(question.name);
1505
+ var template = wp.template('single-question-bank-question');
1506
+ if (question.question_title !== "undefined" && question.question_title !== "") {
1507
+ questionText = question.question_title;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1508
  }
1509
+ $('#question-bank').append(template({
1510
+ id: question.id,
1511
+ question: questionText,
1512
+ category: question.category,
1513
+ quiz_name: question.quiz_name
1514
+ }));
1515
+ },
1516
+ addQuestionFromQuestionBank: function (questionID) {
1517
+ QSMAdmin.displayAlert(qsm_admin_messages.adding_question, 'info');
1518
+ var model = new QSMQuestion.question({
1519
+ id: questionID
1520
  });
1521
+ model.fetch({
1522
+ headers: {
1523
+ 'X-WP-Nonce': qsmQuestionSettings.nonce
1524
+ },
1525
+ url: wpApiSettings.root + 'quiz-survey-master/v1/questions/' + questionID,
1526
+ success: QSMQuestion.questionBankSuccess,
1527
+ error: QSMAdmin.displayError
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1528
  });
1529
+ },
1530
+ questionBankSuccess: function (model) {
1531
+ var newModel = _.clone(model.attributes);
1532
+ newModel.id = null;
1533
+ QSMQuestion.questions.create(
1534
+ newModel, {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1535
  headers: {
1536
  'X-WP-Nonce': qsmQuestionSettings.nonce
1537
  },
1538
+ success: QSMQuestion.addNewQuestionFromQuestionBank,
1539
  error: QSMAdmin.displayError
1540
  }
1541
+ );
1542
+ },
1543
+ prepareCategories: function () {
1544
+ QSMQuestion.categories = [];
1545
+ QSMQuestion.questions.each(function (question) {
1546
+ var category = question.get('category');
1547
+ if (0 !== category.length && !_.contains(QSMQuestion.categories, category)) {
1548
+ QSMQuestion.categories.push(category);
1549
+ }
1550
+ });
1551
+ },
1552
+ processCategories: function () {
1553
+ $('.category').remove();
1554
+ _.each(QSMQuestion.categories, function (category) {
1555
+ QSMQuestion.addCategory(category);
1556
+ });
1557
+ },
1558
+ addCategory: function (category) {
1559
+ var template = wp.template('single-category');
1560
+ $('#categories').prepend(template({
1561
+ category: category
1562
+ }));
1563
+ },
1564
+ loadQuestions: function () {
1565
+ QSMAdmin.displayAlert(qsm_admin_messages.loading_question, 'info');
1566
+ QSMQuestion.questions.fetch({
1567
+ headers: {
1568
+ 'X-WP-Nonce': qsmQuestionSettings.nonce
1569
+ },
1570
+ data: {
1571
+ quizID: qsmQuestionSettings.quizID
1572
+ },
1573
+ success: QSMQuestion.loadSuccess,
1574
+ error: QSMAdmin.displayError
1575
+ });
1576
+ },
1577
+ loadSuccess: function () {
1578
+ QSMAdmin.clearAlerts();
1579
+ $('.qsm-showing-loader').remove();
1580
+ var question;
1581
+ _.each(qsmQuestionSettings.qpages, function (page) {
1582
+ QSMQuestion.qpages.add(page);
1583
+ });
1584
+ if (qsmQuestionSettings.pages.length > 0) {
1585
+ for (var i = 0; i < qsmQuestionSettings.pages.length; i++) {
1586
+ for (var j = 0; j < qsmQuestionSettings.pages[i].length; j++) {
1587
+ question = QSMQuestion.questions.get(qsmQuestionSettings.pages[i][j]);
1588
+ if ('undefined' !== typeof question) {
1589
+ QSMQuestion.addQuestionToPage(question);
1590
+ }
1591
+ }
1592
+ }
 
 
 
 
 
 
 
 
1593
  } else {
1594
+ //We have removed this code in 7.0.0 because not allow to delete the single page.
1595
+ QSMQuestion.questions.each(QSMQuestion.addQuestionToPage);
1596
  }
1597
+ //Create Default pages and one question.
1598
+ if (qsmQuestionSettings.pages.length == 0 && QSMQuestion.questions.length == 0) {
1599
+ $('.new-page-button').trigger('click');
1600
+ $('.questions .new-question-button').trigger('click');
 
1601
  }
1602
+ QSMQuestion.countTotal();
1603
+ },
1604
+ updateQPage: function (pageID) {
1605
+ QSMAdmin.displayAlert(qsm_admin_messages.saving_page_info, 'info');
1606
+ var pageInfo = QSMQuestion.qpages.get(pageID);
1607
+ jQuery('#page-options').find(':input, select, textarea').each(function (i, field) {
1608
+ pageInfo.set(field.name, field.value);
1609
+ });
1610
+ },
1611
+ savePages: function () {
1612
+ QSMAdmin.displayAlert(qsm_admin_messages.saving_page_questions, 'info');
1613
+ var pages = [];
1614
+ var qpages = [];
1615
+ var pageInfo = null;
1616
+ var post_id = jQuery('#edit_quiz_post_id').val();
1617
 
1618
+ // Cycles through each page and add page + questions to pages variable
1619
+ _.each(jQuery('.page'), function (page) {
 
 
 
1620
 
1621
+ // If page is empty, do not add it.
1622
+ if (0 == jQuery(page).children('.question').length) {
1623
+ return;
1624
+ }
1625
+ var singlePage = [];
1626
+ // Cycle through each question and add to the page.
1627
+ _.each(jQuery(page).children('.question'), function (question) {
1628
+ singlePage.push(jQuery(question).data('question-id'))
1629
+ });
1630
+ pages.push(singlePage);
1631
+ /**
1632
+ * Prepare qpages Object
1633
+ */
1634
+ pageInfo = QSMQuestion.qpages.get(jQuery(page).data('page-id'));
1635
+ pageInfo.set('questions', singlePage);
1636
+ qpages.push(pageInfo.attributes);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1637
  });
1638
+ var data = {
1639
+ action: 'qsm_save_pages',
1640
+ quiz_id: qsmQuestionSettings.quizID,
1641
+ nonce: qsmQuestionSettings.saveNonce,
1642
+ pages: pages,
1643
+ qpages: qpages,
1644
+ post_id: post_id,
1645
+ };
1646
+
1647
+ jQuery.ajax(ajaxurl, {
1648
+ data: data,
1649
+ method: 'POST',
1650
+ success: QSMQuestion.savePagesSuccess,
1651
+ error: QSMAdmin.displayjQueryError
1652
+ });
1653
+ },
1654
+ savePagesSuccess: function () {
1655
+ QSMAdmin.displayAlert(qsm_admin_messages.saved_page_questions, 'success');
1656
+ $('#save-edit-quiz-pages').removeClass('is-active');
1657
+ },
1658
+ addNewPage: function (pageID) {
1659
+ var template = wp.template('page');
1660
+ if (typeof pageID == 'undefined' || pageID == '') {
1661
+ var newPageID = QSMQuestion.qpages.length + 1;
1662
+ var pageID = newPageID;
1663
+ var pageInfo = QSMQuestion.qpages.add({
1664
+ id: newPageID,
1665
+ quizID: qsmQuestionSettings.quizID,
1666
+ pagekey: qsmRandomID(8),
1667
+ hide_prevbtn: 0
1668
+ });
1669
+ }
1670
+ var pageInfo = QSMQuestion.qpages.get(pageID);
1671
+ $('.questions').append(template(pageInfo));
1672
+ var page = $('.questions').find('.page').length;
1673
+ $('.page:nth-child(' + page + ')').find('.page-number').text('Page ' + page);
1674
+ $('.page').sortable({
1675
+ items: '.question',
1676
+ opacity: 70,
1677
+ cursor: 'move',
1678
+ handle: 'span.dashicons-move',
1679
+ placeholder: "ui-state-highlight",
1680
+ connectWith: '.page',
1681
+ stop: function (evt, ui) {
1682
+ setTimeout(
1683
+ function () {
1684
+ $('.save-page-button').trigger('click');
1685
+ },
1686
+ 200
1687
+ )
1688
+ }
1689
+ });
1690
+ setTimeout(QSMQuestion.removeNew, 250);
1691
+ },
1692
+ addNewQuestionFromQuestionBank: function (model) {
1693
+ var page = parseInt($('#add-question-bank-page').val(), 10);
1694
+ model.set('page', page);
1695
+ QSMQuestion.questions.add(model);
1696
+ QSMQuestion.addQuestionToPage(model);
1697
+ $('.import-button').removeClass('disable_import');
1698
+ QSMQuestion.countTotal();
1699
+ import_button.html('').html(qsm_admin_messages.add_question);
1700
+ import_button.attr("onclick", "return confirm(" + qsm_admin_messages.confirm_message + "' '" + qsm_admin_messages.import_question_again + ")");
1701
+ QSMQuestion.openEditPopup(model.id, $('.question[data-question-id=' + model.id + ']').find('.edit-question-button'));
1702
+ $('#save-popup-button').trigger('click');
1703
+ },
1704
+ addNewQuestion: function (model) {
1705
+ var default_answers = parseInt(qsmQuestionSettings.default_answers);
1706
+ var count = 0;
1707
+ QSMAdmin.displayAlert(qsm_admin_messages.question_created, 'success');
1708
+ QSMQuestion.addQuestionToPage(model);
1709
+ QSMQuestion.openEditPopup(model.id, $('.question[data-question-id=' + model.id + ']').find('.edit-question-button'));
1710
+ QSMQuestion.countTotal();
1711
+ if ($('#answers').find('.answers-single').length < default_answers) {
1712
+ while (count < default_answers) {
1713
+ $('#new-answer-button').trigger('click');
1714
+ count++;
1715
+ }
1716
+ }
1717
+ $('.save-page-button').trigger('click');
1718
+ },
1719
+ addQuestionToPage: function (model) {
1720
+ var page = model.get('page') + 1;
1721
+ var template = wp.template('question');
1722
+ var page_exists = $('.page:nth-child(' + page + ')').length;
1723
+ var count = 0;
1724
+ while (!page_exists) {
1725
+ QSMQuestion.addNewPage(page);
1726
+ page_exists = $('.page:nth-child(' + page + ')').length;
1727
+ count++;
1728
+ if (count > 5) {
1729
+ page_exists = true;
1730
+ console.log('count reached');
1731
+ }
1732
+ }
1733
+ var questionName = QSMQuestion.prepareQuestionText(model.get('name'));
1734
+ var new_question_title = model.get('question_title');
1735
+ if (new_question_title === null || typeof new_question_title === "undefined" || new_question_title === "") {
1736
+ //Do nothing
1737
+ } else {
1738
+ questionName = new_question_title;
1739
+ }
1740
+ if (questionName == '') {
1741
+ questionName = qsm_admin_messages.new_question;
1742
+ }
1743
+ $('.page:nth-child(' + page + ')').append(template({
1744
+ id: model.id,
1745
+ category: model.get('category'),
1746
+ question: questionName
1747
  }));
1748
+ setTimeout(QSMQuestion.removeNew, 250);
1749
+ },
1750
+ createQuestion: function (page) {
1751
+ QSMAdmin.displayAlert(qsm_admin_messages.creating_question, 'info');
1752
+ QSMQuestion.questions.create({
1753
+ quizID: qsmQuestionSettings.quizID,
1754
+ page: page
1755
+ }, {
1756
+ headers: {
1757
+ 'X-WP-Nonce': qsmQuestionSettings.nonce
1758
+ },
1759
+ success: QSMQuestion.addNewQuestion,
1760
+ error: QSMAdmin.displayError
1761
+ });
1762
+ },
1763
+ duplicateQuestion: function (questionID) {
1764
+ QSMAdmin.displayAlert(qsm_admin_messages.duplicating_question, 'info');
1765
+ var model = QSMQuestion.questions.get(questionID);
1766
+ var newModel = _.clone(model.attributes);
1767
+ newModel.id = null;
1768
+ QSMQuestion.questions.create(
1769
+ newModel, {
1770
+ headers: {
1771
+ 'X-WP-Nonce': qsmQuestionSettings.nonce
1772
+ },
1773
+ success: QSMQuestion.addNewQuestion,
1774
+ error: QSMAdmin.displayError
1775
+ }
1776
+ );
1777
+ },
1778
+ saveQuestion: function (questionID, CurrentElement) {
1779
+ QSMAdmin.displayAlert(qsm_admin_messages.saving_question, 'info');
1780
+ var model = QSMQuestion.questions.get(questionID);
1781
+ var hint = $('#hint').val();
1782
+ var name = wp.editor.getContent('question-text');
1783
+ //Save new question title
1784
+ var question_title = $('#question_title').val();
1785
+ if (name == '' && question_title == '') {
1786
+ alert(qsm_admin_messages.enter_question_title);
1787
+ setTimeout(function () {
1788
+ $('#save-edit-question-spinner').removeClass('is-active');
1789
+ }, 250);
1790
+ return false;
1791
+ }
1792
+ var advanced_option = {};
1793
+ var answerInfo = wp.editor.getContent('correct_answer_info');
1794
+ var quizID = parseInt(qsmTextTabObject.quiz_id);
1795
+ var type = $("#question_type").val();
1796
+ var comments = $("#comments").val();
1797
+ advanced_option['required'] = $(".questionElements input[name='required']").is(":checked") ? 0 : 1;
1798
+ var category = $(".category-radio:checked").val();
1799
+ var type_arr = [];
1800
+ $.each($("input[name='file_upload_type[]']:checked"), function () {
1801
+ type_value = $(this).val().replace(/,/g, '');
1802
+ type_arr.push(type_value);
1803
+ });
1804
+ if ('new_category' == category) {
1805
+ category = $('#new_category').val();
1806
+ }
1807
+ if (!category) {
1808
+ category = '';
1809
+ }
1810
+
1811
+ //polar question validation
1812
+ if (13 == type) {
1813
+ let polar_error = 0;
1814
+ let polar_required_error = 0;
1815
+ let old_value = "";
1816
+ $('.answers-single .answer-points').each(function () {
1817
+ $(this).css('border-color', '');
1818
+ if ("" != old_value && $(this).val() == old_value) {
1819
+ alert(qsm_admin_messages.polar_q_range_error);
1820
+ polar_error++;
1821
+ }
1822
+ if ("" == $(this).val()) {
1823
+ $(this).css('border-color', 'red');
1824
+ polar_error++;
1825
+ polar_required_error++;
1826
+ }
1827
+ old_value = $(this).val();
1828
+ });
1829
+ if (0 < polar_required_error) {
1830
+ alert(qsm_admin_messages.range_fields_required);
1831
+ }
1832
+ if (0 < polar_error) {
1833
+ setTimeout(function () {
1834
+ $('#save-edit-question-spinner').removeClass('is-active');
1835
+ }, 250);
1836
+ return false;
1837
+ }
1838
+ }
1839
+
1840
+ var multicategories = [];
1841
+ $.each($("input[name='tax_input[qsm_category][]']:checked"), function () {
1842
+ multicategories.push($(this).val());
1843
+ });
1844
+ var featureImageID = $('.qsm-feature-image-id').val();
1845
+ var featureImageSrc = $('.qsm-feature-image-src').val();
1846
+ var answerType = $('#change-answer-editor').val();
1847
+ var matchAnswer = $('#match-answer').val();
1848
+
1849
+ var answers = [];
1850
+ var $answers = jQuery('.answers-single');
1851
+ _.each($answers, function (answer) {
1852
+ var $answer = jQuery(answer);
1853
+ var answer = '';
1854
+ var caption = '';
1855
+ if (answerType == 'rich') {
1856
+ var ta_id = $answer.find('textarea').attr('id')
1857
+ answer = wp.editor.getContent(ta_id);
1858
+ } else if (answerType == 'image') {
1859
+ answer = $answer.find('.answer-text').val().trim();
1860
+ answer = $.QSMSanitize(answer);
1861
+ caption = $answer.find('.answer-caption').val().trim();
1862
+ caption = $.QSMSanitize(caption);
1863
+ } else {
1864
+ answer = $answer.find('.answer-text').val().trim();
1865
+ answer = $.QSMSanitize(answer);
1866
+ }
1867
+
1868
+ var points = $answer.find('.answer-points').val();
1869
+ var correct = 0;
1870
+ if ($answer.find('.answer-correct').prop('checked')) {
1871
+ correct = 1;
1872
+ }
1873
+
1874
+ if (answerType == 'image') {
1875
+ answers.push([answer, points, correct, caption]);
1876
+ } else {
1877
+ answers.push([answer, points, correct]);
1878
+ }
1879
+
1880
+ });
1881
+ $('.questionElements .advanced-content > .qsm-row:not(.core-option)').each(function () {
1882
+ if ($(this).find('input[type="text"]').length > 0) {
1883
+ $($(this).find('input[type="text"]')).each(function () {
1884
+ let element_id = $(this).attr('id');
1885
+ advanced_option[element_id] = $(this).val();
1886
+ });
1887
+ } else if ($(this).find('input[type="number"]').length > 0) {
1888
+ let element_id = $(this).find('input[type="number"]').attr('id');
1889
+ advanced_option[element_id] = $(this).find('input[type="number"]').val();
1890
+ } else if ($(this).find('select').length > 0) {
1891
+ let element_id = $(this).find('select').attr('id');
1892
+ advanced_option[element_id] = $(this).find('select').val();
1893
+ } else if ($(this).find('input[type="checkbox"]').length > 0) {
1894
+ let element_id = $(this).find('input[type="checkbox"]').attr('name');
1895
+ let multi_value = $(this).find('input[type="checkbox"]:checked').map(function () {
1896
+ return this.value;
1897
+ }).get().join(',');
1898
+ element_id = element_id.replace('[]', '');
1899
+ advanced_option[element_id] = multi_value;
1900
+ }
1901
+ });
1902
+ model.save({
1903
+ quizID: quizID,
1904
+ type: type,
1905
+ name: name,
1906
+ question_title: question_title,
1907
+ answerInfo: answerInfo,
1908
+ comments: comments,
1909
+ hint: hint,
1910
+ category: category,
1911
+ multicategories: multicategories,
1912
+ featureImageID: featureImageID,
1913
+ featureImageSrc: featureImageSrc,
1914
+ answers: answers,
1915
+ answerEditor: answerType,
1916
+ matchAnswer: matchAnswer,
1917
+ other_settings: advanced_option,
1918
+ rest_nonce: qsmQuestionSettings.rest_user_nonce
1919
+ }, {
1920
+ headers: {
1921
+ 'X-WP-Nonce': qsmQuestionSettings.nonce
1922
+ },
1923
+ success: QSMQuestion.saveSuccess,
1924
+ error: QSMAdmin.displayError,
1925
+ type: 'POST'
1926
+ });
1927
+ jQuery(document).trigger('qsm_save_question', [questionID, CurrentElement]);
1928
+ },
1929
+ saveSuccess: function (model) {
1930
+ QSMAdmin.displayAlert(qsm_admin_messages.question_saved, 'success');
1931
+ var template = wp.template('question');
1932
+ var page = model.get('page') + 1;
1933
+ var questionName = model.get('name');
1934
+ var new_question_title = model.get('question_title');
1935
+ if (new_question_title !== '') {
1936
+ questionName = $.QSMSanitize(new_question_title);
1937
+ }
1938
+ var category = [];
1939
+ var multicategories = model.get('multicategories');
1940
+ if (multicategories === null || typeof multicategories === "undefined") {
1941
+ //No Action Require
1942
+ } else {
1943
+ $.each(multicategories, function (i, val) {
1944
+ category.push($(".qsm-popup__content #qsm_category-" + val + " label:first-child")[0].textContent);
1945
+ });
1946
+ category = category.filter(item => item);
1947
+ }
1948
+ $('.question[data-question-id=' + model.id + ']').replaceWith(template({
1949
+ id: model.id,
1950
+ type: model.get('type'),
1951
+ category: category.join(', '),
1952
+ question: questionName
1953
  }));
1954
+ setTimeout(function () {
1955
+ $('#save-edit-question-spinner').removeClass('is-active');
1956
+ }, 250);
1957
+ setTimeout(QSMQuestion.removeNew, 250);
1958
+ },
1959
+ addNewAnswer: function (answer, questionType = false) {
1960
+ if (!questionType) {
1961
+ questionType = $('#question_type').val();
1962
+ }
1963
+ var answerTemplate = wp.template('single-answer');
1964
+ if (answer.length >= 7 && answer[6] == 'image') {
1965
+ $('#answers').append(answerTemplate({
1966
+ answer: decodeEntities(answer[0]),
1967
+ points: answer[1],
1968
+ correct: answer[2],
1969
+ caption: answer[3],
1970
+ count: answer[4],
1971
+ question_id: answer[5],
1972
+ answerType: answer[6],
1973
+ form_type: qsmQuestionSettings.form_type,
1974
+ quiz_system: qsmQuestionSettings.quiz_system
1975
+ }));
1976
+ } else {
1977
+ $('#answers').append(answerTemplate({
1978
+ answer: decodeEntities(answer[0]),
1979
+ points: answer[1],
1980
+ correct: answer[2],
1981
+ count: answer[3],
1982
+ question_id: answer[4],
1983
+ answerType: answer[5],
1984
+ form_type: qsmQuestionSettings.form_type,
1985
+ quiz_system: qsmQuestionSettings.quiz_system
1986
+ }));
1987
+ }
1988
+
1989
+ // show points field only for polar in survey and simple form
1990
+ if (qsmQuestionSettings.form_type != 0) {
1991
+ if (questionType == 13) {
1992
+ $('#answers .answer-points').show();
1993
+ } else {
1994
+ $('#answers .answer-points').val('').hide();
1995
+ }
1996
+ }
1997
+ if (qsmQuestionSettings.form_type == 0) {
1998
+ if (questionType == 14) {
1999
+ $('.correct-answer').hide();
2000
+ } else {
2001
+ $('.correct-answer').show();
2002
+ }
2003
+ }
2004
+
2005
+ if (answer[5] == 'rich' && qsmQuestionSettings.qsm_user_ve === 'true') {
2006
+ var textarea_id = 'answer-' + answer[4] + '-' + answer[3];
2007
+ wp.editor.remove(textarea_id);
2008
+ var settings = {
2009
+ mediaButtons: true,
2010
+ tinymce: {
2011
+ forced_root_block: '',
2012
+ toolbar1: 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,charmap,undo,redo'
2013
+ },
2014
+ quicktags: true,
2015
+ };
2016
+ wp.editor.initialize(textarea_id, settings);
2017
+ var anser = QSMQuestion.prepareQuestionText(answer[0]);
2018
+ $(textarea_id).val(anser);
2019
+ tinyMCE.get(textarea_id).setContent(anser);
2020
+ }
2021
+ },
2022
+ openEditPopup: function (questionID, CurrentElement) {
2023
+ jQuery('.qsm_tab_content').find('.question').removeClass('opened');
2024
+ if (CurrentElement.parents('.question').next('.questionElements').length > 0) {
2025
+ if (CurrentElement.parents('.question').next('.questionElements').is(":visible")) {
2026
+ CurrentElement.parents('.question').next('.questionElements').slideUp('slow');
2027
+ $('.questions').sortable('enable');
2028
+ $('.page').sortable('enable');
2029
+ } else {
2030
+ CurrentElement.parents('.question').addClass('opened');
2031
+ CurrentElement.parents('.question').next('.questionElements').slideDown('slow');
2032
+ }
2033
+ return;
2034
+ } else {
2035
+ CurrentElement.parents('.question').addClass('opened');
2036
+ $('.questions .questionElements').slideDown('slow');
2037
+ $('.questions .questionElements').remove();
2038
+ }
2039
+ //Copy and remove popup div
2040
+ var questionElements = $('#modal-1-content').html();
2041
+ $('#modal-1-content').children().remove();
2042
+ CurrentElement.parents('.question').after("<div style='display: none;' class='questionElements'>" + questionElements + "</div>");
2043
+
2044
+ //Show question id on question edit screen
2045
+ $('#qsm-question-id').text('ID: ' + questionID);
2046
+ QSMQuestion.prepareCategories();
2047
+ QSMQuestion.processCategories();
2048
+ var question = QSMQuestion.questions.get(questionID);
2049
+ var questionText = QSMQuestion.prepareQuestionText(question.get('name'));
2050
+ $('#edit_question_id').val(questionID);
2051
+ var answerInfo = question.get('answerInfo');
2052
+ var CAI_editor = '';
2053
+ var question_editor = ''
2054
+ if (qsmQuestionSettings.qsm_user_ve === 'true') {
2055
+ wp.editor.remove('question-text');
2056
+ wp.editor.remove('correct_answer_info');
2057
+ QSMQuestion.prepareEditor();
2058
+ question_editor = tinyMCE.get('question-text');
2059
+ CAI_editor = tinyMCE.get('correct_answer_info');
2060
+ }
2061
+ if ($('#wp-question-text-wrap').hasClass('html-active')) {
2062
+ jQuery("#question-text").val(questionText);
2063
+ } else if (question_editor) {
2064
+ tinyMCE.get('question-text').setContent(questionText);
2065
+ } else {
2066
+ jQuery("#question-text").val(questionText);
2067
+ }
2068
+ if ('' != questionText) {
2069
+ jQuery('.qsm-show-question-desc-box').trigger('click');
2070
+ }
2071
 
2072
+ if ($('#wp-correct_answer_info-wrap').hasClass('html-active')) {
2073
+ jQuery("#correct_answer_info").val(answerInfo);
2074
+ } else if (CAI_editor) {
2075
+ tinyMCE.get('correct_answer_info').setContent(answerInfo);
2076
  } else {
2077
+ jQuery("#correct_answer_info").val(answerInfo);
2078
  }
2079
+
2080
+ $('#answers').empty();
2081
+ var answers = question.get('answers');
2082
+ var answerEditor = question.get('answerEditor');
2083
+ if (answerEditor === null || typeof answerEditor === "undefined") {
2084
+ answerEditor = 'text';
2085
+ }
2086
+ //Get text limit value
2087
+ var get_limit_text = question.get('limit_text');
2088
+ if (get_limit_text === null || typeof get_limit_text === "undefined") {
2089
+ get_limit_text = '0';
2090
+ }
2091
+ //Get limit multiple response value
2092
+ var get_limit_mr = question.get('limit_multiple_response');
2093
+ if (get_limit_mr === null || typeof get_limit_mr === "undefined") {
2094
+ get_limit_mr = '0';
2095
+ }
2096
+ //Get image width value
2097
+ let image_width = question.get('img_width');
2098
+ if (image_width === null || typeof image_width === "undefined") {
2099
+ image_width = '';
2100
+ }
2101
+ //Get image height value
2102
+ let image_height = question.get('img_height');
2103
+ if (image_height === null || typeof image_height === "undefined") {
2104
+ image_height = '';
2105
+ }
2106
+ //Get file upload limit
2107
+ var get_limit_fu = question.get('file_upload_limit');
2108
+ if (get_limit_fu === null || typeof get_limit_fu === "undefined") {
2109
+ get_limit_fu = '0';
2110
+ }
2111
+ //Get checked question type
2112
+ var multicategories = question.get('multicategories');
2113
+ $("input[name='tax_input[qsm_category][]']:checkbox").attr("checked", false);
2114
+ if (multicategories === null || typeof multicategories === "undefined") {
2115
+ //No Action Require
2116
  } else {
2117
+ $.each(multicategories, function (i, val) {
2118
+ $("input[name='tax_input[qsm_category][]']:checkbox[value='" + val + "']").attr("checked", "true");
2119
+ });
2120
  }
2121
+ //Get featured image
2122
+ var get_featureImageSrc = question.get('featureImageSrc');
2123
+ var get_featureImageID = question.get('featureImageID');
2124
+ if (get_featureImageSrc === null || typeof get_featureImageSrc === "undefined") {
2125
+ get_featureImageSrc = get_featureImageID = '';
2126
+ }
2127
+ //Get checked question type
2128
+ var get_file_upload_type = question.get('file_upload_type');
2129
+ $("input[name='file_upload_type[]']:checkbox").attr("checked", false);
2130
+ if (get_file_upload_type === null || typeof get_file_upload_type === "undefined") { } else {
2131
+ var fut_arr = get_file_upload_type.split(",");
2132
+ $.each(fut_arr, function (i) {
2133
+ $("input[name='file_upload_type[]']:checkbox[value='" + fut_arr[i] + "']").attr("checked", "true");
2134
+ });
2135
+ }
2136
+ var al = 0;
2137
+ _.each(answers, function (answer) {
2138
+ answer.push(al + 1);
2139
+ answer.push(questionID);
2140
+ answer.push(answerEditor);
2141
+ QSMQuestion.addNewAnswer(answer, question.get('type'));
2142
+ al++;
2143
+ });
2144
+ //get new question type
2145
+ var get_question_title = question.get('question_title');
2146
+ if (get_question_title === null || typeof get_question_title === "undefined") {
2147
+ get_question_title = '';
2148
+ }
2149
+
2150
+ //Hide the question settings based on question type
2151
+ $('.qsm_hide_for_other').hide();
2152
+ if ($('.qsm_show_question_type_' + question.get('type')).length > 0) {
2153
+ $('.qsm_show_question_type_' + question.get('type')).show();
2154
+ }
2155
+
2156
+ qsm_hide_show_question_desc(question.get('type'));
2157
+ $('#hint').val(question.get('hint'));
2158
+ $('#image_size-width').val(image_width);
2159
+ $('#image_size-height').val(image_height);
2160
+ $("#question_type").val(question.get('type'));
2161
+ $("#comments").val(question.get('comments'));
2162
+ //Changed checked logic based on new structure for required.
2163
+ $("input#required[value='" + question.get('required') + "']").prop('checked', true);
2164
+
2165
+ $("#limit_text").val(get_limit_text);
2166
+ $("#limit_multiple_response").val(get_limit_mr);
2167
+ $("#file_upload_limit").val(get_limit_fu);
2168
+ $("#change-answer-editor").val(answerEditor);
2169
+ $(".category-radio").removeAttr('checked');
2170
+ $("#edit-question-id").text('').text(questionID);
2171
+ $("#question_title").val(get_question_title);
2172
+ if (0 !== question.get('category').length) {
2173
+ $(".category-radio").val([question.get('category')]);
2174
+ }
2175
+ //Append feature image
2176
+ if (get_featureImageSrc) {
2177
+ var button = $('.qsm-feature-image-upl');
2178
+ button.html('<img src="' + get_featureImageSrc + '" style="width:150px">');
2179
+ button.next('.qsm-feature-image-rmv').show();
2180
+ button.next().next('.qsm-feature-image-id').val(get_featureImageID);
2181
+ button.next().next().next('.qsm-feature-image-src').val(get_featureImageSrc);
2182
+ }
2183
+ //Append extra settings
2184
+ var all_setting = question.get('settings');
2185
+ if (all_setting === null || typeof all_setting === "undefined") { } else {
2186
+ $.each(all_setting, function (index, value) {
2187
+ if ($('#' + index + '_area').length > 0) {
2188
+ if (1 == $('#' + index + '_area').find('input[type=checkbox]').length) {
2189
+ $(".questionElements input[name='" + index + "'][value='" + value + "']").attr("checked", "true").prop('checked', true);
2190
+ } else if ($('#' + index + '_area').find('input[type=checkbox]').length > 1) {
2191
+ var fut_arr = value.split(",");
2192
+ $.each(fut_arr, function (i) {
2193
+ $(".questionElements input[name='" + index + "[]']:checkbox[value='" + fut_arr[i] + "']").attr("checked", "true").prop('checked', true);
2194
+ });
2195
+ } else {
2196
+ if (value != null) {
2197
+ $('#' + index).val(value);
2198
+ }
2199
+ }
2200
+ }
2201
+ if (index == 'matchAnswer') {
2202
+ $('#match-answer').val(value);
2203
+ }
2204
+ });
2205
+ }
2206
+ CurrentElement.parents('.question').next('.questionElements').slideDown('slow');
2207
+ $('#modal-1-content').html(questionElements);
2208
+ //MicroModal.show( 'modal-1' );
2209
+ $('.questions').sortable('disable');
2210
+ $('.page').sortable('disable');
2211
+
2212
+ if (13 == question.get('type')) {
2213
+ QSMQuestion.prepareEditPolarQuestion(question.get('type'));
2214
+ }
2215
+ QSMQuestion.sync_child_parent_category(questionID);
2216
 
2217
+ $('#image_size_area').hide();
2218
+ if ('image' === answerEditor) {
2219
+ $('#image_size_area').show();
2220
+ }
2221
+
2222
+ jQuery(document).trigger('qsm_open_edit_popup', [questionID, CurrentElement]);
2223
+ },
2224
+ openEditPagePopup: function (pageID) {
2225
+ var page = QSMQuestion.qpages.get(pageID);
2226
+ $('#edit_page_id').val(pageID);
2227
+ $("#edit-page-id").text('').text(pageID);
2228
+ jQuery('#page-options').find(':input, select, textarea').each(function (i, field) {
2229
+ field.value = page.get(field.name);
2230
+ });
2231
+ MicroModal.show('modal-page-1');
2232
+ },
2233
+ removeNew: function () {
2234
+ $('.page-new').removeClass('page-new');
2235
+ $('.question-new').removeClass('question-new');
2236
+ },
2237
+ prepareQuestionText: function (question) {
2238
+ return jQuery('<textarea />').html(question).text();
2239
+ },
2240
+ prepareEditor: function () {
2241
  var settings = {
2242
  mediaButtons: true,
2243
  tinymce: {
2246
  },
2247
  quicktags: true,
2248
  };
2249
+ wp.editor.initialize('question-text', settings);
2250
+ wp.editor.initialize('correct_answer_info', settings);
2251
+ },
2252
+ sync_child_parent_category: function (questionID) {
2253
+ $('.qsm_category_checklist').find('input').each(function (index, input) {
2254
+ $(input).bind('change', function () {
2255
+ var checkbox = $(this);
2256
+ var is_checked = $(checkbox).is(':checked');
2257
+ if (is_checked) {
2258
+ $(checkbox).parents('li').children('label').children('input').prop("checked", true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2259
  } else {
2260
+ $(checkbox).parentsUntil('ul').find('input').prop("checked", false);
2261
+ }
2262
+ jQuery(document).trigger('qsm_sync_child_parent_category', [checkbox, questionID]);
2263
+ });
2264
+ });
2265
+ },
2266
+ question_type_change: function (previous_question_val, questionID) {
2267
+ //you can override this object
2268
+ var ans_type = $('#change-answer-editor').val();
2269
+ if (2 == questionID && 'text' !== ans_type) {
2270
+ $('#change-answer-editor').val('text');
2271
+ $('.answers-single').remove();
2272
+ }
2273
+ if (13 != questionID) {
2274
+ $('.new-answer-button').show();
2275
+ $('.remove-answer-icon').show();
2276
+ $('.answer-points').css('border-color', '');
2277
+ let ans_placeholder = qsm_admin_messages.your_answer;
2278
+ "image" == ans_type && (ans_placeholder = qsm_admin_messages.insert_image_url), $("#answers").find(".answers-single input.answer-text").attr("placeholder", ans_placeholder), $("#answers").find(".answers-single input.answer-points").attr("placeholder", qsm_admin_messages.points);
2279
+ }
2280
+ },
2281
+ prepareEditPolarQuestion: function (question_val) {
2282
+ var answerType = $('#change-answer-editor').val();
2283
+ if (13 == question_val) {
2284
+ if ($('#answers').find('.answers-single').length < 2) {
2285
+ $('#new-answer-button').trigger('click');
2286
+ if ($('#answers').find('.answers-single').length < 2) {
2287
+ $('#new-answer-button').trigger('click');
2288
  }
2289
  }
2290
+ if ($('#answers').find('.answers-single').length > 2) {
2291
+ jQuery('#answers').find('.answers-single').slice(2).remove();
2292
  }
2293
+ $('.new-answer-button').hide();
2294
+ $('#answers').find('.answers-single .remove-answer-icon').hide();
2295
+
2296
+ let ans_l_placeholder = qsm_admin_messages.left_label;
2297
+ "image" == answerType && (ans_l_placeholder = "Insert left image URL"), $("#answers").find(".answers-single:first-child input.answer-text").attr("placeholder", ans_l_placeholder);
2298
+ let ans_r_placeholder = qsm_admin_messages.right_label;
2299
+ "image" == answerType && (ans_r_placeholder = "Insert right image URL"), $("#answers").find(".answers-single:last-child input.answer-text").attr("placeholder", ans_r_placeholder), $("#answers").find(".answers-single:first-child input.answer-points").attr("placeholder", qsm_admin_messages.left_range), $("#answers").find(".answers-single:last-child input.answer-points").attr("placeholder", qsm_admin_messages.right_range);
2300
+ if ( "" == $("#answers").find(".answers-single:first-child input.answer-points").val() ) {
2301
+ $("#answers").find(".answers-single:first-child input.answer-points").val(0);
2302
+ }
2303
+ if ( "" == $("#answers").find(".answers-single:last-child input.answer-points").val() ) {
2304
+ $("#answers").find(".answers-single:last-child input.answer-points").val(5);
2305
+ }
2306
+ } else {
2307
+ $('.new-answer-button').show();
2308
+ $('.remove-answer-icon').show();
2309
+ let ans_placeholder = qsm_admin_messages.your_answer;
2310
+ "image" == answerType && (ans_placeholder = qsm_admin_messages.insert_image_url), $("#answers").find(".answers-single input.answer-text").attr("placeholder", ans_placeholder), $("#answers").find(".answers-single input.answer-points").attr("placeholder", qsm_admin_messages.points);
2311
+ }
2312
  }
2313
+ };
 
 
 
 
 
 
2314
 
2315
+ $(function () {
2316
+ QSMQuestion.pageCollection = Backbone.Collection.extend({
2317
+ model: QSMQuestion.page
 
 
 
 
 
2318
  });
2319
+ QSMQuestion.qpages = new QSMQuestion.pageCollection();
2320
+ QSMQuestion.questionCollection = Backbone.Collection.extend({
2321
+ url: wpApiSettings.root + 'quiz-survey-master/v1/questions',
2322
+ model: QSMQuestion.question
2323
+ });
2324
+ QSMQuestion.questions = new QSMQuestion.questionCollection();
2325
+ $('.new-page-button').on('click', function (event) {
2326
+ event.preventDefault();
2327
+ QSMQuestion.addNewPage();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2328
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2329
 
2330
+ $('.questions').on('click', '.new-question-button', function (event) {
2331
+ event.preventDefault();
2332
+ if (jQuery('.questionElements').is(':visible')) {
2333
+ $('#save-popup-button').trigger('click');
2334
+ }
2335
+ QSMQuestion.createQuestion($(this).parents('.page').index());
2336
+ });
2337
 
2338
+ $('.questions').on('click', '.add-question-bank-button', function (event) {
2339
+ event.preventDefault();
2340
+ if (jQuery('.questionElements').is(':visible')) {
2341
+ $('#save-popup-button').trigger('click');
2342
+ }
2343
+ QSMQuestion.openQuestionBank($(this).parents('.page').index());
2344
+ });
2345
 
2346
+ //Show more question on load more
2347
+ $(document).on('click', '.qb-load-more-question', function (event) {
2348
+ event.preventDefault();
2349
+ QSMQuestion.loadQuestionBank();
2350
+ });
2351
 
2352
+ //Show category related question
2353
+ $(document).on('change', '#question-bank-cat', function (event) {
2354
+ event.preventDefault();
2355
+ QSMQuestion.loadQuestionBank('change');
2356
+ });
 
 
 
 
2357
 
2358
+ //Show searched question
2359
+ $(document).on('submit', '#question-bank-search-form', function (event) {
2360
+ event.preventDefault();
2361
+ QSMQuestion.loadQuestionBank('change');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2362
  });
 
 
 
 
 
2363
 
2364
+ $('.questions').on('click', '.edit-question-button', function (event) {
2365
+ event.preventDefault();
2366
+ $('.qsm-category-filter').trigger('keyup');
2367
+ QSMQuestion.openEditPopup($(this).parents('.question').data('question-id'), $(this));
2368
+ });
2369
+ $('.questions').on('click', '.edit-page-button', function (event) {
2370
+ event.preventDefault();
2371
+ QSMQuestion.openEditPagePopup($(this).parents('.page').data('page-id'));
2372
+ });
2373
 
2374
+ $(document).on('click', '.questions .duplicate-question-button', function (event) {
2375
+ event.preventDefault();
2376
+ QSMQuestion.duplicateQuestion($(this).parents('.question').data('question-id'));
2377
+ });
2378
+ $('.questions').on('click', '.delete-question-button', function (event) {
2379
+ event.preventDefault();
2380
+ remove = $(this);
2381
+ $(this).parents('.question').next('.questionElements').slideUp('slow');
2382
+ // opens-up question-delete modal
2383
+ MicroModal.show('modal-7');
2384
+ $('#unlink-question-button').attr('data-question-iid', $(this).data('question-iid'));
2385
+ $('#delete-question-button').attr('data-question-iid', $(this).data('question-iid'));
2386
+ });
2387
+ // removes question from database
2388
+ $('#delete-question-button').click(function (event) {
2389
+ event.preventDefault();
2390
+ var question_id = $(this).data('question-iid');
2391
+ $.ajax({
2392
+ url: ajaxurl,
2393
+ method: 'POST',
2394
+ data: {
2395
+ 'action': 'qsm_delete_question_from_database',
2396
+ 'question_id': question_id,
2397
+ 'nonce': qsmQuestionSettings.single_question_nonce
2398
+ },
2399
+ success: function (response) {
2400
+ // do nothing
2401
+ }
2402
+ });
2403
+ remove.parents('.question').remove();
2404
+ QSMQuestion.countTotal();
2405
  $('.save-page-button').trigger('click');
2406
+ MicroModal.close('modal-7');
2407
+ });
2408
+
2409
+ // unlink question from a particular quiz.
2410
+ $('#unlink-question-button').click(function (event) {
2411
+ event.preventDefault();
2412
+ var question_id = $(this).data('question-iid');
2413
+ remove.parents('.question').remove();
2414
  QSMQuestion.countTotal();
2415
+ $('.save-page-button').trigger('click');
2416
+ MicroModal.close('modal-7');
2417
+ });
2418
+
2419
+ $(document).on('click', '.delete-page-button', function (event) {
2420
+ event.preventDefault();
2421
+ if (confirm(qsm_admin_messages.confirm_message)) {
2422
+ var pageID = $(this).parent().siblings('main').children('#edit_page_id').val();
2423
+ $('.page[data-page-id=' + pageID + ']').remove();
2424
+ $('.save-page-button').trigger('click');
2425
+ QSMQuestion.countTotal();
2426
+ MicroModal.close('modal-page-1');
 
 
 
 
 
 
 
2427
  }
2428
+ });
2429
+ $(document).on('click', '#answers .delete-answer-button', function (event) {
2430
+ event.preventDefault();
2431
+ $(this).parents('.answers-single').remove();
2432
+ });
2433
+ $(document).on('click', '#delete-action .deletion', function (event) {
2434
+ event.preventDefault();
2435
+ $(this).parents('.questionElements').slideUp('slow');
2436
+ });
2437
+ $(document).on('click', '#save-popup-button', function (event) {
2438
+ event.preventDefault();
2439
+ questionElements = $(this).parents('.questionElements');
2440
+ if (6 == questionElements.find('#question_type').val()) {
2441
+ question_description = wp.editor.getContent('question-text').trim();
2442
+ if (question_description == '' || question_description == null) {
2443
+ alert(qsm_admin_messages.html_section_empty);
2444
  return false;
2445
  }
2446
  }
2447
+ if (14 == questionElements.find('#question_type').val()) {
2448
+ question_description = wp.editor.getContent('question-text').trim();
2449
+ blanks = question_description.match(/%BLANK%/g);
2450
+ options_length = $('.answer-text-div').length
2451
+ if ($('#match-answer').val() == 'sequence') {
2452
+ if (blanks == null || blanks.length != options_length) {
2453
+ $('.modal-8-table').html(qsm_admin_messages.blank_number_validation);
2454
+ MicroModal.show('modal-8');
2455
+ return false;
2456
+ }
2457
+ } else {
2458
+ if (blanks == null || options_length === 0) {
2459
+ $('.modal-8-table').html(qsm_admin_messages.blank_required_validation);
2460
+ MicroModal.show('modal-8');
2461
+ return false;
2462
+ }
2463
+ }
2464
 
2465
 
2466
+ }
2467
+ $('#save-edit-question-spinner').addClass('is-active');
2468
+ var model_html = $('#modal-1-content').html();
2469
+ $('#modal-1-content').children().remove();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2470
 
2471
+ QSMQuestion.saveQuestion($(this).parents('.questionElements').children('#edit_question_id').val(), $(this));
2472
+ $('.save-page-button').trigger('click');
2473
+ $('#modal-1-content').html(model_html);
2474
+ });
2475
+ $(document).on('click', '#new-answer-button', function (event) {
2476
+ event.preventDefault();
2477
+ var answer_length = $('#answers').find('.answers-single').length;
2478
+ if (answer_length > 1 && $('#question_type').val() == 13) {
2479
+ alert(qsm_admin_messages.polar_options_validation);
2480
+ return;
2481
+ }
2482
+ var question_id = $('#edit_question_id').val();
2483
+ var answerType = $('#change-answer-editor').val();
2484
+ var answer = ['', '', 0, answer_length + 1, question_id, answerType];
2485
+ QSMQuestion.addNewAnswer(answer, 0);
2486
+ });
2487
 
2488
+ $(document).on('click', '.qsm-popup-bank .import-button', function (event) {
2489
+ event.preventDefault();
2490
+ $(this).text('').text(qsm_admin_messages.adding_question);
2491
+ import_button = $(this);
 
 
 
 
 
 
 
 
 
 
2492
  $('.import-button').addClass('disable_import');
2493
+ QSMQuestion.addQuestionFromQuestionBank($(this).data('question-id'));
2494
+ MicroModal.close('modal-2');
2495
+ });
2496
+
2497
+ //Click on selected question button.
2498
+ $('.qsm-popup-bank').on('click', '#qsm-import-selected-question', function (event) {
 
2499
  var $total_selction = $('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').length;
2500
  if ($total_selction === 0) {
2501
+ alert(qsm_admin_messages.no_question_selected);
2502
  } else {
2503
  $.fn.reverse = [].reverse;
2504
+ $($('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').parents('.question-bank-question').reverse()).each(function () {
2505
+ $(this).find('.import-button').text('').text(qsm_admin_messages.adding_question);
2506
+ import_button = $(this).find('.import-button');
2507
+ QSMQuestion.countTotal();
2508
+ QSMQuestion.addQuestionFromQuestionBank($(this).data('question-id'));
2509
+ $(this).find('.import-button').text('').text(qsm_admin_messages.add_question);
2510
+ });
2511
+ $('.import-button').addClass('disable_import');
2512
+ $('#question-bank').find('[name="qsm-question-checkbox[]"]').attr('checked', false);
2513
+ MicroModal.close('modal-2');
2514
+ }
2515
+ });
2516
+ //Delete question from question bank
2517
+ $('.qsm-popup-bank').on('click', '#qsm-delete-selected-question', function (event) {
2518
+ if (confirm(qsm_admin_messages.confirm_message)) {
2519
+ var $total_selction = $('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').length;
2520
+ if ($total_selction === 0) {
2521
+ alert(qsm_admin_messages.no_question_selected);
2522
+ } else {
2523
+ $.fn.reverse = [].reverse;
2524
+ var question_ids = $($('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').parents('.question-bank-question').reverse()).map(function () {
2525
+ return $(this).data('question-id');
2526
+ }).get().join(',');
2527
+ if (question_ids) {
2528
+ $.ajax({
2529
+ url: ajaxurl,
2530
+ method: 'POST',
2531
+ data: {
2532
+ 'action': 'qsm_delete_question_question_bank',
2533
+ 'question_ids': question_ids,
2534
+ 'nonce': qsmQuestionSettings.question_bank_nonce
2535
+ },
2536
+ success: function (response) {
2537
+ var data = jQuery.parseJSON(response);
2538
+ if (data.success === true) {
2539
+ $('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').parents('.question-bank-question').slideUp('slow');
2540
+ alert(data.message);
2541
+ } else {
2542
+ alert(data.message);
2543
+ }
2544
  }
2545
+ });
2546
+ }
2547
  }
2548
  }
2549
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2550
 
2551
+ //Select all button.
2552
+ $(document).on('change', '.qsm-question-checkbox', function (event) {
2553
+ event.preventDefault();
2554
+ if ($('.qsm-question-checkbox:checked').length > 0) {
2555
+ $('.qsm-question-bank-footer').addClass('opened');
2556
  } else {
2557
+ $('.qsm-question-bank-footer').removeClass('opened');
 
 
2558
  }
2559
  });
2560
+ $(document).on('change', '#qsm_select_all_question', function (event) {
2561
+ event.preventDefault();
2562
+ $('.qsm-question-checkbox').prop('checked', jQuery('#qsm_select_all_question').prop('checked'));
2563
+ if ($('.qsm-question-checkbox:checked').length > 0) {
2564
+ $('.qsm-question-bank-footer').addClass('opened');
2565
  } else {
2566
+ $('.qsm-question-bank-footer').removeClass('opened');
2567
  }
2568
  });
 
 
 
 
 
 
 
2569
 
2570
+ $('.save-page-button').on('click', function (event) {
2571
+ event.preventDefault();
2572
+ $('#save-edit-quiz-pages').addClass('is-active');
2573
+ QSMQuestion.savePages();
2574
+ });
2575
+ $('#save-page-popup-button').on('click', function (event) {
2576
+ event.preventDefault();
2577
+ var pageID = $(this).parent().siblings('main').children('#edit_page_id').val();
2578
+ var pageKey = jQuery('#pagekey').val();
2579
+ if (pageKey.replace(/^\s+|\s+$/g, "").length == 0) {
2580
+ alert(qsm_admin_messages.page_name_required);
2581
+ return false;
2582
+ } else if (null == pageKey.match(/^[A-Za-z0-9\-\s]+$/)) {
2583
+ alert(qsm_admin_messages.page_name_validation);
2584
+ return false;
2585
  } else {
2586
+ QSMQuestion.updateQPage(pageID);
2587
+ QSMQuestion.savePages();
2588
+ MicroModal.close('modal-page-1');
2589
  }
2590
  });
 
2591
 
2592
+ $(document).on('change', '#change-answer-editor', function (event) {
2593
+ var newVal = $(this).val();
2594
+ if (confirm(qsm_admin_messages.question_reset_message)) {
2595
+ $('#answers').find('.answers-single').remove();
2596
+ $('#image_size_area').hide();
2597
+ if ('image' === newVal) {
2598
+ $('#image_size_area').show();
2599
+ }
2600
+ } else {
2601
+ if (newVal == 'rich') {
2602
+ $(this).val('text');
2603
+ } else {
2604
+ $(this).val('rich');
2605
+ }
2606
+ return false;
2607
  }
2608
+ var question_val = $('#question_type').val();
 
 
 
 
 
 
 
 
 
2609
  if (13 == question_val) {
2610
+ QSMQuestion.prepareEditPolarQuestion(question_val);
 
 
2611
  }
2612
+ });
2613
 
2614
+ // Adds event handlers for searching questions
2615
+ $('#question_search').on('keyup', function () {
2616
+ $('.question').each(function () {
2617
+ if ($(this).text().toLowerCase().indexOf($('#question_search').val().toLowerCase()) === -1) {
2618
+ $(this).hide();
2619
+ } else {
2620
+ $(this).show();
2621
+ $(this).parent('.page').show();
2622
 
2623
+ }
2624
+ });
2625
+ $('.page').each(function () {
2626
+ if (0 === $(this).children('.question:visible').length) {
2627
+ $(this).hide();
2628
+ } else {
2629
+ $(this).show();
2630
+ }
2631
+ });
2632
+ if (0 === $('#question_search').val().length) {
2633
+ $('.page').show();
2634
+ $('.question').show();
2635
+ }
2636
+ });
2637
 
2638
+ qsm_init_sortable();
2639
+
2640
+ if (qsmQuestionSettings.qsm_user_ve === 'true') {
2641
+ QSMQuestion.prepareEditor();
 
 
 
 
2642
  }
2643
+ QSMQuestion.loadQuestions();
2644
 
2645
+ /**
2646
+ * Hide/show advanced option
2647
+ */
2648
+ $(document).on('click', '#show-advanced-option', function () {
2649
+ var $this = $(this);
2650
+ $(this).next('div.advanced-content').slideToggle('slow', function () {
2651
+ if ($(this).is(':visible')) {
2652
+ $this.text('').html(qsm_admin_messages.hide_advance_options);
2653
+ } else {
2654
+ $this.text('').html(qsm_admin_messages.show_advance_options);
2655
+ }
2656
+ });
2657
+ });
 
 
 
 
 
 
 
2658
 
2659
+ //Hide the question settings based on question type
2660
+ var previous_question_val;
2661
+ $(document).on('focus', '#question_type', function () {
2662
+ previous_question_val = this.value;
2663
+ })
2664
+ $(document).on('change', '#question_type', function () {
2665
+ var question_val = $('#question_type').val();
2666
+ QSMQuestion.question_type_change(previous_question_val, question_val);
2667
+ if (6 == question_val) {
2668
+ var question_description = wp.editor.getContent('question-text');
2669
+ if (question_description == 'Add description here!') {
2670
+ tinyMCE.get('question-text').setContent('');
2671
+ }
2672
+ }
2673
+ if (14 == question_val) {
2674
+ $('.correct-answer').hide();
2675
+ } else {
2676
+ $('.correct-answer').show();
2677
+ }
 
 
 
2678
 
2679
+ // show points field only for polar in survey and simple form
2680
+ if (qsmQuestionSettings.form_type != 0) {
2681
+ if (13 == question_val) {
2682
+ $('.answer-points').show();
2683
+ } else {
2684
+ $('.answer-points').val('').hide();
2685
+ }
2686
+ }
2687
 
2688
+ $('.qsm_hide_for_other').hide();
2689
+ if ($('.qsm_show_question_type_' + question_val).length > 0) {
2690
+ $('.qsm_show_question_type_' + question_val).show();
2691
+ }
2692
+ qsm_hide_show_question_desc(question_val);
2693
+ if (13 == question_val) {
2694
+ QSMQuestion.prepareEditPolarQuestion(question_val);
2695
+ }
2696
+ });
2697
 
2698
+ //Add new category
2699
+ $(document).on('click', '#qsm-category-add-toggle', function () {
2700
+ if ($('#qsm-category-add').is(":visible")) {
2701
+ $('.questionElements #new_category_new').attr('checked', false);
2702
+ $('#qsm-category-add').slideUp('slow');
2703
+ } else {
2704
+ $('.questionElements #new_category_new').attr('checked', true).prop('checked', 'checked');
2705
+ $('#qsm-category-add').slideDown('slow');
2706
+ }
2707
+ });
2708
 
2709
+ //Hide/show quesion description
2710
+ $(document).on('click', '.qsm-show-question-desc-box', function (e) {
2711
+ e.preventDefault();
2712
+ $(this).hide();
2713
+ var question_description = wp.editor.getContent('question-text');
2714
+ if (question_description == '' || question_description == null) {
2715
+ var questionElements = $(this).parents('.questionElements');
2716
+ if (6 == questionElements.find('#question_type').val()) {
2717
+ tinyMCE.get('question-text').setContent('');
2718
+ }
2719
  }
2720
+ $(this).next('.qsm-row').show();
2721
+ });
2722
+ $(document).on('click', '.qsm-hide-question-desc-box', function (e) {
2723
+ e.preventDefault();
2724
+ $(this).parents('.qsm-row.qsm-editor-wrap').hide();
2725
+ $('.qsm-show-question-desc-box').show();
2726
+ });
2727
 
2728
+ //Open file upload on feature image
2729
+ $('body').on('click', '.qsm-feature-image-upl', function (e) {
2730
+ e.preventDefault();
2731
+ var button = $(this),
2732
+ custom_uploader = wp.media({
2733
+ title: qsm_admin_messages.insert_img,
2734
+ library: {
2735
+ // uploadedTo : wp.media.view.settings.post.id, // attach to the current post?
2736
+ type: 'image'
2737
+ },
2738
+ button: {
2739
+ text: qsm_admin_messages.use_img // button label text
2740
+ },
2741
+ multiple: false
2742
+ }).on('select', function () { // it also has "open" and "close" events
2743
+ var attachment = custom_uploader.state().get('selection').first().toJSON();
2744
+ button.html('<img src="' + attachment.url + '" style="width:150px">');
2745
+ button.next('.qsm-feature-image-rmv').show();
2746
+ button.next().next('.qsm-feature-image-id').val(attachment.id);
2747
+ button.next().next().next('.qsm-feature-image-src').val(attachment.url);
2748
+ }).open();
2749
+ });
2750
+
2751
+ // on remove button click
2752
+ $('body').on('click', '.qsm-feature-image-rmv', function (e) {
2753
+ e.preventDefault();
2754
+ var button = $(this);
2755
+ button.next().val(''); // emptying the hidden field
2756
+ button.next().next().val(''); // emptying the hidden field
2757
+ button.hide().prev().html(qsm_admin_messages.upload_img);
2758
+ });
2759
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2760
  });
2761
+ var decodeEntities = (function () {
2762
+ //create a new html document (doesn't execute script tags in child elements)
2763
+ var doc = document.implementation.createHTMLDocument("");
2764
+ var element = doc.createElement('div');
2765
+
2766
+ function getText(str) {
2767
+ element.innerHTML = str;
2768
+ str = element.textContent;
2769
+ element.textContent = '';
2770
+ return str;
2771
+ }
2772
+
2773
+ function decodeHTMLEntities(str) {
2774
+ if (str && typeof str === 'string') {
2775
+ var x = getText(str);
2776
+ while (str !== x) {
2777
+ str = x;
2778
+ x = getText(x);
2779
+ }
2780
+ return x;
2781
+ }
2782
  }
2783
+ return decodeHTMLEntities;
2784
+ })();
2785
 
2786
+ function qsm_hide_show_question_desc(question_type) {
2787
+ $('.question-type-description').hide();
2788
+ if ($('#question_type_' + question_type + '_description').length > 0) {
2789
+ $('#question_type_' + question_type + '_description').show();
2790
+ }
 
2791
  }
2792
+
2793
+ function qsm_init_sortable() {
2794
+ $('.questions').sortable({
2795
+ opacity: 70,
2796
+ cursor: 'move',
2797
+ handle: 'span.dashicons-move',
2798
+ placeholder: "ui-state-highlight",
2799
+ stop: function (evt, ui) {
2800
+ $('.questions > .page').each(function () {
2801
+ var page = parseInt($(this).index()) + 1;
2802
+ $(this).find('.page-number').text('Page ' + page);
2803
+ });
2804
+ setTimeout(
2805
+ function () {
2806
+ $('.save-page-button').trigger('click');
2807
+ },
2808
+ 200
2809
+ )
2810
+ }
2811
  });
2812
+ $('.page').sortable({
2813
+ items: '.question',
2814
+ handle: 'span.dashicons-move',
2815
+ opacity: 70,
2816
+ cursor: 'move',
2817
+ placeholder: "ui-state-highlight",
2818
+ connectWith: '.page',
2819
+ stop: function (evt, ui) {
2820
+ setTimeout(
2821
+ function () {
2822
+ $('.save-page-button').trigger('click');
2823
+ },
2824
+ 200
2825
+ )
2826
  }
2827
  });
2828
+ }
2829
 
2830
+ function qsmRandomID(length) {
2831
+ var result = '';
2832
+ var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
2833
+ var charactersLength = characters.length;
2834
+ for (var i = 0; i < length; i++) {
2835
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
2836
+ }
2837
+ return result;
2838
  }
2839
+ $(document).on('keyup', '.qsm-category-filter', function () {
2840
+ search_term = $.trim($(this).val());
2841
+ if (search_term == '') {
2842
+ $('.qsm_category_checklist li').each(function () {
2843
+ $(this).show()
2844
+ });
2845
+ } else {
2846
+ search_term = new RegExp(search_term, 'i');
2847
+ $('.qsm_category_checklist li').each(function () {
2848
+ search_string = $(this).children('label').text();
2849
+ result = search_string.search(search_term);
2850
+ if (result > -1) {
2851
+ $(this).show();
2852
+ if ($(this).parent('ul').hasClass('children')) {
2853
+ $(this).parents('li').show();
2854
+ }
2855
+ } else {
2856
+ $(this).hide();
2857
+ }
2858
+ });
2859
 
 
 
 
 
 
 
 
 
 
 
 
2860
  }
2861
  });
 
2862
 
2863
+ $(document).on('click', '.add-multiple-category', function (e) {
2864
+ e.preventDefault();
2865
+ MicroModal.show('modal-9', {
2866
+ onShow: function () {
2867
+ $('#new-category-name').val($('.qsm-category-filter').val());
2868
+ $('.qsm-category-filter').val('').trigger('keyup');
2869
+ },
2870
+ onClose: function () {
2871
+ $('#modal-9-content .info').html('');
2872
+ $('#new-category-name').val('');
2873
+ $('#qsm-parent-category').val(-1);
 
 
 
2874
  }
2875
  });
2876
+ });
2877
 
2878
+ $(document).on('click', '#save-multi-category-button', function (e) {
2879
+ e.preventDefault();
2880
+ duplicate = false;
2881
+ new_category = $('#new-category-name').val().trim();
2882
+ parent_category = $('#qsm-parent-category option:selected').val();
2883
+ if (new_category == '') {
2884
+ $('#modal-9-content .info').html(qsm_admin_messages.category_not_empty);
2885
+ return false;
2886
+ } else {
2887
+ $('#qsm-parent-category option').each(function () {
2888
+ if ($(this).text().toLowerCase() == new_category.toLowerCase()) {
2889
+ duplicate = true;
2890
+ $('#modal-9-content .info').html(qsm_admin_messages.category + ' ' + new_category + ' ' + qsm_admin_messages.already_exists_in_database);
2891
+ return false;
2892
+ }
2893
+ });
2894
+
2895
+ if (!duplicate) {
2896
+ var new_category_data = {
2897
+ action: 'save_new_category',
2898
+ name: new_category,
2899
+ parent: parent_category
2900
+ };
2901
+ $('#modal-9-content .info').html('');
2902
+ jQuery.ajax(ajaxurl, {
2903
+ data: new_category_data,
2904
+ method: 'POST',
2905
+ success: function (response) {
2906
+ result = JSON.parse(response);
2907
+ if (result.term_id > 0) {
2908
+ $('#qsm-parent-category').append('<option class="level-0" value="' + result.term_id + '">' + new_category + '</option>');
2909
+ if (parent_category == -1) {
2910
+ $('.qsm_category_checklist').prepend('<li id="qsm_category-' + result.term_id + '"><label class="selectit"><input value="' + result.term_id + '" type="checkbox" checked="checked" name="tax_input[qsm_category][]" id="in-qsm_category-' + result.term_id + '"> ' + new_category + '</label></li>');
2911
  } else {
2912
+ if ($('.qsm_category_checklist li#qsm_category-' + parent_category).children('ul').length > 0) {
2913
+ $('.qsm_category_checklist li#qsm_category-' + parent_category).children('ul').append('<li id="qsm_category-' + result.term_id + '"><label class="selectit"><input value="' + result.term_id + '" type="checkbox" name="tax_input[qsm_category][]" id="in-qsm_category-' + result.term_id + '"> ' + new_category + '</label></li>');
2914
+ } else {
2915
+ $('.qsm_category_checklist li#qsm_category-' + parent_category).append('<ul class="children"><li id="qsm_category-' + result.term_id + '"><label class="selectit"><input value="' + result.term_id + '" type="checkbox" name="tax_input[qsm_category][]" id="in-qsm_category-' + result.term_id + '"> ' + new_category + '</label></li></ul>')
2916
+ }
2917
+ $('.qsm_category_checklist li#qsm_category-' + result.term_id).children('label').children('input').prop('checked', true);
2918
+ $('.qsm_category_checklist li#qsm_category-' + result.term_id).parents('li').each(function () {
2919
+ $(this).children('label').children('input').prop('checked', true);
2920
+ });
2921
  }
2922
+ MicroModal.close('modal-9')
 
 
 
2923
  }
 
2924
  }
2925
+ });
2926
+ }
2927
  }
2928
+ });
2929
+ }
2930
  }
 
2931
  }(jQuery));
2932
 
2933
 
2936
  */
2937
 
2938
  (function ($) {
2939
+ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')) {
2940
+ if (window.location.href.indexOf('tab=results-pages') > 0) {
2941
  var QSMAdminResults;
2942
  QSMAdminResults = {
2943
  total: 0,
2944
+ saveResults: function () {
2945
+ QSMAdmin.displayAlert(qsm_admin_messages.saving_results_page, 'info');
2946
  var pages = [];
2947
  var page = {};
2948
  var redirect_value = '';
2949
+ $('.results-page').each(function () {
2950
  page = {
2951
  'conditions': [],
2952
+ 'page': wp.editor.getContent($(this).find('.results-page-template').attr('id')),
2953
  'redirect': false,
2954
  };
2955
+ redirect_value = $(this).find('.results-page-redirect').val();
2956
+ if ('' != redirect_value) {
2957
  page.redirect = redirect_value;
2958
  }
2959
+ $(this).find('.results-page-condition').each(function () {
2960
  page.conditions.push({
2961
  'category': $(this).children('.results-page-condition-category').val(),
2962
+ 'criteria': $(this).children('.results-page-condition-criteria').val(),
2963
+ 'operator': $(this).children('.results-page-condition-operator').val(),
2964
+ 'value': $(this).children('.results-page-condition-value').val()
2965
  });
2966
  });
2967
  pages.push(page);
2976
  data: data,
2977
  headers: { 'X-WP-Nonce': qsmResultsObject.nonce },
2978
  })
2979
+ .done(function (results) {
2980
+ if (results.status) {
2981
+ QSMAdmin.displayAlert(qsm_admin_messages.results_page_saved, 'success');
2982
+ } else {
2983
+ QSMAdmin.displayAlert( qsm_admin_messages.results_page_save_error + ' ' + qsm_admin_messages.results_page_saved, 'error');
2984
+ }
2985
+ })
2986
+ .fail(QSMAdmin.displayjQueryError);
2987
  },
2988
+ loadResults: function () {
2989
  //QSMAdmin.displayAlert( 'Loading results pages...', 'info' );
2990
  $.ajax({
2991
  url: wpApiSettings.root + 'quiz-survey-master/v1/quizzes/' + qsmResultsObject.quizID + '/results',
2992
  headers: { 'X-WP-Nonce': qsmResultsObject.nonce },
2993
  })
2994
+ .done(function (pages) {
2995
+ $('#results-pages').find('.qsm-spinner-loader').remove();
2996
+ pages.forEach(function (page, i, pages) {
2997
+ QSMAdminResults.addResultsPage(page.conditions, page.page, page.redirect);
2998
  });
2999
  QSMAdmin.clearAlerts();
3000
  })
3001
  .fail(QSMAdmin.displayjQueryError);
3002
  },
3003
  addCondition: function ($page, category, criteria, operator, value) {
3004
+ var template = wp.template('results-page-condition');
3005
  $page.find('.results-page-when-conditions').append(template({
3006
+ 'category': category,
3007
+ 'criteria': criteria,
3008
+ 'operator': operator,
3009
+ 'value': value
3010
  }));
3011
  },
3012
+ newCondition: function ($page) {
3013
  QSMAdminResults.addCondition($page, '', 'score', 'equal', 0);
3014
  },
3015
  addResultsPage: function (conditions, page, redirect) {
3016
  QSMAdminResults.total += 1;
3017
+ var template = wp.template('results-page');
3018
+ $('#results-pages').append(template({ id: QSMAdminResults.total, page: page, redirect: redirect }));
3019
+ conditions.forEach(function (condition, i, conditions) {
3020
  QSMAdminResults.addCondition(
3021
  $('.results-page:last-child'),
3022
+ condition.category,
3023
+ condition.criteria,
3024
+ condition.operator,
3025
+ condition.value
3026
  );
3027
  });
3028
  var settings = {
3029
  mediaButtons: true,
3030
+ tinymce: {
3031
+ forced_root_block: '',
3032
  toolbar1: 'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,charmap,undo,redo'
3033
  },
3034
+ quicktags: true,
3035
  };
3036
+ wp.editor.initialize('results-page-' + QSMAdminResults.total, settings);
3037
  jQuery(document).trigger('qsm_after_add_result_block', [conditions, page, redirect]);
3038
  },
3039
+ newResultsPage: function () {
3040
  var conditions = [{
3041
  'category': '',
3042
  'criteria': 'score',
3044
  'value': '0'
3045
  }];
3046
  var page = '%QUESTIONS_ANSWERS%';
3047
+ QSMAdminResults.addResultsPage(conditions, page);
3048
  }
3049
  };
3050
+ $(function () {
3051
  QSMAdminResults.loadResults();
3052
 
3053
+ $('.add-new-page').on('click', function (event) {
3054
  event.preventDefault();
3055
  QSMAdminResults.newResultsPage();
3056
  });
3057
+ $('.save-pages').on('click', function (event) {
3058
  event.preventDefault();
3059
  QSMAdminResults.saveResults();
3060
  });
3061
+ $('#results-pages').on('click', '.new-condition', function (event) {
3062
  event.preventDefault();
3063
+ $page = $(this).closest('.results-page');
3064
+ QSMAdminResults.newCondition($page);
3065
  });
3066
+ $('#results-pages').on('click', '.delete-page-button', function (event) {
3067
  event.preventDefault();
3068
+ $(this).closest('.results-page').remove();
3069
  });
3070
+ $('#results-pages').on('click', '.delete-condition-button', function (event) {
3071
  event.preventDefault();
3072
+ $(this).closest('.results-page-condition').remove();
3073
  });
3074
  });
3075
  }
js/qsm-common.js CHANGED
@@ -23,20 +23,6 @@
23
  let polarQuestion = jQuery(this).find('.slider-main-wrapper div');
24
  let questionID = polarQuestion.attr('id').replace('slider-','');
25
  qsmPolarSliderEach(polarQuestion,questionID,page);
26
- if ('answer' === page || 'admin' === page){
27
- let heightArray = jQuery(".mlw-qmn-question-result-"+questionID+" >> div").map(
28
- function() {
29
- return jQuery(this).height();
30
- }).get();
31
- let maxHeight = Math.max.apply(null, heightArray);
32
- jQuery('.mlw-qmn-question-result-'+questionID).height(maxHeight);
33
- } else {
34
- let heightArray = jQuery(".question-section-id-"+questionID+" .question-type-polar-s >> div").map(function() {
35
- return jQuery(this).height();
36
- }).get();
37
- let maxHeight = Math.max.apply(null,heightArray);
38
- jQuery('.question-section-id-'+questionID+' .question-type-polar-s').height(maxHeight);
39
- }
40
  });
41
  }
42
 
23
  let polarQuestion = jQuery(this).find('.slider-main-wrapper div');
24
  let questionID = polarQuestion.attr('id').replace('slider-','');
25
  qsmPolarSliderEach(polarQuestion,questionID,page);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  });
27
  }
28
 
js/qsm-quiz.js CHANGED
@@ -24,25 +24,25 @@ var qsmTimerInterval = [];
24
  _.each(qmn_quiz_data, function (quiz) {
25
  quizID = parseInt(quiz.quiz_id);
26
  QSM.initPagination(quizID);
27
- qsmTimerInterval[quizID] = setInterval(function() { qmnTimeTakenTimer(quizID) }, 1000);
28
 
29
  if (quiz.hasOwnProperty('pagination') || quiz.qpages.hasOwnProperty(2)) {
30
  qsmEndTimeTakenTimer(quizID);
31
- jQuery('.qsm-quiz-container-'+quizID+' #timer').val(0);
32
- jQuery(".qsm-quiz-container-"+quizID+" input[name='timer_ms']").val(0);
33
  quizType = 'paginated';
34
  }
35
 
36
  if (qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')) {
37
  qsmEndTimeTakenTimer(quizID);
38
- jQuery('.qsm-quiz-container-'+quizID+' #timer').val(0);
39
- jQuery(".qsm-quiz-container-"+quizID+" input[name='timer_ms']").val(0);
40
  QSMPageTimer.endPageTimer(quizID, true);
41
  }
42
  if (quiz.hasOwnProperty('timer_limit') && 0 != quiz.timer_limit) {
43
  qsmEndTimeTakenTimer(quizID);
44
- jQuery('.qsm-quiz-container-'+quizID+' #timer').val(0);
45
- jQuery(".qsm-quiz-container-"+quizID+" input[name='timer_ms']").val(0);
46
  QSM.initTimer(quizID);
47
  quizType = 'timer';
48
  }
@@ -68,20 +68,20 @@ var qsmTimerInterval = [];
68
  // If we are using the newer pagination system...
69
  if (0 < $quizForm.children('.qsm-page').length) {
70
  // If there is a first page...
71
- if (qmn_quiz_data[quizID].hasOwnProperty('first_page') && !qmn_quiz_data[quizID].first_page) {
72
  QSM.activateTimer(quizID);
73
- $('.qsm-quiz-container-'+ quizID).find('.stoptimer-p').show();
74
  }
75
  // ...else, we must be using the questions per page option.
76
  } else {
77
  if (qmn_quiz_data[quizID].hasOwnProperty('pagination') && qmn_quiz_data[quizID].first_page) {
78
- $(document).on('click', '.qsm-quiz-container-'+ quizID + ' .mlw_next', function (event) {
79
  event.preventDefault();
80
  if (qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')) {
81
  var start_timer = parseInt(qmn_quiz_data[quizID].advanced_timer.start_timer_page);
82
- if ($('.qsm-quiz-container-'+ quizID).find('.qmn_pagination > .slide_number_hidden').val() == start_timer) {
83
  QSM.activateTimer(quizID);
84
- $('.qsm-quiz-container-'+ quizID).find('.stoptimer-p').show();
85
  }
86
  } else {
87
  if (!qmn_quiz_data[quizID].timerStatus && (0 == $('.quiz_begin:visible').length || (1 == $('.quiz_begin:visible').length && qmnValidatePage('quizForm' + quizID)))) {
@@ -103,10 +103,10 @@ var qsmTimerInterval = [];
103
  * @param int quizID The ID of the quiz.
104
  */
105
  activateTimer: function (quizID) {
106
- var timer_ms = jQuery(".qsm-quiz-container-"+quizID+" input[name='timer_ms']").val();
107
  if (timer_ms == 0) {
108
- qsmTimerInterval[quizID] = setInterval(function() { qmnTimeTakenTimer(quizID) }, 1000);
109
- jQuery(".qsm-quiz-container-"+quizID+" input[name='timer_ms']").each(function () {
110
  var timems = qsmTimeInMS();
111
  jQuery(this).val(timems);
112
  });
@@ -156,13 +156,13 @@ var qsmTimerInterval = [];
156
  }
157
  var secondsRemaining = qmn_quiz_data[quizID].timerRemaning;
158
  var display = QSM.secondsToTimer(secondsRemaining);
159
- var systemTime=new Date().getTime()/1000;
160
- systemTime=Math.round(systemTime);
161
- if('1'===qmn_quiz_data[quizID].not_allow_after_expired_time && systemTime > qmn_quiz_data[quizID].scheduled_time_end ){
162
  MicroModal.show('modal-4');
163
  return false;
164
  }
165
- // Sets our local storage values for the timer being started and current timer value.
166
  localStorage.setItem('mlw_time_quiz' + quizID, secondsRemaining);
167
  localStorage.setItem('mlw_started_quiz' + quizID, "yes");
168
 
@@ -282,17 +282,14 @@ var qsmTimerInterval = [];
282
  */
283
  initPagination: function (quizID) {
284
  var $quizForm = QSM.getQuizForm(quizID);
285
-
286
-
287
  /**
288
  *
289
  * CHecking if the quiz is random
290
  */
291
  $is_random = $('.qmn_quiz_container').hasClass('random');
292
- if($is_random){
293
- QSM.goToPage(quizID, 1);
294
- }
295
- else if (0 < $quizForm.children('.qsm-page').length) {
296
  $quizForm.children('.qsm-page').hide();
297
  template = wp.template('qsm-pagination-' + quizID);
298
  $quizForm.append(template());
@@ -337,7 +334,7 @@ var qsmTimerInterval = [];
337
  jQuery(document).trigger('qsm_next_button_click_before', [quizID]);
338
  event.preventDefault();
339
  QSM.nextPage(quizID);
340
- var $container = jQuery('.qsm-quiz-container-'+ quizID);
341
  if (qmn_quiz_data[quizID].disable_scroll_next_previous_click != 1) {
342
  qsmScrollTo($container);
343
  }
@@ -347,13 +344,24 @@ var qsmTimerInterval = [];
347
  jQuery(document).trigger('qsm_previous_button_click_before', [quizID]);
348
  event.preventDefault();
349
  QSM.prevPage(quizID);
350
- var $container = jQuery('.qsm-quiz-container-'+ quizID);
351
  if (qmn_quiz_data[quizID].disable_scroll_next_previous_click != 1) {
352
  qsmScrollTo($container);
353
  }
354
  jQuery(document).trigger('qsm_previous_button_click_after', [quizID]);
355
  });
356
  }
 
 
 
 
 
 
 
 
 
 
 
357
  },
358
  /**
359
  * Navigates quiz to specific page
@@ -392,12 +400,11 @@ var qsmTimerInterval = [];
392
  $quizForm.find('.qsm-previous').hide();
393
  }
394
  if ('1' == qmn_quiz_data[quizID].disable_first_page) {
395
- if(pageNumber == 1){
396
- $quizForm.find(".quiz_begin").hide();
397
- $quizForm.find(".mlw_previous").hide();
398
- $quizForm.find('.qsm-page-' + (parseInt(pageNumber))).show();
399
  }
400
- }
401
  if ('1' == qmn_quiz_data[quizID].progress_bar) {
402
  var current_page = jQuery('#quizForm' + quizID).find('.current_page_hidden').val();
403
  var total_page_length = $pages.length - 1;
@@ -437,17 +444,17 @@ var qsmTimerInterval = [];
437
  */
438
  changePage: function (quizID, difference) {
439
  var page = QSM.getPage(quizID);
440
- if(qmn_quiz_data[quizID].hasOwnProperty('first_page') && qmn_quiz_data[quizID].first_page){
441
  if (qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')) {
442
  var start_timer = parseInt(qmn_quiz_data[quizID].advanced_timer.start_timer_page);
443
- if ( page == start_timer ) { // check current page
444
  QSM.activateTimer(quizID);
445
- $('.qsm-quiz-container-'+ quizID).find('.stoptimer-p').show();
446
  }
447
  } else {
448
- if (!qmn_quiz_data[quizID].timerStatus ) {
449
  QSM.activateTimer(quizID);
450
- $('.qsm-quiz-container-'+ quizID).find('.stoptimer-p').show();
451
  }
452
  }
453
 
@@ -666,15 +673,15 @@ function isEmail(email) {
666
  * @param email The Email Id to validate.
667
  * @returns Boolean
668
  */
669
- function isValidDomains( email, domains ) {
670
- if ( 'undefined' == domains ) {
671
  return true;
672
  }
673
- if ( 0 == domains.length ) {
674
  return true;
675
  }
676
- for ( var i = 0; i < domains.length; i++ ) {
677
- if ( email.indexOf( domains[i] ) != -1 ) {
678
  return true;
679
  }
680
  }
@@ -687,7 +694,7 @@ function isValidDomains( email, domains ) {
687
  * @returns Boolean
688
  */
689
  function isUrlValid(url) {
690
- return /^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i.test(url);
691
  }
692
 
693
  /**
@@ -715,10 +722,10 @@ function qmnDoInit() {
715
 
716
  jQuery(document).on("qsm_next_button_click_after", function (_event, _quiz_id) {
717
  if (quizType == 'paginated') {
718
- var timer_ms = jQuery(".qsm-quiz-container-"+_quiz_id+" input[name='timer_ms']").val();
719
  if (timer_ms == 0) {
720
- qsmTimerInterval[_quiz_id] = setInterval(function() { qmnTimeTakenTimer(_quiz_id) }, 1000);
721
- jQuery(".qsm-quiz-container-"+_quiz_id+" input[name='timer_ms']").each(function () {
722
  var timems = qsmTimeInMS();
723
  jQuery(this).val(timems);
724
  });
@@ -728,12 +735,12 @@ function qmnDoInit() {
728
  }
729
 
730
  function qmnTimeTakenTimer(quizID) {
731
- var x = +jQuery('.qsm-quiz-container-'+quizID+' #timer').val();
732
  if (NaN === x) {
733
  x = 0;
734
  }
735
  x = x + 1;
736
- jQuery('.qsm-quiz-container-'+quizID+' #timer').val(x);
737
  }
738
 
739
  function qsmEndTimeTakenTimer(quiz_id) {
@@ -778,46 +785,46 @@ function qmnValidation(element, quiz_form_id) {
778
  qmnResetError(quiz_form_id);
779
  jQuery(element).each(function () {
780
  if (jQuery(this).attr('class')) {
781
- if ( jQuery( this ).attr( 'class' ).indexOf( 'mlwEmail' ) !== -1 && this.value !== "" ) {
782
  // Remove any trailing and preceeding space.
783
- var x = jQuery.trim( this.value );
784
- if ( !isEmail( x ) ) {
785
- qmnDisplayError( error_messages.email_error_text, jQuery( this ), quiz_form_id );
786
  result = false;
787
  }
788
  /**
789
  * Validate email from allowed domains.
790
  */
791
- var domains = jQuery( this ).attr( 'data-domains' );
792
- if ( 'undefined' != typeof domains ) {
793
- if ( !isValidDomains( x, domains.split( "," ) ) ) {
794
- qmnDisplayError( error_messages.email_error_text, jQuery( this ), quiz_form_id );
795
  result = false;
796
  }
797
  }
798
  }
799
- if ( jQuery( this ).attr( 'class' ).indexOf( 'mlwUrl' ) !== -1 && this.value !== "" ) {
800
  // Remove any trailing and preceeding space.
801
- if ( !isUrlValid( jQuery.trim( this.value ) ) ) {
802
- qmnDisplayError( error_messages.url_error_text, jQuery( this ), quiz_form_id );
803
  result = false;
804
  }
805
  }
806
- if ( jQuery( this ).attr( 'class' ).indexOf( 'mlwMinLength' ) !== -1 && this.value !== "" ) {
807
  // Remove any trailing and preceeding space.
808
- if ( jQuery.trim( this.value ).length < jQuery( this ).attr( 'minlength' ) ) {
809
  var minlength_error = error_messages.minlength_error_text;
810
- minlength_error = minlength_error.replace('%minlength%', jQuery( this ).attr( 'minlength' ));
811
- qmnDisplayError( minlength_error, jQuery( this ), quiz_form_id );
812
  result = false;
813
  }
814
  }
815
- if ( jQuery( this ).attr( 'class' ).indexOf( 'mlwMaxLength' ) !== -1 && this.value !== "" ) {
816
  // Remove any trailing and preceeding space.
817
- if ( jQuery.trim( this.value ).length > jQuery( this ).attr( 'maxlength' ) ) {
818
  var maxlength_error = error_messages.maxlength_error_text;
819
- maxlength_error = maxlength_error.replace('%maxlength%', jQuery( this ).attr( 'maxlength' ));
820
- qmnDisplayError( maxlength_error, jQuery( this ), quiz_form_id );
821
  result = false;
822
  }
823
  }
@@ -905,13 +912,13 @@ function qmnFormSubmit(quiz_form_id) {
905
  var $container = jQuery('#' + quiz_form_id).closest('.qmn_quiz_container');
906
  var result = qmnValidation('#' + quiz_form_id + ' *', quiz_form_id);
907
  if (!result) { return result; }
908
-
909
  /**
910
  * Update Timer in MS
911
  */
912
- var timer_ms = jQuery('#' + quiz_form_id).find(".qsm-quiz-container-"+quiz_id+" input[name='timer_ms']").val();
913
  var new_timer_ms = qsmTimeInMS();
914
- jQuery('#' + quiz_form_id).find(".qsm-quiz-container-"+quiz_id+" input[name='timer_ms']").val(Math.abs(new_timer_ms - timer_ms));
915
 
916
  jQuery('.mlw_qmn_quiz input:radio').attr('disabled', false);
917
  jQuery('.mlw_qmn_quiz input:checkbox').attr('disabled', false);
@@ -926,9 +933,9 @@ function qmnFormSubmit(quiz_form_id) {
926
  fd.append(input.name, input.value);
927
  });
928
  fd.append("action", 'qmn_process_quiz');
929
- fd.append("nonce", qmn_ajax_object.security );
930
- fd.append("currentuserTime", Math.round(new Date().getTime()/1000));
931
- fd.append("currentuserTimeZone",Intl.DateTimeFormat().resolvedOptions().timeZone);
932
 
933
 
934
  qsmEndTimeTakenTimer(quizID);
@@ -948,23 +955,27 @@ function qmnFormSubmit(quiz_form_id) {
948
  processData: false,
949
  type: 'POST',
950
  success: function (response) {
951
- response=JSON.parse(response);
952
  if (window.qsm_results_data === undefined) {
953
  window.qsm_results_data = new Object();
954
  }
955
- window.qsm_results_data[quizID]={
956
- 'save_response' : response.result_status['save_response'],
957
- 'id' : response.result_status['id']
958
  };
959
 
960
- if(response.quizExpired){
961
  MicroModal.show('modal-4');
962
  return false;
963
- }else{
964
  qmnDisplayResults(response, quiz_form_id, $container);
 
 
 
 
965
  jQuery(document).trigger('qsm_after_quiz_submit_load_chart');
966
  jQuery(document).trigger('qsm_after_quiz_submit', [quiz_form_id]);
967
- jQuery(".hide").parent().css('display','none');
968
  }
969
  }
970
  });
@@ -976,7 +987,7 @@ function qsmDisplayLoading($container, quiz_id) {
976
  var loader_html = '<div class="qsm_quiz_processing_box">';
977
  loader_html += '<div class="qsm-spinner-loader qsm_quiz_processing_loader"></div>';
978
  if (qmn_quiz_data[quiz_id].hasOwnProperty('quiz_processing_message') && qmn_quiz_data[quiz_id].quiz_processing_message != '') {
979
- loader_html += '<div class="qsm_quiz_processing_message">'+qmn_quiz_data[quiz_id].quiz_processing_message+'</div>';
980
  }
981
  loader_html += '</div>';
982
  $container.empty();
@@ -993,8 +1004,6 @@ function qmnDisplayResults(results, quiz_form_id, $container) {
993
  $container.append('<div class="qmn_results_page"></div>');
994
  $container.find('.qmn_results_page').html(results.display);
995
  qsmScrollTo($container);
996
- // run MathJax on the new content
997
- MathJax.typesetPromise();
998
  // Fires after result is populates via ajax
999
  jQuery(document).trigger('qsm_after_display_result', [results, quiz_form_id, $container]);
1000
  }
@@ -1031,39 +1040,40 @@ function qmnInit() {
1031
  jQuery('#quizForm' + qmn_quiz_data[key].quiz_id + ' .qmn_quiz_radio').change(function () {
1032
  var radio_group = jQuery(this).attr('name');
1033
  jQuery('input[type=radio][name=' + radio_group + ']').prop('disabled', true);
1034
- let radio_value =jQuery(this).val();
1035
  let disableAnswer = {};
1036
- if ( localStorage.getItem( "disable_answer" ) ){
1037
  disableAnswer = JSON.parse(localStorage.getItem("disable_answer"));
1038
  }
1039
- if (!disableAnswer[key]){
1040
- disableAnswer[key]=[];
1041
  }
1042
  let disabledQuestions = disableAnswer[key].map(element => element[0]);
1043
- if (! disabledQuestions.includes(radio_group) ){
1044
  disableAnswer[key].push([radio_group, radio_value]);
1045
  }
1046
- localStorage.setItem("disable_answer",JSON.stringify(disableAnswer));
1047
  });
1048
 
1049
- if(localStorage.getItem("disable_answer")){
1050
  let disabledAnswer = JSON.parse(localStorage.getItem("disable_answer"));
1051
- if(disabledAnswer[key]){
1052
  disabledAnswer[key].forEach(element => {
1053
- let element1=element[1].replaceAll(' ','-');
1054
- jQuery('#'+element[0]+'-'+element1+' input').prop('checked', true).trigger('change');
1055
  });
1056
  }
1057
  }
1058
- jQuery(document).on('qsm_after_quiz_submit',function(event, quiz_form_id ){
1059
  event.preventDefault();
1060
- if(localStorage.getItem("disable_answer")){
1061
  let disabledAnswer2 = JSON.parse(localStorage.getItem("disable_answer"));
1062
- if(disabledAnswer2[key]){
1063
  delete disabledAnswer2[key];
1064
- localStorage.setItem("disable_answer",JSON.stringify(disabledAnswer2)); }
 
1065
  }
1066
-
1067
  });
1068
  }
1069
 
@@ -1135,14 +1145,14 @@ function qmnNextSlide(pagination, go_to_top, quiz_form_id) {
1135
  if (go_to_top == 1 && qmn_quiz_data[quiz_id].disable_scroll_next_previous_click != 1) {
1136
  qsmScrollTo($container);
1137
  }
1138
- if (qmn_quiz_data[quiz_id].disable_first_page == 1) {
1139
- if (slide_number == 0 && page_number == 0) {
1140
- $container.find(".qsm-auto-page-row.quiz_begin").hide();
1141
- $container.find('.qsm-auto-page-row.qsm-apc-' + (parseInt(page_number) + 1)).show();
1142
- $container.find('.slide_number_hidden').val(parseInt(slide_number) + 1);
1143
- $container.find('.current_page_hidden').val(parseInt(page_number) + 2);
1144
- $container.find(".mlw_previous").hide();
1145
- }
1146
  }
1147
  //Show the page counts
1148
  if (page_number > 0 && jQuery(quiz_form_id).closest('.qmn_quiz_container').find('.pages_count').length > 0) {
@@ -1188,10 +1198,10 @@ function qmnPrevSlide(pagination, go_to_top, quiz_form_id) {
1188
  qsmScrollTo($container);
1189
  }
1190
  if (qmn_quiz_data[quiz_id].disable_first_page == 1) {
1191
- if (page_number == 3) {
1192
- $container.find(".qsm-auto-page-row.quiz_begin").hide();
1193
- $container.find(".mlw_previous").hide();
1194
- }
1195
  }
1196
  if (page_number > 0 && jQuery(quiz_form_id).closest('.qmn_quiz_container').find('.pages_count').length > 0) {
1197
  var actual_pages = total_pages - 2;
@@ -1307,7 +1317,7 @@ function qmnInitPagination(quiz_id) {
1307
  jQuery(document).trigger('qsm_init_progressbar_after', [quiz_id, qmn_quiz_data]);
1308
  }
1309
 
1310
- jQuery(document).on( "click", ".qsm-quiz-container-" + quiz_id + " .mlw_next", function (event) {
1311
  event.preventDefault();
1312
  var quiz_id = +jQuery(this).closest('.qmn_quiz_container').find('.qmn_quiz_id').val();
1313
  jQuery(document).trigger('qsm_auto_next_button_click_before', [quiz_id]);
@@ -1317,7 +1327,7 @@ function qmnInitPagination(quiz_id) {
1317
  jQuery(document).trigger('qsm_next_button_click_after', [quiz_id]);
1318
  });
1319
 
1320
- jQuery(document).on( "click", ".qsm-quiz-container-" + quiz_id + " .mlw_previous", function (event) {
1321
  event.preventDefault();
1322
  var quiz_id = +jQuery(this).closest('.qmn_quiz_container').find('.qmn_quiz_id').val();
1323
  qmnPrevSlide(qmn_quiz_data[quiz_id].pagination.amount, 1, '#quizForm' + quiz_id);
@@ -1330,6 +1340,7 @@ function qmnInitPagination(quiz_id) {
1330
  qmnNextSlide(qmn_quiz_data[quiz_id].pagination.amount, 0, '#quizForm' + quiz_id);
1331
  }
1332
 
 
1333
  }
1334
 
1335
  function qmnSocialShare(network, mlw_qmn_social_text, mlw_qmn_title, facebook_id, share_url) {
@@ -1351,9 +1362,9 @@ function qmnSocialShare(network, mlw_qmn_social_text, mlw_qmn_title, facebook_id
1351
  return false;
1352
  }
1353
 
1354
- function maxLengthCheck( object ) {
1355
- if ( object.value.length > object.maxLength ) {
1356
- object.value = object.value.slice( 0, object.maxLength )
1357
  }
1358
  }
1359
 
@@ -1371,7 +1382,7 @@ jQuery(function () {
1371
  var form = jQuery(this).closest('form')[0];
1372
  var form_id = form.id;
1373
  var recaptcha = jQuery('#' + form_id).find("#qsm_grecaptcha_v3");
1374
- if ( ! recaptcha.length ) {
1375
  qmnFormSubmit(form_id);
1376
  return false;
1377
  }
@@ -1379,8 +1390,8 @@ jQuery(function () {
1379
  // Proceed reCaptcha v3
1380
  var site_key = jQuery('#' + form_id).find("#qsm_grecaptcha_v3_sitekey").val();
1381
  var submit_action = jQuery('#' + form_id).find("#qsm_grecaptcha_v3_nonce").val();
1382
- grecaptcha.ready(function() {
1383
- grecaptcha.execute(site_key, {action: submit_action}).then(function(token) {
1384
  jQuery('#' + form_id).find("#qsm_grecaptcha_v3_response").val(token);
1385
  qmnFormSubmit(form_id);
1386
  });
@@ -1404,7 +1415,9 @@ jQuery(function () {
1404
  //Reload the timer and pagination
1405
  qmnDoInit();
1406
 
1407
- MathJax.typesetPromise();
 
 
1408
 
1409
  // trigger fired on successfull retake quiz
1410
  jQuery(document).trigger('qsm_retake_quiz', [quiz_id]);
@@ -1441,7 +1454,9 @@ jQuery(function () {
1441
  $this.append('<div style="color: red" class="quick-question-res-p">' + qmn_quiz_data[quizID].quick_result_wrong_answer_text + '</div>')
1442
  $this.append('<div class="qsm-inline-correct-info">' + data.message + '</div>');
1443
  }
1444
- MathJax.typesetPromise();
 
 
1445
  },
1446
  error: function (errorThrown) {
1447
  alert(errorThrown);
@@ -1451,11 +1466,11 @@ jQuery(function () {
1451
  });
1452
 
1453
  // Autocomplete off
1454
- jQuery('.qsm-quiz-container').find('.qmn_quiz_id').each(function (){
1455
  var quizID = jQuery(this).val();
1456
  var $quizForm = QSM.getQuizForm(quizID);
1457
  if (qmn_quiz_data[quizID].form_disable_autofill == 1) {
1458
- jQuery('#quizForm' + quizID).attr('autocomplete', 'off');
1459
  }
1460
  });
1461
 
@@ -1490,7 +1505,9 @@ jQuery(function () {
1490
  $quizForm.closest('.qmn_quiz_container').find('.qsm-submit-btn').trigger('click');
1491
  }, 1000);
1492
  }
1493
- MathJax.typesetPromise();
 
 
1494
  },
1495
  error: function (errorThrown) {
1496
  alert(errorThrown);
@@ -1621,21 +1638,21 @@ jQuery(function () {
1621
 
1622
  // captcha question type
1623
  var mlw_code;
1624
- jQuery(document).ready(function() {
1625
  let captchaElement = jQuery('#mlw_code_captcha');
1626
- if (captchaElement.length !== 0){
1627
  mlw_code = '';
1628
  var mlw_chars = '0123456789ABCDEFGHIJKL!@#$%^&*()MNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
1629
  var mlw_code_length = 5;
1630
- for (var i=0; i<mlw_code_length; i++) {
1631
  var rnum = Math.floor(Math.random() * mlw_chars.length);
1632
- mlw_code += mlw_chars.substring(rnum,rnum+1);
1633
  }
1634
  var mlw_captchaCTX = document.getElementById('mlw_captcha').getContext('2d');
1635
  mlw_captchaCTX.font = 'normal 24px Verdana';
1636
  mlw_captchaCTX.strokeStyle = '#000000';
1637
- mlw_captchaCTX.clearRect(0,0,100,50);
1638
- mlw_captchaCTX.strokeText(mlw_code,10,30,70);
1639
  mlw_captchaCTX.textBaseline = 'middle';
1640
  document.getElementById('mlw_code_captcha').value = mlw_code;
1641
  }
24
  _.each(qmn_quiz_data, function (quiz) {
25
  quizID = parseInt(quiz.quiz_id);
26
  QSM.initPagination(quizID);
27
+ qsmTimerInterval[quizID] = setInterval(function () { qmnTimeTakenTimer(quizID) }, 1000);
28
 
29
  if (quiz.hasOwnProperty('pagination') || quiz.qpages.hasOwnProperty(2)) {
30
  qsmEndTimeTakenTimer(quizID);
31
+ jQuery('.qsm-quiz-container-' + quizID + ' #timer').val(0);
32
+ jQuery(".qsm-quiz-container-" + quizID + " input[name='timer_ms']").val(0);
33
  quizType = 'paginated';
34
  }
35
 
36
  if (qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')) {
37
  qsmEndTimeTakenTimer(quizID);
38
+ jQuery('.qsm-quiz-container-' + quizID + ' #timer').val(0);
39
+ jQuery(".qsm-quiz-container-" + quizID + " input[name='timer_ms']").val(0);
40
  QSMPageTimer.endPageTimer(quizID, true);
41
  }
42
  if (quiz.hasOwnProperty('timer_limit') && 0 != quiz.timer_limit) {
43
  qsmEndTimeTakenTimer(quizID);
44
+ jQuery('.qsm-quiz-container-' + quizID + ' #timer').val(0);
45
+ jQuery(".qsm-quiz-container-" + quizID + " input[name='timer_ms']").val(0);
46
  QSM.initTimer(quizID);
47
  quizType = 'timer';
48
  }
68
  // If we are using the newer pagination system...
69
  if (0 < $quizForm.children('.qsm-page').length) {
70
  // If there is a first page...
71
+ if (!qmn_quiz_data[quizID].hasOwnProperty('first_page') || !qmn_quiz_data[quizID].first_page) {
72
  QSM.activateTimer(quizID);
73
+ $('.qsm-quiz-container-' + quizID).find('.stoptimer-p').show();
74
  }
75
  // ...else, we must be using the questions per page option.
76
  } else {
77
  if (qmn_quiz_data[quizID].hasOwnProperty('pagination') && qmn_quiz_data[quizID].first_page) {
78
+ $(document).on('click', '.qsm-quiz-container-' + quizID + ' .mlw_next', function (event) {
79
  event.preventDefault();
80
  if (qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')) {
81
  var start_timer = parseInt(qmn_quiz_data[quizID].advanced_timer.start_timer_page);
82
+ if ($('.qsm-quiz-container-' + quizID).find('.qmn_pagination > .slide_number_hidden').val() == start_timer) {
83
  QSM.activateTimer(quizID);
84
+ $('.qsm-quiz-container-' + quizID).find('.stoptimer-p').show();
85
  }
86
  } else {
87
  if (!qmn_quiz_data[quizID].timerStatus && (0 == $('.quiz_begin:visible').length || (1 == $('.quiz_begin:visible').length && qmnValidatePage('quizForm' + quizID)))) {
103
  * @param int quizID The ID of the quiz.
104
  */
105
  activateTimer: function (quizID) {
106
+ var timer_ms = jQuery(".qsm-quiz-container-" + quizID + " input[name='timer_ms']").val();
107
  if (timer_ms == 0) {
108
+ qsmTimerInterval[quizID] = setInterval(function () { qmnTimeTakenTimer(quizID) }, 1000);
109
+ jQuery(".qsm-quiz-container-" + quizID + " input[name='timer_ms']").each(function () {
110
  var timems = qsmTimeInMS();
111
  jQuery(this).val(timems);
112
  });
156
  }
157
  var secondsRemaining = qmn_quiz_data[quizID].timerRemaning;
158
  var display = QSM.secondsToTimer(secondsRemaining);
159
+ var systemTime = new Date().getTime() / 1000;
160
+ systemTime = Math.round(systemTime);
161
+ if ('1' === qmn_quiz_data[quizID].not_allow_after_expired_time && systemTime > qmn_quiz_data[quizID].scheduled_time_end) {
162
  MicroModal.show('modal-4');
163
  return false;
164
  }
165
+ // Sets our local storage values for the timer being started and current timer value.
166
  localStorage.setItem('mlw_time_quiz' + quizID, secondsRemaining);
167
  localStorage.setItem('mlw_started_quiz' + quizID, "yes");
168
 
282
  */
283
  initPagination: function (quizID) {
284
  var $quizForm = QSM.getQuizForm(quizID);
 
 
285
  /**
286
  *
287
  * CHecking if the quiz is random
288
  */
289
  $is_random = $('.qmn_quiz_container').hasClass('random');
290
+ if ($is_random) {
291
+ QSM.goToPage(quizID, 1);
292
+ } else if (0 < $quizForm.children('.qsm-page').length) {
 
293
  $quizForm.children('.qsm-page').hide();
294
  template = wp.template('qsm-pagination-' + quizID);
295
  $quizForm.append(template());
334
  jQuery(document).trigger('qsm_next_button_click_before', [quizID]);
335
  event.preventDefault();
336
  QSM.nextPage(quizID);
337
+ var $container = jQuery('.qsm-quiz-container-' + quizID);
338
  if (qmn_quiz_data[quizID].disable_scroll_next_previous_click != 1) {
339
  qsmScrollTo($container);
340
  }
344
  jQuery(document).trigger('qsm_previous_button_click_before', [quizID]);
345
  event.preventDefault();
346
  QSM.prevPage(quizID);
347
+ var $container = jQuery('.qsm-quiz-container-' + quizID);
348
  if (qmn_quiz_data[quizID].disable_scroll_next_previous_click != 1) {
349
  qsmScrollTo($container);
350
  }
351
  jQuery(document).trigger('qsm_previous_button_click_after', [quizID]);
352
  });
353
  }
354
+ // Gets timer element.
355
+ let $timer = QSM.getTimer(quizID);
356
+
357
+ // Calculates starting time.
358
+ let timerStarted = localStorage.getItem('mlw_started_quiz' + quizID);
359
+ let timerRemaning = localStorage.getItem('mlw_time_quiz' + quizID);
360
+ let seconds = parseFloat(qmn_quiz_data[quizID].timer_limit) * 60;
361
+ if ('yes' == timerStarted && 0 < timerRemaning) {
362
+ seconds = parseInt(timerRemaning);
363
+ }
364
+ $timer.text(QSM.secondsToTimer(seconds));
365
  },
366
  /**
367
  * Navigates quiz to specific page
400
  $quizForm.find('.qsm-previous').hide();
401
  }
402
  if ('1' == qmn_quiz_data[quizID].disable_first_page) {
403
+ if (pageNumber == 1) {
404
+ $quizForm.find(".mlw_previous").hide();
405
+ $quizForm.find('.qsm-page-' + (parseInt(pageNumber))).show();
406
+ }
407
  }
 
408
  if ('1' == qmn_quiz_data[quizID].progress_bar) {
409
  var current_page = jQuery('#quizForm' + quizID).find('.current_page_hidden').val();
410
  var total_page_length = $pages.length - 1;
444
  */
445
  changePage: function (quizID, difference) {
446
  var page = QSM.getPage(quizID);
447
+ if (qmn_quiz_data[quizID].hasOwnProperty('first_page') && qmn_quiz_data[quizID].first_page) {
448
  if (qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')) {
449
  var start_timer = parseInt(qmn_quiz_data[quizID].advanced_timer.start_timer_page);
450
+ if (page == start_timer) { // check current page
451
  QSM.activateTimer(quizID);
452
+ $('.qsm-quiz-container-' + quizID).find('.stoptimer-p').show();
453
  }
454
  } else {
455
+ if (!qmn_quiz_data[quizID].timerStatus) {
456
  QSM.activateTimer(quizID);
457
+ $('.qsm-quiz-container-' + quizID).find('.stoptimer-p').show();
458
  }
459
  }
460
 
673
  * @param email The Email Id to validate.
674
  * @returns Boolean
675
  */
676
+ function isValidDomains(email, domains) {
677
+ if ('undefined' == domains) {
678
  return true;
679
  }
680
+ if (0 == domains.length) {
681
  return true;
682
  }
683
+ for (var i = 0; i < domains.length; i++) {
684
+ if (email.indexOf(domains[i]) != -1) {
685
  return true;
686
  }
687
  }
694
  * @returns Boolean
695
  */
696
  function isUrlValid(url) {
697
+ return /^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i.test(url);
698
  }
699
 
700
  /**
722
 
723
  jQuery(document).on("qsm_next_button_click_after", function (_event, _quiz_id) {
724
  if (quizType == 'paginated') {
725
+ var timer_ms = jQuery(".qsm-quiz-container-" + _quiz_id + " input[name='timer_ms']").val();
726
  if (timer_ms == 0) {
727
+ qsmTimerInterval[_quiz_id] = setInterval(function () { qmnTimeTakenTimer(_quiz_id) }, 1000);
728
+ jQuery(".qsm-quiz-container-" + _quiz_id + " input[name='timer_ms']").each(function () {
729
  var timems = qsmTimeInMS();
730
  jQuery(this).val(timems);
731
  });
735
  }
736
 
737
  function qmnTimeTakenTimer(quizID) {
738
+ var x = +jQuery('.qsm-quiz-container-' + quizID + ' #timer').val();
739
  if (NaN === x) {
740
  x = 0;
741
  }
742
  x = x + 1;
743
+ jQuery('.qsm-quiz-container-' + quizID + ' #timer').val(x);
744
  }
745
 
746
  function qsmEndTimeTakenTimer(quiz_id) {
785
  qmnResetError(quiz_form_id);
786
  jQuery(element).each(function () {
787
  if (jQuery(this).attr('class')) {
788
+ if (jQuery(this).attr('class').indexOf('mlwEmail') !== -1 && this.value !== "") {
789
  // Remove any trailing and preceeding space.
790
+ var x = jQuery.trim(this.value);
791
+ if (!isEmail(x)) {
792
+ qmnDisplayError(error_messages.email_error_text, jQuery(this), quiz_form_id);
793
  result = false;
794
  }
795
  /**
796
  * Validate email from allowed domains.
797
  */
798
+ var domains = jQuery(this).attr('data-domains');
799
+ if ('undefined' != typeof domains) {
800
+ if (!isValidDomains(x, domains.split(","))) {
801
+ qmnDisplayError(error_messages.email_error_text, jQuery(this), quiz_form_id);
802
  result = false;
803
  }
804
  }
805
  }
806
+ if (jQuery(this).attr('class').indexOf('mlwUrl') !== -1 && this.value !== "") {
807
  // Remove any trailing and preceeding space.
808
+ if (!isUrlValid(jQuery.trim(this.value))) {
809
+ qmnDisplayError(error_messages.url_error_text, jQuery(this), quiz_form_id);
810
  result = false;
811
  }
812
  }
813
+ if (jQuery(this).attr('class').indexOf('mlwMinLength') !== -1 && this.value !== "") {
814
  // Remove any trailing and preceeding space.
815
+ if (jQuery.trim(this.value).length < jQuery(this).attr('minlength')) {
816
  var minlength_error = error_messages.minlength_error_text;
817
+ minlength_error = minlength_error.replace('%minlength%', jQuery(this).attr('minlength'));
818
+ qmnDisplayError(minlength_error, jQuery(this), quiz_form_id);
819
  result = false;
820
  }
821
  }
822
+ if (jQuery(this).attr('class').indexOf('mlwMaxLength') !== -1 && this.value !== "") {
823
  // Remove any trailing and preceeding space.
824
+ if (jQuery.trim(this.value).length > jQuery(this).attr('maxlength')) {
825
  var maxlength_error = error_messages.maxlength_error_text;
826
+ maxlength_error = maxlength_error.replace('%maxlength%', jQuery(this).attr('maxlength'));
827
+ qmnDisplayError(maxlength_error, jQuery(this), quiz_form_id);
828
  result = false;
829
  }
830
  }
912
  var $container = jQuery('#' + quiz_form_id).closest('.qmn_quiz_container');
913
  var result = qmnValidation('#' + quiz_form_id + ' *', quiz_form_id);
914
  if (!result) { return result; }
915
+
916
  /**
917
  * Update Timer in MS
918
  */
919
+ var timer_ms = jQuery('#' + quiz_form_id).find(".qsm-quiz-container-" + quiz_id + " input[name='timer_ms']").val();
920
  var new_timer_ms = qsmTimeInMS();
921
+ jQuery('#' + quiz_form_id).find(".qsm-quiz-container-" + quiz_id + " input[name='timer_ms']").val(Math.abs(new_timer_ms - timer_ms));
922
 
923
  jQuery('.mlw_qmn_quiz input:radio').attr('disabled', false);
924
  jQuery('.mlw_qmn_quiz input:checkbox').attr('disabled', false);
933
  fd.append(input.name, input.value);
934
  });
935
  fd.append("action", 'qmn_process_quiz');
936
+ fd.append("nonce", qmn_ajax_object.security);
937
+ fd.append("currentuserTime", Math.round(new Date().getTime() / 1000));
938
+ fd.append("currentuserTimeZone", Intl.DateTimeFormat().resolvedOptions().timeZone);
939
 
940
 
941
  qsmEndTimeTakenTimer(quizID);
955
  processData: false,
956
  type: 'POST',
957
  success: function (response) {
958
+ response = JSON.parse(response);
959
  if (window.qsm_results_data === undefined) {
960
  window.qsm_results_data = new Object();
961
  }
962
+ window.qsm_results_data[quizID] = {
963
+ 'save_response': response.result_status['save_response'],
964
+ 'id': response.result_status['id']
965
  };
966
 
967
+ if (response.quizExpired) {
968
  MicroModal.show('modal-4');
969
  return false;
970
+ } else {
971
  qmnDisplayResults(response, quiz_form_id, $container);
972
+ // run MathJax on the new content
973
+ if (1 != qmn_quiz_data[quiz_id].disable_mathjax) {
974
+ MathJax.typesetPromise();
975
+ }
976
  jQuery(document).trigger('qsm_after_quiz_submit_load_chart');
977
  jQuery(document).trigger('qsm_after_quiz_submit', [quiz_form_id]);
978
+ jQuery(".hide").parent().css('display', 'none');
979
  }
980
  }
981
  });
987
  var loader_html = '<div class="qsm_quiz_processing_box">';
988
  loader_html += '<div class="qsm-spinner-loader qsm_quiz_processing_loader"></div>';
989
  if (qmn_quiz_data[quiz_id].hasOwnProperty('quiz_processing_message') && qmn_quiz_data[quiz_id].quiz_processing_message != '') {
990
+ loader_html += '<div class="qsm_quiz_processing_message">' + qmn_quiz_data[quiz_id].quiz_processing_message + '</div>';
991
  }
992
  loader_html += '</div>';
993
  $container.empty();
1004
  $container.append('<div class="qmn_results_page"></div>');
1005
  $container.find('.qmn_results_page').html(results.display);
1006
  qsmScrollTo($container);
 
 
1007
  // Fires after result is populates via ajax
1008
  jQuery(document).trigger('qsm_after_display_result', [results, quiz_form_id, $container]);
1009
  }
1040
  jQuery('#quizForm' + qmn_quiz_data[key].quiz_id + ' .qmn_quiz_radio').change(function () {
1041
  var radio_group = jQuery(this).attr('name');
1042
  jQuery('input[type=radio][name=' + radio_group + ']').prop('disabled', true);
1043
+ let radio_value = jQuery(this).val();
1044
  let disableAnswer = {};
1045
+ if (localStorage.getItem("disable_answer")) {
1046
  disableAnswer = JSON.parse(localStorage.getItem("disable_answer"));
1047
  }
1048
+ if (!disableAnswer[key]) {
1049
+ disableAnswer[key] = [];
1050
  }
1051
  let disabledQuestions = disableAnswer[key].map(element => element[0]);
1052
+ if (!disabledQuestions.includes(radio_group)) {
1053
  disableAnswer[key].push([radio_group, radio_value]);
1054
  }
1055
+ localStorage.setItem("disable_answer", JSON.stringify(disableAnswer));
1056
  });
1057
 
1058
+ if (localStorage.getItem("disable_answer")) {
1059
  let disabledAnswer = JSON.parse(localStorage.getItem("disable_answer"));
1060
+ if (disabledAnswer[key]) {
1061
  disabledAnswer[key].forEach(element => {
1062
+ let element1 = element[1].replaceAll(' ', '-');
1063
+ jQuery('#' + element[0] + '-' + element1 + ' input').prop('checked', true).trigger('change');
1064
  });
1065
  }
1066
  }
1067
+ jQuery(document).on('qsm_after_quiz_submit', function (event, quiz_form_id) {
1068
  event.preventDefault();
1069
+ if (localStorage.getItem("disable_answer")) {
1070
  let disabledAnswer2 = JSON.parse(localStorage.getItem("disable_answer"));
1071
+ if (disabledAnswer2[key]) {
1072
  delete disabledAnswer2[key];
1073
+ localStorage.setItem("disable_answer", JSON.stringify(disabledAnswer2));
1074
+ }
1075
  }
1076
+
1077
  });
1078
  }
1079
 
1145
  if (go_to_top == 1 && qmn_quiz_data[quiz_id].disable_scroll_next_previous_click != 1) {
1146
  qsmScrollTo($container);
1147
  }
1148
+ if (!qmn_quiz_data[quiz_id].hasOwnProperty('first_page') || !qmn_quiz_data[quiz_id].first_page) {
1149
+ if (slide_number == 0 && page_number == 0) {
1150
+ $container.find(".qsm-auto-page-row.quiz_begin").hide();
1151
+ $container.find('.qsm-auto-page-row.qsm-apc-' + (parseInt(page_number) + 1)).show();
1152
+ $container.find('.slide_number_hidden').val(parseInt(slide_number) + 1);
1153
+ $container.find('.current_page_hidden').val(parseInt(page_number) + 2);
1154
+ $container.find(".mlw_previous").hide();
1155
+ }
1156
  }
1157
  //Show the page counts
1158
  if (page_number > 0 && jQuery(quiz_form_id).closest('.qmn_quiz_container').find('.pages_count').length > 0) {
1198
  qsmScrollTo($container);
1199
  }
1200
  if (qmn_quiz_data[quiz_id].disable_first_page == 1) {
1201
+ if (page_number == 3) {
1202
+ $container.find(".qsm-auto-page-row.quiz_begin").hide();
1203
+ $container.find(".mlw_previous").hide();
1204
+ }
1205
  }
1206
  if (page_number > 0 && jQuery(quiz_form_id).closest('.qmn_quiz_container').find('.pages_count').length > 0) {
1207
  var actual_pages = total_pages - 2;
1317
  jQuery(document).trigger('qsm_init_progressbar_after', [quiz_id, qmn_quiz_data]);
1318
  }
1319
 
1320
+ jQuery(document).on("click", ".qsm-quiz-container-" + quiz_id + " .mlw_next", function (event) {
1321
  event.preventDefault();
1322
  var quiz_id = +jQuery(this).closest('.qmn_quiz_container').find('.qmn_quiz_id').val();
1323
  jQuery(document).trigger('qsm_auto_next_button_click_before', [quiz_id]);
1327
  jQuery(document).trigger('qsm_next_button_click_after', [quiz_id]);
1328
  });
1329
 
1330
+ jQuery(document).on("click", ".qsm-quiz-container-" + quiz_id + " .mlw_previous", function (event) {
1331
  event.preventDefault();
1332
  var quiz_id = +jQuery(this).closest('.qmn_quiz_container').find('.qmn_quiz_id').val();
1333
  qmnPrevSlide(qmn_quiz_data[quiz_id].pagination.amount, 1, '#quizForm' + quiz_id);
1340
  qmnNextSlide(qmn_quiz_data[quiz_id].pagination.amount, 0, '#quizForm' + quiz_id);
1341
  }
1342
 
1343
+ jQuery(document).trigger('qsm_init_pagination_after', [quiz_id, qmn_quiz_data]);
1344
  }
1345
 
1346
  function qmnSocialShare(network, mlw_qmn_social_text, mlw_qmn_title, facebook_id, share_url) {
1362
  return false;
1363
  }
1364
 
1365
+ function maxLengthCheck(object) {
1366
+ if (object.value.length > object.maxLength) {
1367
+ object.value = object.value.slice(0, object.maxLength)
1368
  }
1369
  }
1370
 
1382
  var form = jQuery(this).closest('form')[0];
1383
  var form_id = form.id;
1384
  var recaptcha = jQuery('#' + form_id).find("#qsm_grecaptcha_v3");
1385
+ if (!recaptcha.length) {
1386
  qmnFormSubmit(form_id);
1387
  return false;
1388
  }
1390
  // Proceed reCaptcha v3
1391
  var site_key = jQuery('#' + form_id).find("#qsm_grecaptcha_v3_sitekey").val();
1392
  var submit_action = jQuery('#' + form_id).find("#qsm_grecaptcha_v3_nonce").val();
1393
+ grecaptcha.ready(function () {
1394
+ grecaptcha.execute(site_key, { action: submit_action }).then(function (token) {
1395
  jQuery('#' + form_id).find("#qsm_grecaptcha_v3_response").val(token);
1396
  qmnFormSubmit(form_id);
1397
  });
1415
  //Reload the timer and pagination
1416
  qmnDoInit();
1417
 
1418
+ if (1 != qmn_quiz_data[quiz_id].disable_mathjax) {
1419
+ MathJax.typesetPromise();
1420
+ }
1421
 
1422
  // trigger fired on successfull retake quiz
1423
  jQuery(document).trigger('qsm_retake_quiz', [quiz_id]);
1454
  $this.append('<div style="color: red" class="quick-question-res-p">' + qmn_quiz_data[quizID].quick_result_wrong_answer_text + '</div>')
1455
  $this.append('<div class="qsm-inline-correct-info">' + data.message + '</div>');
1456
  }
1457
+ if (1 != qmn_quiz_data[quizID].disable_mathjax) {
1458
+ MathJax.typesetPromise();
1459
+ }
1460
  },
1461
  error: function (errorThrown) {
1462
  alert(errorThrown);
1466
  });
1467
 
1468
  // Autocomplete off
1469
+ jQuery('.qsm-quiz-container').find('.qmn_quiz_id').each(function () {
1470
  var quizID = jQuery(this).val();
1471
  var $quizForm = QSM.getQuizForm(quizID);
1472
  if (qmn_quiz_data[quizID].form_disable_autofill == 1) {
1473
+ jQuery('#quizForm' + quizID).attr('autocomplete', 'off');
1474
  }
1475
  });
1476
 
1505
  $quizForm.closest('.qmn_quiz_container').find('.qsm-submit-btn').trigger('click');
1506
  }, 1000);
1507
  }
1508
+ if (1 != qmn_quiz_data[quizID].disable_mathjax) {
1509
+ MathJax.typesetPromise();
1510
+ }
1511
  },
1512
  error: function (errorThrown) {
1513
  alert(errorThrown);
1638
 
1639
  // captcha question type
1640
  var mlw_code;
1641
+ jQuery(document).ready(function () {
1642
  let captchaElement = jQuery('#mlw_code_captcha');
1643
+ if (captchaElement.length !== 0) {
1644
  mlw_code = '';
1645
  var mlw_chars = '0123456789ABCDEFGHIJKL!@#$%^&*()MNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
1646
  var mlw_code_length = 5;
1647
+ for (var i = 0; i < mlw_code_length; i++) {
1648
  var rnum = Math.floor(Math.random() * mlw_chars.length);
1649
+ mlw_code += mlw_chars.substring(rnum, rnum + 1);
1650
  }
1651
  var mlw_captchaCTX = document.getElementById('mlw_captcha').getContext('2d');
1652
  mlw_captchaCTX.font = 'normal 24px Verdana';
1653
  mlw_captchaCTX.strokeStyle = '#000000';
1654
+ mlw_captchaCTX.clearRect(0, 0, 100, 50);
1655
+ mlw_captchaCTX.strokeText(mlw_code, 10, 30, 70);
1656
  mlw_captchaCTX.textBaseline = 'middle';
1657
  document.getElementById('mlw_code_captcha').value = mlw_code;
1658
  }
lang/quiz-master-next.pot CHANGED
@@ -1,134 +1,463 @@
1
  # SOME DESCRIPTIVE TITLE.
2
  # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
  # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- #: php/admin/options-page-questions-tab.php:349
7
- #, fuzzy
8
  msgid ""
9
  msgstr ""
10
- "Project-Id-Version: PACKAGE VERSION\n"
11
  "Report-Msgid-Bugs-To: \n"
12
- "POT-Creation-Date: 2021-01-20 10:31+0530\n"
13
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15
- "Language-Team: LANGUAGE <LL@li.org>\n"
16
  "Language: \n"
17
  "MIME-Version: 1.0\n"
18
  "Content-Type: text/plain; charset=CHARSET\n"
19
  "Content-Transfer-Encoding: 8bit\n"
20
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
21
 
22
- #: mlw_quizmaster2.php:214 php/admin/settings-page.php:170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  msgid "Quizzes & Surveys"
24
  msgstr ""
25
 
26
- #: mlw_quizmaster2.php:239 mlw_quizmaster2.php:240 mlw_quizmaster2.php:241
27
- #: php/classes/class-qsm-install.php:51
 
 
28
  msgid "Quiz"
29
  msgstr ""
30
 
31
- #: mlw_quizmaster2.php:242 php/admin/quizzes-page.php:244
32
  msgid "Add New"
33
  msgstr ""
34
 
35
- #: mlw_quizmaster2.php:243
36
  msgid "Add New Quiz"
37
  msgstr ""
38
 
39
- #: mlw_quizmaster2.php:244
40
  msgid "New Quiz"
41
  msgstr ""
42
 
43
- #: mlw_quizmaster2.php:245
44
  msgid "Edit Quiz"
45
  msgstr ""
46
 
47
- #: mlw_quizmaster2.php:246
48
  msgid "View Quiz"
49
  msgstr ""
50
 
51
- #: mlw_quizmaster2.php:247
52
- msgid "All Quizzes"
53
- msgstr ""
54
-
55
- #: mlw_quizmaster2.php:248
56
  msgid "Search Quizzes"
57
  msgstr ""
58
 
59
- #: mlw_quizmaster2.php:249
60
  msgid "Parent Quiz:"
61
  msgstr ""
62
 
63
- #: mlw_quizmaster2.php:250
64
  msgid "No Quiz Found"
65
  msgstr ""
66
 
67
- #: mlw_quizmaster2.php:251
68
  msgid "No Quiz Found In Trash"
69
  msgstr ""
70
 
71
- #: mlw_quizmaster2.php:284
72
- msgid "QSM"
73
  msgstr ""
74
 
75
- #: mlw_quizmaster2.php:285
76
- msgid "Dashboard"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  msgstr ""
78
 
79
- #: mlw_quizmaster2.php:286 php/admin/quizzes-page.php:243
80
- #: php/classes/class-qsm-install.php:1788
81
- msgid "Quizzes/Surveys"
82
  msgstr ""
83
 
84
- #: mlw_quizmaster2.php:288 mlw_quizmaster2.php:291
85
- #: php/admin/addons-page.php:98
 
 
86
  msgid "Settings"
87
  msgstr ""
88
 
89
- #: mlw_quizmaster2.php:289 php/admin/quizzes-page.php:636
90
  msgid "Results"
91
  msgstr ""
92
 
93
- #: mlw_quizmaster2.php:290
94
  msgid "Result Details"
95
  msgstr ""
96
 
97
- #: mlw_quizmaster2.php:292 php/admin/tools-page.php:37
98
  msgid "Tools"
99
  msgstr ""
100
 
101
- #: mlw_quizmaster2.php:293
102
  msgid "Stats"
103
  msgstr ""
104
 
105
- #: mlw_quizmaster2.php:294
106
  msgid "Addon Settings"
107
  msgstr ""
108
 
109
- #: mlw_quizmaster2.php:295
110
  msgid "Get a Free Addon"
111
  msgstr ""
112
 
113
- #: mlw_quizmaster2.php:295
114
  msgid "Get a Free Addon!"
115
  msgstr ""
116
 
 
 
 
 
 
 
 
117
 
118
- #: mlw_quizmaster2.php:296
119
- msgid "Roadmap"
120
  msgstr ""
121
 
122
- #: mlw_quizmaster2.php:297
123
- msgid "About"
 
124
  msgstr ""
125
 
126
- #: mlw_quizmaster2.php:298
127
- msgid "Help"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  msgstr ""
129
 
130
- #: blocks/block.php:49
131
- msgid "Select the quiz"
 
 
 
 
 
 
 
132
  msgstr ""
133
 
134
  #: php/gdpr.php:29
@@ -194,2587 +523,3328 @@ msgstr ""
194
  msgid "Form Responses"
195
  msgstr ""
196
 
197
- #: php/gdpr.php:134
198
  msgid "Form Name"
199
  msgstr ""
200
 
201
- #: php/gdpr.php:138
202
  msgid "Time Submitted"
203
  msgstr ""
204
 
205
- #: php/gdpr.php:142
206
  msgid "Points Earned"
207
  msgstr ""
208
 
209
- #: php/gdpr.php:146
210
  msgid "Score Earned"
211
  msgstr ""
212
 
213
- #: php/gdpr.php:150
214
  msgid "Questions Answered Correctly"
215
  msgstr ""
216
 
217
- #: php/gdpr.php:154
218
  msgid "Total Questions"
219
  msgstr ""
220
 
221
- #: php/gdpr.php:158
222
  msgid "Name Field"
223
  msgstr ""
224
 
225
- #: php/gdpr.php:162
226
  msgid "Business Field"
227
  msgstr ""
228
 
229
- #: php/gdpr.php:166
230
  msgid "Email Field"
231
  msgstr ""
232
 
233
- #: php/gdpr.php:170
234
  msgid "Phone Field"
235
  msgstr ""
236
 
237
- #: php/gdpr.php:174
238
  msgid "User ID"
239
  msgstr ""
240
 
241
- #: php/gdpr.php:178 php/admin/admin-results-page.php:347
 
242
  msgid "IP Address"
243
  msgstr ""
244
 
245
- #: php/gdpr.php:182
246
  msgid "Time to complete form"
247
  msgstr ""
248
 
249
- #: php/gdpr.php:186
250
  msgid "Form comments"
251
  msgstr ""
252
 
253
- #: php/question-types.php:14
254
- msgid "Vertical Multiple Choice"
255
  msgstr ""
256
 
257
- #: php/question-types.php:26
258
  msgid "File Upload"
259
  msgstr ""
260
 
261
- #: php/question-types.php:213
262
  msgid "Date"
263
  msgstr ""
264
 
265
- #: php/question-types.php:285
266
- msgid "Horizontal Multiple Choice"
267
  msgstr ""
268
 
269
- #: php/question-types.php:401
270
  msgid "Drop Down"
271
  msgstr ""
272
 
273
- #: php/question-types.php:427
274
- msgid "Please select your answer"
275
- msgstr ""
276
-
277
- #: php/question-types.php:500
278
  msgid "Short Answer"
279
  msgstr ""
280
 
281
- #: php/question-types.php:578
282
  msgid "Multiple Response"
283
  msgstr ""
284
 
285
- #: php/question-types.php:678
286
  msgid "Paragraph"
287
  msgstr ""
288
 
289
- #: php/question-types.php:762
290
  msgid "Text/HTML Section"
291
  msgstr ""
292
 
293
- #: php/question-types.php:796
294
  msgid "Number"
295
  msgstr ""
296
 
297
- #: php/question-types.php:881
298
  msgid "Opt-in"
299
  msgstr ""
300
 
301
- #: php/question-types.php:926
302
  msgid "Captcha"
303
  msgstr ""
304
 
305
- #: php/question-types.php:985
306
- msgid "Horizontal Multiple Response"
307
  msgstr ""
308
 
309
- #: php/question-types.php:1097
310
  msgid ""
311
  "For fill in the blank types, use %BLANK% to represent where to put the text "
312
  "box in your text."
313
  msgstr ""
314
 
315
- #: php/question-types.php:1102
316
  msgid "Fill In The Blank"
317
  msgstr ""
318
 
319
- #: php/question-types.php:1193
320
  msgid "Polar"
321
  msgstr ""
322
 
323
- #: php/rest-api.php:162 php/rest-api.php:275 php/rest-api.php:302
324
- #: php/rest-api.php:327 php/rest-api.php:354 php/rest-api.php:393
325
- #: php/rest-api.php:451 php/rest-api.php:508 php/rest-api.php:579
 
326
  msgid "User not logged in"
327
  msgstr ""
328
 
329
- #: php/rest-api.php:183 php/admin/admin-dashboard.php:381
330
- #: php/admin/admin-results-page.php:389
331
  msgid "Not Graded"
332
  msgstr ""
333
 
334
- #: php/shortcodes.php:92
 
 
 
 
 
 
 
 
335
  msgid "No quiz found"
336
  msgstr ""
337
 
338
- #: php/template-variables.php:193
 
 
 
 
 
 
 
 
 
 
 
 
339
  msgid "Poll Result"
340
  msgstr ""
341
 
342
- #: php/template-variables.php:249
343
  msgid "Facebbok Share"
344
  msgstr ""
345
 
346
- #: php/template-variables.php:256
347
  msgid "Twitter Share"
348
  msgstr ""
349
 
350
- #: php/template-variables.php:936 php/template-variables.php:945
351
  msgid "No answer provided"
352
  msgstr ""
353
 
354
- #: php/template-variables.php:1060
355
  msgid "No Answer Provided"
356
  msgstr ""
357
 
358
- #: php/admin/about-page.php:29
359
- msgid "Welcome To Quiz And Survey Master (Formerly Quiz Master Next)"
360
  msgstr ""
361
 
362
- #: php/admin/about-page.php:52
363
- msgid "View "
364
  msgstr ""
365
 
366
- #: php/admin/addons-page.php:18 php/admin/addons-page.php:280
367
- msgid "Featured Addons"
368
  msgstr ""
369
 
370
- #: php/admin/addons-page.php:24
371
- msgid "QSM Addon Settings"
372
  msgstr ""
373
 
374
- #: php/admin/addons-page.php:27
375
- msgid "Back to list"
376
  msgstr ""
377
 
378
- #: php/admin/addons-page.php:70 php/admin/addons-page.php:85
379
- msgid "Installed Addons"
380
  msgstr ""
381
 
382
- #: php/admin/addons-page.php:71
383
- msgid "Add Addons"
384
  msgstr ""
385
 
386
- #: php/admin/addons-page.php:74
387
- msgid "Popular Addons"
388
  msgstr ""
389
 
390
- #: php/admin/addons-page.php:75
391
- msgid "On Sale Addons"
392
  msgstr ""
393
 
394
- #: php/admin/addons-page.php:76
395
- msgid "Recently Updated Addons"
396
  msgstr ""
397
 
398
- #: php/admin/addons-page.php:80
399
- msgid "40+ addons available"
400
  msgstr ""
401
 
402
- #: php/admin/addons-page.php:81
403
- msgid "Browse All Addons"
404
  msgstr ""
405
 
406
- #: php/admin/addons-page.php:107
407
- msgid ""
408
- "You have currently not installed any addons. Explore our addons repository "
409
- "with 40+ addons to make your quiz even better."
410
  msgstr ""
411
 
412
- #: php/admin/addons-page.php:139 php/admin/addons-page.php:178
413
- #: php/admin/addons-page.php:220
414
- msgid "Show more"
415
  msgstr ""
416
 
417
- #: php/admin/addons-page.php:144 php/admin/addons-page.php:183
418
- #: php/admin/addons-page.php:225
419
- msgid "Price: "
420
  msgstr ""
421
 
422
- #: php/admin/addons-page.php:145 php/admin/addons-page.php:184
423
- #: php/admin/addons-page.php:226
424
- msgid "Get This Addon"
425
  msgstr ""
426
 
427
- #: php/admin/addons-page.php:247
428
- msgid "SAVE WITH OUR BUNDLES"
429
  msgstr ""
430
 
431
- #: php/admin/addons-page.php:259
432
- msgid "Get now"
433
  msgstr ""
434
 
435
- #: php/admin/addons-page.php:296
436
- msgid "Get Your Free Addon!"
437
  msgstr ""
438
 
439
- #: php/admin/addons-page.php:298
440
- msgid ""
441
- "Wanna get more out of Quiz and Survey Master, but not yet ready to spend the "
442
- "cash? Get one free addon today!"
443
  msgstr ""
444
 
445
- #: php/admin/addons-page.php:310
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  msgid ""
447
  "Getting your addon is dead simple: just subscribe to our newsletter and then "
448
  "you will get the free addon by e-mail. We will not spam you. We usually send "
449
  "out newsletters to talk about new features in "
450
  msgstr ""
451
 
452
- #: php/admin/addons-page.php:310
453
  msgid "Quiz and Survey Master"
454
  msgstr ""
455
 
456
- #: php/admin/addons-page.php:310
457
  msgid ""
458
  " let you know when new or updated addons are being released and provide "
459
  "informative articles that show you how to use "
460
  msgstr ""
461
 
462
- #: php/admin/addons-page.php:310
463
  msgid "Quiz and Survey Master "
464
  msgstr ""
465
 
466
- #: php/admin/addons-page.php:310
467
  msgid "to its full potential. "
468
  msgstr ""
469
 
470
- #: php/admin/addons-page.php:310
471
  msgid "View our privacy policy"
472
  msgstr ""
473
 
474
- #: php/admin/addons-page.php:367
475
  msgid "Your subscription could not be saved. Please try again."
476
  msgstr ""
477
 
478
- #: php/admin/addons-page.php:379
479
  msgid "Your subscription has been successful."
480
  msgstr ""
481
 
482
- #: php/admin/addons-page.php:392
483
  msgid "Enter your email address to subscribe"
484
  msgstr ""
485
 
486
- #: php/admin/addons-page.php:403
487
  msgid "Provide your email address to subscribe. For e.g abc@xyz.com"
488
  msgstr ""
489
 
490
- #: php/admin/addons-page.php:416
491
  msgid "SUBSCRIBE"
492
  msgstr ""
493
 
494
- #: php/admin/addons-page.php:424
495
  msgid "Terms & Privacy policy"
496
  msgstr ""
497
 
498
- #: php/admin/admin-dashboard.php:66
499
  msgid "Welcome"
500
  msgstr ""
501
 
502
- #: php/admin/admin-dashboard.php:110
503
  msgid "QSM Dashboard"
504
  msgstr ""
505
 
506
- #: php/admin/admin-dashboard.php:116
507
  msgid "Dismiss"
508
  msgstr ""
509
 
510
- #: php/admin/admin-dashboard.php:118
511
  msgid "Welcome to Quiz And Survey Master!"
512
  msgstr ""
513
 
514
- #: php/admin/admin-dashboard.php:119
515
  msgid "Formerly Quiz Master Next"
516
  msgstr ""
517
 
518
- #: php/admin/admin-dashboard.php:122
519
  msgid "Get Started"
520
  msgstr ""
521
 
522
- #: php/admin/admin-dashboard.php:123 php/admin/quizzes-page.php:606
523
  msgid "Create New Quiz/Survey"
524
  msgstr ""
525
 
526
- #: php/admin/admin-dashboard.php:125
527
  msgid "Edit previously created quizzes"
528
  msgstr ""
529
 
530
- #: php/admin/admin-dashboard.php:129
531
  msgid "Next Steps"
532
  msgstr ""
533
 
534
- #: php/admin/admin-dashboard.php:131 php/admin/quizzes-page.php:607
535
  msgid "Read Documentation"
536
  msgstr ""
537
 
538
- #: php/admin/admin-dashboard.php:132
539
  msgid "See demos"
540
  msgstr ""
541
 
542
- #: php/admin/admin-dashboard.php:133
543
  msgid "Extend QSM with PRO Addons"
544
  msgstr ""
545
 
546
- #: php/admin/admin-dashboard.php:137
 
 
 
 
547
  msgid "Useful Links"
548
  msgstr ""
549
 
550
- #: php/admin/admin-dashboard.php:139
551
  msgid "Contact Support"
552
  msgstr ""
553
 
554
- #: php/admin/admin-dashboard.php:140
555
  msgid "Github Repository"
556
  msgstr ""
557
 
558
- #: php/admin/admin-dashboard.php:261
 
 
 
 
 
 
 
 
559
  msgid "No settings are found!"
560
  msgstr ""
561
 
562
- #: php/admin/admin-dashboard.php:283
563
  msgid "No addons are found!"
564
  msgstr ""
565
 
566
- #: php/admin/admin-dashboard.php:300 php/admin/admin-dashboard.php:303
567
  msgid "Most Popular Addon this Week"
568
  msgstr ""
569
 
570
- #: php/admin/admin-dashboard.php:322
571
  msgid "SEE ALL ADDONS"
572
  msgstr ""
573
 
574
- #: php/admin/admin-dashboard.php:341 php/admin/admin-dashboard.php:344
575
  msgid "Recently Taken Quizzes"
576
  msgstr ""
577
 
578
- #: php/admin/admin-dashboard.php:370
579
  msgid "Guest"
580
  msgstr ""
581
 
582
- #: php/admin/admin-dashboard.php:372
583
  msgid " took quiz "
584
  msgstr ""
585
 
586
- #: php/admin/admin-dashboard.php:412
587
  msgid " Time to complete "
588
  msgstr ""
589
 
590
- #: php/admin/admin-dashboard.php:431
591
  msgid "See All Results "
592
  msgstr ""
593
 
594
- #: php/admin/admin-dashboard.php:453
595
- msgid "'what's New"
596
- msgstr ""
597
-
598
- #: php/admin/admin-dashboard.php:456
599
- msgid "What's New"
600
  msgstr ""
601
 
602
- #: php/admin/admin-dashboard.php:495
603
  msgid "Changelog"
604
  msgstr ""
605
 
606
- #: php/admin/admin-dashboard.php:498
607
- msgid "Changelog ( "
608
  msgstr ""
609
 
610
- #: php/admin/admin-dashboard.php:525
611
- msgid "View Complete Changelog"
612
  msgstr ""
613
 
614
- #: php/admin/admin-results-details-page.php:26
615
- #: php/admin/admin-results-page.php:21 php/admin/admin-results-page.php:26
616
- #: php/admin/admin-results-page.php:69
617
  msgid "Quiz Results"
618
  msgstr ""
619
 
620
- #: php/admin/admin-results-details-page.php:93
621
  msgid "Back to Results"
622
  msgstr ""
623
 
624
- #: php/admin/admin-results-details-page.php:127
625
  msgid "Name:"
626
  msgstr ""
627
 
628
- #: php/admin/admin-results-details-page.php:128
629
  msgid "Business:"
630
  msgstr ""
631
 
632
- #: php/admin/admin-results-details-page.php:129
633
  msgid "Phone:"
634
  msgstr ""
635
 
636
- #: php/admin/admin-results-details-page.php:130
637
  msgid "Email:"
638
  msgstr ""
639
 
640
- #: php/admin/admin-results-details-page.php:140
641
  msgid "Correct Answers:"
642
  msgstr ""
643
 
644
- #: php/admin/admin-results-details-page.php:141
645
  msgid "Points:"
646
  msgstr ""
647
 
648
- #: php/admin/admin-results-details-page.php:142
649
  msgid "Percentage:"
650
  msgstr ""
651
 
652
- #: php/admin/admin-results-details-page.php:158
653
  msgid "hour"
654
  msgstr ""
655
 
656
- #: php/admin/admin-results-details-page.php:158
657
  msgid "hours"
658
  msgstr ""
659
 
660
- #: php/admin/admin-results-details-page.php:171
661
  msgid "minute"
662
  msgstr ""
663
 
664
- #: php/admin/admin-results-details-page.php:171
665
  msgid "minutes"
666
  msgstr ""
667
 
668
- #: php/admin/admin-results-details-page.php:183
669
  msgid "second"
670
  msgstr ""
671
 
672
- #: php/admin/admin-results-details-page.php:183
673
  msgid "seconds"
674
  msgstr ""
675
 
676
- #: php/admin/admin-results-page.php:108
677
- #: php/classes/class-qmn-quiz-creator.php:305
 
 
 
 
678
  msgid "Unknown error"
679
  msgstr ""
680
 
681
- #: php/admin/admin-results-page.php:110
682
  #, php-format
683
  msgid "There was an error when deleting this result. Error from WordPress: %s"
684
  msgstr ""
685
 
686
- #: php/admin/admin-results-page.php:113
687
  msgid "Your results has been deleted successfully."
688
  msgstr ""
689
 
690
- #: php/admin/admin-results-page.php:248
691
  #, php-format
692
- msgid "One result"
693
  msgid_plural "%s results"
694
  msgstr[0] ""
695
  msgstr[1] ""
696
 
697
- #: php/admin/admin-results-page.php:313 php/admin/admin-results-page.php:323
698
  msgid "Search Results"
699
  msgstr ""
700
 
701
- #: php/admin/admin-results-page.php:315
702
  msgid "Order By"
703
  msgstr ""
704
 
705
- #: php/admin/admin-results-page.php:317 php/admin/admin-results-page.php:336
706
- msgid "Quiz Name"
707
  msgstr ""
708
 
709
- #: php/admin/admin-results-page.php:318
710
- msgid "User Name"
 
711
  msgstr ""
712
 
713
- #: php/admin/admin-results-page.php:319 php/classes/class-qsm-install.php:78
714
- msgid "Points"
715
  msgstr ""
716
 
717
- #: php/admin/admin-results-page.php:320
718
  msgid "Correct Percent"
719
  msgstr ""
720
 
721
- #: php/admin/admin-results-page.php:321
722
- msgid "Default (Time)"
723
- msgstr ""
724
-
725
- #: php/admin/admin-results-page.php:339
726
  msgid "Score"
727
  msgstr ""
728
 
729
- #: php/admin/admin-results-page.php:340
730
  msgid "Time To Complete"
731
  msgstr ""
732
 
733
- #: php/admin/admin-results-page.php:341 php/admin/quiz-options-page.php:177
 
734
  msgid "Name"
735
  msgstr ""
736
 
737
- #: php/admin/admin-results-page.php:342
 
738
  msgid "Business"
739
  msgstr ""
740
 
741
- #: php/admin/admin-results-page.php:343
 
 
742
  msgid "Email"
743
  msgstr ""
744
 
745
- #: php/admin/admin-results-page.php:344
746
  msgid "Phone"
747
  msgstr ""
748
 
749
- #: php/admin/admin-results-page.php:345 php/admin/tools-page.php:185
750
  msgid "User"
751
  msgstr ""
752
 
753
- #: php/admin/admin-results-page.php:346
754
  msgid "Time Taken"
755
  msgstr ""
756
 
757
- #: php/admin/admin-results-page.php:420
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
  msgid "No record found."
759
  msgstr ""
760
 
761
- #: php/admin/admin-results-page.php:429
762
  msgid "Are you sure you want to delete these results?"
763
  msgstr ""
764
 
765
- #: php/admin/admin-results-page.php:435
766
  msgid "Delete Results"
767
  msgstr ""
768
 
 
 
 
 
 
 
 
 
 
 
 
769
  #: php/admin/dashboard-widgets.php:16
770
  msgid "Quiz And Survey Master Snapshot"
771
  msgstr ""
772
 
773
- #: php/admin/dashboard-widgets.php:180
774
  msgid "quizzes taken today"
775
  msgstr ""
776
 
777
- #: php/admin/dashboard-widgets.php:199
778
  msgid "quizzes taken last 7 days"
779
  msgstr ""
780
 
781
- #: php/admin/dashboard-widgets.php:218
782
  msgid "quizzes taken last 30 days"
783
  msgstr ""
784
 
785
- #: php/admin/dashboard-widgets.php:237
786
  msgid "quizzes taken last 120 days"
787
  msgstr ""
788
 
789
- #: php/admin/dashboard-widgets.php:256
790
  msgid "total active quizzes"
791
  msgstr ""
792
 
793
- #: php/admin/dashboard-widgets.php:262
794
  msgid "total active questions"
795
  msgstr ""
796
 
797
- #: php/admin/dashboard-widgets.php:268
798
  msgid "most popular quiz"
799
  msgstr ""
800
 
801
- #: php/admin/dashboard-widgets.php:274
802
  msgid "least popular quiz"
803
  msgstr ""
804
 
805
- #: php/admin/functions.php:8
806
  msgid "Something went wrong"
807
  msgstr ""
808
 
809
- #: php/admin/functions.php:185 php/admin/options-page-contact-tab.php:52
810
- #: php/admin/options-page-email-tab.php:51
811
- #: php/admin/options-page-option-tab.php:28
812
- #: php/admin/options-page-questions-tab.php:278
813
- #: php/admin/options-page-text-tab.php:30
814
- #: php/classes/class-qsm-install.php:1801
815
  msgid "View Documentation"
816
  msgstr ""
817
 
818
- #: php/admin/functions.php:277
819
  msgid "+ Add New Category"
820
  msgstr ""
821
 
822
- #: php/admin/functions.php:350
 
 
 
 
 
 
 
 
823
  msgid "Create New Quiz Or Survey"
824
  msgstr ""
825
 
826
- #: php/admin/functions.php:357
827
- msgid "Start from scratch"
828
  msgstr ""
829
 
830
- #: php/admin/functions.php:389
831
- msgid "Simple Quiz"
 
 
832
  msgstr ""
833
 
834
- #: php/admin/functions.php:426
835
- msgid "Time Based Quiz"
836
  msgstr ""
837
 
838
- #: php/admin/functions.php:459 php/classes/class-qsm-install.php:55
839
- msgid "Survey"
840
  msgstr ""
841
 
842
- #: php/admin/functions.php:505
843
- msgid "Enter quiz name here"
844
  msgstr ""
845
 
846
- #: php/admin/functions.php:507
847
- msgid "Select Template"
848
  msgstr ""
849
 
850
- #: php/admin/functions.php:542
851
- msgid "Quiz Settings"
852
  msgstr ""
853
 
854
- #: php/admin/functions.php:544
855
- msgid "Recommended Addons"
856
  msgstr ""
857
 
858
- #: php/admin/functions.php:551
859
- msgid "Create Quiz"
860
  msgstr ""
861
 
862
- #: php/admin/functions.php:552 php/admin/quizzes-page.php:496
863
- #: php/admin/quizzes-page.php:524 php/admin/quizzes-page.php:551
864
- #: php/admin/quizzes-page.php:570
865
- #: php/shortcodes.php:252,269
866
- msgid "Cancel"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
867
  msgstr ""
868
 
869
- #: php/admin/functions.php:566
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
870
  msgid "Score for the quiz when using points"
871
  msgstr ""
872
 
873
- #: php/admin/functions.php:567
874
  msgid "Maximum possible points one can score"
875
  msgstr ""
876
 
877
- #: php/admin/functions.php:568
 
 
 
 
878
  msgid "The average amount of points user had per question"
879
  msgstr ""
880
 
881
- #: php/admin/functions.php:569
882
  msgid "The number of correct answers the user had"
883
  msgstr ""
884
 
885
- #: php/admin/functions.php:570
886
  msgid "The number of incorrect answers the user had"
887
  msgstr ""
888
 
889
- #: php/admin/functions.php:571
890
  msgid "The number of questions are attempted"
891
  msgstr ""
892
 
893
- #: php/admin/functions.php:572
894
  msgid "The total number of questions in the quiz"
895
  msgstr ""
896
 
897
- #: php/admin/functions.php:573
898
  msgid "Score for the quiz when using correct answers"
899
  msgstr ""
900
 
901
- #: php/admin/functions.php:574
902
  msgid "The name the user entered before the quiz"
903
  msgstr ""
904
 
905
- #: php/admin/functions.php:575
906
  msgid "The full name of user with first name and last name"
907
  msgstr ""
908
 
909
- #: php/admin/functions.php:576
910
  msgid "The business the user entered before the quiz"
911
  msgstr ""
912
 
913
- #: php/admin/functions.php:577
914
  msgid "The phone number the user entered before the quiz"
915
  msgstr ""
916
 
917
- #: php/admin/functions.php:578
918
  msgid "The email the user entered before the quiz"
919
  msgstr ""
920
 
921
- #: php/admin/functions.php:579
922
  msgid "The name of the quiz"
923
  msgstr ""
924
 
925
- #: php/admin/functions.php:580
926
  msgid "The link of the quiz"
927
  msgstr ""
928
 
929
- #: php/admin/functions.php:581
930
  msgid ""
931
  "Shows the question, the answer the user provided, and the correct answer"
932
  msgstr ""
933
 
934
- #: php/admin/functions.php:582
935
  msgid "The comments the user entered into comment box if enabled"
936
  msgstr ""
937
 
938
- #: php/admin/functions.php:583
939
  msgid "The amount of time user spent on quiz in seconds"
940
  msgstr ""
941
 
942
- #: php/admin/functions.php:584
943
- msgid "The amount of time user spent on quiz in minutes"
 
 
 
 
 
 
 
 
944
  msgstr ""
945
 
946
- #: php/admin/functions.php:585
947
  msgid "X: Category name - The amount of points a specific category earned."
948
  msgstr ""
949
 
950
- #: php/admin/functions.php:586
951
  msgid "X: Category name - The score a specific category earned."
952
  msgstr ""
953
 
954
- #: php/admin/functions.php:587
955
  msgid "The average points from all categories."
956
  msgstr ""
957
 
958
- #: php/admin/functions.php:588
959
  msgid "The average score from all categories."
960
  msgstr ""
961
 
962
- #: php/admin/functions.php:589
963
- msgid "The question that the user answered"
964
  msgstr ""
965
 
966
- #: php/admin/functions.php:590
967
- msgid "The answer the user gave for the question"
968
  msgstr ""
969
 
970
- #: php/admin/functions.php:591
971
- msgid "The answer the user gave for the question with default design"
972
  msgstr ""
973
 
974
- #: php/admin/functions.php:592
975
- msgid "The correct answer for the question"
976
  msgstr ""
977
 
978
- #: php/admin/functions.php:593
979
- msgid "The comments the user provided in the comment field for the question"
 
 
980
  msgstr ""
981
 
982
- #: php/admin/functions.php:594
983
- msgid "Reason why the correct answer is the correct answer"
 
984
  msgstr ""
985
 
986
- #: php/admin/functions.php:595
987
- msgid "The Current Date"
988
  msgstr ""
989
 
990
- #: php/admin/functions.php:596
991
- msgid "Point Score of the question"
992
  msgstr ""
993
 
994
- #: php/admin/functions.php:597
995
- msgid "Maximum points of the question"
996
  msgstr ""
997
 
998
- #: php/admin/functions.php:598
999
- msgid "Displays button to share on Facebook."
1000
  msgstr ""
1001
 
1002
- #: php/admin/functions.php:599
1003
- msgid "Displays button to share on Twitter."
1004
  msgstr ""
1005
 
1006
- #: php/admin/functions.php:600
1007
- msgid "The link of the result page."
 
1008
  msgstr ""
1009
 
1010
- #: php/admin/help-page.php:26
1011
- msgid "Need Help?"
1012
  msgstr ""
1013
 
1014
- #: php/admin/help-page.php:27
1015
- msgid "System Info"
1016
  msgstr ""
1017
 
1018
- #: php/admin/help-page.php:30
1019
- msgid "Help Page"
1020
  msgstr ""
1021
 
1022
- #: php/admin/help-page.php:54
1023
- msgid "Need help with the plugin? Try any of the following:"
 
1024
  msgstr ""
1025
 
1026
- #: php/admin/help-page.php:92
1027
- msgid "Site Information"
1028
  msgstr ""
1029
 
1030
- #: php/admin/help-page.php:93
1031
- msgid "Site URL:"
1032
  msgstr ""
1033
 
1034
- #: php/admin/help-page.php:94
1035
- msgid "Home URL:"
1036
  msgstr ""
1037
 
1038
- #: php/admin/help-page.php:95
1039
- msgid "Multisite: "
1040
  msgstr ""
1041
 
1042
- #: php/admin/help-page.php:97
1043
- msgid "WordPress Information"
1044
  msgstr ""
1045
 
1046
- #: php/admin/help-page.php:98
1047
- msgid "Version: "
1048
  msgstr ""
1049
 
1050
- #: php/admin/help-page.php:99
1051
- msgid "Language: "
1052
  msgstr ""
1053
 
1054
- #: php/admin/help-page.php:100
1055
- msgid "Permalink Structure: "
1056
  msgstr ""
1057
 
1058
- #: php/admin/help-page.php:101
1059
- msgid "Active Theme: "
 
1060
  msgstr ""
1061
 
1062
- #: php/admin/help-page.php:102
1063
- msgid "Parent Theme: "
1064
  msgstr ""
1065
 
1066
- #: php/admin/help-page.php:103
1067
- msgid "Debug Mode: "
1068
  msgstr ""
1069
 
1070
- #: php/admin/help-page.php:104
1071
- msgid "Memory Limit: "
1072
  msgstr ""
1073
 
1074
- #: php/admin/help-page.php:106
1075
- msgid "Plugins Information"
1076
  msgstr ""
1077
 
1078
- #: php/admin/help-page.php:109
1079
- msgid "Must Use"
1080
  msgstr ""
1081
 
1082
- #: php/admin/help-page.php:114
1083
- msgid "Active"
1084
  msgstr ""
1085
 
1086
- #: php/admin/help-page.php:123
1087
- msgid "Inactive"
 
1088
  msgstr ""
1089
 
1090
- #: php/admin/help-page.php:131
1091
- msgid "Server Information"
1092
  msgstr ""
1093
 
1094
- #: php/admin/help-page.php:132
1095
- msgid "PHP : "
1096
  msgstr ""
1097
 
1098
- #: php/admin/help-page.php:133
1099
- msgid "MySQL : "
1100
  msgstr ""
1101
 
1102
- #: php/admin/help-page.php:134
1103
- msgid "Webserver : "
 
1104
  msgstr ""
1105
 
1106
- #: php/admin/help-page.php:143
1107
- msgid "QSM Information"
1108
  msgstr ""
1109
 
1110
- #: php/admin/help-page.php:144
1111
- msgid "Initial Version : "
 
1112
  msgstr ""
1113
 
1114
- #: php/admin/help-page.php:145
1115
- msgid "Current Version : "
1116
  msgstr ""
1117
 
1118
- #: php/admin/help-page.php:146
1119
- msgid "Total Quizzes : "
1120
  msgstr ""
1121
 
1122
- #: php/admin/help-page.php:147
1123
- msgid "Total Active Quizzes : "
1124
  msgstr ""
1125
 
1126
- #: php/admin/help-page.php:148
1127
- msgid "Total Questions : "
1128
  msgstr ""
1129
 
1130
- #: php/admin/help-page.php:149
1131
- msgid "Total Active Questions : "
1132
  msgstr ""
1133
 
1134
- #: php/admin/help-page.php:150
1135
- msgid "Total Results : "
1136
  msgstr ""
1137
 
1138
- #: php/admin/help-page.php:151
1139
- msgid "Total Active Results : "
1140
  msgstr ""
1141
 
1142
- #: php/admin/help-page.php:153
1143
- msgid "QSM Recent Logs"
1144
  msgstr ""
1145
 
1146
- #: php/admin/help-page.php:160
1147
- msgid "No recent logs"
1148
  msgstr ""
1149
 
1150
- #: php/admin/options-page-contact-tab.php:14
1151
- #: php/admin/options-page-contact-tab.php:51
1152
- msgid "Contact"
1153
  msgstr ""
1154
 
1155
- #: php/admin/options-page-contact-tab.php:54
1156
- msgid "Save Contact Fields"
 
1157
  msgstr ""
1158
 
1159
- #: php/admin/options-page-contact-tab.php:56
1160
- msgid "Add New Field"
 
1161
  msgstr ""
1162
 
1163
- #: php/admin/options-page-email-tab.php:20
1164
- msgid "Emails"
 
1165
  msgstr ""
1166
 
1167
- #: php/admin/options-page-email-tab.php:48
1168
- #: php/admin/options-page-email-tab.php:53
1169
- msgid "Save Emails"
 
 
 
1170
  msgstr ""
1171
 
1172
- #: php/admin/options-page-email-tab.php:49
1173
- #: php/admin/options-page-email-tab.php:54
1174
- msgid "Add New Email"
 
1175
  msgstr ""
1176
 
1177
- #: php/admin/options-page-email-tab.php:50
1178
- #: php/admin/options-page-results-page-tab.php:46
1179
- msgid "Insert Template Variables"
1180
  msgstr ""
1181
 
1182
- #: php/admin/options-page-email-tab.php:71
1183
- #: php/admin/options-page-results-page-tab.php:67
 
 
 
 
 
 
 
 
 
 
1184
  msgid "When..."
1185
  msgstr ""
1186
 
1187
- #: php/admin/options-page-email-tab.php:72
1188
  msgid ""
1189
  "Set conditions for when this email should be sent. Leave empty to set this "
1190
  "as an email that is always sent."
1191
  msgstr ""
1192
 
1193
- #: php/admin/options-page-email-tab.php:77
1194
- #: php/admin/options-page-results-page-tab.php:73
1195
  msgid "Add additional condition"
1196
  msgstr ""
1197
 
1198
- #: php/admin/options-page-email-tab.php:81
1199
  msgid "...Send"
1200
  msgstr ""
1201
 
1202
- #: php/admin/options-page-email-tab.php:82
1203
  msgid "Create the email that should be sent when the conditions are met."
1204
  msgstr ""
1205
 
1206
- #: php/admin/options-page-email-tab.php:84
1207
  msgid "Who to send the email to? Put %USER_EMAIL% to send to user"
1208
  msgstr ""
1209
 
1210
- #: php/admin/options-page-email-tab.php:86
1211
  msgid "Email Subject"
1212
  msgstr ""
1213
 
1214
- #: php/admin/options-page-email-tab.php:88
1215
  msgid "Email Content"
1216
  msgstr ""
1217
 
1218
- #: php/admin/options-page-email-tab.php:100
1219
- #: php/admin/options-page-results-page-tab.php:92
 
 
 
 
 
 
 
 
 
 
1220
  msgid "Total points earned"
1221
  msgstr ""
1222
 
1223
- #: php/admin/options-page-email-tab.php:101
1224
- #: php/admin/options-page-results-page-tab.php:93
1225
  msgid "Correct score percentage"
1226
  msgstr ""
1227
 
1228
- #: php/admin/options-page-email-tab.php:105
1229
- #: php/admin/options-page-results-page-tab.php:97
1230
  msgid "is equal to"
1231
  msgstr ""
1232
 
1233
- #: php/admin/options-page-email-tab.php:106
1234
- #: php/admin/options-page-results-page-tab.php:98
1235
  msgid "is not equal to"
1236
  msgstr ""
1237
 
1238
- #: php/admin/options-page-email-tab.php:107
1239
- #: php/admin/options-page-results-page-tab.php:99
1240
  msgid "is greater than or equal to"
1241
  msgstr ""
1242
 
1243
- #: php/admin/options-page-email-tab.php:108
1244
- #: php/admin/options-page-results-page-tab.php:100
1245
  msgid "is greater than"
1246
  msgstr ""
1247
 
1248
- #: php/admin/options-page-email-tab.php:109
1249
- #: php/admin/options-page-results-page-tab.php:101
1250
  msgid "is less than or equal to"
1251
  msgstr ""
1252
 
1253
- #: php/admin/options-page-email-tab.php:110
1254
- #: php/admin/options-page-results-page-tab.php:102
1255
  msgid "is less than"
1256
  msgstr ""
1257
 
1258
- #: php/admin/options-page-email-tab.php:123
1259
- #: php/admin/options-page-results-page-tab.php:113
1260
- #: php/admin/options-page-text-tab.php:120
1261
- msgid "Template Variables"
1262
- msgstr ""
1263
-
1264
- #: php/admin/options-page-email-tab.php:125
1265
- #: php/admin/options-page-results-page-tab.php:115
1266
- msgid ""
1267
- "Use these dynamic variables to customize your quiz or survey. Just copy and "
1268
- "paste one or more variables into the content templates and these will be "
1269
- "replaced by actual values when user takes a quiz."
1270
- msgstr ""
1271
-
1272
- #: php/admin/options-page-email-tab.php:126
1273
- #: php/admin/options-page-results-page-tab.php:116
1274
- msgid "Note: "
1275
- msgstr ""
1276
-
1277
- #: php/admin/options-page-email-tab.php:127
1278
- #: php/admin/options-page-results-page-tab.php:117
1279
- msgid "Always use uppercase while using these variables."
1280
- msgstr ""
1281
-
1282
- #: php/admin/options-page-email-tab.php:134
1283
- #: php/admin/options-page-email-tab.php:135
1284
- #: php/admin/options-page-results-page-tab.php:124
1285
- #: php/admin/options-page-results-page-tab.php:125
1286
- msgid ""
1287
- "Value user entered into contact field. X is # of contact field. For example, "
1288
- "first contact field would be %CONTACT_1%"
1289
- msgstr ""
1290
-
1291
- #: php/admin/options-page-email-tab.php:136
1292
- #: php/admin/options-page-results-page-tab.php:131
1293
- msgid "X = Question ID. It will show result of particular question."
1294
- msgstr ""
1295
-
1296
- #: php/admin/options-page-email-tab.php:137
1297
- msgid "Shows the question, the answer provided by user, and the correct answer"
1298
- msgstr ""
1299
-
1300
- #: php/admin/options-page-email-tab.php:140
1301
- #: php/admin/options-page-results-page-tab.php:128
1302
- msgid ""
1303
- "X: Category name - The average amount of points a specific category earned."
1304
- msgstr ""
1305
-
1306
- #: php/admin/options-page-email-tab.php:167
1307
- #: php/admin/options-page-results-page-tab.php:156
1308
- msgid "Close [Esc]"
1309
- msgstr ""
1310
-
1311
  #: php/admin/options-page-option-tab.php:14
1312
  msgid "Options"
1313
  msgstr ""
1314
 
1315
- #: php/admin/options-page-questions-tab.php:19
1316
- #: php/admin/quiz-options-page.php:41
1317
  msgid "Questions"
1318
  msgstr ""
1319
 
1320
- #: php/admin/options-page-questions-tab.php:59
1321
  msgid "Answer"
1322
  msgstr ""
1323
 
1324
- #: php/admin/options-page-questions-tab.php:68
1325
- msgid "Less Description"
1326
- msgstr ""
1327
-
1328
- #: php/admin/options-page-questions-tab.php:69
1329
- #: php/admin/options-page-questions-tab.php:165
1330
- msgid "Add Description"
1331
- msgstr ""
1332
-
1333
- #: php/admin/options-page-questions-tab.php:90
1334
  msgid ""
1335
  "This quiz has the \"How many questions per page would you like?\" option "
1336
  "enabled. The pages below will not be used while that option is enabled. To "
1337
  "turn off, go to the \"Options\" tab and set that option to 0."
1338
  msgstr ""
1339
 
1340
- #: php/admin/options-page-questions-tab.php:98
1341
  msgid ""
1342
  "This quiz has the \"How many questions should be loaded for quiz?\" option "
1343
  "enabled. The pages below will not be used while that option is enabled. To "
1344
  "turn off, go to the \"Options\" tab and set that option to 0."
1345
  msgstr ""
1346
 
1347
- #: php/admin/options-page-questions-tab.php:106
1348
  msgid ""
1349
  "This quiz has the \"Are the questions random?\" option enabled. The pages "
1350
  "below will not be used while that option is enabled. To turn off, go to the "
1351
  "\"Options\" tab and set that option to \"No\"."
1352
  msgstr ""
1353
 
1354
- #: php/admin/options-page-questions-tab.php:114
1355
  msgid "Total Questions:"
1356
  msgstr ""
1357
 
1358
- #: php/admin/options-page-questions-tab.php:118
1359
  msgid "Search Questions"
1360
  msgstr ""
1361
 
1362
- #: php/admin/options-page-questions-tab.php:124
1363
  msgid "Create New Page"
1364
  msgstr ""
1365
 
1366
- #: php/admin/options-page-questions-tab.php:125
1367
  msgid "Save Questions and Pages"
1368
  msgstr ""
1369
 
1370
- #: php/admin/options-page-questions-tab.php:134
1371
- #: php/admin/options-page-questions-tab.php:508
1372
- msgid "Add Question From Question Bank"
1373
  msgstr ""
1374
 
1375
- #: php/admin/options-page-questions-tab.php:154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1376
  msgid "Edit Question"
1377
  msgstr ""
1378
 
1379
- #: php/admin/options-page-questions-tab.php:163
1380
  msgid "Type your question here"
1381
  msgstr ""
1382
 
1383
- #: php/admin/options-page-questions-tab.php:167
 
 
 
 
 
 
 
 
1384
  msgid "Add your description here"
1385
  msgstr ""
1386
 
1387
- #: php/admin/options-page-questions-tab.php:174
1388
  msgid ""
1389
  "For this question type, users will see a file upload field on front end."
1390
  msgstr ""
1391
 
1392
- #: php/admin/options-page-questions-tab.php:178
1393
  msgid "Use %BLANK% variable in the description field to display input boxes."
1394
  msgstr ""
1395
 
1396
- #: php/admin/options-page-questions-tab.php:182
1397
  msgid "For this question type, users will see a date input field on front end."
1398
  msgstr ""
1399
 
1400
- #: php/admin/options-page-questions-tab.php:186
1401
  msgid ""
1402
  "For this question type, users will see a standard input box on front end."
1403
  msgstr ""
1404
 
1405
- #: php/admin/options-page-questions-tab.php:190
1406
  msgid ""
1407
  "For this question type, users will see a standard textarea input box on "
1408
  "front end."
1409
  msgstr ""
1410
 
1411
- #: php/admin/options-page-questions-tab.php:194
1412
- msgid "Displays a simple section on front end."
1413
  msgstr ""
1414
 
1415
- #: php/admin/options-page-questions-tab.php:198
1416
  msgid ""
1417
  "For this question type, users will see an input box which accepts only "
1418
  "number values on front end."
1419
  msgstr ""
1420
 
1421
- #: php/admin/options-page-questions-tab.php:202
1422
  msgid ""
1423
  "For this question type, users will see a checkbox on front end. The text in "
1424
  "description field will act like it's label."
1425
  msgstr ""
1426
 
1427
- #: php/admin/options-page-questions-tab.php:206
1428
  msgid "For this question type, users will see a Captcha field on front end."
1429
  msgstr ""
1430
 
1431
- #: php/admin/options-page-questions-tab.php:210
1432
  msgid "Use points based grading system for Polar questions."
1433
  msgstr ""
1434
 
1435
- #: php/admin/options-page-questions-tab.php:233
1436
- msgid "Answers"
1437
- msgstr ""
1438
-
1439
- #: php/admin/options-page-questions-tab.php:238
1440
- #: php/admin/options-page-questions-tab.php:563
1441
  msgid "Correct"
1442
  msgstr ""
1443
 
1444
- #: php/admin/options-page-questions-tab.php:243
1445
  msgid "Add New Answer!"
1446
  msgstr ""
1447
 
1448
- #: php/admin/options-page-questions-tab.php:249
1449
  msgid "Correct Answer Info"
1450
  msgstr ""
1451
 
1452
- #: php/admin/options-page-questions-tab.php:267
1453
- msgid "Publish"
1454
  msgstr ""
1455
 
1456
- #: php/admin/options-page-questions-tab.php:275
1457
- msgid "Question Type"
1458
  msgstr ""
1459
 
1460
- #: php/admin/options-page-questions-tab.php:291
1461
- msgid "How to use this option?"
1462
  msgstr ""
1463
 
1464
- #: php/admin/options-page-questions-tab.php:297
1465
- msgid "Answers Type"
1466
  msgstr ""
1467
 
1468
- #: php/admin/options-page-questions-tab.php:301
1469
- msgid "Text Answers"
1470
  msgstr ""
1471
 
1472
- #: php/admin/options-page-questions-tab.php:302
1473
- msgid "Rich Answers"
1474
  msgstr ""
1475
 
1476
- #: php/admin/options-page-questions-tab.php:310
1477
- msgid "Required?"
1478
  msgstr ""
1479
 
1480
- #: php/admin/options-page-questions-tab.php:315
1481
- #: php/admin/options-page-questions-tab.php:396
1482
- #: php/admin/options-page-questions-tab.php:484
1483
- #: php/admin/settings-page.php:264 php/classes/class-qsm-install.php:115
1484
- #: php/classes/class-qsm-install.php:134 php/classes/class-qsm-install.php:180
1485
- #: php/classes/class-qsm-install.php:198 php/classes/class-qsm-install.php:348
1486
- #: php/classes/class-qsm-install.php:369 php/classes/class-qsm-install.php:389
1487
- #: php/classes/class-qsm-install.php:408 php/classes/class-qsm-install.php:428
1488
- #: php/classes/class-qsm-install.php:449 php/classes/class-qsm-install.php:470
1489
- #: php/classes/class-qsm-install.php:489 php/classes/class-qsm-install.php:508
1490
- #: php/classes/class-qsm-install.php:552 php/classes/class-qsm-install.php:572
1491
- #: php/classes/class-qsm-install.php:591 php/classes/class-qsm-install.php:611
1492
- #: php/classes/class-qsm-install.php:630 php/classes/class-qsm-install.php:726
1493
- #: php/classes/class-qsm-install.php:750 php/classes/class-qsm-install.php:774
1494
- #: php/classes/class-qsm-install.php:797 php/classes/class-qsm-install.php:820
1495
- msgid "Yes"
1496
  msgstr ""
1497
 
1498
- #: php/admin/options-page-questions-tab.php:342
1499
- msgid "Select Category"
 
1500
  msgstr ""
1501
 
1502
- #: php/admin/options-page-questions-tab.php:366
1503
- msgid "Advanced Option"
 
1504
  msgstr ""
1505
 
1506
- #: php/admin/options-page-questions-tab.php:372
1507
- msgid "Comment Field"
1508
  msgstr ""
1509
 
1510
- #: php/admin/options-page-questions-tab.php:376
1511
- msgid "Small Text Field"
1512
  msgstr ""
1513
 
1514
- #: php/admin/options-page-questions-tab.php:377
1515
- msgid "Large Text Field"
1516
  msgstr ""
1517
 
1518
- #: php/admin/options-page-questions-tab.php:378
1519
- msgid "None"
1520
  msgstr ""
1521
 
1522
- #: php/admin/options-page-questions-tab.php:384
1523
- msgid "Hint"
1524
  msgstr ""
1525
 
1526
- #: php/admin/options-page-questions-tab.php:391
1527
- msgid "Hide Autofill?"
1528
  msgstr ""
1529
 
1530
- #: php/admin/options-page-questions-tab.php:395
1531
- #: php/admin/options-page-questions-tab.php:483
1532
- #: php/admin/settings-page.php:269 php/classes/class-qsm-install.php:119
1533
- #: php/classes/class-qsm-install.php:138 php/classes/class-qsm-install.php:184
1534
- #: php/classes/class-qsm-install.php:202 php/classes/class-qsm-install.php:352
1535
- #: php/classes/class-qsm-install.php:373 php/classes/class-qsm-install.php:393
1536
- #: php/classes/class-qsm-install.php:412 php/classes/class-qsm-install.php:432
1537
- #: php/classes/class-qsm-install.php:453 php/classes/class-qsm-install.php:474
1538
- #: php/classes/class-qsm-install.php:493 php/classes/class-qsm-install.php:512
1539
- #: php/classes/class-qsm-install.php:536 php/classes/class-qsm-install.php:556
1540
- #: php/classes/class-qsm-install.php:576 php/classes/class-qsm-install.php:595
1541
- #: php/classes/class-qsm-install.php:615 php/classes/class-qsm-install.php:634
1542
- #: php/classes/class-qsm-install.php:730 php/classes/class-qsm-install.php:746
1543
- #: php/classes/class-qsm-install.php:770 php/classes/class-qsm-install.php:793
1544
- #: php/classes/class-qsm-install.php:816
1545
- msgid "No"
1546
  msgstr ""
1547
 
1548
- #: php/admin/options-page-questions-tab.php:403
1549
- msgid "Limit Text"
1550
  msgstr ""
1551
 
1552
- #: php/admin/options-page-questions-tab.php:411
1553
- msgid "Limit Multiple choice"
1554
  msgstr ""
1555
 
1556
- #: php/admin/options-page-questions-tab.php:419
1557
  msgid "Allow File type"
1558
  msgstr ""
1559
 
1560
- #: php/admin/options-page-questions-tab.php:423
1561
  msgid "Text File"
1562
  msgstr ""
1563
 
1564
- #: php/admin/options-page-questions-tab.php:424
1565
  msgid "Image"
1566
  msgstr ""
1567
 
1568
- #: php/admin/options-page-questions-tab.php:425
1569
  msgid "PDF File"
1570
  msgstr ""
1571
 
1572
- #: php/admin/options-page-questions-tab.php:426
1573
  msgid "Doc File"
1574
  msgstr ""
1575
 
1576
- #: php/admin/options-page-questions-tab.php:427
1577
  msgid "Excel File"
1578
  msgstr ""
1579
 
1580
- #: php/admin/options-page-questions-tab.php:428
1581
  msgid "Video"
1582
  msgstr ""
1583
 
1584
- #: php/admin/options-page-questions-tab.php:435
1585
- msgid "File upload limit ( in MB )"
1586
- msgstr ""
1587
-
1588
- #: php/admin/options-page-questions-tab.php:470
1589
- msgid "Edit Page"
1590
  msgstr ""
1591
 
1592
- #: php/admin/options-page-questions-tab.php:477
1593
- msgid "Page Name"
1594
  msgstr ""
1595
 
1596
- #: php/admin/options-page-questions-tab.php:481
1597
- msgid "Hide Previous Button?"
1598
  msgstr ""
1599
 
1600
- #: php/admin/options-page-questions-tab.php:507
1601
- msgid "Create New Question"
1602
  msgstr ""
1603
 
1604
- #: php/admin/options-page-questions-tab.php:523
1605
- msgid "Category:"
1606
  msgstr ""
1607
 
1608
- #: php/admin/options-page-questions-tab.php:536
1609
- msgid "Add Question"
1610
  msgstr ""
1611
 
1612
- #: php/admin/options-page-questions-tab.php:704
1613
- msgid "Nonce verification failed."
1614
  msgstr ""
1615
 
1616
- #: php/admin/options-page-questions-tab.php:725
1617
- msgid "Selected Questions are removed from question bank."
1618
  msgstr ""
1619
 
1620
- #: php/admin/options-page-results-page-tab.php:19
1621
- msgid "Results Pages"
1622
  msgstr ""
1623
 
1624
- #: php/admin/options-page-results-page-tab.php:44
1625
- #: php/admin/options-page-results-page-tab.php:49
1626
- msgid "Save Results Pages"
1627
  msgstr ""
1628
 
1629
- #: php/admin/options-page-results-page-tab.php:45
1630
- #: php/admin/options-page-results-page-tab.php:50
1631
- msgid "Add New Results Page"
1632
  msgstr ""
1633
 
1634
- #: php/admin/options-page-results-page-tab.php:68
1635
- msgid ""
1636
- "Set conditions for when this page should be shown. Leave empty to set this "
1637
- "as the default page."
1638
  msgstr ""
1639
 
1640
- #: php/admin/options-page-results-page-tab.php:77
1641
- msgid "...Show"
1642
  msgstr ""
1643
 
1644
- #: php/admin/options-page-results-page-tab.php:78
1645
- msgid ""
1646
- "Create the results page that should be shown when the conditions are met."
1647
  msgstr ""
1648
 
1649
- #: php/admin/options-page-results-page-tab.php:81
1650
- msgid "Or, redirect the user by entering the URL below:"
1651
  msgstr ""
1652
 
1653
- #: php/admin/options-page-results-page-tab.php:129
1654
- msgid "X = Question ID Note: only supported for multiple choice answers"
1655
  msgstr ""
1656
 
1657
- #: php/admin/options-page-results-page-tab.php:130
1658
- msgid "Show result id"
1659
  msgstr ""
1660
 
1661
- #: php/admin/options-page-style-tab.php:18
1662
- msgid "Style"
1663
  msgstr ""
1664
 
1665
- #: php/admin/options-page-style-tab.php:44
1666
- msgid "The style has been saved successfully."
 
1667
  msgstr ""
1668
 
1669
- #: php/admin/options-page-style-tab.php:47
1670
- msgid "Error occured when trying to save the styles. Please try again."
1671
  msgstr ""
1672
 
1673
- #: php/admin/options-page-style-tab.php:71
1674
- msgid "Quiz Styles"
 
 
1675
  msgstr ""
1676
 
1677
- #: php/admin/options-page-style-tab.php:72
1678
- msgid "Choose your style:"
1679
  msgstr ""
1680
 
1681
- #: php/admin/options-page-style-tab.php:86
1682
- msgid "Custom"
1683
  msgstr ""
1684
 
1685
- #: php/admin/options-page-style-tab.php:91
1686
- #: php/admin/options-page-style-tab.php:102
1687
- msgid "Save Quiz Style"
1688
  msgstr ""
1689
 
1690
- #: php/admin/options-page-style-tab.php:93
1691
- msgid "Custom Style CSS"
1692
  msgstr ""
1693
 
1694
- #: php/admin/options-page-style-tab.php:94
1695
- msgid ""
1696
- "For help and guidance along with a list of different classes used in this "
1697
- "plugin, please visit the following link:"
1698
  msgstr ""
1699
 
1700
- #: php/admin/options-page-text-tab.php:12
1701
- msgid "Text"
1702
  msgstr ""
1703
 
1704
- #: php/admin/options-page-text-tab.php:50
1705
- msgid "Select Message"
1706
  msgstr ""
1707
 
1708
- #: php/admin/options-page-text-tab.php:64
1709
- msgid "Save Text Message"
1710
  msgstr ""
1711
 
1712
- #: php/admin/options-page-text-tab.php:77
1713
- msgid "Allowed Variables"
1714
  msgstr ""
1715
 
1716
- #: php/admin/options-page-text-tab.php:78
1717
- msgid "click to insert the variable"
1718
  msgstr ""
1719
 
1720
- #: php/admin/options-page-text-tab.php:102
1721
- msgid "Show all Variables"
 
1722
  msgstr ""
1723
 
1724
- #: php/admin/options-page-text-tab.php:108
1725
- #: php/admin/options-page-text-tab.php:111
1726
- msgid "Customize Labels"
1727
  msgstr ""
1728
 
1729
- #: php/admin/options-page-text-tab.php:141
1730
- msgid "Close"
1731
  msgstr ""
1732
 
1733
- #: php/admin/options-page-text-tab.php:158
1734
- msgid "Text id is missing."
1735
  msgstr ""
1736
 
1737
- #: php/admin/options-page-text-tab.php:208
1738
  msgid ""
1739
- "There has been an error in this action. Please share this with the developer"
 
1740
  msgstr ""
1741
 
1742
- #: php/admin/quiz-options-page.php:109 php/admin/quizzes-page.php:620
1743
- msgid "Post Settings"
1744
  msgstr ""
1745
 
1746
- #: php/admin/quiz-options-page.php:149
1747
- #: php/classes/class-qmn-alert-manager.php:41
1748
- msgid "Error!"
1749
  msgstr ""
1750
 
1751
- #: php/admin/quiz-options-page.php:149
1752
- msgid ""
1753
- "Please go to the quizzes page and click on the Edit link from the quiz you "
1754
- "wish to edit."
1755
  msgstr ""
1756
 
1757
- #: php/admin/quizzes-page.php:63
1758
- msgid "The stats has been reset successfully."
1759
  msgstr ""
1760
 
1761
- #: php/admin/quizzes-page.php:66
1762
- msgid "Error trying to reset stats. Please try again."
1763
  msgstr ""
1764
 
1765
- #: php/admin/quizzes-page.php:251
1766
- msgid "Your site is using PHP version"
1767
  msgstr ""
1768
 
1769
- #: php/admin/quizzes-page.php:251
1770
- msgid "Starting in QSM 6.0, your version of PHP will no longer be supported."
1771
  msgstr ""
1772
 
1773
- #: php/admin/quizzes-page.php:251
1774
- msgid "Click here to learn more about QSM's minimum PHP version change."
 
1775
  msgstr ""
1776
 
1777
- #: php/admin/quizzes-page.php:267
1778
- msgid "Search"
1779
  msgstr ""
1780
 
1781
- #: php/admin/quizzes-page.php:272 php/admin/quizzes-page.php:274
1782
- msgid "Import & Export"
1783
  msgstr ""
1784
 
1785
- #: php/admin/quizzes-page.php:280 php/admin/quizzes-page.php:442
1786
- msgid "Bulk Actions"
1787
  msgstr ""
1788
 
1789
- #: php/admin/quizzes-page.php:281 php/admin/quizzes-page.php:443
1790
- msgid "Delete Permanently"
1791
  msgstr ""
1792
 
1793
- #: php/admin/quizzes-page.php:283 php/admin/quizzes-page.php:445
1794
- msgid "Apply"
1795
  msgstr ""
1796
 
1797
- #: php/admin/quizzes-page.php:286 php/admin/quizzes-page.php:447
1798
- msgid "item"
1799
- msgid_plural "items"
1800
- msgstr[0] ""
1801
- msgstr[1] ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1802
 
1803
- #: php/admin/quizzes-page.php:296 php/admin/quizzes-page.php:457
1804
- msgid "Go to the first page"
1805
  msgstr ""
1806
 
1807
- #: php/admin/quizzes-page.php:297 php/admin/quizzes-page.php:458
1808
- msgid "Go to the previous page"
 
1809
  msgstr ""
1810
 
1811
- #: php/admin/quizzes-page.php:301 php/admin/quizzes-page.php:462
1812
- msgid "of"
1813
  msgstr ""
1814
 
1815
- #: php/admin/quizzes-page.php:308 php/admin/quizzes-page.php:469
1816
- msgid "Go to the next page"
 
 
 
 
 
 
 
 
 
 
1817
  msgstr ""
1818
 
1819
- #: php/admin/quizzes-page.php:309 php/admin/quizzes-page.php:470
1820
- msgid "Go to the last page"
1821
  msgstr ""
1822
 
1823
- #: php/admin/quizzes-page.php:348 php/admin/quizzes-page.php:424
1824
- msgid "Title"
1825
  msgstr ""
1826
 
1827
- #: php/admin/quizzes-page.php:352 php/admin/quizzes-page.php:428
1828
- #: php/admin/quizzes-page.php:581
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1829
  msgid "Shortcode"
1830
  msgstr ""
1831
 
1832
- #: php/admin/quizzes-page.php:353 php/admin/quizzes-page.php:429
 
 
 
 
1833
  msgid "Views"
1834
  msgstr ""
1835
 
1836
- #: php/admin/quizzes-page.php:354 php/admin/quizzes-page.php:399
1837
- #: php/admin/quizzes-page.php:430
1838
  msgid "Participants"
1839
  msgstr ""
1840
 
1841
- #: php/admin/quizzes-page.php:357 php/admin/quizzes-page.php:433
1842
  msgid "Last Modified"
1843
  msgstr ""
1844
 
1845
- #: php/admin/quizzes-page.php:376 php/admin/quizzes-page.php:619
1846
- msgid "Edit"
1847
  msgstr ""
1848
 
1849
- #: php/admin/quizzes-page.php:377 php/admin/quizzes-page.php:510
1850
- #: php/admin/quizzes-page.php:523 php/admin/quizzes-page.php:621
1851
- msgid "Duplicate"
1852
  msgstr ""
1853
 
1854
- #: php/admin/quizzes-page.php:378 php/admin/quizzes-page.php:535
1855
- #: php/admin/quizzes-page.php:550 php/admin/quizzes-page.php:622
1856
- msgid "Delete"
1857
  msgstr ""
1858
 
1859
- #: php/admin/quizzes-page.php:379
1860
  msgid "View Results"
1861
  msgstr ""
1862
 
1863
- #: php/admin/quizzes-page.php:380 php/admin/quizzes-page.php:623
1864
  msgid "Preview"
1865
  msgstr ""
1866
 
1867
- #: php/admin/quizzes-page.php:388 php/admin/quizzes-page.php:630
1868
- msgid "Click here"
1869
  msgstr ""
1870
 
1871
- #: php/admin/quizzes-page.php:393 php/admin/quizzes-page.php:635
1872
- msgid "Reset"
1873
  msgstr ""
1874
 
1875
- #: php/admin/quizzes-page.php:412
1876
- msgid "No Quiz found!"
1877
  msgstr ""
1878
 
1879
- #: php/admin/quizzes-page.php:484
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1880
  msgid "Reset stats for this quiz?"
1881
  msgstr ""
1882
 
1883
- #: php/admin/quizzes-page.php:488
1884
  msgid ""
1885
  "Are you sure you want to reset the stats to 0? All views and taken stats for "
1886
  "this quiz will be reset. This is permanent and cannot be undone."
1887
  msgstr ""
1888
 
1889
- #: php/admin/quizzes-page.php:495
1890
  msgid "Reset All Stats For Quiz"
1891
  msgstr ""
1892
 
1893
- #: php/admin/quizzes-page.php:515
1894
  msgid "Duplicate questions also?"
1895
  msgstr ""
1896
 
1897
- #: php/admin/quizzes-page.php:517
1898
  msgid "Name Of New Quiz Or Survey:"
1899
  msgstr ""
1900
 
1901
- #: php/admin/quizzes-page.php:540
1902
  msgid "Are you sure you want to delete this quiz or survey?"
1903
  msgstr ""
1904
 
1905
- #: php/admin/quizzes-page.php:542
1906
  msgid "Delete question from question bank?"
1907
  msgstr ""
1908
 
1909
- #: php/admin/quizzes-page.php:562
1910
- msgid "Extend QSM"
1911
  msgstr ""
1912
 
1913
- #: php/admin/quizzes-page.php:566
1914
- msgid "Export functionality is provided as Premium addon."
1915
  msgstr ""
1916
 
1917
- #: php/admin/quizzes-page.php:569
1918
- msgid "Buy Now"
1919
  msgstr ""
1920
 
1921
- #: php/admin/quizzes-page.php:586
 
 
 
 
 
 
 
 
1922
  msgid "Embed Shortcode"
1923
  msgstr ""
1924
 
1925
- #: php/admin/quizzes-page.php:591
1926
  msgid "Link Shortcode"
1927
  msgstr ""
1928
 
1929
- #: php/admin/quizzes-page.php:604
1930
  msgid "You do not have any quizzes or surveys yet"
1931
  msgstr ""
1932
 
1933
- #: php/admin/quizzes-page.php:609
1934
  msgid "or watch the below video to get started"
1935
  msgstr ""
1936
 
1937
- #: php/admin/quizzes-page.php:660
1938
- msgid "Number of items per page:"
1939
- msgstr ""
1940
-
1941
- #: php/admin/settings-page.php:45
1942
  msgid "Main Settings"
1943
  msgstr ""
1944
 
1945
- #: php/admin/settings-page.php:46
1946
  msgid "Allow Usage Tracking?"
1947
  msgstr ""
1948
 
1949
- #: php/admin/settings-page.php:47
1950
  msgid "Disable collecting and storing IP addresses?"
1951
  msgstr ""
1952
 
1953
- #: php/admin/settings-page.php:48
1954
  msgid "Disable Quiz Posts From Being Searched?"
1955
  msgstr ""
1956
 
1957
- #: php/admin/settings-page.php:49
1958
  msgid "Disable Quiz Archive?"
1959
  msgstr ""
1960
 
1961
- #: php/admin/settings-page.php:50
1962
  msgid "Delete all the data related to QSM on deletion?"
1963
  msgstr ""
1964
 
1965
- #: php/admin/settings-page.php:51
1966
  msgid "Process emails in background?"
1967
  msgstr ""
1968
 
1969
- #: php/admin/settings-page.php:52
1970
  msgid "Quiz Url Slug"
1971
  msgstr ""
1972
 
1973
- #: php/admin/settings-page.php:53
1974
  msgid ""
1975
  "Post Type Plural Name (Shown in various places such as on archive pages)"
1976
  msgstr ""
1977
 
1978
- #: php/admin/settings-page.php:54
1979
  msgid "Facebook App Id"
1980
  msgstr ""
1981
 
1982
- #: php/admin/settings-page.php:55
1983
  msgid "From Name (The name emails come from)"
1984
  msgstr ""
1985
 
1986
- #: php/admin/settings-page.php:56
1987
  msgid "From Email (The email address that emails come from)"
1988
  msgstr ""
1989
 
1990
- #: php/admin/settings-page.php:57
1991
  msgid "Items per page in question bank pagination"
1992
  msgstr ""
1993
 
1994
- #: php/admin/settings-page.php:58
1995
  msgid "New Template For Admin Results Details"
1996
  msgstr ""
1997
 
1998
- #: php/admin/settings-page.php:59
1999
  msgid "Template For Admin Results Details"
2000
  msgstr ""
2001
 
2002
- #: php/admin/settings-page.php:71
2003
- msgid "These settings are applied to the entire plugin and all quizzes."
2004
  msgstr ""
2005
 
2006
- #: php/admin/settings-page.php:75
2007
- msgid " Settings have been updated!"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2008
  msgstr ""
2009
 
2010
- #: php/admin/settings-page.php:326
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2011
  msgid ""
2012
  "Allow Quiz And Survey Master to anonymously track this plugin's usage and "
2013
  "help us make this plugin better."
2014
  msgstr ""
2015
 
2016
- #: php/admin/settings-page.php:349
2017
  msgid ""
2018
  "You must not restrict number of quiz attempts when this option is enabled."
2019
  msgstr ""
2020
 
2021
- #: php/admin/settings-page.php:364
2022
  msgid "Global Settings"
2023
  msgstr ""
2024
 
2025
- #: php/admin/settings-page.php:389
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2026
  msgid "New Template"
2027
  msgstr ""
2028
 
2029
- #: php/admin/settings-page.php:394
2030
  msgid "Old Template"
2031
  msgstr ""
2032
 
2033
- #: php/admin/stats-page.php:29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2034
  msgid "Quiz/Survey Statistics"
2035
  msgstr ""
2036
 
2037
- #: php/admin/stats-page.php:68
2038
  msgid "Quiz And Survey Submissions"
2039
  msgstr ""
2040
 
2041
- #: php/admin/stats-page.php:111
2042
  msgid "Daily"
2043
  msgstr ""
2044
 
2045
- #: php/admin/stats-page.php:112
2046
  msgid "Weekly"
2047
  msgstr ""
2048
 
2049
- #: php/admin/stats-page.php:113
2050
  msgid "Monthly"
2051
  msgstr ""
2052
 
2053
- #: php/admin/stats-page.php:116
2054
  msgid "Filter"
2055
  msgstr ""
2056
 
2057
- #: php/admin/tools-page.php:79
2058
  msgid "There has been an error! Please try again."
2059
  msgstr ""
2060
 
2061
- #: php/admin/tools-page.php:100
2062
  msgid "Quiz Has Been Restored!"
2063
  msgstr ""
2064
 
2065
- #: php/admin/tools-page.php:106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2066
  msgid ""
2067
- "Choose a quiz in the drop down and then click the button to restore a "
2068
- "deleted quiz."
2069
  msgstr ""
2070
 
2071
- #: php/admin/tools-page.php:117
2072
- msgid "Restore Quiz"
2073
  msgstr ""
2074
 
2075
- #: php/admin/tools-page.php:146
2076
- msgid "Total actions since QSM installed:"
2077
  msgstr ""
2078
 
2079
- #: php/admin/tools-page.php:154 php/admin/tools-page.php:176
2080
- #, php-format
2081
- msgid "Previous %s Audits"
2082
  msgstr ""
2083
 
2084
- #: php/admin/tools-page.php:160 php/admin/tools-page.php:168
2085
- #, php-format
2086
- msgid "Next %s Audits"
2087
  msgstr ""
2088
 
2089
- #: php/admin/tools-page.php:186
2090
- msgid "Action"
2091
  msgstr ""
2092
 
2093
- #: php/admin/tools-page.php:187
2094
- msgid "Time"
2095
  msgstr ""
2096
 
2097
- #: php/classes/class-qmn-alert-manager.php:37
2098
- msgid "Success!"
 
 
 
 
 
 
2099
  msgstr ""
2100
 
2101
- #: php/classes/class-qmn-quiz-creator.php:199
2102
  msgid ""
2103
  "Your new quiz or survey has been created successfully. To begin editing, "
2104
  "click the Edit link."
2105
  msgstr ""
2106
 
2107
- #: php/classes/class-qmn-quiz-creator.php:205
2108
- #: php/classes/class-qmn-quiz-creator.php:268
2109
- #: php/classes/class-qmn-quiz-creator.php:479
2110
- #: php/classes/class-qmn-quiz-creator.php:564
2111
- #, php-format
2112
  msgid ""
2113
  "There has been an error in this action. Please share this with the "
2114
- "developer. Error Code: %s"
 
 
 
 
2115
  msgstr ""
2116
 
2117
- #: php/classes/class-qmn-quiz-creator.php:263
2118
  msgid "Your quiz or survey has been deleted successfully."
2119
  msgstr ""
2120
 
2121
- #: php/classes/class-qmn-quiz-creator.php:300
 
 
 
 
 
 
2122
  msgid "The name of your quiz or survey has been updated successfully."
2123
  msgstr ""
2124
 
2125
- #: php/classes/class-qmn-quiz-creator.php:307
2126
  msgid ""
2127
  "An error occurred while trying to update the name of your quiz or survey. "
2128
  "Please try again."
2129
  msgstr ""
2130
 
2131
- #: php/classes/class-qmn-quiz-creator.php:473
 
 
 
 
2132
  msgid "Your quiz or survey has been duplicated successfully."
2133
  msgstr ""
2134
 
2135
- #: php/classes/class-qmn-quiz-manager.php:96
2136
- msgid "File is too large. File must be less than "
 
 
 
 
 
 
 
 
 
 
 
 
2137
  msgstr ""
2138
 
2139
- #: php/classes/class-qmn-quiz-manager.php:121
2140
- msgid "File not uploaded"
2141
  msgstr ""
2142
 
2143
- #: php/classes/class-qmn-quiz-manager.php:140
2144
  msgid "File uploaded successfully"
2145
  msgstr ""
2146
 
2147
- #: php/classes/class-qmn-quiz-manager.php:147
2148
- msgid "File type is not supported"
 
 
 
 
2149
  msgstr ""
2150
 
2151
- #: php/classes/class-qmn-quiz-manager.php:167
2152
  msgid "File removed successfully"
2153
  msgstr ""
2154
 
2155
- #: php/classes/class-qmn-quiz-manager.php:172
2156
  msgid "File not removed"
2157
  msgstr ""
2158
 
2159
- #: php/classes/class-qmn-quiz-manager.php:207
2160
  msgid "Correct Info: "
2161
  msgstr ""
2162
 
2163
- #: php/classes/class-qmn-quiz-manager.php:258
2164
- #: php/classes/class-qmn-quiz-manager.php:271
2165
  msgid "It appears that this quiz is not set up correctly"
2166
  msgstr ""
2167
 
2168
- #: php/classes/class-qmn-quiz-manager.php:568
 
 
 
 
 
2169
  msgid "Limit of choice is reached."
2170
  msgstr ""
2171
 
2172
- #: php/classes/class-qmn-quiz-manager.php:568
2173
- #: php/classes/class-qmn-quiz-manager.php:792
2174
- #: php/classes/class-qmn-quiz-manager.php:960
2175
  msgid " out of "
2176
  msgstr ""
2177
 
2178
- #: php/classes/class-qmn-quiz-manager.php:1277
2179
- #: php/classes/class-qsm-install.php:548
2180
- msgid "Retake Quiz"
2181
  msgstr ""
2182
 
2183
- #: php/classes/class-qmn-quiz-manager.php:1328
2184
- msgid "Captcha verification failed."
2185
  msgstr ""
2186
 
2187
- #: php/classes/class-qmn-quiz-manager.php:1444
2188
- msgid "Click here to view"
2189
  msgstr ""
2190
 
2191
- #: php/classes/class-qmn-quiz-manager.php:1909
2192
  msgid "Not collected"
2193
  msgstr ""
2194
 
2195
- #: php/classes/class-qmn-quiz-manager.php:1919
2196
  msgid "Unknown"
2197
  msgstr ""
2198
 
2199
- #: php/classes/class-qmn-review-message.php:91
 
 
 
 
2200
  #, php-format
2201
  msgid ""
2202
- "Greetings! I just noticed that you now have more than %d quiz results. That "
2203
- "is\n"
2204
- "\t\tawesome! Could you please help me out by giving this plugin a 5-star "
2205
- "rating on WordPress? This\n"
2206
- "\t\twill help us by helping other users discover this plugin. %s"
2207
  msgstr ""
2208
 
2209
- #: php/classes/class-qmn-review-message.php:97
2210
- msgid "Yeah, you deserve it!"
2211
  msgstr ""
2212
 
2213
- #: php/classes/class-qmn-review-message.php:98
2214
- msgid "I already did!"
2215
  msgstr ""
2216
 
2217
- #: php/classes/class-qmn-review-message.php:99
2218
  msgid "No, this plugin is not good enough"
2219
  msgstr ""
2220
 
2221
- #: php/classes/class-qsm-fields.php:63
2222
  msgid "The settings has been updated successfully."
2223
  msgstr ""
2224
 
2225
- #: php/classes/class-qsm-fields.php:66
2226
  msgid "There was an error when updating the settings. Please try again."
2227
  msgstr ""
2228
 
2229
- #: php/classes/class-qsm-fields.php:81 php/classes/class-qsm-fields.php:109
2230
- msgid "Save Changes"
 
2231
  msgstr ""
2232
 
2233
- #: php/classes/class-qsm-fields.php:225
2234
- msgid "Allowed Variables:"
2235
  msgstr ""
2236
 
2237
- #: php/classes/class-qsm-install.php:47
2238
- msgid "Quiz Type"
2239
  msgstr ""
2240
 
2241
- #: php/classes/class-qsm-install.php:59
2242
- msgid "Simple Form"
2243
  msgstr ""
2244
 
2245
- #: php/classes/class-qsm-install.php:70
2246
- msgid "Grading System"
 
 
 
 
2247
  msgstr ""
2248
 
2249
- #: php/classes/class-qsm-install.php:74
 
 
 
 
 
 
 
 
2250
  msgid "Correct/Incorrect"
2251
  msgstr ""
2252
 
2253
- #: php/classes/class-qsm-install.php:82
2254
  msgid "Both"
2255
  msgstr ""
2256
 
2257
- #: php/classes/class-qsm-install.php:87
2258
  msgid "Select the system for grading the quiz."
2259
  msgstr ""
2260
 
2261
- #: php/classes/class-qsm-install.php:88
2262
  msgid "To know more about our grading systems please "
2263
  msgstr ""
2264
 
2265
- #: php/classes/class-qsm-install.php:88
2266
  msgid "read the documentation."
2267
  msgstr ""
2268
 
2269
- #: php/classes/class-qsm-install.php:96
2270
- msgid "Allow Score Round-off"
2271
  msgstr ""
2272
 
2273
- #: php/classes/class-qsm-install.php:111
2274
- msgid "Show progress bar"
2275
  msgstr ""
2276
 
2277
- #: php/classes/class-qsm-install.php:130
2278
- msgid "Require User Login"
2279
  msgstr ""
2280
 
2281
- #: php/classes/class-qsm-install.php:143
2282
  msgid "Enabling this allows only logged in users to take the quiz"
2283
  msgstr ""
2284
 
2285
- #: php/classes/class-qsm-install.php:150
2286
- msgid "Questions Per Page"
2287
- msgstr ""
2288
-
2289
- #: php/classes/class-qsm-install.php:156
2290
  msgid "Override the default pagination created on questions tab"
2291
  msgstr ""
2292
 
2293
- #: php/classes/class-qsm-install.php:163
2294
- msgid "Time Limit (in minutes)"
2295
- msgstr ""
2296
-
2297
- #: php/classes/class-qsm-install.php:169
2298
  msgid "Leave 0 for no time limit"
2299
  msgstr ""
2300
 
2301
- #: php/classes/class-qsm-install.php:176
2302
- msgid "Force submit after timer expiry"
2303
- msgstr ""
2304
-
2305
- #: php/classes/class-qsm-install.php:194
2306
- msgid "Skip validations when time expire"
2307
- msgstr ""
2308
-
2309
- #: php/classes/class-qsm-install.php:213
2310
- msgid "Limit Attempts"
2311
- msgstr ""
2312
-
2313
- #: php/classes/class-qsm-install.php:219
2314
  msgid "Leave 0 for unlimited attempts"
2315
  msgstr ""
2316
 
2317
- #: php/classes/class-qsm-install.php:220
2318
  msgid "Limits how many times a user can take the quiz"
2319
  msgstr ""
2320
 
2321
- #: php/classes/class-qsm-install.php:227
2322
- msgid "Limit Entries"
2323
- msgstr ""
2324
-
2325
- #: php/classes/class-qsm-install.php:233
2326
  msgid "Leave 0 for unlimited entries"
2327
  msgstr ""
2328
 
2329
- #: php/classes/class-qsm-install.php:234
2330
  msgid "Limits how many users can take the quiz."
2331
  msgstr ""
2332
 
2333
- #: php/classes/class-qsm-install.php:241
2334
- msgid "Limit number of Questions"
2335
- msgstr ""
2336
-
2337
- #: php/classes/class-qsm-install.php:247
2338
  msgid "Leave 0 to load all questions"
2339
  msgstr ""
2340
 
2341
- #: php/classes/class-qsm-install.php:248
2342
  msgid "Show only limited number of questions from your quiz."
2343
  msgstr ""
2344
 
2345
- #: php/classes/class-qsm-install.php:255
2346
- msgid "Quiz Dates"
2347
- msgstr ""
2348
-
2349
- #: php/classes/class-qsm-install.php:262
2350
- msgid "Start Date"
2351
- msgstr ""
2352
-
2353
- #: php/classes/class-qsm-install.php:263
2354
- msgid "If set, Quiz will be accessible only after this date"
2355
- msgstr ""
2356
-
2357
- #: php/classes/class-qsm-install.php:264
2358
- msgid "Leave blank for no date limit"
2359
  msgstr ""
2360
 
2361
- #: php/classes/class-qsm-install.php:277
2362
- msgid " If set, Quiz will not be accessible after this date"
 
 
2363
  msgstr ""
2364
 
2365
- #: php/classes/class-qsm-install.php:278
2366
- msgid "End Date"
 
 
2367
  msgstr ""
2368
 
2369
- #: php/classes/class-qsm-install.php:285 php/classes/class-qsm-install.php:289
2370
- msgid "Random Questions"
2371
  msgstr ""
2372
 
2373
- #: php/classes/class-qsm-install.php:293
2374
- msgid "Random Questions And Answers"
2375
  msgstr ""
2376
 
2377
- #: php/classes/class-qsm-install.php:297
2378
- msgid "Random Answers"
2379
  msgstr ""
2380
 
2381
- #: php/classes/class-qsm-install.php:301
2382
- msgid "Disabled"
2383
  msgstr ""
2384
 
2385
- #: php/classes/class-qsm-install.php:306
2386
- msgid "Randomize the order of questions or answers every time a quiz loads"
2387
  msgstr ""
2388
 
2389
- #: php/classes/class-qsm-install.php:313
2390
- msgid "Random Questions Categories"
2391
  msgstr ""
2392
 
2393
- #: php/classes/class-qsm-install.php:316
2394
- msgid "Questions will load only from selected categories"
2395
  msgstr ""
2396
 
2397
- #: php/classes/class-qsm-install.php:323
2398
- msgid "Contact form position"
2399
  msgstr ""
2400
 
2401
- #: php/classes/class-qsm-install.php:327
2402
  msgid "Show before quiz begins"
2403
  msgstr ""
2404
 
2405
- #: php/classes/class-qsm-install.php:331
2406
  msgid "Show after the quiz ends"
2407
  msgstr ""
2408
 
2409
- #: php/classes/class-qsm-install.php:336
2410
  msgid "Select when to display the contact form"
2411
  msgstr ""
2412
 
2413
- #: php/classes/class-qsm-install.php:337
2414
  msgid "The form can be configured in Contact tab"
2415
  msgstr ""
2416
 
2417
- #: php/classes/class-qsm-install.php:344
2418
- msgid "Show contact form to logged in users"
2419
- msgstr ""
2420
-
2421
- #: php/classes/class-qsm-install.php:357
2422
  msgid "Logged in users can edit their contact information"
2423
  msgstr ""
2424
 
2425
- #: php/classes/class-qsm-install.php:358
2426
  msgid "The information will still get saved if this option is disabled"
2427
  msgstr ""
2428
 
2429
- #: php/classes/class-qsm-install.php:365
2430
- msgid "Enable comments"
2431
- msgstr ""
2432
-
2433
- #: php/classes/class-qsm-install.php:378
2434
  msgid "Allow users to enter their comments after the quiz"
2435
  msgstr ""
2436
 
2437
- #: php/classes/class-qsm-install.php:385
2438
- msgid "Show question numbers"
2439
- msgstr ""
2440
-
2441
- #: php/classes/class-qsm-install.php:404
2442
- msgid "Save Responses"
2443
- msgstr ""
2444
-
2445
- #: php/classes/class-qsm-install.php:417
2446
- msgid "The results will be permanently stored in a database"
2447
- msgstr ""
2448
-
2449
- #: php/classes/class-qsm-install.php:424
2450
- msgid "Disable change of answers"
2451
  msgstr ""
2452
 
2453
- #: php/classes/class-qsm-install.php:437 php/classes/class-qsm-install.php:458
2454
  msgid "Works with multiple choice questions only"
2455
  msgstr ""
2456
 
2457
- #: php/classes/class-qsm-install.php:438
2458
  msgid "The question will be disabled once an answer is selected"
2459
  msgstr ""
2460
 
2461
- #: php/classes/class-qsm-install.php:445
2462
- msgid "Add class for correct/incorrect answers"
2463
- msgstr ""
2464
-
2465
- #: php/classes/class-qsm-install.php:459
2466
  msgid ""
2467
  "Dynamically add class for incorrect/correct answer after user selects answer."
2468
  msgstr ""
2469
 
2470
- #: php/classes/class-qsm-install.php:466
2471
- msgid "Disable auto fill for contact input"
2472
- msgstr ""
2473
-
2474
- #: php/classes/class-qsm-install.php:485
2475
- msgid "Display category name on front end"
2476
- msgstr ""
2477
-
2478
- #: php/classes/class-qsm-install.php:504
2479
- msgid "Show results inline"
2480
- msgstr ""
2481
-
2482
- #: php/classes/class-qsm-install.php:517
2483
  msgid "Instantly displays the result for each question"
2484
  msgstr ""
2485
 
2486
- #: php/classes/class-qsm-install.php:524
2487
- msgid "Show correct answer inline"
 
 
 
2488
  msgstr ""
2489
 
2490
- #: php/classes/class-qsm-install.php:528
2491
  msgid "Yes When answer is correct"
2492
  msgstr ""
2493
 
2494
- #: php/classes/class-qsm-install.php:532
2495
  msgid "Yes Independent of correct/incorrect"
2496
  msgstr ""
2497
 
2498
- #: php/classes/class-qsm-install.php:541
2499
  msgid "Show correct user info when inline result is enabled."
2500
  msgstr ""
2501
 
2502
- #: php/classes/class-qsm-install.php:561
2503
  msgid "Show a button on result page to retake the quiz"
2504
  msgstr ""
2505
 
2506
- #: php/classes/class-qsm-install.php:568
2507
- msgid "Show current page number"
2508
- msgstr ""
2509
-
2510
- #: php/classes/class-qsm-install.php:587
2511
- msgid "Deselect Answer"
2512
- msgstr ""
2513
-
2514
- #: php/classes/class-qsm-install.php:600
2515
  msgid ""
2516
  "Users are able deselect an answer and leave it blank. Works with Multiple "
2517
  "Choice and Horizintal Multiple Choice questions only"
2518
  msgstr ""
2519
 
2520
- #: php/classes/class-qsm-install.php:607
2521
- msgid "Disable description on quiz result page?"
2522
- msgstr ""
2523
-
2524
- #: php/classes/class-qsm-install.php:626
2525
- msgid "Disable scroll on next and previous button click?"
2526
- msgstr ""
2527
-
2528
- #: php/classes/class-qsm-install.php:645
2529
- msgid "Quiz Animation"
2530
- msgstr ""
2531
-
2532
- #: php/classes/class-qsm-install.php:649
2533
- msgid "bounce"
2534
- msgstr ""
2535
-
2536
- #: php/classes/class-qsm-install.php:653
2537
- msgid "flash"
2538
- msgstr ""
2539
-
2540
- #: php/classes/class-qsm-install.php:657
2541
- msgid "pulse"
2542
- msgstr ""
2543
-
2544
- #: php/classes/class-qsm-install.php:661
2545
- msgid "rubberBand"
2546
- msgstr ""
2547
-
2548
- #: php/classes/class-qsm-install.php:665
2549
- msgid "shake"
2550
- msgstr ""
2551
-
2552
- #: php/classes/class-qsm-install.php:669
2553
- msgid "swing"
2554
- msgstr ""
2555
-
2556
- #: php/classes/class-qsm-install.php:673
2557
- msgid "tada"
2558
- msgstr ""
2559
-
2560
- #: php/classes/class-qsm-install.php:677
2561
- msgid "wobble"
2562
- msgstr ""
2563
-
2564
- #: php/classes/class-qsm-install.php:681
2565
- msgid "jello"
2566
- msgstr ""
2567
-
2568
- #: php/classes/class-qsm-install.php:685
2569
- msgid "heartBeat"
2570
- msgstr ""
2571
-
2572
- #: php/classes/class-qsm-install.php:689
2573
- msgid "No animation"
2574
  msgstr ""
2575
 
2576
- #: php/classes/class-qsm-install.php:700
2577
- msgid "Logo URL"
2578
  msgstr ""
2579
 
2580
- #: php/classes/class-qsm-install.php:703
2581
  msgid ""
2582
  "Enter the url of an image which will be used as logo while sharing on "
2583
  "facebook."
2584
  msgstr ""
2585
 
2586
- #: php/classes/class-qsm-install.php:704
2587
  msgid "If left blank, this will default to QSM logo"
2588
  msgstr ""
2589
 
2590
- #: php/classes/class-qsm-install.php:711
2591
- #: php/classes/class-qsm-install.php:1139
2592
- msgid "Show Legacy Options"
2593
- msgstr ""
2594
-
2595
- #: php/classes/class-qsm-install.php:714
2596
- #: php/classes/class-qsm-install.php:1142
2597
- msgid ""
2598
- "All the legacy options are deprecated and will be removed in upcoming version"
2599
  msgstr ""
2600
 
2601
- #: php/classes/class-qsm-install.php:722
2602
  msgid "Social Sharing Buttons"
2603
  msgstr ""
2604
 
2605
- #: php/classes/class-qsm-install.php:735
2606
  msgid ""
2607
  "Please use the new template variables instead.%FACEBOOK_SHARE% %TWITTER_SHARE"
2608
  "%"
2609
  msgstr ""
2610
 
2611
- #: php/classes/class-qsm-install.php:742
2612
  msgid "Ask user's name"
2613
  msgstr ""
2614
 
2615
- #: php/classes/class-qsm-install.php:754 php/classes/class-qsm-install.php:778
2616
- #: php/classes/class-qsm-install.php:801 php/classes/class-qsm-install.php:824
2617
  msgid "Require"
2618
  msgstr ""
2619
 
2620
- #: php/classes/class-qsm-install.php:766
2621
  msgid "Ask user's business"
2622
  msgstr ""
2623
 
2624
- #: php/classes/class-qsm-install.php:789
2625
  msgid "Ask user's email"
2626
  msgstr ""
2627
 
2628
- #: php/classes/class-qsm-install.php:812
2629
  msgid "Ask user's phone"
2630
  msgstr ""
2631
 
2632
- #: php/classes/class-qsm-install.php:835
2633
  msgid "Message Displayed Before Quiz"
2634
  msgstr ""
2635
 
2636
- #: php/classes/class-qsm-install.php:849
2637
  msgid "Message Displayed Before Comments Box If Enabled"
2638
  msgstr ""
2639
 
2640
- #: php/classes/class-qsm-install.php:863
2641
  msgid "Message Displayed At End Of Quiz (Leave Blank To Omit Text Section)"
2642
  msgstr ""
2643
 
2644
- #: php/classes/class-qsm-install.php:877
2645
  msgid "Message Displayed If User Has Tried Quiz Too Many Times"
2646
  msgstr ""
2647
 
2648
- #: php/classes/class-qsm-install.php:891
2649
  msgid ""
2650
  "Message Displayed If User Is Not Logged In And Quiz Requires Users To Be "
2651
  "Logged In"
2652
  msgstr ""
2653
 
2654
- #: php/classes/class-qsm-install.php:905
2655
  msgid "Message Displayed If Date Is Outside Scheduled Timeframe"
2656
  msgstr ""
2657
 
2658
- #: php/classes/class-qsm-install.php:919
2659
  msgid "Message Displayed If The Limit Of Total Entries Has Been Reached"
2660
  msgstr ""
2661
 
2662
- #: php/classes/class-qsm-install.php:933
2663
  msgid "Results Page %QUESTIONS_ANSWERS% Text"
2664
  msgstr ""
2665
 
2666
- #: php/classes/class-qsm-install.php:952
2667
  msgid "%QUESTIONS_ANSWERS_EMAIL% Text"
2668
  msgstr ""
2669
 
2670
- #: php/classes/class-qsm-install.php:970
2671
  msgid "Twitter Sharing Text"
2672
  msgstr ""
2673
 
2674
- #: php/classes/class-qsm-install.php:991
2675
  msgid "Facebook Sharing Text"
2676
  msgstr ""
2677
 
2678
- #: php/classes/class-qsm-install.php:1012
2679
- msgid "Buttons"
2680
  msgstr ""
2681
 
2682
- #: php/classes/class-qsm-install.php:1020
2683
- msgid "Submit Button"
2684
  msgstr ""
2685
 
2686
- #: php/classes/class-qsm-install.php:1029
2687
  msgid "Previous button"
2688
  msgstr ""
2689
 
2690
- #: php/classes/class-qsm-install.php:1038
2691
  msgid "Next button"
2692
  msgstr ""
2693
 
2694
- #: php/classes/class-qsm-install.php:1047
2695
- msgid "Validation Messages"
2696
  msgstr ""
2697
 
2698
- #: php/classes/class-qsm-install.php:1056
2699
- msgid "All required fields"
2700
  msgstr ""
2701
 
2702
- #: php/classes/class-qsm-install.php:1065
2703
  msgid "Invalid email"
2704
  msgstr ""
2705
 
2706
- #: php/classes/class-qsm-install.php:1074
 
 
 
 
2707
  msgid "Invalid number"
2708
  msgstr ""
2709
 
2710
- #: php/classes/class-qsm-install.php:1083
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2711
  msgid "Invalid Captcha"
2712
  msgstr ""
2713
 
2714
- #: php/classes/class-qsm-install.php:1092
2715
- msgid "Other"
2716
  msgstr ""
2717
 
2718
- #: php/classes/class-qsm-install.php:1101
2719
  msgid "Comments field"
2720
  msgstr ""
2721
 
2722
- #: php/classes/class-qsm-install.php:1110
2723
- msgid "Hint Text"
2724
  msgstr ""
2725
 
2726
- #: php/classes/class-qsm-install.php:1119
2727
- msgid "Correct answer message"
2728
  msgstr ""
2729
 
2730
- #: php/classes/class-qsm-install.php:1122
2731
  msgid "Text to show when the selected option is correct answer."
2732
  msgstr ""
2733
 
2734
- #: php/classes/class-qsm-install.php:1129
2735
  msgid "Incorrect answer message"
2736
  msgstr ""
2737
 
2738
- #: php/classes/class-qsm-install.php:1132
 
 
 
 
2739
  msgid "Text to show when the selected option is wrong answer."
2740
  msgstr ""
2741
 
2742
- #: php/classes/class-qsm-install.php:1150
 
 
 
 
 
 
 
 
2743
  msgid "Name field"
2744
  msgstr ""
2745
 
2746
- #: php/classes/class-qsm-install.php:1159
2747
  msgid "Business field"
2748
  msgstr ""
2749
 
2750
- #: php/classes/class-qsm-install.php:1168
2751
  msgid "Email field"
2752
  msgstr ""
2753
 
2754
- #: php/classes/class-qsm-install.php:1177
2755
  msgid "Phone number field"
2756
  msgstr ""
2757
 
2758
- #: php/classes/class-qsm-install.php:1801
2759
  msgid "Documentation"
2760
  msgstr ""
2761
 
2762
- #: php/classes/class-qsm-install.php:1802
2763
  msgid "Create Support Ticket"
2764
  msgstr ""
2765
 
2766
- #: php/classes/class-qsm-install.php:1802
2767
  msgid "Support"
2768
  msgstr ""
2769
 
2770
- #: php/classes/class-qsm-settings.php:323
2771
  msgid "Previous"
2772
  msgstr ""
2773
 
2774
- #: php/classes/class-qsm-settings.php:324
2775
- msgid "Next"
2776
- msgstr ""
2777
-
2778
  #: php/classes/class-qsm-tracking.php:195
2779
  msgid ""
2780
  "Allow Quiz And Survey Master to track this plugin's usage and help us make "
@@ -2801,21 +3871,15 @@ msgstr ""
2801
  msgid "Do not allow"
2802
  msgstr ""
2803
 
2804
- #: php/classes/lib/wp-background-process.php:423
2805
  #, php-format
2806
  msgid "Every %d Minutes"
2807
  msgstr ""
2808
 
2809
- #: php/shortcodes.php:250
2810
- msgid "Time is Up!"
2811
- msgstr ""
2812
-
2813
- #: php/shortcodes.php:250
2814
- #, php-format
2815
- msgid "Time's up"
2816
  msgstr ""
2817
 
2818
- #: php/shortcodes.php:252
2819
- #, php-format
2820
- msgid "Submit Quiz"
2821
  msgstr ""
1
  # SOME DESCRIPTIVE TITLE.
2
  # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
  # This file is distributed under the same license as the PACKAGE package.
4
+
 
 
 
5
  msgid ""
6
  msgstr ""
7
+ "Project-Id-Version: QSM 8.0.3\n"
8
  "Report-Msgid-Bugs-To: \n"
9
+ "POT-Creation-Date: 2022-07-20 17:38+0530\n"
10
+ "PO-Revision-Date: 2022-07-20 17:47+0500\n"
11
+ "Last-Translator: \n"
12
+ "Language-Team: \n"
13
  "Language: \n"
14
  "MIME-Version: 1.0\n"
15
  "Content-Type: text/plain; charset=CHARSET\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
18
 
19
+ #: mlw_quizmaster2.php:360
20
+ msgid "Error"
21
+ msgstr ""
22
+
23
+ #: mlw_quizmaster2.php:361
24
+ msgid "Success"
25
+ msgstr ""
26
+
27
+ #: mlw_quizmaster2.php:362 mlw_quizmaster2.php:512
28
+ msgid "Category"
29
+ msgstr ""
30
+
31
+ #: mlw_quizmaster2.php:363
32
+ msgid "Please try again"
33
+ msgstr ""
34
+
35
+ #: mlw_quizmaster2.php:364
36
+ msgid "already exists in database"
37
+ msgstr ""
38
+
39
+ #: mlw_quizmaster2.php:365 php/admin/quiz-options-page.php:251
40
+ msgid "Are you sure?"
41
+ msgstr ""
42
+
43
+ #: mlw_quizmaster2.php:366
44
+ msgid "Error to delete the result!"
45
+ msgstr ""
46
+
47
+ #: mlw_quizmaster2.php:367
48
+ msgid "Copied!"
49
+ msgstr ""
50
+
51
+ #: mlw_quizmaster2.php:368 php/admin/functions.php:695
52
+ #: php/admin/options-page-style-tab.php:177
53
+ msgid "Set Featured Image"
54
+ msgstr ""
55
+
56
+ #: mlw_quizmaster2.php:369
57
+ msgid "Set Background Image"
58
+ msgstr ""
59
+
60
+ #: mlw_quizmaster2.php:370
61
+ msgid "Insert Image"
62
+ msgstr ""
63
+
64
+ #: mlw_quizmaster2.php:371 php/admin/options-page-questions-tab.php:611
65
+ msgid "Upload Image"
66
+ msgstr ""
67
+
68
+ #: mlw_quizmaster2.php:372
69
+ msgid "Use this image"
70
+ msgstr ""
71
+
72
+ #: mlw_quizmaster2.php:373
73
+ msgid "Updating database"
74
+ msgstr ""
75
+
76
+ #: mlw_quizmaster2.php:374
77
+ msgid "Database updated successfully."
78
+ msgstr ""
79
+
80
+ #: mlw_quizmaster2.php:375
81
+ msgid "Quiz Submissions"
82
+ msgstr ""
83
+
84
+ #: mlw_quizmaster2.php:376
85
+ msgid "Saving contact fields..."
86
+ msgstr ""
87
+
88
+ #: mlw_quizmaster2.php:377
89
+ msgid "Your contact fields have been saved!"
90
+ msgstr ""
91
+
92
+ #: mlw_quizmaster2.php:378
93
+ msgid "There was an error encountered when saving your contact fields."
94
+ msgstr ""
95
+
96
+ #: mlw_quizmaster2.php:379 mlw_quizmaster2.php:382
97
+ msgid "Saving emails..."
98
+ msgstr ""
99
+
100
+ #: mlw_quizmaster2.php:380
101
+ msgid "Emails were saved!"
102
+ msgstr ""
103
+
104
+ #: mlw_quizmaster2.php:381
105
+ msgid "There was an error when saving the emails."
106
+ msgstr ""
107
+
108
+ #: mlw_quizmaster2.php:383
109
+ msgid "Saving results pages..."
110
+ msgstr ""
111
+
112
+ #: mlw_quizmaster2.php:384
113
+ msgid "Results pages were saved!"
114
+ msgstr ""
115
+
116
+ #: mlw_quizmaster2.php:385
117
+ msgid "There was an error when saving the results pages."
118
+ msgstr ""
119
+
120
+ #: mlw_quizmaster2.php:386 mlw_quizmaster2.php:513
121
+ #: php/admin/options-page-questions-tab.php:175
122
+ msgid "All Categories"
123
+ msgstr ""
124
+
125
+ #: mlw_quizmaster2.php:387 php/admin/options-page-questions-tab.php:1076
126
+ msgid "Add Question"
127
+ msgstr ""
128
+
129
+ #: mlw_quizmaster2.php:388
130
+ msgid "Question created!"
131
+ msgstr ""
132
+
133
+ #: mlw_quizmaster2.php:389
134
+ msgid "Your new question!"
135
+ msgstr ""
136
+
137
+ #: mlw_quizmaster2.php:390
138
+ msgid "Adding question..."
139
+ msgstr ""
140
+
141
+ #: mlw_quizmaster2.php:391
142
+ msgid "Creating question..."
143
+ msgstr ""
144
+
145
+ #: mlw_quizmaster2.php:392
146
+ msgid "Duplicating question..."
147
+ msgstr ""
148
+
149
+ #: mlw_quizmaster2.php:393
150
+ msgid "Saving question..."
151
+ msgstr ""
152
+
153
+ #: mlw_quizmaster2.php:394
154
+ msgid "Question was saved!"
155
+ msgstr ""
156
+
157
+ #: mlw_quizmaster2.php:395
158
+ msgid "Loading questions..."
159
+ msgstr ""
160
+
161
+ #: mlw_quizmaster2.php:396
162
+ msgid "No question is selected."
163
+ msgstr ""
164
+
165
+ #: mlw_quizmaster2.php:397
166
+ msgid "All answer will be reset, Do you want to still continue?"
167
+ msgstr ""
168
+
169
+ #: mlw_quizmaster2.php:398 php/admin/options-page-questions-tab.php:1099
170
+ msgid "Your answer"
171
+ msgstr ""
172
+
173
+ #: mlw_quizmaster2.php:399 php/admin/options-page-questions-tab.php:1095
174
+ msgid "Insert image URL"
175
+ msgstr ""
176
+
177
+ #: mlw_quizmaster2.php:400
178
+ msgid "Saving page info"
179
+ msgstr ""
180
+
181
+ #: mlw_quizmaster2.php:401
182
+ msgid "Saving pages and questions..."
183
+ msgstr ""
184
+
185
+ #: mlw_quizmaster2.php:402
186
+ msgid "Questions and pages were saved!"
187
+ msgstr ""
188
+
189
+ #: mlw_quizmaster2.php:403
190
+ msgid "you want to import this question again?"
191
+ msgstr ""
192
+
193
+ #: mlw_quizmaster2.php:404
194
+ msgid "Enter Question title or description"
195
+ msgstr ""
196
+
197
+ #: mlw_quizmaster2.php:405
198
+ msgid "Page Name is required!"
199
+ msgstr ""
200
+
201
+ #: mlw_quizmaster2.php:406
202
+ msgid "Please use only Alphanumeric characters."
203
+ msgstr ""
204
+
205
+ #: mlw_quizmaster2.php:407
206
+ msgid "Left range and right range should be different"
207
+ msgstr ""
208
+
209
+ #: mlw_quizmaster2.php:408
210
+ msgid "Range fields are required!"
211
+ msgstr ""
212
+
213
+ #: mlw_quizmaster2.php:409 php/admin/admin-results-page.php:302
214
+ #: php/admin/admin-results-page.php:406 php/admin/admin-results-page.php:408
215
+ #: php/classes/class-qsm-install.php:80
216
+ msgid "Points"
217
+ msgstr ""
218
+
219
+ #: mlw_quizmaster2.php:410
220
+ msgid "Left Label"
221
+ msgstr ""
222
+
223
+ #: mlw_quizmaster2.php:411
224
+ msgid "Right Label"
225
+ msgstr ""
226
+
227
+ #: mlw_quizmaster2.php:412
228
+ msgid "Left Range"
229
+ msgstr ""
230
+
231
+ #: mlw_quizmaster2.php:413
232
+ msgid "Right Range"
233
+ msgstr ""
234
+
235
+ #: mlw_quizmaster2.php:414
236
+ msgid "Text/HTML Section cannot be empty"
237
+ msgstr ""
238
+
239
+ #: mlw_quizmaster2.php:415
240
+ msgid ""
241
+ "Number of <strong>%BLANK%</strong> should be equal to options for sequential "
242
+ "matching"
243
+ msgstr ""
244
+
245
+ #: mlw_quizmaster2.php:416
246
+ msgid "Atleast one <strong>%BLANK%</strong> and one option is required."
247
+ msgstr ""
248
+
249
+ #: mlw_quizmaster2.php:417
250
+ msgid "You can not add more than 2 answer for Polar Question type"
251
+ msgstr ""
252
+
253
+ #: mlw_quizmaster2.php:418
254
+ msgid "Hide advance options «"
255
+ msgstr ""
256
+
257
+ #: mlw_quizmaster2.php:419
258
+ msgid "Show advance options »"
259
+ msgstr ""
260
+
261
+ #: mlw_quizmaster2.php:420
262
+ msgid "Category cannot be empty"
263
+ msgstr ""
264
+
265
+ #: mlw_quizmaster2.php:422
266
+ msgid "Please fill in your name and email."
267
+ msgstr ""
268
+
269
+ #: mlw_quizmaster2.php:423
270
+ msgid "Your email address is invalid."
271
+ msgstr ""
272
+
273
+ #: mlw_quizmaster2.php:424
274
+ msgid "Your list ID is invalid."
275
+ msgstr ""
276
+
277
+ #: mlw_quizmaster2.php:425
278
+ msgid "You're already subscribed!"
279
+ msgstr ""
280
+
281
+ #: mlw_quizmaster2.php:426
282
+ msgid "Thanks, you are now subscribed to our mailing list!"
283
+ msgstr ""
284
+
285
+ #: mlw_quizmaster2.php:427
286
+ msgid "Sorry, unable to subscribe. Please try again later!"
287
+ msgstr ""
288
+
289
+ #: mlw_quizmaster2.php:447 mlw_quizmaster2.php:480
290
+ #: php/admin/quizzes-page.php:279 php/admin/settings-page.php:336
291
+ #: php/classes/class-qsm-install.php:2060
292
  msgid "Quizzes & Surveys"
293
  msgstr ""
294
 
295
+ #: mlw_quizmaster2.php:472 mlw_quizmaster2.php:473 mlw_quizmaster2.php:474
296
+ #: php/admin/options-page-email-tab.php:185
297
+ #: php/admin/options-page-results-page-tab.php:166
298
+ #: php/classes/class-qsm-install.php:52
299
  msgid "Quiz"
300
  msgstr ""
301
 
302
+ #: mlw_quizmaster2.php:475 php/admin/quizzes-page.php:280
303
  msgid "Add New"
304
  msgstr ""
305
 
306
+ #: mlw_quizmaster2.php:476
307
  msgid "Add New Quiz"
308
  msgstr ""
309
 
310
+ #: mlw_quizmaster2.php:477
311
  msgid "New Quiz"
312
  msgstr ""
313
 
314
+ #: mlw_quizmaster2.php:478 mlw_quizmaster2.php:688
315
  msgid "Edit Quiz"
316
  msgstr ""
317
 
318
+ #: mlw_quizmaster2.php:479 php/admin/quiz-options-page.php:122
319
  msgid "View Quiz"
320
  msgstr ""
321
 
322
+ #: mlw_quizmaster2.php:481
 
 
 
 
323
  msgid "Search Quizzes"
324
  msgstr ""
325
 
326
+ #: mlw_quizmaster2.php:482
327
  msgid "Parent Quiz:"
328
  msgstr ""
329
 
330
+ #: mlw_quizmaster2.php:483
331
  msgid "No Quiz Found"
332
  msgstr ""
333
 
334
+ #: mlw_quizmaster2.php:484
335
  msgid "No Quiz Found In Trash"
336
  msgstr ""
337
 
338
+ #: mlw_quizmaster2.php:510 mlw_quizmaster2.php:578
339
+ msgid "Question Categories"
340
  msgstr ""
341
 
342
+ #: mlw_quizmaster2.php:511
343
+ msgid "Categories"
344
+ msgstr ""
345
+
346
+ #: mlw_quizmaster2.php:514 php/admin/options-page-questions-tab.php:733
347
+ msgid "Parent Category"
348
+ msgstr ""
349
+
350
+ #: mlw_quizmaster2.php:515
351
+ msgid "Parent Category:"
352
+ msgstr ""
353
+
354
+ #: mlw_quizmaster2.php:516
355
+ msgid "New Category Name"
356
+ msgstr ""
357
+
358
+ #: mlw_quizmaster2.php:517 php/admin/options-page-questions-tab.php:722
359
+ msgid "Add New Category"
360
+ msgstr ""
361
+
362
+ #: mlw_quizmaster2.php:518
363
+ msgid "Edit Category"
364
+ msgstr ""
365
+
366
+ #: mlw_quizmaster2.php:519
367
+ msgid "Update Category"
368
+ msgstr ""
369
+
370
+ #: mlw_quizmaster2.php:520
371
+ msgid "View Category"
372
+ msgstr ""
373
+
374
+ #: mlw_quizmaster2.php:575
375
+ msgid "QSM"
376
  msgstr ""
377
 
378
+ #: mlw_quizmaster2.php:576
379
+ msgid "Dashboard"
 
380
  msgstr ""
381
 
382
+ #: mlw_quizmaster2.php:580 mlw_quizmaster2.php:583
383
+ #: php/admin/addons-page.php:113 php/admin/options-page-contact-tab.php:160
384
+ #: php/admin/options-page-contact-tab.php:169
385
+ #: php/admin/quiz-options-page.php:125 php/admin/tools-page.php:245
386
  msgid "Settings"
387
  msgstr ""
388
 
389
+ #: mlw_quizmaster2.php:581
390
  msgid "Results"
391
  msgstr ""
392
 
393
+ #: mlw_quizmaster2.php:582
394
  msgid "Result Details"
395
  msgstr ""
396
 
397
+ #: mlw_quizmaster2.php:584 php/admin/tools-page.php:25
398
  msgid "Tools"
399
  msgstr ""
400
 
401
+ #: mlw_quizmaster2.php:585
402
  msgid "Stats"
403
  msgstr ""
404
 
405
+ #: mlw_quizmaster2.php:586
406
  msgid "Addon Settings"
407
  msgstr ""
408
 
409
+ #: mlw_quizmaster2.php:587
410
  msgid "Get a Free Addon"
411
  msgstr ""
412
 
413
+ #: mlw_quizmaster2.php:587
414
  msgid "Get a Free Addon!"
415
  msgstr ""
416
 
417
+ #: mlw_quizmaster2.php:588
418
+ msgid "About"
419
+ msgstr ""
420
+
421
+ #: mlw_quizmaster2.php:637 php/admin/settings-page.php:226
422
+ msgid "Database update required"
423
+ msgstr ""
424
 
425
+ #: mlw_quizmaster2.php:639 php/admin/settings-page.php:229
426
+ msgid "QSM has been updated!"
427
  msgstr ""
428
 
429
+ #: mlw_quizmaster2.php:640 php/admin/settings-page.php:230
430
+ msgid ""
431
+ "We need to upgrade your database so that you can enjoy the latest features."
432
  msgstr ""
433
 
434
+ #: mlw_quizmaster2.php:643 php/admin/settings-page.php:233
435
+ #, php-format
436
+ msgid ""
437
+ "Please note that this action %1$s can not be %2$s rolled back. We recommend "
438
+ "you to take a backup of your current site before proceeding."
439
+ msgstr ""
440
+
441
+ #: mlw_quizmaster2.php:647 php/shortcodes.php:254 php/shortcodes.php:270
442
+ #: php/admin/admin-results-page.php:555 php/admin/functions.php:843
443
+ #: php/admin/options-page-questions-tab.php:712
444
+ #: php/admin/options-page-style-tab.php:317
445
+ #: php/admin/quiz-options-page.php:241 php/admin/quiz-options-page.php:261
446
+ #: php/admin/quizzes-page.php:336 php/admin/quizzes-page.php:366
447
+ #: php/admin/quizzes-page.php:400 php/admin/quizzes-page.php:431
448
+ #: php/admin/quizzes-page.php:451
449
+ msgid "Cancel"
450
  msgstr ""
451
 
452
+ #: mlw_quizmaster2.php:648 php/admin/settings-page.php:237
453
+ msgid "Update Database"
454
+ msgstr ""
455
+
456
+ #: mlw_quizmaster2.php:659
457
+ msgid ""
458
+ "\"Process emails in background\" option is enabled. WPML string translation "
459
+ "may not work as expected for email templates. Please disable this option to "
460
+ "send translated strings in emails."
461
  msgstr ""
462
 
463
  #: php/gdpr.php:29
523
  msgid "Form Responses"
524
  msgstr ""
525
 
526
+ #: php/gdpr.php:142
527
  msgid "Form Name"
528
  msgstr ""
529
 
530
+ #: php/gdpr.php:146
531
  msgid "Time Submitted"
532
  msgstr ""
533
 
534
+ #: php/gdpr.php:150
535
  msgid "Points Earned"
536
  msgstr ""
537
 
538
+ #: php/gdpr.php:154
539
  msgid "Score Earned"
540
  msgstr ""
541
 
542
+ #: php/gdpr.php:158
543
  msgid "Questions Answered Correctly"
544
  msgstr ""
545
 
546
+ #: php/gdpr.php:162
547
  msgid "Total Questions"
548
  msgstr ""
549
 
550
+ #: php/gdpr.php:166
551
  msgid "Name Field"
552
  msgstr ""
553
 
554
+ #: php/gdpr.php:170
555
  msgid "Business Field"
556
  msgstr ""
557
 
558
+ #: php/gdpr.php:174
559
  msgid "Email Field"
560
  msgstr ""
561
 
562
+ #: php/gdpr.php:178
563
  msgid "Phone Field"
564
  msgstr ""
565
 
566
+ #: php/gdpr.php:182
567
  msgid "User ID"
568
  msgstr ""
569
 
570
+ #: php/gdpr.php:186 php/admin/admin-results-page.php:349
571
+ #: php/admin/admin-results-page.php:546
572
  msgid "IP Address"
573
  msgstr ""
574
 
575
+ #: php/gdpr.php:190
576
  msgid "Time to complete form"
577
  msgstr ""
578
 
579
+ #: php/gdpr.php:194
580
  msgid "Form comments"
581
  msgstr ""
582
 
583
+ #: php/question-types.php:70
584
+ msgid "Multiple Choice"
585
  msgstr ""
586
 
587
+ #: php/question-types.php:82
588
  msgid "File Upload"
589
  msgstr ""
590
 
591
+ #: php/question-types.php:94 php/admin/options-page-contact-tab.php:148
592
  msgid "Date"
593
  msgstr ""
594
 
595
+ #: php/question-types.php:106
596
+ msgid "Multiple Choice (Horizontal)"
597
  msgstr ""
598
 
599
+ #: php/question-types.php:118
600
  msgid "Drop Down"
601
  msgstr ""
602
 
603
+ #: php/question-types.php:130
 
 
 
 
604
  msgid "Short Answer"
605
  msgstr ""
606
 
607
+ #: php/question-types.php:142
608
  msgid "Multiple Response"
609
  msgstr ""
610
 
611
+ #: php/question-types.php:153
612
  msgid "Paragraph"
613
  msgstr ""
614
 
615
+ #: php/question-types.php:173
616
  msgid "Text/HTML Section"
617
  msgstr ""
618
 
619
+ #: php/question-types.php:188 php/admin/options-page-contact-tab.php:147
620
  msgid "Number"
621
  msgstr ""
622
 
623
+ #: php/question-types.php:209
624
  msgid "Opt-in"
625
  msgstr ""
626
 
627
+ #: php/question-types.php:229
628
  msgid "Captcha"
629
  msgstr ""
630
 
631
+ #: php/question-types.php:241
632
+ msgid "Multiple Response (Horizontal)"
633
  msgstr ""
634
 
635
+ #: php/question-types.php:263
636
  msgid ""
637
  "For fill in the blank types, use %BLANK% to represent where to put the text "
638
  "box in your text."
639
  msgstr ""
640
 
641
+ #: php/question-types.php:267
642
  msgid "Fill In The Blank"
643
  msgstr ""
644
 
645
+ #: php/question-types.php:279
646
  msgid "Polar"
647
  msgstr ""
648
 
649
+ #: php/rest-api.php:280 php/rest-api.php:393 php/rest-api.php:421
650
+ #: php/rest-api.php:446 php/rest-api.php:474 php/rest-api.php:515
651
+ #: php/rest-api.php:580 php/rest-api.php:638 php/rest-api.php:710
652
+ #: php/rest-api.php:735
653
  msgid "User not logged in"
654
  msgstr ""
655
 
656
+ #: php/rest-api.php:301 php/admin/admin-dashboard.php:411
657
+ #: php/admin/admin-results-page.php:401 php/admin/admin-results-page.php:410
658
  msgid "Not Graded"
659
  msgstr ""
660
 
661
+ #: php/rest-api.php:748
662
+ msgid "Unauthorized!"
663
+ msgstr ""
664
+
665
+ #: php/rest-api.php:764
666
+ msgid "Select the quiz"
667
+ msgstr ""
668
+
669
+ #: php/shortcodes.php:105
670
  msgid "No quiz found"
671
  msgstr ""
672
 
673
+ #: php/shortcodes.php:252
674
+ msgid "Time is Up!"
675
+ msgstr ""
676
+
677
+ #: php/shortcodes.php:254
678
+ msgid "Submit Quiz"
679
+ msgstr ""
680
+
681
+ #: php/shortcodes.php:268
682
+ msgid "Time's up"
683
+ msgstr ""
684
+
685
+ #: php/template-variables.php:223
686
  msgid "Poll Result"
687
  msgstr ""
688
 
689
+ #: php/template-variables.php:295
690
  msgid "Facebbok Share"
691
  msgstr ""
692
 
693
+ #: php/template-variables.php:303
694
  msgid "Twitter Share"
695
  msgstr ""
696
 
697
+ #: php/template-variables.php:1060 php/template-variables.php:1069
698
  msgid "No answer provided"
699
  msgstr ""
700
 
701
+ #: php/template-variables.php:1242
702
  msgid "No Answer Provided"
703
  msgstr ""
704
 
705
+ #: php/admin/about-page.php:37
706
+ msgid "Need Help?"
707
  msgstr ""
708
 
709
+ #: php/admin/about-page.php:38
710
+ msgid "System Info"
711
  msgstr ""
712
 
713
+ #: php/admin/about-page.php:43
714
+ msgid "Help Page"
715
  msgstr ""
716
 
717
+ #: php/admin/about-page.php:52
718
+ msgid "Welcome To Quiz And Survey Master (Formerly Quiz Master Next)"
719
  msgstr ""
720
 
721
+ #: php/admin/about-page.php:105
722
+ msgid "View "
723
  msgstr ""
724
 
725
+ #: php/admin/about-page.php:136
726
+ msgid "Need help with the plugin? Try any of the following:"
727
  msgstr ""
728
 
729
+ #: php/admin/about-page.php:174
730
+ msgid "Site Information"
731
  msgstr ""
732
 
733
+ #: php/admin/about-page.php:175
734
+ msgid "Site URL:"
735
  msgstr ""
736
 
737
+ #: php/admin/about-page.php:176
738
+ msgid "Home URL:"
739
  msgstr ""
740
 
741
+ #: php/admin/about-page.php:177
742
+ msgid "Multisite: "
743
  msgstr ""
744
 
745
+ #: php/admin/about-page.php:179
746
+ msgid "WordPress Information"
747
  msgstr ""
748
 
749
+ #: php/admin/about-page.php:180
750
+ msgid "Version: "
751
  msgstr ""
752
 
753
+ #: php/admin/about-page.php:181
754
+ msgid "Language: "
 
 
755
  msgstr ""
756
 
757
+ #: php/admin/about-page.php:182
758
+ msgid "Permalink Structure: "
 
759
  msgstr ""
760
 
761
+ #: php/admin/about-page.php:183
762
+ msgid "Active Theme: "
 
763
  msgstr ""
764
 
765
+ #: php/admin/about-page.php:184
766
+ msgid "Parent Theme: "
 
767
  msgstr ""
768
 
769
+ #: php/admin/about-page.php:185
770
+ msgid "Debug Mode: "
771
  msgstr ""
772
 
773
+ #: php/admin/about-page.php:186
774
+ msgid "Memory Limit: "
775
  msgstr ""
776
 
777
+ #: php/admin/about-page.php:188
778
+ msgid "Plugins Information"
779
  msgstr ""
780
 
781
+ #: php/admin/about-page.php:191
782
+ msgid "Must Use"
 
 
783
  msgstr ""
784
 
785
+ #: php/admin/about-page.php:196
786
+ msgid "Active"
787
+ msgstr ""
788
+
789
+ #: php/admin/about-page.php:205
790
+ msgid "Inactive"
791
+ msgstr ""
792
+
793
+ #: php/admin/about-page.php:214
794
+ msgid "Server Information"
795
+ msgstr ""
796
+
797
+ #: php/admin/about-page.php:215
798
+ msgid "PHP : "
799
+ msgstr ""
800
+
801
+ #: php/admin/about-page.php:216
802
+ msgid "MySQL : "
803
+ msgstr ""
804
+
805
+ #: php/admin/about-page.php:217
806
+ msgid "Webserver : "
807
+ msgstr ""
808
+
809
+ #: php/admin/about-page.php:226
810
+ msgid "QSM Information"
811
+ msgstr ""
812
+
813
+ #: php/admin/about-page.php:227
814
+ msgid "Initial Version : "
815
+ msgstr ""
816
+
817
+ #: php/admin/about-page.php:228
818
+ msgid "Current Version : "
819
+ msgstr ""
820
+
821
+ #: php/admin/about-page.php:229
822
+ msgid "Total Quizzes : "
823
+ msgstr ""
824
+
825
+ #: php/admin/about-page.php:230
826
+ msgid "Total Active Quizzes : "
827
+ msgstr ""
828
+
829
+ #: php/admin/about-page.php:231
830
+ msgid "Total Questions : "
831
+ msgstr ""
832
+
833
+ #: php/admin/about-page.php:232
834
+ msgid "Total Active Questions : "
835
+ msgstr ""
836
+
837
+ #: php/admin/about-page.php:233
838
+ msgid "Total Results : "
839
+ msgstr ""
840
+
841
+ #: php/admin/about-page.php:234
842
+ msgid "Total Active Results : "
843
+ msgstr ""
844
+
845
+ #: php/admin/about-page.php:236
846
+ msgid "QSM Recent Logs"
847
+ msgstr ""
848
+
849
+ #: php/admin/about-page.php:243
850
+ msgid "No recent logs"
851
+ msgstr ""
852
+
853
+ #: php/admin/addons-page.php:18 php/admin/addons-page.php:311
854
+ msgid "Featured Addons"
855
+ msgstr ""
856
+
857
+ #: php/admin/addons-page.php:29
858
+ msgid "Back to list"
859
+ msgstr ""
860
+
861
+ #: php/admin/addons-page.php:33
862
+ msgid "QSM Addon Settings"
863
+ msgstr ""
864
+
865
+ #: php/admin/addons-page.php:69
866
+ msgid "Price: "
867
+ msgstr ""
868
+
869
+ #: php/admin/addons-page.php:70
870
+ msgid "Get This Addon"
871
+ msgstr ""
872
+
873
+ #: php/admin/addons-page.php:71
874
+ msgid "Show more"
875
+ msgstr ""
876
+
877
+ #: php/admin/addons-page.php:76 php/admin/addons-page.php:97
878
+ msgid "Installed Addons"
879
+ msgstr ""
880
+
881
+ #: php/admin/addons-page.php:77
882
+ msgid "Add Addons"
883
+ msgstr ""
884
+
885
+ #: php/admin/addons-page.php:86
886
+ msgid "Popular"
887
+ msgstr ""
888
+
889
+ #: php/admin/addons-page.php:87
890
+ msgid "On Sale"
891
+ msgstr ""
892
+
893
+ #: php/admin/addons-page.php:88
894
+ msgid "Recently Updated"
895
+ msgstr ""
896
+
897
+ #: php/admin/addons-page.php:92 php/admin/functions.php:830
898
+ msgid "40+ addons available"
899
+ msgstr ""
900
+
901
+ #: php/admin/addons-page.php:93 php/admin/functions.php:831
902
+ msgid "Browse All Addons"
903
+ msgstr ""
904
+
905
+ #: php/admin/addons-page.php:124
906
+ msgid ""
907
+ "You have currently not installed any addons. Explore our addons repository "
908
+ "with 40+ addons to make your quiz even better."
909
+ msgstr ""
910
+
911
+ #: php/admin/addons-page.php:128
912
+ msgid "Explore Addons"
913
+ msgstr ""
914
+
915
+ #: php/admin/addons-page.php:273
916
+ msgid "SAVE WITH OUR BUNDLES"
917
+ msgstr ""
918
+
919
+ #: php/admin/addons-page.php:289
920
+ msgid "Get now"
921
+ msgstr ""
922
+
923
+ #: php/admin/addons-page.php:325
924
+ msgid "Get Your Free Addon!"
925
+ msgstr ""
926
+
927
+ #: php/admin/addons-page.php:328
928
+ msgid ""
929
+ "Wanna get more out of Quiz and Survey Master, but not yet ready to spend the "
930
+ "cash? Get one free addon today!"
931
+ msgstr ""
932
+
933
+ #: php/admin/addons-page.php:341
934
  msgid ""
935
  "Getting your addon is dead simple: just subscribe to our newsletter and then "
936
  "you will get the free addon by e-mail. We will not spam you. We usually send "
937
  "out newsletters to talk about new features in "
938
  msgstr ""
939
 
940
+ #: php/admin/addons-page.php:341
941
  msgid "Quiz and Survey Master"
942
  msgstr ""
943
 
944
+ #: php/admin/addons-page.php:341
945
  msgid ""
946
  " let you know when new or updated addons are being released and provide "
947
  "informative articles that show you how to use "
948
  msgstr ""
949
 
950
+ #: php/admin/addons-page.php:341
951
  msgid "Quiz and Survey Master "
952
  msgstr ""
953
 
954
+ #: php/admin/addons-page.php:341
955
  msgid "to its full potential. "
956
  msgstr ""
957
 
958
+ #: php/admin/addons-page.php:341
959
  msgid "View our privacy policy"
960
  msgstr ""
961
 
962
+ #: php/admin/addons-page.php:359
963
  msgid "Your subscription could not be saved. Please try again."
964
  msgstr ""
965
 
966
+ #: php/admin/addons-page.php:372
967
  msgid "Your subscription has been successful."
968
  msgstr ""
969
 
970
+ #: php/admin/addons-page.php:389
971
  msgid "Enter your email address to subscribe"
972
  msgstr ""
973
 
974
+ #: php/admin/addons-page.php:404
975
  msgid "Provide your email address to subscribe. For e.g abc@xyz.com"
976
  msgstr ""
977
 
978
+ #: php/admin/addons-page.php:419
979
  msgid "SUBSCRIBE"
980
  msgstr ""
981
 
982
+ #: php/admin/addons-page.php:429
983
  msgid "Terms & Privacy policy"
984
  msgstr ""
985
 
986
+ #: php/admin/admin-dashboard.php:77
987
  msgid "Welcome"
988
  msgstr ""
989
 
990
+ #: php/admin/admin-dashboard.php:111
991
  msgid "QSM Dashboard"
992
  msgstr ""
993
 
994
+ #: php/admin/admin-dashboard.php:118
995
  msgid "Dismiss"
996
  msgstr ""
997
 
998
+ #: php/admin/admin-dashboard.php:120
999
  msgid "Welcome to Quiz And Survey Master!"
1000
  msgstr ""
1001
 
1002
+ #: php/admin/admin-dashboard.php:121
1003
  msgid "Formerly Quiz Master Next"
1004
  msgstr ""
1005
 
1006
+ #: php/admin/admin-dashboard.php:124
1007
  msgid "Get Started"
1008
  msgstr ""
1009
 
1010
+ #: php/admin/admin-dashboard.php:126 php/admin/quizzes-page.php:488
1011
  msgid "Create New Quiz/Survey"
1012
  msgstr ""
1013
 
1014
+ #: php/admin/admin-dashboard.php:128
1015
  msgid "Edit previously created quizzes"
1016
  msgstr ""
1017
 
1018
+ #: php/admin/admin-dashboard.php:132
1019
  msgid "Next Steps"
1020
  msgstr ""
1021
 
1022
+ #: php/admin/admin-dashboard.php:135 php/admin/quizzes-page.php:489
1023
  msgid "Read Documentation"
1024
  msgstr ""
1025
 
1026
+ #: php/admin/admin-dashboard.php:139
1027
  msgid "See demos"
1028
  msgstr ""
1029
 
1030
+ #: php/admin/admin-dashboard.php:143
1031
  msgid "Extend QSM with PRO Addons"
1032
  msgstr ""
1033
 
1034
+ #: php/admin/admin-dashboard.php:147
1035
+ msgid "Explore QSM Themes"
1036
+ msgstr ""
1037
+
1038
+ #: php/admin/admin-dashboard.php:153
1039
  msgid "Useful Links"
1040
  msgstr ""
1041
 
1042
+ #: php/admin/admin-dashboard.php:155
1043
  msgid "Contact Support"
1044
  msgstr ""
1045
 
1046
+ #: php/admin/admin-dashboard.php:156
1047
  msgid "Github Repository"
1048
  msgstr ""
1049
 
1050
+ #: php/admin/admin-dashboard.php:157
1051
+ msgid "Connect on Facebook"
1052
+ msgstr ""
1053
+
1054
+ #: php/admin/admin-dashboard.php:158
1055
+ msgid "Roadmap"
1056
+ msgstr ""
1057
+
1058
+ #: php/admin/admin-dashboard.php:287
1059
  msgid "No settings are found!"
1060
  msgstr ""
1061
 
1062
+ #: php/admin/admin-dashboard.php:309
1063
  msgid "No addons are found!"
1064
  msgstr ""
1065
 
1066
+ #: php/admin/admin-dashboard.php:327 php/admin/admin-dashboard.php:330
1067
  msgid "Most Popular Addon this Week"
1068
  msgstr ""
1069
 
1070
+ #: php/admin/admin-dashboard.php:351
1071
  msgid "SEE ALL ADDONS"
1072
  msgstr ""
1073
 
1074
+ #: php/admin/admin-dashboard.php:371 php/admin/admin-dashboard.php:374
1075