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

Version Description

(Feb 6, 2020)= * Bug: Solved user limit issue with ip address * Bug: Solved Search input issue on Quizzes/Surveys * Added: added question type help link and changed the old documentation in whole plugin * Feature: Added polar question type

Download this release

Release Info

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

Code changes from version 6.4.2 to 6.4.3

css/common.css CHANGED
@@ -15,4 +15,70 @@
15
  }
16
  .mlw_qmn_question{
17
  display: block;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
15
  }
16
  .mlw_qmn_question{
17
  display: block;
18
+ }
19
+ .polar-question-title{
20
+ margin-bottom: 50px;
21
+ font-size: 20px;
22
+ line-height: 20px;
23
+ }
24
+ .question-type-polar-s{
25
+ display: inline-block !important;
26
+ position: relative;
27
+ width: 100%;
28
+ }
29
+ .question-type-polar-s br{
30
+ display: none;
31
+ }
32
+ .question-type-polar-s .left-polar-title{
33
+ width: 25%;
34
+ position: absolute;
35
+ left: 0;
36
+ top: 50%;
37
+ transform: translateY(-50%);
38
+ line-height: normal;
39
+ }
40
+ .question-type-polar-s .slider-main-wrapper{
41
+ width: 45%;
42
+ position: absolute;
43
+ left: 50%;
44
+ top: 50%;
45
+ transform: translate(-50%,-50%);
46
+ }
47
+ .question-type-polar-s .right-polar-title{
48
+ width: 25%;
49
+ position: absolute;
50
+ right: 0;
51
+ top: 50%;
52
+ transform: translateY(-50%);
53
+ line-height: normal;
54
+ }
55
+ .question-type-polar-s .ui-widget-content{
56
+ background: #A5A5A5;
57
+ border-color: #A5A5A5;
58
+ border-radius: 0;
59
+ height: 20px;
60
+ }
61
+ .question-type-polar-s .ui-widget-content .ui-slider-handle{
62
+ background: rgb(119, 113, 113);
63
+ height: 32px;
64
+ border-color: rgb(119, 113, 113);
65
+ top: -7px;
66
+ border-radius: 0px;
67
+ }
68
+ @media screen and (max-width: 767px){
69
+ .question-type-polar-s .left-polar-title,
70
+ .question-type-polar-s .slider-main-wrapper,
71
+ .question-type-polar-s .right-polar-title{
72
+ width: 100%;
73
+ position: relative;
74
+ top: auto;
75
+ left: auto;
76
+ right: auto;
77
+ bottom: auto;
78
+ transform: none;
79
+ margin-bottom: 30px;
80
+ }
81
+ .question-type-polar-s{
82
+ height: auto !important;
83
+ }
84
  }
css/jquery.ui.slider-rtl.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /* Overrides for right-to-left sliders. */
2
+
3
+ .ui-slider-horizontal.ui-slider-rtl .ui-slider-range-min { left: auto; right: 0; }
4
+ .ui-slider-horizontal.ui-slider-rtl .ui-slider-range-max { left: 0; right: auto; }
5
+
6
+ .ui-slider-vertical.ui-slider-rtl .ui-slider-range-min { top: 0; bottom: auto; }
7
+ .ui-slider-vertical.ui-slider-rtl .ui-slider-range-max { top: auto; bottom: 0; }
css/qsm-admin-question.css CHANGED
@@ -357,4 +357,8 @@ a.import-button.button.disable_import::before {
357
  min-width: auto;
358
  max-width: 100%;
359
  }
 
 
 
 
360
  }
357
  min-width: auto;
358
  max-width: 100%;
359
  }
360
+ }
361
+
362
+ .question_info_tag{
363
+ float: right;
364
  }
