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

Version Description

(August 31, 2020) = * Enhancement: Added a new variable %USER_ANSWERS_DEFAULT% to improve default result page. All new quizzes will have this variable by default. * Enhancement: Created new %AMOUNT_INCORRECT% and %AMOUNT_ATTEMPTED% template variable to enhance the quiz result page. * Enhancement: Added time( hours and minute ) support in quiz start and end date. * Enhancement: Added option in setting menu to delete data related to QSM on deletion of plugin. * Enhancement: Added option in setting menu to enable/disable the Background Quiz Email Process. * Enhancement: Added qsm prefixes to email classes. * Enhancement: Added feature to view uploaded file in admin result page for File Upload question type. * Enhancement: Added option to show only title in quiz result page. * Enhancement: Added a button to view uploaded file in quiz result page and replaced the empty spaces in the uploaded file slug with dashes. * Enhancement: Added a check box to select/deselect question in Question Bank Popup. * Bug: Fixed issues where questions were not showing up in admin when there is no pages in quiz. * Bug: Fixed jquery error when editor is changed to text in Quiz text tab. * Bug: Fixed PHP 7.4 Sentry Issues while creating new quiz. * Bug: Fixed issues with Allowed file types while question editing. * Bug: Fixed submit button position for auto pagination. * Bug: Fixed issues with quiz loading when pagination is enabled.

Download this release

Release Info

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

Code changes from version 7.0.2 to 7.1.0

css/common.css CHANGED
@@ -167,6 +167,72 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
167
  cursor: pointer;
168
  }
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  @media screen and (max-width: 767px){
171
  .question-type-polar-s .left-polar-title,
172
  .question-type-polar-s .slider-main-wrapper,
167
  cursor: pointer;
168
  }
169
 
170
+ /**
171
+ * Design for new template variable QUESTION_WITH_ANSWER
172
+ */
173
+ .mlw_qmn_question .qsm-text-wrong-option{
174
+ display: block;
175
+ color: #dc3232;
176
+ margin-bottom: 5px;
177
+ padding-left: 10px;
178
+ }
179
+ .mlw_qmn_question span.qsm-text-wrong-option::before {
180
+ content: "\f335";
181
+ font-family: dashicons;
182
+ position: relative;
183
+ top: 3px;
184
+ left: -10px;
185
+ }
186
+ .mlw_qmn_question .qsm-text-correct-option{
187
+ display: block;
188
+ color: green;
189
+ margin-bottom: 5px;
190
+ padding-left: 10px;
191
+ }
192
+ .mlw_qmn_question .qsm-text-correct-option:before{
193
+ content: "\f159";
194
+ font-family: dashicons;
195
+ position: relative;
196
+ top: 3px;
197
+ left: -10px;
198
+ }
199
+ .mlw_qmn_question .qsm-text-correct-option.qsm-text-user-correct-answer:before{
200
+ content: "\f12a";
201
+ top: 4px;
202
+ }
203
+ .mlw_qmn_question .qsm-text-simple-option{
204
+ display: block;
205
+ margin-bottom: 5px;
206
+ color: #808080;
207
+ padding-left: 10px;
208
+ }
209
+ .mlw_qmn_question .qsm-text-simple-option:before{
210
+ content: "\f159";
211
+ font-family: dashicons;
212
+ position: relative;
213
+ top: 3px;
214
+ left: -10px;
215
+ }
216
+ .qsm-results-page .qmn_question_answer.qsm-add-border-bottom {
217
+ border-bottom: 1px solid #808080;
218
+ padding-bottom: 25px;
219
+ }
220
+ .qmn_quiz_container.qsm_auto_pagination_enabled {
221
+ position: relative;
222
+ }
223
+ .qmn_quiz_container.qsm_auto_pagination_enabled .quiz_section.quiz_end .qsm-btn{
224
+ bottom: 0;
225
+ right: 0;
226
+ width: auto;
227
+ text-align: right;
228
+ height: auto;
229
+ padding: 0;
230
+ position: absolute;
231
+ z-index: 1;
232
+ }
233
+ .qmn_quiz_container.qsm_auto_pagination_enabled .quiz_section:not(.quiz_begin) {
234
+ display: none;
235
+ }
236
  @media screen and (max-width: 767px){
237
  .question-type-polar-s .left-polar-title,
238
  .question-type-polar-s .slider-main-wrapper,
css/jquery.datetimepicker.css ADDED
@@ -0,0 +1,568 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .xdsoft_datetimepicker {
2
+ box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.506);
3
+ background: #fff;
4
+ border-bottom: 1px solid #bbb;
5
+ border-left: 1px solid #ccc;
6
+ border-right: 1px solid #ccc;
7
+ border-top: 1px solid #ccc;
8
+ color: #333;
9
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
10
+ padding: 8px;
11
+ padding-left: 0;
12
+ padding-top: 2px;
13
+ position: absolute;
14
+ z-index: 9999;
15
+ -moz-box-sizing: border-box;
16
+ box-sizing: border-box;
17
+ display: none;
18
+ }
19
+ .xdsoft_datetimepicker.xdsoft_rtl {
20
+ padding: 8px 0 8px 8px;
21
+ }
22
+
23
+ .xdsoft_datetimepicker iframe {
24
+ position: absolute;
25
+ left: 0;
26
+ top: 0;
27
+ width: 75px;
28
+ height: 210px;
29
+ background: transparent;
30
+ border: none;
31
+ }
32
+
33
+ /*For IE8 or lower*/
34
+ .xdsoft_datetimepicker button {
35
+ border: none !important;
36
+ }
37
+
38
+ .xdsoft_noselect {
39
+ -webkit-touch-callout: none;
40
+ -webkit-user-select: none;
41
+ -khtml-user-select: none;
42
+ -moz-user-select: none;
43
+ -ms-user-select: none;
44
+ -o-user-select: none;
45
+ user-select: none;
46
+ }
47
+
48
+ .xdsoft_noselect::selection { background: transparent }
49
+ .xdsoft_noselect::-moz-selection { background: transparent }
50
+
51
+ .xdsoft_datetimepicker.xdsoft_inline {
52
+ display: inline-block;
53
+ position: static;
54
+ box-shadow: none;
55
+ }
56
+
57
+ .xdsoft_datetimepicker * {
58
+ -moz-box-sizing: border-box;
59
+ box-sizing: border-box;
60
+ padding: 0;
61
+ margin: 0;
62
+ }
63
+
64
+ .xdsoft_datetimepicker .xdsoft_datepicker, .xdsoft_datetimepicker .xdsoft_timepicker {
65
+ display: none;
66
+ }
67
+
68
+ .xdsoft_datetimepicker .xdsoft_datepicker.active, .xdsoft_datetimepicker .xdsoft_timepicker.active {
69
+ display: block;
70
+ }
71
+
72
+ .xdsoft_datetimepicker .xdsoft_datepicker {
73
+ width: 224px;
74
+ float: left;
75
+ margin-left: 8px;
76
+ }
77
+ .xdsoft_datetimepicker.xdsoft_rtl .xdsoft_datepicker {
78
+ float: right;
79
+ margin-right: 8px;
80
+ margin-left: 0;
81
+ }
82
+
83
+ .xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_datepicker {
84
+ width: 256px;
85
+ }
86
+
87
+ .xdsoft_datetimepicker .xdsoft_timepicker {
88
+ width: 58px;
89
+ float: left;
90
+ text-align: center;
91
+ margin-left: 8px;
92
+ margin-top: 0;
93
+ }
94
+ .xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker {
95
+ float: right;
96
+ margin-right: 8px;
97
+ margin-left: 0;
98
+ }
99
+
100
+ .xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker {
101
+ margin-top: 8px;
102
+ margin-bottom: 3px
103
+ }
104
+
105
+ .xdsoft_datetimepicker .xdsoft_monthpicker {
106
+ position: relative;
107
+ text-align: center;
108
+ }
109
+
110
+ .xdsoft_datetimepicker .xdsoft_label i,
111
+ .xdsoft_datetimepicker .xdsoft_prev,
112
+ .xdsoft_datetimepicker .xdsoft_next,
113
+ .xdsoft_datetimepicker .xdsoft_today_button {
114
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC);
115
+ }
116
+
117
+ .xdsoft_datetimepicker .xdsoft_label i {
118
+ opacity: 0.5;
119
+ background-position: -92px -19px;
120
+ display: inline-block;
121
+ width: 9px;
122
+ height: 20px;
123
+ vertical-align: middle;
124
+ }
125
+
126
+ .xdsoft_datetimepicker .xdsoft_prev {
127
+ float: left;
128
+ background-position: -20px 0;
129
+ }
130
+ .xdsoft_datetimepicker .xdsoft_today_button {
131
+ float: left;
132
+ background-position: -70px 0;
133
+ margin-left: 5px;
134
+ }
135
+
136
+ .xdsoft_datetimepicker .xdsoft_next {
137
+ float: right;
138
+ background-position: 0 0;
139
+ }
140
+
141
+ .xdsoft_datetimepicker .xdsoft_next,
142
+ .xdsoft_datetimepicker .xdsoft_prev ,
143
+ .xdsoft_datetimepicker .xdsoft_today_button {
144
+ background-color: transparent;
145
+ background-repeat: no-repeat;
146
+ border: 0 none;
147
+ cursor: pointer;
148
+ display: block;
149
+ height: 30px;
150
+ opacity: 0.5;
151
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
152
+ outline: medium none;
153
+ overflow: hidden;
154
+ padding: 0;
155
+ position: relative;
156
+ text-indent: 100%;
157
+ white-space: nowrap;
158
+ width: 20px;
159
+ min-width: 0;
160
+ }
161
+
162
+ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev,
163
+ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next {
164
+ float: none;
165
+ background-position: -40px -15px;
166
+ height: 15px;
167
+ width: 30px;
168
+ display: block;
169
+ margin-left: 14px;
170
+ margin-top: 7px;
171
+ }
172
+ .xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_prev,
173
+ .xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_next {
174
+ float: none;
175
+ margin-left: 0;
176
+ margin-right: 14px;
177
+ }
178
+
179
+ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev {
180
+ background-position: -40px 0;
181
+ margin-bottom: 7px;
182
+ margin-top: 0;
183
+ }
184
+
185
+ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box {
186
+ height: 151px;
187
+ overflow: hidden;
188
+ border-bottom: 1px solid #ddd;
189
+ }
190
+
191
+ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div {
192
+ background: #f5f5f5;
193
+ border-top: 1px solid #ddd;
194
+ color: #666;
195
+ font-size: 12px;
196
+ text-align: center;
197
+ border-collapse: collapse;
198
+ cursor: pointer;
199
+ border-bottom-width: 0;
200
+ height: 25px;
201
+ line-height: 25px;
202
+ }
203
+
204
+ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div > div:first-child {
205
+ border-top-width: 0;
206
+ }
207
+
208
+ .xdsoft_datetimepicker .xdsoft_today_button:hover,
209
+ .xdsoft_datetimepicker .xdsoft_next:hover,
210
+ .xdsoft_datetimepicker .xdsoft_prev:hover {
211
+ opacity: 1;
212
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
213
+ }
214
+
215
+ .xdsoft_datetimepicker .xdsoft_label {
216
+ display: inline;
217
+ position: relative;
218
+ z-index: 9999;
219
+ margin: 0;
220
+ padding: 5px 3px;
221
+ font-size: 14px;
222
+ line-height: 20px;
223
+ font-weight: bold;
224
+ background-color: #fff;
225
+ float: left;
226
+ width: 182px;
227
+ text-align: center;
228
+ cursor: pointer;
229
+ }
230
+
231
+ .xdsoft_datetimepicker .xdsoft_label:hover>span {
232
+ text-decoration: underline;
233
+ }
234
+
235
+ .xdsoft_datetimepicker .xdsoft_label:hover i {
236
+ opacity: 1.0;
237
+ }
238
+
239
+ .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select {
240
+ border: 1px solid #ccc;
241
+ position: absolute;
242
+ right: 0;
243
+ top: 30px;
244
+ z-index: 101;
245
+ display: none;
246
+ background: #fff;
247
+ max-height: 160px;
248
+ overflow-y: hidden;
249
+ }
250
+
251
+ .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_monthselect{ right: -7px }
252
+ .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_yearselect{ right: 2px }
253
+ .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover {
254
+ color: #fff;
255
+ background: #ff8000;
256
+ }
257
+
258
+ .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option {
259
+ padding: 2px 10px 2px 5px;
260
+ text-decoration: none !important;
261
+ }
262
+
263
+ .xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current {
264
+ background: #33aaff;
265
+ box-shadow: #178fe5 0 1px 3px 0 inset;
266
+ color: #fff;
267
+ font-weight: 700;
268
+ }
269
+
270
+ .xdsoft_datetimepicker .xdsoft_month {
271
+ width: 100px;
272
+ text-align: right;
273
+ }
274
+
275
+ .xdsoft_datetimepicker .xdsoft_calendar {
276
+ clear: both;
277
+ }
278
+
279
+ .xdsoft_datetimepicker .xdsoft_year{
280
+ width: 48px;
281
+ margin-left: 5px;
282
+ }
283
+
284
+ .xdsoft_datetimepicker .xdsoft_calendar table {
285
+ border-collapse: collapse;
286
+ width: 100%;
287
+
288
+ }
289
+
290
+ .xdsoft_datetimepicker .xdsoft_calendar td > div {
291
+ padding-right: 5px;
292
+ }
293
+
294
+ .xdsoft_datetimepicker .xdsoft_calendar th {
295
+ height: 25px;
296
+ }
297
+
298
+ .xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th {
299
+ width: 14.2857142%;
300
+ background: #f5f5f5;
301
+ border: 1px solid #ddd;
302
+ color: #666;
303
+ font-size: 12px;
304
+ text-align: right;
305
+ vertical-align: middle;
306
+ padding: 0;
307
+ border-collapse: collapse;
308
+ cursor: pointer;
309
+ height: 25px;
310
+ }
311
+ .xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th {
312
+ width: 12.5%;
313
+ }
314
+
315
+ .xdsoft_datetimepicker .xdsoft_calendar th {
316
+ background: #f1f1f1;
317
+ }
318
+
319
+ .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today {
320
+ color: #33aaff;
321
+ }
322
+
323
+ .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default {
324
+ background: #ffe9d2;
325
+ box-shadow: #ffb871 0 1px 4px 0 inset;
326
+ color: #000;
327
+ }
328
+ .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint {
329
+ background: #c1ffc9;
330
+ box-shadow: #00dd1c 0 1px 4px 0 inset;
331
+ color: #000;
332
+ }
333
+
334
+ .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,
335
+ .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
336
+ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current {
337
+ background: #33aaff;
338
+ box-shadow: #178fe5 0 1px 3px 0 inset;
339
+ color: #fff;
340
+ font-weight: 700;
341
+ }
342
+
343
+ .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month,
344
+ .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled,
345
+ .xdsoft_datetimepicker .xdsoft_time_box >div >div.xdsoft_disabled {
346
+ opacity: 0.5;
347
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
348
+ cursor: default;
349
+ }
350
+
351
+ .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled {
352
+ opacity: 0.2;
353
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
354
+ }
355
+
356
+ .xdsoft_datetimepicker .xdsoft_calendar td:hover,
357
+ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div:hover {
358
+ color: #fff !important;
359
+ background: #ff8000 !important;
360
+ box-shadow: none !important;
361
+ }
362
+
363
+ .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover,
364
+ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover {
365
+ background: #33aaff !important;
366
+ box-shadow: #178fe5 0 1px 3px 0 inset !important;
367
+ color: #fff !important;
368
+ }
369
+
370
+ .xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover,
371
+ .xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_disabled:hover {
372
+ color: inherit !important;
373
+ background: inherit !important;
374
+ box-shadow: inherit !important;
375
+ }
376
+
377
+ .xdsoft_datetimepicker .xdsoft_calendar th {
378
+ font-weight: 700;
379
+ text-align: center;
380
+ color: #999;
381
+ cursor: default;
382
+ }
383
+
384
+ .xdsoft_datetimepicker .xdsoft_copyright {
385
+ color: #ccc !important;
386
+ font-size: 10px;
387
+ clear: both;
388
+ float: none;
389
+ margin-left: 8px;
390
+ }
391
+
392
+ .xdsoft_datetimepicker .xdsoft_copyright a { color: #eee !important }
393
+ .xdsoft_datetimepicker .xdsoft_copyright a:hover { color: #aaa !important }
394
+
395
+ .xdsoft_time_box {
396
+ position: relative;
397
+ border: 1px solid #ccc;
398
+ }
399
+ .xdsoft_scrollbar >.xdsoft_scroller {
400
+ background: #ccc !important;
401
+ height: 20px;
402
+ border-radius: 3px;
403
+ }
404
+ .xdsoft_scrollbar {
405
+ position: absolute;
406
+ width: 7px;
407
+ right: 0;
408
+ top: 0;
409
+ bottom: 0;
410
+ cursor: pointer;
411
+ }
412
+ .xdsoft_datetimepicker.xdsoft_rtl .xdsoft_scrollbar {
413
+ left: 0;
414
+ right: auto;
415
+ }
416
+ .xdsoft_scroller_box {
417
+ position: relative;
418
+ }
419
+
420
+ .xdsoft_datetimepicker.xdsoft_dark {
421
+ box-shadow: 0 5px 15px -5px rgba(255, 255, 255, 0.506);
422
+ background: #000;
423
+ border-bottom: 1px solid #444;
424
+ border-left: 1px solid #333;
425
+ border-right: 1px solid #333;
426
+ border-top: 1px solid #333;
427
+ color: #ccc;
428
+ }
429
+
430
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box {
431
+ border-bottom: 1px solid #222;
432
+ }
433
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div {
434
+ background: #0a0a0a;
435
+ border-top: 1px solid #222;
436
+ color: #999;
437
+ }
438
+
439
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_label {
440
+ background-color: #000;
441
+ }
442
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select {
443
+ border: 1px solid #333;
444
+ background: #000;
445
+ }
446
+
447
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover {
448
+ color: #000;
449
+ background: #007fff;
450
+ }
451
+
452
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current {
453
+ background: #cc5500;
454
+ box-shadow: #b03e00 0 1px 3px 0 inset;
455
+ color: #000;
456
+ }
457
+
458
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i,
459
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev,
460
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_next,
461
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button {
462
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==);
463
+ }
464
+
465
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td,
466
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
467
+ background: #0a0a0a;
468
+ border: 1px solid #222;
469
+ color: #999;
470
+ }
471
+
472
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
473
+ background: #0e0e0e;
474
+ }
475
+
476
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today {
477
+ color: #cc5500;
478
+ }
479
+
480
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_default {
481
+ background: #ffe9d2;
482
+ box-shadow: #ffb871 0 1px 4px 0 inset;
483
+ color:#000;
484
+ }
485
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_mint {
486
+ background: #c1ffc9;
487
+ box-shadow: #00dd1c 0 1px 4px 0 inset;
488
+ color:#000;
489
+ }
490
+
491
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default,
492
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current,
493
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current {
494
+ background: #cc5500;
495
+ box-shadow: #b03e00 0 1px 3px 0 inset;
496
+ color: #000;
497
+ }
498
+
499
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover,
500
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div:hover {
501
+ color: #000 !important;
502
+ background: #007fff !important;
503
+ }
504
+
505
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
506
+ color: #666;
507
+ }
508
+
509
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright { color: #333 !important }
510
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a { color: #111 !important }
511
+ .xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover { color: #555 !important }
512
+
513
+ .xdsoft_dark .xdsoft_time_box {
514
+ border: 1px solid #333;
515
+ }
516
+
517
+ .xdsoft_dark .xdsoft_scrollbar >.xdsoft_scroller {
518
+ background: #333 !important;
519
+ }
520
+ .xdsoft_datetimepicker .xdsoft_save_selected {
521
+ display: block;
522
+ border: 1px solid #dddddd !important;
523
+ margin-top: 5px;
524
+ width: 100%;
525
+ color: #454551;
526
+ font-size: 13px;
527
+ }
528
+ .xdsoft_datetimepicker .blue-gradient-button {
529
+ font-family: "museo-sans", "Book Antiqua", sans-serif;
530
+ font-size: 12px;
531
+ font-weight: 300;
532
+ color: #82878c;
533
+ height: 28px;
534
+ position: relative;
535
+ padding: 4px 17px 4px 33px;
536
+ border: 1px solid #d7d8da;
537
+ background: -moz-linear-gradient(top, #fff 0%, #f4f8fa 73%);
538
+ /* FF3.6+ */
539
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(73%, #f4f8fa));
540
+ /* Chrome,Safari4+ */
541
+ background: -webkit-linear-gradient(top, #fff 0%, #f4f8fa 73%);
542
+ /* Chrome10+,Safari5.1+ */
543
+ background: -o-linear-gradient(top, #fff 0%, #f4f8fa 73%);
544
+ /* Opera 11.10+ */
545
+ background: -ms-linear-gradient(top, #fff 0%, #f4f8fa 73%);
546
+ /* IE10+ */
547
+ background: linear-gradient(to bottom, #fff 0%, #f4f8fa 73%);
548
+ /* W3C */
549
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff', endColorstr='#f4f8fa',GradientType=0 );
550
+ /* IE6-9 */
551
+ }
552
+ .xdsoft_datetimepicker .blue-gradient-button:hover, .xdsoft_datetimepicker .blue-gradient-button:focus, .xdsoft_datetimepicker .blue-gradient-button:hover span, .xdsoft_datetimepicker .blue-gradient-button:focus span {
553
+ color: #454551;
554
+ background: -moz-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
555
+ /* FF3.6+ */
556
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4f8fa), color-stop(73%, #FFF));
557
+ /* Chrome,Safari4+ */
558
+ background: -webkit-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
559
+ /* Chrome10+,Safari5.1+ */
560
+ background: -o-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
561
+ /* Opera 11.10+ */
562
+ background: -ms-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
563
+ /* IE10+ */
564
+ background: linear-gradient(to bottom, #f4f8fa 0%, #FFF 73%);
565
+ /* W3C */
566
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f8fa', endColorstr='#FFF',GradientType=0 );
567
+ /* IE6-9 */
568
+ }
css/qsm-admin-question.css CHANGED
@@ -153,6 +153,17 @@
153
  clear: both;
154
  }
155
 
 
 
 
 
 
 
 
 
 
 
 
156
  .question-bank-question div {
157
  margin: 0 10px;
158
  }
153
  clear: both;
154
  }
155
 
156
+ .qsm-select-all-label {
157
+ margin-right: 5px;
158
+ position: relative;
159
+ top: 5px;
160
+ vertical-align: top;
161
+ }
162
+
163
+ #qsm-import-selected-question{
164
+ margin-right: 30px;
165
+ }
166
+
167
  .question-bank-question div {
168
  margin: 0 10px;
169
  }
css/qsm-admin.css CHANGED
@@ -475,7 +475,7 @@ Options Page
475
  Results Pages & Emails Tab
476
  *********************/
477
  .results-page,
478
- #emails .email {
479
  width: 100%;
480
  background-color: #fff;
481
  margin: 20px 0;
@@ -484,7 +484,7 @@ Results Pages & Emails Tab
484
  }
485
 
486
  .results-page .results-page-content,
487
- #emails .email .email-content{
488
  background: #fff;
489
  padding-right: 15px;
490
  padding-left: 15px;
@@ -493,7 +493,7 @@ Results Pages & Emails Tab
493
  }
494
 
495
  .results-page-header,
496
- #emails .email-header {
497
  display: flex;
498
  align-items: center;
499
  justify-content: flex-end;
@@ -503,7 +503,7 @@ Results Pages & Emails Tab
503
  }
504
 
505
  .delete-page-button,
506
- #emails .delete-email-button {
507
  background: none;
508
  border: none;
509
  color: #dc3232;
@@ -512,12 +512,12 @@ Results Pages & Emails Tab
512
  }
513
 
514
  .delete-page-button:hover,
515
- #emails .delete-email-button:hover {
516
  transform: scale(1.2);
517
  }
518
 
519
  .results-page-content,
520
- .email-content {
521
  display: flex;
522
  flex-direction: column;
523
  }
@@ -597,7 +597,7 @@ Results Pages & Emails Tab
597
 
598
  @media screen and (min-width: 760px) {
599
  .results-page-content,
600
- .email-content {
601
  flex-direction: row;
602
  justify-content: space-around;
603
  }
475
  Results Pages & Emails Tab
476
  *********************/
477
  .results-page,
478
+ #qsm_emails .qsm-email {
479
  width: 100%;
480
  background-color: #fff;
481
  margin: 20px 0;
484
  }
485
 
486
  .results-page .results-page-content,
487
+ #qsm_emails .qsm-email .qsm-email-content{
488
  background: #fff;
489
  padding-right: 15px;
490
  padding-left: 15px;
493
  }
494
 
495
  .results-page-header,
496
+ #qsm_emails .qsm-email-header {
497
  display: flex;
498
  align-items: center;
499
  justify-content: flex-end;
503
  }
