Version Description
Upgrade for fix for timer and blank pages
Download this release
Release Info
Developer | fpcorso |
Plugin | Quiz And Survey Master (Formerly Quiz Master Next) |
Version | 6.0.2 |
Comparing to | |
See all releases |
Code changes from version 6.0.1 to 6.0.2
- css/qsm-admin.css +16 -0
- js/qmn_quiz.js +20 -4
- mlw_quizmaster2.php +3 -3
- php/admin/about-page.php +1 -0
- php/admin/admin-results-page.php +1 -12
- php/admin/help-page.php +7 -7
- php/admin/options-page-style-tab.php +75 -89
- php/classes/class-qmn-quiz-creator.php +60 -163
- php/classes/class-qmn-quiz-manager.php +16 -14
- php/classes/class-qsm-install.php +1 -1
- readme.txt +9 -1
css/qsm-admin.css
CHANGED
@@ -87,6 +87,22 @@ Options Page
|
|
87 |
font-weight: bold;
|
88 |
}
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
|
92 |
/********************
|
87 |
font-weight: bold;
|
88 |
}
|
89 |
|
90 |
+
/********************
|
91 |
+
Quiz Styles Tab
|
92 |
+
*********************/
|
93 |
+
|
94 |
+
.qsm-styles {
|
95 |
+
display: flex;
|
96 |
+
flex-direction: column;
|
97 |
+
}
|
98 |
+
|
99 |
+
@media screen and (min-width:700px) {
|
100 |
+
.qsm-styles {
|
101 |
+
flex-direction: row;
|
102 |
+
flex-wrap: wrap;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
|
107 |
|
108 |
/********************
|
js/qmn_quiz.js
CHANGED
@@ -3,14 +3,19 @@
|
|
3 |
*************************/
|
4 |
|
5 |
/**************************
|
6 |
-
* This object
|
7 |
* being deprecated and replaced with rewritten newer functions
|
8 |
**************************/
|
9 |
var QSM;
|
10 |
(function ($) {
|
11 |
QSM = {
|
|
|
|
|
|
|
12 |
init: function() {
|
|
|
13 |
if ( typeof qmn_quiz_data != 'undefined' && qmn_quiz_data) {
|
|
|
14 |
_.each( qmn_quiz_data, function( quiz ) {
|
15 |
quizID = parseInt( quiz.quiz_id );
|
16 |
QSM.initPagination( quizID );
|
@@ -27,18 +32,26 @@ var QSM;
|
|
27 |
* @param int quizID The ID of the quiz
|
28 |
*/
|
29 |
initTimer: function( quizID ) {
|
|
|
|
|
30 |
$quizForm = QSM.getQuizForm( quizID );
|
|
|
|
|
31 |
if ( 0 < $quizForm.children( '.qsm-page' ).length ) {
|
|
|
32 |
if ( qmn_quiz_data[quizID].hasOwnProperty('first_page') && qmn_quiz_data[quizID].first_page ) {
|
|
|
33 |
jQuery( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.mlw_next' ).on( 'click', function(event) {
|
34 |
event.preventDefault();
|
35 |
if ( !qmn_timer_activated && qmnValidatePage( 'quizForm' + quizID ) ) {
|
36 |
qmnActivateTimer( quizID );
|
37 |
}
|
38 |
});
|
|
|
39 |
} else {
|
40 |
qmnActivateTimer( quizID );
|
41 |
}
|
|
|
42 |
} else {
|
43 |
if ( qmn_quiz_data[quizID].hasOwnProperty('pagination') && qmn_quiz_data[quizID].first_page ) {
|
44 |
jQuery( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.mlw_next' ).on( 'click', function(event) {
|
@@ -182,6 +195,11 @@ var QSM;
|
|
182 |
|
183 |
// On load code
|
184 |
$(function() {
|
|
|
|
|
|
|
|
|
|
|
185 |
QSM.init();
|
186 |
});
|
187 |
}(jQuery));
|
@@ -643,9 +661,7 @@ function qmnSocialShare( network, mlw_qmn_social_text, mlw_qmn_title, facebook_i
|
|
643 |
return false;
|
644 |
}
|
645 |
|
646 |
-
jQuery(function() {
|
647 |
-
qmnInit();
|
648 |
-
|
649 |
jQuery( '.qmn_quiz_container' ).tooltip();
|
650 |
|
651 |
jQuery( '.qmn_quiz_container input' ).on( 'keypress', function ( e ) {
|
3 |
*************************/
|
4 |
|
5 |
/**************************
|
6 |
+
* This object contains the newer functions. All global functions under are slowly
|
7 |
* being deprecated and replaced with rewritten newer functions
|
8 |
**************************/
|
9 |
var QSM;
|
10 |
(function ($) {
|
11 |
QSM = {
|
12 |
+
/**
|
13 |
+
* Initializes all quizzes or surveys on the page
|
14 |
+
*/
|
15 |
init: function() {
|
16 |
+
// Makes sure we have quizzes on this page
|
17 |
if ( typeof qmn_quiz_data != 'undefined' && qmn_quiz_data) {
|
18 |
+
// Cycle through all quizzes
|
19 |
_.each( qmn_quiz_data, function( quiz ) {
|
20 |
quizID = parseInt( quiz.quiz_id );
|
21 |
QSM.initPagination( quizID );
|
32 |
* @param int quizID The ID of the quiz
|
33 |
*/
|
34 |
initTimer: function( quizID ) {
|
35 |
+
|
36 |
+
// Gets our form
|
37 |
$quizForm = QSM.getQuizForm( quizID );
|
38 |
+
|
39 |
+
// If we are using the newer pagination system...
|
40 |
if ( 0 < $quizForm.children( '.qsm-page' ).length ) {
|
41 |
+
// If there is a first page...
|
42 |
if ( qmn_quiz_data[quizID].hasOwnProperty('first_page') && qmn_quiz_data[quizID].first_page ) {
|
43 |
+
// ... attach an event handler to the click event to activate the timer.
|
44 |
jQuery( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.mlw_next' ).on( 'click', function(event) {
|
45 |
event.preventDefault();
|
46 |
if ( !qmn_timer_activated && qmnValidatePage( 'quizForm' + quizID ) ) {
|
47 |
qmnActivateTimer( quizID );
|
48 |
}
|
49 |
});
|
50 |
+
// ...else, activate the timer on page load.
|
51 |
} else {
|
52 |
qmnActivateTimer( quizID );
|
53 |
}
|
54 |
+
// ...else, we must be using the questions per page option.
|
55 |
} else {
|
56 |
if ( qmn_quiz_data[quizID].hasOwnProperty('pagination') && qmn_quiz_data[quizID].first_page ) {
|
57 |
jQuery( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.mlw_next' ).on( 'click', function(event) {
|
195 |
|
196 |
// On load code
|
197 |
$(function() {
|
198 |
+
|
199 |
+
// Legacy init.
|
200 |
+
qmnInit();
|
201 |
+
|
202 |
+
// Call main initialization.
|
203 |
QSM.init();
|
204 |
});
|
205 |
}(jQuery));
|
661 |
return false;
|
662 |
}
|
663 |
|
664 |
+
jQuery(function() {
|
|
|
|
|
665 |
jQuery( '.qmn_quiz_container' ).tooltip();
|
666 |
|
667 |
jQuery( '.qmn_quiz_container input' ).on( 'keypress', function ( e ) {
|
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.0.
|
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 6.0.
|
13 |
* @package QSM
|
14 |
*/
|
15 |
|
@@ -33,7 +33,7 @@ class MLWQuizMasterNext {
|
|
33 |
* @var string
|
34 |
* @since 4.0.0
|
35 |
*/
|
36 |
-
public $version = '6.0.
|
37 |
|
38 |
/**
|
39 |
* 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.0.2
|
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 6.0.2
|
13 |
* @package QSM
|
14 |
*/
|
15 |
|
33 |
* @var string
|
34 |
* @since 4.0.0
|
35 |
*/
|
36 |
+
public $version = '6.0.2';
|
37 |
|
38 |
/**
|
39 |
* QSM Alert Manager Object
|
php/admin/about-page.php
CHANGED
@@ -46,6 +46,7 @@ function mlw_generate_about_page() {
|
|
46 |
</div>
|
47 |
<div class="qsm-tab-content tab-2" style="display: none;">
|
48 |
<h2>Changelog</h2>
|
|
|
49 |
<?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 53 ); ?>
|
50 |
<?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 36 ); ?>
|
51 |
</div>
|
46 |
</div>
|
47 |
<div class="qsm-tab-content tab-2" style="display: none;">
|
48 |
<h2>Changelog</h2>
|
49 |
+
<?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 54 ); ?>
|
50 |
<?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 53 ); ?>
|
51 |
<?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 36 ); ?>
|
52 |
</div>
|
php/admin/admin-results-page.php
CHANGED
@@ -188,25 +188,14 @@ function qsm_results_overview_tab_content() {
|
|
188 |
wp_enqueue_script( 'jquery-ui-core' );
|
189 |
wp_enqueue_script( 'jquery-ui-dialog' );
|
190 |
wp_enqueue_script( 'jquery-ui-button' );
|
191 |
-
wp_enqueue_script( '
|
192 |
-
wp_enqueue_script( 'jquery-effects-explode' );
|
193 |
-
wp_enqueue_script('qmn_admin_js', plugins_url( '../../js/admin.js' , __FILE__ ));
|
194 |
wp_enqueue_style( 'qmn_jquery_redmond_theme', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css' );
|
195 |
?>
|
196 |
<script type="text/javascript">
|
197 |
var $j = jQuery.noConflict();
|
198 |
-
// increase the default animation speed to exaggerate the effect
|
199 |
-
$j.fx.speeds._default = 1000;
|
200 |
-
|
201 |
-
$j(function() {
|
202 |
-
$j("button, #prev_page, #next_page").button();
|
203 |
-
|
204 |
-
});
|
205 |
function deleteResults(id,quizName){
|
206 |
$j("#delete_dialog").dialog({
|
207 |
autoOpen: false,
|
208 |
-
show: 'blind',
|
209 |
-
hide: 'explode',
|
210 |
buttons: {
|
211 |
Cancel: function() {
|
212 |
$j(this).dialog('close');
|
188 |
wp_enqueue_script( 'jquery-ui-core' );
|
189 |
wp_enqueue_script( 'jquery-ui-dialog' );
|
190 |
wp_enqueue_script( 'jquery-ui-button' );
|
191 |
+
wp_enqueue_script( 'qmn_admin_js', plugins_url( '../../js/admin.js', __FILE__ ) );
|
|
|
|
|
192 |
wp_enqueue_style( 'qmn_jquery_redmond_theme', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css' );
|
193 |
?>
|
194 |
<script type="text/javascript">
|
195 |
var $j = jQuery.noConflict();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
function deleteResults(id,quizName){
|
197 |
$j("#delete_dialog").dialog({
|
198 |
autoOpen: false,
|
|
|
|
|
199 |
buttons: {
|
200 |
Cancel: function() {
|
201 |
$j(this).dialog('close');
|
php/admin/help-page.php
CHANGED
@@ -105,13 +105,13 @@ function qsm_get_system_info() {
|
|
105 |
|
106 |
$sys_info .= "<h3>Plugins Information</h3><br />";
|
107 |
$plugin_mu = get_mu_plugins();
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
$plugins = get_plugins();
|
116 |
$active_plugins = get_option( 'active_plugins', array() );
|
117 |
foreach( $plugins as $plugin_path => $plugin ) {
|
105 |
|
106 |
$sys_info .= "<h3>Plugins Information</h3><br />";
|
107 |
$plugin_mu = get_mu_plugins();
|
108 |
+
if ( count( $plugin_mu ) > 0 ) {
|
109 |
+
$sys_info .= "<h4>Must Use</h4><br />";
|
110 |
+
foreach ( $plugin_mu as $plugin => $plugin_data ) {
|
111 |
+
$sys_info .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "<br />";
|
112 |
+
}
|
113 |
+
}
|
114 |
+
$sys_info .= "<h4>Active</h4><br />";
|
115 |
$plugins = get_plugins();
|
116 |
$active_plugins = get_option( 'active_plugins', array() );
|
117 |
foreach( $plugins as $plugin_path => $plugin ) {
|
php/admin/options-page-style-tab.php
CHANGED
@@ -1,52 +1,57 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
/**
|
5 |
-
* Adds the Style tab to the Quiz Settings page.
|
6 |
-
*
|
7 |
-
* @return void
|
8 |
-
* @since
|
9 |
-
*/
|
10 |
-
function
|
11 |
-
{
|
12 |
global $mlwQuizMasterNext;
|
13 |
-
$mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__(
|
14 |
}
|
15 |
-
add_action(
|
16 |
|
17 |
/**
|
18 |
-
* Adds the Style tab content to the tab.
|
19 |
-
*
|
20 |
-
* @return void
|
21 |
-
* @since
|
22 |
-
*/
|
23 |
-
function
|
24 |
-
{
|
25 |
global $wpdb;
|
26 |
global $mlwQuizMasterNext;
|
27 |
-
$quiz_id = $_GET["quiz_id"];
|
28 |
-
if (isset($_POST["save_style_options"]) && $_POST["save_style_options"] == "confirmation")
|
29 |
-
{
|
30 |
-
//Function Variables
|
31 |
-
$mlw_qmn_style_id = intval( $_POST["style_quiz_id"] );
|
32 |
-
$mlw_qmn_theme = sanitize_text_field( $_POST["save_quiz_theme"] );
|
33 |
-
$mlw_qmn_style = htmlspecialchars( stripslashes( $_POST["quiz_css"] ), ENT_QUOTES );
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
} else {
|
41 |
-
$mlwQuizMasterNext->alertManager->newAlert(
|
42 |
-
$mlwQuizMasterNext->log_manager->add(
|
43 |
}
|
44 |
}
|
45 |
|
46 |
-
if (isset($_GET[
|
47 |
-
|
48 |
-
$
|
49 |
-
$mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"]));
|
50 |
}
|
51 |
$registered_templates = $mlwQuizMasterNext->pluginHelper->get_quiz_templates();
|
52 |
?>
|
@@ -60,60 +65,41 @@ function mlw_options_styling_tab_content()
|
|
60 |
|
61 |
}
|
62 |
</script>
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
?>
|
99 |
-
<div onclick="mlw_qmn_theme('default');" id="mlw_qmn_theme_block_default" class="mlw_qmn_themeBlock <?php if ($mlw_quiz_options->theme_selected == 'default') {echo 'mlw_qmn_themeBlockActive';} ?>"><?php _e('Custom', 'quiz-master-next'); ?></div>
|
100 |
-
<script>
|
101 |
-
mlw_qmn_theme('<?php echo $mlw_quiz_options->theme_selected; ?>');
|
102 |
-
</script>
|
103 |
-
<br /><br />
|
104 |
-
<button id="save_styles_button" class="button-primary" onclick="javascript: document.quiz_style_form.submit();"><?php _e('Save Quiz Style', 'quiz-master-next'); ?></button>
|
105 |
-
<hr />
|
106 |
-
<h3><?php _e('Custom Style CSS', 'quiz-master-next'); ?></h3>
|
107 |
-
<p><?php _e('For detailed help and guidance along with a list of different classes used in this plugin, please visit the following link:', 'quiz-master-next'); ?>
|
108 |
-
<a target="_blank" href="http://quizmasternext.com/quiz-master-next-editing-quizs-style/">Style Guide</a></p>
|
109 |
-
<button id="save_styles_button" class="button-primary" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
|
110 |
-
|
111 |
-
<table class="form-table">
|
112 |
-
<tr>
|
113 |
-
<td><textarea style="width: 100%; height: 700px;" id="quiz_css" name="quiz_css"><?php echo $mlw_quiz_options->quiz_stye; ?></textarea></td>
|
114 |
-
</tr>
|
115 |
-
</table>
|
116 |
-
<button id="save_styles_button" class="button-primary" onclick="javascript: document.quiz_style_form.submit();"><?php _e('Save Quiz Style', 'quiz-master-next'); ?></button>
|
117 |
</form>
|
118 |
</div>
|
119 |
<?php
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Handles the functions/views for the "Style" tab when editing a quiz or survey
|
4 |
+
*/
|
5 |
+
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
|
10 |
/**
|
11 |
+
* Adds the Style tab to the Quiz Settings page.
|
12 |
+
*
|
13 |
+
* @return void
|
14 |
+
* @since 6.0.2
|
15 |
+
*/
|
16 |
+
function qsm_settings_style_tab() {
|
|
|
17 |
global $mlwQuizMasterNext;
|
18 |
+
$mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs( __( 'Style', 'quiz-master-next' ), 'qsm_options_styling_tab_content' );
|
19 |
}
|
20 |
+
add_action( 'plugins_loaded', 'qsm_settings_style_tab', 5 );
|
21 |
|
22 |
/**
|
23 |
+
* Adds the Style tab content to the tab.
|
24 |
+
*
|
25 |
+
* @return void
|
26 |
+
* @since 6.0.2
|
27 |
+
*/
|
28 |
+
function qsm_options_styling_tab_content() {
|
|
|
29 |
global $wpdb;
|
30 |
global $mlwQuizMasterNext;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
+
wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ), array(), $mlwQuizMasterNext->version );
|
33 |
+
|
34 |
+
$quiz_id = intval( $_GET['quiz_id'] );
|
35 |
+
if ( isset( $_POST['save_style_options'] ) && 'confirmation' == $_POST['save_style_options'] ) {
|
36 |
+
|
37 |
+
$style_quiz_id = intval( $_POST['style_quiz_id'] );
|
38 |
+
$quiz_theme = sanitize_text_field( $_POST['save_quiz_theme'] );
|
39 |
+
$quiz_style = htmlspecialchars( stripslashes( $_POST['quiz_css'] ), ENT_QUOTES );
|
40 |
+
|
41 |
+
// Saves the new css.
|
42 |
+
$results = $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}mlw_quizzes SET quiz_stye='%s', theme_selected='%s', last_activity='" . date( 'Y-m-d H:i:s' ) . "' WHERE quiz_id=%d", $quiz_style, $quiz_theme, $style_quiz_id ) );
|
43 |
+
if ( false !== $results ) {
|
44 |
+
$mlwQuizMasterNext->alertManager->newAlert( __( 'The style has been saved successfully.', 'quiz-master-next' ), 'success' );
|
45 |
+
$mlwQuizMasterNext->audit_manager->new_audit( "Styles Have Been Saved For Quiz Number $style_quiz_id" );
|
46 |
} else {
|
47 |
+
$mlwQuizMasterNext->alertManager->newAlert( __( 'Error occured when trying to save the styles. Please try again.', 'quiz-master-next' ), 'error' );
|
48 |
+
$mlwQuizMasterNext->log_manager->add( 'Error saving styles', $wpdb->last_error . ' from ' . $wpdb->last_query, 0, 'error' );
|
49 |
}
|
50 |
}
|
51 |
|
52 |
+
if ( isset( $_GET['quiz_id'] ) ) {
|
53 |
+
$table_name = $wpdb->prefix . 'mlw_quizzes';
|
54 |
+
$mlw_quiz_options = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $quiz_id ) );
|
|
|
55 |
}
|
56 |
$registered_templates = $mlwQuizMasterNext->pluginHelper->get_quiz_templates();
|
57 |
?>
|
65 |
|
66 |
}
|
67 |
</script>
|
68 |
+
<form action='' method='post' name='quiz_style_form'>
|
69 |
+
<input type='hidden' name='save_style_options' value='confirmation' />
|
70 |
+
<input type='hidden' name='style_quiz_id' value='<?php echo esc_attr( $quiz_id ); ?>' />
|
71 |
+
<input type='hidden' name='save_quiz_theme' id='save_quiz_theme' value='<?php echo esc_attr( $mlw_quiz_options->theme_selected ); ?>' />
|
72 |
+
<h3><?php _e( 'Quiz Styles', 'quiz-master-next' ); ?></h3>
|
73 |
+
<p><?php _e( 'Choose your style:', 'quiz-master-next' ); ?></p>
|
74 |
+
<style>
|
75 |
+
div.mlw_qmn_themeBlockActive {
|
76 |
+
background-color: yellow;
|
77 |
+
}
|
78 |
+
</style>
|
79 |
+
<div class="qsm-styles">
|
80 |
+
<?php
|
81 |
+
foreach ( $registered_templates as $slug => $template ) {
|
82 |
+
?>
|
83 |
+
<div onclick="mlw_qmn_theme('<?php echo $slug; ?>');" id="mlw_qmn_theme_block_<?php echo $slug; ?>" class="qsm-info-widget <?php if ($mlw_quiz_options->theme_selected == $slug) {echo 'mlw_qmn_themeBlockActive';} ?>"><?php echo $template["name"]; ?></div>
|
84 |
+
<?php
|
85 |
+
}
|
86 |
+
?>
|
87 |
+
<div onclick="mlw_qmn_theme('default');" id="mlw_qmn_theme_block_default" class="qsm-info-widget <?php if ($mlw_quiz_options->theme_selected == 'default') {echo 'mlw_qmn_themeBlockActive';} ?>"><?php _e('Custom', 'quiz-master-next'); ?></div>
|
88 |
+
<script>
|
89 |
+
mlw_qmn_theme('<?php echo $mlw_quiz_options->theme_selected; ?>');
|
90 |
+
</script>
|
91 |
+
</div>
|
92 |
+
<button id="save_styles_button" class="button-primary"><?php _e('Save Quiz Style', 'quiz-master-next'); ?></button>
|
93 |
+
<hr />
|
94 |
+
<h3><?php _e('Custom Style CSS', 'quiz-master-next'); ?></h3>
|
95 |
+
<p><?php _e('For detailed help and guidance along with a list of different classes used in this plugin, please visit the following link:', 'quiz-master-next'); ?>
|
96 |
+
<a target="_blank" href="http://bit.ly/2JDHwA6">Style Guide</a></p>
|
97 |
+
<table class="form-table">
|
98 |
+
<tr>
|
99 |
+
<td><textarea style="width: 100%; height: 700px;" id="quiz_css" name="quiz_css"><?php echo $mlw_quiz_options->quiz_stye; ?></textarea></td>
|
100 |
+
</tr>
|
101 |
+
</table>
|
102 |
+
<button id="save_styles_button" class="button-primary"><?php _e('Save Quiz Style', 'quiz-master-next'); ?></button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
</form>
|
104 |
</div>
|
105 |
<?php
|
php/classes/class-qmn-quiz-creator.php
CHANGED
@@ -165,167 +165,67 @@ class QMNQuizCreator
|
|
165 |
*
|
166 |
* @access public
|
167 |
* @since 3.7.1
|
|
|
168 |
* @return void
|
169 |
*/
|
170 |
-
public function create_quiz($quiz_name)
|
171 |
-
{
|
172 |
global $mlwQuizMasterNext;
|
173 |
global $wpdb;
|
174 |
-
$mlw_leaderboard_default = "<h3>Leaderboard for %QUIZ_NAME%</h3>
|
175 |
-
1. %FIRST_PLACE_NAME%-%FIRST_PLACE_SCORE%<br />
|
176 |
-
2. %SECOND_PLACE_NAME%-%SECOND_PLACE_SCORE%<br />
|
177 |
-
3. %THIRD_PLACE_NAME%-%THIRD_PLACE_SCORE%<br />
|
178 |
-
4. %FOURTH_PLACE_NAME%-%FOURTH_PLACE_SCORE%<br />
|
179 |
-
5. %FIFTH_PLACE_NAME%-%FIFTH_PLACE_SCORE%<br />";
|
180 |
-
$mlw_style_default = ".mlw_qmn_quiz label {
|
181 |
-
display: inline;
|
182 |
-
}
|
183 |
-
.ui-tooltip
|
184 |
-
{
|
185 |
-
max-width: 500px !important;
|
186 |
-
}
|
187 |
-
.ui-tooltip-content
|
188 |
-
{
|
189 |
-
max-width: 500px !important;
|
190 |
-
}
|
191 |
-
.qmn_error, .qmn_page_error_message
|
192 |
-
{
|
193 |
-
color: red;
|
194 |
-
}
|
195 |
-
.mlw_qmn_hint_link
|
196 |
-
{
|
197 |
-
text-decoration:underline;
|
198 |
-
color:rgb(0,0,255);
|
199 |
-
}
|
200 |
-
.mlw_qmn_quiz_link
|
201 |
-
{
|
202 |
-
display: inline;
|
203 |
-
vertical-align:top !important;
|
204 |
-
text-decoration: none;
|
205 |
-
}
|
206 |
-
div.mlw_qmn_quiz input[type=radio],
|
207 |
-
div.mlw_qmn_quiz input[type=submit],
|
208 |
-
div.mlw_qmn_quiz label {
|
209 |
-
cursor: pointer;
|
210 |
-
}
|
211 |
-
div.mlw_qmn_quiz input:not([type=submit]):focus,
|
212 |
-
div.mlw_qmn_quiz textarea:focus {
|
213 |
-
background: #eaeaea;
|
214 |
-
}
|
215 |
-
div.mlw_qmn_quiz {
|
216 |
-
text-align: left;
|
217 |
-
}
|
218 |
-
div.quiz_section {
|
219 |
-
|
220 |
-
}
|
221 |
-
.mlw_horizontal_choice
|
222 |
-
{
|
223 |
-
margin-right: 20px;
|
224 |
-
}
|
225 |
-
div.mlw_qmn_timer {
|
226 |
-
position:fixed;
|
227 |
-
top:200px;
|
228 |
-
right:0px;
|
229 |
-
width:130px;
|
230 |
-
color:#00CCFF;
|
231 |
-
border-radius: 15px;
|
232 |
-
background:#000000;
|
233 |
-
text-align: center;
|
234 |
-
padding: 15px 15px 15px 15px
|
235 |
-
}
|
236 |
-
div.mlw_qmn_quiz input[type=submit],
|
237 |
-
a.mlw_qmn_quiz_link
|
238 |
-
{
|
239 |
-
border-radius: 4px;
|
240 |
-
position: relative;
|
241 |
-
background-image: linear-gradient(#fff,#dedede);
|
242 |
-
background-color: #eee;
|
243 |
-
border: #ccc solid 1px;
|
244 |
-
color: #333;
|
245 |
-
text-shadow: 0 1px 0 rgba(255,255,255,.5);
|
246 |
-
box-sizing: border-box;
|
247 |
-
display: inline-block;
|
248 |
-
padding: 7px 7px 7px 7px;
|
249 |
-
margin: auto;
|
250 |
-
font-weight: bold;
|
251 |
-
cursor: pointer;
|
252 |
-
}
|
253 |
-
.mlw_qmn_question, .mlw_qmn_question_number, .mlw_qmn_comment_section_text
|
254 |
-
{
|
255 |
-
font-weight: bold;
|
256 |
-
}
|
257 |
-
.mlw_next
|
258 |
-
{
|
259 |
-
float: right;
|
260 |
-
}
|
261 |
-
.mlw_previous
|
262 |
-
{
|
263 |
-
float: left;
|
264 |
-
}
|
265 |
-
.mlw_qmn_question_comment, .mlw_answer_open_text, .qmn_comment_section {
|
266 |
-
width: 100%;
|
267 |
-
border-radius: 7px;
|
268 |
-
padding: 2px 10px;
|
269 |
-
-webkit-box-shadow: inset 0 3px 3px rgba(0,0,0,.075);
|
270 |
-
box-shadow: inset 0 3px 3px rgba(0,0,0,.075);
|
271 |
-
border: 1px solid #ccc;
|
272 |
-
}
|
273 |
-
";
|
274 |
$results = $wpdb->insert(
|
275 |
-
$wpdb->prefix .
|
276 |
array(
|
277 |
-
'quiz_name'
|
278 |
-
'message_before'
|
279 |
-
'message_after'
|
280 |
-
'message_comment'
|
281 |
-
'message_end_template'
|
282 |
-
'user_email_template'
|
283 |
-
'admin_email_template'
|
284 |
-
'submit_button_text'
|
285 |
-
'name_field_text'
|
286 |
-
'business_field_text'
|
287 |
-
'email_field_text'
|
288 |
-
'phone_field_text'
|
289 |
-
'comment_field_text'
|
290 |
-
'email_from_text'
|
291 |
'question_answer_template' => '%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />',
|
292 |
-
'leaderboard_template'
|
293 |
-
'system'
|
294 |
-
'randomness_order'
|
295 |
-
'loggedin_user_contact'
|
296 |
-
'show_score'
|
297 |
-
'send_user_email'
|
298 |
-
'send_admin_email'
|
299 |
-
'contact_info_location'
|
300 |
-
'user_name'
|
301 |
-
'user_comp'
|
302 |
-
'user_email'
|
303 |
-
'user_phone'
|
304 |
-
'admin_email'
|
305 |
-
'comment_section'
|
306 |
-
'question_from_total'
|
307 |
-
'total_user_tries'
|
308 |
-
'total_user_tries_text'
|
309 |
-
'certificate_template'
|
310 |
-
'social_media'
|
311 |
-
'social_media_text'
|
312 |
-
'pagination'
|
313 |
-
'pagination_text'
|
314 |
-
'timer_limit'
|
315 |
-
'quiz_stye'
|
316 |
-
'question_numbering'
|
317 |
-
'quiz_settings'
|
318 |
-
'theme_selected'
|
319 |
-
'last_activity'
|
320 |
-
'require_log_in'
|
321 |
-
'require_log_in_text'
|
322 |
-
'limit_total_entries'
|
323 |
'limit_total_entries_text' => 'Unfortunately, this quiz has a limited amount of entries it can recieve and has already reached that limit.',
|
324 |
-
'scheduled_timeframe'
|
325 |
'scheduled_timeframe_text' => '',
|
326 |
-
'quiz_views'
|
327 |
-
'quiz_taken'
|
328 |
-
'deleted'
|
329 |
),
|
330 |
array(
|
331 |
'%s',
|
@@ -379,19 +279,18 @@ class QMNQuizCreator
|
|
379 |
'%s',
|
380 |
'%d',
|
381 |
'%d',
|
382 |
-
'%d'
|
383 |
)
|
384 |
);
|
385 |
-
if ($results
|
386 |
-
{
|
387 |
$new_quiz = $wpdb->insert_id;
|
388 |
$current_user = wp_get_current_user();
|
389 |
$quiz_post = array(
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
);
|
396 |
$quiz_post_id = wp_insert_post( $quiz_post );
|
397 |
add_post_meta( $quiz_post_id, 'quiz_id', $new_quiz );
|
@@ -401,9 +300,7 @@ class QMNQuizCreator
|
|
401 |
|
402 |
// Hook called after new quiz or survey has been created. Passes quiz_id to hook
|
403 |
do_action('qmn_quiz_created', $new_quiz);
|
404 |
-
}
|
405 |
-
else
|
406 |
-
{
|
407 |
$mlwQuizMasterNext->alertManager->newAlert(sprintf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0001'), 'error');
|
408 |
$mlwQuizMasterNext->log_manager->add("Error 0001", $wpdb->last_error.' from '.$wpdb->last_query, 0, 'error');
|
409 |
}
|
165 |
*
|
166 |
* @access public
|
167 |
* @since 3.7.1
|
168 |
+
* @param string $quiz_name The name of the new quiz.
|
169 |
* @return void
|
170 |
*/
|
171 |
+
public function create_quiz( $quiz_name ) {
|
|
|
172 |
global $mlwQuizMasterNext;
|
173 |
global $wpdb;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
$results = $wpdb->insert(
|
175 |
+
$wpdb->prefix . 'mlw_quizzes',
|
176 |
array(
|
177 |
+
'quiz_name' => $quiz_name,
|
178 |
+
'message_before' => 'Welcome to your %QUIZ_NAME%',
|
179 |
+
'message_after' => 'Thanks for submitting your response! You can edit this message on the "Results Pages" tab. <br>%CONTACT_ALL% <br>%QUESTIONS_ANSWERS%',
|
180 |
+
'message_comment' => 'Please fill in the comment box below.',
|
181 |
+
'message_end_template' => '',
|
182 |
+
'user_email_template' => '%QUESTIONS_ANSWERS%',
|
183 |
+
'admin_email_template' => '%QUESTIONS_ANSWERS%',
|
184 |
+
'submit_button_text' => 'Submit',
|
185 |
+
'name_field_text' => 'Name',
|
186 |
+
'business_field_text' => 'Business',
|
187 |
+
'email_field_text' => 'Email',
|
188 |
+
'phone_field_text' => 'Phone Number',
|
189 |
+
'comment_field_text' => 'Comments',
|
190 |
+
'email_from_text' => 'Wordpress',
|
191 |
'question_answer_template' => '%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />',
|
192 |
+
'leaderboard_template' => '',
|
193 |
+
'system' => 0,
|
194 |
+
'randomness_order' => 0,
|
195 |
+
'loggedin_user_contact' => 0,
|
196 |
+
'show_score' => 0,
|
197 |
+
'send_user_email' => 0,
|
198 |
+
'send_admin_email' => 0,
|
199 |
+
'contact_info_location' => 0,
|
200 |
+
'user_name' => 2,
|
201 |
+
'user_comp' => 2,
|
202 |
+
'user_email' => 2,
|
203 |
+
'user_phone' => 2,
|
204 |
+
'admin_email' => get_option( 'admin_email', 'Enter email' ),
|
205 |
+
'comment_section' => 1,
|
206 |
+
'question_from_total' => 0,
|
207 |
+
'total_user_tries' => 0,
|
208 |
+
'total_user_tries_text' => 'You are only allowed 1 try and have already submitted your quiz.',
|
209 |
+
'certificate_template' => '',
|
210 |
+
'social_media' => 0,
|
211 |
+
'social_media_text' => 'I just scored %CORRECT_SCORE%% on %QUIZ_NAME%!',
|
212 |
+
'pagination' => 0,
|
213 |
+
'pagination_text' => 'Next',
|
214 |
+
'timer_limit' => 0,
|
215 |
+
'quiz_stye' => '',
|
216 |
+
'question_numbering' => 0,
|
217 |
+
'quiz_settings' => '',
|
218 |
+
'theme_selected' => 'primary',
|
219 |
+
'last_activity' => current_time( 'mysql' ),
|
220 |
+
'require_log_in' => 0,
|
221 |
+
'require_log_in_text' => 'This quiz is for logged in users only.',
|
222 |
+
'limit_total_entries' => 0,
|
223 |
'limit_total_entries_text' => 'Unfortunately, this quiz has a limited amount of entries it can recieve and has already reached that limit.',
|
224 |
+
'scheduled_timeframe' => '',
|
225 |
'scheduled_timeframe_text' => '',
|
226 |
+
'quiz_views' => 0,
|
227 |
+
'quiz_taken' => 0,
|
228 |
+
'deleted' => 0,
|
229 |
),
|
230 |
array(
|
231 |
'%s',
|
279 |
'%s',
|
280 |
'%d',
|
281 |
'%d',
|
282 |
+
'%d',
|
283 |
)
|
284 |
);
|
285 |
+
if ( false !== $results ) {
|
|
|
286 |
$new_quiz = $wpdb->insert_id;
|
287 |
$current_user = wp_get_current_user();
|
288 |
$quiz_post = array(
|
289 |
+
'post_title' => $quiz_name,
|
290 |
+
'post_content' => "[mlw_quizmaster quiz=$new_quiz]",
|
291 |
+
'post_status' => 'publish',
|
292 |
+
'post_author' => $current_user->ID,
|
293 |
+
'post_type' => 'quiz',
|
294 |
);
|
295 |
$quiz_post_id = wp_insert_post( $quiz_post );
|
296 |
add_post_meta( $quiz_post_id, 'quiz_id', $new_quiz );
|
300 |
|
301 |
// Hook called after new quiz or survey has been created. Passes quiz_id to hook
|
302 |
do_action('qmn_quiz_created', $new_quiz);
|
303 |
+
} else {
|
|
|
|
|
304 |
$mlwQuizMasterNext->alertManager->newAlert(sprintf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0001'), 'error');
|
305 |
$mlwQuizMasterNext->log_manager->add("Error 0001", $wpdb->last_error.' from '.$wpdb->last_query, 0, 'error');
|
306 |
}
|
php/classes/class-qmn-quiz-manager.php
CHANGED
@@ -308,7 +308,7 @@ class QMNQuizManager {
|
|
308 |
global $mlw_qmn_section_count;
|
309 |
$mlw_qmn_section_count = 0;
|
310 |
|
311 |
-
$quiz_display .= "<div class='qmn_quiz_container mlw_qmn_quiz'>";
|
312 |
$quiz_display .= "<form name='quizForm{$quiz_data['quiz_id']}' id='quizForm{$quiz_data['quiz_id']}' action='' method='post' class='qsm-quiz-form qmn_quiz_form mlw_quiz_form' novalidate >";
|
313 |
$quiz_display .= "<div name='mlw_error_message' id='mlw_error_message' class='qsm-error-message qmn_error_message_section'></div>";
|
314 |
$quiz_display .= "<span id='mlw_top_of_quiz'></span>";
|
@@ -331,7 +331,7 @@ class QMNQuizManager {
|
|
331 |
$quiz_display .= $this->display_end_section( $options, $quiz_data );
|
332 |
}
|
333 |
|
334 |
-
$quiz_display .= "<div name='mlw_error_message_bottom' id='mlw_error_message_bottom' class='qmn_error_message_section'></div>";
|
335 |
$quiz_display .= "<input type='hidden' name='total_questions' id='total_questions' value='$qmn_total_questions'/>";
|
336 |
$quiz_display .= "<input type='hidden' name='timer' id='timer' value='0'/>";
|
337 |
$quiz_display .= "<input type='hidden' class='qmn_quiz_id' name='qmn_quiz_id' id='qmn_quiz_id' value='{$quiz_data['quiz_id']}'/>";
|
@@ -359,7 +359,8 @@ class QMNQuizManager {
|
|
359 |
$pages = $mlwQuizMasterNext->pluginHelper->get_quiz_setting( 'pages', array() );
|
360 |
$questions = QSM_Questions::load_questions_by_pages( $options->quiz_id );
|
361 |
$question_list = '';
|
362 |
-
|
|
|
363 |
$qmn_json_data['first_page'] = true;
|
364 |
$message_before = wpautop( htmlspecialchars_decode( $options->message_before, ENT_QUOTES ) );
|
365 |
$message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_before, $quiz_data );
|
@@ -382,7 +383,7 @@ class QMNQuizManager {
|
|
382 |
?>
|
383 |
<section class="qsm-page">
|
384 |
<?php
|
385 |
-
if ( ! empty( $options->message_before ) || 0 == $options->contact_info_location ) {
|
386 |
$qmn_json_data['first_page'] = false;
|
387 |
$message_before = wpautop( htmlspecialchars_decode( $options->message_before, ENT_QUOTES ) );
|
388 |
$message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_before, $quiz_data );
|
@@ -428,7 +429,7 @@ class QMNQuizManager {
|
|
428 |
</div>
|
429 |
<?php
|
430 |
}
|
431 |
-
if ( ! empty( $options->message_end_template ) || 1 == $options->contact_info_location ) {
|
432 |
$message_after = wpautop( htmlspecialchars_decode( $options->message_end_template, ENT_QUOTES ) );
|
433 |
$message_after = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_after, $quiz_data );
|
434 |
?>
|
@@ -489,7 +490,7 @@ class QMNQuizManager {
|
|
489 |
</section>
|
490 |
<?php
|
491 |
}
|
492 |
-
if ( count( $pages ) > 1 && ( ! empty( $options->message_end_template ) || 1 == $options->contact_info_location ) ) {
|
493 |
$message_after = wpautop( htmlspecialchars_decode( $options->message_end_template, ENT_QUOTES ) );
|
494 |
$message_after = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_after, $quiz_data );
|
495 |
?>
|
@@ -540,7 +541,8 @@ class QMNQuizManager {
|
|
540 |
public function display_begin_section( $qmn_quiz_options, $qmn_array_for_variables ) {
|
541 |
$section_display = '';
|
542 |
global $qmn_json_data;
|
543 |
-
|
|
|
544 |
$qmn_json_data["first_page"] = true;
|
545 |
global $mlw_qmn_section_count;
|
546 |
$mlw_qmn_section_count +=1;
|
@@ -646,26 +648,26 @@ class QMNQuizManager {
|
|
646 |
public function display_end_section( $qmn_quiz_options, $qmn_array_for_variables ) {
|
647 |
global $mlw_qmn_section_count;
|
648 |
$section_display = '';
|
649 |
-
$section_display .=
|
650 |
$mlw_qmn_section_count = $mlw_qmn_section_count + 1;
|
651 |
$section_display .= "<div class='quiz_section slide$mlw_qmn_section_count quiz_end'>";
|
652 |
-
if (! empty( $qmn_quiz_options->message_end_template ) ) {
|
653 |
-
$message_end = wpautop( htmlspecialchars_decode( $qmn_quiz_options->message_end_template, ENT_QUOTES));
|
654 |
-
$message_end = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_end, $qmn_array_for_variables);
|
655 |
$section_display .= "<span class='mlw_qmn_message_end'>$message_end</span>";
|
656 |
-
$section_display .=
|
657 |
}
|
658 |
if ( 1 == $qmn_quiz_options->contact_info_location ) {
|
659 |
$section_display .= QSM_Contact_Manager::display_fields( $qmn_quiz_options );
|
660 |
}
|
661 |
|
662 |
-
//Legacy Code
|
663 |
ob_start();
|
664 |
do_action( 'mlw_qmn_end_quiz_section' );
|
665 |
$section_display .= ob_get_contents();
|
666 |
ob_end_clean();
|
667 |
|
668 |
-
$section_display .= "<input type='submit' class='qsm-btn qsm-submit-btn qmn_btn' value='".esc_attr(htmlspecialchars_decode($qmn_quiz_options->submit_button_text, ENT_QUOTES))."' />";
|
669 |
$section_display .= "</div>";
|
670 |
|
671 |
return $section_display;
|
308 |
global $mlw_qmn_section_count;
|
309 |
$mlw_qmn_section_count = 0;
|
310 |
|
311 |
+
$quiz_display .= "<div class='qsm-quiz-container qmn_quiz_container mlw_qmn_quiz'>";
|
312 |
$quiz_display .= "<form name='quizForm{$quiz_data['quiz_id']}' id='quizForm{$quiz_data['quiz_id']}' action='' method='post' class='qsm-quiz-form qmn_quiz_form mlw_quiz_form' novalidate >";
|
313 |
$quiz_display .= "<div name='mlw_error_message' id='mlw_error_message' class='qsm-error-message qmn_error_message_section'></div>";
|
314 |
$quiz_display .= "<span id='mlw_top_of_quiz'></span>";
|
331 |
$quiz_display .= $this->display_end_section( $options, $quiz_data );
|
332 |
}
|
333 |
|
334 |
+
$quiz_display .= "<div name='mlw_error_message_bottom' id='mlw_error_message_bottom' class='qsm-error-message qmn_error_message_section'></div>";
|
335 |
$quiz_display .= "<input type='hidden' name='total_questions' id='total_questions' value='$qmn_total_questions'/>";
|
336 |
$quiz_display .= "<input type='hidden' name='timer' id='timer' value='0'/>";
|
337 |
$quiz_display .= "<input type='hidden' class='qmn_quiz_id' name='qmn_quiz_id' id='qmn_quiz_id' value='{$quiz_data['quiz_id']}'/>";
|
359 |
$pages = $mlwQuizMasterNext->pluginHelper->get_quiz_setting( 'pages', array() );
|
360 |
$questions = QSM_Questions::load_questions_by_pages( $options->quiz_id );
|
361 |
$question_list = '';
|
362 |
+
$contact_fields = QSM_Contact_Manager::load_fields();
|
363 |
+
if ( count( $pages ) > 1 && ( ! empty( $options->message_before ) || ( 0 == $options->contact_info_location && $contact_fields ) ) ) {
|
364 |
$qmn_json_data['first_page'] = true;
|
365 |
$message_before = wpautop( htmlspecialchars_decode( $options->message_before, ENT_QUOTES ) );
|
366 |
$message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_before, $quiz_data );
|
383 |
?>
|
384 |
<section class="qsm-page">
|
385 |
<?php
|
386 |
+
if ( ! empty( $options->message_before ) || ( 0 == $options->contact_info_location && $contact_fields ) ) {
|
387 |
$qmn_json_data['first_page'] = false;
|
388 |
$message_before = wpautop( htmlspecialchars_decode( $options->message_before, ENT_QUOTES ) );
|
389 |
$message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_before, $quiz_data );
|
429 |
</div>
|
430 |
<?php
|
431 |
}
|
432 |
+
if ( ! empty( $options->message_end_template ) || ( 1 == $options->contact_info_location && $contact_fields ) ) {
|
433 |
$message_after = wpautop( htmlspecialchars_decode( $options->message_end_template, ENT_QUOTES ) );
|
434 |
$message_after = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_after, $quiz_data );
|
435 |
?>
|
490 |
</section>
|
491 |
<?php
|
492 |
}
|
493 |
+
if ( count( $pages ) > 1 && ( ! empty( $options->message_end_template ) || ( 1 == $options->contact_info_location && $contact_fields ) ) ) {
|
494 |
$message_after = wpautop( htmlspecialchars_decode( $options->message_end_template, ENT_QUOTES ) );
|
495 |
$message_after = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_after, $quiz_data );
|
496 |
?>
|
541 |
public function display_begin_section( $qmn_quiz_options, $qmn_array_for_variables ) {
|
542 |
$section_display = '';
|
543 |
global $qmn_json_data;
|
544 |
+
$contact_fields = QSM_Contact_Manager::load_fields();
|
545 |
+
if ( ! empty( $qmn_quiz_options->message_before ) || ( 0 == $qmn_quiz_options->contact_info_location && $contact_fields ) ) {
|
546 |
$qmn_json_data["first_page"] = true;
|
547 |
global $mlw_qmn_section_count;
|
548 |
$mlw_qmn_section_count +=1;
|
648 |
public function display_end_section( $qmn_quiz_options, $qmn_array_for_variables ) {
|
649 |
global $mlw_qmn_section_count;
|
650 |
$section_display = '';
|
651 |
+
$section_display .= '<br />';
|
652 |
$mlw_qmn_section_count = $mlw_qmn_section_count + 1;
|
653 |
$section_display .= "<div class='quiz_section slide$mlw_qmn_section_count quiz_end'>";
|
654 |
+
if ( ! empty( $qmn_quiz_options->message_end_template ) ) {
|
655 |
+
$message_end = wpautop( htmlspecialchars_decode( $qmn_quiz_options->message_end_template, ENT_QUOTES ) );
|
656 |
+
$message_end = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_end, $qmn_array_for_variables );
|
657 |
$section_display .= "<span class='mlw_qmn_message_end'>$message_end</span>";
|
658 |
+
$section_display .= '<br /><br />';
|
659 |
}
|
660 |
if ( 1 == $qmn_quiz_options->contact_info_location ) {
|
661 |
$section_display .= QSM_Contact_Manager::display_fields( $qmn_quiz_options );
|
662 |
}
|
663 |
|
664 |
+
// Legacy Code.
|
665 |
ob_start();
|
666 |
do_action( 'mlw_qmn_end_quiz_section' );
|
667 |
$section_display .= ob_get_contents();
|
668 |
ob_end_clean();
|
669 |
|
670 |
+
$section_display .= "<input type='submit' class='qsm-btn qsm-submit-btn qmn_btn' value='" . esc_attr( htmlspecialchars_decode( $qmn_quiz_options->submit_button_text, ENT_QUOTES ) ) . "' />";
|
671 |
$section_display .= "</div>";
|
672 |
|
673 |
return $section_display;
|
php/classes/class-qsm-install.php
CHANGED
@@ -104,7 +104,7 @@ class QSM_Install {
|
|
104 |
// Registers pagination setting
|
105 |
$field_array = array(
|
106 |
'id' => 'pagination',
|
107 |
-
'label' => __('How many questions per page would you like? (Leave 0
|
108 |
'type' => 'number',
|
109 |
'options' => array(
|
110 |
|
104 |
// Registers pagination setting
|
105 |
$field_array = array(
|
106 |
'id' => 'pagination',
|
107 |
+
'label' => __('How many questions per page would you like? (Leave 0 to use pages created on Questions tab)', 'quiz-master-next'),
|
108 |
'type' => 'number',
|
109 |
'options' => array(
|
110 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: quiz, survey, lead, test, score, exam, questionnaire, question
|
|
4 |
Requires at least: 4.8
|
5 |
Tested up to: 4.9
|
6 |
Requires PHP: 5.4
|
7 |
-
Stable tag: 6.0.
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -111,6 +111,11 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
|
|
111 |
|
112 |
== Changelog ==
|
113 |
|
|
|
|
|
|
|
|
|
|
|
114 |
= 6.0.1 (July 11, 2018) =
|
115 |
* Closed Bug: Quiz comment box shows HTML in label when using newer pagination system ([Issue #704](https://github.com/fpcorso/quiz_master_next/issues/704))
|
116 |
|
@@ -123,5 +128,8 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
|
|
123 |
|
124 |
== Upgrade Notice ==
|
125 |
|
|
|
|
|
|
|
126 |
= 6.0.1 =
|
127 |
Upgrade for fix quiz comments displaying HTML
|
4 |
Requires at least: 4.8
|
5 |
Tested up to: 4.9
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 6.0.2
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
111 |
|
112 |
== Changelog ==
|
113 |
|
114 |
+
= 6.0.2 (July 18, 2018) =
|
115 |
+
* Closed Bug: PHP warning thrown on Help page ([Issue #711](https://github.com/fpcorso/quiz_master_next/issues/711))
|
116 |
+
* Closed Bug: Timer not working on certain sites when using questions per page option ([Issue #709](https://github.com/fpcorso/quiz_master_next/issues/709))
|
117 |
+
* Closed Bug: Blank page shown when contact fields and message fields are empty ([Issue #707](https://github.com/fpcorso/quiz_master_next/issues/707))
|
118 |
+
|
119 |
= 6.0.1 (July 11, 2018) =
|
120 |
* Closed Bug: Quiz comment box shows HTML in label when using newer pagination system ([Issue #704](https://github.com/fpcorso/quiz_master_next/issues/704))
|
121 |
|
128 |
|
129 |
== Upgrade Notice ==
|
130 |
|
131 |
+
= 6.0.2 =
|
132 |
+
Upgrade for fix for timer and blank pages
|
133 |
+
|
134 |
= 6.0.1 =
|
135 |
Upgrade for fix quiz comments displaying HTML
|