js/jquery.ui.slider-rtl.js ADDED
@@ -0,0 +1,711 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Slider 1.8.9.rtl.1
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Slider
9
+ *
10
+ * Depends:
11
+ * jquery.ui.core.js
12
+ * jquery.ui.mouse.js
13
+ * jquery.ui.widget.js
14
+ */
15
+ (function( $, undefined ) {
16
+
17
+ // number of pages in a slider
18
+ // (how many times can you page up/down to go through the whole range)
19
+ var numPages = 5;
20
+
21
+ $.widget( "ui.slider", $.ui.mouse, {
22
+
23
+ widgetEventPrefix: "slide",
24
+
25
+ options: {
26
+ animate: false,
27
+ distance: 0,
28
+ max: 100,
29
+ min: 0,
30
+ orientation: "horizontal",
31
+ isRTL: false, // RTL
32
+ range: false,
33
+ step: 1,
34
+ value: 0,
35
+ values: null
36
+ },
37
+
38
+ _create: function() {
39
+ var self = this,
40
+ o = this.options;
41
+
42
+ this._keySliding = false;
43
+ this._mouseSliding = false;
44
+ this._animateOff = true;
45
+ this._handleIndex = null;
46
+ this._detectOrientation();
47
+ this._mouseInit();
48
+
49
+ this.element
50
+ .addClass( "ui-slider" +
51
+ " ui-slider-" + this.orientation +
52
+ ( o.isRTL ? " ui-slider-rtl" : "" ) + // RTL
53
+ " ui-widget" +
54
+ " ui-widget-content" +
55
+ " ui-corner-all" );
56
+
57
+ if ( o.disabled ) {
58
+ this.element.addClass( "ui-slider-disabled ui-disabled" );
59
+ }
60
+
61
+ this.range = $([]);
62
+
63
+ if ( o.range ) {
64
+ if ( o.range === true ) {
65
+ this.range = $( "<div></div>" );
66
+ if ( !o.values ) {
67
+ o.values = [ this._valueMin(), this._valueMin() ];
68
+ }
69
+ if ( o.values.length && o.values.length !== 2 ) {
70
+ o.values = [ o.values[0], o.values[0] ];
71
+ }
72
+ } else {
73
+ this.range = $( "<div></div>" );
74
+ }
75
+
76
+ this.range
77
+ .appendTo( this.element )
78
+ .addClass( "ui-slider-range" );
79
+
80
+ if ( o.range === "min" || o.range === "max" ) {
81
+ this.range.addClass( "ui-slider-range-" + o.range );
82
+ }
83
+
84
+ // note: this isn't the most fittingly semantic framework class for this element,
85
+ // but worked best visually with a variety of themes
86
+ this.range.addClass( "ui-widget-header" );
87
+ }
88
+
89
+ if ( $( ".ui-slider-handle", this.element ).length === 0 ) {
90
+ $( "<a href='#'></a>" )
91
+ .appendTo( this.element )
92
+ .addClass( "ui-slider-handle" );
93
+ }
94
+
95
+ if ( o.values && o.values.length ) {
96
+ while ( $(".ui-slider-handle", this.element).length < o.values.length ) {
97
+ $( "<a href='#'></a>" )
98
+ .appendTo( this.element )
99
+ .addClass( "ui-slider-handle" );
100
+ }
101
+ }
102
+
103
+ this.handles = $( ".ui-slider-handle", this.element )
104
+ .addClass( "ui-state-default" +
105
+ " ui-corner-all" );
106
+
107
+ this.handle = this.handles.eq( 0 );
108
+
109
+ this.handles.add( this.range ).filter( "a" )
110
+ .click(function( event ) {
111
+ event.preventDefault();
112
+ })
113
+ .hover(function() {
114
+ if ( !o.disabled ) {
115
+ $( this ).addClass( "ui-state-hover" );
116
+ }
117
+ }, function() {
118
+ $( this ).removeClass( "ui-state-hover" );
119
+ })
120
+ .focus(function() {
121
+ if ( !o.disabled ) {
122
+ $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" );
123
+ $( this ).addClass( "ui-state-focus" );
124
+ } else {
125
+ $( this ).blur();
126
+ }
127
+ })
128
+ .blur(function() {
129
+ $( this ).removeClass( "ui-state-focus" );
130
+ });
131
+
132
+ this.handles.each(function( i ) {
133
+ $( this ).data( "index.ui-slider-handle", i );
134
+ });
135
+
136
+ this.handles
137
+ .keydown(function( event ) {
138
+ var ret = true,
139
+ index = $( this ).data( "index.ui-slider-handle" ),
140
+ allowed,
141
+ curVal,
142
+ newVal,
143
+ step;
144
+
145
+ if ( self.options.disabled ) {
146
+ return;
147
+ }
148
+
149
+ switch ( event.keyCode ) {
150
+ case $.ui.keyCode.HOME:
151
+ case $.ui.keyCode.END:
152
+ case $.ui.keyCode.PAGE_UP:
153
+ case $.ui.keyCode.PAGE_DOWN:
154
+ case $.ui.keyCode.UP:
155
+ case $.ui.keyCode.RIGHT:
156
+ case $.ui.keyCode.DOWN:
157
+ case $.ui.keyCode.LEFT:
158
+ ret = false;
159
+ if ( !self._keySliding ) {
160
+ self._keySliding = true;
161
+ $( this ).addClass( "ui-state-active" );
162
+ allowed = self._start( event, index );
163
+ if ( allowed === false ) {
164
+ return;
165
+ }
166
+ }
167
+ break;
168
+ }
169
+
170
+ step = self.options.step;
171
+ if ( self.options.values && self.options.values.length ) {
172
+ curVal = newVal = self.values( index );
173
+ } else {
174
+ curVal = newVal = self.value();
175
+ }
176
+
177
+ var adjust = function( minMax, offset ) { // RTL
178
+ if ( curVal === minMax ) {
179
+ return;
180
+ }
181
+ newVal = self._trimAlignValue( curVal + offset );
182
+ };
183
+ switch ( event.keyCode ) {
184
+ case $.ui.keyCode.HOME:
185
+ newVal = self._valueMin();
186
+ break;
187
+ case $.ui.keyCode.END:
188
+ newVal = self._valueMax();
189
+ break;
190
+ case $.ui.keyCode.PAGE_UP:
191
+ newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) );
192
+ break;
193
+ case $.ui.keyCode.PAGE_DOWN:
194
+ newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) );
195
+ break;
196
+ case $.ui.keyCode.UP:
197
+ adjust( self._valueMax(), step ); // RTL
198
+ break;
199
+ case $.ui.keyCode.RIGHT:
200
+ adjust( self._valueMax(), self.options.isRTL ? -step : step ); // RTL
201
+ break;
202
+ case $.ui.keyCode.DOWN:
203
+ adjust( self._valueMin(), -step ); // RTL
204
+ break;
205
+ case $.ui.keyCode.LEFT:
206
+ adjust( self._valueMin(), self.options.isRTL ? step : -step ); // RTL
207
+ break;
208
+ }
209
+
210
+ self._slide( event, index, newVal );
211
+
212
+ return ret;
213
+
214
+ })
215
+ .keyup(function( event ) {
216
+ var index = $( this ).data( "index.ui-slider-handle" );
217
+
218
+ if ( self._keySliding ) {
219
+ self._keySliding = false;
220
+ self._stop( event, index );
221
+ self._change( event, index );
222
+ $( this ).removeClass( "ui-state-active" );
223
+ }
224
+
225
+ });
226
+
227
+ this._refreshValue();
228
+
229
+ this._animateOff = false;
230
+ },
231
+
232
+ destroy: function() {
233
+ this.handles.remove();
234
+ this.range.remove();
235
+
236
+ this.element
237
+ .removeClass( "ui-slider" +
238
+ " ui-slider-horizontal" +
239
+ " ui-slider-vertical" +
240
+ " ui-slider-disabled" +
241
+ " ui-widget" +
242
+ " ui-widget-content" +
243
+ " ui-corner-all" )
244
+ .removeData( "slider" )
245
+ .unbind( ".slider" );
246
+
247
+ this._mouseDestroy();
248
+
249
+ return this;
250
+ },
251
+
252
+ _mouseCapture: function( event ) {
253
+ var o = this.options,
254
+ position,
255
+ normValue,
256
+ distance,
257
+ closestHandle,
258
+ self,
259
+ index,
260
+ allowed,
261
+ offset,
262
+ mouseOverHandle;
263
+
264
+ if ( o.disabled ) {
265
+ return false;
266
+ }
267
+
268
+ this.elementSize = {
269
+ width: this.element.outerWidth(),
270
+ height: this.element.outerHeight()
271
+ };
272
+ this.elementOffset = this.element.offset();
273
+
274
+ position = { x: event.pageX, y: event.pageY };
275
+ normValue = this._normValueFromMouse( position );
276
+ distance = this._valueMax() - this._valueMin() + 1;
277
+ self = this;
278
+ this.handles.each(function( i ) {
279
+ var thisDistance = Math.abs( normValue - self.values(i) );
280
+ if ( distance > thisDistance ) {
281
+ distance = thisDistance;
282
+ closestHandle = $( this );
283
+ index = i;
284
+ }
285
+ });
286
+
287
+ // workaround for bug #3736 (if both handles of a range are at 0,
288
+ // the first is always used as the one with least distance,
289
+ // and moving it is obviously prevented by preventing negative ranges)
290
+ if( o.range === true && this.values(1) === o.min ) {
291
+ index += 1;
292
+ closestHandle = $( this.handles[index] );
293
+ }
294
+
295
+ allowed = this._start( event, index );
296
+ if ( allowed === false ) {
297
+ return false;
298
+ }
299
+ this._mouseSliding = true;
300
+
301
+ self._handleIndex = index;
302
+
303
+ closestHandle
304
+ .addClass( "ui-state-active" )
305
+ .focus();
306
+
307
+ offset = closestHandle.offset();
308
+ mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );
309
+ this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
310
+ left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
311
+ top: event.pageY - offset.top -
312
+ ( closestHandle.height() / 2 ) -
313
+ ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
314
+ ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
315
+ ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
316
+ };
317
+
318
+ if ( !this.handles.hasClass( "ui-state-hover" ) ) {
319
+ this._slide( event, index, normValue );
320
+ }
321
+ this._animateOff = true;
322
+ return true;
323
+ },
324
+
325
+ _mouseStart: function( event ) {
326
+ return true;
327
+ },
328
+
329
+ _mouseDrag: function( event ) {
330
+ var position = { x: event.pageX, y: event.pageY },
331
+ normValue = this._normValueFromMouse( position );
332
+
333
+ this._slide( event, this._handleIndex, normValue );
334
+
335
+ return false;
336
+ },
337
+
338
+ _mouseStop: function( event ) {
339
+ this.handles.removeClass( "ui-state-active" );
340
+ this._mouseSliding = false;
341
+
342
+ this._stop( event, this._handleIndex );
343
+ this._change( event, this._handleIndex );
344
+
345
+ this._handleIndex = null;
346
+ this._clickOffset = null;
347
+ this._animateOff = false;
348
+
349
+ return false;
350
+ },
351
+
352
+ _detectOrientation: function() {
353
+ this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
354
+ },
355
+
356
+ _normValueFromMouse: function( position ) {
357
+ var pixelTotal,
358
+ pixelMouse,
359
+ percentMouse,
360
+ valueTotal,
361
+ valueMouse;
362
+
363
+ if ( this.orientation === "horizontal" ) {
364
+ pixelTotal = this.elementSize.width;
365
+ pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
366
+ } else {
367
+ pixelTotal = this.elementSize.height;
368
+ pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
369
+ }
370
+
371
+ percentMouse = ( pixelMouse / pixelTotal );
372
+ if ( percentMouse > 1 ) {
373
+ percentMouse = 1;
374
+ }
375
+ if ( percentMouse < 0 ) {
376
+ percentMouse = 0;
377
+ }
378
+ if ( this.orientation === "vertical" ) {
379
+ percentMouse = 1 - percentMouse;
380
+ }
381
+ if ( this.options.isRTL ) { // RTL
382
+ percentMouse = 1 - percentMouse;
383
+ }
384
+
385
+ valueTotal = this._valueMax() - this._valueMin();
386
+ valueMouse = this._valueMin() + percentMouse * valueTotal;
387
+
388
+ return this._trimAlignValue( valueMouse );
389
+ },
390
+
391
+ _start: function( event, index ) {
392
+ var uiHash = {
393
+ handle: this.handles[ index ],
394
+ value: this.value()
395
+ };
396
+ if ( this.options.values && this.options.values.length ) {
397
+ uiHash.value = this.values( index );
398
+ uiHash.values = this.values();
399
+ }
400
+ return this._trigger( "start", event, uiHash );
401
+ },
402
+
403
+ _slide: function( event, index, newVal ) {
404
+ var otherVal,
405
+ newValues,
406
+ allowed;
407
+
408
+ if ( this.options.values && this.options.values.length ) {
409
+ otherVal = this.values( index ? 0 : 1 );
410
+
411
+ if ( ( this.options.values.length === 2 && this.options.range === true ) &&
412
+ ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
413
+ ) {
414
+ newVal = otherVal;
415
+ }
416
+
417
+ if ( newVal !== this.values( index ) ) {
418
+ newValues = this.values();
419
+ newValues[ index ] = newVal;
420
+ // A slide can be canceled by returning false from the slide callback
421
+ allowed = this._trigger( "slide", event, {
422
+ handle: this.handles[ index ],
423
+ value: newVal,
424
+ values: newValues
425
+ } );
426
+ otherVal = this.values( index ? 0 : 1 );
427
+ if ( allowed !== false ) {
428
+ this.values( index, newVal, true );
429
+ }
430
+ }
431
+ } else {
432
+ if ( newVal !== this.value() ) {
433
+ // A slide can be canceled by returning false from the slide callback
434
+ allowed = this._trigger( "slide", event, {
435
+ handle: this.handles[ index ],
436
+ value: newVal
437
+ } );
438
+ if ( allowed !== false ) {
439
+ this.value( newVal );
440
+ }
441
+ }
442
+ }
443
+ },
444
+
445
+ _stop: function( event, index ) {
446
+ var uiHash = {
447
+ handle: this.handles[ index ],
448
+ value: this.value()
449
+ };
450
+ if ( this.options.values && this.options.values.length ) {
451
+ uiHash.value = this.values( index );
452
+ uiHash.values = this.values();
453
+ }
454
+
455
+ this._trigger( "stop", event, uiHash );
456
+ },
457
+
458
+ _change: function( event, index ) {
459
+ if ( !this._keySliding && !this._mouseSliding ) {
460
+ var uiHash = {
461
+ handle: this.handles[ index ],
462
+ value: this.value()
463
+ };
464
+ if ( this.options.values && this.options.values.length ) {
465
+ uiHash.value = this.values( index );
466
+ uiHash.values = this.values();
467
+ }
468
+
469
+ this._trigger( "change", event, uiHash );
470
+ }
471
+ },
472
+
473
+ value: function( newValue ) {
474
+ if ( arguments.length ) {
475
+ this.options.value = this._trimAlignValue( newValue );
476
+ this._refreshValue();
477
+ this._change( null, 0 );
478
+ }
479
+
480
+ return this._value();
481
+ },
482
+
483
+ values: function( index, newValue ) {
484
+ var vals,
485
+ newValues,
486
+ i;
487
+
488
+ if ( arguments.length > 1 ) {
489
+ this.options.values[ index ] = this._trimAlignValue( newValue );
490
+ this._refreshValue();
491
+ this._change( null, index );
492
+ }
493
+
494
+ if ( arguments.length ) {
495
+ if ( $.isArray( arguments[ 0 ] ) ) {
496
+ vals = this.options.values;
497
+ newValues = arguments[ 0 ];
498
+ for ( i = 0; i < vals.length; i += 1 ) {
499
+ vals[ i ] = this._trimAlignValue( newValues[ i ] );
500
+ this._change( null, i );
501
+ }
502
+ this._refreshValue();
503
+ } else {
504
+ if ( this.options.values && this.options.values.length ) {
505
+ return this._values( index );
506
+ } else {
507
+ return this.value();
508
+ }
509
+ }
510
+ } else {
511
+ return this._values();
512
+ }
513
+ },
514
+
515
+ _setOption: function( key, value ) {
516
+ var i,
517
+ valsLength = 0;
518
+
519
+ if ( $.isArray( this.options.values ) ) {
520
+ valsLength = this.options.values.length;
521
+ }
522
+
523
+ $.Widget.prototype._setOption.apply( this, arguments );
524
+
525
+ switch ( key ) {
526
+ case "disabled":
527
+ if ( value ) {
528
+ this.handles.filter( ".ui-state-focus" ).blur();
529
+ this.handles.removeClass( "ui-state-hover" );
530
+ this.handles.attr( "disabled", "disabled" );
531
+ this.element.addClass( "ui-disabled" );
532
+ } else {
533
+ this.handles.removeAttr( "disabled" );
534
+ this.element.removeClass( "ui-disabled" );
535
+ }
536
+ break;
537
+ case "orientation":
538
+ this._detectOrientation();
539
+ this.element
540
+ .removeClass( "ui-slider-horizontal ui-slider-vertical" )
541
+ .addClass( "ui-slider-" + this.orientation );
542
+ this._refreshValue();
543
+ break;
544
+ case "isRTL": // RTL
545
+ this.element.toggleClass( "ui-slider-rtl", value );
546
+ this._refreshValue();
547
+ break;
548
+ case "value":
549
+ this._animateOff = true;
550
+ this._refreshValue();
551
+ this._change( null, 0 );
552
+ this._animateOff = false;
553
+ break;
554
+ case "values":
555
+ this._animateOff = true;
556
+ this._refreshValue();
557
+ for ( i = 0; i < valsLength; i += 1 ) {
558
+ this._change( null, i );
559
+ }
560
+ this._animateOff = false;
561
+ break;
562
+ }
563
+ },
564
+
565
+ //internal value getter
566
+ // _value() returns value trimmed by min and max, aligned by step
567
+ _value: function() {
568
+ var val = this.options.value;
569
+ val = this._trimAlignValue( val );
570
+
571
+ return val;
572
+ },
573
+
574
+ //internal values getter
575
+ // _values() returns array of values trimmed by min and max, aligned by step
576
+ // _values( index ) returns single value trimmed by min and max, aligned by step
577
+ _values: function( index ) {
578
+ var val,
579
+ vals,
580
+ i;
581
+
582
+ if ( arguments.length ) {
583
+ val = this.options.values[ index ];
584
+ val = this._trimAlignValue( val );
585
+
586
+ return val;
587
+ } else {
588
+ // .slice() creates a copy of the array
589
+ // this copy gets trimmed by min and max and then returned
590
+ vals = this.options.values.slice();
591
+ for ( i = 0; i < vals.length; i+= 1) {
592
+ vals[ i ] = this._trimAlignValue( vals[ i ] );
593
+ }
594
+
595
+ return vals;
596
+ }
597
+ },
598
+
599
+ // returns the step-aligned value that val is closest to, between (inclusive) min and max
600
+ _trimAlignValue: function( val ) {
601
+ if ( val <= this._valueMin() ) {
602
+ return this._valueMin();
603
+ }
604
+ if ( val >= this._valueMax() ) {
605
+ return this._valueMax();
606
+ }
607
+ var step = ( this.options.step > 0 ) ? this.options.step : 1,
608
+ valModStep = (val - this._valueMin()) % step;
609
+ alignValue = val - valModStep;
610
+
611
+ if ( Math.abs(valModStep) * 2 >= step ) {
612
+ alignValue += ( valModStep > 0 ) ? step : ( -step );
613
+ }
614
+
615
+ // Since JavaScript has problems with large floats, round
616
+ // the final value to 5 digits after the decimal point (see #4124)
617
+ return parseFloat( alignValue.toFixed(5) );
618
+ },
619
+
620
+ _valueMin: function() {
621
+ return this.options.min;
622
+ },
623
+
624
+ _valueMax: function() {
625
+ return this.options.max;
626
+ },
627
+
628
+ _refreshValue: function() {
629
+ var oRange = this.options.range,
630
+ o = this.options,
631
+ self = this,
632
+ animate = ( !this._animateOff ) ? o.animate : false,
633
+ valPercent,
634
+ _set = {},
635
+ lastValPercent,
636
+ value,
637
+ valueMin,
638
+ valueMax;
639
+
640
+ if ( this.options.values && this.options.values.length ) {
641
+ this.handles.each(function( i, j ) {
642
+ valPercent = ( self.values( i ) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100;
643
+ valPercent = ( self.options.isRTL ? 100 - valPercent : valPercent ); // RTL
644
+ _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
645
+ $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
646
+ if ( self.options.range === true ) {
647
+ if ( self.orientation === "horizontal" ) {
648
+ if ( i === 0 ) {
649
+ self.range.stop( 1, 1 )[ animate ? "animate" : "css" ](
650
+ self.options.isRTL ? { right: ( 100 - valPercent ) + "%"} : // RTL
651
+ { left: valPercent + "%" }, o.animate );
652
+ }
653
+ if ( i === 1 ) {
654
+ self.range[ animate ? "animate" : "css" ]( {
655
+ width: ( ( self.options.isRTL ? -1 : +1 ) * ( valPercent - lastValPercent ) ) + "%" }, // RTL
656
+ { queue: false, duration: o.animate } );
657
+ }
658
+ } else {
659
+ if ( i === 0 ) {
660
+ self.range.stop( 1, 1 )[ animate ? "animate" : "css" ](
661
+ self.options.isRTL ? { top: ( 100 - valPercent ) + "%" } : // RTL
662
+ { bottom: ( valPercent ) + "%" }, o.animate );
663
+ }
664
+ if ( i === 1 ) {
665
+ self.range[ animate ? "animate" : "css" ]( {
666
+ height: ( ( self.options.isRTL ? -1 : +1 ) * ( valPercent - lastValPercent ) ) + "%" }, // RTL
667
+ { queue: false, duration: o.animate } );
668
+ }
669
+ }
670
+ }
671
+ lastValPercent = valPercent;
672
+ });
673
+ } else {
674
+ value = this.value();
675
+ valueMin = this._valueMin();
676
+ valueMax = this._valueMax();
677
+ valPercent = ( valueMax !== valueMin ) ?
678
+ ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
679
+ 0;
680
+ valPercent = ( self.options.isRTL ? 100 - valPercent : valPercent ); // RTL
681
+ _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
682
+ this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
683
+
684
+ if ( oRange === "min" && this.orientation === "horizontal" ) {
685
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ](
686
+ { width: ( self.options.isRTL ? 100 - valPercent : valPercent ) + "%" }, o.animate ); // RTL
687
+ }
688
+ if ( oRange === "max" && this.orientation === "horizontal" ) {
689
+ this.range[ animate ? "animate" : "css" ]( {
690
+ width: ( self.options.isRTL ? valPercent : 100 - valPercent ) + "%" }, // RTL
691
+ { queue: false, duration: o.animate } );
692
+ }
693
+ if ( oRange === "min" && this.orientation === "vertical" ) {
694
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ](
695
+ { height: ( self.options.isRTL ? 100 - valPercent : valPercent ) + "%" }, o.animate ); // RTL
696
+ }
697
+ if ( oRange === "max" && this.orientation === "vertical" ) {
698
+ this.range[ animate ? "animate" : "css" ](
699
+ { height: ( self.options.isRTL ? valPercent : 100 - valPercent ) + "%" }, // RTL
700
+ { queue: false, duration: o.animate } );
701
+ }
702
+ }
703
+ }
704
+
705
+ });
706
+
707
+ $.extend( $.ui.slider, {
708
+ version: "1.8.9"
709
+ });
710
+
711
+ }(jQuery));
js/qsm-quiz.js CHANGED
@@ -576,7 +576,9 @@ function qmnNextSlide( pagination, go_to_top, quiz_form_id ) {
576
  var slide_number = +$container.find( '.slide_number_hidden' ).val();
577
  var previous = +$container.find( '.previous_amount_hidden' ).val();
578
  var section_totals = +$container.find( '.total_sections_hidden' ).val();
579
-
 
 
580
  jQuery( quiz_form_id + " .quiz_section" ).hide();
581
  for ( var i = 0; i < pagination; i++ ) {
582
  if (i === 0 && previous === 1 && slide_number > 1) {
@@ -588,24 +590,27 @@ function qmnNextSlide( pagination, go_to_top, quiz_form_id ) {
588
  slide_number = 1;
589
  }
590
  $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
591
-
592
- if ( qmn_quiz_data[ quiz_id ].first_page ) {
593
- if (slide_number > 1) {
594
- $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
595
- }
596
- } else {
597
- if (slide_number > pagination) {
598
- $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
599
- }
600
- }
601
- if (slide_number == section_totals) {
602
- $container.find( ".mlw_qmn_quiz_link.mlw_next" ).hide();
603
- }
604
- if (slide_number < section_totals) {
605
- $container.find( ".mlw_qmn_quiz_link.mlw_next" ).show();
606
- }
607
- jQuery( quiz_form_id + " .quiz_section.slide" + slide_number ).show();
608
- }
 
 
 
609
 
610
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find( '.slide_number_hidden' ).val( slide_number );
611
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find( '.previous_amount_hidden' ).val( 0 );
@@ -904,7 +909,7 @@ jQuery(function() {
904
  }
905
  });
906
  return false;
907
- });
908
  });