504
 
505
  .delete-page-button,
506
+ #qsm_emails .delete-email-button {
507
  background: none;
508
  border: none;
509
  color: #dc3232;
512
  }
513
 
514
  .delete-page-button:hover,
515
+ #qsm_emails .delete-email-button:hover {
516
  transform: scale(1.2);
517
  }
518
 
519
  .results-page-content,
520
+ .qsm-email-content {
521
  display: flex;
522
  flex-direction: column;
523
  }
597
 
598
  @media screen and (min-width: 760px) {
599
  .results-page-content,
600
+ .qsm-email-content {
601
  flex-direction: row;
602
  justify-content: space-around;
603
  }
js/admin.js CHANGED
@@ -217,7 +217,7 @@ var QSMAdmin;
217
  text_msg = text_msg.replace(/\n/g,"<br>");
218
  tinyMCE.get( 'qsm_question_text_message' ).setContent( text_msg );
219
  }
220
- tinyMCE.get( 'qsm_question_text_message' ).setContent( text_msg );
221
  jQuery( '.qsm-text-allowed-variables > .qsm-text-variable-wrap' ).html('').html( data.allowed_variable_text );
222
  jQuery('.qsm-text-main-wrap .qsm-text-tab-message-loader').hide();
223
  } else {
@@ -244,7 +244,15 @@ var QSMAdmin;
244
  //On click append on tiny mce
245
  jQuery( document ).on( 'click', '.qsm-text-allowed-variables button.button' , function(){
246
  var content = jQuery(this).text();
247
- tinyMCE.activeEditor.execCommand('mceInsertContent', false, content);
 
 
 
 
 
 
 
 
248
  });
249
  //Show all the variable list
250
  jQuery('.qsm-show-all-variable-text').click(function (e) {
@@ -296,7 +304,7 @@ var QSMAdmin;
296
  $(this).parents('tr').next('tr').show();
297
  }
298
  });
299
- $(document).on('click', '.qsm-text-template-span > .button', function(e){
300
  e.preventDefault();
301
  var $temp = $("<input>");
302
  $("body").append($temp);
217
  text_msg = text_msg.replace(/\n/g,"<br>");
218
  tinyMCE.get( 'qsm_question_text_message' ).setContent( text_msg );
219
  }
220
+ //tinyMCE.get( 'qsm_question_text_message' ).setContent( text_msg );
221
  jQuery( '.qsm-text-allowed-variables > .qsm-text-variable-wrap' ).html('').html( data.allowed_variable_text );
222
  jQuery('.qsm-text-main-wrap .qsm-text-tab-message-loader').hide();
223
  } else {
244
  //On click append on tiny mce
245
  jQuery( document ).on( 'click', '.qsm-text-allowed-variables button.button' , function(){
246
  var content = jQuery(this).text();
247
+ if( jQuery('.qsm-question-text-tab .html-active').length > 0 ){
248
+ var $txt = jQuery("#qsm_question_text_message");
249
+ var caretPos = $txt[0].selectionStart;
250
+ var textAreaTxt = $txt.val();
251
+ var txtToAdd = content;
252
+ $txt.val(textAreaTxt.substring(0, caretPos) + txtToAdd + textAreaTxt.substring(caretPos) );
253
+ }else{
254
+ tinyMCE.activeEditor.execCommand('mceInsertContent', false, content);
255
+ }
256
  });
257
  //Show all the variable list
258
  jQuery('.qsm-show-all-variable-text').click(function (e) {
304
  $(this).parents('tr').next('tr').show();
305
  }
306
  });
