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

Version Description

(November 27, 2017) = * Closed Bug: Headers already sent message - (Issue #596) * Closed Bug: Styling for hints is missing causing them to be hard to read - (Issue #587)

Download this release

Release Info

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

Code changes from version 5.1.3 to 5.1.4

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: 5.1.3
6
  * Author: Frank Corso
7
  * Author URI: https://www.quizandsurveymaster.com/
8
  * Plugin URI: https://www.quizandsurveymaster.com/
9
  * Text Domain: quiz-master-next
10
  *
11
  * @author Frank Corso
12
- * @version 5.1.3
13
  */
14
  if ( ! defined( 'ABSPATH' ) ) exit;
15
 
@@ -29,7 +29,7 @@ class MLWQuizMasterNext {
29
  * @var string
30
  * @since 4.0.0
31
  */
32
- public $version = '5.1.3';
33
 
34
  /**
35
  * QSM Alert Manager Object
@@ -259,7 +259,7 @@ class MLWQuizMasterNext {
259
  add_submenu_page( __FILE__, __( 'Settings', 'quiz-master-next' ), __( 'Settings', 'quiz-master-next' ), 'manage_options', 'qmn_global_settings', array( 'QMNGlobalSettingsPage', 'display_page' ) );
260
  add_submenu_page( __FILE__, __( 'Tools', 'quiz-master-next' ), __( 'Tools', 'quiz-master-next' ), 'manage_options', 'mlw_quiz_tools', 'mlw_generate_quiz_tools' );
261
  add_submenu_page( __FILE__, __( 'Stats', 'quiz-master-next' ), __( 'Stats', 'quiz-master-next' ), 'moderate_comments', 'qmn_stats', 'qmn_generate_stats_page' );
262
- add_submenu_page( __FILE__, __( 'Addon Settings', 'quiz-master-next' ), __( 'Addon Settings', 'quiz-master-next' ), 'manage_options', 'qmn_addons', 'qmn_addons_page' );
263
  add_submenu_page( __FILE__, __( 'Help', 'quiz-master-next' ), __( 'Help', 'quiz-master-next' ), 'moderate_comments', 'mlw_quiz_help', 'mlw_generate_help_page' );
264
 
265
  add_dashboard_page(
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
+ * Version: 5.1.4
6
  * Author: Frank Corso
7
  * Author URI: https://www.quizandsurveymaster.com/
8
  * Plugin URI: https://www.quizandsurveymaster.com/
9
  * Text Domain: quiz-master-next
10
  *
11
  * @author Frank Corso
12
+ * @version 5.1.4
13
  */
14
  if ( ! defined( 'ABSPATH' ) ) exit;
15
 
29
  * @var string
30
  * @since 4.0.0
31
  */
32
+ public $version = '5.1.4';
33
 
34
  /**
35
  * QSM Alert Manager Object
259
  add_submenu_page( __FILE__, __( 'Settings', 'quiz-master-next' ), __( 'Settings', 'quiz-master-next' ), 'manage_options', 'qmn_global_settings', array( 'QMNGlobalSettingsPage', 'display_page' ) );
260
  add_submenu_page( __FILE__, __( 'Tools', 'quiz-master-next' ), __( 'Tools', 'quiz-master-next' ), 'manage_options', 'mlw_quiz_tools', 'mlw_generate_quiz_tools' );
261
  add_submenu_page( __FILE__, __( 'Stats', 'quiz-master-next' ), __( 'Stats', 'quiz-master-next' ), 'moderate_comments', 'qmn_stats', 'qmn_generate_stats_page' );
262
+ add_submenu_page( __FILE__, __( 'Addon Settings', 'quiz-master-next' ), __( 'Addon Settings', 'quiz-master-next' ), 'moderate_comments', 'qmn_addons', 'qmn_addons_page' );
263
  add_submenu_page( __FILE__, __( 'Help', 'quiz-master-next' ), __( 'Help', 'quiz-master-next' ), 'moderate_comments', 'mlw_quiz_help', 'mlw_generate_help_page' );
264
 
265
  add_dashboard_page(
php/about-page.php CHANGED
@@ -54,6 +54,7 @@ function mlw_generate_about_page() {
54
  </div>
55
  <div class="qsm-tab-content tab-2" style="display: none;">
56
  <h2>Changelog</h2>
 
57
  <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 43 ); ?>
58
  <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 41 ); ?>
59
  <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 40 ); ?>
54
  </div>
55
  <div class="qsm-tab-content tab-2" style="display: none;">
56
  <h2>Changelog</h2>
57
+ <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 44 ); ?>
58
  <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 43 ); ?>
59
  <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 41 ); ?>
60
  <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 40 ); ?>
php/addons-page.php CHANGED
@@ -1,18 +1,18 @@
1
  <?php
2
 
3
- /**
4
- *Creates the add on page that is displayed in the add on settings page
5
- *
6
- * @return void
7
- * @since 4.4.0
8
- */
9
  if ( ! defined( 'ABSPATH' ) ) exit;
10
- function qmn_addons_page()
11
- {
12
- if ( !current_user_can('moderate_comments') )
13
- {
 
 
 
 
 
14
  return;
15
  }
 
16
  global $mlwQuizMasterNext;
17
  $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'featured-addons';
18
  $tab_array = $mlwQuizMasterNext->pluginHelper->get_addon_tabs();
@@ -21,24 +21,20 @@ function qmn_addons_page()
21
  <h2>Quiz And Survey Master Addon Settings</h2>
22
  <h2 class="nav-tab-wrapper">
23
  <?php
24
- foreach($tab_array as $tab)
25
- {
26
  $active_class = '';
27
- if ($active_tab == $tab['slug'])
28
- {
29
  $active_class = 'nav-tab-active';
30
  }
31
- echo "<a href=\"?page=qmn_addons&tab=".$tab['slug']."\" class=\"nav-tab $active_class\">".$tab['title']."</a>";
32
  }
33
  ?>
34
  </h2>
35
  <div>
36
  <?php
37
- foreach($tab_array as $tab)
38
- {
39
- if ($active_tab == $tab['slug'])
40
- {
41
- call_user_func($tab['function']);
42
  }
43
  }
44
  ?>
@@ -53,9 +49,8 @@ function qmn_addons_page()
53
  * @return void
54
  * @since 4.4.0
55
  */
56
- function qmn_generate_featured_addons()
57
- {
58
- wp_enqueue_style( 'qmn_addons_style', plugins_url( '../css/qmn_addons_page.css' , __FILE__ ) );
59
  ?>
60
  <p><?php _e('These addons extend the functionality of Quiz And Survey Master', 'quiz-master-next'); ?></p>
61
  <a href="http://quizandsurveymaster.com/addons/?utm_source=qsm-addons-page&utm_medium=plugin&utm_content=all-addons-top&utm_campaign=qsm_plugin" target="_blank" class="button-primary"><?php _e('Browse All Addons', 'quiz-master-next'); ?></a>
@@ -113,10 +108,9 @@ function qmn_generate_featured_addons()
113
  * @return void
114
  * @since 4.4.0
115
  */
116
- function qmn_featured_addons_tab()
117
- {
118
  global $mlwQuizMasterNext;
119
- $mlwQuizMasterNext->pluginHelper->register_addon_settings_tab(__("Featured Addons", 'quiz-master-next'), "qmn_generate_featured_addons");
120
  }
121
- add_action("plugins_loaded", 'qmn_featured_addons_tab');
122
  ?>
1
  <?php
2
 
 
 
 
 
 
 
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
+
5
+ /**
6
+ *Creates the add on page that is displayed in the add on settings page
7
+ *
8
+ * @return void
9
+ * @since 4.4.0
10
+ */
11
+ function qmn_addons_page() {
12
+ if ( ! current_user_can( 'moderate_comments' ) ) {
13
  return;
14
  }
15
+
16
  global $mlwQuizMasterNext;
17
  $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'featured-addons';
18
  $tab_array = $mlwQuizMasterNext->pluginHelper->get_addon_tabs();
21
  <h2>Quiz And Survey Master Addon Settings</h2>
22
  <h2 class="nav-tab-wrapper">
23
  <?php
24
+ foreach( $tab_array as $tab ) {
 
25
  $active_class = '';
26
+ if ( $active_tab == $tab['slug'] ) {
 
27
  $active_class = 'nav-tab-active';
28
  }
29
+ echo "<a href=\"?page=qmn_addons&tab={$tab['slug']}\" class=\"nav-tab $active_class\">{$tab['title']}</a>";
30
  }
31
  ?>
32
  </h2>
33
  <div>
34
  <?php
35
+ foreach( $tab_array as $tab ) {
36
+ if ( $active_tab == $tab['slug'] ) {
37
+ call_user_func( $tab['function'] );
 
 
38
  }
39
  }
40
  ?>
49
  * @return void
50
  * @since 4.4.0
51
  */
52
+ function qsm_generate_featured_addons() {
53
+ wp_enqueue_style( 'qsm_addons_style', plugins_url( '../css/qmn_addons_page.css' , __FILE__ ) );
 
54
  ?>
55
  <p><?php _e('These addons extend the functionality of Quiz And Survey Master', 'quiz-master-next'); ?></p>
56
  <a href="http://quizandsurveymaster.com/addons/?utm_source=qsm-addons-page&utm_medium=plugin&utm_content=all-addons-top&utm_campaign=qsm_plugin" target="_blank" class="button-primary"><?php _e('Browse All Addons', 'quiz-master-next'); ?></a>
108
  * @return void
109
  * @since 4.4.0
110
  */
111
+ function qsm_featured_addons_tab() {
 
112
  global $mlwQuizMasterNext;
113
+ $mlwQuizMasterNext->pluginHelper->register_addon_settings_tab( __( "Featured Addons", 'quiz-master-next' ), "qsm_generate_featured_addons" );
114
  }
115
+ add_action( "plugins_loaded", 'qsm_featured_addons_tab') ;
116
  ?>
php/class-qmn-quiz-manager.php CHANGED
@@ -37,23 +37,25 @@ class QMNQuizManager {
37
  }
38
 
39
  /**
40
- * Generates Content For Quiz Shortcode
41
- *
42
- * Generates the content for the [mlw_quizmaster] shortcode
43
- *
44
- * @since 4.0.0
45
- * @uses QMNQuizManager:load_questions() Loads questions
46
- * @uses QMNQuizManager:create_answer_array() Prepares answers
47
- * @uses QMNQuizManager:display_quiz() Generates and prepares quiz page
48
- * @uses QMNQuizManager:display_results() Generates and prepares results page
49
- * @return string The content for the shortcode
50
- */
51
  public function display_shortcode( $atts ) {
52
  extract(shortcode_atts(array(
53
  'quiz' => 0,
54
  'question_amount' => 0
55
  ), $atts));
56
 
 
 
57
  global $wpdb;
58
  global $mlwQuizMasterNext;
59
  global $qmn_allowed_visit;
@@ -67,16 +69,14 @@ class QMNQuizManager {
67
  global $mlw_qmn_quiz;
68
  $mlw_qmn_quiz = $quiz;
69
 
70
- if (get_option('timezone_string') != '' && get_option('timezone_string') !== false)
71
- {
72
- date_default_timezone_set(get_option('timezone_string'));
73
  }
74
  $return_display = '';
75
  $qmn_quiz_options = $mlwQuizMasterNext->quiz_settings->get_quiz_options();
76
 
77
  //If quiz options isn't found, stop function
78
- if (is_null($qmn_quiz_options) || $qmn_quiz_options->quiz_name == '')
79
- {
80
  return __("It appears that this quiz is not set up correctly", 'quiz-master-next');
81
  }
82
 
@@ -115,7 +115,7 @@ class QMNQuizManager {
115
  $qmn_array_for_variables['user_ip'] = "Unknown";
116
  }
117
 
118
- echo "<script>
119
  if (window.qmn_quiz_data === undefined) {
120
  window.qmn_quiz_data = new Object();
121
  }
@@ -153,6 +153,7 @@ class QMNQuizManager {
153
  window.qmn_quiz_data["'.$qmn_json_data["quiz_id"].'"] = '.json_encode( $qmn_json_data ).'
154
  </script>';
155
 
 
156
  $return_display = apply_filters('qmn_end_shortcode', $return_display, $qmn_quiz_options, $qmn_array_for_variables);
157
  return $return_display;
158
  }
@@ -266,6 +267,7 @@ class QMNQuizManager {
266
  wp_enqueue_script( 'jquery' );
267
  wp_enqueue_script( 'jquery-ui-core' );
268
  wp_enqueue_script( 'jquery-ui-tooltip' );
 
269
 
270
  global $qmn_json_data;
271
  $qmn_json_data["error_messages"] = array(
37
  }
38
 
39
  /**
40
+ * Generates Content For Quiz Shortcode
41
+ *
42
+ * Generates the content for the [mlw_quizmaster] shortcode
43
+ *
44
+ * @since 4.0.0
45
+ * @uses QMNQuizManager:load_questions() Loads questions
46
+ * @uses QMNQuizManager:create_answer_array() Prepares answers
47
+ * @uses QMNQuizManager:display_quiz() Generates and prepares quiz page
48
+ * @uses QMNQuizManager:display_results() Generates and prepares results page
49
+ * @return string The content for the shortcode
50
+ */
51
  public function display_shortcode( $atts ) {
52
  extract(shortcode_atts(array(
53
  'quiz' => 0,
54
  'question_amount' => 0
55
  ), $atts));
56
 
57
+ ob_start();
58
+
59
  global $wpdb;
60
  global $mlwQuizMasterNext;
61
  global $qmn_allowed_visit;
69
  global $mlw_qmn_quiz;
70
  $mlw_qmn_quiz = $quiz;
71
 
72
+ if ( ! empty( get_option( 'timezone_string' ) ) ) {
73
+ date_default_timezone_set( get_option( 'timezone_string' ) );
 
74
  }
75
  $return_display = '';
76
  $qmn_quiz_options = $mlwQuizMasterNext->quiz_settings->get_quiz_options();
77
 
78
  //If quiz options isn't found, stop function
79
+ if ( is_null( $qmn_quiz_options ) || $qmn_quiz_options->quiz_name == '' ) {
 
80
  return __("It appears that this quiz is not set up correctly", 'quiz-master-next');
81
  }
82
 
115
  $qmn_array_for_variables['user_ip'] = "Unknown";
116
  }
117
 
118
+ $return_display .= "<script>
119
  if (window.qmn_quiz_data === undefined) {
120
  window.qmn_quiz_data = new Object();
121
  }
153
  window.qmn_quiz_data["'.$qmn_json_data["quiz_id"].'"] = '.json_encode( $qmn_json_data ).'
154
  </script>';
155
 
156
+ $return_display .= ob_get_clean();
157
  $return_display = apply_filters('qmn_end_shortcode', $return_display, $qmn_quiz_options, $qmn_array_for_variables);
158
  return $return_display;
159
  }
267
  wp_enqueue_script( 'jquery' );
268
  wp_enqueue_script( 'jquery-ui-core' );
269
  wp_enqueue_script( 'jquery-ui-tooltip' );
270
+ wp_enqueue_style( 'jquery-redmond-theme', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css' );
271
 
272
  global $qmn_json_data;
273
  $qmn_json_data["error_messages"] = array(
readme.txt CHANGED
@@ -1,9 +1,10 @@
1
  === Quiz And Survey Master (Formerly Quiz Master Next) ===
2
  Contributors: fpcorso
3
- Tags: quiz, survey, lead, test, score, exam, questionnaire, answer, question, points
4
  Requires at least: 4.8
5
  Tested up to: 4.9
6
- Stable tag: 5.1.3
 
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -66,6 +67,7 @@ While Quiz And Survey Master is fully functional and is packed full of features
66
 
67
  **Premium Add-ons**
68
 
 
69
  * [Landing Page](https://quizandsurveymaster.com/downloads/landing-page/?utm_source=readme&utm_medium=plugin&utm_content=landing-page&utm_campaign=qsm_plugin)
70
  * [Export Results](https://quizandsurveymaster.com/downloads/export-results/?utm_source=readme&utm_medium=plugin&utm_content=export-results&utm_campaign=qsm_plugin)
71
  * [Reporting & Analysis](https://quizandsurveymaster.com/downloads/results-analysis/?utm_source=readme&utm_medium=plugin&utm_content=reporting-analysis&utm_campaign=qsm_plugin)
@@ -108,6 +110,10 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
108
 
109
  == Changelog ==
110
 
 
 
 
 
111
  = 5.1.3 (November 18, 2017) =
112
  * Closed Bug: MathJax library not loading - ([Issue #590](https://github.com/fpcorso/quiz_master_next/issues/590))
113
  * Closed Bug: Fatal error: Call to a member function register_question_type - ([Issue #509](https://github.com/fpcorso/quiz_master_next/issues/509))
1
  === Quiz And Survey Master (Formerly Quiz Master Next) ===
2
  Contributors: fpcorso
3
+ Tags: quiz, survey, lead, test, score, exam, questionnaire, answer, question
4
  Requires at least: 4.8
5
  Tested up to: 4.9
6
+ Requires PHP: 5.2
7
+ Stable tag: 5.1.4
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
67
 
68
  **Premium Add-ons**
69
 
70
+ * [Google Analytics Tracking](http://bit.ly/2AAgABs)
71
  * [Landing Page](https://quizandsurveymaster.com/downloads/landing-page/?utm_source=readme&utm_medium=plugin&utm_content=landing-page&utm_campaign=qsm_plugin)
72
  * [Export Results](https://quizandsurveymaster.com/downloads/export-results/?utm_source=readme&utm_medium=plugin&utm_content=export-results&utm_campaign=qsm_plugin)
73
  * [Reporting & Analysis](https://quizandsurveymaster.com/downloads/results-analysis/?utm_source=readme&utm_medium=plugin&utm_content=reporting-analysis&utm_campaign=qsm_plugin)
110
 
111
  == Changelog ==
112
 
113
+ = 5.1.4 (November 27, 2017) =
114
+ * Closed Bug: Headers already sent message - ([Issue #596](https://github.com/fpcorso/quiz_master_next/issues/596))
115
+ * Closed Bug: Styling for hints is missing causing them to be hard to read - ([Issue #587](https://github.com/fpcorso/quiz_master_next/issues/587))
116
+
117
  = 5.1.3 (November 18, 2017) =
118
  * Closed Bug: MathJax library not loading - ([Issue #590](https://github.com/fpcorso/quiz_master_next/issues/590))
119
  * Closed Bug: Fatal error: Call to a member function register_question_type - ([Issue #509](https://github.com/fpcorso/quiz_master_next/issues/509))