909
 
910
  var qsmTimerInterval = setInterval( qmnTimeTakenTimer, 1000 );
576
  var slide_number = +$container.find( '.slide_number_hidden' ).val();
577
  var previous = +$container.find( '.previous_amount_hidden' ).val();
578
  var section_totals = +$container.find( '.total_sections_hidden' ).val();
579
+ if(pagination == 1){
580
+ section_totals = section_totals - 1;
581
+ }
582
  jQuery( quiz_form_id + " .quiz_section" ).hide();
583
  for ( var i = 0; i < pagination; i++ ) {
584
  if (i === 0 && previous === 1 && slide_number > 1) {
590
  slide_number = 1;
591
  }
592
  $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
593
+
594
+ if (qmn_quiz_data[ quiz_id ].first_page) {
595
+ if (slide_number > 1) {
596
+ $container.find(".mlw_qmn_quiz_link.mlw_previous").show();
597
+ }
598
+ } else {
599
+ if (slide_number > pagination) {
600
+ $container.find(".mlw_qmn_quiz_link.mlw_previous").show();
601
+ }
602
+ }
603
+ if (slide_number == section_totals) {
604
+ $container.find(".mlw_qmn_quiz_link.mlw_next").hide();
605
+ if(pagination == 1){
606
+ jQuery(quiz_form_id + " .quiz_section.quiz_end").show();
607
+ }
608
+ }
609
+ if (slide_number < section_totals) {
610
+ $container.find(".mlw_qmn_quiz_link.mlw_next").show();
611
+ }
612
+ jQuery(quiz_form_id + " .quiz_section.slide" + slide_number).show();
613
+ }
614
 
