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

Version Description

(May 23, 2016) = * Closed Bug: Multiple quizzes on page causes plugin to scroll to top quiz when submitting - Issue #428

Download this release

Release Info

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

Code changes from version 4.7.1 to 4.7.2

Files changed (4) hide show
  1. js/qmn_quiz.js +24 -24
  2. mlw_quizmaster2.php +3 -3
  3. php/about-page.php +1 -1
  4. readme.txt +6 -3
js/qmn_quiz.js CHANGED
@@ -16,8 +16,8 @@ function qmnClearField( field ) {
16
  if ( field.defaultValue == field.value ) field.value = '';
17
  }
18
 
19
- function qmnReturnToTop() {
20
- jQuery( 'html, body' ).animate( { scrollTop: jQuery( '.qmn_quiz_container' ).offset().top - 150 }, 1000 );
21
  }
22
 
23
  function qmnDisplayError( message, field, quiz_form_id ) {
@@ -133,7 +133,7 @@ function qmnFormSubmit( quiz_form_id ) {
133
  function qsmDisplayLoading( $container ) {
134
  $container.empty();
135
  $container.append( '<div class="qsm-spinner-loader"></div>' );
136
- qmnReturnToTop();
137
  }
138
 
139
  function qmnDisplayResults( results, quiz_form_id, $container ) {
@@ -143,7 +143,7 @@ function qmnDisplayResults( results, quiz_form_id, $container ) {
143
  } else {
144
  $container.append( '<div class="qmn_results_page"></div>' );
145
  $container.find( '.qmn_results_page' ).html( results.display );
146
- qmnReturnToTop();
147
  }
148
  }
149
 
@@ -302,10 +302,10 @@ function qmnValidatePage( quiz_form_id ) {
302
  //Function to advance quiz to next page
303
  function qmnNextSlide( pagination, go_to_top, quiz_form_id ) {
304
  var quiz_id = +jQuery( quiz_form_id ).find( '.qmn_quiz_id' ).val();
305
- var quiz_container = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' );
306
- var slide_number = +quiz_container.find( '.slide_number_hidden' ).val();
307
- var previous = +quiz_container.find( '.previous_amount_hidden' ).val();
308
- var section_totals = +quiz_container.find( '.total_sections_hidden' ).val();
309
 
310
  jQuery( quiz_form_id + " .quiz_section" ).hide();
311
  for ( var i = 0; i < pagination; i++ ) {
@@ -317,22 +317,22 @@ function qmnNextSlide( pagination, go_to_top, quiz_form_id ) {
317
  if (slide_number < 1) {
318
  slide_number = 1;
319
  }
320
- quiz_container.find( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
321
 
322
  if ( qmn_quiz_data[ quiz_id ].first_page ) {
323
  if (slide_number > 1) {
324
- quiz_container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
325
  }
326
  } else {
327
  if (slide_number > pagination) {
328
- quiz_container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
329
  }
330
  }
331
  if (slide_number == section_totals) {
332
- quiz_container.find( ".mlw_qmn_quiz_link.mlw_next" ).hide();
333
  }
334
  if (slide_number < section_totals) {
335
- quiz_container.find( ".mlw_qmn_quiz_link.mlw_next" ).show();
336
  }
337
  jQuery( quiz_form_id + " .quiz_section.slide" + slide_number ).show();
338
  }
@@ -343,16 +343,16 @@ function qmnNextSlide( pagination, go_to_top, quiz_form_id ) {
343
  qmnUpdatePageNumber( 1, quiz_form_id );
344
 
345
  if (go_to_top == 1) {
346
- qmnReturnToTop();
347
  }
348
  }
349
 
350
  function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
351
  var quiz_id = +jQuery( quiz_form_id ).find( '.qmn_quiz_id' ).val();
352
- var quiz_container = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' );
353
- var slide_number = +quiz_container.find( '.slide_number_hidden' ).val();
354
- var previous = +quiz_container.find( '.previous_amount_hidden' ).val();
355
- var section_totals = +quiz_container.find( '.total_sections_hidden' ).val();
356
 
357
  jQuery( quiz_form_id + " .quiz_section" ).hide();
358
  for (var i = 0; i < pagination; i++) {
@@ -365,22 +365,22 @@ function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
365
  slide_number = 1;
366
  }
367
 
368
- quiz_container.find( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
369
 
370
  if ( qmn_quiz_data[ quiz_id ].first_page ) {
371
  if (slide_number > 1) {
372
- quiz_container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
373
  }
374
  } else {
375
  if (slide_number > pagination) {
376
- quiz_container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
377
  }
378
  }
379
  if (slide_number == section_totals) {
380
- quiz_container.find( ".mlw_qmn_quiz_link.mlw_next" ).hide();
381
  }
382
  if (slide_number < section_totals) {
383
- quiz_container.find( ".mlw_qmn_quiz_link.mlw_next" ).show();
384
  }
385
  jQuery( quiz_form_id + " .quiz_section.slide" + slide_number ).show();
386
  }
@@ -391,7 +391,7 @@ function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
391
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find( '.previous_amount_hidden' ).val( 0 );
392
 
393
  if (go_to_top == 1) {
394
- qmnReturnToTop();
395
  }
396
  }
397
 
16
  if ( field.defaultValue == field.value ) field.value = '';
17
  }
18
 
19
+ function qsmScrollTo( $element ) {
20
+ jQuery( 'html, body' ).animate( { scrollTop: $element.offset().top - 150 }, 1000 );
21
  }
22
 
23
  function qmnDisplayError( message, field, quiz_form_id ) {
133
  function qsmDisplayLoading( $container ) {
134
  $container.empty();
135
  $container.append( '<div class="qsm-spinner-loader"></div>' );
136
+ qsmScrollTo( $container );
137
  }
138
 
139
  function qmnDisplayResults( results, quiz_form_id, $container ) {
143
  } else {
144
  $container.append( '<div class="qmn_results_page"></div>' );
145
  $container.find( '.qmn_results_page' ).html( results.display );
146
+ qsmScrollTo( $container );
147
  }
148
  }
149
 
302
  //Function to advance quiz to next page
303
  function qmnNextSlide( pagination, go_to_top, quiz_form_id ) {
304
  var quiz_id = +jQuery( quiz_form_id ).find( '.qmn_quiz_id' ).val();
305
+ var $container = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' );
306
+ var slide_number = +$container.find( '.slide_number_hidden' ).val();
307
+ var previous = +$container.find( '.previous_amount_hidden' ).val();
308
+ var section_totals = +$container.find( '.total_sections_hidden' ).val();
309
 
310
  jQuery( quiz_form_id + " .quiz_section" ).hide();
311
  for ( var i = 0; i < pagination; i++ ) {
317
  if (slide_number < 1) {
318
  slide_number = 1;
319
  }
320
+ $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
321
 
322
  if ( qmn_quiz_data[ quiz_id ].first_page ) {
323
  if (slide_number > 1) {
324
+ $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
325
  }
326
  } else {
327
  if (slide_number > pagination) {
328
+ $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
329
  }
330
  }
331
  if (slide_number == section_totals) {
332
+ $container.find( ".mlw_qmn_quiz_link.mlw_next" ).hide();
333
  }
334
  if (slide_number < section_totals) {
335
+ $container.find( ".mlw_qmn_quiz_link.mlw_next" ).show();
336
  }
337
  jQuery( quiz_form_id + " .quiz_section.slide" + slide_number ).show();
338
  }
343
  qmnUpdatePageNumber( 1, quiz_form_id );
344
 
345
  if (go_to_top == 1) {
346
+ qsmScrollTo( $container );
347
  }
348
  }
349
 
350
  function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
351
  var quiz_id = +jQuery( quiz_form_id ).find( '.qmn_quiz_id' ).val();
352
+ var $container = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' );
353
+ var slide_number = +$container.find( '.slide_number_hidden' ).val();
354
+ var previous = +$container.find( '.previous_amount_hidden' ).val();
355
+ var section_totals = +$container.find( '.total_sections_hidden' ).val();
356
 
357
  jQuery( quiz_form_id + " .quiz_section" ).hide();
358
  for (var i = 0; i < pagination; i++) {
365
  slide_number = 1;
366
  }
367
 
368
+ $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
369
 
370
  if ( qmn_quiz_data[ quiz_id ].first_page ) {
371
  if (slide_number > 1) {
372
+ $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
373
  }
374
  } else {
375
  if (slide_number > pagination) {
376
+ $container.find( ".mlw_qmn_quiz_link.mlw_previous" ).show();
377
  }
378
  }
379
  if (slide_number == section_totals) {
380
+ $container.find( ".mlw_qmn_quiz_link.mlw_next" ).hide();
381
  }
382
  if (slide_number < section_totals) {
383
+ $container.find( ".mlw_qmn_quiz_link.mlw_next" ).show();
384
  }
385
  jQuery( quiz_form_id + " .quiz_section.slide" + slide_number ).show();
386
  }
391
  jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find( '.previous_amount_hidden' ).val( 0 );
392
 
393
  if (go_to_top == 1) {
394
+ qsmScrollTo( $container );
395
  }
396
  }
397
 
mlw_quizmaster2.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
- * Version: 4.7.1
6
  * Author: Frank Corso
7
  * Author URI: http://www.quizandsurveymaster.com/
8
  * Plugin URI: http://www.quizandsurveymaster.com/
@@ -10,7 +10,7 @@
10
  * Domain Path: /languages
11
  *
12
  * @author Frank Corso
13
- * @version 4.7.1
14
  */
15
  if ( ! defined( 'ABSPATH' ) ) exit;
16
 
@@ -30,7 +30,7 @@ class MLWQuizMasterNext
30
  * @var string
31
  * @since 4.0.0
32
  */
33
- public $version = '4.7.1';
34
 
35
  /**
36
  * QMN 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: 4.7.2
6
  * Author: Frank Corso
7
  * Author URI: http://www.quizandsurveymaster.com/
8
  * Plugin URI: http://www.quizandsurveymaster.com/
10
  * Domain Path: /languages
11
  *
12
  * @author Frank Corso
13
+ * @version 4.7.2
14
  */
15
  if ( ! defined( 'ABSPATH' ) ) exit;
16
 
30
  * @var string
31
  * @since 4.0.0
32
  */
33
+ public $version = '4.7.2';
34
 
35
  /**
36
  * QMN Alert Manager Object
php/about-page.php CHANGED
@@ -59,7 +59,7 @@ function mlw_generate_about_page()
59
  </div>
60
  <div id="mlw_quiz_changelog" class="qmn_tab" style="display: none;">
61
  <h2>Changelog</h2>
62
- <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 21 ); ?>
63
  </div>
64
  <div id="qmn_contributors" class="qmn_tab" style="display:none;">
65
  <h2>GitHub Contributors</h2>
59
  </div>
60
  <div id="mlw_quiz_changelog" class="qmn_tab" style="display: none;">
61
  <h2>Changelog</h2>
62
+ <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 22 ); ?>
63
  </div>
64
  <div id="qmn_contributors" class="qmn_tab" style="display:none;">
65
  <h2>GitHub Contributors</h2>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://mylocalwebstop.com/downloads/donation-service-payment/
4
  Tags: quiz, survey, test, score, exam, questionnaire, email, answer, question, certificate, points, results
5
  Requires at least: 4.1
6
  Tested up to: 4.5.2
7
- Stable tag: 4.7.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -104,6 +104,9 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
104
 
105
  == Changelog ==
106
 
 
 
 
107
  = 4.7.1 (May 10, 2016) =
108
  * Closed Enhancement: Create new audit trail class - Issue #425
109
  * Closed Enhancement: Raise minimum WordPress version to 4.1 - Issue #423
@@ -134,5 +137,5 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
134
 
135
  == Upgrade Notice ==
136
 
137
- = 4.7.1 =
138
- Upgrade to make minor changes and improve limit per user feature
4
  Tags: quiz, survey, test, score, exam, questionnaire, email, answer, question, certificate, points, results
5
  Requires at least: 4.1
6
  Tested up to: 4.5.2
7
+ Stable tag: 4.7.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
104
 
105
  == Changelog ==
106
 
107
+ = 4.7.2 (May 23, 2016) =
108
+ * Closed Bug: Multiple quizzes on page causes plugin to scroll to top quiz when submitting - Issue #428
109
+
110
  = 4.7.1 (May 10, 2016) =
111
  * Closed Enhancement: Create new audit trail class - Issue #425
112
  * Closed Enhancement: Raise minimum WordPress version to 4.1 - Issue #423
137
 
138
  == Upgrade Notice ==
139
 
140
+ = 4.7.2 =
141
+ Upgrade to fix scrolling bug affecting posts with multiple quizzes