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

Version Description

Upgrade for minor bug fixes.

Download this release

Release Info

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

Code changes from version 3.3.2 to 3.3.3

Files changed (5) hide show
  1. README.md +4 -0
  2. includes/mlw_qmn_credits.php +148 -146
  3. includes/mlw_quiz.php +1568 -1569
  4. mlw_quizmaster2.php +192 -189
  5. readme.txt +716 -708
README.md ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ quiz_master_next
2
+ ================
3
+
4
+ Attempting to use github for my plugin
includes/mlw_qmn_credits.php CHANGED
@@ -1,147 +1,149 @@
1
- <?php
2
- /*
3
- This page shows the about page
4
- */
5
- /*
6
- Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com)
7
- */
8
-
9
- function mlw_generate_about_page()
10
- {
11
- //Page Variables
12
- $mlw_quiz_version = get_option('mlw_quiz_master_version');
13
-
14
-
15
- ?>
16
- <!-- css -->
17
- <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
18
- <!-- jquery scripts -->
19
- <?php
20
- wp_enqueue_script( 'jquery' );
21
- wp_enqueue_script( 'jquery-ui-core' );
22
- wp_enqueue_script( 'jquery-ui-dialog' );
23
- wp_enqueue_script( 'jquery-ui-button' );
24
- wp_enqueue_script( 'jquery-effects-blind' );
25
- wp_enqueue_script( 'jquery-effects-explode' );
26
- ?>
27
- <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
28
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>-->
29
- <script type="text/javascript">
30
- var $j = jQuery.noConflict();
31
- // increase the default animation speed to exaggerate the effect
32
- $j.fx.speeds._default = 1000;
33
- function mlw_qmn_setTab(tab) {
34
- jQuery("a.nav-tab-active").toggleClass("nav-tab-active");
35
- if (tab == 1)
36
- {
37
- jQuery("#mlw_quiz_what_new").show();
38
- jQuery("#mlw_quiz_changelog").hide();
39
- jQuery("#mlw_quiz_requested").hide();
40
- jQuery("#mlw_qmn_tab_1").toggleClass("nav-tab-active");
41
- }
42
- if (tab == 2)
43
- {
44
- jQuery("#mlw_quiz_what_new").hide();
45
- jQuery("#mlw_quiz_changelog").show();
46
- jQuery("#mlw_quiz_requested").hide();
47
- jQuery("#mlw_qmn_tab_2").toggleClass("nav-tab-active");
48
- }
49
- if (tab == 3)
50
- {
51
- jQuery("#mlw_quiz_what_new").hide();
52
- jQuery("#mlw_quiz_changelog").hide();
53
- jQuery("#mlw_quiz_requested").show();
54
- jQuery("#mlw_qmn_tab_3").toggleClass("nav-tab-active");
55
- }
56
- }
57
- </script>
58
- <style>
59
- div.mlw_qmn_icon_wrap
60
- {
61
- background: <?php echo 'url("'.plugins_url( 'images/quiz_icon.png' , __FILE__ ).'")'; ?> no-repeat;
62
- background: none, <?php echo 'url("'.plugins_url( 'images/quiz_icon.png' , __FILE__ ).'")'; ?> no-repeat;
63
- position: absolute;
64
- top: 0;
65
- right: 0;
66
- background-color: #0d97d8;
67
- color: yellow;
68
- background-position: center 24px;
69
- background-size: 85px 85px;
70
- font-size: 14px;
71
- text-align: center;
72
- font-weight: 600;
73
- margin: 5px 0 0;
74
- padding-top: 120px;
75
- height: 40px;
76
- display: inline-block;
77
- width: 150px;
78
- text-rendering: optimizeLegibility;
79
- border: 5px solid #106daa;
80
- -moz-border-radius: 20px;
81
- -webkit-border-radius: 20px;
82
- -khtml-border-radius: 20px;
83
- border-radius: 20px;
84
- }
85
- </style>
86
- <div class="wrap about-wrap">
87
- <h1>Welcome To Quiz Master Next <?php echo $mlw_quiz_version; ?></h1>
88
- <div class="about-text">Thank you for updating!</div>
89
- <div class="mlw_qmn_icon_wrap">Version <?php echo $mlw_quiz_version; ?></div>
90
- <h2 class="nav-tab-wrapper">
91
- <a href="javascript:mlw_qmn_setTab(1);" id="mlw_qmn_tab_1" class="nav-tab nav-tab-active">
92
- What&#8217;s New In 3.3</a>
93
- <a href="javascript:mlw_qmn_setTab(2);" id="mlw_qmn_tab_2" class="nav-tab">
94
- Changelog For <?php echo $mlw_quiz_version; ?> </a>
95
- <a href="javascript:mlw_qmn_setTab(3);" id="mlw_qmn_tab_3" class="nav-tab">
96
- Requested Features</a>
97
- </h2>
98
- <div id="mlw_quiz_what_new">
99
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Duplicate Questions With Quizzes</h2>
100
- <p style="text-align: center;">You can now duplicate your questions with your quizzes when duplicating!</p>
101
- <br />
102
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Question Type</h2>
103
- <p style="text-align: center;">You can now use the new Horizontal Multiple Response type to have your multiple reponse check boxes go horizontally instead of vertically.</p>
104
- <br />
105
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Our Premium Add-Ons!</h2>
106
- <p style="text-align: center;">We have several new premium add-ons in our WordPress Store: MailPoet Integration (subscribes users to your MailPoet list), MailChimp Integration (subscribes users to your Mailchimp list), Export Results (exports your quiz results), Extra Shortcodes (gives you extra shortcodes to use), User Dashboard (allow users to see the results from all the quizzes they have taken), and Advertisement Be Gone (gets rid of blue-border ads). Visit our <a href="http://mylocalwebstop.com/shop/">WordPress Store</a> for details! </p>
107
- </div>
108
- <div id="mlw_quiz_changelog" style="display: none;">
109
- <h3><?php echo $mlw_quiz_version; ?> (October 26, 2014)</h3>
110
- <ul>
111
- <li>* Minor Design Change To Quiz Options</li>
112
- </ul>
113
- </div>
114
- <div id="mlw_quiz_requested" style="display: none;">
115
- <h3>Requested Features For Future Updates By Premium Support Users</h3>
116
- <ul>
117
- <li>None</li>
118
- </ul>
119
- <h3>Requested Features For Future Updates By Non-Premium Support Users</h3>
120
- <ul>
121
- <li>Importing Questions</li>
122
- <li>Stats For Each Quiz</li>
123
- <li>Force Login/Register Option</li>
124
- <li>Categories</li>
125
- <li>More Social Media Integration</li>
126
- <li>Show Question Amount On Pagination</li>
127
- <li>Required Questions</li>
128
- <li>Allow Quiz To Not Show Start Page</li>
129
- <li>Progress Bar For Timer</li>
130
- <li>Ability To Redirect User Instead Of Showing Results Page</li>
131
- <li>Multi-Delete Option For Quiz Results</li>
132
- <li>Spam Prevention</li>
133
- <li>Graphical Click Aware Questions</li>
134
- <li>Results Bar Graph For Users Taking Polls</li>
135
- <li>Head To Head Comparison Questions</li>
136
- <li>Enhanced Leaderboard</li>
137
- <li>Different Social Media Sharing Text For Different Social Media</li>
138
- <li>Ability To Highlight Incorrect Answers</li>
139
- <li>Set Default Question Type</li>
140
- <li>Show Pop-Up When Clicking Submit</li>
141
- <li>Conditional Continuation To Next Quiz</li>
142
- </ul>
143
- </div>
144
- </div>
145
- <?php
146
- }
 
 
147
  ?>
1
+ <?php
2
+ /*
3
+ This page shows the about page
4
+ */
5
+ /*
6
+ Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com)
7
+ */
8
+
9
+ function mlw_generate_about_page()
10
+ {
11
+ //Page Variables
12
+ $mlw_quiz_version = get_option('mlw_quiz_master_version');
13
+
14
+
15
+ ?>
16
+ <!-- css -->
17
+ <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
18
+ <!-- jquery scripts -->
19
+ <?php
20
+ wp_enqueue_script( 'jquery' );
21
+ wp_enqueue_script( 'jquery-ui-core' );
22
+ wp_enqueue_script( 'jquery-ui-dialog' );
23
+ wp_enqueue_script( 'jquery-ui-button' );
24
+ wp_enqueue_script( 'jquery-effects-blind' );
25
+ wp_enqueue_script( 'jquery-effects-explode' );
26
+ ?>
27
+ <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
28
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>-->
29
+ <script type="text/javascript">
30
+ var $j = jQuery.noConflict();
31
+ // increase the default animation speed to exaggerate the effect
32
+ $j.fx.speeds._default = 1000;
33
+ function mlw_qmn_setTab(tab) {
34
+ jQuery("a.nav-tab-active").toggleClass("nav-tab-active");
35
+ if (tab == 1)
36
+ {
37
+ jQuery("#mlw_quiz_what_new").show();
38
+ jQuery("#mlw_quiz_changelog").hide();
39
+ jQuery("#mlw_quiz_requested").hide();
40
+ jQuery("#mlw_qmn_tab_1").toggleClass("nav-tab-active");
41
+ }
42
+ if (tab == 2)
43
+ {
44
+ jQuery("#mlw_quiz_what_new").hide();
45
+ jQuery("#mlw_quiz_changelog").show();
46
+ jQuery("#mlw_quiz_requested").hide();
47
+ jQuery("#mlw_qmn_tab_2").toggleClass("nav-tab-active");
48
+ }
49
+ if (tab == 3)
50
+ {
51
+ jQuery("#mlw_quiz_what_new").hide();
52
+ jQuery("#mlw_quiz_changelog").hide();
53
+ jQuery("#mlw_quiz_requested").show();
54
+ jQuery("#mlw_qmn_tab_3").toggleClass("nav-tab-active");
55
+ }
56
+ }
57
+ </script>
58
+ <style>
59
+ div.mlw_qmn_icon_wrap
60
+ {
61
+ background: <?php echo 'url("'.plugins_url( 'images/quiz_icon.png' , __FILE__ ).'")'; ?> no-repeat;
62
+ background: none, <?php echo 'url("'.plugins_url( 'images/quiz_icon.png' , __FILE__ ).'")'; ?> no-repeat;
63
+ position: absolute;
64
+ top: 0;
65
+ right: 0;
66
+ background-color: #0d97d8;
67
+ color: yellow;
68
+ background-position: center 24px;
69
+ background-size: 85px 85px;
70
+ font-size: 14px;
71
+ text-align: center;
72
+ font-weight: 600;
73
+ margin: 5px 0 0;
74
+ padding-top: 120px;
75
+ height: 40px;
76
+ display: inline-block;
77
+ width: 150px;
78
+ text-rendering: optimizeLegibility;
79
+ border: 5px solid #106daa;
80
+ -moz-border-radius: 20px;
81
+ -webkit-border-radius: 20px;
82
+ -khtml-border-radius: 20px;
83
+ border-radius: 20px;
84
+ }
85
+ </style>
86
+ <div class="wrap about-wrap">
87
+ <h1>Welcome To Quiz Master Next <?php echo $mlw_quiz_version; ?></h1>
88
+ <div class="about-text">Thank you for updating!</div>
89
+ <div class="mlw_qmn_icon_wrap">Version <?php echo $mlw_quiz_version; ?></div>
90
+ <h2 class="nav-tab-wrapper">
91
+ <a href="javascript:mlw_qmn_setTab(1);" id="mlw_qmn_tab_1" class="nav-tab nav-tab-active">
92
+ What&#8217;s New In 3.3</a>
93
+ <a href="javascript:mlw_qmn_setTab(2);" id="mlw_qmn_tab_2" class="nav-tab">
94
+ Changelog For <?php echo $mlw_quiz_version; ?> </a>
95
+ <a href="javascript:mlw_qmn_setTab(3);" id="mlw_qmn_tab_3" class="nav-tab">
96
+ Requested Features</a>
97
+ </h2>
98
+ <div id="mlw_quiz_what_new">
99
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Duplicate Questions With Quizzes</h2>
100
+ <p style="text-align: center;">You can now duplicate your questions with your quizzes when duplicating!</p>
101
+ <br />
102
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Question Type</h2>
103
+ <p style="text-align: center;">You can now use the new Horizontal Multiple Response type to have your multiple reponse check boxes go horizontally instead of vertically.</p>
104
+ <br />
105
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Our Premium Add-Ons!</h2>
106
+ <p style="text-align: center;">We have several new premium add-ons in our WordPress Store: MailPoet Integration (subscribes users to your MailPoet list), MailChimp Integration (subscribes users to your Mailchimp list), Export Results (exports your quiz results), Extra Shortcodes (gives you extra shortcodes to use), User Dashboard (allow users to see the results from all the quizzes they have taken), and Advertisement Be Gone (gets rid of blue-border ads). Visit our <a href="http://mylocalwebstop.com/shop/">WordPress Store</a> for details! </p>
107
+ </div>
108
+ <div id="mlw_quiz_changelog" style="display: none;">
109
+ <h3><?php echo $mlw_quiz_version; ?> (November 14, 2014)</h3>
110
+ <ul>
111
+ <li>* Minor Backend Change To Quiz Validation</li>
112
+ <li>* Disabled Enter Key On Quiz</li>
113
+ <li>* Minor Bug Fixes</li>
114
+ </ul>
115
+ </div>
116
+ <div id="mlw_quiz_requested" style="display: none;">
117
+ <h3>Requested Features For Future Updates By Premium Support Users</h3>
118
+ <ul>
119
+ <li>None</li>
120
+ </ul>
121
+ <h3>Requested Features For Future Updates By Non-Premium Support Users</h3>
122
+ <ul>
123
+ <li>Importing Questions</li>
124
+ <li>Stats For Each Quiz</li>
125
+ <li>Force Login/Register Option</li>
126
+ <li>Categories</li>
127
+ <li>More Social Media Integration</li>
128
+ <li>Show Question Amount On Pagination</li>
129
+ <li>Required Questions</li>
130
+ <li>Allow Quiz To Not Show Start Page</li>
131
+ <li>Progress Bar For Timer</li>
132
+ <li>Ability To Redirect User Instead Of Showing Results Page</li>
133
+ <li>Multi-Delete Option For Quiz Results</li>
134
+ <li>Spam Prevention</li>
135
+ <li>Graphical Click Aware Questions</li>
136
+ <li>Results Bar Graph For Users Taking Polls</li>
137
+ <li>Head To Head Comparison Questions</li>
138
+ <li>Enhanced Leaderboard</li>
139
+ <li>Different Social Media Sharing Text For Different Social Media</li>
140
+ <li>Ability To Highlight Incorrect Answers</li>
141
+ <li>Set Default Question Type</li>
142
+ <li>Show Pop-Up When Clicking Submit</li>
143
+ <li>Conditional Continuation To Next Quiz</li>
144
+ </ul>
145
+ </div>
146
+ </div>
147
+ <?php
148
+ }
149
  ?>