307
+ $(document).on('click', '#show-all-variable .qsm-text-template-span > .button', function(e){
308
  e.preventDefault();
309
  var $temp = $("<input>");
310
  $("body").append($temp);
js/jquery.datetimepicker.full.min.js ADDED
@@ -0,0 +1 @@
 
1
+ var DateFormatter;!function(){"use strict";var D,s,r,a,n;D=function(e,t){return"string"==typeof e&&"string"==typeof t&&e.toLowerCase()===t.toLowerCase()},s=function(e,t,a){var n=a||"0",r=e.toString();return r.length<t?s(n+r,t):r},r=function(e){var t,a;for(e=e||{},t=1;t<arguments.length;t++)if(a=arguments[t])for(var n in a)a.hasOwnProperty(n)&&("object"==typeof a[n]?r(e[n],a[n]):e[n]=a[n]);return e},a=function(e,t){for(var a=0;a<t.length;a++)if(t[a].toLowerCase()===e.toLowerCase())return a;return-1},n={dateSettings:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["AM","PM"],ordinal:function(e){var t=e%10,a={1:"st",2:"nd",3:"rd"};return 1!==Math.floor(e%100/10)&&a[t]?a[t]:"th"}},separators:/[ \-+\/\.T:@]/g,validParts:/[dDjlNSwzWFmMntLoYyaABgGhHisueTIOPZcrU]/g,intParts:/[djwNzmnyYhHgGis]/g,tzParts:/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,tzClip:/[^-+\dA-Z]/g},(DateFormatter=function(e){var t=this,a=r(n,e);t.dateSettings=a.dateSettings,t.separators=a.separators,t.validParts=a.validParts,t.intParts=a.intParts,t.tzParts=a.tzParts,t.tzClip=a.tzClip}).prototype={constructor:DateFormatter,getMonth:function(e){var t;return 0===(t=a(e,this.dateSettings.monthsShort)+1)&&(t=a(e,this.dateSettings.months)+1),t},parseDate:function(e,t){var a,n,r,o,i,s,d,u,l,f,c=this,m=!1,h=!1,g=c.dateSettings,p={date:null,year:null,month:null,day:null,hour:0,min:0,sec:0};if(!e)return null;if(e instanceof Date)return e;if("U"===t)return(r=parseInt(e))?new Date(1e3*r):e;switch(typeof e){case"number":return new Date(e);case"string":break;default:return null}if(!(a=t.match(c.validParts))||0===a.length)throw new Error("Invalid date format definition.");for(n=e.replace(c.separators,"\0").split("\0"),r=0;r<n.length;r++)switch(o=n[r],i=parseInt(o),a[r]){case"y":case"Y":if(!i)return null;l=o.length,p.year=2===l?parseInt((i<70?"20":"19")+o):i,m=!0;break;case"m":case"n":case"M":case"F":if(isNaN(i)){if(!(0<(s=c.getMonth(o))))return null;p.month=s}else{if(!(1<=i&&i<=12))return null;p.month=i}m=!0;break;case"d":case"j":if(!(1<=i&&i<=31))return null;p.day=i,m=!0;break;case"g":case"h":if(f=n[d=-1<a.indexOf("a")?a.indexOf("a"):-1<a.indexOf("A")?a.indexOf("A"):-1],-1<d)u=D(f,g.meridiem[0])?0:D(f,g.meridiem[1])?12:-1,1<=i&&i<=12&&-1<u?p.hour=i+u-1:0<=i&&i<=23&&(p.hour=i);else{if(!(0<=i&&i<=23))return null;p.hour=i}h=!0;break;case"G":case"H":if(!(0<=i&&i<=23))return null;p.hour=i,h=!0;break;case"i":if(!(0<=i&&i<=59))return null;p.min=i,h=!0;break;case"s":if(!(0<=i&&i<=59))return null;p.sec=i,h=!0}if(!0===m&&p.year&&p.month&&p.day)p.date=new Date(p.year,p.month-1,p.day,p.hour,p.min,p.sec,0);else{if(!0!==h)return null;p.date=new Date(0,0,0,p.hour,p.min,p.sec,0)}return p.date},guessDate:function(e,t){if("string"!=typeof e)return e;var a,n,r,o,i,s,d=e.replace(this.separators,"\0").split("\0"),u=t.match(this.validParts),l=new Date,f=0;if(!/^[djmn]/g.test(u[0]))return e;for(r=0;r<d.length;r++){if(f=2,i=d[r],s=parseInt(i.substr(0,2)),isNaN(s))return null;switch(r){case 0:"m"===u[0]||"n"===u[0]?l.setMonth(s-1):l.setDate(s);break;case 1:"m"===u[0]||"n"===u[0]?l.setDate(s):l.setMonth(s-1);break;case 2:if(n=l.getFullYear(),f=(a=i.length)<4?a:4,!(n=parseInt(a<4?n.toString().substr(0,4-a)+i:i.substr(0,4))))return null;l.setFullYear(n);break;case 3:l.setHours(s);break;case 4:l.setMinutes(s);break;case 5:l.setSeconds(s)}0<(o=i.substr(f)).length&&d.splice(r+1,0,o)}return l},parseFormat:function(e,n){var a,t=this,r=t.dateSettings,o=/\\?(.?)/gi,i=function(e,t){return a[e]?a[e]():t};return a={d:function(){return s(a.j(),2)},D:function(){return r.daysShort[a.w()]},j:function(){return n.getDate()},l:function(){return r.days[a.w()]},N:function(){return a.w()||7},w:function(){return n.getDay()},z:function(){var e=new Date(a.Y(),a.n()-1,a.j()),t=new Date(a.Y(),0,1);return Math.round((e-t)/864e5)},W:function(){var e=new Date(a.Y(),a.n()-1,a.j()-a.N()+3),t=new Date(e.getFullYear(),0,4);return s(1+Math.round((e-t)/864e5/7),2)},F:function(){return r.months[n.getMonth()]},m:function(){return s(a.n(),2)},M:function(){return r.monthsShort[n.getMonth()]},n:function(){return n.getMonth()+1},t:function(){return new Date(a.Y(),a.n(),0).getDate()},L:function(){var e=a.Y();return e%4==0&&e%100!=0||e%400==0?1:0},o:function(){var e=a.n(),t=a.W();return a.Y()+(12===e&&t<9?1:1===e&&9<t?-1:0)},Y:function(){return n.getFullYear()},y:function(){return a.Y().toString().slice(-2)},a:function(){return a.A().toLowerCase()},A:function(){var e=a.G()<12?0:1;return r.meridiem[e]},B:function(){var e=3600*n.getUTCHours(),t=60*n.getUTCMinutes(),a=n.getUTCSeconds();return s(Math.floor((e+t+a+3600)/86.4)%1e3,3)},g:function(){return a.G()%12||12},G:function(){return n.getHours()},h:function(){return s(a.g(),2)},H:function(){return s(a.G(),2)},i:function(){return s(n.getMinutes(),2)},s:function(){return s(n.getSeconds(),2)},u:function(){return s(1e3*n.getMilliseconds(),6)},e:function(){return/\((.*)\)/.exec(String(n))[1]||"Coordinated Universal Time"},I:function(){return new Date(a.Y(),0)-Date.UTC(a.Y(),0)!=new Date(a.Y(),6)-Date.UTC(a.Y(),6)?1:0},O:function(){var e=n.getTimezoneOffset(),t=Math.abs(e);return(0<e?"-":"+")+s(100*Math.floor(t/60)+t%60,4)},P:function(){var e=a.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return(String(n).match(t.tzParts)||[""]).pop().replace(t.tzClip,"")||"UTC"},Z:function(){return 60*-n.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(o,i)},r:function(){return"D, d M Y H:i:s O".replace(o,i)},U:function(){return n.getTime()/1e3||0}},i(e,e)},formatDate:function(e,t){var a,n,r,o,i,s="";if("string"==typeof e&&!(e=this.parseDate(e,t)))return null;if(e instanceof Date){for(r=t.length,a=0;a<r;a++)"S"!==(i=t.charAt(a))&&"\\"!==i&&(0<a&&"\\"===t.charAt(a-1)?s+=i:(o=this.parseFormat(i,e),a!==r-1&&this.intParts.test(i)&&"S"===t.charAt(a+1)&&(n=parseInt(o)||0,o+=this.dateSettings.ordinal(n)),s+=o));return s}return""}}}();var datetimepickerFactory=function(L){"use strict";var s={i18n:{ar:{months:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],dayOfWeekShort:["ن","ث","ع","خ","ج","س","ح"],dayOfWeek:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"]},ro:{months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],dayOfWeekShort:["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],dayOfWeek:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă"]},id:{months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],dayOfWeekShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],dayOfWeek:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},is:{months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],dayOfWeekShort:["Sun","Mán","Þrið","Mið","Fim","Fös","Lau"],dayOfWeek:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur"]},bg:{months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],dayOfWeekShort:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],dayOfWeek:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота"]},fa:{months:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],dayOfWeekShort:["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],dayOfWeek:["یک‌شنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنج‌شنبه","جمعه","شنبه","یک‌شنبه"]},ru:{months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayOfWeekShort:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],dayOfWeek:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"]},uk:{months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],dayOfWeekShort:["Ндл","Пнд","Втр","Срд","Чтв","Птн","Сбт"],dayOfWeek:["Неділя","Понеділок","Вівторок","Середа","Четвер","П'ятниця","Субота"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},el:{months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],dayOfWeekShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],dayOfWeek:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],dayOfWeekShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayOfWeek:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},nl:{months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],dayOfWeekShort:["zo","ma","di","wo","do","vr","za"],dayOfWeek:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},tr:{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],dayOfWeekShort:["Paz","Pts","Sal","Çar","Per","Cum","Cts"],dayOfWeek:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayOfWeekShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],dayOfWeek:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayOfWeekShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],dayOfWeek:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"]},th:{months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],dayOfWeekShort:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],dayOfWeek:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"]},pl:{months:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],dayOfWeekShort:["nd","pn","wt","śr","cz","pt","sb"],dayOfWeek:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},pt:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},ch:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"]},se:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},km:{months:["មករា​","កុម្ភៈ","មិនា​","មេសា​","ឧសភា​","មិថុនា​","កក្កដា​","សីហា​","កញ្ញា​","តុលា​","វិច្ឆិកា","ធ្នូ​"],dayOfWeekShort:["អាទិ​","ច័ន្ទ​","អង្គារ​","ពុធ​","ព្រហ​​","សុក្រ​","សៅរ៍"],dayOfWeek:["អាទិត្យ​","ច័ន្ទ​","អង្គារ​","ពុធ​","ព្រហស្បតិ៍​","សុក្រ​","សៅរ៍"]},kr:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeekShort:["일","월","화","수","목","금","토"],dayOfWeek:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dayOfWeek:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"]},da:{months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"]},ja:{months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeekShort:["日","月","火","水","木","金","土"],dayOfWeek:["日曜","月曜","火曜","水曜","木曜","金曜","土曜"]},vi:{months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],dayOfWeekShort:["CN","T2","T3","T4","T5","T6","T7"],dayOfWeek:["Chủ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu","Thứ bảy"]},sl:{months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],dayOfWeekShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"],dayOfWeek:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"]},cs:{months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],dayOfWeekShort:["Ne","Po","Út","St","Čt","Pá","So"]},hu:{months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],dayOfWeekShort:["Va","Hé","Ke","Sze","Cs","Pé","Szo"],dayOfWeek:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"]},az:{months:["Yanvar","Fevral","Mart","Aprel","May","Iyun","Iyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],dayOfWeekShort:["B","Be","Ça","Ç","Ca","C","Ş"],dayOfWeek:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"]},bs:{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},ca:{months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],dayOfWeekShort:["Dg","Dl","Dt","Dc","Dj","Dv","Ds"],dayOfWeek:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"]},"en-GB":{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},et:{months:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],dayOfWeekShort:["P","E","T","K","N","R","L"],dayOfWeek:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev"]},eu:{months:["Urtarrila","Otsaila","Martxoa","Apirila","Maiatza","Ekaina","Uztaila","Abuztua","Iraila","Urria","Azaroa","Abendua"],dayOfWeekShort:["Ig.","Al.","Ar.","Az.","Og.","Or.","La."],dayOfWeek:["Igandea","Astelehena","Asteartea","Asteazkena","Osteguna","Ostirala","Larunbata"]},fi:{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],dayOfWeekShort:["Su","Ma","Ti","Ke","To","Pe","La"],dayOfWeek:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"]},gl:{months:["Xan","Feb","Maz","Abr","Mai","Xun","Xul","Ago","Set","Out","Nov","Dec"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Xov","Ven","Sab"],dayOfWeek:["Domingo","Luns","Martes","Mércores","Xoves","Venres","Sábado"]},hr:{months:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],dayOfWeekShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},ko:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeekShort:["일","월","화","수","목","금","토"],dayOfWeek:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},lt:{months:["Sausio","Vasario","Kovo","Balandžio","Gegužės","Birželio","Liepos","Rugpjūčio","Rugsėjo","Spalio","Lapkričio","Gruodžio"],dayOfWeekShort:["Sek","Pir","Ant","Tre","Ket","Pen","Šeš"],dayOfWeek:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis"]},lv:{months:["Janvāris","Februāris","Marts","Aprīlis ","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],dayOfWeekShort:["Sv","Pr","Ot","Tr","Ct","Pk","St"],dayOfWeek:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena"]},mk:{months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],dayOfWeekShort:["нед","пон","вто","сре","чет","пет","саб"],dayOfWeek:["Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота"]},mn:{months:["1-р сар","2-р сар","3-р сар","4-р сар","5-р сар","6-р сар","7-р сар","8-р сар","9-р сар","10-р сар","11-р сар","12-р сар"],dayOfWeekShort:["Дав","Мяг","Лха","Пүр","Бсн","Бям","Ням"],dayOfWeek:["Даваа","Мягмар","Лхагва","Пүрэв","Баасан","Бямба","Ням"]},"pt-BR":{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},sk:{months:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],dayOfWeekShort:["Ne","Po","Ut","St","Št","Pi","So"],dayOfWeek:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"]},sq:{months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],dayOfWeekShort:["Die","Hën","Mar","Mër","Enj","Pre","Shtu"],dayOfWeek:["E Diel","E Hënë","E Martē","E Mërkurë","E Enjte","E Premte","E Shtunë"]},"sr-YU":{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sre","čet","Pet","Sub"],dayOfWeek:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota"]},sr:{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],dayOfWeekShort:["нед","пон","уто","сре","чет","пет","суб"],dayOfWeek:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота"]},sv:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"],dayOfWeek:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"]},"zh-TW":{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},zh:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},ug:{months:["1-ئاي","2-ئاي","3-ئاي","4-ئاي","5-ئاي","6-ئاي","7-ئاي","8-ئاي","9-ئاي","10-ئاي","11-ئاي","12-ئاي"],dayOfWeek:["يەكشەنبە","دۈشەنبە","سەيشەنبە","چارشەنبە","پەيشەنبە","جۈمە","شەنبە"]},he:{months:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],dayOfWeekShort:["א'","ב'","ג'","ד'","ה'","ו'","שבת"],dayOfWeek:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת","ראשון"]},hy:{months:["Հունվար","Փետրվար","Մարտ","Ապրիլ","Մայիս","Հունիս","Հուլիս","Օգոստոս","Սեպտեմբեր","Հոկտեմբեր","Նոյեմբեր","Դեկտեմբեր"],dayOfWeekShort:["Կի","Երկ","Երք","Չոր","Հնգ","Ուրբ","Շբթ"],dayOfWeek:["Կիրակի","Երկուշաբթի","Երեքշաբթի","Չորեքշաբթի","Հինգշաբթի","Ուրբաթ","Շաբաթ"]},kg:{months:["Үчтүн айы","Бирдин айы","Жалган Куран","Чын Куран","Бугу","Кулжа","Теке","Баш Оона","Аяк Оона","Тогуздун айы","Жетинин айы","Бештин айы"],dayOfWeekShort:["Жек","Дүй","Шей","Шар","Бей","Жум","Ише"],dayOfWeek:["Жекшемб","Дүйшөмб","Шейшемб","Шаршемб","Бейшемби","Жума","Ишенб"]},rm:{months:["Schaner","Favrer","Mars","Avrigl","Matg","Zercladur","Fanadur","Avust","Settember","October","November","December"],dayOfWeekShort:["Du","Gli","Ma","Me","Gie","Ve","So"],dayOfWeek:["Dumengia","Glindesdi","Mardi","Mesemna","Gievgia","Venderdi","Sonda"]},ka:{months:["იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","აგვისტო","სექტემბერი","ოქტომბერი","ნოემბერი","დეკემბერი"],dayOfWeekShort:["კვ","ორშ","სამშ","ოთხ","ხუთ","პარ","შაბ"],dayOfWeek:["კვირა","ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი"]}},ownerDocument:document,contentWindow:window,value:"",rtl:!1,format:"Y/m/d H:i",formatTime:"H:i",formatDate:"Y/m/d",startDate:!1,step:60,monthChangeSpinner:!0,closeOnDateSelect:!1,closeOnTimeSelect:!0,closeOnWithoutClick:!0,closeOnInputClick:!0,openOnFocus:!0,timepicker:!0,datepicker:!0,weeks:!1,defaultTime:!1,defaultDate:!1,minDate:!1,maxDate:!1,minTime:!1,maxTime:!1,minDateTime:!1,maxDateTime:!1,allowTimes:[],opened:!1,initTime:!0,inline:!1,theme:"",touchMovedThreshold:5,onSelectDate:function(){},onSelectTime:function(){},onChangeMonth:function(){},onGetWeekOfYear:function(){},onChangeYear:function(){},onChangeDateTime:function(){},onShow:function(){},onClose:function(){},onGenerate:function(){},withoutCopyright:!0,inverseButton:!1,hours12:!1,next:"xdsoft_next",prev:"xdsoft_prev",dayOfWeekStart:0,parentID:"body",timeHeightInTimePicker:25,timepickerScrollbar:!0,todayButton:!0,prevButton:!0,nextButton:!0,defaultSelect:!0,scrollMonth:!0,scrollTime:!0,scrollInput:!0,lazyInit:!1,mask:!1,validateOnBlur:!0,allowBlank:!0,yearStart:1950,yearEnd:2050,monthStart:0,monthEnd:11,style:"",id:"",fixed:!1,roundTime:"round",className:"",weekends:[],highlightedDates:[],highlightedPeriods:[],allowDates:[],allowDateRe:null,disabledDates:[],disabledWeekDays:[],yearOffset:0,beforeShowDay:null,enterLikeTab:!0,showApplyButton:!1,insideParent:!1},E=null,n=null,R="en",a={meridiem:["AM","PM"]},r=function(){var e=s.i18n[R],t={days:e.dayOfWeek,daysShort:e.dayOfWeekShort,months:e.months,monthsShort:L.map(e.months,function(e){return e.substring(0,3)})};"function"==typeof DateFormatter&&(E=n=new DateFormatter({dateSettings:L.extend({},a,t)}))},o={moment:{default_options:{format:"YYYY/MM/DD HH:mm",formatDate:"YYYY/MM/DD",formatTime:"HH:mm"},formatter:{parseDate:function(e,t){if(i(t))return n.parseDate(e,t);var a=moment(e,t);return!!a.isValid()&&a.toDate()},formatDate:function(e,t){return i(t)?n.formatDate(e,t):moment(e).format(t)},formatMask:function(e){return e.replace(/Y{4}/g,"9999").replace(/Y{2}/g,"99").replace(/M{2}/g,"19").replace(/D{2}/g,"39").replace(/H{2}/g,"29").replace(/m{2}/g,"59").replace(/s{2}/g,"59")}}}};L.datetimepicker={setLocale:function(e){var t=s.i18n[e]?e:"en";R!==t&&(R=t,r())},setDateFormatter:function(e){if("string"==typeof e&&o.hasOwnProperty(e)){var t=o[e];L.extend(s,t.default_options),E=t.formatter}else E=e}};var t={RFC_2822:"D, d M Y H:i:s O",ATOM:"Y-m-dTH:i:sP",ISO_8601:"Y-m-dTH:i:sO",RFC_822:"D, d M y H:i:s O",RFC_850:"l, d-M-y H:i:s T",RFC_1036:"D, d M y H:i:s O",RFC_1123:"D, d M Y H:i:s O",RSS:"D, d M Y H:i:s O",W3C:"Y-m-dTH:i:sP"},i=function(e){return-1!==Object.values(t).indexOf(e)};function m(e,t,a){this.date=e,this.desc=t,this.style=a}L.extend(L.datetimepicker,t),r(),window.getComputedStyle||(window.getComputedStyle=function(a){return this.el=a,this.getPropertyValue=function(e){var t=/(-([a-z]))/g;return"float"===e&&(e="styleFloat"),t.test(e)&&(e=e.replace(t,function(e,t,a){return a.toUpperCase()})),a.currentStyle[e]||null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var a,n;for(a=t||0,n=this.length;a<n;a+=1)if(this[a]===e)return a;return-1}),Date.prototype.countDaysInMonth=function(){return new Date(this.getFullYear(),this.getMonth()+1,0).getDate()},L.fn.xdsoftScroller=function(D,y){return this.each(function(){var o,i,s,d,u,l=L(this),a=function(e){var t,a={x:0,y:0};return"touchstart"===e.type||"touchmove"===e.type||"touchend"===e.type||"touchcancel"===e.type?(t=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],a.x=t.clientX,a.y=t.clientY):"mousedown"!==e.type&&"mouseup"!==e.type&&"mousemove"!==e.type&&"mouseover"!==e.type&&"mouseout"!==e.type&&"mouseenter"!==e.type&&"mouseleave"!==e.type||(a.x=e.clientX,a.y=e.clientY),a},f=0,c=100,n=!1,r=0,m=0,h=0,t=!1,g=0,p=function(){};"hide"!==y?(L(this).hasClass("xdsoft_scroller_box")||(o=l.children().eq(0),f=Math.abs(parseInt(o.css("marginTop"),10)),i=l[0].clientHeight,s=o[0].offsetHeight,d=L('<div class="xdsoft_scrollbar"></div>'),u=L('<div class="xdsoft_scroller"></div>'),d.append(u),l.addClass("xdsoft_scroller_box").append(d),p=function(e){var t=a(e).y-r+g;t<0&&(t=0),t+u[0].offsetHeight>h&&(t=h-u[0].offsetHeight),l.trigger("scroll_element.xdsoft_scroller",[c?t/c:0])},u.on("touchstart.xdsoft_scroller mousedown.xdsoft_scroller",function(e){i||l.trigger("resize_scroll.xdsoft_scroller",[y]),r=a(e).y,g=parseInt(u.css("marginTop"),10),h=d[0].offsetHeight,"mousedown"===e.type||"touchstart"===e.type?(D.ownerDocument&&L(D.ownerDocument.body).addClass("xdsoft_noselect"),L([D.ownerDocument.body,D.contentWindow]).on("touchend mouseup.xdsoft_scroller",function e(){L([D.ownerDocument.body,D.contentWindow]).off("touchend mouseup.xdsoft_scroller",e).off("mousemove.xdsoft_scroller",p).removeClass("xdsoft_noselect")}),L(D.ownerDocument.body).on("mousemove.xdsoft_scroller",p)):(t=!0,e.stopPropagation(),e.preventDefault())}).on("touchmove",function(e){t&&(e.preventDefault(),p(e))}).on("touchend touchcancel",function(){t=!1,g=0}),l.on("scroll_element.xdsoft_scroller",function(e,t){i||l.trigger("resize_scroll.xdsoft_scroller",[t,!0]),t=1<t?1:t<0||isNaN(t)?0:t,f=parseFloat(Math.abs((o[0].offsetHeight-i)*t).toFixed(4)),u.css("marginTop",c*t),o.css("marginTop",-f)}).on("resize_scroll.xdsoft_scroller",function(e,t,a){var n,r;i=l[0].clientHeight,s=o[0].offsetHeight,r=(n=i/s)*d[0].offsetHeight,1<n?u.hide():(u.show(),u.css("height",parseInt(10<r?r:10,10)),c=d[0].offsetHeight-u[0].offsetHeight,!0!==a&&l.trigger("scroll_element.xdsoft_scroller",[t||f/(s-i)]))}),l.on("mousewheel",function(e){var t,a,n=(t=e.originalEvent,a=0,"detail"in t&&(a=t.detail),"wheelDelta"in t&&(a=-t.wheelDelta/120),"wheelDeltaY"in t&&(a=-t.wheelDeltaY/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(a=0),a*=10,"deltaY"in t&&(a=t.deltaY),a&&t.deltaMode&&(1===t.deltaMode?a*=40:a*=800),a),r=Math.max(0,f-n);return l.trigger("scroll_element.xdsoft_scroller",[r/(s-i)]),e.stopPropagation(),!1}),l.on("touchstart",function(e){n=a(e),m=f}),l.on("touchmove",function(e){if(n){e.preventDefault();var t=a(e);l.trigger("scroll_element.xdsoft_scroller",[(m-(t.y-n.y))/(s-i)])}}),l.on("touchend touchcancel",function(){n=!1,m=0})),l.trigger("resize_scroll.xdsoft_scroller",[y])):l.find(".xdsoft_scrollbar").hide()})},L.fn.datetimepicker=function(H,a){var n,r,o=this,p=17,D=13,y=27,v=37,b=38,k=39,x=40,T=9,S=116,M=65,w=67,j=86,J=90,z=89,N=!1,I=L.isPlainObject(H)||!H?L.extend(!0,{},s,H):L.extend(!0,{},s),i=0;return n=function(O){var t,n,a,r,W,h,_=L('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),e=L('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),g=L('<div class="xdsoft_datepicker active"></div>'),F=L('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button><div class="xdsoft_label xdsoft_month"><span></span><i></i></div><div class="xdsoft_label xdsoft_year"><span></span><i></i></div><button type="button" class="xdsoft_next"></button></div>'),C=L('<div class="xdsoft_calendar"></div>'),o=L('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),u=o.find(".xdsoft_time_box").eq(0),P=L('<div class="xdsoft_time_variant"></div>'),i=L('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'),Y=L('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),A=L('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),s=!1,d=0;I.id&&_.attr("id",I.id),I.style&&_.attr("style",I.style),I.weeks&&_.addClass("xdsoft_showweeks"),I.rtl&&_.addClass("xdsoft_rtl"),_.addClass("xdsoft_"+I.theme),_.addClass(I.className),F.find(".xdsoft_month span").after(Y),F.find(".xdsoft_year span").after(A),F.find(".xdsoft_month,.xdsoft_year").on("touchstart mousedown.xdsoft",function(e){var t,a,n=L(this).find(".xdsoft_select").eq(0),r=0,o=0,i=n.is(":visible");for(F.find(".xdsoft_select").hide(),W.currentTime&&(r=W.currentTime[L(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]()),n[i?"hide":"show"](),t=n.find("div.xdsoft_option"),a=0;a<t.length&&t.eq(a).data("value")!==r;a+=1)o+=t[0].offsetHeight;return n.xdsoftScroller(I,o/(n.children()[0].offsetHeight-n[0].clientHeight)),e.stopPropagation(),!1});var l=function(e){var t=e.originalEvent,a=t.touches?t.touches[0]:t;this.touchStartPosition=this.touchStartPosition||a;var n=Math.abs(this.touchStartPosition.clientX-a.clientX),r=Math.abs(this.touchStartPosition.clientY-a.clientY);Math.sqrt(n*n+r*r)>I.touchMovedThreshold&&(this.touchMoved=!0)};function f(){var e,t=!1;return I.startDate?t=W.strToDate(I.startDate):(t=I.value||(O&&O.val&&O.val()?O.val():""))?(t=W.strToDateTime(t),I.yearOffset&&(t=new Date(t.getFullYear()-I.yearOffset,t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))):I.defaultDate&&(t=W.strToDateTime(I.defaultDate),I.defaultTime&&(e=W.strtotime(I.defaultTime),t.setHours(e.getHours()),t.setMinutes(e.getMinutes()))),t&&W.isValidDate(t)?_.data("changed",!0):t="",t||0}function c(m){var h=function(e,t){var a=e.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,"\\$1").replace(/_/g,"{digit+}").replace(/([0-9]{1})/g,"{digit$1}").replace(/\{digit([0-9]{1})\}/g,"[0-$1_]{1}").replace(/\{digit[\+]\}/g,"[0-9_]{1}");return new RegExp(a).test(t)},g=function(e,t){if(!(e="string"==typeof e||e instanceof String?m.ownerDocument.getElementById(e):e))return!1;if(e.createTextRange){var a=e.createTextRange();return a.collapse(!0),a.moveEnd("character",t),a.moveStart("character",t),a.select(),!0}return!!e.setSelectionRange&&(e.setSelectionRange(t,t),!0)};m.mask&&O.off("keydown.xdsoft"),!0===m.mask&&(E.formatMask?m.mask=E.formatMask(m.format):m.mask=m.format.replace(/Y/g,"9999").replace(/F/g,"9999").replace(/m/g,"19").replace(/d/g,"39").replace(/H/g,"29").replace(/i/g,"59").replace(/s/g,"59")),"string"===L.type(m.mask)&&(h(m.mask,O.val())||(O.val(m.mask.replace(/[0-9]/g,"_")),g(O[0],0)),O.on("paste.xdsoft",function(e){var t=(e.clipboardData||e.originalEvent.clipboardData||window.clipboardData).getData("text"),a=this.value,n=this.selectionStart;return a=a.substr(0,n)+t+a.substr(n+t.length),n+=t.length,h(m.mask,a)?(this.value=a,g(this,n)):""===L.trim(a)?this.value=m.mask.replace(/[0-9]/g,"_"):O.trigger("error_input.xdsoft"),e.preventDefault(),!1}),O.on("keydown.xdsoft",function(e){var t,a=this.value,n=e.which,r=this.selectionStart,o=this.selectionEnd,i=r!==o;if(48<=n&&n<=57||96<=n&&n<=105||8===n||46===n){for(t=8===n||46===n?"_":String.fromCharCode(96<=n&&n<=105?n-48:n),8===n&&r&&!i&&(r-=1);;){var s=m.mask.substr(r,1),d=r<m.mask.length,u=0<r;if(!(/[^0-9_]/.test(s)&&d&&u))break;r+=8!==n||i?1:-1}if(e.metaKey&&(i=!(r=0)),i){var l=o-r,f=m.mask.replace(/[0-9]/g,"_"),c=f.substr(r,l).substr(1);a=a.substr(0,r)+(t+c)+a.substr(r+l)}else{a=a.substr(0,r)+t+a.substr(r+1)}if(""===L.trim(a))a=f;else if(r===m.mask.length)return e.preventDefault(),!1;for(r+=8===n?0:1;/[^0-9_]/.test(m.mask.substr(r,1))&&r<m.mask.length&&0<r;)r+=8===n?0:1;h(m.mask,a)?(this.value=a,g(this,r)):""===L.trim(a)?this.value=m.mask.replace(/[0-9]/g,"_"):O.trigger("error_input.xdsoft")}else if(-1!==[M,w,j,J,z].indexOf(n)&&N||-1!==[y,b,x,v,k,S,p,T,D].indexOf(n))return!0;return e.preventDefault(),!1}))}F.find(".xdsoft_select").xdsoftScroller(I).on("touchstart mousedown.xdsoft",function(e){var t=e.originalEvent;this.touchMoved=!1,this.touchStartPosition=t.touches?t.touches[0]:t,e.stopPropagation(),e.preventDefault()}).on("touchmove",".xdsoft_option",l).on("touchend mousedown.xdsoft",".xdsoft_option",function(){if(!this.touchMoved){void 0!==W.currentTime&&null!==W.currentTime||(W.currentTime=W.now());var e=W.currentTime.getFullYear();W&&W.currentTime&&W.currentTime[L(this).parent().parent().hasClass("xdsoft_monthselect")?"setMonth":"setFullYear"](L(this).data("value")),L(this).parent().parent().hide(),_.trigger("xchange.xdsoft"),I.onChangeMonth&&L.isFunction(I.onChangeMonth)&&I.onChangeMonth.call(_,W.currentTime,_.data("input")),e!==W.currentTime.getFullYear()&&L.isFunction(I.onChangeYear)&&I.onChangeYear.call(_,W.currentTime,_.data("input"))}}),_.getValue=function(){return W.getCurrentTime()},_.setOptions=function(e){var l={};I=L.extend(!0,{},I,e),e.allowTimes&&L.isArray(e.allowTimes)&&e.allowTimes.length&&(I.allowTimes=L.extend(!0,[],e.allowTimes)),e.weekends&&L.isArray(e.weekends)&&e.weekends.length&&(I.weekends=L.extend(!0,[],e.weekends)),e.allowDates&&L.isArray(e.allowDates)&&e.allowDates.length&&(I.allowDates=L.extend(!0,[],e.allowDates)),e.allowDateRe&&"[object String]"===Object.prototype.toString.call(e.allowDateRe)&&(I.allowDateRe=new RegExp(e.allowDateRe)),e.highlightedDates&&L.isArray(e.highlightedDates)&&e.highlightedDates.length&&(L.each(e.highlightedDates,function(e,t){var a,n=L.map(t.split(","),L.trim),r=new m(E.parseDate(n[0],I.formatDate),n[1],n[2]),o=E.formatDate(r.date,I.formatDate);void 0!==l[o]?(a=l[o].desc)&&a.length&&r.desc&&r.desc.length&&(l[o].desc=a+"\n"+r.desc):l[o]=r}),I.highlightedDates=L.extend(!0,[],l)),e.highlightedPeriods&&L.isArray(e.highlightedPeriods)&&e.highlightedPeriods.length&&(l=L.extend(!0,[],I.highlightedDates),L.each(e.highlightedPeriods,function(e,t){var a,n,r,o,i,s,d;if(L.isArray(t))a=t[0],n=t[1],r=t[2],d=t[3];else{var u=L.map(t.split(","),L.trim);a=E.parseDate(u[0],I.formatDate),n=E.parseDate(u[1],I.formatDate),r=u[2],d=u[3]}for(;a<=n;)o=new m(a,r,d),i=E.formatDate(a,I.formatDate),a.setDate(a.getDate()+1),void 0!==l[i]?(s=l[i].desc)&&s.length&&o.desc&&o.desc.length&&(l[i].desc=s+"\n"+o.desc):l[i]=o}),I.highlightedDates=L.extend(!0,[],l)),e.disabledDates&&L.isArray(e.disabledDates)&&e.disabledDates.length&&(I.disabledDates=L.extend(!0,[],e.disabledDates)),e.disabledWeekDays&&L.isArray(e.disabledWeekDays)&&e.disabledWeekDays.length&&(I.disabledWeekDays=L.extend(!0,[],e.disabledWeekDays)),!I.open&&!I.opened||I.inline||O.trigger("open.xdsoft"),I.inline&&(s=!0,_.addClass("xdsoft_inline"),O.after(_).hide()),I.inverseButton&&(I.next="xdsoft_prev",I.prev="xdsoft_next"),I.datepicker?g.addClass("active"):g.removeClass("active"),I.timepicker?o.addClass("active"):o.removeClass("active"),I.value&&(W.setCurrentTime(I.value),O&&O.val&&O.val(W.str)),isNaN(I.dayOfWeekStart)?I.dayOfWeekStart=0:I.dayOfWeekStart=parseInt(I.dayOfWeekStart,10)%7,I.timepickerScrollbar||u.xdsoftScroller(I,"hide"),I.minDate&&/^[\+\-](.*)$/.test(I.minDate)&&(I.minDate=E.formatDate(W.strToDateTime(I.minDate),I.formatDate)),I.maxDate&&/^[\+\-](.*)$/.test(I.maxDate)&&(I.maxDate=E.formatDate(W.strToDateTime(I.maxDate),I.formatDate)),I.minDateTime&&/^\+(.*)$/.test(I.minDateTime)&&(I.minDateTime=W.strToDateTime(I.minDateTime).dateFormat(I.formatDate)),I.maxDateTime&&/^\+(.*)$/.test(I.maxDateTime)&&(I.maxDateTime=W.strToDateTime(I.maxDateTime).dateFormat(I.formatDate)),i.toggle(I.showApplyButton),F.find(".xdsoft_today_button").css("visibility",I.todayButton?"visible":"hidden"),F.find("."+I.prev).css("visibility",I.prevButton?"visible":"hidden"),F.find("."+I.next).css("visibility",I.nextButton?"visible":"hidden"),c(I),I.validateOnBlur&&O.off("blur.xdsoft").on("blur.xdsoft",function(){if(I.allowBlank&&(!L.trim(L(this).val()).length||"string"==typeof I.mask&&L.trim(L(this).val())===I.mask.replace(/[0-9]/g,"_")))L(this).val(null),_.data("xdsoft_datetime").empty();else{var e=E.parseDate(L(this).val(),I.format);if(e)L(this).val(E.formatDate(e,I.format));else{var t=+[L(this).val()[0],L(this).val()[1]].join(""),a=+[L(this).val()[2],L(this).val()[3]].join("");!I.datepicker&&I.timepicker&&0<=t&&t<24&&0<=a&&a<60?L(this).val([t,a].map(function(e){return 9<e?e:"0"+e}).join(":")):L(this).val(E.formatDate(W.now(),I.format))}_.data("xdsoft_datetime").setCurrentTime(L(this).val())}_.trigger("changedatetime.xdsoft"),_.trigger("close.xdsoft")}),I.dayOfWeekStartPrev=0===I.dayOfWeekStart?6:I.dayOfWeekStart-1,_.trigger("xchange.xdsoft").trigger("afterOpen.xdsoft")},_.data("options",I).on("touchstart mousedown.xdsoft",function(e){return e.stopPropagation(),e.preventDefault(),A.hide(),Y.hide(),!1}),u.append(P),u.xdsoftScroller(I),_.on("afterOpen.xdsoft",function(){u.xdsoftScroller(I)}),_.append(g).append(o),!0!==I.withoutCopyright&&_.append(e),g.append(F).append(C).append(i),I.insideParent?L(O).parent().append(_):L(I.parentID).append(_),W=new function(){var r=this;r.now=function(e){var t,a,n=new Date;return!e&&I.defaultDate&&(t=r.strToDateTime(I.defaultDate),n.setFullYear(t.getFullYear()),n.setMonth(t.getMonth()),n.setDate(t.getDate())),n.setFullYear(n.getFullYear()),!e&&I.defaultTime&&(a=r.strtotime(I.defaultTime),n.setHours(a.getHours()),n.setMinutes(a.getMinutes()),n.setSeconds(a.getSeconds()),n.setMilliseconds(a.getMilliseconds())),n},r.isValidDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},r.setCurrentTime=function(e,t){"string"==typeof e?r.currentTime=r.strToDateTime(e):r.isValidDate(e)?r.currentTime=e:e||t||!I.allowBlank||I.inline?r.currentTime=r.now():r.currentTime=null,_.trigger("xchange.xdsoft")},r.empty=function(){r.currentTime=null},r.getCurrentTime=function(){return r.currentTime},r.nextMonth=function(){void 0!==r.currentTime&&null!==r.currentTime||(r.currentTime=r.now());var e,t=r.currentTime.getMonth()+1;return 12===t&&(r.currentTime.setFullYear(r.currentTime.getFullYear()+1),t=0),e=r.currentTime.getFullYear(),r.currentTime.setDate(Math.min(new Date(r.currentTime.getFullYear(),t+1,0).getDate(),r.currentTime.getDate())),r.currentTime.setMonth(t),I.onChangeMonth&&L.isFunction(I.onChangeMonth)&&I.onChangeMonth.call(_,W.currentTime,_.data("input")),e!==r.currentTime.getFullYear()&&L.isFunction(I.onChangeYear)&&I.onChangeYear.call(_,W.currentTime,_.data("input")),_.trigger("xchange.xdsoft"),t},r.prevMonth=function(){void 0!==r.currentTime&&null!==r.currentTime||(r.currentTime=r.now());var e=r.currentTime.getMonth()-1;return-1===e&&(r.currentTime.setFullYear(r.currentTime.getFullYear()-1),e=11),r.currentTime.setDate(Math.min(new Date(r.currentTime.getFullYear(),e+1,0).getDate(),r.currentTime.getDate())),r.currentTime.setMonth(e),I.onChangeMonth&&L.isFunction(I.onChangeMonth)&&I.onChangeMonth.call(_,W.currentTime,_.data("input")),_.trigger("xchange.xdsoft"),e},r.getWeekOfYear=function(e){if(I.onGetWeekOfYear&&L.isFunction(I.onGetWeekOfYear)){var t=I.onGetWeekOfYear.call(_,e);if(void 0!==t)return t}var a=new Date(e.getFullYear(),0,1);return 4!==a.getDay()&&a.setMonth(0,1+(4-a.getDay()+7)%7),Math.ceil(((e-a)/864e5+a.getDay()+1)/7)},r.strToDateTime=function(e){var t,a,n=[];return e&&e instanceof Date&&r.isValidDate(e)?e:((n=/^([+-]{1})(.*)$/.exec(e))&&(n[2]=E.parseDate(n[2],I.formatDate)),a=n&&n[2]?(t=n[2].getTime()-6e4*n[2].getTimezoneOffset(),new Date(r.now(!0).getTime()+parseInt(n[1]+"1",10)*t)):e?E.parseDate(e,I.format):r.now(),r.isValidDate(a)||(a=r.now()),a)},r.strToDate=function(e){if(e&&e instanceof Date&&r.isValidDate(e))return e;var t=e?E.parseDate(e,I.formatDate):r.now(!0);return r.isValidDate(t)||(t=r.now(!0)),t},r.strtotime=function(e){if(e&&e instanceof Date&&r.isValidDate(e))return e;var t=e?E.parseDate(e,I.formatTime):r.now(!0);return r.isValidDate(t)||(t=r.now(!0)),t},r.str=function(){var e=I.format;return I.yearOffset&&(e=(e=e.replace("Y",r.currentTime.getFullYear()+I.yearOffset)).replace("y",String(r.currentTime.getFullYear()+I.yearOffset).substring(2,4))),E.formatDate(r.currentTime,e)},r.currentTime=this.now()},i.on("touchend click",function(e){e.preventDefault(),_.data("changed",!0),W.setCurrentTime(f()),O.val(W.str()),_.trigger("close.xdsoft")}),F.find(".xdsoft_today_button").on("touchend mousedown.xdsoft",function(){_.data("changed",!0),W.setCurrentTime(0,!0),_.trigger("afterOpen.xdsoft")}).on("dblclick.xdsoft",function(){var e,t,a=W.getCurrentTime();a=new Date(a.getFullYear(),a.getMonth(),a.getDate()),e=W.strToDate(I.minDate),a<(e=new Date(e.getFullYear(),e.getMonth(),e.getDate()))||(t=W.strToDate(I.maxDate),(t=new Date(t.getFullYear(),t.getMonth(),t.getDate()))<a||(O.val(W.str()),O.trigger("change"),_.trigger("close.xdsoft")))}),F.find(".xdsoft_prev,.xdsoft_next").on("touchend mousedown.xdsoft",function(){var a=L(this),n=0,r=!1;!function e(t){a.hasClass(I.next)?W.nextMonth():a.hasClass(I.prev)&&W.prevMonth(),I.monthChangeSpinner&&(r||(n=setTimeout(e,t||100)))}(500),L([I.ownerDocument.body,I.contentWindow]).on("touchend mouseup.xdsoft",function e(){clearTimeout(n),r=!0,L([I.ownerDocument.body,I.contentWindow]).off("touchend mouseup.xdsoft",e)})}),o.find(".xdsoft_prev,.xdsoft_next").on("touchend mousedown.xdsoft",function(){var o=L(this),i=0,s=!1,d=110;!function e(t){var a=u[0].clientHeight,n=P[0].offsetHeight,r=Math.abs(parseInt(P.css("marginTop"),10));o.hasClass(I.next)&&n-a-I.timeHeightInTimePicker>=r?P.css("marginTop","-"+(r+I.timeHeightInTimePicker)+"px"):o.hasClass(I.prev)&&0<=r-I.timeHeightInTimePicker&&P.css("marginTop","-"+(r-I.timeHeightInTimePicker)+"px"),u.trigger("scroll_element.xdsoft_scroller",[Math.abs(parseInt(P[0].style.marginTop,10)/(n-a))]),d=10<d?10:d-10,s||(i=setTimeout(e,t||d))}(500),L([I.ownerDocument.body,I.contentWindow]).on("touchend mouseup.xdsoft",function e(){clearTimeout(i),s=!0,L([I.ownerDocument.body,I.contentWindow]).off("touchend mouseup.xdsoft",e)})}),t=0,_.on("xchange.xdsoft",function(e){clearTimeout(t),t=setTimeout(function(){void 0!==W.currentTime&&null!==W.currentTime||(W.currentTime=W.now());for(var e,t,a,n,r,o,i,s,d,u,l="",f=new Date(W.currentTime.getFullYear(),W.currentTime.getMonth(),1,12,0,0),c=0,m=W.now(),h=!1,g=!1,p=!1,D=!1,y=[],v=!0,b="";f.getDay()!==I.dayOfWeekStart;)f.setDate(f.getDate()-1);for(l+="<table><thead><tr>",I.weeks&&(l+="<th></th>"),e=0;e<7;e+=1)l+="<th>"+I.i18n[R].dayOfWeekShort[(e+I.dayOfWeekStart)%7]+"</th>";for(l+="</tr></thead>",l+="<tbody>",!1!==I.maxDate&&(h=W.strToDate(I.maxDate),h=new Date(h.getFullYear(),h.getMonth(),h.getDate(),23,59,59,999)),!1!==I.minDate&&(g=W.strToDate(I.minDate),g=new Date(g.getFullYear(),g.getMonth(),g.getDate())),!1!==I.minDateTime&&(p=W.strToDate(I.minDateTime),p=new Date(p.getFullYear(),p.getMonth(),p.getDate(),p.getHours(),p.getMinutes(),p.getSeconds())),!1!==I.maxDateTime&&(D=W.strToDate(I.maxDateTime),D=new Date(D.getFullYear(),D.getMonth(),D.getDate(),D.getHours(),D.getMinutes(),D.getSeconds())),!1!==D&&(u=31*(12*D.getFullYear()+D.getMonth())+D.getDate());c<W.currentTime.countDaysInMonth()||f.getDay()!==I.dayOfWeekStart||W.currentTime.getMonth()===f.getMonth();){y=[],c+=1,a=f.getDay(),n=f.getDate(),r=f.getFullYear(),M=f.getMonth(),o=W.getWeekOfYear(f),d="",y.push("xdsoft_date"),i=I.beforeShowDay&&L.isFunction(I.beforeShowDay.call)?I.beforeShowDay.call(_,f):null,I.allowDateRe&&"[object RegExp]"===Object.prototype.toString.call(I.allowDateRe)&&(I.allowDateRe.test(E.formatDate(f,I.formatDate))||y.push("xdsoft_disabled")),I.allowDates&&0<I.allowDates.length&&-1===I.allowDates.indexOf(E.formatDate(f,I.formatDate))&&y.push("xdsoft_disabled");var k=31*(12*f.getFullYear()+f.getMonth())+f.getDate();(!1!==h&&h<f||!1!==p&&f<p||!1!==g&&f<g||!1!==D&&u<k||i&&!1===i[0])&&y.push("xdsoft_disabled"),-1!==I.disabledDates.indexOf(E.formatDate(f,I.formatDate))&&y.push("xdsoft_disabled"),-1!==I.disabledWeekDays.indexOf(a)&&y.push("xdsoft_disabled"),O.is("[disabled]")&&y.push("xdsoft_disabled"),i&&""!==i[1]&&y.push(i[1]),W.currentTime.getMonth()!==M&&y.push("xdsoft_other_month"),(I.defaultSelect||_.data("changed"))&&E.formatDate(W.currentTime,I.formatDate)===E.formatDate(f,I.formatDate)&&y.push("xdsoft_current"),E.formatDate(m,I.formatDate)===E.formatDate(f,I.formatDate)&&y.push("xdsoft_today"),0!==f.getDay()&&6!==f.getDay()&&-1===I.weekends.indexOf(E.formatDate(f,I.formatDate))||y.push("xdsoft_weekend"),void 0!==I.highlightedDates[E.formatDate(f,I.formatDate)]&&(t=I.highlightedDates[E.formatDate(f,I.formatDate)],y.push(void 0===t.style?"xdsoft_highlighted_default":t.style),d=void 0===t.desc?"":t.desc),I.beforeShowDay&&L.isFunction(I.beforeShowDay)&&y.push(I.beforeShowDay(f)),v&&(l+="<tr>",v=!1,I.weeks&&(l+="<th>"+o+"</th>")),l+='<td data-date="'+n+'" data-month="'+M+'" data-year="'+r+'" class="xdsoft_date xdsoft_day_of_week'+f.getDay()+" "+y.join(" ")+'" title="'+d+'"><div>'+n+"</div></td>",f.getDay()===I.dayOfWeekStartPrev&&(l+="</tr>",v=!0),f.setDate(n+1)}l+="</tbody></table>",C.html(l),F.find(".xdsoft_label span").eq(0).text(I.i18n[R].months[W.currentTime.getMonth()]),F.find(".xdsoft_label span").eq(1).text(W.currentTime.getFullYear()+I.yearOffset),M=b="";var x=0;if(!1!==I.minTime){var T=W.strtotime(I.minTime);x=60*T.getHours()+T.getMinutes()}var S=1440;if(!1!==I.maxTime){T=W.strtotime(I.maxTime);S=60*T.getHours()+T.getMinutes()}if(!1!==I.minDateTime){T=W.strToDateTime(I.minDateTime);if(E.formatDate(W.currentTime,I.formatDate)===E.formatDate(T,I.formatDate)){var M=60*T.getHours()+T.getMinutes();x<M&&(x=M)}}if(!1!==I.maxDateTime){T=W.strToDateTime(I.maxDateTime);if(E.formatDate(W.currentTime,I.formatDate)===E.formatDate(T,I.formatDate))(M=60*T.getHours()+T.getMinutes())<S&&(S=M)}if(s=function(e,t){var a,n=W.now(),r=I.allowTimes&&L.isArray(I.allowTimes)&&I.allowTimes.length;n.setHours(e),e=parseInt(n.getHours(),10),n.setMinutes(t),t=parseInt(n.getMinutes(),10),y=[];var o=60*e+t;(O.is("[disabled]")||S<=o||o<x)&&y.push("xdsoft_disabled"),(a=new Date(W.currentTime)).setHours(parseInt(W.currentTime.getHours(),10)),r||a.setMinutes(Math[I.roundTime](W.currentTime.getMinutes()/I.step)*I.step),(I.initTime||I.defaultSelect||_.data("changed"))&&a.getHours()===parseInt(e,10)&&(!r&&59<I.step||a.getMinutes()===parseInt(t,10))&&(I.defaultSelect||_.data("changed")?y.push("xdsoft_current"):I.initTime&&y.push("xdsoft_init_time")),parseInt(m.getHours(),10)===parseInt(e,10)&&parseInt(m.getMinutes(),10)===parseInt(t,10)&&y.push("xdsoft_today"),b+='<div class="xdsoft_time '+y.join(" ")+'" data-hour="'+e+'" data-minute="'+t+'">'+E.formatDate(n,I.formatTime)+"</div>"},I.allowTimes&&L.isArray(I.allowTimes)&&I.allowTimes.length)for(c=0;c<I.allowTimes.length;c+=1)s(W.strtotime(I.allowTimes[c]).getHours(),M=W.strtotime(I.allowTimes[c]).getMinutes());else for(e=c=0;c<(I.hours12?12:24);c+=1)for(e=0;e<60;e+=I.step){var w=60*c+e;w<x||(S<=w||s((c<10?"0":"")+c,M=(e<10?"0":"")+e))}for(P.html(b),H="",c=parseInt(I.yearStart,10);c<=parseInt(I.yearEnd,10);c+=1)H+='<div class="xdsoft_option '+(W.currentTime.getFullYear()===c?"xdsoft_current":"")+'" data-value="'+c+'">'+(c+I.yearOffset)+"</div>";for(A.children().eq(0).html(H),c=parseInt(I.monthStart,10),H="";c<=parseInt(I.monthEnd,10);c+=1)H+='<div class="xdsoft_option '+(W.currentTime.getMonth()===c?"xdsoft_current":"")+'" data-value="'+c+'">'+I.i18n[R].months[c]+"</div>";Y.children().eq(0).html(H),L(_).trigger("generate.xdsoft")},10),e.stopPropagation()}).on("afterOpen.xdsoft",function(){var e,t,a,n;I.timepicker&&(P.find(".xdsoft_current").length?e=".xdsoft_current":P.find(".xdsoft_init_time").length&&(e=".xdsoft_init_time"),e?(t=u[0].clientHeight,(a=P[0].offsetHeight)-t<(n=P.find(e).index()*I.timeHeightInTimePicker+1)&&(n=a-t),u.trigger("scroll_element.xdsoft_scroller",[parseInt(n,10)/(a-t)])):u.trigger("scroll_element.xdsoft_scroller",[0]))}),n=0,C.on("touchend click.xdsoft","td",function(e){e.stopPropagation(),n+=1;var t=L(this),a=W.currentTime;if(null==a&&(W.currentTime=W.now(),a=W.currentTime),t.hasClass("xdsoft_disabled"))return!1;a.setDate(1),a.setFullYear(t.data("year")),a.setMonth(t.data("month")),a.setDate(t.data("date")),_.trigger("select.xdsoft",[a]),O.val(W.str()),I.onSelectDate&&L.isFunction(I.onSelectDate)&&I.onSelectDate.call(_,W.currentTime,_.data("input"),e),_.data("changed",!0),_.trigger("xchange.xdsoft"),_.trigger("changedatetime.xdsoft"),(1<n||!0===I.closeOnDateSelect||!1===I.closeOnDateSelect&&!I.timepicker)&&!I.inline&&_.trigger("close.xdsoft"),setTimeout(function(){n=0},200)}),P.on("touchstart","div",function(e){this.touchMoved=!1}).on("touchmove","div",l).on("touchend click.xdsoft","div",function(e){if(!this.touchMoved){e.stopPropagation();var t=L(this),a=W.currentTime;if(null==a&&(W.currentTime=W.now(),a=W.currentTime),t.hasClass("xdsoft_disabled"))return!1;a.setHours(t.data("hour")),a.setMinutes(t.data("minute")),_.trigger("select.xdsoft",[a]),_.data("input").val(W.str()),I.onSelectTime&&L.isFunction(I.onSelectTime)&&I.onSelectTime.call(_,W.currentTime,_.data("input"),e),_.data("changed",!0),_.trigger("xchange.xdsoft"),_.trigger("changedatetime.xdsoft"),!0!==I.inline&&!0===I.closeOnTimeSelect&&_.trigger("close.xdsoft")}}),g.on("mousewheel.xdsoft",function(e){return!I.scrollMonth||(e.deltaY<0?W.nextMonth():W.prevMonth(),!1)}),O.on("mousewheel.xdsoft",function(e){return!I.scrollInput||(!I.datepicker&&I.timepicker?(0<=(a=P.find(".xdsoft_current").length?P.find(".xdsoft_current").eq(0).index():0)+e.deltaY&&a+e.deltaY<P.children().length&&(a+=e.deltaY),P.children().eq(a).length&&P.children().eq(a).trigger("mousedown"),!1):I.datepicker&&!I.timepicker?(g.trigger(e,[e.deltaY,e.deltaX,e.deltaY]),O.val&&O.val(W.str()),_.trigger("changedatetime.xdsoft"),!1):void 0)}),_.on("changedatetime.xdsoft",function(e){if(I.onChangeDateTime&&L.isFunction(I.onChangeDateTime)){var t=_.data("input");I.onChangeDateTime.call(_,W.currentTime,t,e),delete I.value,t.trigger("change")}}).on("generate.xdsoft",function(){I.onGenerate&&L.isFunction(I.onGenerate)&&I.onGenerate.call(_,W.currentTime,_.data("input")),s&&(_.trigger("afterOpen.xdsoft"),s=!1)}).on("click.xdsoft",function(e){e.stopPropagation()}),a=0,h=function(e,t){do{if(!(e=e.parentNode)||!1===t(e))break}while("HTML"!==e.nodeName)},r=function(){var e,t,a,n,r,o,i,s,d,u,l,f,c;if(e=(s=_.data("input")).offset(),t=s[0],u="top",a=e.top+t.offsetHeight-1,n=e.left,r="absolute",d=L(I.contentWindow).width(),f=L(I.contentWindow).height(),c=L(I.contentWindow).scrollTop(),I.ownerDocument.documentElement.clientWidth-e.left<g.parent().outerWidth(!0)){var m=g.parent().outerWidth(!0)-t.offsetWidth;n-=m}"rtl"===s.parent().css("direction")&&(n-=_.outerWidth()-s.outerWidth()),I.fixed?(a-=c,n-=L(I.contentWindow).scrollLeft(),r="fixed"):(i=!1,h(t,function(e){return null!==e&&("fixed"===I.contentWindow.getComputedStyle(e).getPropertyValue("position")?!(i=!0):void 0)}),i&&!I.insideParent?(r="fixed",a+_.outerHeight()>f+c?(u="bottom",a=f+c-e.top):a-=c):a+_[0].offsetHeight>f+c&&(a=e.top-_[0].offsetHeight+1),a<0&&(a=0),n+t.offsetWidth>d&&(n=d-t.offsetWidth)),o=_[0],h(o,function(e){if("relative"===I.contentWindow.getComputedStyle(e).getPropertyValue("position")&&d>=e.offsetWidth)return n-=(d-e.offsetWidth)/2,!1}),l={position:r,left:I.insideParent?t.offsetLeft:n,top:"",bottom:""},I.insideParent?l[u]=t.offsetTop+t.offsetHeight:l[u]=a,_.css(l)},_.on("open.xdsoft",function(e){var t=!0;I.onShow&&L.isFunction(I.onShow)&&(t=I.onShow.call(_,W.currentTime,_.data("input"),e)),!1!==t&&(_.show(),r(),L(I.contentWindow).off("resize.xdsoft",r).on("resize.xdsoft",r),I.closeOnWithoutClick&&L([I.ownerDocument.body,I.contentWindow]).on("touchstart mousedown.xdsoft",function e(){_.trigger("close.xdsoft"),L([I.ownerDocument.body,I.contentWindow]).off("touchstart mousedown.xdsoft",e)}))}).on("close.xdsoft",function(e){var t=!0;F.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide(),I.onClose&&L.isFunction(I.onClose)&&(t=I.onClose.call(_,W.currentTime,_.data("input"),e)),!1===t||I.opened||I.inline||_.hide(),e.stopPropagation()}).on("toggle.xdsoft",function(){_.is(":visible")?_.trigger("close.xdsoft"):_.trigger("open.xdsoft")}).data("input",O),d=0,_.data("xdsoft_datetime",W),_.setOptions(I),W.setCurrentTime(f()),O.data("xdsoft_datetimepicker",_).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function(){O.is(":disabled")||O.data("xdsoft_datetimepicker").is(":visible")&&I.closeOnInputClick||I.openOnFocus&&(clearTimeout(d),d=setTimeout(function(){O.is(":disabled")||(s=!0,W.setCurrentTime(f(),!0),I.mask&&c(I),_.trigger("open.xdsoft"))},100))}).on("keydown.xdsoft",function(e){var t,a=e.which;return-1!==[D].indexOf(a)&&I.enterLikeTab?(t=L("input:visible,textarea:visible,button:visible,a:visible"),_.trigger("close.xdsoft"),t.eq(t.index(this)+1).focus(),!1):-1!==[T].indexOf(a)?(_.trigger("close.xdsoft"),!0):void 0}).on("blur.xdsoft",function(){_.trigger("close.xdsoft")})},r=function(e){var t=e.data("xdsoft_datetimepicker");t&&(t.data("xdsoft_datetime",null),t.remove(),e.data("xdsoft_datetimepicker",null).off(".xdsoft"),L(I.contentWindow).off("resize.xdsoft"),L([I.contentWindow,I.ownerDocument.body]).off("mousedown.xdsoft touchstart"),e.unmousewheel&&e.unmousewheel())},L(I.ownerDocument).off("keydown.xdsoftctrl keyup.xdsoftctrl").off("keydown.xdsoftcmd keyup.xdsoftcmd").on("keydown.xdsoftctrl",function(e){e.keyCode===p&&(N=!0)}).on("keyup.xdsoftctrl",function(e){e.keyCode===p&&(N=!1)}).on("keydown.xdsoftcmd",function(e){91===e.keyCode&&!0}).on("keyup.xdsoftcmd",function(e){91===e.keyCode&&!1}),this.each(function(){var t,e=L(this).data("xdsoft_datetimepicker");if(e){if("string"===L.type(H))switch(H){case"show":L(this).select().focus(),e.trigger("open.xdsoft");break;case"hide":e.trigger("close.xdsoft");break;case"toggle":e.trigger("toggle.xdsoft");break;case"destroy":r(L(this));break;case"reset":this.value=this.defaultValue,this.value&&e.data("xdsoft_datetime").isValidDate(E.parseDate(this.value,I.format))||e.data("changed",!1),e.data("xdsoft_datetime").setCurrentTime(this.value);break;case"validate":e.data("input").trigger("blur.xdsoft");break;default:e[H]&&L.isFunction(e[H])&&(o=e[H](a))}else e.setOptions(H);return 0}"string"!==L.type(H)&&(!I.lazyInit||I.open||I.inline?n(L(this)):(t=L(this)).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function e(){t.is(":disabled")||t.data("xdsoft_datetimepicker")||(clearTimeout(i),i=setTimeout(function(){t.data("xdsoft_datetimepicker")||n(t),t.off("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",e).trigger("open.xdsoft")},100))}))}),o},L.fn.datetimepicker.defaults=s};!function(e){"function"==typeof define&&define.amd?define(["jquery","jquery-mousewheel"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(datetimepickerFactory),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(c){var m,h,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],g=Array.prototype.slice;if(c.event.fixHooks)for(var a=e.length;a;)c.event.fixHooks[e[--a]]=c.event.mouseHooks;var p=c.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],n,!1);else this.onmousewheel=n;c.data(this,"mousewheel-line-height",p.getLineHeight(this)),c.data(this,"mousewheel-page-height",p.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],n,!1);else this.onmousewheel=null;c.removeData(this,"mousewheel-line-height"),c.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=c(e),a=t["offsetParent"in c.fn?"offsetParent":"parent"]();return a.length||(a=c("body")),parseInt(a.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return c(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function n(e){var t,a=e||window.event,n=g.call(arguments,1),r=0,o=0,i=0,s=0,d=0;if((e=c.event.fix(a)).type="mousewheel","detail"in a&&(i=-1*a.detail),"wheelDelta"in a&&(i=a.wheelDelta),"wheelDeltaY"in a&&(i=a.wheelDeltaY),"wheelDeltaX"in a&&(o=-1*a.wheelDeltaX),"axis"in a&&a.axis===a.HORIZONTAL_AXIS&&(o=-1*i,i=0),r=0===i?o:i,"deltaY"in a&&(r=i=-1*a.deltaY),"deltaX"in a&&(o=a.deltaX,0===i&&(r=-1*o)),0!==i||0!==o){if(1===a.deltaMode){var u=c.data(this,"mousewheel-line-height");r*=u,i*=u,o*=u}else if(2===a.deltaMode){var l=c.data(this,"mousewheel-page-height");r*=l,i*=l,o*=l}if(t=Math.max(Math.abs(i),Math.abs(o)),(!h||t<h)&&y(a,h=t)&&(h/=40),y(a,t)&&(r/=40,o/=40,i/=40),r=Math[1<=r?"floor":"ceil"](r/h),o=Math[1<=o?"floor":"ceil"](o/h),i=Math[1<=i?"floor":"ceil"](i/h),p.settings.normalizeOffset&&this.getBoundingClientRect){var f=this.getBoundingClientRect();s=e.clientX-f.left,d=e.clientY-f.top}return e.deltaX=o,e.deltaY=i,e.deltaFactor=h,e.offsetX=s,e.offsetY=d,e.deltaMode=0,n.unshift(e,r,o,i),m&&clearTimeout(m),m=setTimeout(D,200),(c.event.dispatch||c.event.handle).apply(this,n)}}function D(){h=null}function y(e,t){return p.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}c.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})});
js/qsm-admin-emails.js CHANGED
@@ -10,7 +10,7 @@ var QSMAdminEmails;
10
  QSMAdmin.displayAlert( 'Saving emails...', 'info' );