615
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find( '.slide_number_hidden' ).val( slide_number );
616
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find( '.previous_amount_hidden' ).val( 0 );
909
  }
910
  });
911
  return false;
912
+ });
913
  });
914
 
915
  var qsmTimerInterval = setInterval( qmnTimeTakenTimer, 1000 );
mlw_quizmaster2.php CHANGED
@@ -2,14 +2,14 @@
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
- * Version: 6.4.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 6.3.6
13
  * @package QSM
14
  */
15
 
@@ -37,7 +37,7 @@ class MLWQuizMasterNext {
37
  * @var string
38
  * @since 4.0.0
39
  */
40
- public $version = '6.4.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: 6.4.3
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 6.4.3
13
  * @package QSM
14
  */
15
 
37
  * @var string
38
  * @since 4.0.0
39
  */
40
+ public $version = '6.4.3';
41
 
42
  /**
43
  * QSM Alert Manager Object
php/admin/help-page.php CHANGED
@@ -53,7 +53,7 @@ function qsm_documentation_meta_box_content() {
53
  ?>
54
  <p><?php esc_html_e( 'Need help with the plugin? Try any of the following:', 'quiz-master-next' ); ?></p>
55
  <ul>
56
- <li>For assistance in using the plugin, read our <a href="https://docs.quizandsurveymaster.com" target="_blank">documentation</a></li>
57
  <li>For support, fill out the form on our <a href="https://quizandsurveymaster.com/quiz/contact/?utm_source=qsm-help-page&utm_medium=plugin&utm_campaign=qsm_plugin&utm_content=contact_us" target="_blank">Contact Us Page</a></li>
58
  </ul>
59
  <?php
53
  ?>
54
  <p><?php esc_html_e( 'Need help with the plugin? Try any of the following:', 'quiz-master-next' ); ?></p>
55
  <ul>
56
+ <li>For assistance in using the plugin, read our <a href="https://quizandsurveymaster.com/docs/" target="_blank">documentation</a></li>
57
  <li>For support, fill out the form on our <a href="https://quizandsurveymaster.com/quiz/contact/?utm_source=qsm-help-page&utm_medium=plugin&utm_campaign=qsm_plugin&utm_content=contact_us" target="_blank">Contact Us Page</a></li>
58
  </ul>
59
  <?php
php/admin/options-page-contact-tab.php CHANGED
@@ -49,7 +49,7 @@ function qsm_options_contact_tab_content() {
49
 
50
  ?>
51
  <h2><?php _e( 'Contact', 'quiz-master-next' ); ?></h2>
52
- <p>Need assistance with this tab? <a href="https://docs.quizandsurveymaster.com/article/20-collecting-users-information-using-contact-fields" target="_blank">Check out the documentation</a> for this tab!</p>
53
  <div class="contact-message"></div>
54
  <a class="save-contact button-primary"><?php _e( 'Save Contact Fields', 'quiz-master-next' ); ?></a>
55
  <div class="contact-form"></div>
49
 
50
  ?>
51
  <h2><?php _e( 'Contact', 'quiz-master-next' ); ?></h2>
52
+ <p>Need assistance with this tab? <a href="https://quizandsurveymaster.com/docs/creating-quizzes-and-surveys/adding-contact-form-fields/" target="_blank">Check out the documentation</a> for this tab!</p>
53
  <div class="contact-message"></div>
54
  <a class="save-contact button-primary"><?php _e( 'Save Contact Fields', 'quiz-master-next' ); ?></a>
55
  <div class="contact-form"></div>
php/admin/options-page-email-tab.php CHANGED
@@ -41,7 +41,7 @@ function qsm_options_emails_tab_content() {
41
  wp_enqueue_media();
42
  ?>
43
  <h2><?php esc_html_e( 'Emails', 'quiz-master-next' ); ?></h2>
44
- <p>Need assistance with this tab? <a href="https://docs.quizandsurveymaster.com/article/17-sending-emails" target="_blank">Check out the documentation</a> for this tab!</p>
45
 
46
  <!-- Template Variable Section -->
47
  <section>
41
  wp_enqueue_media();
42
  ?>
43
  <h2><?php esc_html_e( 'Emails', 'quiz-master-next' ); ?></h2>
44
+ <p>Need assistance with this tab? <a href="https://quizandsurveymaster.com/docs/creating-quizzes-and-surveys/setting-up-emails/" target="_blank">Check out the documentation</a> for this tab!</p>
45
 
46
  <!-- Template Variable Section -->
47
  <section>
php/admin/options-page-preview-tab.php CHANGED
@@ -27,7 +27,7 @@ add_action( 'plugins_loaded', 'qsm_settings_preview_tab', 5 );
27
  */
28
  function qsm_options_preview_tab_content() {
29
  ?>
30
- <p>If your quiz looks different on the front end compared to this preview, then there is a conflict with your theme. Check out our <a href="https://docs.quizandsurveymaster.com/article/21-common-theme-conflict-fixes" target="_blank">Common Theme Conflict Fixes</a>.</p>
31
  <?php
32
  echo do_shortcode( '[qsm quiz=' . intval( $_GET['quiz_id'] ) . ']' );
33
  ?>
27
  */
28
  function qsm_options_preview_tab_content() {
29
  ?>
30
+ <p>If your quiz looks different on the front end compared to this preview, then there is a conflict with your theme. Check out our <a href="https://quizandsurveymaster.com/docs/advanced-topics/common-theme-conflict-fixes/" target="_blank">Common Theme Conflict Fixes</a>.</p>
31
  <?php
32
  echo do_shortcode( '[qsm quiz=' . intval( $_GET['quiz_id'] ) . ']' );
33
  ?>
php/admin/options-page-questions-tab.php CHANGED
@@ -12,7 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) {
12
  * Adds the settings for questions tab to the Quiz Settings page.
13
  *
14
  * @return void
15
- * @since 4.4.0
16
  */
17
  function qsm_settings_questions_tab() {
18
  global $mlwQuizMasterNext;
@@ -134,6 +134,7 @@ function qsm_options_questions_tab_content() {
134
  }
135
  ?>
136
  </select>
 
137
  </div>
138
  <p id="question_type_info"></p>
139
  <div class="qsm-row">
12
  * Adds the settings for questions tab to the Quiz Settings page.
13
  *
14
  * @return void
15
+ * @since 4.4.0
16
  */
17
  function qsm_settings_questions_tab() {
18
  global $mlwQuizMasterNext;
134
  }
135
  ?>
136
  </select>
137
+ <a class="question_info_tag" target="_blank" href="https://quizandsurveymaster.com/docs/about-quiz-survey-master/question-types/"><?php _e('How to use this option?','quiz_master_next') ?></a>
138
  </div>
139
  <p id="question_type_info"></p>
140
  <div class="qsm-row">
php/admin/options-page-results-page-tab.php CHANGED
@@ -39,7 +39,7 @@ function qsm_options_results_tab_content() {
39
  wp_enqueue_media();
40
  ?>
41
  <h2><?php esc_html_e( 'Results Pages', 'quiz-master-next' ); ?></h2>
42
- <p>Need assistance with this tab? <a href="https://docs.quizandsurveymaster.com/article/25-setting-up-results-pages-and-thank-you-pages" target="_blank">Check out the documentation</a> for this tab!</p>
43
 
44
  <!-- Template Variables Section -->
45
  <section>
39
  wp_enqueue_media();
40
  ?>
41
  <h2><?php esc_html_e( 'Results Pages', 'quiz-master-next' ); ?></h2>
42
+ <p>Need assistance with this tab? <a href="https://quizandsurveymaster.com/docs/creating-quizzes-and-surveys/setting-up-results-pages/" target="_blank">Check out the documentation</a> for this tab!</p>
43
 
44
  <!-- Template Variables Section -->
45
  <section>
php/admin/quizzes-page.php CHANGED
@@ -385,7 +385,7 @@ function qsm_generate_quizzes_surveys_page() {
385
  <!-- Templates -->
386
  <script type="text/template" id="tmpl-no-quiz">
387
  <h2><?php _e( 'You do not have any quizzes or surveys. Click "Add New" to get started.', 'quiz-master-next' ); ?></h2>
388
- <h2>Is this your first time using this plugin? Check out our <a href="https://docs.quizandsurveymaster.com" target="_blank">Documentation</a> or watch our Getting Started Video below</h2>
389
  <iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/coE5W_WB-48" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
390
  </script>
391
 
385
  <!-- Templates -->
386
  <script type="text/template" id="tmpl-no-quiz">
387
  <h2><?php _e( 'You do not have any quizzes or surveys. Click "Add New" to get started.', 'quiz-master-next' ); ?></h2>
388
+ <h2>Is this your first time using this plugin? Check out our <a href="https://quizandsurveymaster.com/docs" target="_blank">Documentation</a> or watch our Getting Started Video below</h2>
389
  <iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/coE5W_WB-48" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
390
  </script>
391
 
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -463,8 +463,12 @@ class QMNQuizManager {
463
  'incorrect' => $options->incorrect_error_text,
464
  'empty' => $options->empty_error_text,
465
  );
466
-
467
  wp_enqueue_script('progress-bar', plugins_url('../../js/progressbar.min.js', __FILE__));
 
 
 
 
468
  wp_enqueue_script('qsm_quiz', plugins_url('../../js/qsm-quiz.js', __FILE__), array('wp-util', 'underscore', 'jquery', 'jquery-ui-tooltip', 'progress-bar'), $mlwQuizMasterNext->version);
469
  wp_localize_script('qsm_quiz', 'qmn_ajax_object', array('ajaxurl' => admin_url('admin-ajax.php'), 'enable_quick_result_mc' => isset($options->enable_quick_result_mc) ? $options->enable_quick_result_mc : '','enable_result_after_timer_end' => isset($options->enable_result_after_timer_end) ? $options->enable_result_after_timer_end : ''));
470
  wp_enqueue_script( 'math_jax', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' );
@@ -1619,6 +1623,21 @@ class QMNQuizManager {
1619
  } else {
1620
  $ip = __('Unknown', 'quiz-master-next');
1621
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1622
  }
1623
  return $ip;
1624
  }
@@ -1680,7 +1699,7 @@ add_filter('qmn_begin_shortcode', 'qmn_total_user_tries_check', 10, 3);
1680
  * @return string The altered HTML display for the quiz
1681
  */
1682
  function qmn_total_user_tries_check($display, $qmn_quiz_options, $qmn_array_for_variables) {
1683
-
1684
  global $qmn_allowed_visit;
1685
  if ($qmn_quiz_options->total_user_tries != 0) {
1686
 
463
  'incorrect' => $options->incorrect_error_text,
464
  'empty' => $options->empty_error_text,
465
  );
466
+
467
  wp_enqueue_script('progress-bar', plugins_url('../../js/progressbar.min.js', __FILE__));
468
+ wp_enqueue_script( 'jquery-ui-slider-js', '//code.jquery.com/ui/1.12.1/jquery-ui.js' );
469
+ wp_enqueue_script( 'jquery-ui-slider-rtl-js', plugins_url('../../js/jquery.ui.slider-rtl.js', __FILE__) );
470
+ wp_enqueue_script( 'jquery-ui-slider-rtl-css', plugins_url('../../css/jquery.ui.slider-rtl.css', __FILE__) );
471
+ wp_enqueue_script( 'jqueryui-touch-js', '//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js' );
472
  wp_enqueue_script('qsm_quiz', plugins_url('../../js/qsm-quiz.js', __FILE__), array('wp-util', 'underscore', 'jquery', 'jquery-ui-tooltip', 'progress-bar'), $mlwQuizMasterNext->version);
473
  wp_localize_script('qsm_quiz', 'qmn_ajax_object', array('ajaxurl' => admin_url('admin-ajax.php'), 'enable_quick_result_mc' => isset($options->enable_quick_result_mc) ? $options->enable_quick_result_mc : '','enable_result_after_timer_end' => isset($options->enable_result_after_timer_end) ? $options->enable_result_after_timer_end : ''));
474
  wp_enqueue_script( 'math_jax', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' );
1623
  } else {
1624
  $ip = __('Unknown', 'quiz-master-next');
1625
  }
1626
+
1627
+ if (getenv('HTTP_CLIENT_IP'))
1628
+ $ip = getenv('HTTP_CLIENT_IP');
1629
+ else if (getenv('HTTP_X_FORWARDED_FOR'))
1630
+ $ip = getenv('HTTP_X_FORWARDED_FOR');
1631
+ else if (getenv('HTTP_X_FORWARDED'))
1632
+ $ip = getenv('HTTP_X_FORWARDED');
1633
+ else if (getenv('HTTP_FORWARDED_FOR'))
1634
+ $ip = getenv('HTTP_FORWARDED_FOR');
1635
+ else if (getenv('HTTP_FORWARDED'))
1636
+ $ip = getenv('HTTP_FORWARDED');
1637
+ else if (getenv('REMOTE_ADDR'))
1638
+ $ip = getenv('REMOTE_ADDR');
1639
+ else
1640
+ $ip = $_SERVER['REMOTE_ADDR'];
1641
  }
1642
  return $ip;
1643
  }
1699
  * @return string The altered HTML display for the quiz
1700
  */
1701
  function qmn_total_user_tries_check($display, $qmn_quiz_options, $qmn_array_for_variables) {
1702
+
1703
  global $qmn_allowed_visit;
1704
  if ($qmn_quiz_options->total_user_tries != 0) {
1705
 
php/classes/class-qsm-install.php CHANGED
@@ -1502,7 +1502,7 @@ class QSM_Install {
1502
  public function plugin_row_meta( $links, $file ) {
1503
  if ( $file == QSM_PLUGIN_BASENAME ) {
1504
  $row_meta = array(
1505
- 'docs' => '<a href="' . esc_url( 'https://docs.quizandsurveymaster.com/' ) . '" title="' . esc_attr( __( 'View Documentation', 'quiz-master-next' ) ) . '">' . __( 'Documentation', 'quiz-master-next' ) . '</a>',
1506
  'support' => '<a href="' . admin_url( 'admin.php?page=qsm_quiz_help' ) . '" title="' . esc_attr( __( 'Create Support Ticket', 'quiz-master-next' ) ) . '">' . __( 'Support', 'quiz-master-next' ) . '</a>',
1507
  );
1508
  return array_merge( $links, $row_meta );
1502
  public function plugin_row_meta( $links, $file ) {
1503
  if ( $file == QSM_PLUGIN_BASENAME ) {
1504
  $row_meta = array(
1505
+ 'docs' => '<a href="' . esc_url( 'https://quizandsurveymaster.com/docs/' ) . '" title="' . esc_attr( __( 'View Documentation', 'quiz-master-next' ) ) . '">' . __( 'Documentation', 'quiz-master-next' ) . '</a>',
1506
  'support' => '<a href="' . admin_url( 'admin.php?page=qsm_quiz_help' ) . '" title="' . esc_attr( __( 'Create Support Ticket', 'quiz-master-next' ) ) . '">' . __( 'Support', 'quiz-master-next' ) . '</a>',
1507
  );
1508
  return array_merge( $links, $row_meta );
php/question-types.php CHANGED
@@ -1104,12 +1104,167 @@ function qmn_fill_blank_review($id, $question, $answers)
1104
  return $return_array;
1105
  }
1106
 
1107
- function qsm_question_title_func($question){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1108
  //$question_title = apply_filters('the_content', $question);
1109
  $question_title = $question;
1110
  global $wp_embed;
1111
  $question_title = $wp_embed->run_shortcode($question_title);
1112
- $question_display = "<span class='mlw_qmn_question'>" . do_shortcode( htmlspecialchars_decode( $question_title, ENT_QUOTES ) ) . "</span>";
 
 
 
 
1113
  return $question_display;
1114
  }
1115
  ?>
1104
  return $return_array;
1105
  }
1106
 
1107
+
1108
+ //Start polar question
1109
+ add_action("plugins_loaded", 'qmn_question_type_polar');
1110
+
1111
+ /**
1112
+ * This function registers the fill in the blank question type
1113
+ *
1114
+ * @return void
1115
+ * @since 6.4.1
1116
+ */
1117
+ function qmn_question_type_polar() {
1118
+ global $mlwQuizMasterNext;
1119
+ $mlwQuizMasterNext->pluginHelper->register_question_type(__("Polar", 'quiz-master-next'), 'qmn_polar_display', true, 'qmn_polar_review', null, null, 13);
1120
+ }
1121
+
1122
+ /**
1123
+ * This function displays the fill in the blank question
1124
+ *
1125
+ * @params $id The ID of the multiple choice question
1126
+ * @params $question The question that is being edited.
1127
+ * @params @answers The array that contains the answers to the question.
1128
+ * @return $question_display Returns the content of the question
1129
+ * @since 6.4.1
1130
+ */
1131
+ function qmn_polar_display($id, $question, $answers) {
1132
+ $question_display = '';
1133
+ global $mlwQuizMasterNext;
1134
+ $required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
1135
+ $autofill = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'autofill');
1136
+ $limit_text = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'limit_text');
1137
+ $autofill_att = $autofill ? "autocomplete='off' " : '';
1138
+ $limit_text_att = $limit_text ? "maxlength='" . $limit_text . "' " : '';
1139
+ $input_text = '';
1140
+ $first_point = isset($answers[0][1]) ? $answers[0][1] : 0;
1141
+ $second_point = isset($answers[1][1]) ? $answers[1][1] : 0;
1142
+ $is_reverse = false;
1143
+ $check_point = $second_point;
1144
+ $font_weight_lc = 'right-polar-title';
1145
+ $font_weight_rc = 'left-polar-title';
1146
+ if($first_point > $second_point){
1147
+ $is_reverse = true;
1148
+ $check_point = $first_point;
1149
+ $font_weight_lc = 'left-polar-title';
1150
+ $font_weight_rc = 'right-polar-title';
1151
+ }
1152
+ $total_answer = count($answers);
1153
+ ?>
1154
+ <script type="text/javascript">
1155
+ (function($) {
1156
+ $(document).ready(function() {
1157
+ $('#slider-' + '<?php echo $id; ?>').slider({
1158
+ <?php if ($total_answer == 2 && $is_reverse) { ?>
1159
+ max: <?php echo $answers[0][1]; ?>,
1160
+ min: <?php echo $answers[1][1]; ?>,
1161
+ isRTL: true,
1162
+ <?php }else{ ?>
1163
+ min: <?php echo $answers[0][1]; ?>,
1164
+ max: <?php echo $answers[1][1]; ?>,
1165
+ <?php } ?>
1166
+ step: 1,
1167
+ value: <?php echo ceil($check_point/2); ?>,
1168
+ change: function( event, ui ) {
1169
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.qmn_polar').val(ui.value);
1170
+ if(ui.value == <?php echo $answers[0][1]; ?>){
1171
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.left-polar-title').css('font-weight','900');
1172
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.right-polar-title').css('font-weight','100');
1173
+ } else if(ui.value == <?php echo $answers[1][1]; ?>){
1174
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.left-polar-title').css('font-weight','100');
1175
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.right-polar-title').css('font-weight','900');
1176
+ } else if(ui.value == <?php echo $check_point / 2; ?>){
1177
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.left-polar-title').css('font-weight','400');
1178
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.right-polar-title').css('font-weight','400');
1179
+ } else if(ui.value > <?php echo $check_point / 2; ?>){
1180
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.<?php echo $font_weight_rc; ?>').css('font-weight','400');
1181
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.<?php echo $font_weight_lc; ?>').css('font-weight','600');
1182
+ } else if(ui.value < <?php echo $check_point / 2; ?>){
1183
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.<?php echo $font_weight_rc; ?>').css('font-weight','600');
1184
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.<?php echo $font_weight_lc; ?>').css('font-weight','400');
1185
+ }
1186
+ },
1187
+ create: function( event, ui ) {
1188
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.left-polar-title').css('font-weight','400');
1189
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.right-polar-title').css('font-weight','400');
1190
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').find('.qmn_polar').val(<?php echo ceil($check_point/2); ?>);
1191
+ }
1192
+ });
1193
+ var maxHeight = Math.max.apply(null, $(".question-section-id-<?php echo $id; ?> .question-type-polar-s > div").map(function (){
1194
+ return $(this).height();
1195
+ }).get());
1196
+ $('.question-section-id-<?php echo $id; ?> .question-type-polar-s').height(maxHeight);
1197
+ });
1198
+ })(jQuery);
1199
+ </script>
1200
+ <?php
1201
+ if ($required == 0) {
1202
+ $mlw_requireClass = "mlwRequiredText";
1203
+ } else {
1204
+ $mlw_requireClass = "";
1205
+ }
1206
+ $question_title = "<div class='polar-question-title'>". do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES)) ."</div>";
1207
+ $input_text .= "<div class='left-polar-title'>" . $answers[0][0] ."</div>";
1208
+ $input_text .= "<div class='slider-main-wrapper'><input type='hidden' class='qmn_polar $mlw_requireClass' id='question" . $id . "' name='question" . $id . "' />";
1209
+ $input_text .= '<div id="slider-'. $id .'"></div></div>';
1210
+ $input_text .= "<div class='right-polar-title'>" . $answers[1][0] . "</div>";
1211
+ /*if (strpos($question, '%POLAR_SLIDER%') !== false) {
1212
+ $question = str_replace("%POLAR_SLIDER%", $input_text, do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES)));
1213
+ }*/
1214
+ $question = $input_text;
1215
+ //$question_title = apply_filters('the_content', $question);
1216
+ $question_display .= $question_title . "<span class='mlw_qmn_question question-type-polar-s'>" . do_shortcode( htmlspecialchars_decode( $question, ENT_QUOTES ) ) . "</span>";;
1217
+ return apply_filters('qmn_polar_display_front', $question_display, $id, $question, $answers);
1218
+ }
1219
+
1220
+ /**
1221
+ * This function determines how the fill in the blank question is graded.
1222
+ *
1223
+ * @params $id The ID of the multiple choice question
1224
+ * @params $question The question that is being edited.
1225
+ * @params @answers The array that contains the answers to the question.
1226
+ * @return $return_array Returns the graded question to the results page
1227
+ * @since 6.4.1
1228
+ */
1229
+ function qmn_polar_review($id, $question, $answers) {
1230
+ $return_array = array(
1231
+ 'points' => 0,
1232
+ 'correct' => 'incorrect',
1233
+ 'user_text' => '',
1234
+ 'correct_text' => ''
1235
+ );
1236
+ if (strpos($question, '%POLAR_SLIDER%') !== false) {
1237
+ $return_array['question_text'] = str_replace("%POLAR_SLIDER%", "__________", do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES)));
1238
+ }
1239
+ if (isset($_POST["question" . $id])) {
1240
+ $decode_user_answer = sanitize_textarea_field(strval(stripslashes(htmlspecialchars_decode($_POST["question" . $id], ENT_QUOTES))));
1241
+ $mlw_user_answer = trim(preg_replace('/\s\s+/', ' ', str_replace("\n", " ", $decode_user_answer)));
1242
+ } else {
1243
+ $mlw_user_answer = " ";
1244
+ }
1245
+ $return_array['user_text'] = $mlw_user_answer;
1246
+
1247
+ foreach($answers as $answer) {
1248
+ $decode_correct_text = strval(htmlspecialchars_decode($answer[0], ENT_QUOTES));
1249
+ if (mb_strtoupper($return_array['user_text']) == mb_strtoupper( trim ($decode_correct_text) ) ) {
1250
+ $return_array['correct'] = "correct";
1251
+ $return_array['points'] = $answer[1];
1252
+ break;
1253
+ }
1254
+ }
1255
+ return $return_array;
1256
+ }
1257
+
1258
+ function qsm_question_title_func($question,$question_type = ''){
1259
  //$question_title = apply_filters('the_content', $question);
1260
  $question_title = $question;
1261
  global $wp_embed;
1262
  $question_title = $wp_embed->run_shortcode($question_title);
1263
+ $polar_extra_class = '';
1264
+ if($question_type == 'polar'){
1265
+ $polar_extra_class = 'question-type-polar-s';
1266
+ }
1267
+ $question_display = "<span class='mlw_qmn_question {$polar_extra_class}' >" . do_shortcode( htmlspecialchars_decode( $question_title, ENT_QUOTES ) ) . "</span>";
1268
  return $question_display;
1269
  }
1270
  ?>
php/shortcodes.php CHANGED
@@ -93,4 +93,13 @@ function qsm_display_recent_quizzes($attrs) {
93
  return $result;
94
 
95
  }
96
- add_shortcode('qsm_recent_quizzes', 'qsm_display_recent_quizzes');
 
 
 
 
 
 
 
 
 
93
  return $result;
94
 
95
  }
96
+ add_shortcode('qsm_recent_quizzes', 'qsm_display_recent_quizzes');
97
+
98
+ /**
99
+ * @since 6.4.1
100
+ */
101
+
102
+ function qsm_load_main_scripts() {
103
+ wp_enqueue_script( 'jquery' );
104
+ }
105
+ add_action( 'wp_enqueue_scripts', 'qsm_load_main_scripts' );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: quiz, survey, lead, test, score, exam, questionnaire, question,wordpress q
4
  Requires at least: 4.9
5
  Tested up to: 5.3.2
6
  Requires PHP: 5.4
7
- Stable tag: 6.4.2
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -92,7 +92,7 @@ QSM is a WordPress Quiz Plugin which is owned completely by [ExpressTech](https:
92
  == Frequently Asked Questions ==
93
 
94
  = How do you use that feature? =
95
- We have extensive documentation and videos for the plugin. You can view the documentation here: [Documentation](https://docs.quizandsurveymaster.com). If you still need assistance, feel free to reach out to us!
96
 
97
  = I want to edit the output for %QUESTIONS_ANSWERS%. Can I do that? =
98
 
@@ -104,7 +104,7 @@ To make these changes, you will edit the %QUESTIONS_ANSWERS% variable. To do tha
104
 
105
  = My preview looks different than my quiz. What can I do? =
106
 
107
- This is usually a theme conflict. You can [checkout out our common conflict solutions](https://docs.quizandsurveymaster.com/article/21-common-theme-conflict-fixes) or feel free to contact us.
108
 
109
  == Screenshots ==
110
 
@@ -118,11 +118,16 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
118
 
119
  == Changelog ==
120
 
 
 
 
 
 
 
 
121
  = 6.4.2 (Jan 27, 2020) =
122
  * Bug: Solved Email without (https://github.com/QuizandSurveyMaster/quiz_master_next/issues/831)
123
 
124
- == Changelog ==
125
-
126
  = 6.4.1 (Jan 24, 2020) =
127
  * Bug: Solve vulnerability issues reported by wordfence
128
  * Bug: PHP notices in Settings page
4
  Requires at least: 4.9
5
  Tested up to: 5.3.2
6
  Requires PHP: 5.4
7
+ Stable tag: 6.4.3
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
92
  == Frequently Asked Questions ==
93
 
94
  = How do you use that feature? =
95
+ We have extensive documentation and videos for the plugin. You can view the documentation here: [Documentation](https://quizandsurveymaster.com/docs). If you still need assistance, feel free to reach out to us!
96
 
97
  = I want to edit the output for %QUESTIONS_ANSWERS%. Can I do that? =
98
 
104
 
105
  = My preview looks different than my quiz. What can I do? =
106
 
107
+ This is usually a theme conflict. You can [checkout out our common conflict solutions](https://quizandsurveymaster.com/docs/advanced-topics/common-theme-conflict-fixes/) or feel free to contact us.
108
 
109
  == Screenshots ==
110
 
118
 
119
  == Changelog ==
120
 
121
+ = 6.4.3 (Feb 6, 2020)=
122
+ * Bug: Solved user limit issue with ip address
123
+ * Bug: Solved Search input issue on Quizzes/Surveys
124
+ * Added: added question type help link and changed the old documentation in whole plugin
125
+ * Feature: Added polar question type
126
+
127
+
128
  = 6.4.2 (Jan 27, 2020) =
129
  * Bug: Solved Email without (https://github.com/QuizandSurveyMaster/quiz_master_next/issues/831)
130
 
 
 
131
  = 6.4.1 (Jan 24, 2020) =
132
  * Bug: Solve vulnerability issues reported by wordfence
133
  * Bug: PHP notices in Settings page