includes/mlw_quiz.php CHANGED
@@ -1,1570 +1,1569 @@
1
- <?php
2
- /*
3
- This function is the very heart of the plugin. This function displays the quiz to the user as well as handles all the scripts that are part of the quiz. Please be very careful if you are editing this script without my assistance.
4
- */
5
- function mlw_quiz_shortcode($atts)
6
- {
7
- extract(shortcode_atts(array(
8
- 'quiz' => 0
9
- ), $atts));
10
-
11
-
12
-
13
- /*
14
- Code before loading the quiz
15
- */
16
-
17
- //Variables needed throughout script
18
- $mlw_quiz_id = intval($quiz);
19
- $GLOBALS['mlw_qmn_quiz'] = $mlw_quiz_id;
20
- $mlw_display = "";
21
- global $wpdb;
22
- $mlw_qmn_isAllowed = true;
23
- $mlw_qmn_section_count = 1;
24
- $mlw_qmn_section_limit = 0;
25
-
26
-
27
- //Load quiz
28
- $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_quizzes" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0'";
29
- $mlw_quiz_options = $wpdb->get_results($sql);
30
-
31
- foreach($mlw_quiz_options as $mlw_eaches) {
32
- $mlw_quiz_options = $mlw_eaches;
33
- break;
34
- }
35
-
36
- //Check to see if there is limit on the amount of tries
37
- if ( $mlw_quiz_options->total_user_tries != 0 && is_user_logged_in() )
38
- {
39
- $current_user = wp_get_current_user();
40
- $mlw_qmn_user_try_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE email='%s' AND deleted='0' AND quiz_id=%d", $current_user->user_email, $mlw_quiz_id ) );
41
- if ($mlw_qmn_user_try_count >= $mlw_quiz_options->total_user_tries) { $mlw_qmn_isAllowed = false; }
42
- }
43
-
44
-
45
- //Load questions
46
- $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' ";
47
- if ($mlw_quiz_options->randomness_order == 0)
48
- {
49
- $sql .= "ORDER BY question_order ASC";
50
- }
51
- if ($mlw_quiz_options->randomness_order == 1 || $mlw_quiz_options->randomness_order == 2)
52
- {
53
- $sql .= "ORDER BY rand()";
54
- }
55
- if ($mlw_quiz_options->question_from_total != 0)
56
- {
57
- $sql .= " LIMIT ".$mlw_quiz_options->question_from_total;
58
- }
59
- $mlw_questions = $wpdb->get_results($sql);
60
-
61
-
62
- //Load and prepare answer arrays
63
- $mlw_qmn_answer_arrays = array();
64
- foreach($mlw_questions as $mlw_question_info) {
65
- $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array);
66
- if ( !is_array($mlw_qmn_answer_array_each) )
67
- {
68
- $mlw_answer_array_correct = array(0, 0, 0, 0, 0, 0);
69
- $mlw_answer_array_correct[$mlw_question_info->correct_answer-1] = 1;
70
- $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = array(
71
- array($mlw_question_info->answer_one, $mlw_question_info->answer_one_points, $mlw_answer_array_correct[0]),
72
- array($mlw_question_info->answer_two, $mlw_question_info->answer_two_points, $mlw_answer_array_correct[1]),
73
- array($mlw_question_info->answer_three, $mlw_question_info->answer_three_points, $mlw_answer_array_correct[2]),
74
- array($mlw_question_info->answer_four, $mlw_question_info->answer_four_points, $mlw_answer_array_correct[3]),
75
- array($mlw_question_info->answer_five, $mlw_question_info->answer_five_points, $mlw_answer_array_correct[4]),
76
- array($mlw_question_info->answer_six, $mlw_question_info->answer_six_points, $mlw_answer_array_correct[5]));
77
- }
78
- else
79
- {
80
- $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each;
81
- }
82
- }
83
-
84
-
85
- //Variables to load if quiz has been taken
86
- if (isset($_POST["complete_quiz"]) && $_POST["complete_quiz"] == "confirmation")
87
- {
88
- $mlw_success = $_POST["complete_quiz"];
89
- $mlw_user_name = isset($_POST["mlwUserName"]) ? $_POST["mlwUserName"] : 'None';
90
- $mlw_user_comp = isset($_POST["mlwUserComp"]) ? $_POST["mlwUserComp"] : 'None';
91
- $mlw_user_email = isset($_POST["mlwUserEmail"]) ? $_POST["mlwUserEmail"] : 'None';
92
- $mlw_user_phone = isset($_POST["mlwUserPhone"]) ? $_POST["mlwUserPhone"] : 'None';
93
- $mlw_qmn_timer = isset($_POST["timer"]) ? $_POST["timer"] : 0;
94
- $mlw_spam_email = $_POST["email"];
95
- }
96
-
97
- wp_enqueue_script( 'json2' );
98
- wp_enqueue_script( 'jquery' );
99
- wp_enqueue_script( 'jquery-ui-core' );
100
- wp_enqueue_script( 'jquery-effects-core' );
101
- wp_enqueue_script( 'jquery-effects-slide' );
102
- wp_enqueue_script( 'jquery-ui-dialog' );
103
- wp_enqueue_script( 'jquery-ui-button' );
104
- wp_enqueue_script( 'jquery-ui-accordion' );
105
- wp_enqueue_script( 'jquery-ui-tooltip' );
106
- wp_enqueue_script( 'jquery-ui-tabs' );
107
- ?>
108
- <!-- css -->
109
- <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
110
- <script type="text/javascript">
111
- setTimeout(function(){
112
- var $j = jQuery.noConflict();
113
- // increase the default animation speed to exaggerate the effect
114
- $j.fx.speeds._default = 1000;
115
- $j(function() {
116
- $j( ".mlw_qmn_quiz" ).tooltip();
117
- });
118
- }, 100);
119
- </script>
120
- <style type="text/css">
121
- .ui-tooltip
122
- {
123
- /* tooltip container box */
124
- max-width: 500px !important;
125
- }
126
- .ui-tooltip-content
127
- {
128
- /* tooltip content */
129
- max-width: 500px !important;
130
- }
131
- </style>
132
-
133
- <?php
134
- if ($mlw_quiz_options->theme_selected == "default")
135
- {
136
- echo "<style type='text/css'>".$mlw_quiz_options->quiz_stye."</style>";
137
- }
138
- else
139
- {
140
- echo "<link type='text/css' href='".get_option('mlw_qmn_theme_'.$mlw_quiz_options->theme_selected)."' rel='stylesheet' />";
141
- }
142
-
143
- /*
144
- The following code is for displaying the quiz and completion screen
145
- */
146
-
147
- //If there is no quiz for the shortcode provided
148
- if ($mlw_quiz_options->quiz_name == "")
149
- {
150
- $mlw_display .= "It appears that this quiz is not set up correctly.";
151
- return $mlw_display;
152
- }
153
-
154
-
155
-
156
- //Display Quiz
157
- if (!isset($_POST["complete_quiz"]) && $mlw_quiz_options->quiz_name != "" && $mlw_qmn_isAllowed)
158
- {
159
- $mlw_qmn_total_questions = 0;
160
- //Calculate number of pages if pagination is turned on
161
- if ($mlw_quiz_options->pagination != 0)
162
- {
163
- $mlw_qmn_section_limit = 2 + count($mlw_questions);
164
- if ($mlw_quiz_options->comment_section == 0)
165
- {
166
- $mlw_qmn_section_limit = $mlw_qmn_section_limit + 1;
167
- }
168
-
169
- //Gather text for pagination buttons
170
- $mlw_qmn_pagination_text = "";
171
- $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text);
172
- if (!is_array($mlw_qmn_pagination_text)) {
173
- $mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text);
174
- }
175
- ?>
176
- <script type="text/javascript">
177
- setTimeout(function(){
178
- var $j = jQuery.noConflict();
179
- $j( ".quiz_section" ).hide();
180
- $j( ".quiz_section" ).append( "<br />" );
181
- $j( ".mlw_qmn_quiz" ).append( "<a class=\"mlw_qmn_quiz_link mlw_previous\" href=\"javascript:prevSlide(<?php echo $mlw_quiz_options->pagination; ?>, 1);\"><?php echo $mlw_qmn_pagination_text[0]; ?></a>" );
182
- $j( ".mlw_qmn_quiz" ).append( "<a class=\"mlw_qmn_quiz_link mlw_next\" href=\"javascript:nextSlide(<?php echo $mlw_quiz_options->pagination; ?>, 1);\"><?php echo $mlw_qmn_pagination_text[1]; ?></a>" );
183
- window.mlw_quiz_slide = 0;
184
- window.mlw_previous = 0;
185
- window.mlw_quiz_total_slides = <?php echo $mlw_qmn_section_limit; ?>;
186
- nextSlide(1, 0);
187
- }, 100);
188
- function nextSlide(mlw_pagination, mlw_goto_top)
189
- {
190
- jQuery( ".quiz_section" ).hide();
191
- for (var i = 0; i < mlw_pagination; i++)
192
- {
193
- if (i == 0 && window.mlw_previous == 1 && window.mlw_quiz_slide > 1)
194
- {
195
- window.mlw_quiz_slide = window.mlw_quiz_slide + mlw_pagination;
196
- }
197
- else
198
- {
199
- window.mlw_quiz_slide++;
200
- }
201
- if (window.mlw_quiz_slide < 1)
202
- {
203
- window.mlw_quiz_slide = 1;
204
- }
205
- if (window.mlw_quiz_slide == 1)
206
- {
207
- jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
208
- }
209
- if (window.mlw_quiz_slide > 1)
210
- {
211
- jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).show();
212
- }
213
- if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
214
- {
215
- jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
216
- }
217
- if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
218
- {
219
- jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
220
- }
221
- jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
222
- }
223
- window.mlw_previous = 0;
224
- if (mlw_goto_top == 1)
225
- {
226
- window.location.hash = "mlw_does_not_exist";
227
- window.location.hash = "mlw_top_of_quiz";
228
- }
229
-
230
- }
231
- function prevSlide(mlw_pagination, mlw_goto_top)
232
- {
233
- jQuery( ".quiz_section" ).hide();
234
- for (var i = 0; i < mlw_pagination; i++)
235
- {
236
- if (i == 0 && window.mlw_previous == 0)
237
- {
238
- window.mlw_quiz_slide = window.mlw_quiz_slide - mlw_pagination;
239
- }
240
- else
241
- {
242
- window.mlw_quiz_slide--;
243
- }
244
- if (window.mlw_quiz_slide < 1)
245
- {
246
- window.mlw_quiz_slide = 1;
247
- }
248
- if (window.mlw_quiz_slide == 1)
249
- {
250
- jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
251
- }
252
- if (window.mlw_quiz_slide > 1)
253
- {
254
- jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).show();
255
- }
256
- if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
257
- {
258
- jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
259
- }
260
- if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
261
- {
262
- jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
263
- }
264
- jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
265
- }
266
- window.mlw_previous = 1;
267
- if (mlw_goto_top == 1)
268
- {
269
- window.location.hash = "mlw_does_not_exist";
270
- window.location.hash = "mlw_top_of_quiz";
271
- }
272
- }
273
- </script>
274
- <?php
275
- }
276
- if ($mlw_quiz_options->timer_limit != 0)
277
- {
278
- ?>
279
- <div id="mlw_qmn_timer" class="mlw_qmn_timer"></div>
280
- <script type="text/javascript">
281
- setTimeout(function(){
282
- var minutes = 0;
283
- if (window.sessionStorage.getItem('mlw_started_quiz<?php echo $mlw_quiz_id; ?>') == "yes" && window.sessionStorage.getItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>') >= 0)
284
- {
285
- minutes = window.sessionStorage.getItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>');
286
- }
287
- else
288
- {
289
- minutes = <?php echo $mlw_quiz_options->timer_limit; ?>;
290
- }
291
- window.amount = (minutes*60);
292
- window.titleText = window.document.title;
293
- document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
294
- window.counter=setInterval(timer, 1000);
295
- }, 100);
296
- function timer()
297
- {
298
- window.amount=window.amount-1;
299
- if (window.amount < 0)
300
- {
301
- window.amount = 0;
302
- }
303
- window.sessionStorage.setItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>', window.amount/60);
304
- window.sessionStorage.setItem('mlw_started_quiz<?php echo $mlw_quiz_id; ?>', "yes");
305
- document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
306
- window.document.title = minToSec(window.amount) + " " + window.titleText;
307
- if (window.amount <= 0)
308
- {
309
- clearInterval(window.counter);
310
- jQuery( ".mlw_qmn_quiz input:radio" ).attr('disabled',true);
311
- jQuery( ".mlw_qmn_quiz input:checkbox" ).attr('disabled',true);
312
- jQuery( ".mlw_qmn_quiz select" ).attr('disabled',true);
313
- jQuery( ".mlw_qmn_question_comment" ).attr('disabled',true);
314
- jQuery( ".mlw_answer_open_text" ).attr('disabled',true);
315
- //document.quizForm.submit();
316
- return;
317
- }
318
- }
319
- function minToSec(amount)
320
- {
321
- var minutes = Math.floor(amount/60);
322
- var seconds = amount - (minutes * 60);
323
- if (seconds == '0')
324
- {
325
- seconds = "00";
326
- }
327
- else if (seconds < 10)
328
- {
329
- seconds = '0' + seconds;
330
- }
331
- return minutes+":"+seconds;
332
- }
333
- </script>
334
- <?php
335
- }
336
-
337
- ?>
338
- <script type="text/javascript">
339
- var myVar=setInterval("mlwQmnTimer();",1000);
340
- function mlwQmnTimer()
341
- {
342
- var x = +document.getElementById("timer").value;
343
- x = x + 1;
344
- document.getElementById("timer").value = x;
345
- }
346
-
347
- </script>
348
- <?php
349
- //Update the quiz views
350
- $mlw_views = $mlw_quiz_options->quiz_views;
351
- $mlw_views += 1;
352
- $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views='".$mlw_views."' WHERE quiz_id=".$mlw_quiz_id;
353
- $results = $wpdb->query( $update );
354
-
355
- //Form validation script
356
- ?>
357
- <script>
358
- function clear_field(field)
359
- {
360
- if (field.defaultValue == field.value) field.value = '';
361
- }
362
-
363
- function mlw_validateForm()
364
- {
365
- mlw_validateResult = true;
366
- <?php
367
- if ($mlw_quiz_options->user_name == 1)
368
- {
369
- ?>
370
- var x=document.forms['quizForm']['mlwUserName'].value;
371
- if (x==null || x=='')
372
- {
373
- document.getElementById('mlw_error_message').innerHTML = '**Name must be filled out!**';
374
- document.getElementById('mlw_error_message_bottom').innerHTML = '**Name must be filled out!**';
375
- mlw_validateResult = false;
376
- }
377
- <?php
378
- }
379
- if ($mlw_quiz_options->user_comp == 1)
380
- {
381
- ?>
382
- var x=document.forms['quizForm']['mlwUserComp'].value;
383
- if (x==null || x=='')
384
- {
385
- document.getElementById('mlw_error_message').innerHTML = '**Business must be filled out!**';
386
- document.getElementById('mlw_error_message_bottom').innerHTML = '**Business must be filled out!**';
387
- mlw_validateResult = false;
388
- }
389
- <?php
390
- }
391
- if ($mlw_quiz_options->user_email == 1)
392
- {
393
- ?>
394
- var x=document.forms['quizForm']['mlwUserEmail'].value;
395
- if (x==null || x=='')
396
- {
397
- document.getElementById('mlw_error_message').innerHTML = '**Email must be filled out!**';
398
- document.getElementById('mlw_error_message_bottom').innerHTML = '**Email must be filled out!**';
399
- mlw_validateResult = false;
400
- }
401
- <?php
402
- }
403
- if ($mlw_quiz_options->user_phone == 1)
404
- {
405
- ?>
406
- var x=document.forms['quizForm']['mlwUserPhone'].value;
407
- if (x==null || x=='')
408
- {
409
- document.getElementById('mlw_error_message').innerHTML = '**Phone number must be filled out!**';
410
- document.getElementById('mlw_error_message_bottom').innerHTML = '**Phone number must be filled out!**';
411
- mlw_validateResult = false;
412
- }
413
- <?php
414
- }
415
- ?>
416
- if (document.forms['quizForm']['mlwUserEmail'].value != '')
417
- {
418
- var x=document.forms['quizForm']['mlwUserEmail'].value;
419
- var atpos=x.indexOf('@');
420
- var dotpos=x.lastIndexOf('.');
421
- if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
422
- {
423
- document.getElementById('mlw_error_message').innerHTML = '**Not a valid e-mail address!**';
424
- document.getElementById('mlw_error_message_bottom').innerHTML = '**Not a valid e-mail address!**';
425
- mlw_validateResult = false;
426
- }
427
- }
428
-
429
- jQuery('#quizForm *').filter(':input').each(function(){
430
- jQuery(this).css("outline", "");
431
- if (jQuery(this).attr('class'))
432
- {
433
- if(jQuery(this).attr('class').indexOf('mlwRequiredNumber') > -1 && this.value == "" && +this.value != NaN)
434
- {
435
- document.getElementById('mlw_error_message').innerHTML = '**This field must be a number!**';
436
- document.getElementById('mlw_error_message_bottom').innerHTML = '**This field must be a number!**';
437
- jQuery(this).css("outline", "2px solid red");
438
- mlw_validateResult = false;
439
- }
440
- if(jQuery(this).attr('class').indexOf('mlwRequiredText') > -1 && this.value == "")
441
- {
442
- document.getElementById('mlw_error_message').innerHTML = '**Please complete all required fields!**';
443
- document.getElementById('mlw_error_message_bottom').innerHTML = '**Please complete all required fields!**';
444
- jQuery(this).css("outline", "2px solid red");
445
- mlw_validateResult = false;
446
- }
447
- if(jQuery(this).attr('class').indexOf('mlwRequiredCaptcha') > -1 && this.value != mlw_code)
448
- {
449
- document.getElementById('mlw_error_message').innerHTML = '**The entered text is not correct!**';
450
- document.getElementById('mlw_error_message_bottom').innerHTML = '**The entered text is not correct!**';
451
- jQuery(this).css("outline", "2px solid red");
452
- mlw_validateResult = false;
453
- }
454
- if(jQuery(this).attr('class').indexOf('mlwRequiredCheck') > -1 && !this.checked)
455
- {
456
- document.getElementById('mlw_error_message').innerHTML = '**Please complete all required fields!**';
457
- document.getElementById('mlw_error_message_bottom').innerHTML = '**Please complete all required fields!**';
458
- jQuery(this).css("outline", "2px solid red");
459
- mlw_validateResult = false;
460
- }
461
- }
462
- });
463
-
464
- if (!mlw_validateResult) {return mlw_validateResult;}
465
-
466
- jQuery( '.mlw_qmn_quiz input:radio' ).attr('disabled',false);
467
- jQuery( '.mlw_qmn_quiz input:checkbox' ).attr('disabled',false);
468
- jQuery( '.mlw_qmn_quiz select' ).attr('disabled',false);
469
- jQuery( '.mlw_qmn_question_comment' ).attr('disabled',false);
470
- jQuery( '.mlw_answer_open_text' ).attr('disabled',false);
471
- }
472
- </script>
473
- <?php
474
-
475
- if ( $mlw_quiz_options->pagination != 0) { $mlw_display .= "<style>.quiz_section { display: none; }</style>"; }
476
-
477
- //Begin the quiz
478
- $mlw_display .= "<div class='mlw_qmn_quiz'>";
479
- $mlw_display .= "<form name='quizForm' id='quizForm' action='' method='post' class='mlw_quiz_form' onsubmit='return mlw_validateForm()' novalidate >";
480
- $mlw_display .= "<span id='mlw_top_of_quiz'></span>";
481
- $mlw_display .= "<div class='quiz_section quiz_begin slide".$mlw_qmn_section_count."'>";
482
- $mlw_message_before = htmlspecialchars_decode($mlw_quiz_options->message_before, ENT_QUOTES);
483
- $mlw_message_before = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_before);
484
- $mlw_message_before = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_before);
485
- $mlw_display .= "<span class='mlw_qmn_message_before'>".$mlw_message_before."</span><br />";
486
- $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
487
-
488
- if ($mlw_quiz_options->contact_info_location == 0)
489
- {
490
- $mlw_display .= mlwDisplayContactInfo($mlw_quiz_options);
491
- }
492
- $mlw_display .= "</div>";
493
-
494
- //Display the questions
495
- foreach($mlw_questions as $mlw_question) {
496
- $mlw_question_settings = @unserialize($mlw_question->question_settings);
497
- if (!is_array($mlw_question_settings))
498
- {
499
- $mlw_question_settings = array();
500
- $mlw_question_settings['required'] = 1;
501
- }
502
- if ( !isset($mlw_question_settings['required']))
503
- {
504
- $mlw_question_settings['required'] = 1;
505
- }
506
- $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
507
- $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
508
- if ($mlw_question->question_type == 0)
509
- {
510
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
511
- $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
512
- if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
513
- $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
514
- $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
515
- if (is_array($mlw_qmn_answer_array))
516
- {
517
- if ($mlw_quiz_options->randomness_order == 2)
518
- {
519
- shuffle($mlw_qmn_answer_array);
520
- }
521
- $mlw_answer_total = 0;
522
- foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
523
- {
524
- $mlw_answer_total++;
525
- if ($mlw_qmn_answer_each[0] != "")
526
- {
527
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_".$mlw_answer_total."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> <label for='question".$mlw_question->question_id."_".$mlw_answer_total."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."</label>";
528
- $mlw_display .= "<br />";
529
- }
530
- }
531
- $mlw_display .= "<input type='radio' style='display: none;' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_none' checked='checked' value='No Answer Provided' />";
532
- }
533
- else
534
- {
535
- if ($mlw_question->answer_one != "")
536
- {
537
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_one' value='1' /> <label for='question".$mlw_question->question_id."_one'>".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES)."</label>";
538
- $mlw_display .= "<br />";
539
- }
540
- if ($mlw_question->answer_two != "")
541
- {
542
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_two' value='2' /> <label for='question".$mlw_question->question_id."_two'>".htmlspecialchars_decode($mlw_question->answer_two, ENT_QUOTES)."</label>";
543
- $mlw_display .= "<br />";
544
- }
545
- if ($mlw_question->answer_three != "")
546
- {
547
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_three' value='3' /> <label for='question".$mlw_question->question_id."_three'>".htmlspecialchars_decode($mlw_question->answer_three, ENT_QUOTES)."</label>";
548
- $mlw_display .= "<br />";
549
- }
550
- if ($mlw_question->answer_four != "")
551
- {
552
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_four' value='4' /> <label for='question".$mlw_question->question_id."_four'>".htmlspecialchars_decode($mlw_question->answer_four, ENT_QUOTES)."</label>";
553
- $mlw_display .= "<br />";
554
- }
555
- if ($mlw_question->answer_five != "")
556
- {
557
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_five' value='5' /> <label for='question".$mlw_question->question_id."_five'>".htmlspecialchars_decode($mlw_question->answer_five, ENT_QUOTES)."</label>";
558
- $mlw_display .= "<br />";
559
- }
560
- if ($mlw_question->answer_six != "")
561
- {
562
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_six' value='6' /> <label for='question".$mlw_question->question_id."_six'>".htmlspecialchars_decode($mlw_question->answer_six, ENT_QUOTES)."</label>";
563
- $mlw_display .= "<br />";
564
- }
565
- }
566
- }
567
- elseif ($mlw_question->question_type == 4)
568
- {
569
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
570
- $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
571
- if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
572
- $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
573
- $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
574
- if (is_array($mlw_qmn_answer_array))
575
- {
576
- if ($mlw_quiz_options->randomness_order == 2)
577
- {
578
- shuffle($mlw_qmn_answer_array);
579
- }
580
- $mlw_answer_total = 0;
581
- foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
582
- {
583
- $mlw_answer_total++;
584
- if ($mlw_qmn_answer_each[0] != "")
585
- {
586
- $mlw_display .= "<input type='hidden' name='question".$mlw_question->question_id."' value='This value does not matter' />";
587
- $mlw_display .= "<input type='checkbox' name='question".$mlw_question->question_id."_".$mlw_answer_total."' id='question".$mlw_question->question_id."_".$mlw_answer_total."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> <label for='question".$mlw_question->question_id."_".$mlw_answer_total."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."</label>";
588
- $mlw_display .= "<br />";
589
- }
590
- }
591
- }
592
- }
593
- elseif ($mlw_question->question_type == 10)
594
- {
595
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
596
- $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
597
- if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
598
- $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
599
- $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
600
- if (is_array($mlw_qmn_answer_array))
601
- {
602
- if ($mlw_quiz_options->randomness_order == 2)
603
- {
604
- shuffle($mlw_qmn_answer_array);
605
- }
606
- $mlw_answer_total = 0;
607
- foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
608
- {
609
- $mlw_answer_total++;
610
- if ($mlw_qmn_answer_each[0] != "")
611
- {
612
- $mlw_display .= "<input type='hidden' name='question".$mlw_question->question_id."' value='This value does not matter' />";
613
- $mlw_display .= "<span class='mlw_horizontal_multiple'><input type='checkbox' name='question".$mlw_question->question_id."_".$mlw_answer_total."' id='question".$mlw_question->question_id."_".$mlw_answer_total."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> <label for='question".$mlw_question->question_id."_".$mlw_answer_total."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."&nbsp;</label></span>";
614
- }
615
- }
616
- }
617
- }
618
- elseif ($mlw_question->question_type == 1)
619
- {
620
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
621
- $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
622
- if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
623
- $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
624
- $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
625
- if (is_array($mlw_qmn_answer_array))
626
- {
627
- if ($mlw_quiz_options->randomness_order == 2)
628
- {
629
- shuffle($mlw_qmn_answer_array);
630
- }
631
- $mlw_answer_total = 0;
632
- foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
633
- {
634
- $mlw_answer_total++;
635
- if ($mlw_qmn_answer_each[0] != "")
636
- {
637
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> ".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)." ";
638
- }
639
- }
640
- $mlw_display .= "<input type='radio' style='display: none;' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_none' checked='checked' value='No Answer Provided' />";
641
- }
642
- else
643
- {
644
- if ($mlw_question->answer_one != "")
645
- {
646
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='1' />".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES);
647
- }
648
- if ($mlw_question->answer_two != "")
649
- {
650
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='2' />".htmlspecialchars_decode($mlw_question->answer_two, ENT_QUOTES);
651
- }
652
- if ($mlw_question->answer_three != "")
653
- {
654
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='3' />".htmlspecialchars_decode($mlw_question->answer_three, ENT_QUOTES);
655
- }
656
- if ($mlw_question->answer_four != "")
657
- {
658
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='4' />".htmlspecialchars_decode($mlw_question->answer_four, ENT_QUOTES);
659
- }
660
- if ($mlw_question->answer_five != "")
661
- {
662
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='5' />".htmlspecialchars_decode($mlw_question->answer_five, ENT_QUOTES);
663
- }
664
- if ($mlw_question->answer_six != "")
665
- {
666
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='6' />".htmlspecialchars_decode($mlw_question->answer_six, ENT_QUOTES);
667
- }
668
- }
669
- $mlw_display .= "<br />";
670
- }
671
- elseif ($mlw_question->question_type == 2)
672
- {
673
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
674
- $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
675
- if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
676
- $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
677
- $mlw_display .= "<select name='question".$mlw_question->question_id."'>";
678
- $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
679
- if (is_array($mlw_qmn_answer_array))
680
- {
681
- if ($mlw_quiz_options->randomness_order == 2)
682
- {
683
- shuffle($mlw_qmn_answer_array);
684
- }
685
- $mlw_answer_total = 0;
686
- foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
687
- {
688
- $mlw_answer_total++;
689
- if ($mlw_qmn_answer_each[0] != "")
690
- {
691
- $mlw_display .= "<option value='".esc_attr($mlw_qmn_answer_each[0])."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."</option>";
692
- }
693
- }
694
- }
695
- else
696
- {
697
- if ($mlw_question->answer_one != "")
698
- {
699
- $mlw_display .= "<option value='1'>".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES)."</option>";
700
- }
701
- if ($mlw_question->answer_two != "")
702
- {
703
- $mlw_display .= "<option value='2'>".htmlspecialchars_decode($mlw_question->answer_two, ENT_QUOTES)."</option>";
704
- }
705
- if ($mlw_question->answer_three != "")
706
- {
707
- $mlw_display .= "<option value='3'>".htmlspecialchars_decode($mlw_question->answer_three, ENT_QUOTES)."</option>";
708
- }
709
- if ($mlw_question->answer_four != "")
710
- {
711
- $mlw_display .= "<option value='4'>".htmlspecialchars_decode($mlw_question->answer_four, ENT_QUOTES)."</option>";
712
- }
713
- if ($mlw_question->answer_five != "")
714
- {
715
- $mlw_display .= "<option value='5'>".htmlspecialchars_decode($mlw_question->answer_five, ENT_QUOTES)."</option>";
716
- }
717
- if ($mlw_question->answer_six != "")
718
- {
719
- $mlw_display .= "<option value='6'>".htmlspecialchars_decode($mlw_question->answer_six, ENT_QUOTES)."</option>";
720
- }
721
- }
722
- $mlw_display .= "</select>";
723
- $mlw_display .= "<br />";
724
- }
725
- elseif ($mlw_question->question_type == 5)
726
- {
727
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
728
- $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
729
- if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
730
- $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
731
- if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredText";} else {$mlw_requireClass = "";}
732
- $mlw_display .= "<textarea class='mlw_answer_open_text $mlw_requireClass' cols='70' rows='5' name='question".$mlw_question->question_id."' /></textarea>";
733
- $mlw_display .= "<br />";
734
- }
735
- elseif ($mlw_question->question_type == 6)
736
- {
737
- $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES);
738
- $mlw_display .= "<br />";
739
- }
740
- elseif ($mlw_question->question_type == 7)
741
- {
742
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
743
- $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
744
- if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
745
- $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
746
- if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredNumber";} else {$mlw_requireClass = "";}
747
- $mlw_display .= "<input type='number' class='mlw_answer_number $mlw_requireClass' name='question".$mlw_question->question_id."' />";
748
- $mlw_display .= "<br />";
749
- }
750
- elseif ($mlw_question->question_type == 8)
751
- {
752
- if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredCheck";} else {$mlw_requireClass = "";}
753
- $mlw_display .= "<input type='checkbox' id='mlwAcceptance' class='$mlw_requireClass ' />";
754
- $mlw_display .= "<label for='mlwAcceptance'><span class='mlw_qmn_question' style='font-weight:bold;'>".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span></label>";
755
- $mlw_display .= "<br />";
756
- }
757
- elseif ($mlw_question->question_type == 9)
758
- {
759
- if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredCaptcha";} else {$mlw_requireClass = "";}
760
- $mlw_display .= "<div class='mlw_captchaWrap'>";
761
- $mlw_display .= "<canvas alt='' id='mlw_captcha' class='mlw_captcha' width='100' height='50'></canvas>";
762
- $mlw_display .= "</div>";
763
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
764
- $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
765
- $mlw_display .= "<input type='text' class='mlw_answer_open_text $mlw_requireClass' id='mlw_captcha_text' name='mlw_user_captcha'/>";
766
- $mlw_display .= "<input type='hidden' name='mlw_code_captcha' id='mlw_code_captcha' value='none' />";
767
- $mlw_display .= "<br />";
768
- $mlw_display .= "<script>
769
- var mlw_code = '';
770
- var mlw_chars = '0123456789ABCDEFGHIJKL!@#$%^&*()MNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
771
- var mlw_code_length = 5;
772
- for (var i=0; i<mlw_code_length; i++) {
773
- var rnum = Math.floor(Math.random() * mlw_chars.length);
774
- mlw_code += mlw_chars.substring(rnum,rnum+1);
775
- }
776
- var mlw_captchaCTX = document.getElementById('mlw_captcha').getContext('2d');
777
- mlw_captchaCTX.font = 'normal 24px Verdana';
778
- mlw_captchaCTX.strokeStyle = '#000000';
779
- mlw_captchaCTX.clearRect(0,0,100,50);
780
- mlw_captchaCTX.strokeText(mlw_code,10,30,70);
781
- mlw_captchaCTX.textBaseline = 'middle';
782
- document.getElementById('mlw_code_captcha').value = mlw_code;
783
- </script>
784
- ";
785
- }
786
- else
787
- {
788
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
789
- $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
790
- if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
791
- $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
792
- if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredText";} else {$mlw_requireClass = "";}
793
- $mlw_display .= "<input type='text' class='mlw_answer_open_text $mlw_requireClass' name='question".$mlw_question->question_id."' />";
794
- $mlw_display .= "<br />";
795
- }
796
- if ($mlw_question->comments == 0)
797
- {
798
- $mlw_display .= "<input type='text' class='mlw_qmn_question_comment' x-webkit-speech id='mlwComment".$mlw_question->question_id."' name='mlwComment".$mlw_question->question_id."' value='".esc_attr(htmlspecialchars_decode($mlw_quiz_options->comment_field_text, ENT_QUOTES))."' onclick='clear_field(this)'/>";
799
- $mlw_display .= "<br />";
800
- }
801
- if ($mlw_question->comments == 2)
802
- {
803
- $mlw_display .= "<textarea cols='70' rows='5' class='mlw_qmn_question_comment' id='mlwComment".$mlw_question->question_id."' name='mlwComment".$mlw_question->question_id."' onclick='clear_field(this)'>".htmlspecialchars_decode($mlw_quiz_options->comment_field_text, ENT_QUOTES)."</textarea>";
804
- $mlw_display .= "<br />";
805
- }
806
- if ($mlw_question->hints != "")
807
- {
808
- $mlw_display .= "<span title=\"".htmlspecialchars_decode($mlw_question->hints, ENT_QUOTES)."\" style=\"text-decoration:underline;color:rgb(0,0,255);\" class='mlw_qmn_hint_link'>Hint</span>";
809
- $mlw_display .= "<br /><br />";
810
- }
811
- $mlw_display .= "</div>";
812
- if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br />"; }
813
- }
814
-
815
- //Display comment box if needed
816
- if ($mlw_quiz_options->comment_section == 0)
817
- {
818
- $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
819
- $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
820
- $mlw_message_comments = htmlspecialchars_decode($mlw_quiz_options->message_comment, ENT_QUOTES);
821
- $mlw_message_comments = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_comments);
822
- $mlw_message_comments = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_comments);
823
- $mlw_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text' style='font-weight:bold;'>".$mlw_message_comments."</label><br />";
824
- $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
825
- $mlw_display .= "</div>";
826
- if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br /><br />"; }
827
- }
828
- $mlw_display .= "<br />";
829
- $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
830
- $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count." quiz_end'>";
831
- if ($mlw_quiz_options->message_end_template != '')
832
- {
833
- $mlw_message_end = htmlspecialchars_decode($mlw_quiz_options->message_end_template, ENT_QUOTES);
834
- $mlw_message_end = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_end);
835
- $mlw_message_end = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_end);
836
- $mlw_display .= "<span class='mlw_qmn_message_end'>".$mlw_message_end."</span>";
837
- $mlw_display .= "<br /><br />";
838
- }
839
- if ($mlw_quiz_options->contact_info_location == 1)
840
- {
841
- $mlw_display .= mlwDisplayContactInfo($mlw_quiz_options);
842
- }
843
- ob_start();
844
- do_action('mlw_qmn_end_quiz_section');
845
- $mlw_display .= ob_get_contents();
846
- ob_end_clean();
847
- $mlw_display .= "<span style='display: none;'>If you are human, leave this field blank or you will be considered spam:</span>";
848
- $mlw_display .= "<input style='display: none;' type='text' name='email' id='email' />";
849
- $mlw_display .= "<input type='hidden' name='total_questions' id='total_questions' value='".$mlw_qmn_total_questions."'/>";
850
- $mlw_display .= "<input type='hidden' name='timer' id='timer' value='0'/>";
851
- $mlw_display .= "<input type='hidden' name='complete_quiz' value='confirmation' />";
852
- $mlw_display .= "<input type='submit' value='".esc_attr(htmlspecialchars_decode($mlw_quiz_options->submit_button_text, ENT_QUOTES))."' />";
853
- $mlw_display .= "<span name='mlw_error_message_bottom' id='mlw_error_message_bottom' style='color: red;'></span><br />";
854
- $mlw_display .= "</form>";
855
- $mlw_display .= "</div>";
856
- $mlw_display .= "</div>";
857
-
858
- }
859
- //Display Completion Screen
860
- else
861
- {
862
- ?>
863
- <script type="text/javascript">
864
- window.sessionStorage.setItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>', 'completed');
865
- window.sessionStorage.setItem('mlw_started_quiz<?php echo $mlw_quiz_id; ?>', "no");
866
- </script>
867
- <?php
868
- if (empty($mlw_spam_email) && $mlw_qmn_isAllowed && ((!isset($_POST["mlw_code_captcha"])) || isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] == $_POST["mlw_code_captcha"]))
869
- {
870
-
871
- //Load questions
872
- $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' ";
873
- if ($mlw_quiz_options->randomness_order == 0)
874
- {
875
- $sql .= "ORDER BY question_order ASC";
876
- }
877
- if ($mlw_quiz_options->randomness_order == 1 || $mlw_quiz_options->randomness_order == 2)
878
- {
879
- $sql .= "ORDER BY rand()";
880
- }
881
- $mlw_questions = $wpdb->get_results($sql);
882
-
883
- //Load and prepare answer arrays
884
- $mlw_qmn_loaded_answer_arrays = array();
885
- foreach($mlw_questions as $mlw_question_info) {
886
- $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array);
887
- if ( !is_array($mlw_qmn_answer_array_each) )
888
- {
889
- $mlw_answer_array_correct = array(0, 0, 0, 0, 0, 0);
890
- $mlw_answer_array_correct[$mlw_question_info->correct_answer-1] = 1;
891
- $mlw_qmn_loaded_answer_arrays[$mlw_question_info->question_id] = array(
892
- array($mlw_question_info->answer_one, $mlw_question_info->answer_one_points, $mlw_answer_array_correct[0]),
893
- array($mlw_question_info->answer_two, $mlw_question_info->answer_two_points, $mlw_answer_array_correct[1]),
894
- array($mlw_question_info->answer_three, $mlw_question_info->answer_three_points, $mlw_answer_array_correct[2]),
895
- array($mlw_question_info->answer_four, $mlw_question_info->answer_four_points, $mlw_answer_array_correct[3]),
896
- array($mlw_question_info->answer_five, $mlw_question_info->answer_five_points, $mlw_answer_array_correct[4]),
897
- array($mlw_question_info->answer_six, $mlw_question_info->answer_six_points, $mlw_answer_array_correct[5]));
898
- }
899
- else
900
- {
901
- $mlw_qmn_loaded_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each;
902
- }
903
- }
904
-
905
- //Variables needed for scoring
906
- $mlw_points = 0;
907
- $mlw_correct = 0;
908
- $mlw_total_questions = 0;
909
- $mlw_total_score = 0;
910
- $mlw_question_answers = "";
911
- isset($_POST["total_questions"]) ? $mlw_total_questions = intval($_POST["total_questions"]) : $mlw_total_questions = 0;
912
-
913
- //Update the amount of times the quiz has been taken
914
- $mlw_taken = $mlw_quiz_options->quiz_taken;
915
- $mlw_taken += 1;
916
- $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_taken='".$mlw_taken."' WHERE quiz_id=".$mlw_quiz_id;
917
- $results = $wpdb->query( $update );
918
-
919
- //See which answers were correct and award points if necessary
920
- $mlw_user_text = "";
921
- $mlw_correct_text = "";
922
- $mlw_qmn_answer_array = array();
923
- foreach($mlw_questions as $mlw_question) {
924
- $mlw_user_text = "";
925
- $mlw_correct_text = "";
926
- if ( isset($_POST["question".$mlw_question->question_id]) || isset($_POST["mlwComment".$mlw_question->question_id]) )
927
- {
928
- if ( $mlw_question->question_type == 0 || $mlw_question->question_type == 1 || $mlw_question->question_type == 2)
929
- {
930
- if (isset($_POST["question".$mlw_question->question_id]))
931
- {
932
- $mlw_user_answer = $_POST["question".$mlw_question->question_id];
933
- }
934
- else
935
- {
936
- $mlw_user_answer = " ";
937
- }
938
- $mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id];
939
- foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each)
940
- {
941
- if (htmlspecialchars(stripslashes($mlw_user_answer), ENT_QUOTES) == esc_attr($mlw_qmn_question_answers_each[0]))
942
- {
943
- $mlw_points += $mlw_qmn_question_answers_each[1];
944
- $mlw_user_text .= strval(htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES));
945
- if ($mlw_qmn_question_answers_each[2] == 1)
946
- {
947
- $mlw_correct += 1;
948
- }
949
- }
950
- if ($mlw_qmn_question_answers_each[2] == 1)
951
- {
952
- $mlw_correct_text .= htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES);
953
- }
954
- }
955
- }
956
- elseif ( $mlw_question->question_type == 3 || $mlw_question->question_type == 5 || $mlw_question->question_type == 7)
957
- {
958
- if (isset($_POST["question".$mlw_question->question_id]))
959
- {
960
- $mlw_user_answer = $_POST["question".$mlw_question->question_id];
961
- }
962
- else
963
- {
964
- $mlw_user_answer = " ";
965
- }
966
- $mlw_user_text .= strval(stripslashes(htmlspecialchars_decode($mlw_user_answer, ENT_QUOTES)));
967
- $mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id];
968
- foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each)
969
- {
970
- $mlw_correct_text = strval(htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES));
971
- if (strtoupper($mlw_user_text) == strtoupper($mlw_correct_text))
972
- {
973
- $mlw_correct += 1;
974
- $mlw_points += $mlw_qmn_question_answers_each[1];
975
- break;
976
- }
977
- }
978
- }
979
- elseif ( $mlw_question->question_type == 4 || $mlw_question->question_type == 10)
980
- {
981
- $mlw_qmn_user_correct_answers = 0;
982
- $mlw_qmn_total_correct_answers = 0;
983
- $mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id];
984
- $mlw_qmn_total_answers = count($mlw_qmn_question_answers_array);
985
- foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each)
986
- {
987
- for ($i = 1; $i <= $mlw_qmn_total_answers; $i++) {
988
- if (isset($_POST["question".$mlw_question->question_id."_".$i]) && htmlspecialchars(stripslashes($_POST["question".$mlw_question->question_id."_".$i]), ENT_QUOTES) == esc_attr($mlw_qmn_question_answers_each[0]))
989
- {
990
- $mlw_points += $mlw_qmn_question_answers_each[1];
991
- $mlw_user_text .= strval(htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES)).".";
992
- if ($mlw_qmn_question_answers_each[2] == 1)
993
- {
994
- $mlw_qmn_user_correct_answers += 1;
995
- }
996
- else
997
- {
998
- $mlw_qmn_user_correct_answers = -1;
999
- }
1000
- }
1001
- }
1002
- if ($mlw_qmn_question_answers_each[2] == 1)
1003
- {
1004
- $mlw_correct_text .= htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES).".";
1005
- $mlw_qmn_total_correct_answers++;
1006
- }
1007
- }
1008
- if ($mlw_qmn_user_correct_answers == $mlw_qmn_total_correct_answers)
1009
- {
1010
- $mlw_correct += 1;
1011
- }
1012
- }
1013
- if (isset($_POST["mlwComment".$mlw_question->question_id]))
1014
- {
1015
- $mlw_qm_question_comment = $_POST["mlwComment".$mlw_question->question_id];
1016
- }
1017
- else
1018
- {
1019
- $mlw_qm_question_comment = "";
1020
- }
1021
-
1022
- $mlw_question_answer_display = htmlspecialchars_decode($mlw_quiz_options->question_answer_template, ENT_QUOTES);
1023
- $mlw_question_answer_display = str_replace( "%QUESTION%" , htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES), $mlw_question_answer_display);
1024
- $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , $mlw_user_text, $mlw_question_answer_display);
1025
- $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER%" , $mlw_correct_text, $mlw_question_answer_display);
1026
- $mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $mlw_qm_question_comment, $mlw_question_answer_display);
1027
- $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($mlw_question->question_answer_info, ENT_QUOTES), $mlw_question_answer_display);
1028
-
1029
- $mlw_qmn_answer_array[] = array($mlw_question->question_name, htmlspecialchars($mlw_user_text, ENT_QUOTES), htmlspecialchars($mlw_correct_text, ENT_QUOTES), htmlspecialchars(stripslashes($mlw_qm_question_comment), ENT_QUOTES));
1030
-
1031
- $mlw_question_answers .= $mlw_question_answer_display;
1032
- $mlw_question_answers .= "<br />";
1033
- }
1034
- }
1035
-
1036
- //Calculate Total Percent Score And Average Points Only If Total Questions Doesn't Equal Zero To Avoid Division By Zero Error
1037
- if ($mlw_total_questions != 0)
1038
- {
1039
- $mlw_total_score = round((($mlw_correct/$mlw_total_questions)*100), 2);
1040
- $mlw_average_points = round(($mlw_points/$mlw_total_questions), 2);
1041
- }
1042
- else
1043
- {
1044
- $mlw_total_score = 0;
1045
- $mlw_average_points = 0;
1046
- }
1047
-
1048
- //Prepare comment section if set
1049
- if (isset($_POST["mlwQuizComments"]))
1050
- {
1051
- $mlw_qm_quiz_comments = $_POST["mlwQuizComments"];
1052
- }
1053
- else
1054
- {
1055
- $mlw_qm_quiz_comments = "";
1056
- }
1057
-
1058
-
1059
- //Prepare Certificate
1060
- $mlw_certificate_link = "";
1061
- $mlw_certificate_options = unserialize($mlw_quiz_options->certificate_template);
1062
- if (!is_array($mlw_certificate_options)) {
1063
- // something went wrong, initialize to empty array
1064
- $mlw_certificate_options = array('Enter title here', 'Enter text here', '', '', 1);
1065
- }
1066
- if ($mlw_certificate_options[4] == 0)
1067
- {
1068
- $mlw_message_certificate = $mlw_certificate_options[1];
1069
- $mlw_message_certificate = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_certificate);
1070
- $mlw_message_certificate = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_certificate);
1071
- $mlw_message_certificate = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_certificate);
1072
- $mlw_message_certificate = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_certificate);
1073
- $mlw_message_certificate = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_certificate);
1074
- $mlw_message_certificate = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_certificate);
1075
- $mlw_message_certificate = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_certificate);
1076
- $mlw_message_certificate = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_certificate);
1077
- $mlw_message_certificate = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_certificate);
1078
- $mlw_message_certificate = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_certificate);
1079
- $mlw_message_certificate = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_certificate);
1080
- $mlw_message_certificate = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_certificate);
1081
- $mlw_message_certificate = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_certificate);
1082
- $mlw_message_certificate = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_certificate);
1083
- $mlw_message_certificate = str_replace( "\n" , "<br>", $mlw_message_certificate);
1084
- $mlw_plugindirpath = plugin_dir_path( __FILE__ );
1085
- $plugindirpath=plugin_dir_path( __FILE__ );
1086
- $mlw_qmn_certificate_file=<<<EOC
1087
- <?php
1088
- include("$plugindirpath/WriteHTML.php");
1089
- \$pdf=new PDF_HTML();
1090
- \$pdf->AddPage('L');
1091
- EOC;
1092
- $mlw_qmn_certificate_file.=$mlw_certificate_options[3] != '' ? '$pdf->Image("'.$mlw_certificate_options[3].'",0,0,$pdf->w, $pdf->h);' : '';
1093
- $mlw_qmn_certificate_file.=<<<EOC
1094
- \$pdf->Ln(20);
1095
- \$pdf->SetFont('Arial','B',24);
1096
- \$pdf->MultiCell(280,20,'$mlw_certificate_options[0]',0,'C');
1097
- \$pdf->Ln(15);
1098
- \$pdf->SetFont('Arial','',16);
1099
- \$pdf->WriteHTML("<p align='center'>$mlw_message_certificate</p>");
1100
- EOC;
1101
- $mlw_qmn_certificate_file.=$mlw_certificate_options[2] != '' ? '$pdf->Image("'.$mlw_certificate_options[2].'",110,130);' : '';
1102
- $mlw_qmn_certificate_file.=<<<EOC
1103
- \$pdf->Output('mlw_qmn_certificate.pdf','D');
1104
- unlink(__FILE__);
1105
- EOC;
1106
- $mlw_qmn_certificate_filename = str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
1107
- file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file);
1108
- $mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
1109
- $mlw_certificate_link = "<a href='".$mlw_qmn_certificate_filename."' style='color: blue;'>Download Certificate</a>";
1110
- }
1111
-
1112
- /*
1113
- Prepare the landing page
1114
- -First, unserialize message_after column
1115
- -Second, check for array in case user has not updated
1116
- Message array = (array( bottomvalue, topvalue, text),array( bottomvalue, topvalue, text), etc..., array(0,0,text))
1117
- */
1118
- $mlw_message_after_array = @unserialize($mlw_quiz_options->message_after);
1119
- if (is_array($mlw_message_after_array))
1120
- {
1121
- //Cycle through landing pages
1122
- foreach($mlw_message_after_array as $mlw_each)
1123
- {
1124
- //Check to see if default
1125
- if ($mlw_each[0] == 0 && $mlw_each[1] == 0)
1126
- {
1127
- $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1128
- $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1129
- $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1130
- $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1131
- $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1132
- $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1133
- $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1134
- $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1135
- $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1136
- $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1137
- $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1138
- $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1139
- $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1140
- $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1141
- $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1142
- $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1143
- $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1144
- $mlw_display .= $mlw_message_after;
1145
- break;
1146
- }
1147
- else
1148
- {
1149
- //Check to see if points fall in correct range
1150
- if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1])
1151
- {
1152
- $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1153
- $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1154
- $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1155
- $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1156
- $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1157
- $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1158
- $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1159
- $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1160
- $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1161
- $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1162
- $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1163
- $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1164
- $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1165
- $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1166
- $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1167
- $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1168
- $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1169
- $mlw_display .= $mlw_message_after;
1170
- break;
1171
- }
1172
- //Check to see if score fall in correct range
1173
- if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1])
1174
- {
1175
- $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1176
- $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1177
- $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1178
- $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1179
- $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1180
- $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1181
- $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1182
- $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1183
- $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1184
- $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1185
- $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1186
- $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1187
- $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1188
- $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1189
- $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1190
- $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1191
- $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1192
- $mlw_display .= $mlw_message_after;
1193
- break;
1194
- }
1195
- }
1196
- }
1197
- }
1198
- else
1199
- {
1200
- //Prepare the after quiz message
1201
- $mlw_message_after = htmlspecialchars_decode($mlw_quiz_options->message_after, ENT_QUOTES);
1202
- $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1203
- $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1204
- $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1205
- $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1206
- $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1207
- $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1208
- $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1209
- $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1210
- $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1211
- $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1212
- $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1213
- $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1214
- $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1215
- $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1216
- $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1217
- $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1218
- $mlw_display .= $mlw_message_after;
1219
- }
1220
-
1221
- if ($mlw_quiz_options->social_media == 1)
1222
- {
1223
- ?>
1224
- <script>
1225
- function mlw_qmn_share(network, mlw_qmn_social_text, mlw_qmn_title)
1226
- {
1227
- var sTop = window.screen.height/2-(218);
1228
- var sLeft = window.screen.width/2-(313);
1229
- var sqShareOptions = "height=400,width=580,toolbar=0,status=0,location=0,menubar=0,directories=0,scrollbars=0,top=" + sTop + ",left=" + sLeft;
1230
- var pageUrl = window.location.href;
1231
- var pageUrlEncoded = encodeURIComponent(pageUrl);
1232
- if (network == 1)
1233
- {
1234
- var Url = "https://www.facebook.com/dialog/feed?"
1235
- + "display=popup&"
1236
- + "app_id=483815031724529&"
1237
- + "link=" + pageUrlEncoded + "&"
1238
- + "name=" + encodeURIComponent(mlw_qmn_social_text) + "&"
1239
- + "description= &"
1240
- + "redirect_uri=http://www.mylocalwebstop.com/mlw_qmn_close.html";
1241
- }
1242
- if (network == 2)
1243
- {
1244
- var Url = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(mlw_qmn_social_text);
1245
- }
1246
- window.open(Url, "Share", sqShareOptions);
1247
- return false;
1248
- }
1249
- </script>
1250
- <?php
1251
- $mlw_social_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_quiz_options->social_media_text);
1252
- $mlw_social_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_social_message);
1253
- $mlw_social_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_social_message);
1254
- $mlw_social_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_social_message);
1255
- $mlw_social_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_social_message);
1256
- $mlw_social_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_social_message);
1257
- $mlw_social_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_social_message);
1258
- $mlw_social_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_social_message);
1259
- $mlw_display .= "<br />
1260
- <a class=\"mlw_qmn_quiz_link\" style=\"display: inline; vertical-align:top !important;font-weight: bold; cursor: pointer;text-decoration: none;\" onclick=\"mlw_qmn_share(1, '".esc_js($mlw_social_message)."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Facebook</a>
1261
- <a class=\"mlw_qmn_quiz_link\" style=\"display: inline; vertical-align:top !important;font-weight: bold; cursor: pointer;text-decoration: none;\" onclick=\"mlw_qmn_share(2, '".esc_js($mlw_social_message)."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Twitter</a>
1262
- <br />";
1263
- }
1264
-
1265
- //Switch email type to HTML
1266
- add_filter( 'wp_mail_content_type', 'mlw_qmn_set_html_content_type' );
1267
-
1268
- /*
1269
- Prepare and send the user email
1270
- - First, check to see if user_email_template is the newer array format, if not use it as the template
1271
- - If it is an array, check to see if the score meets the parameter of one of the templates. If, not send the default
1272
- */
1273
- $mlw_message = "";
1274
- if ($mlw_quiz_options->send_user_email == "0")
1275
- {
1276
- if ($mlw_user_email != "")
1277
- {
1278
- $mlw_user_email_array = @unserialize($mlw_quiz_options->user_email_template);
1279
- if (is_array($mlw_user_email_array))
1280
- {
1281
- //Cycle through landing pages
1282
- foreach($mlw_user_email_array as $mlw_each)
1283
- {
1284
-
1285
- //Generate Email Subject
1286
- if (!isset($mlw_each[3]))
1287
- {
1288
- $mlw_each[3] = "Quiz Results For %QUIZ_NAME";
1289
- }
1290
- $mlw_each[3] = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_each[3]);
1291
- $mlw_each[3] = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_each[3]);
1292
- $mlw_each[3] = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_each[3]);
1293
- $mlw_each[3] = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_each[3]);
1294
- $mlw_each[3] = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_each[3]);
1295
- $mlw_each[3] = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_each[3]);
1296
- $mlw_each[3] = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_each[3]);
1297
- $mlw_each[3] = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_each[3]);
1298
- $mlw_each[3] = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_each[3]);
1299
- $mlw_each[3] = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_each[3]);
1300
- $mlw_each[3] = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_each[3]);
1301
- $mlw_each[3] = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_each[3]);
1302
-
1303
-
1304
- //Check to see if default
1305
- if ($mlw_each[0] == 0 && $mlw_each[1] == 0)
1306
- {
1307
- $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1308
- $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1309
- $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1310
- $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1311
- $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1312
- $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1313
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1314
- $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1315
- $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1316
- $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1317
- $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1318
- $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1319
- $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1320
- $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1321
- $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1322
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1323
- $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1324
- $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1325
- $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1326
- $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
1327
- wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers);
1328
- break;
1329
- }
1330
- else
1331
- {
1332
- //Check to see if points fall in correct range
1333
- if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1])
1334
- {
1335
- $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1336
- $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1337
- $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1338
- $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1339
- $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1340
- $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1341
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1342
- $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1343
- $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1344
- $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1345
- $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1346
- $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1347
- $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1348
- $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1349
- $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1350
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1351
- $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1352
- $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1353
- $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1354
- $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
1355
- wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers);
1356
- break;
1357
- }
1358
-
1359
- //Check to see if score fall in correct range
1360
- if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1])
1361
- {
1362
- $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1363
- $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1364
- $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1365
- $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1366
- $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1367
- $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1368
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1369
- $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1370
- $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1371
- $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1372
- $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1373
- $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1374
- $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1375
- $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1376
- $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1377
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1378
- $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1379
- $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1380
- $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1381
- $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
1382
- wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers);
1383
- break;
1384
- }
1385
- }
1386
- }
1387
- }
1388
- else
1389
- {
1390
- $mlw_message = htmlspecialchars_decode($mlw_quiz_options->user_email_template, ENT_QUOTES);
1391
- $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1392
- $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1393
- $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1394
- $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1395
- $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1396
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1397
- $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1398
- $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1399
- $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1400
- $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1401
- $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1402
- $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1403
- $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1404
- $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1405
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1406
- $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1407
- $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1408
- $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1409
- $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
1410
- wp_mail($mlw_user_email, "Quiz Results For ".$mlw_quiz_options->quiz_name, $mlw_message, $mlw_headers);
1411
- }
1412
- }
1413
- }
1414
-
1415
- //Prepare and send the admin email
1416
- $mlw_message = "";
1417
- if ($mlw_quiz_options->send_admin_email == "0")
1418
- {
1419
- $mlw_message = htmlspecialchars_decode($mlw_quiz_options->admin_email_template, ENT_QUOTES);
1420
- $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1421
- $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1422
- $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1423
- $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1424
- $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1425
- $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1426
- $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1427
- $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1428
- $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1429
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1430
- $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1431
- $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1432
- $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1433
- $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1434
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1435
- if ( get_option('mlw_advert_shows') == 'true' ) {$mlw_message .= "<br>This email was generated by the Quiz Master Next script by Frank Corso";}
1436
- $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1437
- $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1438
- $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1439
- $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
1440
- $mlw_qmn_admin_emails = explode(",", $mlw_quiz_options->admin_email);
1441
- foreach($mlw_qmn_admin_emails as $admin_email)
1442
- {
1443
- wp_mail($admin_email, "Quiz Results For ".$mlw_quiz_options->quiz_name, $mlw_message, $mlw_headers);
1444
- }
1445
- }
1446
-
1447
- //Remove HTML type for emails
1448
- remove_filter( 'wp_mail_content_type', 'mlw_qmn_set_html_content_type' );
1449
-
1450
- //Save the results into database
1451
- $mlw_quiz_results_array = array( intval($mlw_qmn_timer), $mlw_qmn_answer_array, htmlspecialchars(stripslashes($mlw_qm_quiz_comments), ENT_QUOTES));
1452
- $mlw_quiz_results = serialize($mlw_quiz_results_array);
1453
-
1454
- global $wpdb;
1455
- $table_name = $wpdb->prefix . "mlw_results";
1456
- $results = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $table_name . " (result_id, quiz_id, quiz_name, quiz_system, point_score, correct_score, correct, total, name, business, email, phone, user, time_taken, time_taken_real, quiz_results, deleted) VALUES (NULL, %d, '%s', %d, %d, %d, %d, %d, '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', 0)", $mlw_quiz_id, $mlw_quiz_options->quiz_name, $mlw_quiz_options->system, $mlw_points, $mlw_total_score, $mlw_correct, $mlw_total_questions, $mlw_user_name, $mlw_user_comp, $mlw_user_email, $mlw_user_phone, get_current_user_id(), date("h:i:s A m/d/Y"), date("Y-m-d H:i:s"), $mlw_quiz_results) );
1457
-
1458
- //Integration Action
1459
- do_action('mlw_qmn_load_results_page');
1460
- }
1461
- else
1462
- {
1463
- if (!$mlw_qmn_isAllowed)
1464
- {
1465
- $current_user = wp_get_current_user();
1466
- $mlw_message = htmlspecialchars_decode($mlw_quiz_options->total_user_tries_text, ENT_QUOTES);
1467
- $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1468
- $mlw_message = str_replace( "%USER_NAME%" , $current_user->display_name, $mlw_message);
1469
- $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1470
- $mlw_display .= $mlw_message;
1471
- }
1472
- elseif (isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] != $_POST["mlw_code_captcha"])
1473
- {
1474
- $mlw_display .= "There was an issue with the captcha verification. Please try again.";
1475
- }
1476
- else { $mlw_display .= "Thank you."; }
1477
- }
1478
- }
1479
- return $mlw_display;
1480
- }
1481
-
1482
-
1483
- /*
1484
- This function displays fields to ask for contact information
1485
- */
1486
- function mlwDisplayContactInfo($mlw_quiz_options)
1487
- {
1488
- $mlw_contact_display = "";
1489
- //Check to see if user is logged in, then ask for contact if not
1490
- if ( is_user_logged_in() )
1491
- {
1492
- //If this quiz does not let user edit contact information we hide this section
1493
- if ($mlw_quiz_options->loggedin_user_contact == 1)
1494
- {
1495
- $mlw_contact_display .= "<div style='display:none;'>";
1496
- }
1497
-
1498
- //Retrieve current user information and save into text fields for contact information
1499
- $current_user = wp_get_current_user();
1500
- if ($mlw_quiz_options->user_name != 2)
1501
- {
1502
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span><br />";
1503
- $mlw_contact_display .= "<input type='text' x-webkit-speech name='mlwUserName' value='".$current_user->display_name."' />";
1504
- $mlw_contact_display .= "<br /><br />";
1505
-
1506
- }
1507
- if ($mlw_quiz_options->user_comp != 2)
1508
- {
1509
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span><br />";
1510
- $mlw_contact_display .= "<input type='text' x-webkit-speech name='mlwUserComp' value='' />";
1511
- $mlw_contact_display .= "<br /><br />";
1512
- }
1513
- if ($mlw_quiz_options->user_email != 2)
1514
- {
1515
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span><br />";
1516
- $mlw_contact_display .= "<input type='text' x-webkit-speech name='mlwUserEmail' value='".$current_user->user_email."' />";
1517
- $mlw_contact_display .= "<br /><br />";
1518
- }
1519
- if ($mlw_quiz_options->user_phone != 2)
1520
- {
1521
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span><br />";
1522
- $mlw_contact_display .= "<input type='text' x-webkit-speech name='mlwUserPhone' value='' />";
1523
- $mlw_contact_display .= "<br /><br />";
1524
- }
1525
-
1526
- //End of hidden section div
1527
- if ($mlw_quiz_options->loggedin_user_contact == 1)
1528
- {
1529
- $mlw_contact_display .= "</div>";
1530
- }
1531
- }
1532
- else
1533
- {
1534
- //See if the site wants to ask for any contact information, then ask for it
1535
- if ($mlw_quiz_options->user_name != 2)
1536
- {
1537
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span><br />";
1538
- $mlw_contact_display .= "<input type='text' x-webkit-speech name='mlwUserName' value='' />";
1539
- $mlw_contact_display .= "<br /><br />";
1540
- }
1541
- if ($mlw_quiz_options->user_comp != 2)
1542
- {
1543
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span><br />";
1544
- $mlw_contact_display .= "<input type='text' x-webkit-speech name='mlwUserComp' value='' />";
1545
- $mlw_contact_display .= "<br /><br />";
1546
- }
1547
- if ($mlw_quiz_options->user_email != 2)
1548
- {
1549
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span><br />";
1550
- $mlw_contact_display .= "<input type='text' x-webkit-speech name='mlwUserEmail' value='' />";
1551
- $mlw_contact_display .= "<br /><br />";
1552
- }
1553
- if ($mlw_quiz_options->user_phone != 2)
1554
- {
1555
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span><br />";
1556
- $mlw_contact_display .= "<input type='text' x-webkit-speech name='mlwUserPhone' value='' />";
1557
- $mlw_contact_display .= "<br /><br />";
1558
- }
1559
- }
1560
- return $mlw_contact_display;
1561
- }
1562
-
1563
- /*
1564
- This function helps set the email type to HTML
1565
- */
1566
- function mlw_qmn_set_html_content_type() {
1567
-
1568
- return 'text/html';
1569
- }
1570
  ?>