11
  var emails = [];
12
  var email = {};
13
- $( '.email' ).each( function() {
14
  email = {
15
  'conditions': [],
16
  'to': $( this ).find( '.to-email' ).val(),
@@ -52,7 +52,7 @@ var QSMAdminEmails;
52
  headers: { 'X-WP-Nonce': qsmEmailsObject.nonce },
53
  })
54
  .done(function( emails ) {
55
- $( '#emails' ).find( '.qsm-spinner-loader' ).remove();
56
  emails.forEach( function( email, i, emails ) {
57
  QSMAdminEmails.addEmail( email.conditions, email.to, email.subject, email.content, email.replyTo );
58
  });
@@ -74,10 +74,10 @@ var QSMAdminEmails;
74
  addEmail: function( conditions, to, subject, content, replyTo ) {
75
  QSMAdminEmails.total += 1;
76
  var template = wp.template( 'email' );
77
- $( '#emails' ).append( template( { id: QSMAdminEmails.total, to: to, subject: subject, content: content, replyTo: replyTo } ) );
78
  conditions.forEach( function( condition, i, conditions) {
79
  QSMAdminEmails.addCondition(
80
- $( '.email:last-child' ),
81
  condition.criteria,
82
  condition.operator,
83
  condition.value
@@ -101,7 +101,7 @@ var QSMAdminEmails;
101
  }];
102
  var to = '%USER_EMAIL%';
103
  var subject = 'Quiz Results For %QUIZ_NAME%';
104
- var content = '%QUESTIONS_ANSWERS%';
105
  var replyTo = false;
106
  QSMAdminEmails.addEmail( conditions, to, subject, content, replyTo );
107
  }
@@ -117,16 +117,16 @@ var QSMAdminEmails;
117
  event.preventDefault();
118
  QSMAdminEmails.saveEmails();
119
  });
120
- $( '#emails' ).on( 'click', '.new-condition', function( event ) {
121
  event.preventDefault();
122
- $page = $( this ).closest( '.email' );
123
  QSMAdminEmails.newCondition( $page );
124
  });
125
- $( '#emails' ).on( 'click', '.delete-email-button', function( event ) {
126
  event.preventDefault();
127
- $( this ).closest( '.email' ).remove();
128
  });
129
- $( '#emails' ).on( 'click', '.delete-condition-button', function( event ) {
130
  event.preventDefault();
131
  $( this ).closest( '.email-condition' ).remove();
132
  });
10
  QSMAdmin.displayAlert( 'Saving emails...', 'info' );
11
  var emails = [];
12
  var email = {};
13
+ $( '.qsm-email' ).each( function() {
14
  email = {
15
  'conditions': [],
16
  'to': $( this ).find( '.to-email' ).val(),
52
  headers: { 'X-WP-Nonce': qsmEmailsObject.nonce },
53
  })
54
  .done(function( emails ) {
55
+ $( '#qsm_emails' ).find( '.qsm-spinner-loader' ).remove();
56
  emails.forEach( function( email, i, emails ) {
57
  QSMAdminEmails.addEmail( email.conditions, email.to, email.subject, email.content, email.replyTo );
58
  });
74
  addEmail: function( conditions, to, subject, content, replyTo ) {
75
  QSMAdminEmails.total += 1;
76
  var template = wp.template( 'email' );
77
+ $( '#qsm_emails' ).append( template( { id: QSMAdminEmails.total, to: to, subject: subject, content: content, replyTo: replyTo } ) );
78
  conditions.forEach( function( condition, i, conditions) {
79
  QSMAdminEmails.addCondition(
80
+ $( '.qsm-email:last-child' ),
81
  condition.criteria,
82
  condition.operator,
83
  condition.value
101
  }];
102
  var to = '%USER_EMAIL%';
103
  var subject = 'Quiz Results For %QUIZ_NAME%';
104
+ var content = '%QUESTIONS_ANSWERS_EMAIL%';
105
  var replyTo = false;
106
  QSMAdminEmails.addEmail( conditions, to, subject, content, replyTo );
107
  }
117
  event.preventDefault();
118
  QSMAdminEmails.saveEmails();
119
  });
120
+ $( '#qsm_emails' ).on( 'click', '.new-condition', function( event ) {
121
  event.preventDefault();
122
+ $page = $( this ).closest( '.qsm-email' );
123
  QSMAdminEmails.newCondition( $page );
124
  });
125
+ $( '#qsm_emails' ).on( 'click', '.delete-email-button', function( event ) {
126
  event.preventDefault();
127
+ $( this ).closest( '.qsm-email' ).remove();
128
  });
129
+ $( '#qsm_emails' ).on( 'click', '.delete-condition-button', function( event ) {
130
  event.preventDefault();
131
  $( this ).closest( '.email-condition' ).remove();
132
  });
js/qsm-admin-question.js CHANGED
@@ -123,8 +123,9 @@ var import_button;
123
  $( '#question-bank' ).prepend($cat_html);
124
  $('#question-bank-cat').val(pagination.category);
125
  }
126
- if(pagination.current_page == 1){
127
  $( '#question-bank' ).prepend('<button class="button button-primary" id="qsm-import-selected-question">Import All Selected Questions</button>');
 
128
  }
129
  },
130
  addQuestionToQuestionBank: function( question ) {
@@ -199,7 +200,7 @@ var import_button;
199
  }
200
  } else {
201
  //We have removed this code in 7.0.0 because not allow to delete the single page.
202
- //QSMQuestion.questions.each( QSMQuestion.addQuestionToPage );
203
  }
204
  //Create Default pages and one question.
205
  if( qsmQuestionSettings.pages.length == 0 && QSMQuestion.questions.length == 0){
@@ -241,6 +242,7 @@ var import_button;
241
  pageInfo.set('questions', singlePage);
242
  qpages.push(pageInfo.attributes);
243
  });
 