1
+ <?php
2
+ /*
3
+ This function is the very heart of the plugin. This function displays the quiz to the user as well as handles all the scripts that are part of the quiz. Please be very careful if you are editing this script without my assistance.
4
+ */
5
+ function mlw_quiz_shortcode($atts)
6
+ {
7
+ extract(shortcode_atts(array(
8
+ 'quiz' => 0
9
+ ), $atts));
10
+
11
+
12
+
13
+ /*
14
+ Code before loading the quiz
15
+ */
16
+
17
+ //Variables needed throughout script
18
+ $mlw_quiz_id = intval($quiz);
19
+ $GLOBALS['mlw_qmn_quiz'] = $mlw_quiz_id;
20
+ $mlw_display = "";
21
+ global $wpdb;
22
+ $mlw_qmn_isAllowed = true;
23
+ $mlw_qmn_section_count = 1;
24
+ $mlw_qmn_section_limit = 0;
25
+
26
+
27
+ //Load quiz
28
+ $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_quizzes" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0'";
29
+ $mlw_quiz_options = $wpdb->get_results($sql);
30
+
31
+ foreach($mlw_quiz_options as $mlw_eaches) {
32
+ $mlw_quiz_options = $mlw_eaches;
33
+ break;
34
+ }
35
+
36
+ //Check to see if there is limit on the amount of tries
37
+ if ( $mlw_quiz_options->total_user_tries != 0 && is_user_logged_in() )
38
+ {
39
+ $current_user = wp_get_current_user();
40
+ $mlw_qmn_user_try_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE email='%s' AND deleted='0' AND quiz_id=%d", $current_user->user_email, $mlw_quiz_id ) );
41
+ if ($mlw_qmn_user_try_count >= $mlw_quiz_options->total_user_tries) { $mlw_qmn_isAllowed = false; }
42
+ }
43
+
44
+
45
+ //Load questions
46
+ $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' ";
47
+ if ($mlw_quiz_options->randomness_order == 0)
48
+ {
49
+ $sql .= "ORDER BY question_order ASC";
50
+ }
51
+ if ($mlw_quiz_options->randomness_order == 1 || $mlw_quiz_options->randomness_order == 2)
52
+ {
53
+ $sql .= "ORDER BY rand()";
54
+ }
55
+ if ($mlw_quiz_options->question_from_total != 0)
56
+ {
57
+ $sql .= " LIMIT ".$mlw_quiz_options->question_from_total;
58
+ }
59
+ $mlw_questions = $wpdb->get_results($sql);
60
+
61
+
62
+ //Load and prepare answer arrays
63
+ $mlw_qmn_answer_arrays = array();
64
+ foreach($mlw_questions as $mlw_question_info) {
65
+ $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array);
66
+ if ( !is_array($mlw_qmn_answer_array_each) )
67
+ {
68
+ $mlw_answer_array_correct = array(0, 0, 0, 0, 0, 0);
69
+ $mlw_answer_array_correct[$mlw_question_info->correct_answer-1] = 1;
70
+ $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = array(
71
+ array($mlw_question_info->answer_one, $mlw_question_info->answer_one_points, $mlw_answer_array_correct[0]),
72
+ array($mlw_question_info->answer_two, $mlw_question_info->answer_two_points, $mlw_answer_array_correct[1]),
73
+ array($mlw_question_info->answer_three, $mlw_question_info->answer_three_points, $mlw_answer_array_correct[2]),
74
+ array($mlw_question_info->answer_four, $mlw_question_info->answer_four_points, $mlw_answer_array_correct[3]),
75
+ array($mlw_question_info->answer_five, $mlw_question_info->answer_five_points, $mlw_answer_array_correct[4]),
76
+ array($mlw_question_info->answer_six, $mlw_question_info->answer_six_points, $mlw_answer_array_correct[5]));
77
+ }
78
+ else
79
+ {
80
+ $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each;
81
+ }
82
+ }
83
+
84
+
85
+ //Variables to load if quiz has been taken
86
+ if (isset($_POST["complete_quiz"]) && $_POST["complete_quiz"] == "confirmation")
87
+ {
88
+ $mlw_success = $_POST["complete_quiz"];
89
+ $mlw_user_name = isset($_POST["mlwUserName"]) ? $_POST["mlwUserName"] : 'None';
90
+ $mlw_user_comp = isset($_POST["mlwUserComp"]) ? $_POST["mlwUserComp"] : 'None';
91
+ $mlw_user_email = isset($_POST["mlwUserEmail"]) ? $_POST["mlwUserEmail"] : 'None';
92
+ $mlw_user_phone = isset($_POST["mlwUserPhone"]) ? $_POST["mlwUserPhone"] : 'None';
93
+ $mlw_qmn_timer = isset($_POST["timer"]) ? $_POST["timer"] : 0;
94
+ $mlw_spam_email = $_POST["email"];
95
+ }
96
+
97
+ wp_enqueue_script( 'json2' );
98
+ wp_enqueue_script( 'jquery' );
99
+ wp_enqueue_script( 'jquery-ui-core' );
100
+ wp_enqueue_script( 'jquery-effects-core' );
101
+ wp_enqueue_script( 'jquery-effects-slide' );
102
+ wp_enqueue_script( 'jquery-ui-dialog' );
103
+ wp_enqueue_script( 'jquery-ui-button' );
104
+ wp_enqueue_script( 'jquery-ui-accordion' );
105
+ wp_enqueue_script( 'jquery-ui-tooltip' );
106
+ wp_enqueue_script( 'jquery-ui-tabs' );
107
+ ?>
108
+ <!-- css -->
109
+ <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
110
+ <script type="text/javascript">
111
+ setTimeout(function(){
112
+ var $j = jQuery.noConflict();
113
+ // increase the default animation speed to exaggerate the effect
114
+ $j.fx.speeds._default = 1000;
115
+ $j(function() {
116
+ $j( ".mlw_qmn_quiz" ).tooltip();
117
+ });
118
+ }, 100);
119
+ setTimeout(function()
120
+ {
121
+ var $j = jQuery.noConflict();
122
+ $j('.mlw_qmn_quiz input').on('keypress', function (e) {
123
+ if (e.which === 13) {
124
+ e.preventDefault();
125
+ }
126
+ });
127
+ }, 100);
128
+ </script>
129
+ <style type="text/css">
130
+ .ui-tooltip
131
+ {
132
+ /* tooltip container box */
133
+ max-width: 500px !important;
134
+ }
135
+ .ui-tooltip-content
136
+ {
137
+ /* tooltip content */
138
+ max-width: 500px !important;
139
+ }
140
+ </style>
141
+
142
+ <?php
143
+ if ($mlw_quiz_options->theme_selected == "default")
144
+ {
145
+ echo "<style type='text/css'>".$mlw_quiz_options->quiz_stye."</style>";
146
+ }
147
+ else
148
+ {
149
+ echo "<link type='text/css' href='".get_option('mlw_qmn_theme_'.$mlw_quiz_options->theme_selected)."' rel='stylesheet' />";
150
+ }
151
+
152
+ /*
153
+ The following code is for displaying the quiz and completion screen
154
+ */
155
+
156
+ //If there is no quiz for the shortcode provided
157
+ if ($mlw_quiz_options->quiz_name == "")
158
+ {
159
+ $mlw_display .= "It appears that this quiz is not set up correctly.";
160
+ return $mlw_display;
161
+ }
162
+
163
+
164
+
165
+ //Display Quiz
166
+ if (!isset($_POST["complete_quiz"]) && $mlw_quiz_options->quiz_name != "" && $mlw_qmn_isAllowed)
167
+ {
168
+ $mlw_qmn_total_questions = 0;
169
+ //Calculate number of pages if pagination is turned on
170
+ if ($mlw_quiz_options->pagination != 0)
171
+ {
172
+ $mlw_qmn_section_limit = 2 + count($mlw_questions);
173
+ if ($mlw_quiz_options->comment_section == 0)
174
+ {
175
+ $mlw_qmn_section_limit = $mlw_qmn_section_limit + 1;
176
+ }
177
+
178
+ //Gather text for pagination buttons
179
+ $mlw_qmn_pagination_text = "";
180
+ $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text);
181
+ if (!is_array($mlw_qmn_pagination_text)) {
182
+ $mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text);
183
+ }
184
+ ?>
185
+ <script type="text/javascript">
186
+ setTimeout(function(){
187
+ var $j = jQuery.noConflict();
188
+ $j( ".quiz_section" ).hide();
189
+ $j( ".quiz_section" ).append( "<br />" );
190
+ $j( ".mlw_qmn_quiz" ).append( "<a class=\"mlw_qmn_quiz_link mlw_previous\" href=\"javascript:prevSlide(<?php echo $mlw_quiz_options->pagination; ?>, 1);\"><?php echo $mlw_qmn_pagination_text[0]; ?></a>" );
191
+ $j( ".mlw_qmn_quiz" ).append( "<a class=\"mlw_qmn_quiz_link mlw_next\" href=\"javascript:nextSlide(<?php echo $mlw_quiz_options->pagination; ?>, 1);\"><?php echo $mlw_qmn_pagination_text[1]; ?></a>" );
192
+ window.mlw_quiz_slide = 0;
193
+ window.mlw_previous = 0;
194
+ window.mlw_quiz_total_slides = <?php echo $mlw_qmn_section_limit; ?>;
195
+ nextSlide(1, 0);
196
+ }, 100);
197
+ function nextSlide(mlw_pagination, mlw_goto_top)
198
+ {
199
+ jQuery( ".quiz_section" ).hide();
200
+ for (var i = 0; i < mlw_pagination; i++)
201
+ {
202
+ if (i == 0 && window.mlw_previous == 1 && window.mlw_quiz_slide > 1)
203
+ {
204
+ window.mlw_quiz_slide = window.mlw_quiz_slide + mlw_pagination;
205
+ }
206
+ else
207
+ {
208
+ window.mlw_quiz_slide++;
209
+ }
210
+ if (window.mlw_quiz_slide < 1)
211
+ {
212
+ window.mlw_quiz_slide = 1;
213
+ }
214
+ if (window.mlw_quiz_slide == 1)
215
+ {
216
+ jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
217
+ }
218
+ if (window.mlw_quiz_slide > 1)
219
+ {
220
+ jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).show();
221
+ }
222
+ if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
223
+ {
224
+ jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
225
+ }
226
+ if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
227
+ {
228
+ jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
229
+ }
230
+ jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
231
+ }
232
+ window.mlw_previous = 0;
233
+ if (mlw_goto_top == 1)
234
+ {
235
+ window.location.hash = "mlw_does_not_exist";
236
+ window.location.hash = "mlw_top_of_quiz";
237
+ }
238
+
239
+ }
240
+ function prevSlide(mlw_pagination, mlw_goto_top)
241
+ {
242
+ jQuery( ".quiz_section" ).hide();
243
+ for (var i = 0; i < mlw_pagination; i++)
244
+ {
245
+ if (i == 0 && window.mlw_previous == 0)
246
+ {
247
+ window.mlw_quiz_slide = window.mlw_quiz_slide - mlw_pagination;
248
+ }
249
+ else
250
+ {
251
+ window.mlw_quiz_slide--;
252
+ }
253
+ if (window.mlw_quiz_slide < 1)
254
+ {
255
+ window.mlw_quiz_slide = 1;
256
+ }
257
+ if (window.mlw_quiz_slide == 1)
258
+ {
259
+ jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
260
+ }
261
+ if (window.mlw_quiz_slide > 1)
262
+ {
263
+ jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).show();
264
+ }
265
+ if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
266
+ {
267
+ jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
268
+ }
269
+ if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
270
+ {
271
+ jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
272
+ }
273
+ jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
274
+ }
275
+ window.mlw_previous = 1;
276
+ if (mlw_goto_top == 1)
277
+ {
278
+ window.location.hash = "mlw_does_not_exist";
279
+ window.location.hash = "mlw_top_of_quiz";
280
+ }
281
+ }
282
+ </script>
283
+ <?php
284
+ }
285
+ if ($mlw_quiz_options->timer_limit != 0)
286
+ {
287
+ ?>
288
+ <div id="mlw_qmn_timer" class="mlw_qmn_timer"></div>
289
+ <script type="text/javascript">
290
+ setTimeout(function(){
291
+ var minutes = 0;
292
+ if (window.sessionStorage.getItem('mlw_started_quiz<?php echo $mlw_quiz_id; ?>') == "yes" && window.sessionStorage.getItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>') >= 0)
293
+ {
294
+ minutes = window.sessionStorage.getItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>');
295
+ }
296
+ else
297
+ {
298
+ minutes = <?php echo $mlw_quiz_options->timer_limit; ?>;
299
+ }
300
+ window.amount = (minutes*60);
301
+ window.titleText = window.document.title;
302
+ document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
303
+ window.counter=setInterval(timer, 1000);
304
+ }, 100);
305
+ function timer()
306
+ {
307
+ window.amount=window.amount-1;
308
+ if (window.amount < 0)
309
+ {
310
+ window.amount = 0;
311
+ }
312
+ window.sessionStorage.setItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>', window.amount/60);
313
+ window.sessionStorage.setItem('mlw_started_quiz<?php echo $mlw_quiz_id; ?>', "yes");
314
+ document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
315
+ window.document.title = minToSec(window.amount) + " " + window.titleText;
316
+ if (window.amount <= 0)
317
+ {
318
+ clearInterval(window.counter);
319
+ jQuery( ".mlw_qmn_quiz input:radio" ).attr('disabled',true);
320
+ jQuery( ".mlw_qmn_quiz input:checkbox" ).attr('disabled',true);
321
+ jQuery( ".mlw_qmn_quiz select" ).attr('disabled',true);
322
+ jQuery( ".mlw_qmn_question_comment" ).attr('disabled',true);
323
+ jQuery( ".mlw_answer_open_text" ).attr('disabled',true);
324
+ //document.quizForm.submit();
325
+ return;
326
+ }
327
+ }
328
+ function minToSec(amount)
329
+ {
330
+ var minutes = Math.floor(amount/60);
331
+ var seconds = amount - (minutes * 60);
332
+ if (seconds == '0')
333
+ {
334
+ seconds = "00";
335
+ }
336
+ else if (seconds < 10)
337
+ {
338
+ seconds = '0' + seconds;
339
+ }
340
+ return minutes+":"+seconds;
341
+ }
342
+ </script>
343
+ <?php
344
+ }
345
+
346
+ ?>
347
+ <script type="text/javascript">
348
+ var myVar=setInterval("mlwQmnTimer();",1000);
349
+ function mlwQmnTimer()
350
+ {
351
+ var x = +document.getElementById("timer").value;
352
+ x = x + 1;
353
+ document.getElementById("timer").value = x;
354
+ }
355
+
356
+ </script>
357
+ <?php
358
+ //Update the quiz views
359
+ $mlw_views = $mlw_quiz_options->quiz_views;
360
+ $mlw_views += 1;
361
+ $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views='".$mlw_views."' WHERE quiz_id=".$mlw_quiz_id;
362
+ $results = $wpdb->query( $update );
363
+
364
+ //Form validation script
365
+ ?>
366
+ <script>
367
+ function clear_field(field)
368
+ {
369
+ if (field.defaultValue == field.value) field.value = '';
370
+ }
371
+
372
+ function mlw_validateForm()
373
+ {
374
+ mlw_validateResult = true;
375
+ if (document.forms['quizForm']['mlwUserEmail'].value != '')
376
+ {
377
+ var x=document.forms['quizForm']['mlwUserEmail'].value;
378
+ var atpos=x.indexOf('@');
379
+ var dotpos=x.lastIndexOf('.');
380
+ if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
381
+ {
382
+ document.getElementById('mlw_error_message').innerHTML = '**Not a valid e-mail address!**';
383
+ document.getElementById('mlw_error_message_bottom').innerHTML = '**Not a valid e-mail address!**';
384
+ mlw_validateResult = false;
385
+ }
386
+ }
387
+
388
+ jQuery('#quizForm *').filter(':input').each(function(){
389
+ jQuery(this).css("outline", "");
390
+ if (jQuery(this).attr('class'))
391
+ {
392
+ if(jQuery(this).attr('class').indexOf('mlwRequiredNumber') > -1 && this.value == "" && +this.value != NaN)
393
+ {
394
+ document.getElementById('mlw_error_message').innerHTML = '**This field must be a number!**';
395
+ document.getElementById('mlw_error_message_bottom').innerHTML = '**This field must be a number!**';
396
+ jQuery(this).css("outline", "2px solid red");
397
+ mlw_validateResult = false;
398
+ }
399
+ if(jQuery(this).attr('class').indexOf('mlwRequiredText') > -1 && this.value == "")
400
+ {
401
+ document.getElementById('mlw_error_message').innerHTML = '**Please complete all required fields!**';
402
+ document.getElementById('mlw_error_message_bottom').innerHTML = '**Please complete all required fields!**';
403
+ jQuery(this).css("outline", "2px solid red");
404
+ mlw_validateResult = false;
405
+ }
406
+ if(jQuery(this).attr('class').indexOf('mlwRequiredCaptcha') > -1 && this.value != mlw_code)
407
+ {
408
+ document.getElementById('mlw_error_message').innerHTML = '**The entered text is not correct!**';
409
+ document.getElementById('mlw_error_message_bottom').innerHTML = '**The entered text is not correct!**';
410
+ jQuery(this).css("outline", "2px solid red");
411
+ mlw_validateResult = false;
412
+ }
413
+ if(jQuery(this).attr('class').indexOf('mlwRequiredCheck') > -1 && !this.checked)
414
+ {
415
+ document.getElementById('mlw_error_message').innerHTML = '**Please complete all required fields!**';
416
+ document.getElementById('mlw_error_message_bottom').innerHTML = '**Please complete all required fields!**';
417
+ jQuery(this).css("outline", "2px solid red");
418
+ mlw_validateResult = false;
419
+ }
420
+ }
421
+ });
422
+
423
+ if (!mlw_validateResult) {return mlw_validateResult;}
424
+
425
+ jQuery( '.mlw_qmn_quiz input:radio' ).attr('disabled',false);
426
+ jQuery( '.mlw_qmn_quiz input:checkbox' ).attr('disabled',false);
427
+ jQuery( '.mlw_qmn_quiz select' ).attr('disabled',false);
428
+ jQuery( '.mlw_qmn_question_comment' ).attr('disabled',false);
429
+ jQuery( '.mlw_answer_open_text' ).attr('disabled',false);
430
+ }
431
+ </script>
432
+ <?php
433
+
434
+ if ( $mlw_quiz_options->pagination != 0) { $mlw_display .= "<style>.quiz_section { display: none; }</style>"; }
435
+
436
+ //Begin the quiz
437
+ $mlw_display .= "<div class='mlw_qmn_quiz'>";
438
+ $mlw_display .= "<form name='quizForm' id='quizForm' action='' method='post' class='mlw_quiz_form' onsubmit='return mlw_validateForm()' novalidate >";
439
+ $mlw_display .= "<span id='mlw_top_of_quiz'></span>";
440
+ $mlw_display .= "<div class='quiz_section quiz_begin slide".$mlw_qmn_section_count."'>";
441
+ $mlw_message_before = htmlspecialchars_decode($mlw_quiz_options->message_before, ENT_QUOTES);
442
+ $mlw_message_before = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_before);
443
+ $mlw_message_before = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_before);
444
+ $mlw_display .= "<span class='mlw_qmn_message_before'>".$mlw_message_before."</span><br />";
445
+ $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
446
+
447
+ if ($mlw_quiz_options->contact_info_location == 0)
448
+ {
449
+ $mlw_display .= mlwDisplayContactInfo($mlw_quiz_options);
450
+ }
451
+ $mlw_display .= "</div>";
452
+
453
+ //Display the questions
454
+ foreach($mlw_questions as $mlw_question) {
455
+ $mlw_question_settings = @unserialize($mlw_question->question_settings);
456
+ if (!is_array($mlw_question_settings))
457
+ {
458
+ $mlw_question_settings = array();
459
+ $mlw_question_settings['required'] = 1;
460
+ }
461
+ if ( !isset($mlw_question_settings['required']))
462
+ {
463
+ $mlw_question_settings['required'] = 1;
464
+ }
465
+ $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
466
+ $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
467
+ if ($mlw_question->question_type == 0)
468
+ {
469
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
470
+ $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
471
+ if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
472
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
473
+ $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
474
+ if (is_array($mlw_qmn_answer_array))
475
+ {
476
+ if ($mlw_quiz_options->randomness_order == 2)
477
+ {
478
+ shuffle($mlw_qmn_answer_array);
479
+ }
480
+ $mlw_answer_total = 0;
481
+ foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
482
+ {
483
+ $mlw_answer_total++;
484
+ if ($mlw_qmn_answer_each[0] != "")
485
+ {
486
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_".$mlw_answer_total."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> <label for='question".$mlw_question->question_id."_".$mlw_answer_total."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."</label>";
487
+ $mlw_display .= "<br />";
488
+ }
489
+ }
490
+ $mlw_display .= "<input type='radio' style='display: none;' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_none' checked='checked' value='No Answer Provided' />";
491
+ }
492
+ else
493
+ {
494
+ if ($mlw_question->answer_one != "")
495
+ {
496
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_one' value='1' /> <label for='question".$mlw_question->question_id."_one'>".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES)."</label>";
497
+ $mlw_display .= "<br />";
498
+ }
499
+ if ($mlw_question->answer_two != "")
500
+ {
501
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_two' value='2' /> <label for='question".$mlw_question->question_id."_two'>".htmlspecialchars_decode($mlw_question->answer_two, ENT_QUOTES)."</label>";
502
+ $mlw_display .= "<br />";
503
+ }
504
+ if ($mlw_question->answer_three != "")
505
+ {
506
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_three' value='3' /> <label for='question".$mlw_question->question_id."_three'>".htmlspecialchars_decode($mlw_question->answer_three, ENT_QUOTES)."</label>";
507
+ $mlw_display .= "<br />";
508
+ }
509
+ if ($mlw_question->answer_four != "")
510
+ {
511
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_four' value='4' /> <label for='question".$mlw_question->question_id."_four'>".htmlspecialchars_decode($mlw_question->answer_four, ENT_QUOTES)."</label>";
512
+ $mlw_display .= "<br />";
513
+ }
514
+ if ($mlw_question->answer_five != "")
515
+ {
516
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_five' value='5' /> <label for='question".$mlw_question->question_id."_five'>".htmlspecialchars_decode($mlw_question->answer_five, ENT_QUOTES)."</label>";
517
+ $mlw_display .= "<br />";
518
+ }
519
+ if ($mlw_question->answer_six != "")
520
+ {
521
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_six' value='6' /> <label for='question".$mlw_question->question_id."_six'>".htmlspecialchars_decode($mlw_question->answer_six, ENT_QUOTES)."</label>";
522
+ $mlw_display .= "<br />";
523
+ }
524
+ }
525
+ }
526
+ elseif ($mlw_question->question_type == 4)
527
+ {
528
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
529
+ $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
530
+ if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
531
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
532
+ $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
533
+ if (is_array($mlw_qmn_answer_array))
534
+ {
535
+ if ($mlw_quiz_options->randomness_order == 2)
536
+ {
537
+ shuffle($mlw_qmn_answer_array);
538
+ }
539
+ $mlw_answer_total = 0;
540
+ foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
541
+ {
542
+ $mlw_answer_total++;
543
+ if ($mlw_qmn_answer_each[0] != "")
544
+ {
545
+ $mlw_display .= "<input type='hidden' name='question".$mlw_question->question_id."' value='This value does not matter' />";
546
+ $mlw_display .= "<input type='checkbox' name='question".$mlw_question->question_id."_".$mlw_answer_total."' id='question".$mlw_question->question_id."_".$mlw_answer_total."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> <label for='question".$mlw_question->question_id."_".$mlw_answer_total."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."</label>";
547
+ $mlw_display .= "<br />";
548
+ }
549
+ }
550
+ }
551
+ }
552
+ elseif ($mlw_question->question_type == 10)
553
+ {
554
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
555
+ $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
556
+ if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
557
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
558
+ $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
559
+ if (is_array($mlw_qmn_answer_array))
560
+ {
561
+ if ($mlw_quiz_options->randomness_order == 2)
562
+ {
563
+ shuffle($mlw_qmn_answer_array);
564
+ }
565
+ $mlw_answer_total = 0;
566
+ foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
567
+ {
568
+ $mlw_answer_total++;
569
+ if ($mlw_qmn_answer_each[0] != "")
570
+ {
571
+ $mlw_display .= "<input type='hidden' name='question".$mlw_question->question_id."' value='This value does not matter' />";
572
+ $mlw_display .= "<span class='mlw_horizontal_multiple'><input type='checkbox' name='question".$mlw_question->question_id."_".$mlw_answer_total."' id='question".$mlw_question->question_id."_".$mlw_answer_total."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> <label for='question".$mlw_question->question_id."_".$mlw_answer_total."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."&nbsp;</label></span>";
573
+ }
574
+ }
575
+ }
576
+ }
577
+ elseif ($mlw_question->question_type == 1)
578
+ {
579
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
580
+ $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
581
+ if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
582
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
583
+ $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
584
+ if (is_array($mlw_qmn_answer_array))
585
+ {
586
+ if ($mlw_quiz_options->randomness_order == 2)
587
+ {
588
+ shuffle($mlw_qmn_answer_array);
589
+ }
590
+ $mlw_answer_total = 0;
591
+ foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
592
+ {
593
+ $mlw_answer_total++;
594
+ if ($mlw_qmn_answer_each[0] != "")
595
+ {
596
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> ".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)." ";
597
+ }
598
+ }
599
+ $mlw_display .= "<input type='radio' style='display: none;' name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_none' checked='checked' value='No Answer Provided' />";
600
+ }
601
+ else
602
+ {
603
+ if ($mlw_question->answer_one != "")
604
+ {
605
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='1' />".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES);
606
+ }
607
+ if ($mlw_question->answer_two != "")
608
+ {
609
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='2' />".htmlspecialchars_decode($mlw_question->answer_two, ENT_QUOTES);
610
+ }
611
+ if ($mlw_question->answer_three != "")
612
+ {
613
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='3' />".htmlspecialchars_decode($mlw_question->answer_three, ENT_QUOTES);
614
+ }
615
+ if ($mlw_question->answer_four != "")
616
+ {
617
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='4' />".htmlspecialchars_decode($mlw_question->answer_four, ENT_QUOTES);
618
+ }
619
+ if ($mlw_question->answer_five != "")
620
+ {
621
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='5' />".htmlspecialchars_decode($mlw_question->answer_five, ENT_QUOTES);
622
+ }
623
+ if ($mlw_question->answer_six != "")
624
+ {
625
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='6' />".htmlspecialchars_decode($mlw_question->answer_six, ENT_QUOTES);
626
+ }
627
+ }
628
+ $mlw_display .= "<br />";
629
+ }
630
+ elseif ($mlw_question->question_type == 2)
631
+ {
632
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
633
+ $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
634
+ if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
635
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
636
+ $mlw_display .= "<select name='question".$mlw_question->question_id."'>";
637
+ $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
638
+ if (is_array($mlw_qmn_answer_array))
639
+ {
640
+ if ($mlw_quiz_options->randomness_order == 2)
641
+ {
642
+ shuffle($mlw_qmn_answer_array);
643
+ }
644
+ $mlw_answer_total = 0;
645
+ foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
646
+ {
647
+ $mlw_answer_total++;
648
+ if ($mlw_qmn_answer_each[0] != "")
649
+ {
650
+ $mlw_display .= "<option value='".esc_attr($mlw_qmn_answer_each[0])."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."</option>";
651
+ }
652
+ }
653
+ }
654
+ else
655
+ {
656
+ if ($mlw_question->answer_one != "")
657
+ {
658
+ $mlw_display .= "<option value='1'>".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES)."</option>";
659
+ }
660
+ if ($mlw_question->answer_two != "")
661
+ {
662
+ $mlw_display .= "<option value='2'>".htmlspecialchars_decode($mlw_question->answer_two, ENT_QUOTES)."</option>";
663
+ }
664
+ if ($mlw_question->answer_three != "")
665
+ {
666
+ $mlw_display .= "<option value='3'>".htmlspecialchars_decode($mlw_question->answer_three, ENT_QUOTES)."</option>";
667
+ }
668
+ if ($mlw_question->answer_four != "")
669
+ {
670
+ $mlw_display .= "<option value='4'>".htmlspecialchars_decode($mlw_question->answer_four, ENT_QUOTES)."</option>";
671
+ }
672
+ if ($mlw_question->answer_five != "")
673
+ {
674
+ $mlw_display .= "<option value='5'>".htmlspecialchars_decode($mlw_question->answer_five, ENT_QUOTES)."</option>";
675
+ }
676
+ if ($mlw_question->answer_six != "")
677
+ {
678
+ $mlw_display .= "<option value='6'>".htmlspecialchars_decode($mlw_question->answer_six, ENT_QUOTES)."</option>";
679
+ }
680
+ }
681
+ $mlw_display .= "</select>";
682
+ $mlw_display .= "<br />";
683
+ }
684
+ elseif ($mlw_question->question_type == 5)
685
+ {
686
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
687
+ $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
688
+ if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
689
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
690
+ if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredText";} else {$mlw_requireClass = "";}
691
+ $mlw_display .= "<textarea class='mlw_answer_open_text $mlw_requireClass' cols='70' rows='5' name='question".$mlw_question->question_id."' /></textarea>";
692
+ $mlw_display .= "<br />";
693
+ }
694
+ elseif ($mlw_question->question_type == 6)
695
+ {
696
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES);
697
+ $mlw_display .= "<br />";
698
+ }
699
+ elseif ($mlw_question->question_type == 7)
700
+ {
701
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
702
+ $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
703
+ if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
704
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
705
+ if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredNumber";} else {$mlw_requireClass = "";}
706
+ $mlw_display .= "<input type='number' class='mlw_answer_number $mlw_requireClass' name='question".$mlw_question->question_id."' />";
707
+ $mlw_display .= "<br />";
708
+ }
709
+ elseif ($mlw_question->question_type == 8)
710
+ {
711
+ if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredCheck";} else {$mlw_requireClass = "";}
712
+ $mlw_display .= "<input type='checkbox' id='mlwAcceptance' class='$mlw_requireClass ' />";
713
+ $mlw_display .= "<label for='mlwAcceptance'><span class='mlw_qmn_question' style='font-weight:bold;'>".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span></label>";
714
+ $mlw_display .= "<br />";
715
+ }
716
+ elseif ($mlw_question->question_type == 9)
717
+ {
718
+ if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredCaptcha";} else {$mlw_requireClass = "";}
719
+ $mlw_display .= "<div class='mlw_captchaWrap'>";
720
+ $mlw_display .= "<canvas alt='' id='mlw_captcha' class='mlw_captcha' width='100' height='50'></canvas>";
721
+ $mlw_display .= "</div>";
722
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
723
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
724
+ $mlw_display .= "<input type='text' class='mlw_answer_open_text $mlw_requireClass' id='mlw_captcha_text' name='mlw_user_captcha'/>";
725
+ $mlw_display .= "<input type='hidden' name='mlw_code_captcha' id='mlw_code_captcha' value='none' />";
726
+ $mlw_display .= "<br />";
727
+ $mlw_display .= "<script>
728
+ var mlw_code = '';
729
+ var mlw_chars = '0123456789ABCDEFGHIJKL!@#$%^&*()MNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
730
+ var mlw_code_length = 5;
731
+ for (var i=0; i<mlw_code_length; i++) {
732
+ var rnum = Math.floor(Math.random() * mlw_chars.length);
733
+ mlw_code += mlw_chars.substring(rnum,rnum+1);
734
+ }
735
+ var mlw_captchaCTX = document.getElementById('mlw_captcha').getContext('2d');
736
+ mlw_captchaCTX.font = 'normal 24px Verdana';
737
+ mlw_captchaCTX.strokeStyle = '#000000';
738
+ mlw_captchaCTX.clearRect(0,0,100,50);
739
+ mlw_captchaCTX.strokeText(mlw_code,10,30,70);
740
+ mlw_captchaCTX.textBaseline = 'middle';
741
+ document.getElementById('mlw_code_captcha').value = mlw_code;
742
+ </script>
743
+ ";
744
+ }
745
+ else
746
+ {
747
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
748
+ $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
749
+ if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
750
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
751
+ if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredText";} else {$mlw_requireClass = "";}
752
+ $mlw_display .= "<input type='text' class='mlw_answer_open_text $mlw_requireClass' name='question".$mlw_question->question_id."' />";
753
+ $mlw_display .= "<br />";
754
+ }
755
+ if ($mlw_question->comments == 0)
756
+ {
757
+ $mlw_display .= "<input type='text' class='mlw_qmn_question_comment' x-webkit-speech id='mlwComment".$mlw_question->question_id."' name='mlwComment".$mlw_question->question_id."' value='".esc_attr(htmlspecialchars_decode($mlw_quiz_options->comment_field_text, ENT_QUOTES))."' onclick='clear_field(this)'/>";
758
+ $mlw_display .= "<br />";
759
+ }
760
+ if ($mlw_question->comments == 2)
761
+ {
762
+ $mlw_display .= "<textarea cols='70' rows='5' class='mlw_qmn_question_comment' id='mlwComment".$mlw_question->question_id."' name='mlwComment".$mlw_question->question_id."' onclick='clear_field(this)'>".htmlspecialchars_decode($mlw_quiz_options->comment_field_text, ENT_QUOTES)."</textarea>";
763
+ $mlw_display .= "<br />";
764
+ }
765
+ if ($mlw_question->hints != "")
766
+ {
767
+ $mlw_display .= "<span title=\"".htmlspecialchars_decode($mlw_question->hints, ENT_QUOTES)."\" style=\"text-decoration:underline;color:rgb(0,0,255);\" class='mlw_qmn_hint_link'>Hint</span>";
768
+ $mlw_display .= "<br /><br />";
769
+ }
770
+ $mlw_display .= "</div>";
771
+ if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br />"; }
772
+ }
773
+
774
+ //Display comment box if needed
775
+ if ($mlw_quiz_options->comment_section == 0)
776
+ {
777
+ $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
778
+ $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
779
+ $mlw_message_comments = htmlspecialchars_decode($mlw_quiz_options->message_comment, ENT_QUOTES);
780
+ $mlw_message_comments = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_comments);
781
+ $mlw_message_comments = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_comments);
782
+ $mlw_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text' style='font-weight:bold;'>".$mlw_message_comments."</label><br />";
783
+ $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
784
+ $mlw_display .= "</div>";
785
+ if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br /><br />"; }
786
+ }
787
+ $mlw_display .= "<br />";
788
+ $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
789
+ $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count." quiz_end'>";
790
+ if ($mlw_quiz_options->message_end_template != '')
791
+ {
792
+ $mlw_message_end = htmlspecialchars_decode($mlw_quiz_options->message_end_template, ENT_QUOTES);
793
+ $mlw_message_end = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_end);
794
+ $mlw_message_end = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_end);
795
+ $mlw_display .= "<span class='mlw_qmn_message_end'>".$mlw_message_end."</span>";
796
+ $mlw_display .= "<br /><br />";
797
+ }
798
+ if ($mlw_quiz_options->contact_info_location == 1)
799
+ {
800
+ $mlw_display .= mlwDisplayContactInfo($mlw_quiz_options);
801
+ }
802
+ ob_start();
803
+ do_action('mlw_qmn_end_quiz_section');
804
+ $mlw_display .= ob_get_contents();
805
+ ob_end_clean();
806
+ $mlw_display .= "<span style='display: none;'>If you are human, leave this field blank or you will be considered spam:</span>";
807
+ $mlw_display .= "<input style='display: none;' type='text' name='email' id='email' />";
808
+ $mlw_display .= "<input type='hidden' name='total_questions' id='total_questions' value='".$mlw_qmn_total_questions."'/>";
809
+ $mlw_display .= "<input type='hidden' name='timer' id='timer' value='0'/>";
810
+ $mlw_display .= "<input type='hidden' name='complete_quiz' value='confirmation' />";
811
+ $mlw_display .= "<input type='submit' value='".esc_attr(htmlspecialchars_decode($mlw_quiz_options->submit_button_text, ENT_QUOTES))."' />";
812
+ $mlw_display .= "<span name='mlw_error_message_bottom' id='mlw_error_message_bottom' style='color: red;'></span><br />";
813
+ $mlw_display .= "</form>";
814
+ $mlw_display .= "</div>";
815
+ $mlw_display .= "</div>";
816
+
817
+ }
818
+ //Display Completion Screen
819
+ else
820
+ {
821
+ ?>
822
+ <script type="text/javascript">
823
+ window.sessionStorage.setItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>', 'completed');
824
+ window.sessionStorage.setItem('mlw_started_quiz<?php echo $mlw_quiz_id; ?>', "no");
825
+ </script>
826
+ <?php
827
+ if (empty($mlw_spam_email) && $mlw_qmn_isAllowed && ((!isset($_POST["mlw_code_captcha"])) || isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] == $_POST["mlw_code_captcha"]))
828
+ {
829
+
830
+ //Load questions
831
+ $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' ";
832
+ if ($mlw_quiz_options->randomness_order == 0)
833
+ {
834
+ $sql .= "ORDER BY question_order ASC";
835
+ }
836
+ if ($mlw_quiz_options->randomness_order == 1 || $mlw_quiz_options->randomness_order == 2)
837
+ {
838
+ $sql .= "ORDER BY rand()";
839
+ }
840
+ $mlw_questions = $wpdb->get_results($sql);
841
+
842
+ //Load and prepare answer arrays
843
+ $mlw_qmn_loaded_answer_arrays = array();
844
+ foreach($mlw_questions as $mlw_question_info) {
845
+ $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array);
846
+ if ( !is_array($mlw_qmn_answer_array_each) )
847
+ {
848
+ $mlw_answer_array_correct = array(0, 0, 0, 0, 0, 0);
849
+ $mlw_answer_array_correct[$mlw_question_info->correct_answer-1] = 1;
850
+ $mlw_qmn_loaded_answer_arrays[$mlw_question_info->question_id] = array(
851
+ array($mlw_question_info->answer_one, $mlw_question_info->answer_one_points, $mlw_answer_array_correct[0]),
852
+ array($mlw_question_info->answer_two, $mlw_question_info->answer_two_points, $mlw_answer_array_correct[1]),
853
+ array($mlw_question_info->answer_three, $mlw_question_info->answer_three_points, $mlw_answer_array_correct[2]),
854
+ array($mlw_question_info->answer_four, $mlw_question_info->answer_four_points, $mlw_answer_array_correct[3]),
855
+ array($mlw_question_info->answer_five, $mlw_question_info->answer_five_points, $mlw_answer_array_correct[4]),
856
+ array($mlw_question_info->answer_six, $mlw_question_info->answer_six_points, $mlw_answer_array_correct[5]));
857
+ }
858
+ else
859
+ {
860
+ $mlw_qmn_loaded_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each;
861
+ }
862
+ }
863
+
864
+ //Variables needed for scoring
865
+ $mlw_points = 0;
866
+ $mlw_correct = 0;
867
+ $mlw_total_questions = 0;
868
+ $mlw_total_score = 0;
869
+ $mlw_question_answers = "";
870
+ isset($_POST["total_questions"]) ? $mlw_total_questions = intval($_POST["total_questions"]) : $mlw_total_questions = 0;
871
+
872
+ //Update the amount of times the quiz has been taken
873
+ $mlw_taken = $mlw_quiz_options->quiz_taken;
874
+ $mlw_taken += 1;
875
+ $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_taken='".$mlw_taken."' WHERE quiz_id=".$mlw_quiz_id;
876
+ $results = $wpdb->query( $update );
877
+
878
+ //See which answers were correct and award points if necessary
879
+ $mlw_user_text = "";
880
+ $mlw_correct_text = "";
881
+ $mlw_qmn_answer_array = array();
882
+ foreach($mlw_questions as $mlw_question) {
883
+ $mlw_user_text = "";
884
+ $mlw_correct_text = "";
885
+ if ( isset($_POST["question".$mlw_question->question_id]) || isset($_POST["mlwComment".$mlw_question->question_id]) )
886
+ {
887
+ if ( $mlw_question->question_type == 0 || $mlw_question->question_type == 1 || $mlw_question->question_type == 2)
888
+ {
889
+ if (isset($_POST["question".$mlw_question->question_id]))
890
+ {
891
+ $mlw_user_answer = $_POST["question".$mlw_question->question_id];
892
+ }
893
+ else
894
+ {
895
+ $mlw_user_answer = " ";
896
+ }
897
+ $mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id];
898
+ foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each)
899
+ {
900
+ if (htmlspecialchars(stripslashes($mlw_user_answer), ENT_QUOTES) == esc_attr($mlw_qmn_question_answers_each[0]))
901
+ {
902
+ $mlw_points += $mlw_qmn_question_answers_each[1];
903
+ $mlw_user_text .= strval(htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES));
904
+ if ($mlw_qmn_question_answers_each[2] == 1)
905
+ {
906
+ $mlw_correct += 1;
907
+ }
908
+ }
909
+ if ($mlw_qmn_question_answers_each[2] == 1)
910
+ {
911
+ $mlw_correct_text .= htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES);
912
+ }
913
+ }
914
+ }
915
+ elseif ( $mlw_question->question_type == 3 || $mlw_question->question_type == 5 || $mlw_question->question_type == 7)
916
+ {
917
+ if (isset($_POST["question".$mlw_question->question_id]))
918
+ {
919
+ $mlw_user_answer = $_POST["question".$mlw_question->question_id];
920
+ }
921
+ else
922
+ {
923
+ $mlw_user_answer = " ";
924
+ }
925
+ $mlw_user_text .= strval(stripslashes(htmlspecialchars_decode($mlw_user_answer, ENT_QUOTES)));
926
+ $mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id];
927
+ foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each)
928
+ {
929
+ $mlw_correct_text = strval(htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES));
930
+ if (strtoupper($mlw_user_text) == strtoupper($mlw_correct_text))
931
+ {
932
+ $mlw_correct += 1;
933
+ $mlw_points += $mlw_qmn_question_answers_each[1];
934
+ break;
935
+ }
936
+ }
937
+ }
938
+ elseif ( $mlw_question->question_type == 4 || $mlw_question->question_type == 10)
939
+ {
940
+ $mlw_qmn_user_correct_answers = 0;
941
+ $mlw_qmn_total_correct_answers = 0;
942
+ $mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id];
943
+ $mlw_qmn_total_answers = count($mlw_qmn_question_answers_array);
944
+ foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each)
945
+ {
946
+ for ($i = 1; $i <= $mlw_qmn_total_answers; $i++) {
947
+ if (isset($_POST["question".$mlw_question->question_id."_".$i]) && htmlspecialchars(stripslashes($_POST["question".$mlw_question->question_id."_".$i]), ENT_QUOTES) == esc_attr($mlw_qmn_question_answers_each[0]))
948
+ {
949
+ $mlw_points += $mlw_qmn_question_answers_each[1];
950
+ $mlw_user_text .= strval(htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES)).".";
951
+ if ($mlw_qmn_question_answers_each[2] == 1)
952
+ {
953
+ $mlw_qmn_user_correct_answers += 1;
954
+ }
955
+ else
956
+ {
957
+ $mlw_qmn_user_correct_answers = -1;
958
+ }
959
+ }
960
+ }
961
+ if ($mlw_qmn_question_answers_each[2] == 1)
962
+ {
963
+ $mlw_correct_text .= htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES).".";
964
+ $mlw_qmn_total_correct_answers++;
965
+ }
966
+ }
967
+ if ($mlw_qmn_user_correct_answers == $mlw_qmn_total_correct_answers)
968
+ {
969
+ $mlw_correct += 1;
970
+ }
971
+ }
972
+ if (isset($_POST["mlwComment".$mlw_question->question_id]))
973
+ {
974
+ $mlw_qm_question_comment = $_POST["mlwComment".$mlw_question->question_id];
975
+ }
976
+ else
977
+ {
978
+ $mlw_qm_question_comment = "";
979
+ }
980
+
981
+ $mlw_question_answer_display = htmlspecialchars_decode($mlw_quiz_options->question_answer_template, ENT_QUOTES);
982
+ $mlw_question_answer_display = str_replace( "%QUESTION%" , htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES), $mlw_question_answer_display);
983
+ $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , $mlw_user_text, $mlw_question_answer_display);
984
+ $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER%" , $mlw_correct_text, $mlw_question_answer_display);
985
+ $mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $mlw_qm_question_comment, $mlw_question_answer_display);
986
+ $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($mlw_question->question_answer_info, ENT_QUOTES), $mlw_question_answer_display);
987
+
988
+ $mlw_qmn_answer_array[] = array($mlw_question->question_name, htmlspecialchars($mlw_user_text, ENT_QUOTES), htmlspecialchars($mlw_correct_text, ENT_QUOTES), htmlspecialchars(stripslashes($mlw_qm_question_comment), ENT_QUOTES));
989
+
990
+ $mlw_question_answers .= $mlw_question_answer_display;
991
+ $mlw_question_answers .= "<br />";
992
+ }
993
+ }
994
+
995
+ //Calculate Total Percent Score And Average Points Only If Total Questions Doesn't Equal Zero To Avoid Division By Zero Error
996
+ if ($mlw_total_questions != 0)
997
+ {
998
+ $mlw_total_score = round((($mlw_correct/$mlw_total_questions)*100), 2);
999
+ $mlw_average_points = round(($mlw_points/$mlw_total_questions), 2);
1000
+ }
1001
+ else
1002
+ {
1003
+ $mlw_total_score = 0;
1004
+ $mlw_average_points = 0;
1005
+ }
1006
+
1007
+ //Prepare comment section if set
1008
+ if (isset($_POST["mlwQuizComments"]))
1009
+ {
1010
+ $mlw_qm_quiz_comments = $_POST["mlwQuizComments"];
1011
+ }
1012
+ else
1013
+ {
1014
+ $mlw_qm_quiz_comments = "";
1015
+ }
1016
+
1017
+
1018
+ //Prepare Certificate
1019
+ $mlw_certificate_link = "";
1020
+ $mlw_certificate_options = unserialize($mlw_quiz_options->certificate_template);
1021
+ if (!is_array($mlw_certificate_options)) {
1022
+ // something went wrong, initialize to empty array
1023
+ $mlw_certificate_options = array('Enter title here', 'Enter text here', '', '', 1);
1024
+ }
1025
+ if ($mlw_certificate_options[4] == 0)
1026
+ {
1027
+ $mlw_message_certificate = $mlw_certificate_options[1];
1028
+ $mlw_message_certificate = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_certificate);
1029
+ $mlw_message_certificate = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_certificate);
1030
+ $mlw_message_certificate = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_certificate);
1031
+ $mlw_message_certificate = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_certificate);
1032
+ $mlw_message_certificate = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_certificate);
1033
+ $mlw_message_certificate = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_certificate);
1034
+ $mlw_message_certificate = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_certificate);
1035
+ $mlw_message_certificate = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_certificate);
1036
+ $mlw_message_certificate = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_certificate);
1037
+ $mlw_message_certificate = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_certificate);
1038
+ $mlw_message_certificate = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_certificate);
1039
+ $mlw_message_certificate = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_certificate);
1040
+ $mlw_message_certificate = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_certificate);
1041
+ $mlw_message_certificate = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_certificate);
1042
+ $mlw_message_certificate = str_replace( "\n" , "<br>", $mlw_message_certificate);
1043
+ $mlw_plugindirpath = plugin_dir_path( __FILE__ );
1044
+ $plugindirpath=plugin_dir_path( __FILE__ );
1045
+ $mlw_qmn_certificate_file=<<<EOC
1046
+ <?php
1047
+ include("$plugindirpath/WriteHTML.php");
1048
+ \$pdf=new PDF_HTML();
1049
+ \$pdf->AddPage('L');
1050
+ EOC;
1051
+ $mlw_qmn_certificate_file.=$mlw_certificate_options[3] != '' ? '$pdf->Image("'.$mlw_certificate_options[3].'",0,0,$pdf->w, $pdf->h);' : '';
1052
+ $mlw_qmn_certificate_file.=<<<EOC
1053
+ \$pdf->Ln(20);
1054
+ \$pdf->SetFont('Arial','B',24);
1055
+ \$pdf->MultiCell(280,20,'$mlw_certificate_options[0]',0,'C');
1056
+ \$pdf->Ln(15);
1057
+ \$pdf->SetFont('Arial','',16);
1058
+ \$pdf->WriteHTML("<p align='center'>$mlw_message_certificate</p>");
1059
+ EOC;
1060
+ $mlw_qmn_certificate_file.=$mlw_certificate_options[2] != '' ? '$pdf->Image("'.$mlw_certificate_options[2].'",110,130);' : '';
1061
+ $mlw_qmn_certificate_file.=<<<EOC
1062
+ \$pdf->Output('mlw_qmn_certificate.pdf','D');
1063
+ unlink(__FILE__);
1064
+ EOC;
1065
+ $mlw_qmn_certificate_filename = str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
1066
+ file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file);
1067
+ $mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
1068
+ $mlw_certificate_link = "<a href='".$mlw_qmn_certificate_filename."' style='color: blue;'>Download Certificate</a>";
1069
+ }
1070
+
1071
+ /*
1072
+ Prepare the landing page
1073
+ -First, unserialize message_after column
1074
+ -Second, check for array in case user has not updated
1075
+ Message array = (array( bottomvalue, topvalue, text),array( bottomvalue, topvalue, text), etc..., array(0,0,text))
1076
+ */
1077
+ $mlw_message_after_array = @unserialize($mlw_quiz_options->message_after);
1078
+ if (is_array($mlw_message_after_array))
1079
+ {
1080
+ //Cycle through landing pages
1081
+ foreach($mlw_message_after_array as $mlw_each)
1082
+ {
1083
+ //Check to see if default
1084
+ if ($mlw_each[0] == 0 && $mlw_each[1] == 0)
1085
+ {
1086
+ $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1087
+ $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1088
+ $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1089
+ $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1090
+ $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1091
+ $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1092
+ $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1093
+ $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1094
+ $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1095
+ $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1096
+ $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1097
+ $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1098
+ $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1099
+ $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1100
+ $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1101
+ $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1102
+ $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1103
+ $mlw_display .= $mlw_message_after;
1104
+ break;
1105
+ }
1106
+ else
1107
+ {
1108
+ //Check to see if points fall in correct range
1109
+ if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1])
1110
+ {
1111
+ $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1112
+ $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1113
+ $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1114
+ $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1115
+ $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1116
+ $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1117
+ $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1118
+ $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1119
+ $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1120
+ $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1121
+ $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1122
+ $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1123
+ $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1124
+ $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1125
+ $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1126
+ $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1127
+ $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1128
+ $mlw_display .= $mlw_message_after;
1129
+ break;
1130
+ }
1131
+ //Check to see if score fall in correct range
1132
+ if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1])
1133
+ {
1134
+ $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1135
+ $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1136
+ $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1137
+ $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1138
+ $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1139
+ $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1140
+ $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1141
+ $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1142
+ $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1143
+ $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1144
+ $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1145
+ $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1146
+ $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1147
+ $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1148
+ $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1149
+ $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1150
+ $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1151
+ $mlw_display .= $mlw_message_after;
1152
+ break;
1153
+ }
1154
+ }
1155
+ }
1156
+ }
1157
+ else
1158
+ {
1159
+ //Prepare the after quiz message
1160
+ $mlw_message_after = htmlspecialchars_decode($mlw_quiz_options->message_after, ENT_QUOTES);
1161
+ $mlw_message_after = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message_after);
1162
+ $mlw_message_after = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message_after);
1163
+ $mlw_message_after = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message_after);
1164
+ $mlw_message_after = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message_after);
1165
+ $mlw_message_after = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message_after);
1166
+ $mlw_message_after = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_after);
1167
+ $mlw_message_after = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message_after);
1168
+ $mlw_message_after = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message_after);
1169
+ $mlw_message_after = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message_after);
1170
+ $mlw_message_after = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message_after);
1171
+ $mlw_message_after = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_after);
1172
+ $mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
1173
+ $mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
1174
+ $mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
1175
+ $mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
1176
+ $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
1177
+ $mlw_display .= $mlw_message_after;
1178
+ }
1179
+
1180
+ if ($mlw_quiz_options->social_media == 1)
1181
+ {
1182
+ ?>
1183
+ <script>
1184
+ function mlw_qmn_share(network, mlw_qmn_social_text, mlw_qmn_title)
1185
+ {
1186
+ var sTop = window.screen.height/2-(218);
1187
+ var sLeft = window.screen.width/2-(313);
1188
+ var sqShareOptions = "height=400,width=580,toolbar=0,status=0,location=0,menubar=0,directories=0,scrollbars=0,top=" + sTop + ",left=" + sLeft;
1189
+ var pageUrl = window.location.href;
1190
+ var pageUrlEncoded = encodeURIComponent(pageUrl);
1191
+ if (network == 1)
1192
+ {
1193
+ var Url = "https://www.facebook.com/dialog/feed?"
1194
+ + "display=popup&"
1195
+ + "app_id=483815031724529&"
1196
+ + "link=" + pageUrlEncoded + "&"
1197
+ + "name=" + encodeURIComponent(mlw_qmn_social_text) + "&"
1198
+ + "description= &"
1199
+ + "redirect_uri=http://www.mylocalwebstop.com/mlw_qmn_close.html";
1200
+ }
1201
+ if (network == 2)
1202
+ {
1203
+ var Url = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(mlw_qmn_social_text);
1204
+ }
1205
+ window.open(Url, "Share", sqShareOptions);
1206
+ return false;
1207
+ }
1208
+ </script>
1209
+ <?php
1210
+ $mlw_social_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_quiz_options->social_media_text);
1211
+ $mlw_social_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_social_message);
1212
+ $mlw_social_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_social_message);
1213
+ $mlw_social_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_social_message);
1214
+ $mlw_social_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_social_message);
1215
+ $mlw_social_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_social_message);
1216
+ $mlw_social_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_social_message);
1217
+ $mlw_social_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_social_message);
1218
+ $mlw_display .= "<br />
1219
+ <a class=\"mlw_qmn_quiz_link\" style=\"display: inline; vertical-align:top !important;font-weight: bold; cursor: pointer;text-decoration: none;\" onclick=\"mlw_qmn_share(1, '".esc_js($mlw_social_message)."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Facebook</a>
1220
+ <a class=\"mlw_qmn_quiz_link\" style=\"display: inline; vertical-align:top !important;font-weight: bold; cursor: pointer;text-decoration: none;\" onclick=\"mlw_qmn_share(2, '".esc_js($mlw_social_message)."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Twitter</a>
1221
+ <br />";
1222
+ }
1223
+
1224
+ //Switch email type to HTML
1225
+ add_filter( 'wp_mail_content_type', 'mlw_qmn_set_html_content_type' );
1226
+
1227
+ /*
1228
+ Prepare and send the user email
1229
+ - First, check to see if user_email_template is the newer array format, if not use it as the template
1230
+ - If it is an array, check to see if the score meets the parameter of one of the templates. If, not send the default
1231
+ */
1232
+ $mlw_message = "";
1233
+ if ($mlw_quiz_options->send_user_email == "0")
1234
+ {
1235
+ if ($mlw_user_email != "")
1236
+ {
1237
+ $mlw_user_email_array = @unserialize($mlw_quiz_options->user_email_template);
1238
+ if (is_array($mlw_user_email_array))
1239
+ {
1240
+ //Cycle through landing pages
1241
+ foreach($mlw_user_email_array as $mlw_each)
1242
+ {
1243
+
1244
+ //Generate Email Subject
1245
+ if (!isset($mlw_each[3]))
1246
+ {
1247
+ $mlw_each[3] = "Quiz Results For %QUIZ_NAME";
1248
+ }
1249
+ $mlw_each[3] = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_each[3]);
1250
+ $mlw_each[3] = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_each[3]);
1251
+ $mlw_each[3] = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_each[3]);
1252
+ $mlw_each[3] = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_each[3]);
1253
+ $mlw_each[3] = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_each[3]);
1254
+ $mlw_each[3] = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_each[3]);
1255
+ $mlw_each[3] = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_each[3]);
1256
+ $mlw_each[3] = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_each[3]);
1257
+ $mlw_each[3] = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_each[3]);
1258
+ $mlw_each[3] = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_each[3]);
1259
+ $mlw_each[3] = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_each[3]);
1260
+ $mlw_each[3] = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_each[3]);
1261
+
1262
+
1263
+ //Check to see if default
1264
+ if ($mlw_each[0] == 0 && $mlw_each[1] == 0)
1265
+ {
1266
+ $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1267
+ $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1268
+ $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1269
+ $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1270
+ $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1271
+ $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1272
+ $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1273
+ $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1274
+ $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1275
+ $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1276
+ $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1277
+ $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1278
+ $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1279
+ $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1280
+ $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1281
+ $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1282
+ $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1283
+ $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1284
+ $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1285
+ $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
1286
+ wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers);
1287
+ break;
1288
+ }
1289
+ else
1290
+ {
1291
+ //Check to see if points fall in correct range
1292
+ if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1])
1293
+ {
1294
+ $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1295
+ $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1296
+ $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1297
+ $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1298
+ $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1299
+ $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1300
+ $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1301
+ $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1302
+ $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1303
+ $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1304
+ $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1305
+ $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1306
+ $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1307
+ $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1308
+ $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1309
+ $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1310
+ $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1311
+ $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1312
+ $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1313
+ $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
1314
+ wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers);
1315
+ break;
1316
+ }
1317
+
1318
+ //Check to see if score fall in correct range
1319
+ if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1])
1320
+ {
1321
+ $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES);
1322
+ $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1323
+ $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1324
+ $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1325
+ $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1326
+ $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1327
+ $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1328
+ $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1329
+ $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1330
+ $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1331
+ $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1332
+ $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1333
+ $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1334
+ $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1335
+ $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1336
+ $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1337
+ $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1338
+ $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1339
+ $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1340
+ $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
1341
+ wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers);
1342
+ break;
1343
+ }
1344
+ }
1345
+ }
1346
+ }
1347
+ else
1348
+ {
1349
+ $mlw_message = htmlspecialchars_decode($mlw_quiz_options->user_email_template, ENT_QUOTES);
1350
+ $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1351
+ $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1352
+ $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1353
+ $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1354
+ $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1355
+ $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1356
+ $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1357
+ $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1358
+ $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1359
+ $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1360
+ $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1361
+ $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1362
+ $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1363
+ $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1364
+ $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1365
+ $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1366
+ $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1367
+ $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1368
+ $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
1369
+ wp_mail($mlw_user_email, "Quiz Results For ".$mlw_quiz_options->quiz_name, $mlw_message, $mlw_headers);
1370
+ }
1371
+ }
1372
+ }
1373
+
1374
+ //Prepare and send the admin email
1375
+ $mlw_message = "";
1376
+ if ($mlw_quiz_options->send_admin_email == "0")
1377
+ {
1378
+ $mlw_message = htmlspecialchars_decode($mlw_quiz_options->admin_email_template, ENT_QUOTES);
1379
+ $mlw_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_message);
1380
+ $mlw_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_message);
1381
+ $mlw_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_message);
1382
+ $mlw_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_message);
1383
+ $mlw_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_message);
1384
+ $mlw_message = str_replace( "%USER_NAME%" , $mlw_user_name, $mlw_message);
1385
+ $mlw_message = str_replace( "%USER_BUSINESS%" , $mlw_user_comp, $mlw_message);
1386
+ $mlw_message = str_replace( "%USER_PHONE%" , $mlw_user_phone, $mlw_message);
1387
+ $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
1388
+ $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1389
+ $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
1390
+ $mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
1391
+ $mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
1392
+ $mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
1393
+ $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1394
+ if ( get_option('mlw_advert_shows') == 'true' ) {$mlw_message .= "<br>This email was generated by the Quiz Master Next script by Frank Corso";}
1395
+ $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1396
+ $mlw_message = str_replace( "<br/>" , "<br>", $mlw_message);
1397
+ $mlw_message = str_replace( "<br />" , "<br>", $mlw_message);
1398
+ $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
1399
+ $mlw_qmn_admin_emails = explode(",", $mlw_quiz_options->admin_email);
1400
+ foreach($mlw_qmn_admin_emails as $admin_email)
1401
+ {
1402
+ wp_mail($admin_email, "Quiz Results For ".$mlw_quiz_options->quiz_name, $mlw_message, $mlw_headers);
1403
+ }
1404
+ }
1405
+
1406
+ //Remove HTML type for emails
1407
+ remove_filter( 'wp_mail_content_type', 'mlw_qmn_set_html_content_type' );
1408
+
1409
+ //Save the results into database
1410
+ $mlw_quiz_results_array = array( intval($mlw_qmn_timer), $mlw_qmn_answer_array, htmlspecialchars(stripslashes($mlw_qm_quiz_comments), ENT_QUOTES));
1411
+ $mlw_quiz_results = serialize($mlw_quiz_results_array);
1412
+
1413
+ global $wpdb;
1414
+ $table_name = $wpdb->prefix . "mlw_results";
1415
+ $results = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $table_name . " (result_id, quiz_id, quiz_name, quiz_system, point_score, correct_score, correct, total, name, business, email, phone, user, time_taken, time_taken_real, quiz_results, deleted) VALUES (NULL, %d, '%s', %d, %d, %d, %d, %d, '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', 0)", $mlw_quiz_id, $mlw_quiz_options->quiz_name, $mlw_quiz_options->system, $mlw_points, $mlw_total_score, $mlw_correct, $mlw_total_questions, $mlw_user_name, $mlw_user_comp, $mlw_user_email, $mlw_user_phone, get_current_user_id(), date("h:i:s A m/d/Y"), date("Y-m-d H:i:s"), $mlw_quiz_results) );
1416
+
1417
+ //Integration Action
1418
+ do_action('mlw_qmn_load_results_page');
1419
+ }
1420
+ else
1421
+ {
1422
+ if (!$mlw_qmn_isAllowed)
1423
+ {
1424
+ $current_user = wp_get_current_user();
1425
+ $mlw_message = htmlspecialchars_decode($mlw_quiz_options->total_user_tries_text, ENT_QUOTES);
1426
+ $mlw_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message);
1427
+ $mlw_message = str_replace( "%USER_NAME%" , $current_user->display_name, $mlw_message);
1428
+ $mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
1429
+ $mlw_display .= $mlw_message;
1430
+ }
1431
+ elseif (isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] != $_POST["mlw_code_captcha"])
1432
+ {
1433
+ $mlw_display .= "There was an issue with the captcha verification. Please try again.";
1434
+ }
1435
+ else { $mlw_display .= "Thank you."; }
1436
+ }
1437
+ }
1438
+ return $mlw_display;
1439
+ }
1440
+
1441
+
1442
+ /*
1443
+ This function displays fields to ask for contact information
1444
+ */
1445
+ function mlwDisplayContactInfo($mlw_quiz_options)
1446
+ {
1447
+ $mlw_contact_display = "";
1448
+ //Check to see if user is logged in, then ask for contact if not
1449
+ if ( is_user_logged_in() )
1450
+ {
1451
+ //If this quiz does not let user edit contact information we hide this section
1452
+ if ($mlw_quiz_options->loggedin_user_contact == 1)
1453
+ {
1454
+ $mlw_contact_display .= "<div style='display:none;'>";
1455
+ }
1456
+
1457
+ //Retrieve current user information and save into text fields for contact information
1458
+ $current_user = wp_get_current_user();
1459
+ if ($mlw_quiz_options->user_name != 2)
1460
+ {
1461
+ $mlw_contact_class = "class=\"\"";
1462
+ if ($mlw_quiz_options->user_name == 1)
1463
+ {
1464
+ $mlw_contact_class = "class=\"mlwRequiredText\"";
1465
+ }
1466
+ $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span><br />";
1467
+ $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserName' value='".$current_user->display_name."' />";
1468
+ $mlw_contact_display .= "<br /><br />";
1469
+
1470
+ }
1471
+ if ($mlw_quiz_options->user_comp != 2)
1472
+ {
1473
+ $mlw_contact_class = "class=\"\"";
1474
+ if ($mlw_quiz_options->user_comp == 1)
1475
+ {
1476
+ $mlw_contact_class = "class=\"mlwRequiredText\"";
1477
+ }
1478
+ $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span><br />";
1479
+ $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserComp' value='' />";
1480
+ $mlw_contact_display .= "<br /><br />";
1481
+ }
1482
+ if ($mlw_quiz_options->user_email != 2)
1483
+ {
1484
+ $mlw_contact_class = "class=\"\"";
1485
+ if ($mlw_quiz_options->user_email == 1)
1486
+ {
1487
+ $mlw_contact_class = "class=\"mlwRequiredText\"";
1488
+ }
1489
+ $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span><br />";
1490
+ $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserEmail' value='".$current_user->user_email."' />";
1491
+ $mlw_contact_display .= "<br /><br />";
1492
+ }
1493
+ if ($mlw_quiz_options->user_phone != 2)
1494
+ {
1495
+ $mlw_contact_class = "class=\"\"";
1496
+ if ($mlw_quiz_options->user_phone == 1)
1497
+ {
1498
+ $mlw_contact_class = "class=\"mlwRequiredText\"";
1499
+ }
1500
+ $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span><br />";
1501
+ $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserPhone' value='' />";
1502
+ $mlw_contact_display .= "<br /><br />";
1503
+ }
1504
+
1505
+ //End of hidden section div
1506
+ if ($mlw_quiz_options->loggedin_user_contact == 1)
1507
+ {
1508
+ $mlw_contact_display .= "</div>";
1509
+ }
1510
+ }
1511
+ else
1512
+ {
1513
+ //See if the site wants to ask for any contact information, then ask for it
1514
+ if ($mlw_quiz_options->user_name != 2)
1515
+ {
1516
+ $mlw_contact_class = "class=\"\"";
1517
+ if ($mlw_quiz_options->user_name == 1)
1518
+ {
1519
+ $mlw_contact_class = "class=\"mlwRequiredText\"";
1520
+ }
1521
+ $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span><br />";
1522
+ $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserName' value='' />";
1523
+ $mlw_contact_display .= "<br /><br />";
1524
+ }
1525
+ if ($mlw_quiz_options->user_comp != 2)
1526
+ {
1527
+ $mlw_contact_class = "class=\"\"";
1528
+ if ($mlw_quiz_options->user_comp == 1)
1529
+ {
1530
+ $mlw_contact_class = "class=\"mlwRequiredText\"";
1531
+ }
1532
+ $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span><br />";
1533
+ $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserComp' value='' />";
1534
+ $mlw_contact_display .= "<br /><br />";
1535
+ }
1536
+ if ($mlw_quiz_options->user_email != 2)
1537
+ {
1538
+ $mlw_contact_class = "class=\"\"";
1539
+ if ($mlw_quiz_options->user_email == 1)
1540
+ {
1541
+ $mlw_contact_class = "class=\"mlwRequiredText\"";
1542
+ }
1543
+ $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span><br />";
1544
+ $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserEmail' value='' />";
1545
+ $mlw_contact_display .= "<br /><br />";
1546
+ }
1547
+ if ($mlw_quiz_options->user_phone != 2)
1548
+ {
1549
+ $mlw_contact_class = "class=\"\"";
1550
+ if ($mlw_quiz_options->user_phone == 1)
1551
+ {
1552
+ $mlw_contact_class = "class=\"mlwRequiredText\"";
1553
+ }
1554
+ $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span><br />";
1555
+ $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserPhone' value='' />";
1556
+ $mlw_contact_display .= "<br /><br />";
1557
+ }
1558
+ }
1559
+ return $mlw_contact_display;
1560
+ }
1561
+
1562
+ /*
1563
+ This function helps set the email type to HTML
1564
+ */
1565
+ function mlw_qmn_set_html_content_type() {
1566
+
1567
+ return 'text/html';
1568
+ }
 