244
  var data = {
245
  action: 'qsm_save_pages',
246
  pages: pages,
@@ -557,7 +559,7 @@ var import_button;
557
  }
558
  //Get checked question type
559
  var get_file_upload_type = question.get( 'file_upload_type' );
560
- $("input[name='file_upload_type[]']:checkbox").attr("checked",false);
561
  if( get_file_upload_type === null || typeof get_file_upload_type === "undefined" ){
562
  }else{
563
  var fut_arr = get_file_upload_type.split(",");
@@ -607,12 +609,12 @@ var import_button;
607
  var all_setting = question.get('settings');
608
  if( all_setting === null || typeof all_setting === "undefined" ){
609
  }else{
610
- $.each(all_setting, function( index, value ) {
611
  if($('#' + index + '_area').length > 0){
612
- if($('#' + index + '_area').find('input[type="checkbox"]').length > 1){
613
  var fut_arr = value.split(",");
614
- $.each(fut_arr,function(i){
615
- $("input[name='"+ index +"[]']:checkbox[value='"+ fut_arr[i] +"']").attr("checked","true");
616
  });
617
  }else{
618
  if( value != null)
@@ -776,6 +778,11 @@ var import_button;
776
  $('#question-bank').find('[name="qsm-question-checkbox[]"]').attr('checked',false);
777
  }
778
  });
 
 
 
 
 
779
 
780
  $( '.save-page-button' ).on( 'click', function( event ) {
781
  event.preventDefault();
123
  $( '#question-bank' ).prepend($cat_html);
124
  $('#question-bank-cat').val(pagination.category);
125
  }
126
+ if(pagination.current_page == 1){
127
  $( '#question-bank' ).prepend('<button class="button button-primary" id="qsm-import-selected-question">Import All Selected Questions</button>');
128
+ $( '#question-bank' ).prepend('<label class="qsm-select-all-label"><input type="checkbox" id="qsm_select_all_question" /> Select All Question</button>');
129
  }
130
  },
131
  addQuestionToQuestionBank: function( question ) {
200
  }
201
  } else {
202
  //We have removed this code in 7.0.0 because not allow to delete the single page.
203
+ QSMQuestion.questions.each( QSMQuestion.addQuestionToPage );
204
  }
205
  //Create Default pages and one question.
206
  if( qsmQuestionSettings.pages.length == 0 && QSMQuestion.questions.length == 0){
242
  pageInfo.set('questions', singlePage);
243
  qpages.push(pageInfo.attributes);
244
  });
245
+ console.log(pages);
246
  var data = {
247
  action: 'qsm_save_pages',
248
  pages: pages,
559
  }
560
  //Get checked question type
561
  var get_file_upload_type = question.get( 'file_upload_type' );
562
+ $("input[name='file_upload_type[]']:checkbox").attr("checked",false);
563
  if( get_file_upload_type === null || typeof get_file_upload_type === "undefined" ){
564
  }else{
565
  var fut_arr = get_file_upload_type.split(",");
609
  var all_setting = question.get('settings');
610
  if( all_setting === null || typeof all_setting === "undefined" ){
611
  }else{
612
+ $.each(all_setting, function( index, value ) {
613
  if($('#' + index + '_area').length > 0){
614
+ if($('#' + index + '_area').find('input[type="checkbox"]').length > 1){
615
  var fut_arr = value.split(",");
616
+ $.each(fut_arr,function(i){
617
+ $(".questionElements input[name='"+ index +"[]']:checkbox[value='"+ fut_arr[i] +"']").attr("checked","true").prop('checked', true);
618
  });
619
  }else{
620
  if( value != null)
778
  $('#question-bank').find('[name="qsm-question-checkbox[]"]').attr('checked',false);
779
  }
780
  });
781
+
782
+ //Select all button.
783
+ $( document ).on( 'change', '#qsm_select_all_question', function( event) {
784
+ $('.qsm-question-checkbox').prop('checked', jQuery('#qsm_select_all_question').prop('checked'));
785
+ });
786
 
787
  $( '.save-page-button' ).on( 'click', function( event ) {
788
  event.preventDefault();
mlw_quizmaster2.php CHANGED
@@ -2,14 +2,14 @@
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
- * Version: 7.0.2
6
  * Author: ExpressTech
7
  * Author URI: https://quizandsurveymaster.com/
8
  * Plugin URI: https://expresstech.io/
9
  * Text Domain: quiz-master-next
10
  *
11
  * @author QSM Team
12
- * @version 7.0.2
13
  * @package QSM
14
  */
15
 
@@ -37,7 +37,7 @@ class MLWQuizMasterNext {
37
  * @var string
38
  * @since 4.0.0
39
  */
40
- public $version = '7.0.2';
41
 
42
  /**
43
  * QSM Alert Manager Object
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
+ * Version: 7.1.0
6
  * Author: ExpressTech
7
  * Author URI: https://quizandsurveymaster.com/
8
  * Plugin URI: https://expresstech.io/
9
  * Text Domain: quiz-master-next
10
  *
11
  * @author QSM Team
12
+ * @version 7.1.0
13
  * @package QSM
14
  */
15
 
37
  * @var string
38
  * @since 4.0.0
39
  */
40
+ public $version = '7.1.0';
41
 
42
  /**
43
  * QSM Alert Manager Object
php/admin/admin-dashboard.php CHANGED
@@ -136,7 +136,7 @@ function qsm_generate_dashboard_page() {
136
  <div class="welcome-panel-column welcome-panel-last">
137
  <h3><?php _e( 'Useful Links', 'quiz-master-next' ); ?></h3>
138
  <ul>
139
- <li><a target="_blank" href="https://quizandsurveymaster.com/contact-support/" class="welcome-icon"><span class="dashicons dashicons-admin-users"></span>&nbsp;&nbsp;<?php _e( 'Support Forum', 'quiz-master-next' ); ?></a></li>
140
  <li><a target="_blank" href="https://github.com/QuizandSurveyMaster/quiz_master_next" class="welcome-icon"><span class="dashicons dashicons-editor-code"></span>&nbsp;&nbsp;<?php _e( 'Github Repository', 'quiz-master-next' ); ?></a></li>
141
  </ul>
142
  </div>
136
  <div class="welcome-panel-column welcome-panel-last">
137
  <h3><?php _e( 'Useful Links', 'quiz-master-next' ); ?></h3>
138
  <ul>
139
+ <li><a target="_blank" href="https://quizandsurveymaster.com/contact-support/" class="welcome-icon"><span class="dashicons dashicons-admin-users"></span>&nbsp;&nbsp;<?php _e( 'Contact Support', 'quiz-master-next' ); ?></a></li>
140
  <li><a target="_blank" href="https://github.com/QuizandSurveyMaster/quiz_master_next" class="welcome-icon"><span class="dashicons dashicons-editor-code"></span>&nbsp;&nbsp;<?php _e( 'Github Repository', 'quiz-master-next' ); ?></a></li>
141
  </ul>
142
  </div>
php/admin/functions.php CHANGED
@@ -549,6 +549,8 @@ function qsm_text_template_variable_list(){
549
  '%MAXIMUM_POINTS%' => __('Maximum possible points one can score', 'quiz-master-next'),
550
  '%AVERAGE_POINT%' => __('The average amount of points user had per question', 'quiz-master-next'),
551
  '%AMOUNT_CORRECT%' => __('The number of correct answers the user had', 'quiz-master-next'),
 
 
552
  '%TOTAL_QUESTIONS%' => __('The total number of questions in the quiz', 'quiz-master-next'),
553
  '%CORRECT_SCORE%' => __('Score for the quiz when using correct answers', 'quiz-master-next'),
554
  '%USER_NAME%' => __('The name the user entered before the quiz', 'quiz-master-next'),
@@ -566,6 +568,7 @@ function qsm_text_template_variable_list(){
566
  '%CATEGORY_AVERAGE_SCORE%' => __('The average score from all categories.', 'quiz-master-next'),
567
  '%QUESTION%' => __('The question that the user answered', 'quiz-master-next'),
568
  '%USER_ANSWER%' => __('The answer the user gave for the question', 'quiz-master-next'),
 
569
  '%CORRECT_ANSWER%' => __('The correct answer for the question', 'quiz-master-next'),
570
  '%USER_COMMENTS%' => __('The comments the user provided in the comment field for the question', 'quiz-master-next'),
571
  '%CORRECT_ANSWER_INFO%' => __('Reason why the correct answer is the correct answer', 'quiz-master-next'),
549
  '%MAXIMUM_POINTS%' => __('Maximum possible points one can score', 'quiz-master-next'),
550
  '%AVERAGE_POINT%' => __('The average amount of points user had per question', 'quiz-master-next'),
551
  '%AMOUNT_CORRECT%' => __('The number of correct answers the user had', 'quiz-master-next'),
552
+ '%AMOUNT_INCORRECT%' => __('The number of incorrect answers the user had', 'quiz-master-next'),
553
+ '%AMOUNT_ATTEMPTED%' => __('The number of questions are attempted', 'quiz-master-next'),
554
  '%TOTAL_QUESTIONS%' => __('The total number of questions in the quiz', 'quiz-master-next'),
555
  '%CORRECT_SCORE%' => __('Score for the quiz when using correct answers', 'quiz-master-next'),
556
  '%USER_NAME%' => __('The name the user entered before the quiz', 'quiz-master-next'),
568
  '%CATEGORY_AVERAGE_SCORE%' => __('The average score from all categories.', 'quiz-master-next'),
569
  '%QUESTION%' => __('The question that the user answered', 'quiz-master-next'),
570
  '%USER_ANSWER%' => __('The answer the user gave for the question', 'quiz-master-next'),
571
+ '%USER_ANSWERS_DEFAULT%' => __('The answer the user gave for the question with default design', 'quiz-master-next'),
572
  '%CORRECT_ANSWER%' => __('The correct answer for the question', 'quiz-master-next'),
573
  '%USER_COMMENTS%' => __('The comments the user provided in the comment field for the question', 'quiz-master-next'),
574
  '%CORRECT_ANSWER_INFO%' => __('Reason why the correct answer is the correct answer', 'quiz-master-next'),
php/admin/options-page-email-tab.php CHANGED
@@ -47,7 +47,7 @@ function qsm_options_emails_tab_content() {
47
  <button class="add-new-email button"><?php esc_html_e( 'Add New Email', 'quiz-master-next' ); ?></button>
48
  <a style="float: right;" class="qsm-show-all-variable-text" href="#"><?php _e('Insert Template Variables', 'quiz-master-next'); ?> <span class="dashicons dashicons-upload"></span></a>
49
  <a style="margin: 0 10px; float: right;" href="https://quizandsurveymaster.com/docs/v7/emails-tab/" target="_blank"><?php _e('View Documentation', 'quiz-master-next'); ?></a>
50
- <div id="emails"><div style="margin-bottom: 30px;margin-top: 35px;" class="qsm-spinner-loader"></div></div>
51
  <button class="save-emails button-primary"><?php esc_html_e( 'Save Emails', 'quiz-master-next' ); ?></button>
52
  <button class="add-new-email button"><?php esc_html_e( 'Add New Email', 'quiz-master-next' ); ?></button>
53
  <div class="qsm-alerts" style="margin-top: 20px;">
@@ -59,11 +59,11 @@ function qsm_options_emails_tab_content() {
59
 
60
  <!-- Templates -->
61
  <script type="text/template" id="tmpl-email">
62
- <div class="email">
63
- <header class="email-header">
64
  <div><button class="delete-email-button"><span class="dashicons dashicons-trash"></span></button></div>
65
  </header>
66
- <main class="email-content">
67
  <div class="email-when">
68
  <div class="email-content-header">
69
  <h4><?php esc_html_e('When...', 'quiz-master-') ?></h4>
@@ -126,15 +126,18 @@ function qsm_options_emails_tab_content() {
126
  $email_exta_variable = array(
127
  '%CONTACT_X%' => __( 'Value user entered into contact field. X is # of contact field. For example, first contact field would be %CONTACT_1%', 'quiz-master-next' ),
128
  '%CONTACT_ALL%' => __( 'Value user entered into contact field. X is # of contact field. For example, first contact field would be %CONTACT_1%', 'quiz-master-next' ),
129
- '%QUESTION_ANSWER_X%' => __('X = Question ID. It will show result of particular question.', 'quiz-master-next')
 
130
  );
131
  $variable_list = array_merge($email_exta_variable, $variable_list);
132
  $variable_list['%AVERAGE_CATEGORY_POINTS_X%'] = __('X: Category name - The average amount of points a specific category earned.', 'quiz-master-next');
133
  unset($variable_list['%QUESTION%']);
134
  unset($variable_list['%USER_ANSWER%']);
 
135
  unset($variable_list['%CORRECT_ANSWER%']);
136
  unset($variable_list['%USER_COMMENTS%']);
137
  unset($variable_list['%CORRECT_ANSWER_INFO%']);
 
138
  if( $variable_list ){
139
  foreach ( $variable_list as $key => $s_variable ) { ?>
140
  <div class="popup-template-span-wrap">
47
  <button class="add-new-email button"><?php esc_html_e( 'Add New Email', 'quiz-master-next' ); ?></button>
48
  <a style="float: right;" class="qsm-show-all-variable-text" href="#"><?php _e('Insert Template Variables', 'quiz-master-next'); ?> <span class="dashicons dashicons-upload"></span></a>
49
  <a style="margin: 0 10px; float: right;" href="https://quizandsurveymaster.com/docs/v7/emails-tab/" target="_blank"><?php _e('View Documentation', 'quiz-master-next'); ?></a>
50
+ <div id="qsm_emails"><div style="margin-bottom: 30px;margin-top: 35px;" class="qsm-spinner-loader"></div></div>
51
  <button class="save-emails button-primary"><?php esc_html_e( 'Save Emails', 'quiz-master-next' ); ?></button>
52
  <button class="add-new-email button"><?php esc_html_e( 'Add New Email', 'quiz-master-next' ); ?></button>
53
  <div class="qsm-alerts" style="margin-top: 20px;">
59
 
60
  <!-- Templates -->
61
  <script type="text/template" id="tmpl-email">
62
+ <div class="qsm-email">
63
+ <header class="qsm-email-header">
64
  <div><button class="delete-email-button"><span class="dashicons dashicons-trash"></span></button></div>
65
  </header>
66
+ <main class="qsm-email-content">
67
  <div class="email-when">
68
  <div class="email-content-header">
69
  <h4><?php esc_html_e('When...', 'quiz-master-') ?></h4>
126
  $email_exta_variable = array(
127
  '%CONTACT_X%' => __( 'Value user entered into contact field. X is # of contact field. For example, first contact field would be %CONTACT_1%', 'quiz-master-next' ),
128
  '%CONTACT_ALL%' => __( 'Value user entered into contact field. X is # of contact field. For example, first contact field would be %CONTACT_1%', 'quiz-master-next' ),
129
+ '%QUESTION_ANSWER_X%' => __('X = Question ID. It will show result of particular question.', 'quiz-master-next'),
130
+ '%QUESTIONS_ANSWERS_EMAIL%' => __('Shows the question, the answer provided by user, and the correct answer', 'quiz-master-next')
131
  );
132
  $variable_list = array_merge($email_exta_variable, $variable_list);
133
  $variable_list['%AVERAGE_CATEGORY_POINTS_X%'] = __('X: Category name - The average amount of points a specific category earned.', 'quiz-master-next');
134
  unset($variable_list['%QUESTION%']);
135
  unset($variable_list['%USER_ANSWER%']);
136
+ unset($variable_list['%USER_ANSWERS_DEFAULT%']);
137
  unset($variable_list['%CORRECT_ANSWER%']);
138
  unset($variable_list['%USER_COMMENTS%']);
139
  unset($variable_list['%CORRECT_ANSWER_INFO%']);
140
+ unset($variable_list['%QUESTIONS_ANSWERS%']);
141
  if( $variable_list ){
142
  foreach ( $variable_list as $key => $s_variable ) { ?>
143
  <div class="popup-template-span-wrap">
php/admin/options-page-questions-tab.php CHANGED
@@ -49,7 +49,10 @@ function qsm_options_questions_tab_content() {
49
  $qpage['questions'] = $val;
50
  $qpages[] = $qpage;
51
  }
52
- }
 
 
 
53
  $qpages = apply_filters('qsm_filter_quiz_page_attributes', $qpages, $pages);
54
  $json_data = array(
55
  'quizID' => $quiz_id,
@@ -254,6 +257,7 @@ function qsm_options_questions_tab_content() {
254
  echo qsm_display_question_option($qo_key, $single_answer_option);
255
  }
256
  ?>
 
257
  </div>
258
  <div id="postbox-container-1" class="postbox-container">
259
  <div id="side-sortables" class="meta-box-sortables ui-sortable" style="">
@@ -445,6 +449,7 @@ function qsm_options_questions_tab_content() {
445
  </div>
446
  </div>
447
  </div>
 
448
  </div>
449
  </div>
450
  </div>
49
  $qpage['questions'] = $val;
50
  $qpages[] = $qpage;
51
  }
52
+ } else {
53
+ $defaultQPage = array('id' => 1, 'quizID' => $quiz_id, 'pagekey' => uniqid(), 'hide_prevbtn' => 0, 'questions' => array());
54
+ $qpages[] = $defaultQPage;
55
+ }
56
  $qpages = apply_filters('qsm_filter_quiz_page_attributes', $qpages, $pages);
57
  $json_data = array(
58
  'quizID' => $quiz_id,
257
  echo qsm_display_question_option($qo_key, $single_answer_option);
258
  }
259
  ?>
260
+ <?php do_action('qsm_question_form_fields', $quiz_id);?>
261
  </div>
262
  <div id="postbox-container-1" class="postbox-container">
263
  <div id="side-sortables" class="meta-box-sortables ui-sortable" style="">
449
  </div>
450
  </div>
451
  </div>
452
+ <?php do_action('qsm_question_form_fields_side', $quiz_id);?>
453
  </div>
454
  </div>
455
  </div>
php/admin/options-page-results-page-tab.php CHANGED
@@ -129,6 +129,7 @@ function qsm_options_results_tab_content() {
129
  $variable_list['%QUESTION_ANSWER_X%'] = __('X = Question ID. It will show result of particular question.', 'quiz-master-next');
130
  unset($variable_list['%QUESTION%']);
131
  unset($variable_list['%USER_ANSWER%']);
 
132
  unset($variable_list['%CORRECT_ANSWER%']);
133
  unset($variable_list['%USER_COMMENTS%']);
134
  unset($variable_list['%CORRECT_ANSWER_INFO%']);
129
  $variable_list['%QUESTION_ANSWER_X%'] = __('X = Question ID. It will show result of particular question.', 'quiz-master-next');
130
  unset($variable_list['%QUESTION%']);
131
  unset($variable_list['%USER_ANSWER%']);
132
+ unset($variable_list['%USER_ANSWERS_DEFAULT%']);
133
  unset($variable_list['%CORRECT_ANSWER%']);
134
  unset($variable_list['%USER_COMMENTS%']);
135
  unset($variable_list['%CORRECT_ANSWER_INFO%']);
php/admin/options-page-text-tab.php CHANGED
@@ -30,7 +30,7 @@ function mlw_options_text_tab_content() {
30
  <p style="text-align: right;"><a href="https://quizandsurveymaster.com/docs/v7/text-tab/" target="_blank"><?php _e( 'View Documentation', 'quiz-master-next' ); ?></a></p>
31
  <div id="poststuff">
32
  <div id="post-body" class="metabox-holder columns-2">
33
- <div id="post-body-content" style="position: relative;">
34
  <?php
35
  $quiz_text_arr = $mlwQuizMasterNext->quiz_settings->load_setting_fields( 'quiz_text' );
36
  $editor_text_arr = $text_text_arr = array();
30
  <p style="text-align: right;"><a href="https://quizandsurveymaster.com/docs/v7/text-tab/" target="_blank"><?php _e( 'View Documentation', 'quiz-master-next' ); ?></a></p>
31
  <div id="poststuff">
32
  <div id="post-body" class="metabox-holder columns-2">
33
+ <div class="qsm-question-text-tab" id="post-body-content" style="position: relative;">
34
  <?php
35
  $quiz_text_arr = $mlwQuizMasterNext->quiz_settings->load_setting_fields( 'quiz_text' );
36
  $editor_text_arr = $text_text_arr = array();
php/admin/quiz-options-page.php CHANGED
@@ -51,7 +51,8 @@ function qsm_generate_quiz_options() {
51
  wp_enqueue_script( 'jquery-ui-core' );
52
  wp_enqueue_script( 'jquery-ui-dialog' );
53
  wp_enqueue_script( 'jquery-ui-button' );
54
- wp_enqueue_script( 'jquery-ui-datepicker' );
 
55
  wp_enqueue_script( 'jquery-ui-tabs' );
56
  wp_enqueue_script( 'jquery-effects-blind' );
57
  wp_enqueue_script( 'jquery-effects-explode' );
51
  wp_enqueue_script( 'jquery-ui-core' );
52
  wp_enqueue_script( 'jquery-ui-dialog' );
53
  wp_enqueue_script( 'jquery-ui-button' );
54
+ wp_enqueue_script( 'qmn_datetime_js', plugins_url( '../../js/jquery.datetimepicker.full.min.js', __FILE__ ) );
55
+ wp_enqueue_style( 'qsm_datetime_style', plugins_url( '../../css/jquery.datetimepicker.css', __FILE__ ) );
56
  wp_enqueue_script( 'jquery-ui-tabs' );
57
  wp_enqueue_script( 'jquery-effects-blind' );
58
  wp_enqueue_script( 'jquery-effects-explode' );
php/admin/settings-page.php CHANGED
@@ -47,6 +47,8 @@ class QMNGlobalSettingsPage {
47
  add_settings_field( 'ip-collection', __( 'Disable collecting and storing IP addresses?', 'quiz-master-next' ), array( $this, 'ip_collection_field' ), 'qmn_global_settings', 'qmn-global-section' );
48
  add_settings_field( 'cpt-search', __( 'Disable Quiz Posts From Being Searched?', 'quiz-master-next' ), array( $this, 'cpt_search_field' ), 'qmn_global_settings', 'qmn-global-section' );
49
  add_settings_field( 'cpt-archive', __( 'Disable Quiz Archive?', 'quiz-master-next' ), array( $this, 'cpt_archive_field' ), 'qmn_global_settings', 'qmn-global-section' );
 
 
50
  add_settings_field( 'cpt-slug', __( 'Quiz Url Slug', 'quiz-master-next' ), array( $this, 'cpt_slug_field' ), 'qmn_global_settings', 'qmn-global-section' );
51
  add_settings_field( 'plural-name', __( 'Post Type Plural Name (Shown in various places such as on archive pages)', 'quiz-master-next' ), array( $this, 'plural_name_field' ), 'qmn_global_settings', 'qmn-global-section' );
52
  add_settings_field( 'facebook-app-id', __( 'Facebook App Id', 'quiz-master-next' ), array( $this, 'facebook_app_id' ), 'qmn_global_settings', 'qmn-global-section' );
@@ -70,7 +72,7 @@ class QMNGlobalSettingsPage {
70
  if ( isset( $_GET["settings-updated"] ) && $_GET["settings-updated"] ) {
71
  flush_rewrite_rules( true );
72
  echo '<div class="updated" style="padding: 10px;">';
73
- echo "<span style='color:red;'>" . __( ' Settings have been updated!', 'quiz-master-next' ) . "</span>";
74
  echo '</div>';
75
  }
76
  }
@@ -219,6 +221,54 @@ class QMNGlobalSettingsPage {
219
  echo "<input type='checkbox' name='qmn-settings[cpt_archive]' id='qmn-settings[cpt_archive]' value='1'$checked />";
220
  echo '<span class="slider round"></span></label>';
221
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
 
223
  /**
224
  * Generates Setting Field For Results Details Template
47
  add_settings_field( 'ip-collection', __( 'Disable collecting and storing IP addresses?', 'quiz-master-next' ), array( $this, 'ip_collection_field' ), 'qmn_global_settings', 'qmn-global-section' );
48
  add_settings_field( 'cpt-search', __( 'Disable Quiz Posts From Being Searched?', 'quiz-master-next' ), array( $this, 'cpt_search_field' ), 'qmn_global_settings', 'qmn-global-section' );
49
  add_settings_field( 'cpt-archive', __( 'Disable Quiz Archive?', 'quiz-master-next' ), array( $this, 'cpt_archive_field' ), 'qmn_global_settings', 'qmn-global-section' );
50
+ add_settings_field( 'detele-qsm-data', __( 'Delete all the data related to QSM on deletion?', 'quiz-master-next' ), array( $this, 'qsm_delete_data' ), 'qmn_global_settings', 'qmn-global-section' );
51
+ add_settings_field( 'background-quiz-email-process', __( 'Process emails in background?', 'quiz-master-next' ), array( $this, 'qsm_background_quiz_email_process' ), 'qmn_global_settings', 'qmn-global-section' );
52
  add_settings_field( 'cpt-slug', __( 'Quiz Url Slug', 'quiz-master-next' ), array( $this, 'cpt_slug_field' ), 'qmn_global_settings', 'qmn-global-section' );
53
  add_settings_field( 'plural-name', __( 'Post Type Plural Name (Shown in various places such as on archive pages)', 'quiz-master-next' ), array( $this, 'plural_name_field' ), 'qmn_global_settings', 'qmn-global-section' );
54
  add_settings_field( 'facebook-app-id', __( 'Facebook App Id', 'quiz-master-next' ), array( $this, 'facebook_app_id' ), 'qmn_global_settings', 'qmn-global-section' );
72
  if ( isset( $_GET["settings-updated"] ) && $_GET["settings-updated"] ) {
73
  flush_rewrite_rules( true );
74
  echo '<div class="updated" style="padding: 10px;">';
75
+ echo "<span>" . __( ' Settings have been updated!', 'quiz-master-next' ) . "</span>";
76
  echo '</div>';
77
  }
78
  }
221
  echo "<input type='checkbox' name='qmn-settings[cpt_archive]' id='qmn-settings[cpt_archive]' value='1'$checked />";
222
  echo '<span class="slider round"></span></label>';
223
  }
224
+
225
+ /**
226
+ * Generates Setting Field For delete QSM data
227
+ *
228
+ * @since 7.0.3
229
+ * @return void
230
+ */
231
+ public function qsm_delete_data()
232
+ {
233
+ $settings = (array) get_option( 'qmn-settings' );
234
+ $cpt_archive = '0';
235
+ if (isset($settings['delete_qsm_data']))
236
+ {
237
+ $cpt_archive = esc_attr( $settings['delete_qsm_data'] );
238
+ }
239
+ $checked = '';
240
+ if ($cpt_archive == '1')
241
+ {
242
+ $checked = " checked='checked'";
243
+ }
244
+ echo '<label class="switch">';
245
+ echo "<input type='checkbox' name='qmn-settings[delete_qsm_data]' id='qmn-settings[delete_qsm_data]' value='1'$checked />";
246
+ echo '<span class="slider round"></span></label>';
247
+ }
248
+
249
+ /**
250
+ * Generates Setting Field For background email process
251
+ *
252
+ * @since 7.0.3
253
+ * @return void
254
+ */
255
+ public function qsm_background_quiz_email_process()
256
+ {
257
+ $settings = (array) get_option( 'qmn-settings' );
258
+ $background_quiz_email_process = '1';
259
+ if ( isset($settings['background_quiz_email_process']) ){
260
+ $background_quiz_email_process = esc_attr( $settings['background_quiz_email_process'] );
261
+ }
262
+ echo '<label style="margin-bottom: 10px;display: inline-block;">';
263
+ echo "<input type='radio' name='qmn-settings[background_quiz_email_process]' class='background_quiz_email_process' value='1' ". checked($background_quiz_email_process, '1', false) ."/>";
264
+ echo __('Yes', 'quiz-master-next');
265
+ echo '</label>';
266
+ echo '<br/>';
267
+ echo '<label>';
268
+ echo "<input type='radio' name='qmn-settings[background_quiz_email_process]' class='background_quiz_email_process' value='0' ". checked($background_quiz_email_process, '0', false) ."/>";
269
+ echo __('No', 'quiz-master-next');
270
+ echo '</label>';
271
+ }
272
 
273
  /**
274
  * Generates Setting Field For Results Details Template
php/classes/class-qmn-plugin-helper.php CHANGED
@@ -196,7 +196,7 @@ class QMNPluginHelper {
196
  */
197
  public function get_section_setting( $section, $setting, $default = false ) {
198
  global $mlwQuizMasterNext;
199
- return $mlwQuizMasterNext->quiz_settings->get_section_setting( $section, $setting, $default );
200
  }
201
 
202
  /**
196
  */
197
  public function get_section_setting( $section, $setting, $default = false ) {
198
  global $mlwQuizMasterNext;
199
+ return apply_filters('qsm_section_setting_text', $mlwQuizMasterNext->quiz_settings->get_section_setting( $section, $setting, $default ));
200
  }
201
 
202
  /**
php/classes/class-qmn-quiz-creator.php CHANGED
@@ -79,8 +79,8 @@ class QMNQuizCreator {
79
  'message_after' => 'Thanks for submitting your response! You can edit this message on the "Results Pages" tab. <br>%CONTACT_ALL% <br>%QUESTIONS_ANSWERS%',
80
  'message_comment' => 'Please fill in the comment box below.',
81
  'message_end_template' => '',
82
- 'user_email_template' => '%QUESTIONS_ANSWERS%',
83
- 'admin_email_template' => '%QUESTIONS_ANSWERS%',
84
  'submit_button_text' => 'Submit',
85
  'name_field_text' => 'Name',
86
  'business_field_text' => 'Business',
@@ -88,7 +88,7 @@ class QMNQuizCreator {
88
  'phone_field_text' => 'Phone Number',
89
  'comment_field_text' => 'Comments',
90
  'email_from_text' => 'Wordpress',
91
- 'question_answer_template' => '%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />',
92
  'leaderboard_template' => '',
93
  'quiz_system' => 0,
94
  'randomness_order' => 0,
@@ -328,7 +328,13 @@ class QMNQuizCreator {
328
  $quiz_settings = unserialize( $mlw_qmn_duplicate_data->quiz_settings );
329
  if( $is_duplicating_questions == 0 ){
330
  $quiz_settings['pages'] = '';
331
- }
 
 
 
 
 
 
332
  $results = $wpdb->insert(
333
  $table_name,
334
  array(
@@ -348,7 +354,7 @@ class QMNQuizCreator {
348
  'email_from_text' => $mlw_qmn_duplicate_data->email_from_text,
349
  'question_answer_template' => $mlw_qmn_duplicate_data->question_answer_template,
350
  'leaderboard_template' => $mlw_qmn_duplicate_data->leaderboard_template,
351
- 'quiz_system' => isset( $mlw_qmn_duplicate_data->system ) ? $mlw_qmn_duplicate_data->system : isset( $mlw_qmn_duplicate_data->quiz_system ) ? $mlw_qmn_duplicate_data->quiz_system : 0,
352
  'randomness_order' => $mlw_qmn_duplicate_data->randomness_order,
353
  'loggedin_user_contact' => $mlw_qmn_duplicate_data->loggedin_user_contact,
354
  'show_score' => $mlw_qmn_duplicate_data->show_score,
79
  'message_after' => 'Thanks for submitting your response! You can edit this message on the "Results Pages" tab. <br>%CONTACT_ALL% <br>%QUESTIONS_ANSWERS%',
80
  'message_comment' => 'Please fill in the comment box below.',
81
  'message_end_template' => '',
82
+ 'user_email_template' => '%QUESTIONS_ANSWERS_EMAIL%',
83
+ 'admin_email_template' => '%QUESTIONS_ANSWERS_EMAIL%',
84
  'submit_button_text' => 'Submit',
85
  'name_field_text' => 'Name',
86
  'business_field_text' => 'Business',
88
  'phone_field_text' => 'Phone Number',
89
  'comment_field_text' => 'Comments',
90
  'email_from_text' => 'Wordpress',
91
+ 'question_answer_template' => '%QUESTION%<br />%USER_ANSWERS_DEFAULT%',
92
  'leaderboard_template' => '',
93
  'quiz_system' => 0,
94
  'randomness_order' => 0,
328
  $quiz_settings = unserialize( $mlw_qmn_duplicate_data->quiz_settings );
329
  if( $is_duplicating_questions == 0 ){
330
  $quiz_settings['pages'] = '';
331
+ }
332
+ $qsm_create_quiz_system = 0;
333
+ if( isset( $mlw_qmn_duplicate_data->system ) ){
334
+ $qsm_create_quiz_system = $mlw_qmn_duplicate_data->system;
335
+ } else if( isset( $mlw_qmn_duplicate_data->quiz_system ) ){
336
+ $qsm_create_quiz_system = $mlw_qmn_duplicate_data->quiz_system;
337
+ }
338
  $results = $wpdb->insert(
339
  $table_name,
340
  array(
354
  'email_from_text' => $mlw_qmn_duplicate_data->email_from_text,
355
  'question_answer_template' => $mlw_qmn_duplicate_data->question_answer_template,
356
  'leaderboard_template' => $mlw_qmn_duplicate_data->leaderboard_template,
357
+ 'quiz_system' => $qsm_create_quiz_system,
358
  'randomness_order' => $mlw_qmn_duplicate_data->randomness_order,
359
  'loggedin_user_contact' => $mlw_qmn_duplicate_data->loggedin_user_contact,
360
  'show_score' => $mlw_qmn_duplicate_data->show_score,
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -101,6 +101,8 @@ class QMNQuizManager {
101
  $datafile = $_FILES["file"]["tmp_name"];
102
  //$file_name = $_FILES["file"]["name"];
103
  $extension = pathinfo($file_name, PATHINFO_EXTENSION);
 
 
104
  $rawBaseName = 'qsmfileupload_' . md5( date('Y-m-d H:i:s') ) . '_' . pathinfo($file_name, PATHINFO_FILENAME);
105
  $new_fname = $rawBaseName . '.' . $extension;
106
  $file = $upload_dir['path'] . '/' . $new_fname;
@@ -403,6 +405,7 @@ class QMNQuizManager {
403
  $question_ids[] = intval($question);
404
  }
405
  }
 
406
  $question_sql = implode(', ', $question_ids);
407
  $questions = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}mlw_questions WHERE question_id IN ($question_sql) " . $cat_query . $order_by_sql . $limit_sql);
408
 
@@ -421,9 +424,15 @@ class QMNQuizManager {
421
  $questions = $ordered_questions;
422
  }
423
  } else {
424
- $questions = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted=0 " . $cat_query . $order_by_sql . $limit_sql, $quiz_id));
 
 
 
 
 
 
425
  }
426
-
427
  // Returns an array of all the loaded questions.
428
  return $questions;
429
  }
@@ -522,8 +531,8 @@ class QMNQuizManager {
522
  $qmn_total_questions = 0;
523
  global $mlw_qmn_section_count;
524
  $mlw_qmn_section_count = 0;
525
-
526
- $quiz_display .= "<div class='qsm-quiz-container qmn_quiz_container mlw_qmn_quiz'>";
527
  // Get quiz post based on quiz id
528
  $args = array(
529
  'posts_per_page' => 1,
@@ -547,7 +556,7 @@ class QMNQuizManager {
547
  /* Restore original Post Data */
548
  wp_reset_postdata();
549
  }
550
- $quiz_display = apply_filters('qsm_display_before_form', $quiz_display);
551
  $quiz_display .= "<form name='quizForm{$quiz_data['quiz_id']}' id='quizForm{$quiz_data['quiz_id']}' action='".$_SERVER['REQUEST_URI']."' method='POST' class='qsm-quiz-form qmn_quiz_form mlw_quiz_form' novalidate enctype='multipart/form-data'>";
552
  $quiz_display .= "<input type='hidden' name='qsm_hidden_questions' id='qsm_hidden_questions' value=''>";
553
  $quiz_display .= "<div id='mlw_error_message' class='qsm-error-message qmn_error_message_section'></div>";
@@ -630,6 +639,7 @@ class QMNQuizManager {
630
  }
631
 
632
  // If there is only one page.
 
633
  if (1 == count($pages)) {
634
  ?>
635
  <section class="qsm-page <?php echo $animation_effect; ?>">
@@ -708,9 +718,10 @@ class QMNQuizManager {
708
  $qpage = (isset($qpages[$key]) ? $qpages[$key] : array());
709
  $qpage_id = (isset($qpage['id']) ? $qpage['id'] : $key);
710
  $page_key = (isset($qpage['pagekey']) ? $qpage['pagekey'] : $key);
711
- $hide_prevbtn = (isset($qpage['hide_prevbtn']) ? $qpage['hide_prevbtn'] : 0);
 
712
  ?>
713
- <section class="qsm-page <?php echo $animation_effect; ?> qsm-page-<?php echo $qpage_id;?>" data-pid="<?php echo $qpage_id;?>" data-prevbtn="<?php echo $hide_prevbtn;?>">
714
  <?php do_action('qsm_action_before_page', $qpage_id, $qpage);?>
715
  <?php
716
  foreach ($page as $question_id) {
@@ -765,7 +776,7 @@ class QMNQuizManager {
765
  $message_after = wpautop(htmlspecialchars_decode($options->message_end_template, ENT_QUOTES));
766
  $message_after = apply_filters('mlw_qmn_template_variable_quiz_page', $message_after, $quiz_data);
767
  ?>
768
- <section class="qsm-page">
769
  <div class="quiz_section">
770
  <div class='qsm-after-message mlw_qmn_message_end'><?php echo $message_after; ?></div>
771
  <?php
@@ -864,7 +875,11 @@ class QMNQuizManager {
864
  foreach ($qmn_quiz_questions as $mlw_question) {
865
  $question_id_list .= $mlw_question->question_id . "Q";
866
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
867
- $question_display .= "<div class='quiz_section {$animation_effect} question-section-id-{$mlw_question->question_id} slide{$mlw_qmn_section_count}'>";
 
 
 
 
868
 
869
  $question_display .= $mlwQuizMasterNext->pluginHelper->display_question($mlw_question->question_type_new, $mlw_question->question_id, $qmn_quiz_options);
870
 
@@ -937,7 +952,7 @@ class QMNQuizManager {
937
  $section_display = '';
938
  $section_display .= '<br />';
939
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
940
- $section_display .= "<div class='quiz_section slide$mlw_qmn_section_count quiz_end'>";
941
  if (!empty($qmn_quiz_options->message_end_template)) {
942
  $message_end = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_end_template, ENT_QUOTES));
943
  $message_end = apply_filters('mlw_qmn_template_variable_quiz_page', $message_end, $qmn_array_for_variables);
@@ -1096,6 +1111,7 @@ class QMNQuizManager {
1096
  $qmn_array_for_variables['time_taken'] = current_time('h:i:s A m/d/Y');
1097
  $qmn_array_for_variables['contact'] = $contact_responses;
1098
  $qmn_array_for_variables['hidden_questions'] = isset($_POST['qsm_hidden_questions']) ? json_decode(html_entity_decode(stripslashes($_POST['qsm_hidden_questions'])),true) : array();
 
1099
 
1100
  if (!isset($_POST["mlw_code_captcha"]) || ( isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] == $_POST["mlw_code_captcha"] )) {
1101
 
@@ -1205,13 +1221,17 @@ class QMNQuizManager {
1205
  do_action('qsm_quiz_submitted', $results_array, $results_id, $qmn_quiz_options, $qmn_array_for_variables);
1206
 
1207
  $qmn_array_for_variables = apply_filters( 'qmn_filter_email_content', $qmn_array_for_variables, $results_id);
1208
-
1209
- // Send the emails in background.
1210
- $qmn_array_for_variables['quiz_settings'] = isset( $qmn_quiz_options->quiz_settings ) ? @unserialize( $qmn_quiz_options->quiz_settings ) : array();
1211
- $this->qsm_background_email->data( array( 'name' => 'send_emails', 'variables' => $qmn_array_for_variables ) )->dispatch();
1212
-
1213
- // Sends the emails - Defer the emails.
1214
- //QSM_Emails::send_emails($qmn_array_for_variables);
 
 
 
 
1215
 
1216
  /**
1217
  * Filters for filtering the results text after emails are sent.
@@ -1279,6 +1299,7 @@ class QMNQuizManager {
1279
  $answer_points = 0;
1280
  $question_data = array();
1281
  $total_possible_points = 0;
 
1282
 
1283
  // Question types to calculate result on
1284
  $result_question_types = array(
@@ -1367,7 +1388,13 @@ class QMNQuizManager {
1367
  }
1368
  $user_answer = $results_array["user_text"];
1369
  $correct_answer = $results_array["correct_text"];
1370
-
 
 
 
 
 
 
1371
  // If a comment was submitted
1372
  if (isset($_POST["mlwComment" . $question['question_id']])) {
1373
  $comment = sanitize_textarea_field( htmlspecialchars(stripslashes($_POST["mlwComment" . $question['question_id']]), ENT_QUOTES) );
@@ -1448,7 +1475,11 @@ class QMNQuizManager {
1448
  }
1449
  $user_answer = $results_array["user_text"];
1450
  $correct_answer = $results_array["correct_text"];
1451
-
 
 
 
 
1452
  // If a comment was submitted
1453
  if (isset($_POST["mlwComment" . $question['question_id']])) {
1454
  $comment = sanitize_textarea_field( htmlspecialchars(stripslashes($_POST["mlwComment" . $question['question_id']]), ENT_QUOTES) );
@@ -1497,7 +1528,8 @@ class QMNQuizManager {
1497
  'total_questions' => $total_questions,
1498
  'question_answers_display' => '', // Kept for backwards compatibility
1499
  'question_answers_array' => $question_data,
1500
- 'total_possible_points' => $total_possible_points
 
1501
  );
1502
  }
1503
 
@@ -1921,27 +1953,32 @@ function qsm_scheduled_timeframe_check($display, $options, $variable_data) {
1921
 
1922
  $checked_pass = FALSE;
1923
  // Checks if the start and end dates have data
1924
- if (!empty($options->scheduled_time_start) && !empty($options->scheduled_time_end)) {
1925
  $start = strtotime($options->scheduled_time_start);
1926
- $end = strtotime($options->scheduled_time_end) + 86399;
1927
-
 
 
 
1928
  // Checks if the current timestamp is outside of scheduled timeframe
1929
- if (current_time('timestamp') < $start || current_time('timestamp') > $end) {
1930
  $checked_pass = TRUE;
1931
  }
1932
  }
1933
- if ( !empty( $options->scheduled_time_start ) && empty( $options->scheduled_time_end ) ){
1934
- $start = strtotime($options->scheduled_time_start);
1935
- if ( current_time('timestamp') < $start ){
 
1936
  $checked_pass = TRUE;
1937
  }
1938
  }
1939
- if ( empty( $options->scheduled_time_start ) && !empty( $options->scheduled_time_end ) ){
1940
- $end = strtotime($options->scheduled_time_end) + 86399;
1941
- if ( current_time('timestamp') > $end ) {
 
1942
  $checked_pass = TRUE;
1943
  }
1944
- }
1945
  if( $checked_pass == TRUE ){
1946
  $qmn_allowed_visit = false;
1947
  $message = wpautop(htmlspecialchars_decode($options->scheduled_timeframe_text, ENT_QUOTES));
101
  $datafile = $_FILES["file"]["tmp_name"];
102
  //$file_name = $_FILES["file"]["name"];
103
  $extension = pathinfo($file_name, PATHINFO_EXTENSION);
104
+ //remove white space between file name
105
+ $file_name = str_replace(' ', '-', $file_name);
106
  $rawBaseName = 'qsmfileupload_' . md5( date('Y-m-d H:i:s') ) . '_' . pathinfo($file_name, PATHINFO_FILENAME);
107
  $new_fname = $rawBaseName . '.' . $extension;
108
  $file = $upload_dir['path'] . '/' . $new_fname;
405
  $question_ids[] = intval($question);
406
  }
407
  }
408
+ $question_ids = apply_filters('qsm_load_questions_ids', $question_ids, $quiz_id, $quiz_options);
409
  $question_sql = implode(', ', $question_ids);
410
  $questions = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}mlw_questions WHERE question_id IN ($question_sql) " . $cat_query . $order_by_sql . $limit_sql);
411
 
424
  $questions = $ordered_questions;
425
  }
426
  } else {
427
+ $question_ids = apply_filters('qsm_load_questions_ids', array(), $quiz_id, $quiz_options);
428
+ $question_sql = '';
429
+ if (!empty($question_ids)) {
430
+ $qids = implode(', ', $question_ids);
431
+ $question_sql = " AND question_id IN ({$qids}) ";
432
+ }
433
+ $questions = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted=0 {$question_sql} {$cat_query} {$order_by_sql} {$limit_sql}", $quiz_id));
434
  }
435
+ $questions = apply_filters('qsm_load_questions_filter', $questions, $quiz_id, $quiz_options);
436
  // Returns an array of all the loaded questions.
437
  return $questions;
438
  }
531
  $qmn_total_questions = 0;
532
  global $mlw_qmn_section_count;
533
  $mlw_qmn_section_count = 0;
534
+ $auto_pagination_class = $options->pagination > 0 ? 'qsm_auto_pagination_enabled' : '';
535
+ $quiz_display .= "<div class='qsm-quiz-container qmn_quiz_container mlw_qmn_quiz {$auto_pagination_class}'>";
536
  // Get quiz post based on quiz id
537
  $args = array(
538
  'posts_per_page' => 1,
556
  /* Restore original Post Data */
557
  wp_reset_postdata();
558
  }
559
+ $quiz_display = apply_filters('qsm_display_before_form', $quiz_display, $options, $quiz_data);
560
  $quiz_display .= "<form name='quizForm{$quiz_data['quiz_id']}' id='quizForm{$quiz_data['quiz_id']}' action='".$_SERVER['REQUEST_URI']."' method='POST' class='qsm-quiz-form qmn_quiz_form mlw_quiz_form' novalidate enctype='multipart/form-data'>";
561
  $quiz_display .= "<input type='hidden' name='qsm_hidden_questions' id='qsm_hidden_questions' value=''>";
562
  $quiz_display .= "<div id='mlw_error_message' class='qsm-error-message qmn_error_message_section'></div>";
639
  }
640
 
641
  // If there is only one page.
642
+ $pages = apply_filters('qsm_display_pages', $pages, $options->quiz_id, $options);
643
  if (1 == count($pages)) {
644
  ?>
645
  <section class="qsm-page <?php echo $animation_effect; ?>">
718
  $qpage = (isset($qpages[$key]) ? $qpages[$key] : array());
719
  $qpage_id = (isset($qpage['id']) ? $qpage['id'] : $key);
720
  $page_key = (isset($qpage['pagekey']) ? $qpage['pagekey'] : $key);
721
+ $hide_prevbtn = (isset($qpage['hide_prevbtn']) ? $qpage['hide_prevbtn'] : 0);
722
+ $style = "style='display: none;'";
723
  ?>
724
+ <section class="qsm-page <?php echo $animation_effect; ?> qsm-page-<?php echo $qpage_id;?>" data-pid="<?php echo $qpage_id;?>" data-prevbtn="<?php echo $hide_prevbtn;?>" <?php echo $style; ?>>
725
  <?php do_action('qsm_action_before_page', $qpage_id, $qpage);?>
726
  <?php
727
  foreach ($page as $question_id) {
776
  $message_after = wpautop(htmlspecialchars_decode($options->message_end_template, ENT_QUOTES));
777
  $message_after = apply_filters('mlw_qmn_template_variable_quiz_page', $message_after, $quiz_data);
778
  ?>
779
+ <section class="qsm-page" style="display: none;">
780
  <div class="quiz_section">
781
  <div class='qsm-after-message mlw_qmn_message_end'><?php echo $message_after; ?></div>
782
  <?php
875
  foreach ($qmn_quiz_questions as $mlw_question) {
876
  $question_id_list .= $mlw_question->question_id . "Q";
877
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
878
+ $style = '';
879
+ if( $mlw_qmn_section_count != 1 ){
880
+ $style = "style='display: none;'";
881
+ }
882
+ $question_display .= "<div class='quiz_section {$animation_effect} question-section-id-{$mlw_question->question_id} slide{$mlw_qmn_section_count}' {$style}>";
883
 
884
  $question_display .= $mlwQuizMasterNext->pluginHelper->display_question($mlw_question->question_type_new, $mlw_question->question_id, $qmn_quiz_options);
885
 
952
  $section_display = '';
953
  $section_display .= '<br />';
954
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
955
+ $section_display .= "<div class='quiz_section slide$mlw_qmn_section_count quiz_end' style='display: none;'>";
956
  if (!empty($qmn_quiz_options->message_end_template)) {
957
  $message_end = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_end_template, ENT_QUOTES));
958
  $message_end = apply_filters('mlw_qmn_template_variable_quiz_page', $message_end, $qmn_array_for_variables);
1111
  $qmn_array_for_variables['time_taken'] = current_time('h:i:s A m/d/Y');
1112
  $qmn_array_for_variables['contact'] = $contact_responses;
1113
  $qmn_array_for_variables['hidden_questions'] = isset($_POST['qsm_hidden_questions']) ? json_decode(html_entity_decode(stripslashes($_POST['qsm_hidden_questions'])),true) : array();
1114
+ $qmn_array_for_variables = apply_filters('qsm_result_variables', $qmn_array_for_variables);
1115
 
1116
  if (!isset($_POST["mlw_code_captcha"]) || ( isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] == $_POST["mlw_code_captcha"] )) {
1117
 
1221
  do_action('qsm_quiz_submitted', $results_array, $results_id, $qmn_quiz_options, $qmn_array_for_variables);
1222
 
1223
  $qmn_array_for_variables = apply_filters( 'qmn_filter_email_content', $qmn_array_for_variables, $results_id);
1224
+
1225
+ $qmn_global_settings = (array) get_option('qmn-settings');
1226
+ $background_quiz_email_process = isset( $qmn_global_settings['background_quiz_email_process'] ) ? esc_attr( $qmn_global_settings['background_quiz_email_process'] ) : '1';
1227
+ if( $background_quiz_email_process == 1 ){
1228
+ // Send the emails in background.
1229
+ $qmn_array_for_variables['quiz_settings'] = isset( $qmn_quiz_options->quiz_settings ) ? @unserialize( $qmn_quiz_options->quiz_settings ) : array();
1230
+ $this->qsm_background_email->data( array( 'name' => 'send_emails', 'variables' => $qmn_array_for_variables ) )->dispatch();
1231
+ }else{
1232
+ // Sends the emails.
1233
+ QSM_Emails::send_emails($qmn_array_for_variables);
1234
+ }
1235
 
1236
  /**
1237
  * Filters for filtering the results text after emails are sent.
1299
  $answer_points = 0;
1300
  $question_data = array();
1301
  $total_possible_points = 0;
1302
+ $attempted_question = 0;
1303
 
1304
  // Question types to calculate result on
1305
  $result_question_types = array(
1388
  }
1389
  $user_answer = $results_array["user_text"];
1390
  $correct_answer = $results_array["correct_text"];
1391
+
1392
+ if( trim( $user_answer ) != '' ){
1393
+ if( $user_answer != 'No Answer Provided' ){
1394
+ $attempted_question++;
1395
+ }
1396
+ }
1397
+
1398
  // If a comment was submitted
1399
  if (isset($_POST["mlwComment" . $question['question_id']])) {
1400
  $comment = sanitize_textarea_field( htmlspecialchars(stripslashes($_POST["mlwComment" . $question['question_id']]), ENT_QUOTES) );
1475
  }
1476
  $user_answer = $results_array["user_text"];
1477
  $correct_answer = $results_array["correct_text"];
1478
+ if( trim( $user_answer ) != '' ){
1479
+ if( $user_answer != 'No Answer Provided' ){
1480
+ $attempted_question++;
1481
+ }
1482
+ }
1483
  // If a comment was submitted
1484
  if (isset($_POST["mlwComment" . $question['question_id']])) {
1485
  $comment = sanitize_textarea_field( htmlspecialchars(stripslashes($_POST["mlwComment" . $question['question_id']]), ENT_QUOTES) );
1528
  'total_questions' => $total_questions,
1529
  'question_answers_display' => '', // Kept for backwards compatibility
1530
  'question_answers_array' => $question_data,
1531
+ 'total_possible_points' => $total_possible_points,
1532
+ 'total_attempted_questions' => $attempted_question
1533
  );
1534
  }
1535
 
1953
 
1954
  $checked_pass = FALSE;
1955
  // Checks if the start and end dates have data
1956
+ if (!empty($options->scheduled_time_start) && !empty($options->scheduled_time_end)) {
1957
  $start = strtotime($options->scheduled_time_start);
1958
+ $end = strtotime($options->scheduled_time_end);
1959
+ if( strpos( $options->scheduled_time_end, ':' ) === false || strpos( $options->scheduled_time_end, '00:00' ) !== false )
1960
+ $end = strtotime($options->scheduled_time_end) + 86399;
1961
+
1962
+ $current_time = strtotime( current_time( 'm/d/Y H:i' ) );
1963
  // Checks if the current timestamp is outside of scheduled timeframe
1964
+ if ( $current_time < $start || $current_time > $end) {
1965
  $checked_pass = TRUE;
1966
  }
1967
  }
1968
+ if ( !empty( $options->scheduled_time_start ) && empty( $options->scheduled_time_end ) ){
1969
+ $start = new DateTime( $options->scheduled_time_start );
1970
+ $current_datetime = new DateTime( current_time( 'm/d/Y H:i' ) );
1971
+ if ( $current_datetime < $start ){
1972
  $checked_pass = TRUE;
1973
  }
1974
  }
1975
+ if ( empty( $options->scheduled_time_start ) && !empty( $options->scheduled_time_end ) ){
1976
+ $end = new DateTime( $options->scheduled_time_end );
1977
+ $current_datetime = new DateTime( current_time( 'm/d/Y H:i' ) );
1978
+ if ( $current_datetime > $end ) {
1979
  $checked_pass = TRUE;
1980
  }
1981
+ }
1982
  if( $checked_pass == TRUE ){
1983
  $qmn_allowed_visit = false;
1984
  $message = wpautop(htmlspecialchars_decode($options->scheduled_timeframe_text, ENT_QUOTES));
php/classes/class-qsm-emails.php CHANGED
@@ -156,7 +156,8 @@ class QSM_Emails {
156
  $subject = apply_filters( 'mlw_qmn_template_variable_results_page', $subject, $response_data );
157
 
158
  // Prepares our content.
159
- $content = htmlspecialchars_decode( $content, ENT_QUOTES );
 
160
  $content = apply_filters( 'mlw_qmn_template_variable_results_page', $content, $response_data );
161
  $content = str_replace( "\n", '<br>', $content );
162
  $content = str_replace( '<br/>', '<br>', $content );
156
  $subject = apply_filters( 'mlw_qmn_template_variable_results_page', $subject, $response_data );
157
 
158
  // Prepares our content.
159
+ $content = htmlspecialchars_decode( $content, ENT_QUOTES );
160
+ $response_data['email_template_array'] = true;
161
  $content = apply_filters( 'mlw_qmn_template_variable_results_page', $content, $response_data );
162
  $content = str_replace( "\n", '<br>', $content );
163
  $content = str_replace( '<br/>', '<br>', $content );
php/classes/class-qsm-fields.php CHANGED
@@ -231,14 +231,16 @@ class QSM_Fields {
231
  * @param array $field The array that contains the data for the input field
232
  * @param mixed $value The current value of the setting
233
  */
234
- public static function generate_date_field( $field, $value ) {
235
- wp_enqueue_script( 'jquery-ui-datepicker' );
236
  ?>
237
  <script>
238
- jQuery(function() {
239
- jQuery( "#<?php echo $field["id"]; ?>" ).datepicker();
240
- });
241
- </script>
 
 
 
242
  <tr valign="top">
243
  <th scope="row" class="qsm-opt-tr">
244
  <label for="<?php echo $field["id"]; ?>"><?php echo $field["label"]; ?></label>
@@ -252,7 +254,7 @@ class QSM_Fields {
252
  <?php if( isset($field['ph_text']) && $field['ph_text'] != ''){ ?>
253
  <span class="qsm-ph_text"><?php echo $field['ph_text']; ?></span>
254
  <?php } ?>
255
- <input type="text" id="<?php echo $field["id"]; ?>" name="<?php echo $field["id"]; ?>" value="<?php echo $value; ?>" />
256
  <?php if( isset($field['help']) && $field['help'] != ''){ ?>
257
  <span class="qsm-opt-desc"><?php echo $field['help']; ?></span>
258
  <?php } ?>
231
  * @param array $field The array that contains the data for the input field
232
  * @param mixed $value The current value of the setting
233
  */
234
+ public static function generate_date_field( $field, $value ) {
 
235
  ?>
236
  <script>
237
+ jQuery(function() {
238
+ jQuery( "#<?php echo $field["id"]; ?>" ).datetimepicker({
239
+ format:'m/d/Y H:i',
240
+ step: 1
241
+ });
242
+ });
243
+ </script>
244
  <tr valign="top">
245
  <th scope="row" class="qsm-opt-tr">
246
  <label for="<?php echo $field["id"]; ?>"><?php echo $field["label"]; ?></label>
254
  <?php if( isset($field['ph_text']) && $field['ph_text'] != ''){ ?>
255
  <span class="qsm-ph_text"><?php echo $field['ph_text']; ?></span>
256
  <?php } ?>
257
+ <input autocomplete="off" type="text" id="<?php echo $field["id"]; ?>" name="<?php echo $field["id"]; ?>" value="<?php echo $value; ?>" />
258
  <?php if( isset($field['help']) && $field['help'] != ''){ ?>
259
  <span class="qsm-opt-desc"><?php echo $field['help']; ?></span>
260
  <?php } ?>
php/classes/class-qsm-install.php CHANGED
@@ -562,6 +562,25 @@ class QSM_Install {
562
  );
563
  $mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_options' );
564
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
  //Setting for animation
566
  $field_array = array(
567
  'id' => 'quiz_animation',
@@ -846,11 +865,28 @@ class QSM_Install {
846
  // Registers question_answer_template setting
847
  $field_array = array(
848
  'id' => 'question_answer_template',
849
- 'label' => __("%QUESTIONS_ANSWERS% Text", 'quiz-master-next'),
850
  'type' => 'editor',
851
  'default' => 0,
852
  'variables' => array(
853
  '%QUESTION%',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
854
  '%USER_ANSWER%',
855
  '%CORRECT_ANSWER%',
856
  '%USER_COMMENTS%',
562
  );
563
  $mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_options' );
564
 
565
+ //Setting for pagination of quiz
566
+ $field_array = array(
567
+ 'id' => 'disable_description_on_result',
568
+ 'label' => __('Disable description on quiz result page?', 'quiz-master-next'),
569
+ 'type' => 'radio',
570
+ 'options' => array(
571
+ array(
572
+ 'label' => __('Yes', 'quiz-master-next'),
573
+ 'value' => 1
574
+ ),
575
+ array(
576
+ 'label' => __('No', 'quiz-master-next'),
577
+ 'value' => 0
578
+ ),
579
+ ),
580
+ 'default' => 0,
581
+ );
582
+ $mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_options' );
583
+
584
  //Setting for animation
585
  $field_array = array(
586
  'id' => 'quiz_animation',
865
  // Registers question_answer_template setting
866
  $field_array = array(
867
  'id' => 'question_answer_template',
868
+ 'label' => __("Results Page %QUESTIONS_ANSWERS% Text", 'quiz-master-next'),
869
  'type' => 'editor',
870
  'default' => 0,
871
  'variables' => array(
872
  '%QUESTION%',
873
+ '%USER_ANSWERS_DEFAULT%',
874
+ '%USER_ANSWER%',
875
+ '%CORRECT_ANSWER%',
876
+ '%USER_COMMENTS%',
877
+ '%CORRECT_ANSWER_INFO%'
878
+ )
879
+ );
880
+ $mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_text' );
881
+
882
+ // Registers question_answer_template setting
883
+ $field_array = array(
884
+ 'id' => 'question_answer_email_template',
885
+ 'label' => __("%QUESTIONS_ANSWERS_EMAIL% Text", 'quiz-master-next'),
886
+ 'type' => 'editor',
887
+ 'default' => '%QUESTION%<br />Answer Provided: %USER_ANSWER%<br/>Correct Answer: %CORRECT_ANSWER%<br/>Comments Entered: %USER_COMMENTS%',
888
+ 'variables' => array(
889
+ '%QUESTION%',
890
  '%USER_ANSWER%',
891
  '%CORRECT_ANSWER%',
892
  '%USER_COMMENTS%',
php/question-types.php CHANGED
@@ -145,14 +145,17 @@ function qmn_multiple_choice_display($id, $question, $answers)
145
  */
146
  function qmn_multiple_choice_review($id, $question, $answers)
147
  {
 
148
  $return_array = array(
149
  'points' => 0,
150
  'correct' => 'incorrect',
151
  'user_text' => '',
152
  'correct_text' => ''
153
  );
 
154
  if ( isset( $_POST["question".$id] ) ) {
155
- $mlw_user_answer = sanitize_textarea_field( $_POST["question".$id] );
 
156
  } else {
157
  $mlw_user_answer = " ";
158
  }
@@ -308,6 +311,8 @@ function qmn_horizontal_multiple_choice_display($id, $question, $answers)
308
  */
309
  function qmn_horizontal_multiple_choice_review($id, $question, $answers)
310
  {
 
 
311
  $return_array = array(
312
  'points' => 0,
313
  'correct' => 'incorrect',
@@ -315,7 +320,8 @@ function qmn_horizontal_multiple_choice_review($id, $question, $answers)
315
  'correct_text' => ''
316
  );
317
  if ( isset( $_POST["question".$id] ) ) {
318
- $mlw_user_answer = sanitize_textarea_field( htmlspecialchars( stripslashes( $_POST["question".$id] ), ENT_QUOTES ) );
 
319
  } else {
320
  $mlw_user_answer = " ";
321
  }
@@ -403,6 +409,8 @@ function qmn_drop_down_display($id, $question, $answers)
403
  */
404
  function qmn_drop_down_review($id, $question, $answers)
405
  {
 
 
406
  $return_array = array(
407
  'points' => 0,
408
  'correct' => 'incorrect',
@@ -410,7 +418,8 @@ function qmn_drop_down_review($id, $question, $answers)
410
  'correct_text' => ''
411
  );
412
  if (isset($_POST["question".$id])) {
413
- $mlw_user_answer = sanitize_textarea_field( htmlspecialchars( stripslashes( $_POST["question".$id] ), ENT_QUOTES ) );
 
414
  } else {
415
  $mlw_user_answer = " ";
416
  }
@@ -1104,9 +1113,9 @@ function qmn_fill_blank_review($id, $question, $answers)
1104
  'user_text' => '',
1105
  'correct_text' => ''
1106
  );
1107
- if (strpos($question, '%BLANK%') !== false)
1108
  {
1109
- $return_array['question_text'] = str_replace( "%BLANK%", "__________", do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES)));
1110
  }
1111
  if ( isset( $_POST["question".$id] ) ) {
1112
  $decode_user_answer = sanitize_textarea_field( strval( stripslashes( htmlspecialchars_decode( $_POST["question".$id], ENT_QUOTES ) ) ) );
@@ -1260,8 +1269,8 @@ function qmn_polar_review($id, $question, $answers) {
1260
  'user_text' => '',
1261
  'correct_text' => ''
1262
  );
1263
- if (strpos($question, '%POLAR_SLIDER%') !== false) {
1264
- $return_array['question_text'] = str_replace("%POLAR_SLIDER%", "__________", do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES)));
1265
  }
1266
  if (isset($_POST["question" . $id])) {
1267
  $decode_user_answer = sanitize_textarea_field( $_POST["question" . $id] );
145
  */
146
  function qmn_multiple_choice_review($id, $question, $answers)
147
  {
148
+ global $mlwQuizMasterNext;
149
  $return_array = array(
150
  'points' => 0,
151
  'correct' => 'incorrect',
152
  'user_text' => '',
153
  'correct_text' => ''
154
  );
155
+ $answerEditor = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'answerEditor');
156
  if ( isset( $_POST["question".$id] ) ) {
157
+ $mlw_user_answer = $_POST["question".$id];
158
+ $mlw_user_answer = trim( stripslashes( htmlspecialchars_decode($mlw_user_answer, ENT_QUOTES) ) );
159
  } else {
160
  $mlw_user_answer = " ";
161
  }
311
  */
312
  function qmn_horizontal_multiple_choice_review($id, $question, $answers)
313
  {
314
+ global $mlwQuizMasterNext;
315
+ $answerEditor = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'answerEditor');
316
  $return_array = array(
317
  'points' => 0,
318
  'correct' => 'incorrect',
320
  'correct_text' => ''
321
  );
322
  if ( isset( $_POST["question".$id] ) ) {
323
+ $mlw_user_answer = $_POST["question".$id];
324
+ $mlw_user_answer = trim( stripslashes( htmlspecialchars_decode($mlw_user_answer, ENT_QUOTES) ) );
325
  } else {
326
  $mlw_user_answer = " ";
327
  }
409
  */
410
  function qmn_drop_down_review($id, $question, $answers)
411
  {
412
+ global $mlwQuizMasterNext;
413
+ $answerEditor = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'answerEditor');
414
  $return_array = array(
415
  'points' => 0,
416
  'correct' => 'incorrect',
418
  'correct_text' => ''
419
  );
420
  if (isset($_POST["question".$id])) {
421
+ $mlw_user_answer = $_POST["question".$id];
422
+ $mlw_user_answer = trim( stripslashes( htmlspecialchars_decode($mlw_user_answer, ENT_QUOTES) ) );
423
  } else {
424
  $mlw_user_answer = " ";
425
  }
1113
  'user_text' => '',
1114
  'correct_text' => ''
1115
  );
1116
+ if (strpos($question, '%BLANK%') !== false || strpos($question, '%blank%') !== false)
1117
  {
1118
+ $return_array['question_text'] = str_replace( array( "%BLANK%", "%blank%" ), array( "__________", "__________" ), do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES)));
1119
  }
1120
  if ( isset( $_POST["question".$id] ) ) {
1121
  $decode_user_answer = sanitize_textarea_field( strval( stripslashes( htmlspecialchars_decode( $_POST["question".$id], ENT_QUOTES ) ) ) );
1269
  'user_text' => '',
1270
  'correct_text' => ''
1271
  );
1272
+ if (strpos($question, '%POLAR_SLIDER%') !== false || strpos($question, '%polar_slider%') !== false) {
1273
+ $return_array['question_text'] = str_replace( array( "%POLAR_SLIDER%", "%polar_slider%" ), array( "__________", "__________" ), do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES)));
1274
  }
1275
  if (isset($_POST["question" . $id])) {
1276
  $decode_user_answer = sanitize_textarea_field( $_POST["question" . $id] );
php/rest-api.php CHANGED
@@ -130,7 +130,7 @@ function qsm_rest_get_bank_questions( WP_REST_Request $request ){
130
  }
131
  $question['settings'] = $settings;
132
 
133
- $question_array['questions'][] = array(
134
  'id' => $question['question_id'],
135
  'quizID' => $question['quiz_id'],
136
  'type' => $question['question_type_new'],
@@ -152,6 +152,8 @@ function qsm_rest_get_bank_questions( WP_REST_Request $request ){
152
  'quiz_name' => isset($quiz_name['quiz_name']) ? $quiz_name['quiz_name'] : '',
153
  'question_title' => isset($question['settings']['question_title']) ? $question['settings']['question_title'] : '',
154
  );
 
 
155
  }
156
  return $question_array;
157
  }else{
@@ -416,7 +418,7 @@ function qsm_rest_get_questions( WP_REST_Request $request ) {
416
  foreach ( $questions as $question ) {
417
  $quiz_name = $wpdb->get_row('SELECT quiz_name FROM '. $quiz_table . ' WHERE quiz_id = ' . $question['quiz_id'], ARRAY_A );
418
  $question['page'] = isset( $question['page'] ) ? $question['page'] : 0;
419
- $question_array[] = array(
420
  'id' => $question['question_id'],
421
  'quizID' => $question['quiz_id'],
422
  'type' => $question['question_type_new'],
@@ -438,6 +440,8 @@ function qsm_rest_get_questions( WP_REST_Request $request ) {
438
  'question_title' => isset($question['settings']['question_title']) ? $question['settings']['question_title'] : '',
439
  'settings' => $question['settings']
440
  );
 
 
441
  }
442
  return $question_array;
443
  }
@@ -483,6 +487,9 @@ function qsm_rest_create_question( WP_REST_Request $request ) {
483
  $answers = $intial_answers;
484
  }
485
  $question_id = QSM_Questions::create_question( $data, $answers, $settings );
 
 
 
486
  return array(
487
  'status' => 'success',
488
  'id' => $question_id,
@@ -552,6 +559,9 @@ function qsm_rest_save_question( WP_REST_Request $request ) {
552
  $answers = $intial_answers;
553
  }
554
  $question_id = QSM_Questions::save_question( $id, $data, $answers, $settings );
 
 
 
555
  return array(
556
  'status' => 'success',
557
  );
130
  }
131
  $question['settings'] = $settings;
132
 
133
+ $question_data = array(
134
  'id' => $question['question_id'],
135
  'quizID' => $question['quiz_id'],
136
  'type' => $question['question_type_new'],
152
  'quiz_name' => isset($quiz_name['quiz_name']) ? $quiz_name['quiz_name'] : '',
153
  'question_title' => isset($question['settings']['question_title']) ? $question['settings']['question_title'] : '',
154
  );
155
+ $question_data = apply_filters('qsm_rest_api_filter_question_data', $question_data, $question, $request);
156
+ $question_array['questions'][] = $question_data;
157
  }
158
  return $question_array;
159
  }else{
418
  foreach ( $questions as $question ) {
419
  $quiz_name = $wpdb->get_row('SELECT quiz_name FROM '. $quiz_table . ' WHERE quiz_id = ' . $question['quiz_id'], ARRAY_A );
420
  $question['page'] = isset( $question['page'] ) ? $question['page'] : 0;
421
+ $question_data = array(
422
  'id' => $question['question_id'],
423
  'quizID' => $question['quiz_id'],
424
  'type' => $question['question_type_new'],
440
  'question_title' => isset($question['settings']['question_title']) ? $question['settings']['question_title'] : '',
441
  'settings' => $question['settings']
442
  );
443
+ $question_data = apply_filters('qsm_rest_api_filter_question_data', $question_data, $question, $request);
444
+ $question_array[] = $question_data;
445
  }
446
  return $question_array;
447
  }
487
  $answers = $intial_answers;
488
  }
489
  $question_id = QSM_Questions::create_question( $data, $answers, $settings );
490
+
491
+ do_action('qsm_saved_question_data', $question_id, $request);
492
+
493
  return array(
494
  'status' => 'success',
495
  'id' => $question_id,
559
  $answers = $intial_answers;
560
  }
561
  $question_id = QSM_Questions::save_question( $id, $data, $answers, $settings );
562
+
563
+ do_action('qsm_saved_question_data', $question_id, $request);
564
+
565
  return array(
566
  'status' => 'success',
567
  );
php/template-variables.php CHANGED
@@ -42,6 +42,7 @@ add_filter('mlw_qmn_template_variable_results_page', 'qmn_variable_category_aver
42
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_point_score',10,2);
43
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_average_point',10,2);
44
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_amount_correct',10,2);
 
45
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_total_questions',10,2);
46
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_correct_score',10,2);
47
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_quiz_name',10,2);
@@ -60,6 +61,7 @@ add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_twitter_share
60
  add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_result_id',10,2);
61
  add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_single_question_answer',10,2);
62
  add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_total_possible_points',10,2);
 
63
  add_filter('qmn_end_results', 'qsm_variable_poll_result',10,3);
64
 
65
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_quiz_name',10,2);
@@ -147,6 +149,21 @@ function qsm_variable_total_possible_points( $content, $mlw_quiz_array ){
147
  return $content;
148
  }
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  /**
151
  * Show poll result
152
  * @param str $content
@@ -293,6 +310,24 @@ function mlw_qmn_variable_amount_correct($content, $mlw_quiz_array)
293
  $content = str_replace( "%AMOUNT_CORRECT%" , $mlw_quiz_array["total_correct"], $content);
294
  return $content;
295
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  function mlw_qmn_variable_total_questions($content, $mlw_quiz_array)
297
  {
298
  $content = str_replace( "%TOTAL_QUESTIONS%" , $mlw_quiz_array["total_questions"], $content);
@@ -383,26 +418,37 @@ function mlw_qmn_variable_question_answers( $content, $mlw_quiz_array ) {
383
  }
384
 
385
  // Checks if the variable is present in the content.
386
- while ( strpos( $content, '%QUESTIONS_ANSWERS%' ) !== false ) {
387
  global $wpdb;
388
  $display = '';
389
- if( isset( $mlw_quiz_array['quiz_settings'] ) && !empty($mlw_quiz_array['quiz_settings']) ){
390
- $quiz_text_settings = isset( $mlw_quiz_array['quiz_settings']['quiz_text'] ) ? @unserialize( stripslashes( $mlw_quiz_array['quiz_settings']['quiz_text'] ) ) : array();
391
- $qmn_question_answer_template = isset( $quiz_text_settings['question_answer_template'] ) ? $quiz_text_settings['question_answer_template'] : $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'question_answer_template', '%QUESTION%<br/>Answer Provided: %USER_ANSWER%<br/>Correct Answer: %CORRECT_ANSWER%<br/>Comments Entered: %USER_COMMENTS%' );
 
 
 
 
392
  }else{
393
- $qmn_question_answer_template = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'question_answer_template', '%QUESTION%<br/>Answer Provided: %USER_ANSWER%<br/>Correct Answer: %CORRECT_ANSWER%<br/>Comments Entered: %USER_COMMENTS%' );
394
- }
 
 
 
 
 
395
  $questions = QSM_Questions::load_questions_by_pages( $mlw_quiz_array['quiz_id'] );
396
  $qmn_questions = array();
397
  foreach ( $questions as $question ) {
398
  $qmn_questions[ $question['question_id'] ] = $question['question_answer_info'];
399
  }
400
-
401
  // Cycles through each answer in the responses.
 
 
402
  foreach ( $mlw_quiz_array['question_answers_array'] as $answer ) {
403
- if(in_array($answer['id'],$hidden_questions)) {
404
- continue;
405
- }
406
  if( is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'qsm_quiz_result_details' ){
407
  $user_answer_class = "";
408
  $question_answer_class = "";
@@ -428,12 +474,65 @@ function mlw_qmn_variable_question_answers( $content, $mlw_quiz_array ) {
428
  }
429
 
430
  $mlw_question_answer_display = htmlspecialchars_decode($qmn_question_answer_template, ENT_QUOTES);
 
431
  if( isset( $answer['question_title'] ) && $answer['question_title'] != '' ){
432
- $mlw_question_answer_display = str_replace( "%QUESTION%" , '<b>' . htmlspecialchars_decode($answer['question_title'], ENT_QUOTES) . '</b><br />' . htmlspecialchars_decode($answer[0], ENT_QUOTES), $mlw_question_answer_display);
 
 
 
 
 
 
 
 
433
  }else{
434
  $mlw_question_answer_display = str_replace( "%QUESTION%" , '<b>' . htmlspecialchars_decode($answer[0], ENT_QUOTES) . '</b>', $mlw_question_answer_display);
435
  }
436
  $mlw_question_answer_display = qsm_question_title_func($mlw_question_answer_display);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  if( isset($answer['question_type']) && $answer['question_type'] == 11 ){
438
  $file_extension = substr($answer[1], -4);
439
  if($file_extension == '.jpg' || $file_extension == 'jepg' || $file_extension == '.png' || $file_extension == '.gif'){
@@ -451,10 +550,16 @@ function mlw_qmn_variable_question_answers( $content, $mlw_quiz_array ) {
451
  $answer_4 = !empty( $qmn_questions[$answer['id']] ) ? $qmn_questions[$answer['id']] : 'NA';
452
  $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($answer_4, ENT_QUOTES), $mlw_question_answer_display);
453
  $mlw_question_answer_display = wp_kses_post( $mlw_question_answer_display );
454
- $display .= "<div class='qmn_question_answer $question_answer_class'>".apply_filters('qmn_variable_question_answers', $mlw_question_answer_display, $mlw_quiz_array).'</div>';
 
 
 
 
455
  }
456
  $content = str_replace( "%QUESTIONS_ANSWERS%" , $display, $content);
 
457
  }
 
458
  return $content;
459
  }
460
 
@@ -799,4 +904,4 @@ function qsm_custom_wpkses_post_tags( $tags, $context ) {
799
  return $tags;
800
  }
801
 
802
- add_filter( 'wp_kses_allowed_html', 'qsm_custom_wpkses_post_tags', 10, 2 );
42
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_point_score',10,2);
43
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_average_point',10,2);
44
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_amount_correct',10,2);
45
+ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_amount_incorrect',10,2);
46
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_total_questions',10,2);
47
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_correct_score',10,2);
48
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_quiz_name',10,2);
61
  add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_result_id',10,2);
62
  add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_single_question_answer',10,2);
63
  add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_total_possible_points',10,2);
64
+ add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_total_attempted_questions',10,2);
65
  add_filter('qmn_end_results', 'qsm_variable_poll_result',10,3);
66
 
67
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_quiz_name',10,2);
149
  return $content;
150
  }
151
 
152
+ /**
153
+ * Replace total_possible_points variable with actual points
154
+ *
155
+ * @since 7.0.2
156
+ *
157
+ * @param string $content
158
+ * @param array $mlw_quiz_array
159
+ * @return string $content
160
+ */
161
+ function qsm_variable_total_attempted_questions( $content, $mlw_quiz_array ){
162
+ $total_attempted_questions = isset( $mlw_quiz_array["total_attempted_questions"] ) ? $mlw_quiz_array["total_attempted_questions"] : 0;
163
+ $content = str_replace( "%AMOUNT_ATTEMPTED%" , $total_attempted_questions, $content);
164
+ return $content;
165
+ }
166
+
167
  /**
168
  * Show poll result
169
  * @param str $content
310
  $content = str_replace( "%AMOUNT_CORRECT%" , $mlw_quiz_array["total_correct"], $content);
311
  return $content;
312
  }
313
+
314
+ /**
315
+ * Return total incorrect amount
316
+ *
317
+ * @since 7.0.3
318
+ * @param string $content
319
+ * @param array $mlw_quiz_array
320
+ * @return string
321
+ */
322
+ function mlw_qmn_variable_amount_incorrect($content, $mlw_quiz_array){
323
+ if( false !== strpos($content, '%AMOUNT_INCORRECT%') ){
324
+ $total_question = $mlw_quiz_array["total_questions"];
325
+ $total_correct = $mlw_quiz_array["total_correct"];
326
+ $total_incorrect = $total_question - $total_correct;
327
+ $content = str_replace( "%AMOUNT_INCORRECT%" , max($total_incorrect, 0), $content);
328
+ }
329
+ return $content;
330
+ }
331
  function mlw_qmn_variable_total_questions($content, $mlw_quiz_array)
332
  {
333
  $content = str_replace( "%TOTAL_QUESTIONS%" , $mlw_quiz_array["total_questions"], $content);
418
  }
419
 
420
  // Checks if the variable is present in the content.
421
+ while ( strpos( $content, '%QUESTIONS_ANSWERS%' ) !== false || strpos( $content, '%QUESTIONS_ANSWERS_EMAIL%' ) !== false ) {
422
  global $wpdb;
423
  $display = '';
424
+ if( strpos( $content, '%QUESTIONS_ANSWERS_EMAIL%' ) !== false ){
425
+ if( isset( $mlw_quiz_array['quiz_settings'] ) && !empty($mlw_quiz_array['quiz_settings']) ){
426
+ $quiz_text_settings = isset( $mlw_quiz_array['quiz_settings']['quiz_text'] ) ? @unserialize( stripslashes( $mlw_quiz_array['quiz_settings']['quiz_text'] ) ) : array();
427
+ $qmn_question_answer_template = isset( $quiz_text_settings['question_answer_email_template'] ) ? apply_filters('qsm_section_setting_text', $quiz_text_settings['question_answer_email_template']) : $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'question_answer_email_template', '%QUESTION%<br/>Answer Provided: %USER_ANSWER%<br/>Correct Answer: %CORRECT_ANSWER%<br/>Comments Entered: %USER_COMMENTS%' );
428
+ }else{
429
+ $qmn_question_answer_template = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'question_answer_email_template', '%QUESTION%<br/>Answer Provided: %USER_ANSWER%<br/>Correct Answer: %CORRECT_ANSWER%<br/>Comments Entered: %USER_COMMENTS%' );
430
+ }
431
  }else{
432
+ if( isset( $mlw_quiz_array['quiz_settings'] ) && !empty($mlw_quiz_array['quiz_settings']) ){
433
+ $quiz_text_settings = isset( $mlw_quiz_array['quiz_settings']['quiz_text'] ) ? @unserialize( stripslashes( $mlw_quiz_array['quiz_settings']['quiz_text'] ) ) : array();
434
+ $qmn_question_answer_template = isset( $quiz_text_settings['question_answer_template'] ) ? apply_filters('qsm_section_setting_text', $quiz_text_settings['question_answer_template']) : $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'question_answer_template', '%QUESTION%<br/>%USER_ANSWERS_DEFAULT%' );
435
+ }else{
436
+ $qmn_question_answer_template = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'question_answer_template', '%QUESTION%<br/>%USER_ANSWERS_DEFAULT%' );
437
+ }
438
+ }
439
  $questions = QSM_Questions::load_questions_by_pages( $mlw_quiz_array['quiz_id'] );
440
  $qmn_questions = array();
441
  foreach ( $questions as $question ) {
442
  $qmn_questions[ $question['question_id'] ] = $question['question_answer_info'];
443
  }
444
+
445
  // Cycles through each answer in the responses.
446
+ $total_question_cnt = count( $mlw_quiz_array['question_answers_array'] );
447
+ $qsm_question_cnt = 1;
448
  foreach ( $mlw_quiz_array['question_answers_array'] as $answer ) {
449
+ if(in_array($answer['id'],$hidden_questions)) {
450
+ continue;
451
+ }
452
  if( is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'qsm_quiz_result_details' ){
453
  $user_answer_class = "";
454
  $question_answer_class = "";
474
  }
475
 
476
  $mlw_question_answer_display = htmlspecialchars_decode($qmn_question_answer_template, ENT_QUOTES);
477
+ $disable_description_on_result = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_options', 'disable_description_on_result' );
478
  if( isset( $answer['question_title'] ) && $answer['question_title'] != '' ){
479
+ $add_br = '';
480
+ if( $answer[0] != '' ){
481
+ $add_br = '<br/>';
482
+ }
483
+ if( $disable_description_on_result == 1 ){
484
+ $mlw_question_answer_display = str_replace( "%QUESTION%" , '<b>' . htmlspecialchars_decode($answer['question_title'], ENT_QUOTES) . '</b>', $mlw_question_answer_display);
485
+ }else{
486
+ $mlw_question_answer_display = str_replace( "%QUESTION%" , '<b>' . htmlspecialchars_decode($answer['question_title'], ENT_QUOTES) . '</b>'. $add_br . htmlspecialchars_decode($answer[0], ENT_QUOTES), $mlw_question_answer_display);
487
+ }
488
  }else{
489
  $mlw_question_answer_display = str_replace( "%QUESTION%" , '<b>' . htmlspecialchars_decode($answer[0], ENT_QUOTES) . '</b>', $mlw_question_answer_display);
490
  }
491
  $mlw_question_answer_display = qsm_question_title_func($mlw_question_answer_display);
492
+ $extra_border_bottom_class = '';
493
+ if( strpos( $mlw_question_answer_display, '%USER_ANSWERS_DEFAULT%') !== false ){
494
+ $extra_border_bottom_class = 'qsm-add-border-bottom';
495
+ $show_two_option_questions = array(
496
+ 3,12,5,7,14
497
+ );
498
+ if( isset( $answer['id'] ) && isset( $questions[ $answer['id'] ] ) && !empty( $questions[ $answer['id'] ] ) ){
499
+ $total_answers = isset( $questions[ $answer['id'] ][ 'answers' ] ) ? $questions[ $answer['id'] ][ 'answers' ] : array();
500
+ $question_with_answer_text = '';
501
+ if( $total_answers ){
502
+ if( isset($answer['question_type']) && in_array( $answer['question_type'], $show_two_option_questions) ){
503
+ $do_show_wrong = true;
504
+ foreach( $total_answers as $single_answer ){
505
+ if( isset( $single_answer[2] ) && $single_answer[2] == 1 && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] ){
506
+ $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
507
+ $do_show_wrong = false;
508
+ }
509
+ }
510
+ if( $do_show_wrong ){
511
+ $question_with_answer_text .= '<span class="qsm-text-wrong-option">'. htmlspecialchars_decode($answer[1], ENT_QUOTES) .'</span>';
512
+ foreach( $total_answers as $single_answer ){
513
+ if( isset( $single_answer[2] ) && $single_answer[2] == 1 ){
514
+ $question_with_answer_text .= '<span class="qsm-text-correct-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
515
+ break;
516
+ }
517
+ }
518
+ }
519
+ } else {
520
+ foreach ( $total_answers as $single_answer ) {
521
+ if( isset( $single_answer[2] ) && $single_answer[2] == 1 && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] ){
522
+ $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
523
+ }else if( isset( $single_answer[2] ) && $single_answer[2] == 1 ){
524
+ $question_with_answer_text .= '<span class="qsm-text-correct-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
525
+ }else if( htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer[0] && $single_answer[2] !== 1 ){
526
+ $question_with_answer_text .= '<span class="qsm-text-wrong-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
527
+ }else{
528
+ $question_with_answer_text .= '<span class="qsm-text-simple-option">'. htmlspecialchars_decode($single_answer[0], ENT_QUOTES) .'</span>';
529
+ }
530
+ }
531
+ }
532
+ }
533
+ }
534
+ $mlw_question_answer_display = str_replace( "%USER_ANSWERS_DEFAULT%" , $question_with_answer_text, $mlw_question_answer_display);
535
+ }
536
  if( isset($answer['question_type']) && $answer['question_type'] == 11 ){
537
  $file_extension = substr($answer[1], -4);
538
  if($file_extension == '.jpg' || $file_extension == 'jepg' || $file_extension == '.png' || $file_extension == '.gif'){
550
  $answer_4 = !empty( $qmn_questions[$answer['id']] ) ? $qmn_questions[$answer['id']] : 'NA';
551
  $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($answer_4, ENT_QUOTES), $mlw_question_answer_display);
552
  $mlw_question_answer_display = wp_kses_post( $mlw_question_answer_display );
553
+ if( $total_question_cnt == $qsm_question_cnt){
554
+ $extra_border_bottom_class = '';
555
+ }
556
+ $display .= "<div class='qmn_question_answer $extra_border_bottom_class $question_answer_class'>".apply_filters('qmn_variable_question_answers', $mlw_question_answer_display, $mlw_quiz_array).'</div>';
557
+ $qsm_question_cnt++;
558
  }
559
  $content = str_replace( "%QUESTIONS_ANSWERS%" , $display, $content);
560
+ $content = str_replace( "%QUESTIONS_ANSWERS_EMAIL%" , $display, $content);
561
  }
562
+
563
  return $content;
564
  }
565
 
904
  return $tags;
905
  }
906
 
907
+ add_filter( 'wp_kses_allowed_html', 'qsm_custom_wpkses_post_tags', 10, 2 );
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === WordPress Quiz Plugin - Quiz And Survey Master ===
2
  Contributors: quizsurvey,expresstech
3
- Tags: quiz, survey, wordpress quiz plugin, exam, quiz builder
4
  Requires at least: 4.9
5
  Tested up to: 5.5
6
  Requires PHP: 5.4
7
- Stable tag: 7.0.2
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -27,7 +27,7 @@ Quiz and Survey Master is the easiest [WordPress Quiz Plugin](https://quizandsur
27
  [youtube https://www.youtube.com/watch?v=DyiCCNnDpHk]
28
 
29
  = Customize Text =
30
- You can customized anything your users will see and engage with. Everything from the text blocks throughout the quiz or survey to the submit button. You can even "template variables" to generate personalized text for your users.
31
 
32
  = Question Types =
33
  You can have **multiple choice** (radio buttons), **true and false**, **open answer** question, **drop down**, **multiple response** (checkboxes), **fill in the blank**, **number**, **captcha**, **polar** (slider) and **accept**. We release more questions types with every major release.
@@ -68,7 +68,7 @@ You can integrate Mailchimp, Activecampaign, Zapier, Campaign Monitor, Get Respo
68
  * Create and display math formulas
69
  * And **Much** More...
70
 
71
- = Pro Addons =
72
  Quiz And Survey Master is fully functional and is packed with tons of features that will meet the needs of most, we do offer various extra features including:
73
 
74
  **Free Add-ons**
@@ -135,6 +135,24 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
135
 
136
  == Changelog ==
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  = 7.0.2 (August 18, 2020) =
139
  * Enhancement: Checked compatibility with WordPress 5.5.
140
  * Enhancement: Added option to customize the inline correct/incorrect messages.
1
+ === Quiz And Survey Master - Best Quiz, Exam and Survey Plugin for WordPress ===
2
  Contributors: quizsurvey,expresstech
3
+ Tags: quiz, survey, lead, test, score, exam, questionnaire, question,wordpress quiz plugin
4
  Requires at least: 4.9
5
  Tested up to: 5.5
6
  Requires PHP: 5.4
7
+ Stable tag: 7.1.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
27
  [youtube https://www.youtube.com/watch?v=DyiCCNnDpHk]
28
 
29
  = Customize Text =
30
+ You can customize anything your users will see and engage with. Everything from the text blocks throughout the quiz or survey to the submit button. You can even use "template variables" to generate personalized text for your users.
31
 
32
  = Question Types =
33
  You can have **multiple choice** (radio buttons), **true and false**, **open answer** question, **drop down**, **multiple response** (checkboxes), **fill in the blank**, **number**, **captcha**, **polar** (slider) and **accept**. We release more questions types with every major release.
68
  * Create and display math formulas
69
  * And **Much** More...
70
 
71
+ = [WordPress Quiz Plugin](https://quizandsurveymaster.com/) Addons =
72
  Quiz And Survey Master is fully functional and is packed with tons of features that will meet the needs of most, we do offer various extra features including:
73
 
74
  **Free Add-ons**
135
 
136
  == Changelog ==
137
 
138
+ = 7.1.0 (August 31, 2020) =
139
+ * Enhancement: Added a new variable %USER_ANSWERS_DEFAULT% to improve default result page. All new quizzes will have this variable by default.
140
+ * Enhancement: Created new %AMOUNT_INCORRECT% and %AMOUNT_ATTEMPTED% template variable to enhance the quiz result page.
141
+ * Enhancement: Added time( hours and minute ) support in quiz start and end date.
142
+ * Enhancement: Added option in setting menu to delete data related to QSM on deletion of plugin.
143
+ * Enhancement: Added option in setting menu to enable/disable the Background Quiz Email Process.
144
+ * Enhancement: Added qsm prefixes to email classes.
145
+ * Enhancement: Added feature to view uploaded file in admin result page for File Upload question type.
146
+ * Enhancement: Added option to show only title in quiz result page.
147
+ * Enhancement: Added a button to view uploaded file in quiz result page and replaced the empty spaces in the uploaded file slug with dashes.
148
+ * Enhancement: Added a check box to select/deselect question in Question Bank Popup.
149
+ * Bug: Fixed issues where questions were not showing up in admin when there is no pages in quiz.
150
+ * Bug: Fixed jquery error when editor is changed to text in Quiz text tab.
151
+ * Bug: Fixed PHP 7.4 Sentry Issues while creating new quiz.
152
+ * Bug: Fixed issues with Allowed file types while question editing.
153
+ * Bug: Fixed submit button position for auto pagination.
154
+ * Bug: Fixed issues with quiz loading when pagination is enabled.
155
+
156
  = 7.0.2 (August 18, 2020) =
157
  * Enhancement: Checked compatibility with WordPress 5.5.
158
  * Enhancement: Added option to customize the inline correct/incorrect messages.
uninstall.php CHANGED
@@ -9,6 +9,12 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
9
  exit();
10
  }
11
 
 
 
 
 
 
 
12
  global $wpdb;
13
 
14
  $qsm_tables = array(
9
  exit();
10
  }
11
 
12
+ //Do not allow to delete the data untill delete_qsm_data option is not set.
13
+ $settings = (array) get_option( 'qmn-settings' );
14
+ if( !isset( $settings['delete_qsm_data'] ) ){
15
+ return;
16
+ }
17
+
18
  global $wpdb;
19
 
20
  $qsm_tables = array(