1569
  ?>
mlw_quizmaster2.php CHANGED
@@ -1,190 +1,193 @@
1
- <?php
2
-
3
- /*
4
- Plugin Name: Quiz Master Next
5
- Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
6
- Version: 3.3.2
7
- Author: Frank Corso
8
- Author URI: http://www.mylocalwebstop.com/
9
- Plugin URI: http://www.mylocalwebstop.com/
10
- */
11
-
12
- /*
13
- Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com)
14
-
15
- Disclaimer of Warranties.
16
-
17
- The plugin is provided "as is". My Local Webstop and its suppliers and licensors hereby disclaim all warranties of any kind,
18
- express or implied, including, without limitation, the warranties of merchantability, fitness for a particular purpose and non-infringement.
19
- Neither My Local Webstop nor its suppliers and licensors, makes any warranty that the plugin will be error free or that access thereto will be continuous or uninterrupted.
20
- You understand that you install, operate, and unistall the plugin at your own discretion and risk.
21
- */
22
-
23
-
24
- ///Files to Include
25
- include("includes/mlw_quiz.php");
26
- include("includes/mlw_dashboard.php");
27
- include("includes/mlw_quiz_admin.php");
28
- include("includes/mlw_quiz_options.php");
29
- include("includes/mlw_quiz_install.php");
30
- include("includes/mlw_results.php");
31
- include("includes/mlw_results_details.php");
32
- include("includes/mlw_tools.php");
33
- include("includes/mlw_leaderboard.php");
34
- include("includes/mlw_update.php");
35
- include("includes/mlw_qmn_widgets.php");
36
- include("includes/mlw_qmn_credits.php");
37
-
38
-
39
- ///Activation Actions
40
- add_action('admin_menu', 'mlw_add_menu');
41
- add_action('admin_init', 'mlw_quiz_update');
42
- add_action('widgets_init', create_function('', 'return register_widget("Mlw_Qmn_Leaderboard_Widget");'));
43
- add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode');
44
- add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
45
- register_activation_hook( __FILE__, 'mlw_quiz_activate');
46
- register_deactivation_hook( __FILE__, 'mlw_quiz_deactivate');
47
-
48
- //Setup Translations
49
- function mlw_qmn_translation_setup() {
50
- load_plugin_textdomain( 'mlw_qmn_text_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
51
- }
52
- add_action('plugins_loaded', 'mlw_qmn_translation_setup');
53
-
54
-
55
- ///Create Admin Pages
56
- function mlw_add_menu()
57
- {
58
- if (function_exists('add_menu_page'))
59
- {
60
- add_menu_page('Quiz Master Next', 'Quiz Dashboard', 'moderate_comments', __FILE__, 'mlw_generate_quiz_dashboard', 'dashicons-feedback');
61
- add_submenu_page(__FILE__, 'Quizzes', 'Quizzes', 'moderate_comments', 'mlw_quiz_admin', 'mlw_generate_quiz_admin');
62
- add_submenu_page(__FILE__, 'Quiz Settings', 'Quiz Settings', 'moderate_comments', 'mlw_quiz_options', 'mlw_generate_quiz_options');
63
- add_submenu_page(__FILE__, 'Quiz Results', 'Quiz Results', 'moderate_comments', 'mlw_quiz_results', 'mlw_generate_quiz_results');
64
- add_submenu_page(__FILE__, 'Quiz Result Details', 'Quiz Result Details', 'moderate_comments', 'mlw_quiz_result_details', 'mlw_generate_result_details');
65
- add_submenu_page(__FILE__, 'Tools', 'Tools', 'manage_options', 'mlw_quiz_tools', 'mlw_generate_quiz_tools');
66
- add_submenu_page(__FILE__, 'QMN About', 'QMN About', 'manage_options', 'mlw_qmn_about', 'mlw_generate_about_page');
67
- }
68
- }
69
-
70
-
71
- //Admin Notice
72
- add_action('admin_notices', 'mlw_qmn_notice');
73
- function mlw_qmn_notice() {
74
- if ( get_option('mlw_qmn_review_notice') == 1 && current_user_can( 'manage_options' ) )
75
- {
76
- echo "
77
- <style>
78
- div.help_decide
79
- {
80
- display: block;
81
- text-align:center;
82
- letter-spacing: 1px;
83
- margin: auto;
84
- text-shadow: 0 1px 1px #000000;
85
- background: #0d97d8;
86
- border: 5px solid #106daa;
87
- -moz-border-radius: 20px;
88
- -webkit-border-radius: 20px;
89
- -khtml-border-radius: 20px;
90
- border-radius: 20px;
91
- color: #FFFFFF;
92
- }
93
- div.help_decide a
94
- {
95
- color: yellow;
96
- }
97
- </style>";
98
- echo '<div class="help_decide"><p>';
99
- printf(__('You have been using the Quiz Master Next plugin for a while now! Thanks for choosing to use this plugin. If it has benefited your website, please consider purchasing an <a href="http://mylocalwebstop.com/shop/">add-on</a>, giving a <a href="http://wordpress.org/support/view/plugin-reviews/quiz-master-next">review</a>, or taking this <a href="http://mylocalwebstop.com/sample-survey/" target="_blank">survey</a>. | <a href="%1$s">Hide Notice</a>'), '?page=quiz-master-next/mlw_quizmaster2.php&&mlw_qmn_ignore_notice=0');
100
- echo "</p></div>";
101
- }
102
- }
103
- //Check to see if notices should be shown or dismissed
104
- add_action('admin_init', 'mlw_qmn_notice_ignore');
105
- function mlw_qmn_notice_ignore() {
106
- global $wpdb;
107
- if ( ! get_option('mlw_qmn_review_notice'))
108
- {
109
- add_option('mlw_qmn_review_notice' , '0');
110
- }
111
- if ($wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results" ) >= 20 && get_option('mlw_qmn_review_notice') == 0)
112
- {
113
- update_option('mlw_qmn_review_notice' , '1');
114
- }
115
- if ( isset($_GET['mlw_qmn_ignore_notice']) && '0' == $_GET['mlw_qmn_ignore_notice'] ) {
116
- update_option('mlw_qmn_review_notice' , '2');
117
- }
118
- }
119
- function mlw_qmn_show_adverts()
120
- {
121
- $mlw_advert = "";
122
- $mlw_advert_text = "";
123
- if ( get_option('mlw_advert_shows') == 'true' )
124
- {
125
- $mlw_random_int = rand(0, 7);
126
- switch ($mlw_random_int) {
127
- case 0:
128
- $mlw_advert_text = "Need support or features? Check out our Premium Support options! Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details!";
129
- break;
130
- case 1:
131
- $mlw_advert_text = "Is Quiz Master Next beneficial to your website? Please help by giving us a review on WordPress.org by going <a href=\"http://wordpress.org/support/view/plugin-reviews/quiz-master-next\">here</a>!";
132
- break;
133
- case 2:
134
- $mlw_advert_text = "Want help installing and configuring one of our plugins? Check out our Plugin Installation services. Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details!";
135
- break;
136
- case 3:
137
- $mlw_advert_text = "Would you like to support this plugin but do not need or want premium support? Please consider our inexpensive 'Advertisements Be Gone' add-on which will get rid of these ads. Visit our <a href=\"http://mylocalwebstop.com/shop/\">Plugin Add-On Store</a> for details!";
138
- break;
139
- case 4:
140
- $mlw_advert_text = "Need to be able to export the results of your quizzes? Be sure to check out our new Export Results add-on in our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a>!";
141
- break;
142
- case 5:
143
- $mlw_advert_text = "Need help keeping your plugins, themes, and WordPress up to date? Want around the clock security monitoring and off-site back-ups? How about WordPress training videos, a monthly status report, and support/consultation? Check out our <a href=\"http://mylocalwebstop.com/wordpress-maintenance-services/\">WordPress Maintenance Services</a> for more details!";
144
- break;
145
- case 6:
146
- $mlw_advert_text = "Setting up a new site? Let us take care of the set-up so you back to running your business. Check out our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for more details!";
147
- break;
148
- case 7:
149
- $mlw_advert_text = "Need a page so your users can see their results from all the quizzes they have taken? Try our new User Dashboard add-on. Check out our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for more details!";
150
- break;
151
- default:
152
- $mlw_advert_text = "Need support or features? Check out our Premium Support options! Visit our <a href=\"http://mylocalwebstop.com/shop/\">Plugin Add-On Store</a> for details!";
153
- }
154
- $mlw_advert .= "
155
- <style>
156
- div.help_decide
157
- {
158
- display: block;
159
- text-align:center;
160
- letter-spacing: 1px;
161
- margin: auto;
162
- text-shadow: 0 1px 1px #000000;
163
- background: #0d97d8;
164
- border: 5px solid #106daa;
165
- -moz-border-radius: 20px;
166
- -webkit-border-radius: 20px;
167
- -khtml-border-radius: 20px;
168
- border-radius: 20px;
169
- color: #FFFFFF;
170
- }
171
- div.help_decide a
172
- {
173
- color: yellow;
174
- }
175
- </style>";
176
- $mlw_advert .= "
177
- <div class=\"help_decide\">
178
- <p>$mlw_advert_text</p>
179
- </div>";
180
- }
181
- return $mlw_advert;
182
- }
183
-
184
-
185
-
186
- /*
187
-
188
-
189
- */
 
 
 
190
  ?>
1
+ <?php
2
+
3
+ /*
4
+ Plugin Name: Quiz Master Next
5
+ Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
6
+ Version: 3.3.3
7
+ Author: Frank Corso
8
+ Author URI: http://www.mylocalwebstop.com/
9
+ Plugin URI: http://www.mylocalwebstop.com/
10
+ */
11
+
12
+ /*
13
+ Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com)
14
+
15
+ Disclaimer of Warranties.
16
+
17
+ The plugin is provided "as is". My Local Webstop and its suppliers and licensors hereby disclaim all warranties of any kind,
18
+ express or implied, including, without limitation, the warranties of merchantability, fitness for a particular purpose and non-infringement.
19
+ Neither My Local Webstop nor its suppliers and licensors, makes any warranty that the plugin will be error free or that access thereto will be continuous or uninterrupted.
20
+ You understand that you install, operate, and unistall the plugin at your own discretion and risk.
21
+ */
22
+
23
+
24
+ ///Files to Include
25
+ include("includes/mlw_quiz.php");
26
+ include("includes/mlw_dashboard.php");
27
+ include("includes/mlw_quiz_admin.php");
28
+ include("includes/mlw_quiz_options.php");
29
+ include("includes/mlw_quiz_install.php");
30
+ include("includes/mlw_results.php");
31
+ include("includes/mlw_results_details.php");
32
+ include("includes/mlw_tools.php");
33
+ include("includes/mlw_leaderboard.php");
34
+ include("includes/mlw_update.php");
35
+ include("includes/mlw_qmn_widgets.php");
36
+ include("includes/mlw_qmn_credits.php");
37
+
38
+
39
+ ///Activation Actions
40
+ add_action('admin_menu', 'mlw_add_menu');
41
+ add_action('admin_init', 'mlw_quiz_update');
42
+ add_action('widgets_init', create_function('', 'return register_widget("Mlw_Qmn_Leaderboard_Widget");'));
43
+ add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode');
44
+ add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
45
+ register_activation_hook( __FILE__, 'mlw_quiz_activate');
46
+ register_deactivation_hook( __FILE__, 'mlw_quiz_deactivate');
47
+
48
+ //Setup Translations
49
+ function mlw_qmn_translation_setup() {
50
+ load_plugin_textdomain( 'mlw_qmn_text_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
51
+ }
52
+ add_action('plugins_loaded', 'mlw_qmn_translation_setup');
53
+
54
+
55
+ ///Create Admin Pages
56
+ function mlw_add_menu()
57
+ {
58
+ if (function_exists('add_menu_page'))
59
+ {
60
+ add_menu_page('Quiz Master Next', 'Quiz Dashboard', 'moderate_comments', __FILE__, 'mlw_generate_quiz_dashboard', 'dashicons-feedback');
61
+ add_submenu_page(__FILE__, 'Quizzes', 'Quizzes', 'moderate_comments', 'mlw_quiz_admin', 'mlw_generate_quiz_admin');
62
+ add_submenu_page(__FILE__, 'Quiz Settings', 'Quiz Settings', 'moderate_comments', 'mlw_quiz_options', 'mlw_generate_quiz_options');
63
+ add_submenu_page(__FILE__, 'Quiz Results', 'Quiz Results', 'moderate_comments', 'mlw_quiz_results', 'mlw_generate_quiz_results');
64
+ add_submenu_page(__FILE__, 'Quiz Result Details', 'Quiz Result Details', 'moderate_comments', 'mlw_quiz_result_details', 'mlw_generate_result_details');
65
+ add_submenu_page(__FILE__, 'Tools', 'Tools', 'manage_options', 'mlw_quiz_tools', 'mlw_generate_quiz_tools');
66
+ add_submenu_page(__FILE__, 'QMN About', 'QMN About', 'manage_options', 'mlw_qmn_about', 'mlw_generate_about_page');
67
+ }
68
+ }
69
+
70
+
71
+ //Admin Notice
72
+ add_action('admin_notices', 'mlw_qmn_notice');
73
+ function mlw_qmn_notice() {
74
+ if ( get_option('mlw_qmn_review_notice') == 1 && current_user_can( 'manage_options' ) )
75
+ {
76
+ echo "
77
+ <style>
78
+ div.help_decide
79
+ {
80
+ display: block;
81
+ text-align:center;
82
+ letter-spacing: 1px;
83
+ margin: auto;
84
+ text-shadow: 0 1px 1px #000000;
85
+ background: #0d97d8;
86
+ border: 5px solid #106daa;
87
+ -moz-border-radius: 20px;
88
+ -webkit-border-radius: 20px;
89
+ -khtml-border-radius: 20px;
90
+ border-radius: 20px;
91
+ color: #FFFFFF;
92
+ }
93
+ div.help_decide a
94
+ {
95
+ color: yellow;
96
+ }
97
+ </style>";
98
+ echo '<div class="help_decide"><p>';
99
+ printf(__('You have been using the Quiz Master Next plugin for a while now! Thanks for choosing to use this plugin. If it has benefited your website, please consider purchasing an <a href="http://mylocalwebstop.com/shop/">add-on</a>, giving a <a href="http://wordpress.org/support/view/plugin-reviews/quiz-master-next">review</a>, or taking this <a href="http://mylocalwebstop.com/sample-survey/" target="_blank">survey</a>. | <a href="%1$s">Hide Notice</a>'), '?page=quiz-master-next/mlw_quizmaster2.php&&mlw_qmn_ignore_notice=0');
100
+ echo "</p></div>";
101
+ }
102
+ }
103
+ //Check to see if notices should be shown or dismissed
104
+ add_action('admin_init', 'mlw_qmn_notice_ignore');
105
+ function mlw_qmn_notice_ignore() {
106
+ global $wpdb;
107
+ if ( ! get_option('mlw_qmn_review_notice'))
108
+ {
109
+ add_option('mlw_qmn_review_notice' , '0');
110
+ }
111
+ if ($wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results" ) >= 20 && get_option('mlw_qmn_review_notice') == 0)
112
+ {
113
+ update_option('mlw_qmn_review_notice' , '1');
114
+ }
115
+ if ( isset($_GET['mlw_qmn_ignore_notice']) && '0' == $_GET['mlw_qmn_ignore_notice'] ) {
116
+ update_option('mlw_qmn_review_notice' , '2');
117
+ }
118
+ }
119
+ function mlw_qmn_show_adverts()
120
+ {
121
+ $mlw_advert = "";
122
+ $mlw_advert_text = "";
123
+ if ( get_option('mlw_advert_shows') == 'true' )
124
+ {
125
+ $mlw_random_int = rand(0, 8);
126
+ switch ($mlw_random_int) {
127
+ case 0:
128
+ $mlw_advert_text = "Need support or features? Check out our Premium Support options! Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details!";
129
+ break;
130
+ case 1:
131
+ $mlw_advert_text = "Is Quiz Master Next beneficial to your website? Please help by giving us a review on WordPress.org by going <a href=\"http://wordpress.org/support/view/plugin-reviews/quiz-master-next\">here</a>!";
132
+ break;
133
+ case 2:
134
+ $mlw_advert_text = "Want help installing and configuring one of our plugins? Check out our Plugin Installation services. Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details!";
135
+ break;
136
+ case 3:
137
+ $mlw_advert_text = "Would you like to support this plugin but do not need or want premium support? Please consider our inexpensive 'Advertisements Be Gone' add-on which will get rid of these ads. Visit our <a href=\"http://mylocalwebstop.com/shop/\">Plugin Add-On Store</a> for details!";
138
+ break;
139
+ case 4:
140
+ $mlw_advert_text = "Need to be able to export the results of your quizzes? Be sure to check out our new Export Results add-on in our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a>!";
141
+ break;
142
+ case 5:
143
+ $mlw_advert_text = "Need help keeping your plugins, themes, and WordPress up to date? Want around the clock security monitoring and off-site back-ups? How about WordPress training videos, a monthly status report, and support/consultation? Check out our <a href=\"http://mylocalwebstop.com/wordpress-maintenance-services/\">WordPress Maintenance Services</a> for more details!";
144
+ break;
145
+ case 6:
146
+ $mlw_advert_text = "Setting up a new site? Let us take care of the set-up so you back to running your business. Check out our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for more details!";
147
+ break;
148
+ case 7:
149
+ $mlw_advert_text = "Need a page so your users can see their results from all the quizzes they have taken? Try our new User Dashboard add-on. Check out our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for more details!";
150
+ break;
151
+ case 8:
152
+ $mlw_advert_text = "Our new Popular Add-On Pack is now only $45 for 6 add-ons! Now is the time to save almost 50%! Visit our <a href=\"http://mylocalwebstop.com/shop/\">WordPress Store</a> for details.";
153
+ break;
154
+ default:
155
+ $mlw_advert_text = "Need support or features? Check out our Premium Support options! Visit our <a href=\"http://mylocalwebstop.com/shop/\">Plugin Add-On Store</a> for details!";
156
+ }
157
+ $mlw_advert .= "
158
+ <style>
159
+ div.help_decide
160
+ {
161
+ display: block;
162
+ text-align:center;
163
+ letter-spacing: 1px;
164
+ margin: auto;
165
+ text-shadow: 0 1px 1px #000000;
166
+ background: #0d97d8;
167
+ border: 5px solid #106daa;
168
+ -moz-border-radius: 20px;
169
+ -webkit-border-radius: 20px;
170
+ -khtml-border-radius: 20px;
171
+ border-radius: 20px;
172
+ color: #FFFFFF;
173
+ }
174
+ div.help_decide a
175
+ {
176
+ color: yellow;
177
+ }
178
+ </style>";
179
+ $mlw_advert .= "
180
+ <div class=\"help_decide\">
181
+ <p>$mlw_advert_text</p>
182
+ </div>";
183
+ }
184
+ return $mlw_advert;
185
+ }
186
+
187
+
188
+
189
+ /*
190
+
191
+
192
+ */
193
  ?>
readme.txt CHANGED
@@ -1,709 +1,717 @@
1
- === Quiz Master Next ===
2
- Contributors: fpcorso
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RTGYAETX36ZQJ
4
- Tags: quiz, test, score, exam, survey, contact, form, email, answer, question
5
- Requires at least: 3.8.1
6
- Tested up to: 4.0
7
- Stable tag: 3.3.2
8
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
-
10
- The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
11
-
12
- == Description ==
13
-
14
- The easiest and most flexible way to add multiple quizzes, tests, surveys, and contact forms to your website. This plugin allows for unlimited quizzes each with unlimited amount of questions. The plugin allows you to create the quiz, add it to any page using a customized shortcode, allows the user to take the quiz, and then saves the results. You can set up what the user sees after he or she takes the quiz based on the user's score. You can also have the plugin create a certificate for the user as well!
15
-
16
- = Have Unlimted Quizzes, Tests, Surveys, Contact Forms, etc.. =
17
- Each of your quizzes can have **unlimited** questions and each of those questions can have **unlimited** answers! Your questions can contain **HTML** to show images, Youtube videos and more.
18
-
19
- = Customize Your Text =
20
- All the text your users see can be **customized**. Everything from the text blocks throughout the quiz to the submit button.
21
-
22
- = Different Types Of Questions =
23
- You can have **multiple choice** (radio buttons), **true and false**, **open answer** question, **drop down**, **multiple response** (checkboxes), **number**, **captcha**, and **accept**. More types are being supported in future updates!
24
-
25
- = Mulitple Landing Pages For Each Quiz =
26
- Each quiz can have **unlimited** results pages that can be customized with your text. Show different results pages based on the users score!
27
-
28
- = Emails After Completion Of Quiz =
29
- After the user takes a quiz, you can have the plugin email you and the user with results. This too can be customized with your own text.
30
-
31
- = Very Flexible =
32
- Your quiz can be graded with an incorrect/correct system or a points-based system. Or not at all. You ask for contact information at the beginning or the end and you decide which contact fields are required. You can decide to use all the questions or only a select few chosen at random. You can also set the number of questions per page or have all the questions on one page.
33
-
34
- = Useful For Businesses =
35
- The plugin features useful **statistics** that show how many times each quiz has been viewed and taken and plots the data on several different **graphs** so you can see how the quizzes are doing at a glance. Also, the plugin includes an **audit trail** that logs every action done on the admin side so you can keep up with who is doing what!
36
-
37
- = Saves The Results For Later Use =
38
- The plugin will **save** the results, the user's answers, the user's comments, and more!
39
-
40
- = Other Useful Features =
41
-
42
- * Allow the user to share the results on *social networks*
43
- * Show all questions on one page or have only one question per page
44
- * Allows for you to create **certificates** for the user
45
- * Can set amount of tries a user has to take the quiz
46
- * Can enable **comment boxes** for each question and/or comment section at the end of the quiz
47
- * Can enable **hints** for questions
48
- * Can show user why the answer is the correct answer
49
- * Questions can be in predetermined order or random
50
- * **Leaderboards** for every quiz which can be used as shortcode or in included widget
51
- * Keep track how long a user takes on the quiz
52
- * Able to set up time limits on the quiz
53
- * And **Much** More...
54
-
55
- = Quiz Master Next Add-ons =
56
- While Quiz Master Next is fully functional and is packed full of features that will meet the needs of most, we do offer vaious extra features and support available in our [Wordpress Store](http://mylocalwebstop.com/shop/)
57
-
58
-
59
- == Installation ==
60
-
61
- We now offer an installation service to assist you in this process. We will install any or all of our plugins and spend up to 2 hours with you for consultaion and training. Visit our website for details.
62
- [My Local Webstop Plugin Installation](http://mylocalwebstop.com/product/plugin-installation/)
63
-
64
- **Or**
65
-
66
- * Navigate to Add New Plugin page within your WordPress
67
- * Search for Quiz Master Next
68
- * Click Install Now link on the plugin and follow the prompts
69
- * Activate the plugin through the 'Plugins' menu in WordPress
70
-
71
- **Or**
72
-
73
- * Upload plugin dir to the `/wp-content/plugins/` directory
74
- * Activate the plugin through the 'Plugins' menu in WordPress
75
-
76
-
77
- == Frequently Asked Questions ==
78
-
79
- = What does the option do on that page? =
80
- On each page, there is a "?" next to the page title. Clicking on it will bring up a small help window that will assist you on that page.
81
-
82
- = How do you use that feature? =
83
- We have begun creating documentation for the plugin. You can view the documentation here: [Documentation](http://mylocalwebstop.com/plugin-documentation/) If you still have any trouble, feel free to use the widget on the quiz dashboard within the plugin to contact me and I will help you.
84
-
85
- = I need a lot of help setting up my quiz, what can you do to help? =
86
- We now offer a premium support plan that offers priority response, priority feature requests, and 1-on-1 training! For details, visit our services page: [My Local Webstop Services](http://mylocalwebstop.com/product/plugin-premium-support/)
87
-
88
- = Do you offer any 1-on-1 training to assist me in using this plugin? =
89
- We now offer an installation service that includes 1-on-1 training as well as a premium support that offers 1-on-1 training. For details, visit our [Wordpress Store](http://mylocalwebstop.com/shop/)
90
-
91
- = I have an idea, how do I contact you? =
92
- Feel free to use the widget on the quiz dashboard within the plugin or from the contact page at mylocalwebstop.com.
93
-
94
- == Screenshots ==
95
-
96
- 1. Quiz Admin Page (With Advertisement Be Gone Add-On)
97
- 2. Quiz Options Page (With Advertisement Be Gone Add-On)
98
- 3. Quiz Dashboard Page (With Advertisement Be Gone Add-On)
99
- 4. Example Quiz
100
- 5. Example Survey
101
- 6. Quiz Results Page
102
- 7. Example Contact Form
103
- 8. Example Quiz With Styling
104
-
105
- == Changelog ==
106
-
107
- = 3.3.2 (October 26, 2014) =
108
- * Minor Design Change To Quiz Options
109
-
110
- = 3.3.1 (October 15, 2014) =
111
- * Added Horizontal Multiple Response Question Type
112
- * Added Ability To Duplicate Questions When Duplicate Quizzes
113
- * Added Last Modified Column To Table On Quizzes Page
114
- * Fixed Number Question Type Grading Bug
115
- * Fixed Missing theme_selected Column Installation Bug
116
- * Fixed Missing theme_selected Column Duplication Bug
117
- * Fixed Numerous Small Bugs
118
-
119
- = 3.2.2 (October 4, 2014) =
120
- * Minor Bug Fixes
121
-
122
- = 3.2.1 (October 2, 2014) =
123
- * Added New Captcha Question Type
124
- * Fixed Number Question Type Validation Bug
125
- * Fixed Validation Wrong Border Bug
126
-
127
- = 3.1.1 (September 15, 2014) =
128
- * Added Ability To Duplicate Individual Questions
129
- * Added Ability To Require Accept, Number, And Open Answer Question Types
130
- * Added Number Question Type
131
- * Added Accept Non-Question Type
132
-
133
- = 3.0.1 (August 28, 2014) =
134
- * Added New Style Manager
135
- * Added Ability For Non-Question Question Types
136
- * Added New Text Block Question Type
137
- * Added Question Type Column To Question List
138
- * Minor Design Changes To Quiz Questions Tab
139
- * Fixed Results Delete Link Not Working Bug
140
- * Fixed Quiz Name Showing Escaped Values Bug
141
-
142
- = 2.9.1 (August 11, 2014) =
143
- * Added Facebook Sharing
144
- * Added Ability To Edit Email Subject
145
- * Added Large Open Answer Question Type
146
- * Added Ability For Points To Have Decimal Values
147
- * Fixed Not All Questions Showing In Results Bug
148
- * Fixed Not Valid Email On Non-Required Email Bug
149
- * Fixed Special Character Not Grading Properly In Open Answer Bug
150
-
151
- = 2.8.5 (August 9, 2014) =
152
- * Minor Bug Fixes
153
- * Minor Design Tweaks To About Page
154
-
155
- = 2.8.4 (August 3, 2014) =
156
- * Minor Bug Fixes
157
-
158
- = 2.8.3 (June 8, 2014) =
159
- * Next/Previous Buttons Now Scroll Page To Top Of Quiz
160
- * Minor Bug Fixes
161
-
162
- = 2.8.2 (May 28, 2014) =
163
- * Minor Bug Fixes
164
-
165
- = 2.8.1 (May 26, 2014) =
166
- * Took Out Help Related Tool Tips
167
- * Design Changes To Quiz Text Tab For Easier Navigation
168
- * Deleted How-To Page, Please Use Documentation On Our Website
169
- * Renamed Quiz Options Page As Quiz Settings To Avoid Confusion With Quiz Options Tab
170
-
171
- = 2.7.3 (May 19, 2014) =
172
- * Fixed Open Answer Not Showing Correct Answer Bug
173
-
174
- = 2.7.2 (May 18, 2014) =
175
- * Fixed Timer Not Restarting Bug
176
- * Fixed Tooltip Affecting Whole Page Bug
177
-
178
- = 2.7.1 (May 16, 2014) =
179
- * Added Ability To Set Number Of Question Per Page
180
- * Fixed HTML Not Showing On Results Page Bug
181
- * Fixed Timer Not Disabling New Fields Bug
182
- * Fixed Timer Submitting Disabled Fields Bug
183
-
184
- = 2.6.4 (May 12, 2014) =
185
- * Bug Fixes
186
-
187
- = 2.6.3 (May 9, 2014) =
188
- * Bug Fixes
189
-
190
- = 2.6.2 (May 8, 2014) =
191
- * Bug Fixes
192
-
193
- = 2.6.1 (May 7, 2014) =
194
- * Added UTF-8 Support For Special Characters And Non-Latin Languages
195
- * Fixed Question Bank Showing All Answers Bug
196
-
197
- = 2.5.1 (May 3, 2014) =
198
- * Rebuilt Answer System
199
- * Added Ability To Have Unlimited Answers
200
- * Added Ability To Randomize Answers
201
- * Added New Question Type - Multiple Response (Checkboxes)
202
- * Added Ability To Send Admin Email To Multiple Users
203
- * Minor Design Changes To Quiz Options Page
204
-
205
- = 2.4.1 (April 20, 2014) =
206
- * Added New Quiz Emails Tab
207
- * Added Ability To Send Different Emails To Users Based On Score
208
- * Fixed Required Question Bug
209
- * Fixed Landing Page Bug
210
-
211
- = 2.3.1 (April 6, 2014) =
212
- * Added Ability To Have Graded Open Answer Questions
213
- * Minor Design Changes
214
-
215
- = 2.2.2 (March 30, 2014) =
216
- * Reverted To Previous Pagination Javascript
217
-
218
- = 2.2.1 (March 30, 2014) =
219
- * Added Ability To Show Question Numbers
220
- * Added More CSS Classes To Quiz Page For Better Styling Options
221
- * Changed Timer To Disable Fields Instead Of Submit Form When Time Is Up
222
- * Fixed Pagination Javascript Bug
223
- * Minor Design Change To Quiz
224
- * Minor Design Change To Quiz Options Page
225
-
226
- = 2.1.1 (March 26, 2014) =
227
- * Added Ability To Edit Style For Each Quiz
228
- * Fixed Tried Quiz Too Many Times Text Bug
229
- * Fixed Dashboard Quartely Widget Bug
230
- * Minor Design Changes To Quiz Options Page
231
-
232
- = 2.0.1 (March 22, 2014) =
233
- * Added Pagination On Quiz Results Page
234
- * Redesigned Results Detail Page
235
- * Fixed PHP Notice On Quizzes Page
236
- * Allow HTML/CSS in Landing Pages
237
-
238
- = 1.9.6 (March 19, 2014) =
239
- * Fixed Duplicate Quiz Bug
240
- * Fixed Uneditable Question Bug
241
- * Fixed Parse Bug
242
- * Made Email Now Send As HTML
243
-
244
- = 1.9.5 (March 18, 2014) =
245
- * Fixed Bug
246
-
247
- = 1.9.4 (March 18, 2014) =
248
- * Fixed Bug
249
-
250
- = 1.9.3 (March 17, 2014) =
251
- * Fixed Bug: Unexpected T_CONSTANT_ENCAPSED_STRING When Activating
252
-
253
- = 1.9.2 (March 17, 2014) =
254
- * Added Ability To Delete Landing Pages
255
- * Added Ability To Have HTML In Correct Answer Info Field
256
- * Added Previous Question Button To Paginated Quiz
257
- * Minor Design Changes To Quiz
258
- * Add Timer To Title Bar
259
- * Added %CURRENT_DATE% field
260
-
261
- = 1.9.1 (March 13, 2014) =
262
- * Added Ability To Show One Question At A Time Instead Of All At Once
263
- * Added Ability To Allow Users To Share Results On Twitter
264
- * Added Ability To Set Time Limits On Quiz
265
- * Minor Design Changes To Quiz
266
- * Minor Bug Fixes
267
-
268
- = 1.8.2 (March 11, 2014) =
269
- * Minor Bug Fixes
270
-
271
- = 1.8.1 (March 10, 2014) =
272
- * Added Customizable Text Section At End Of Quiz
273
- * Added Ability To Set Up Different Landing Pages Based On Score
274
- * Added Ability To Give Certificate After Quiz
275
- * Enhanced Quiz Total Stats Widget
276
- * Minor Design Changes To Quiz
277
- * Fixed Session_Start Bug
278
- * Fixed Division By Zero Bug
279
- * Fixed Total Stats Deleted Bug
280
- * Fixed Dashboard Rounding Bug
281
- * Fixed Notice Unknown Company Field Bug
282
-
283
-
284
- = 1.7.1 (March 6, 2014) =
285
- * Added Several New Widgets To Quiz Dashboard
286
- * Added A Timer Mechanism To Track How Long User Takes On Quiz
287
- * Added New About Update Page
288
- * Fixed Saving Results Bug
289
- * Fixed Random Number On Quiz Options Page Bug
290
-
291
- = 1.6.3 (March 5, 2014) =
292
- * Fixed Duplicated Shortcode Bug
293
- * Quiz Dashboard Design Changes
294
-
295
- = 1.6.2 (March 4, 2014) =
296
- * Minor Bug Fixes
297
- * Minor Design Changes
298
-
299
- = 1.6.1 (March 2, 2014) =
300
- * Added Ability To Limit Amount User Tries Certain Quizzes
301
- * Fixed Internet Explorer Quiz Adding Bug
302
- * Fixed Results Link On Quizzes Page Bug
303
- * Fixed Points Number Check Bug
304
- * Fixed Limited Question Grading Bug
305
- * Minor Design Changes To Admin Pages
306
-
307
- = 1.5.1 (February 26, 2014) =
308
- * Added Ability To Load Only Set Amount Of Questions From Total Questions
309
- * Fixed PHP Notices On Quizzes Page
310
- * Fixed PHP Notices On Quiz Options Page
311
- * Fixed PHP Notices On Quiz Results Page
312
- * Fixed PHP Notices On Quiz
313
- * Fixed Hidden Pop-Up Bug
314
-
315
- = 1.4.2 (February 22, 2014) =
316
- * Fixed Capability Bug
317
- * Minor Design Changes To Question Form
318
- * Hint Bubble Is Now Wider For Longer Hints
319
- * Minor Design Change To Quiz
320
-
321
- = 1.4.1 (February 20, 2014) =
322
- * Enhanced Plugins Compatibility With Other Plugins
323
- * Hints Are Now Hidden By Default
324
- * Minor Bug Fixes
325
-
326
- = 1.3.1 (February 18, 2014) =
327
- * Added Ability To Choose Whether Logged-in Users Can Enter Contact Info
328
- * Fixed Editing Hint Field Error
329
- * Added Ability To Have Media In Answers
330
- * Added Ability To Have HTML In Questions And Answers
331
-
332
- = 1.2.1 (February 11, 2014) =
333
- * Fixed Quiz Results Details Bug
334
- * Continued Working On New Error Code System
335
- * Added Pagination To Tools Page, Quizzes Page And List Of Questions On Quiz Options Page
336
- * Added Ability To Create A Duplicate Of A Quiz
337
-
338
- = 1.1.1 (February 6, 2014) =
339
- * Added %AVERAGE_POINT% Variable That Calculates Average Points Per Question
340
- * Added Field For Reason Why Answer Is Correct
341
- * Added %CORRECT_ANSWER_INFO% To Display Why Answer Is Correct
342
- * Begun Creating New Error Code System
343
- * Fixed Edit Quiz Name Bug
344
- * Fixed New Quiz Bug
345
-
346
- = 1.0.1 (February 4, 2014) =
347
- * Fixed Saving Results Bug
348
- * Fixed Leaderboard Bug
349
-
350
- = 1.0 (February 1, 2014) =
351
- * Added Ability To Customize From Name For User And Admin Emails
352
- * Changed Question Editor
353
- * Minor Change To Help System
354
-
355
- = 0.9.9 (January 30, 2014) =
356
- * Begun Creating New Advanced Help System
357
- * Added New Question Editor
358
- * Added Ability To Have Media In Questions
359
- * Minor Design Changes To Quiz Options
360
-
361
- = 0.9.8 (January 25, 2014) =
362
- * Added Leaderboard Widget
363
- * Added Ability To Reset Quiz Stats On Each Quiz
364
- * Added Ability To Delete Results
365
- * Minor Design Changes
366
- * Minor Bug Fixes
367
-
368
- = 0.9.7 (January 24, 2014) =
369
- * Started Setting Plugin Up For Translations
370
- * Relocated Widgets From Help Page To Quiz Dashboard Page
371
- * Updated Several Of The Help Sections Through Plugin
372
- * Minor Bug Fixes
373
-
374
- = 0.9.6 (January 21, 2014) =
375
- * Added Ability To Edit Question Order When Adding Questions
376
- * Added Ability To Choose Whether Contact Info Is Asked For At Beginning Or End Of Quiz
377
- * Defaulted Question Comment Field To None On New Questions
378
- * Fixed Double Quote Bug
379
- * Enhanced Monthly Stat Widget
380
- * Minor Design Change To Quiz Total Stats Widget
381
- * Minor Design Changes To Quiz Options Page
382
-
383
- = 0.9.5 (January 19, 2014) =
384
- * Added Ability To Edit %QUESTIONS_ANSWERS% Template
385
- * Changed Name Of Support Page To Help Page
386
- * Minor Design Changes On Quiz Options Page
387
-
388
- = 0.9.4 (January 16, 2014) =
389
- * Added Ability To Randomly Order Questions
390
- * Updated Monthly Stat Widget
391
-
392
- = 0.9.3 (January 14, 2014) =
393
- * Logged-In Users Now See Contact Information
394
- * Minor Bug Fixes
395
-
396
- = 0.9.2 (January 12, 2014) =
397
- * Updated Weekly Stat Widget
398
- * Begun Work On Monthly Stat Widget
399
- * Added Ability To Edit Leaderboard Template
400
- * Bug Fixes
401
-
402
- = 0.9.1 (January 8, 2014) =
403
- * Fixed Leaderboard Design Bug
404
- * Fixed Contact Information Design Bug
405
- * Added Ability To Not Need Contact Info For Logged In Users
406
-
407
- = 0.9 (January 5, 2014) =
408
- * Added Ability To Edit Quiz Name
409
- * Added Ability To Display Question As Drop Down
410
- * Added Quiz Name To Completion Email's Subject
411
- * Minor Design Changes To Quiz Options Page
412
- * Design Changes To Quiz
413
-
414
- = 0.8.6 (January 2, 2014) =
415
- * Bug Fixes
416
-
417
- = 0.8.5 (January 1, 2014) =
418
- * New Screenshots Added
419
- * Minor Design Changes
420
- * Bug Fixes
421
-
422
- = 0.8.4 (December 22, 2013) =
423
- * New Option To Change Size Of Comment Field
424
- * Enhanced Weekly Stat Chart
425
- * Bug Fixes
426
-
427
- = 0.8.3 (December 14, 2013) =
428
- * Fixed Leaderboard Bug
429
- * Started Work On Weekly Stat Widget
430
- * Tweaked Some Design Throughout Admin Side
431
- * Minor Bug Fixes
432
-
433
- = 0.8.2 (December 10, 2013) =
434
- * Fixed Disappearing Question Bug Completely
435
- * Updated Update Process
436
-
437
- = 0.8.1 (December 9, 2013) =
438
- * Fixed Disappearing Question Bug
439
-
440
- = 0.8 (December 1, 2013) =
441
- * Added Spam Prevention Techniques To Backend
442
- * Added Ability To Reorder Questions
443
- * Added New Section On How-To Page
444
- * Bug Fixes
445
-
446
- = 0.7.2 (November 24, 2013) =
447
- * Bug Fixes
448
- * Added New Section On How-To Page
449
-
450
- = 0.7.1 (November 19, 2013) =
451
- * Changed Design For How-To Page
452
- * Added New Section In How-To Page
453
- * Added New Widget On Plugin Dashboard For Daily Stats
454
-
455
- = 0.7 (November 15, 2013) =
456
- * Bug Fixes
457
- * Begun Work On New How-To Page
458
- * Continued Redesigning Plugin Dashboard
459
-
460
- = 0.6.2 (November 10, 2013) =
461
- * Bug Fixes
462
- * Added More Stats
463
- * Started Redesigning Plugin Dashboard
464
-
465
- = 0.6.1 (November 2, 2013) =
466
- * Bug Fixes
467
-
468
- = 0.6 (October 19, 2013) =
469
- * Started Developing Quiz Leaderboards
470
- * Added Ability To Save User Answers And Comments
471
- * Added More Statistics To Quiz Dashboard
472
- * Bug Fixes
473
-
474
- = 0.5.3 (October 11, 2013) =
475
- * Bug Fixes
476
- * Started Redesigning Quiz Look
477
-
478
- = 0.5.2 (September 29, 2013) =
479
- * Bug Fixes
480
-
481
- = 0.5.1 (September 22, 2013) =
482
- * Added More Statistics To Quiz Dashboard
483
- * Bug Fixes
484
-
485
- = 0.5 (September 18, 2013) =
486
- * Created New Tools Page And Moved Audit Trail To It
487
- * Added Ability For Comment Section At End Of Quiz
488
- * Added Ability To Have Hints
489
- * Added Option To Have Comment Boxes On Questions
490
- * Added More Statistics To Main Page
491
-
492
- = 0.4.1 (September 15, 2013) =
493
- * Bug Fixes
494
-
495
- = 0.4 (September 13, 2013) =
496
- * Add The Ability To Require Contact Information
497
- * Add Email Validating To Email Field
498
-
499
- = 0.3.1 (September 13, 2013) =
500
- * Bug Fixes
501
-
502
- = 0.3 (September 12, 2013) =
503
- * Increased Scoring Systems To Three: Correct, Points, Or Not Graded
504
- * Error Fixes
505
-
506
- = 0.2 (September 9, 2013) =
507
- * Added New Quiz Dashboard Page
508
- * Created Audit Trail
509
- * Added Ability to Add Questions/Answers to Templates
510
- * Minor Spelling/Grammer Fixes
511
-
512
- = 0.1 (September 1, 2013) =
513
- * Begun Development
514
- * Added ability to create/edit/delete quizzes
515
- * Added ability to create/edit/delete questions
516
- * Added quiz admin page
517
- * Added questions admin page
518
- * Added results page
519
-
520
- == Upgrade Notice ==
521
-
522
- = 3.3.1 =
523
- Upgrade for new Horizontal Multiple Response question type and to be able to duplicate questions when duplicating quizzes. Also, fixes several major and minor bugs.
524
-
525
- = 3.2.1 =
526
- Upgrade for new Captcha question types!
527
-
528
- = 3.1.1 =
529
- Upgrade for new Accept and Number question types. Also, now you have the ability to duplicate individual questions!
530
-
531
- = 3.0.1 =
532
- Upgrade for new style manager, new non-question types, text block question type, and various design/bug fixes!
533
-
534
- = 2.9.1 =
535
- Upgrade for facebook sharing, a new question type, the ability to edit the email's subject, and much more!
536
-
537
- = 2.8.5 =
538
- Upgrade for minor bug fixes.
539
-
540
- = 2.8.3 =
541
- Upgrade for minor bug fixes.
542
-
543
- = 2.8.2 =
544
- Upgrade for minor bug fixes.
545
-
546
- = 2.7.3 =
547
- Upgrade for bug fixes.
548
-
549
- = 2.7.2 =
550
- Upgrade for bug fixes.
551
-
552
- = 2.7.1 =
553
- Upgrade to have the ability to set number of questions per page and more bug fixes.
554
-
555
- = 2.6.4 =
556
- Upgrade for bug fixes.
557
-
558
- = 2.6.3 =
559
- Upgrade for bug fixes.
560
-
561
- = 2.6.2 =
562
- Upgrade for bug fixes.
563
-
564
- = 2.6.1 =
565
- Upgrade to be able to support special characters and non-latin based languages.
566
-
567
- = 2.5.1 =
568
- Upgrade for many new features including unlimited answers, random answers, new question type, and more!
569
-
570
- = 2.4.1 =
571
- Upgrade to be able to send different emails based on user's score. Also, minor bug fixes included.
572
-
573
- = 2.1.1 =
574
- Upgrade to have the ability to edit the css styles for each quiz! Plus minor bugs fixes.
575
-
576
- = 2.0.1 =
577
- Upgrade to fix minor bugs and enable pagination on results page.
578
-
579
- = 1.9.2 =
580
- Upgrade to have the ability to delete landing pages, allow users to go back when paginating questions, and have HTML in the correct answer info field!
581
-
582
- = 1.9.1 =
583
- Upgrade to 1.9.1 to get the ability for pagination on the quiz and to allow your users to share their results on Twitter.
584
-
585
- = 1.8.1 =
586
- Upgrade to 1.8.1 to get the ability to have different landing pages based on the user's score, give users certificates, and an additional customizable text section at the end of quiz. Plus minor design changes to quiz and Quiz Dashboard and lots of bug fixes.
587
-
588
- = 1.7.1 =
589
- This update adds new widgets to Quiz Dashboard, adds a timer mechanism, and fixes several minor bugs.
590
-
591
- = 1.6.3 =
592
- This update fixes minor bugs and adds minor design changes.
593
-
594
- = 1.6.2 =
595
- This update fixes minor bugs and adds minor design changes.
596
-
597
- = 1.6.1 =
598
- This update allows you to set the amount of tries a user has for cetain quizzes. Also fixes several bugs.
599
-
600
- = 1.5.1 =
601
- This update allows you to have the quiz only load a set number of questions from your total question bank. Also fixes several minor bugs.
602
-
603
- = 1.4.2 =
604
- This update brings many minor design changes and minor bug fixes.
605
-
606
- = 1.4.1 =
607
- This update helps plugin work better with other plugins. The hints for the quiz are now hidden by default.
608
-
609
- = 1.2.1 =
610
- This update adds pagination to the quizzes, audit trail, and question tables to make using the admin side easier. It also adds the ability to duplicate a quiz. Fixes various minor bugs.
611
-
612
- = 1.1.1 =
613
- This update adds the ability to show the user the reason why an answer is correct. Also, added new variable for templates that calculates average points per question. Minor bug fixes.
614
-
615
- = 1.0.1 =
616
- This update fixes minor bugs.
617
-
618
- = 1.0 =
619
- This update finally brings this plugin out of beta! This update brings the ability to edit the From Name part of the email sent to users and admin. Minor bug fixes.
620
-
621
- = 0.9.9 =
622
- Upgrade to be able to include media in your questions! Also, fixed minor bugs and made minor design changes.
623
-
624
- = 0.9.8 =
625
- Upgrade to use new leaderboard widet! Also, added ability to reset stats for quizzes from Quiz Options page. Added ability to delete results as well. Minor design changes and bug fixes.
626
-
627
- = 0.9.7 =
628
- Upgrade to see widgets relocated from help page to quiz dashboard page. Also, began setting plugin up for translations. Updated many help sections throughout plugin. Minor bug fixes.
629
-
630
- = 0.9.6 =
631
- Upgrade to be able to choose whether contact information is asked for at beginning or end of the quiz. Also, added ability to edit question order when adding new questions. Several minor design changes on admin side. Fixed double quote bug.
632
-
633
- = 0.9.5 =
634
- Upgrade to be able to edit the %QUESTIONS_ANSWERS% template. Also, minor design changes on Quiz Options page.
635
-
636
- = 0.9.4 =
637
- Upgrade to set up your quizzes to randomize the questions
638
-
639
- = 0.9.3 =
640
- Upgrade for minor bug fixes.
641
-
642
- = 0.9.2 =
643
- Upgrade for several enhanced stat widgets and the ability to edit leaderboard templates!
644
-
645
- = 0.9.1 =
646
- Upgrade for several bug fixes and new ability to have logged in users not have to enter contact information
647
-
648
- = 0.9 =
649
- Upgrade for several new features and bug fixes
650
-
651
- = 0.8.6 =
652
- Upgrade to fix minor bugs
653
-
654
- = 0.8.5 =
655
- Upgrade to fix minor bugs
656
-
657
- = 0.8.4 =
658
- Upgrade to enjoy small tweaks throughout admin side
659
-
660
- = 0.8.3 =
661
- Upgrade to enjoy small tweaks throughout admin side
662
-
663
- = 0.8.2 =
664
- Upgrade to fix bug that made questions vanish.
665
-
666
- = 0.8.1 =
667
- Upgrade to fix bug that made questions vanish.
668
-
669
- = 0.8 =
670
- Upgrade to enjoy several new features and minor bug fixes.
671
-
672
- = 0.7.2 =
673
- Upgrade to fix minor bugs and view new section on how-to page.
674
-
675
- = 0.7.1 =
676
- Upgrade to fix minor bugs, view new section how-to page, and new stats on main page.
677
-
678
- = 0.7 =
679
- Upgrade to fix minor bugs, view new how-to page, and new stats on main page.
680
-
681
- = 0.6.2 =
682
- Upgrade to fix some minor bug fixes.
683
-
684
- = 0.6 =
685
- Upgrade to enjoy several new features including saved results and leaderboards!
686
-
687
- = 0.5.3 =
688
- Upgrade to fix some minor bug fixes.
689
-
690
- = 0.5.2 =
691
- Upgrade to fix some minor bug fixes.
692
-
693
- = 0.5.1 =
694
- Upgrade to fix some minor bug fixes.
695
-
696
- = 0.5 =
697
- Upgrade to enjoy several new features including surveys!
698
-
699
- = 0.4 =
700
- Upgrade to enjoy being able to require contact information.
701
-
702
- = 0.3 =
703
- Upgrade to enjoy the new Not Graded scoring system and some error fixes!
704
-
705
- = 0.2 =
706
- Upgrade to enjoy three new features and some minor fixes!
707
-
708
- = 0.1 =
 
 
 
 
 
 
 
 
709
  Initial Version
1
+ === Quiz Master Next ===
2
+ Contributors: fpcorso
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RTGYAETX36ZQJ
4
+ Tags: quiz, test, score, exam, survey, contact, form, email, answer, question
5
+ Requires at least: 3.8.1
6
+ Tested up to: 4.0
7
+ Stable tag: 3.3.3
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
11
+
12
+ == Description ==
13
+
14
+ The easiest and most flexible way to add multiple quizzes, tests, surveys, and contact forms to your website. This plugin allows for unlimited quizzes each with unlimited amount of questions. The plugin allows you to create the quiz, add it to any page using a customized shortcode, allows the user to take the quiz, and then saves the results. You can set up what the user sees after he or she takes the quiz based on the user's score. You can also have the plugin create a certificate for the user as well!
15
+
16
+ = Have Unlimted Quizzes, Tests, Surveys, Contact Forms, etc.. =
17
+ Each of your quizzes can have **unlimited** questions and each of those questions can have **unlimited** answers! Your questions can contain **HTML** to show images, Youtube videos and more.
18
+
19
+ = Customize Your Text =
20
+ All the text your users see can be **customized**. Everything from the text blocks throughout the quiz to the submit button.
21
+
22
+ = Different Types Of Questions =
23
+ You can have **multiple choice** (radio buttons), **true and false**, **open answer** question, **drop down**, **multiple response** (checkboxes), **number**, **captcha**, and **accept**. More types are being supported in future updates!
24
+
25
+ = Mulitple Landing Pages For Each Quiz =
26
+ Each quiz can have **unlimited** results pages that can be customized with your text. Show different results pages based on the users score!
27
+
28
+ = Emails After Completion Of Quiz =
29
+ After the user takes a quiz, you can have the plugin email you and the user with results. This too can be customized with your own text.
30
+
31
+ = Very Flexible =
32
+ Your quiz can be graded with an incorrect/correct system or a points-based system. Or not at all. You ask for contact information at the beginning or the end and you decide which contact fields are required. You can decide to use all the questions or only a select few chosen at random. You can also set the number of questions per page or have all the questions on one page.
33
+
34
+ = Useful For Businesses =
35
+ The plugin features useful **statistics** that show how many times each quiz has been viewed and taken and plots the data on several different **graphs** so you can see how the quizzes are doing at a glance. Also, the plugin includes an **audit trail** that logs every action done on the admin side so you can keep up with who is doing what!
36
+
37
+ = Saves The Results For Later Use =
38
+ The plugin will **save** the results, the user's answers, the user's comments, and more!
39
+
40
+ = Other Useful Features =
41
+
42
+ * Allow the user to share the results on *social networks*
43
+ * Show all questions on one page or have only one question per page
44
+ * Allows for you to create **certificates** for the user
45
+ * Can set amount of tries a user has to take the quiz
46
+ * Can enable **comment boxes** for each question and/or comment section at the end of the quiz
47
+ * Can enable **hints** for questions
48
+ * Can show user why the answer is the correct answer
49
+ * Questions can be in predetermined order or random
50
+ * **Leaderboards** for every quiz which can be used as shortcode or in included widget
51
+ * Keep track how long a user takes on the quiz
52
+ * Able to set up time limits on the quiz
53
+ * And **Much** More...
54
+
55
+ = Quiz Master Next Add-ons =
56
+ While Quiz Master Next is fully functional and is packed full of features that will meet the needs of most, we do offer vaious extra features and support available in our [Wordpress Store](http://mylocalwebstop.com/shop/)
57
+
58
+
59
+ == Installation ==
60
+
61
+ We now offer an installation service to assist you in this process. We will install any or all of our plugins and spend up to 2 hours with you for consultaion and training. Visit our website for details.
62
+ [My Local Webstop Plugin Installation](http://mylocalwebstop.com/product/plugin-installation/)
63
+
64
+ **Or**
65
+
66
+ * Navigate to Add New Plugin page within your WordPress
67
+ * Search for Quiz Master Next
68
+ * Click Install Now link on the plugin and follow the prompts
69
+ * Activate the plugin through the 'Plugins' menu in WordPress
70
+
71
+ **Or**
72
+
73
+ * Upload plugin dir to the `/wp-content/plugins/` directory
74
+ * Activate the plugin through the 'Plugins' menu in WordPress
75
+
76
+
77
+ == Frequently Asked Questions ==
78
+
79
+ = What does the option do on that page? =
80
+ On each page, there is a "?" next to the page title. Clicking on it will bring up a small help window that will assist you on that page.
81
+
82
+ = How do you use that feature? =
83
+ We have begun creating documentation for the plugin. You can view the documentation here: [Documentation](http://mylocalwebstop.com/plugin-documentation/) If you still have any trouble, feel free to use the widget on the quiz dashboard within the plugin to contact me and I will help you.
84
+
85
+ = I need a lot of help setting up my quiz, what can you do to help? =
86
+ We now offer a premium support plan that offers priority response, priority feature requests, and 1-on-1 training! For details, visit our services page: [My Local Webstop Services](http://mylocalwebstop.com/product/plugin-premium-support/)
87
+
88
+ = Do you offer any 1-on-1 training to assist me in using this plugin? =
89
+ We now offer an installation service that includes 1-on-1 training as well as a premium support that offers 1-on-1 training. For details, visit our [Wordpress Store](http://mylocalwebstop.com/shop/)
90
+
91
+ = I have an idea, how do I contact you? =
92
+ Feel free to use the widget on the quiz dashboard within the plugin or from the contact page at mylocalwebstop.com.
93
+
94
+ == Screenshots ==
95
+
96
+ 1. Quiz Admin Page (With Advertisement Be Gone Add-On)
97
+ 2. Quiz Options Page (With Advertisement Be Gone Add-On)
98
+ 3. Quiz Dashboard Page (With Advertisement Be Gone Add-On)
99
+ 4. Example Quiz
100
+ 5. Example Survey
101
+ 6. Quiz Results Page
102
+ 7. Example Contact Form
103
+ 8. Example Quiz With Styling
104
+
105
+ == Changelog ==
106
+
107
+ = 3.3.3 (November 14, 2014) =
108
+ * Minor Backend Change To Quiz Validation
109
+ * Disabled Enter Key On Quiz
110
+ * Minor Bug Fixes
111
+
112
+ = 3.3.2 (October 26, 2014) =
113
+ * Minor Design Change To Quiz Options
114
+
115
+ = 3.3.1 (October 15, 2014) =
116
+ * Added Horizontal Multiple Response Question Type
117
+ * Added Ability To Duplicate Questions When Duplicate Quizzes
118
+ * Added Last Modified Column To Table On Quizzes Page
119
+ * Fixed Number Question Type Grading Bug
120
+ * Fixed Missing theme_selected Column Installation Bug
121
+ * Fixed Missing theme_selected Column Duplication Bug
122
+ * Fixed Numerous Small Bugs
123
+
124
+ = 3.2.2 (October 4, 2014) =
125
+ * Minor Bug Fixes
126
+
127
+ = 3.2.1 (October 2, 2014) =
128
+ * Added New Captcha Question Type
129
+ * Fixed Number Question Type Validation Bug
130
+ * Fixed Validation Wrong Border Bug
131
+
132
+ = 3.1.1 (September 15, 2014) =
133
+ * Added Ability To Duplicate Individual Questions
134
+ * Added Ability To Require Accept, Number, And Open Answer Question Types
135
+ * Added Number Question Type
136
+ * Added Accept Non-Question Type
137
+
138
+ = 3.0.1 (August 28, 2014) =
139
+ * Added New Style Manager
140
+ * Added Ability For Non-Question Question Types
141
+ * Added New Text Block Question Type
142
+ * Added Question Type Column To Question List
143
+ * Minor Design Changes To Quiz Questions Tab
144
+ * Fixed Results Delete Link Not Working Bug
145
+ * Fixed Quiz Name Showing Escaped Values Bug
146
+
147
+ = 2.9.1 (August 11, 2014) =
148
+ * Added Facebook Sharing
149
+ * Added Ability To Edit Email Subject
150
+ * Added Large Open Answer Question Type
151
+ * Added Ability For Points To Have Decimal Values
152
+ * Fixed Not All Questions Showing In Results Bug
153
+ * Fixed Not Valid Email On Non-Required Email Bug
154
+ * Fixed Special Character Not Grading Properly In Open Answer Bug
155
+
156
+ = 2.8.5 (August 9, 2014) =
157
+ * Minor Bug Fixes
158
+ * Minor Design Tweaks To About Page
159
+
160
+ = 2.8.4 (August 3, 2014) =
161
+ * Minor Bug Fixes
162
+
163
+ = 2.8.3 (June 8, 2014) =
164
+ * Next/Previous Buttons Now Scroll Page To Top Of Quiz
165
+ * Minor Bug Fixes
166
+
167
+ = 2.8.2 (May 28, 2014) =
168
+ * Minor Bug Fixes
169
+
170
+ = 2.8.1 (May 26, 2014) =
171
+ * Took Out Help Related Tool Tips
172
+ * Design Changes To Quiz Text Tab For Easier Navigation
173
+ * Deleted How-To Page, Please Use Documentation On Our Website
174
+ * Renamed Quiz Options Page As Quiz Settings To Avoid Confusion With Quiz Options Tab
175
+
176
+ = 2.7.3 (May 19, 2014) =
177
+ * Fixed Open Answer Not Showing Correct Answer Bug
178
+
179
+ = 2.7.2 (May 18, 2014) =
180
+ * Fixed Timer Not Restarting Bug
181
+ * Fixed Tooltip Affecting Whole Page Bug
182
+
183
+ = 2.7.1 (May 16, 2014) =
184
+ * Added Ability To Set Number Of Question Per Page
185
+ * Fixed HTML Not Showing On Results Page Bug
186
+ * Fixed Timer Not Disabling New Fields Bug
187
+ * Fixed Timer Submitting Disabled Fields Bug
188
+
189
+ = 2.6.4 (May 12, 2014) =
190
+ * Bug Fixes
191
+
192
+ = 2.6.3 (May 9, 2014) =
193
+ * Bug Fixes
194
+
195
+ = 2.6.2 (May 8, 2014) =
196
+ * Bug Fixes
197
+
198
+ = 2.6.1 (May 7, 2014) =
199
+ * Added UTF-8 Support For Special Characters And Non-Latin Languages
200
+ * Fixed Question Bank Showing All Answers Bug
201
+
202
+ = 2.5.1 (May 3, 2014) =
203
+ * Rebuilt Answer System
204
+ * Added Ability To Have Unlimited Answers
205
+ * Added Ability To Randomize Answers
206
+ * Added New Question Type - Multiple Response (Checkboxes)
207
+ * Added Ability To Send Admin Email To Multiple Users
208
+ * Minor Design Changes To Quiz Options Page
209
+
210
+ = 2.4.1 (April 20, 2014) =
211
+ * Added New Quiz Emails Tab
212
+ * Added Ability To Send Different Emails To Users Based On Score
213
+ * Fixed Required Question Bug
214
+ * Fixed Landing Page Bug
215
+
216
+ = 2.3.1 (April 6, 2014) =
217
+ * Added Ability To Have Graded Open Answer Questions
218
+ * Minor Design Changes
219
+
220
+ = 2.2.2 (March 30, 2014) =
221
+ * Reverted To Previous Pagination Javascript
222
+
223
+ = 2.2.1 (March 30, 2014) =
224
+ * Added Ability To Show Question Numbers
225
+ * Added More CSS Classes To Quiz Page For Better Styling Options
226
+ * Changed Timer To Disable Fields Instead Of Submit Form When Time Is Up
227
+ * Fixed Pagination Javascript Bug
228
+ * Minor Design Change To Quiz
229
+ * Minor Design Change To Quiz Options Page
230
+
231
+ = 2.1.1 (March 26, 2014) =
232
+ * Added Ability To Edit Style For Each Quiz
233
+ * Fixed Tried Quiz Too Many Times Text Bug
234
+ * Fixed Dashboard Quartely Widget Bug
235
+ * Minor Design Changes To Quiz Options Page
236
+
237
+ = 2.0.1 (March 22, 2014) =
238
+ * Added Pagination On Quiz Results Page
239
+ * Redesigned Results Detail Page
240
+ * Fixed PHP Notice On Quizzes Page
241
+ * Allow HTML/CSS in Landing Pages
242
+
243
+ = 1.9.6 (March 19, 2014) =
244
+ * Fixed Duplicate Quiz Bug
245
+ * Fixed Uneditable Question Bug
246
+ * Fixed Parse Bug
247
+ * Made Email Now Send As HTML
248
+
249
+ = 1.9.5 (March 18, 2014) =
250
+ * Fixed Bug
251
+
252
+ = 1.9.4 (March 18, 2014) =
253
+ * Fixed Bug
254
+
255
+ = 1.9.3 (March 17, 2014) =
256
+ * Fixed Bug: Unexpected T_CONSTANT_ENCAPSED_STRING When Activating
257
+
258
+ = 1.9.2 (March 17, 2014) =
259
+ * Added Ability To Delete Landing Pages
260
+ * Added Ability To Have HTML In Correct Answer Info Field
261
+ * Added Previous Question Button To Paginated Quiz
262
+ * Minor Design Changes To Quiz
263
+ * Add Timer To Title Bar
264
+ * Added %CURRENT_DATE% field
265
+
266
+ = 1.9.1 (March 13, 2014) =
267
+ * Added Ability To Show One Question At A Time Instead Of All At Once
268
+ * Added Ability To Allow Users To Share Results On Twitter
269
+ * Added Ability To Set Time Limits On Quiz
270
+ * Minor Design Changes To Quiz
271
+ * Minor Bug Fixes
272
+
273
+ = 1.8.2 (March 11, 2014) =
274
+ * Minor Bug Fixes
275
+
276
+ = 1.8.1 (March 10, 2014) =
277
+ * Added Customizable Text Section At End Of Quiz
278
+ * Added Ability To Set Up Different Landing Pages Based On Score
279
+ * Added Ability To Give Certificate After Quiz
280
+ * Enhanced Quiz Total Stats Widget
281
+ * Minor Design Changes To Quiz
282
+ * Fixed Session_Start Bug
283
+ * Fixed Division By Zero Bug
284
+ * Fixed Total Stats Deleted Bug
285
+ * Fixed Dashboard Rounding Bug
286
+ * Fixed Notice Unknown Company Field Bug
287
+
288
+
289
+ = 1.7.1 (March 6, 2014) =
290
+ * Added Several New Widgets To Quiz Dashboard
291
+ * Added A Timer Mechanism To Track How Long User Takes On Quiz
292
+ * Added New About Update Page
293
+ * Fixed Saving Results Bug
294
+ * Fixed Random Number On Quiz Options Page Bug
295
+
296
+ = 1.6.3 (March 5, 2014) =
297
+ * Fixed Duplicated Shortcode Bug
298
+ * Quiz Dashboard Design Changes
299
+
300
+ = 1.6.2 (March 4, 2014) =
301
+ * Minor Bug Fixes
302
+ * Minor Design Changes
303
+
304
+ = 1.6.1 (March 2, 2014) =
305
+ * Added Ability To Limit Amount User Tries Certain Quizzes
306
+ * Fixed Internet Explorer Quiz Adding Bug
307
+ * Fixed Results Link On Quizzes Page Bug
308
+ * Fixed Points Number Check Bug
309
+ * Fixed Limited Question Grading Bug
310
+ * Minor Design Changes To Admin Pages
311
+
312
+ = 1.5.1 (February 26, 2014) =
313
+ * Added Ability To Load Only Set Amount Of Questions From Total Questions
314
+ * Fixed PHP Notices On Quizzes Page
315
+ * Fixed PHP Notices On Quiz Options Page
316
+ * Fixed PHP Notices On Quiz Results Page
317
+ * Fixed PHP Notices On Quiz
318
+ * Fixed Hidden Pop-Up Bug
319
+
320
+ = 1.4.2 (February 22, 2014) =
321
+ * Fixed Capability Bug
322
+ * Minor Design Changes To Question Form
323
+ * Hint Bubble Is Now Wider For Longer Hints
324
+ * Minor Design Change To Quiz
325
+
326
+ = 1.4.1 (February 20, 2014) =
327
+ * Enhanced Plugins Compatibility With Other Plugins
328
+ * Hints Are Now Hidden By Default
329
+ * Minor Bug Fixes
330
+
331
+ = 1.3.1 (February 18, 2014) =
332
+ * Added Ability To Choose Whether Logged-in Users Can Enter Contact Info
333
+ * Fixed Editing Hint Field Error
334
+ * Added Ability To Have Media In Answers
335
+ * Added Ability To Have HTML In Questions And Answers
336
+
337
+ = 1.2.1 (February 11, 2014) =
338
+ * Fixed Quiz Results Details Bug
339
+ * Continued Working On New Error Code System
340
+ * Added Pagination To Tools Page, Quizzes Page And List Of Questions On Quiz Options Page
341
+ * Added Ability To Create A Duplicate Of A Quiz
342
+
343
+ = 1.1.1 (February 6, 2014) =
344
+ * Added %AVERAGE_POINT% Variable That Calculates Average Points Per Question
345
+ * Added Field For Reason Why Answer Is Correct
346
+ * Added %CORRECT_ANSWER_INFO% To Display Why Answer Is Correct
347
+ * Begun Creating New Error Code System
348
+ * Fixed Edit Quiz Name Bug
349
+ * Fixed New Quiz Bug
350
+
351
+ = 1.0.1 (February 4, 2014) =
352
+ * Fixed Saving Results Bug
353
+ * Fixed Leaderboard Bug
354
+
355
+ = 1.0 (February 1, 2014) =
356
+ * Added Ability To Customize From Name For User And Admin Emails
357
+ * Changed Question Editor
358
+ * Minor Change To Help System
359
+
360
+ = 0.9.9 (January 30, 2014) =
361
+ * Begun Creating New Advanced Help System
362
+ * Added New Question Editor
363
+ * Added Ability To Have Media In Questions
364
+ * Minor Design Changes To Quiz Options
365
+
366
+ = 0.9.8 (January 25, 2014) =
367
+ * Added Leaderboard Widget
368
+ * Added Ability To Reset Quiz Stats On Each Quiz
369
+ * Added Ability To Delete Results
370
+ * Minor Design Changes
371
+ * Minor Bug Fixes
372
+
373
+ = 0.9.7 (January 24, 2014) =
374
+ * Started Setting Plugin Up For Translations
375
+ * Relocated Widgets From Help Page To Quiz Dashboard Page
376
+ * Updated Several Of The Help Sections Through Plugin
377
+ * Minor Bug Fixes
378
+
379
+ = 0.9.6 (January 21, 2014) =
380
+ * Added Ability To Edit Question Order When Adding Questions
381
+ * Added Ability To Choose Whether Contact Info Is Asked For At Beginning Or End Of Quiz
382
+ * Defaulted Question Comment Field To None On New Questions
383
+ * Fixed Double Quote Bug
384
+ * Enhanced Monthly Stat Widget
385
+ * Minor Design Change To Quiz Total Stats Widget
386
+ * Minor Design Changes To Quiz Options Page
387
+
388
+ = 0.9.5 (January 19, 2014) =
389
+ * Added Ability To Edit %QUESTIONS_ANSWERS% Template
390
+ * Changed Name Of Support Page To Help Page
391
+ * Minor Design Changes On Quiz Options Page
392
+
393
+ = 0.9.4 (January 16, 2014) =
394
+ * Added Ability To Randomly Order Questions
395
+ * Updated Monthly Stat Widget
396
+
397
+ = 0.9.3 (January 14, 2014) =
398
+ * Logged-In Users Now See Contact Information
399
+ * Minor Bug Fixes
400
+
401
+ = 0.9.2 (January 12, 2014) =
402
+ * Updated Weekly Stat Widget
403
+ * Begun Work On Monthly Stat Widget
404
+ * Added Ability To Edit Leaderboard Template
405
+ * Bug Fixes
406
+
407
+ = 0.9.1 (January 8, 2014) =
408
+ * Fixed Leaderboard Design Bug
409
+ * Fixed Contact Information Design Bug
410
+ * Added Ability To Not Need Contact Info For Logged In Users
411
+
412
+ = 0.9 (January 5, 2014) =
413
+ * Added Ability To Edit Quiz Name
414
+ * Added Ability To Display Question As Drop Down
415
+ * Added Quiz Name To Completion Email's Subject
416
+ * Minor Design Changes To Quiz Options Page
417
+ * Design Changes To Quiz
418
+
419
+ = 0.8.6 (January 2, 2014) =
420
+ * Bug Fixes
421
+
422
+ = 0.8.5 (January 1, 2014) =
423
+ * New Screenshots Added
424
+ * Minor Design Changes
425
+ * Bug Fixes
426
+
427
+ = 0.8.4 (December 22, 2013) =
428
+ * New Option To Change Size Of Comment Field
429
+ * Enhanced Weekly Stat Chart
430
+ * Bug Fixes
431
+
432
+ = 0.8.3 (December 14, 2013) =
433
+ * Fixed Leaderboard Bug
434
+ * Started Work On Weekly Stat Widget
435
+ * Tweaked Some Design Throughout Admin Side
436
+ * Minor Bug Fixes
437
+
438
+ = 0.8.2 (December 10, 2013) =
439
+ * Fixed Disappearing Question Bug Completely
440
+ * Updated Update Process
441
+
442
+ = 0.8.1 (December 9, 2013) =
443
+ * Fixed Disappearing Question Bug
444
+
445
+ = 0.8 (December 1, 2013) =
446
+ * Added Spam Prevention Techniques To Backend
447
+ * Added Ability To Reorder Questions
448
+ * Added New Section On How-To Page
449
+ * Bug Fixes
450
+
451
+ = 0.7.2 (November 24, 2013) =
452
+ * Bug Fixes
453
+ * Added New Section On How-To Page
454
+
455
+ = 0.7.1 (November 19, 2013) =
456
+ * Changed Design For How-To Page
457
+ * Added New Section In How-To Page
458
+ * Added New Widget On Plugin Dashboard For Daily Stats
459
+
460
+ = 0.7 (November 15, 2013) =
461
+ * Bug Fixes
462
+ * Begun Work On New How-To Page
463
+ * Continued Redesigning Plugin Dashboard
464
+
465
+ = 0.6.2 (November 10, 2013) =
466
+ * Bug Fixes
467
+ * Added More Stats
468
+ * Started Redesigning Plugin Dashboard
469
+
470
+ = 0.6.1 (November 2, 2013) =
471
+ * Bug Fixes
472
+
473
+ = 0.6 (October 19, 2013) =
474
+ * Started Developing Quiz Leaderboards
475
+ * Added Ability To Save User Answers And Comments
476
+ * Added More Statistics To Quiz Dashboard
477
+ * Bug Fixes
478
+
479
+ = 0.5.3 (October 11, 2013) =
480
+ * Bug Fixes
481
+ * Started Redesigning Quiz Look
482
+
483
+ = 0.5.2 (September 29, 2013) =
484
+ * Bug Fixes
485
+
486
+ = 0.5.1 (September 22, 2013) =
487
+ * Added More Statistics To Quiz Dashboard
488
+ * Bug Fixes
489
+
490
+ = 0.5 (September 18, 2013) =
491
+ * Created New Tools Page And Moved Audit Trail To It
492
+ * Added Ability For Comment Section At End Of Quiz
493
+ * Added Ability To Have Hints
494
+ * Added Option To Have Comment Boxes On Questions
495
+ * Added More Statistics To Main Page
496
+
497
+ = 0.4.1 (September 15, 2013) =
498
+ * Bug Fixes
499
+
500
+ = 0.4 (September 13, 2013) =
501
+ * Add The Ability To Require Contact Information
502
+ * Add Email Validating To Email Field
503
+
504
+ = 0.3.1 (September 13, 2013) =
505
+ * Bug Fixes
506
+
507
+ = 0.3 (September 12, 2013) =
508
+ * Increased Scoring Systems To Three: Correct, Points, Or Not Graded
509
+ * Error Fixes
510
+
511
+ = 0.2 (September 9, 2013) =
512
+ * Added New Quiz Dashboard Page
513
+ * Created Audit Trail
514
+ * Added Ability to Add Questions/Answers to Templates
515
+ * Minor Spelling/Grammer Fixes
516
+
517
+ = 0.1 (September 1, 2013) =
518
+ * Begun Development
519
+ * Added ability to create/edit/delete quizzes
520
+ * Added ability to create/edit/delete questions
521
+ * Added quiz admin page
522
+ * Added questions admin page
523
+ * Added results page
524
+
525
+ == Upgrade Notice ==
526
+
527
+ = 3.3.3 =
528
+ Upgrade for minor bug fixes.
529
+
530
+ = 3.3.1 =
531
+ Upgrade for new Horizontal Multiple Response question type and to be able to duplicate questions when duplicating quizzes. Also, fixes several major and minor bugs.
532
+
533
+ = 3.2.1 =
534
+ Upgrade for new Captcha question types!
535
+
536
+ = 3.1.1 =
537
+ Upgrade for new Accept and Number question types. Also, now you have the ability to duplicate individual questions!
538
+
539
+ = 3.0.1 =
540
+ Upgrade for new style manager, new non-question types, text block question type, and various design/bug fixes!
541
+
542
+ = 2.9.1 =
543
+ Upgrade for facebook sharing, a new question type, the ability to edit the email's subject, and much more!
544
+
545
+ = 2.8.5 =
546
+ Upgrade for minor bug fixes.
547
+
548
+ = 2.8.3 =
549
+ Upgrade for minor bug fixes.
550
+
551
+ = 2.8.2 =
552
+ Upgrade for minor bug fixes.
553
+
554
+ = 2.7.3 =
555
+ Upgrade for bug fixes.
556
+
557
+ = 2.7.2 =
558
+ Upgrade for bug fixes.
559
+
560
+ = 2.7.1 =
561
+ Upgrade to have the ability to set number of questions per page and more bug fixes.
562
+
563
+ = 2.6.4 =
564
+ Upgrade for bug fixes.
565
+
566
+ = 2.6.3 =
567
+ Upgrade for bug fixes.
568
+
569
+ = 2.6.2 =
570
+ Upgrade for bug fixes.
571
+
572
+ = 2.6.1 =
573
+ Upgrade to be able to support special characters and non-latin based languages.
574
+
575
+ = 2.5.1 =
576
+ Upgrade for many new features including unlimited answers, random answers, new question type, and more!
577
+
578
+ = 2.4.1 =
579
+ Upgrade to be able to send different emails based on user's score. Also, minor bug fixes included.
580
+
581
+ = 2.1.1 =
582
+ Upgrade to have the ability to edit the css styles for each quiz! Plus minor bugs fixes.
583
+
584
+ = 2.0.1 =
585
+ Upgrade to fix minor bugs and enable pagination on results page.
586
+
587
+ = 1.9.2 =
588
+ Upgrade to have the ability to delete landing pages, allow users to go back when paginating questions, and have HTML in the correct answer info field!
589
+
590
+ = 1.9.1 =
591
+ Upgrade to 1.9.1 to get the ability for pagination on the quiz and to allow your users to share their results on Twitter.
592
+
593
+ = 1.8.1 =
594
+ Upgrade to 1.8.1 to get the ability to have different landing pages based on the user's score, give users certificates, and an additional customizable text section at the end of quiz. Plus minor design changes to quiz and Quiz Dashboard and lots of bug fixes.
595
+
596
+ = 1.7.1 =
597
+ This update adds new widgets to Quiz Dashboard, adds a timer mechanism, and fixes several minor bugs.
598
+
599
+ = 1.6.3 =
600
+ This update fixes minor bugs and adds minor design changes.
601
+
602
+ = 1.6.2 =
603
+ This update fixes minor bugs and adds minor design changes.
604
+
605
+ = 1.6.1 =
606
+ This update allows you to set the amount of tries a user has for cetain quizzes. Also fixes several bugs.
607
+
608
+ = 1.5.1 =
609
+ This update allows you to have the quiz only load a set number of questions from your total question bank. Also fixes several minor bugs.
610
+
611
+ = 1.4.2 =
612
+ This update brings many minor design changes and minor bug fixes.
613
+
614
+ = 1.4.1 =
615
+ This update helps plugin work better with other plugins. The hints for the quiz are now hidden by default.
616
+
617
+ = 1.2.1 =
618
+ This update adds pagination to the quizzes, audit trail, and question tables to make using the admin side easier. It also adds the ability to duplicate a quiz. Fixes various minor bugs.
619
+
620
+ = 1.1.1 =
621
+ This update adds the ability to show the user the reason why an answer is correct. Also, added new variable for templates that calculates average points per question. Minor bug fixes.
622
+
623
+ = 1.0.1 =
624
+ This update fixes minor bugs.
625
+
626
+ = 1.0 =
627
+ This update finally brings this plugin out of beta! This update brings the ability to edit the From Name part of the email sent to users and admin. Minor bug fixes.
628
+
629
+ = 0.9.9 =
630
+ Upgrade to be able to include media in your questions! Also, fixed minor bugs and made minor design changes.
631
+
632
+ = 0.9.8 =
633
+ Upgrade to use new leaderboard widet! Also, added ability to reset stats for quizzes from Quiz Options page. Added ability to delete results as well. Minor design changes and bug fixes.
634
+
635
+ = 0.9.7 =
636
+ Upgrade to see widgets relocated from help page to quiz dashboard page. Also, began setting plugin up for translations. Updated many help sections throughout plugin. Minor bug fixes.
637
+
638
+ = 0.9.6 =
639
+ Upgrade to be able to choose whether contact information is asked for at beginning or end of the quiz. Also, added ability to edit question order when adding new questions. Several minor design changes on admin side. Fixed double quote bug.
640
+
641
+ = 0.9.5 =
642
+ Upgrade to be able to edit the %QUESTIONS_ANSWERS% template. Also, minor design changes on Quiz Options page.
643
+
644
+ = 0.9.4 =
645
+ Upgrade to set up your quizzes to randomize the questions
646
+
647
+ = 0.9.3 =
648
+ Upgrade for minor bug fixes.
649
+
650
+ = 0.9.2 =
651
+ Upgrade for several enhanced stat widgets and the ability to edit leaderboard templates!
652
+
653
+ = 0.9.1 =
654
+ Upgrade for several bug fixes and new ability to have logged in users not have to enter contact information
655
+
656
+ = 0.9 =
657
+ Upgrade for several new features and bug fixes
658
+
659
+ = 0.8.6 =
660
+ Upgrade to fix minor bugs
661
+
662
+ = 0.8.5 =
663
+ Upgrade to fix minor bugs
664
+
665
+ = 0.8.4 =
666
+ Upgrade to enjoy small tweaks throughout admin side
667
+
668
+ = 0.8.3 =
669
+ Upgrade to enjoy small tweaks throughout admin side
670
+
671
+ = 0.8.2 =
672
+ Upgrade to fix bug that made questions vanish.
673
+
674
+ = 0.8.1 =
675
+ Upgrade to fix bug that made questions vanish.
676
+
677
+ = 0.8 =
678
+ Upgrade to enjoy several new features and minor bug fixes.
679
+
680
+ = 0.7.2 =
681
+ Upgrade to fix minor bugs and view new section on how-to page.
682
+
683
+ = 0.7.1 =
684
+ Upgrade to fix minor bugs, view new section how-to page, and new stats on main page.
685
+
686
+ = 0.7 =
687
+ Upgrade to fix minor bugs, view new how-to page, and new stats on main page.
688
+
689
+ = 0.6.2 =
690
+ Upgrade to fix some minor bug fixes.
691
+
692
+ = 0.6 =
693
+ Upgrade to enjoy several new features including saved results and leaderboards!
694
+
695
+ = 0.5.3 =
696
+ Upgrade to fix some minor bug fixes.
697
+
698
+ = 0.5.2 =
699
+ Upgrade to fix some minor bug fixes.
700
+
701
+ = 0.5.1 =
702
+ Upgrade to fix some minor bug fixes.
703
+
704
+ = 0.5 =
705
+ Upgrade to enjoy several new features including surveys!
706
+
707
+ = 0.4 =
708
+ Upgrade to enjoy being able to require contact information.
709
+
710
+ = 0.3 =
711
+ Upgrade to enjoy the new Not Graded scoring system and some error fixes!
712
+
713
+ = 0.2 =
714
+ Upgrade to enjoy three new features and some minor fixes!
715
+
716
+ = 0.1 =
717
  Initial Version