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

Version Description

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.

Download this release

Release Info

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

Code changes from version 1.8.2 to 1.9.1

includes/mlw_qmn_credits.php CHANGED
@@ -57,23 +57,19 @@ function mlw_generate_about_page()
57
  <hr />
58
  <h3>What's New In <?php echo $mlw_quiz_version; ?></h3>
59
  <ul>
60
- <li>Added Ability To Set Up Different Landing Pages Based On Score</li>
61
- <li>Added Ability To Give Certificate After Quiz</li>
62
- <li>Added Customizable Text Section At End Of Quiz</li>
63
- <li>Enhanced Quiz Total Stats Widget</li>
64
  <li>Minor Design Changes To Quiz</li>
65
- <li>Fixed Session_Start Bug</li>
66
- <li>Fixed Division By Zero Bug</li>
67
- <li>Fixed Total Stats Deleted Bug</li>
68
- <li>Fixed Dashboard Rounding Bug</li>
69
- <li>Fixed Notice Of Unknown Company Field Bug</li>
70
  </ul>
71
  <h3>What's Coming Soon</h3>
72
  <ul>
73
- <li>Time Limits</li>
74
- <li>Quiz Pagination</li>
75
  <li>Importing Questions</li>
76
  <li>Stats For Each Quiz</li>
 
 
 
77
  </ul>
78
 
79
  <div id="dialog" title="Help">
57
  <hr />
58
  <h3>What's New In <?php echo $mlw_quiz_version; ?></h3>
59
  <ul>
60
+ <li>Added Ability To Show One Question At A Time Instead Of All At Once</li>
61
+ <li>Added Ability To Allow Users To Share Results On Twitter</li>
62
+ <li>Added Ability To Set Time Limits On Quiz</li>
 
63
  <li>Minor Design Changes To Quiz</li>
64
+ <li>Minor Bug Fixes</li>
 
 
 
 
65
  </ul>
66
  <h3>What's Coming Soon</h3>
67
  <ul>
 
 
68
  <li>Importing Questions</li>
69
  <li>Stats For Each Quiz</li>
70
+ <li>Multiple Right Answers</li>
71
+ <li>Graded Text Answers</li>
72
+ <li>Quiz Styling</li>
73
  </ul>
74
 
75
  <div id="dialog" title="Help">
includes/mlw_quiz.php CHANGED
@@ -19,6 +19,8 @@ function mlw_quiz_shortcode($atts)
19
  $mlw_display = "";
20
  global $wpdb;
21
  $mlw_qmn_isAllowed = true;
 
 
22
 
23
 
24
  //Load quiz
@@ -70,6 +72,8 @@ function mlw_quiz_shortcode($atts)
70
 
71
  wp_enqueue_script( 'jquery' );
72
  wp_enqueue_script( 'jquery-ui-core' );
 
 
73
  wp_enqueue_script( 'jquery-ui-dialog' );
74
  wp_enqueue_script( 'jquery-ui-button' );
75
  wp_enqueue_script( 'jquery-ui-accordion' );
@@ -98,7 +102,7 @@ function mlw_quiz_shortcode($atts)
98
  max-width: 500px !important;
99
  }
100
  </style>
101
- <?php
102
 
103
  /*
104
  The following code is for displaying the quiz and completion screen
@@ -114,6 +118,110 @@ function mlw_quiz_shortcode($atts)
114
  //Display Quiz
115
  if (!isset($_POST["complete_quiz"]) && $mlw_quiz_options->quiz_name != "" && $mlw_qmn_isAllowed)
116
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  ?>
118
  <script type="text/javascript">
119
  var myVar=setInterval("mlwQmnTimer();",1000);
@@ -123,17 +231,23 @@ function mlw_quiz_shortcode($atts)
123
  x = x + 1;
124
  document.getElementById("timer").value = x;
125
  }
 
126
  </script>
127
  <style type="text/css">
128
- form.mlw_quiz_form input[type=radio],
129
- form.mlw_quiz_form input[type=submit] {
 
130
  cursor: pointer;
131
  }
132
- form.mlw_quiz_form input:not([type=submit]):focus,
133
- form.mlw_quiz_form textarea:focus {
134
  background: #eaeaea;
135
  }
136
- </style>
 
 
 
 
137
  <?
138
  //Update the quiz views
139
  $mlw_views = $mlw_quiz_options->quiz_views;
@@ -212,27 +326,31 @@ function mlw_quiz_shortcode($atts)
212
  }
213
  </script>";
214
 
215
-
216
  //Begin the quiz
 
 
 
217
  $mlw_message_before = $mlw_quiz_options->message_before;
218
  $mlw_message_before = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_before);
219
  $mlw_display .= "<span>".$mlw_message_before."</span><br />";
220
  $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
221
- $mlw_display .= "<form name='quizForm' action='' method='post' class='mlw_quiz_form' onsubmit='return mlw_validateForm()' >";
222
 
223
  if ($mlw_quiz_options->contact_info_location == 0)
224
  {
225
  $mlw_display .= mlwDisplayContactInfo($mlw_quiz_options);
226
  }
 
227
 
228
  //Display the questions
229
  foreach($mlw_questions as $mlw_question) {
 
 
230
  $mlw_display .= "<span style='font-weight:bold;'>".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
231
  if ($mlw_question->question_type == 0)
232
  {
233
  if ($mlw_question->answer_one != "")
234
  {
235
- $mlw_display .= "<input type='radio' required 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>";
236
  $mlw_display .= "<br />";
237
  }
238
  if ($mlw_question->answer_two != "")
@@ -265,7 +383,7 @@ function mlw_quiz_shortcode($atts)
265
  {
266
  if ($mlw_question->answer_one != "")
267
  {
268
- $mlw_display .= "<input type='radio' required name='question".$mlw_question->question_id."' value='1' />".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES);
269
  }
270
  if ($mlw_question->answer_two != "")
271
  {
@@ -334,18 +452,24 @@ function mlw_quiz_shortcode($atts)
334
  $mlw_display .= "<span title=\"".htmlspecialchars_decode($mlw_question->hints, ENT_QUOTES)."\" style=\"text-decoration:underline;color:rgb(0,0,255);\">Hint</span>";
335
  $mlw_display .= "<br /><br />";
336
  }
337
- $mlw_display .= "<br />";
 
338
  }
339
 
340
  //Display comment box if needed
341
  if ($mlw_quiz_options->comment_section == 0)
342
  {
 
 
343
  $mlw_message_comments = $mlw_quiz_options->message_comment;
344
  $mlw_message_comments = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_comments);
345
  $mlw_display .= "<label for='mlwQuizComments' style='font-weight:bold;'>".$mlw_message_comments."</label>";
346
  $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
347
- $mlw_display .= "<br /><br />";
 
348
  }
 
 
349
  if ($mlw_quiz_options->message_end_template != '')
350
  {
351
  $mlw_message_end = $mlw_quiz_options->message_end_template;
@@ -364,6 +488,8 @@ function mlw_quiz_shortcode($atts)
364
  $mlw_display .= "<input type='submit' value='".$mlw_quiz_options->submit_button_text."' />";
365
  $mlw_display .= "<span name='mlw_error_message_bottom' id='mlw_error_message_bottom' style='color: red;'></span><br />";
366
  $mlw_display .= "</form>";
 
 
367
 
368
  }
369
  //Display Completion Screen
@@ -642,6 +768,21 @@ function mlw_quiz_shortcode($atts)
642
  $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
643
  $mlw_display .= $mlw_message_after;
644
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
645
 
646
  //Prepare and send the user email
647
  $mlw_message = "";
19
  $mlw_display = "";
20
  global $wpdb;
21
  $mlw_qmn_isAllowed = true;
22
+ $mlw_qmn_section_count = 1;
23
+ $mlw_qmn_section_limit = 0;
24
 
25
 
26
  //Load quiz
72
 
73
  wp_enqueue_script( 'jquery' );
74
  wp_enqueue_script( 'jquery-ui-core' );
75
+ wp_enqueue_script( 'jquery-effects-core' );
76
+ wp_enqueue_script( 'jquery-effects-slide' );
77
  wp_enqueue_script( 'jquery-ui-dialog' );
78
  wp_enqueue_script( 'jquery-ui-button' );
79
  wp_enqueue_script( 'jquery-ui-accordion' );
102
  max-width: 500px !important;
103
  }
104
  </style>
105
+ <?php
106
 
107
  /*
108
  The following code is for displaying the quiz and completion screen
118
  //Display Quiz
119
  if (!isset($_POST["complete_quiz"]) && $mlw_quiz_options->quiz_name != "" && $mlw_qmn_isAllowed)
120
  {
121
+ //Calculate number of pages if pagination is turned on
122
+ if ($mlw_quiz_options->pagination != 0)
123
+ {
124
+ $mlw_qmn_section_limit = 2 + $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted=0", $mlw_quiz_id ) );
125
+ if ($mlw_quiz_options->comment_section == 0)
126
+ {
127
+ $mlw_qmn_section_limit = $mlw_qmn_section_limit + 1;
128
+ }
129
+ ?>
130
+ <script type="text/javascript">
131
+ var $j = jQuery.noConflict();
132
+ $j(function() {
133
+ $j( ".quiz_section" ).hide();
134
+ $j( ".quiz_section" ).not( ".quiz_end" ).append( "<br /><a class=\"mlw_qmn_quiz_link\" href='#' onclick=\"nextSlide();\"><?php echo $mlw_quiz_options->pagination_text; ?></a>" );
135
+ window.mlw_quiz_slide = 1;
136
+ window.mlw_quiz_total_slides = <?php echo $mlw_qmn_section_limit; ?>;
137
+ nextSlide();
138
+ });
139
+ function nextSlide()
140
+ {
141
+ if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
142
+ {
143
+ $j(".quiz_link").html("Submit");
144
+ }
145
+ if (window.mlw_quiz_slide > window.mlw_quiz_total_slides)
146
+ {
147
+ document.quizForm.submit();
148
+ exit();
149
+ }
150
+ y = window.mlw_quiz_slide-1;
151
+ $j( ".quiz_section.slide"+y ).hide();
152
+ $j( ".quiz_section.slide"+window.mlw_quiz_slide ).show( "slide", {direction: "right"} );
153
+ window.mlw_quiz_slide++;
154
+ }
155
+ </script>
156
+ <style type="text/css">
157
+ a.mlw_qmn_quiz_link
158
+ {
159
+ border-radius: 4px;
160
+ position: relative;
161
+ background-image: linear-gradient(#fff,#dedede);
162
+ background-color: #eee;
163
+ border: #ccc solid 1px;
164
+ color: #333;
165
+ text-shadow: 0 1px 0 rgba(255,255,255,.5);
166
+ box-sizing: border-box;
167
+ display: inline-block;
168
+ padding: 5px 5px 5px 5px;
169
+ margin: auto;
170
+ }
171
+ </style>
172
+ <?php
173
+ }
174
+ if ($mlw_quiz_options->timer_limit != 0)
175
+ {
176
+ ?>
177
+ <div id="mlw_qmn_timer"></div>
178
+ <script type="text/javascript">
179
+ var minutes = <?php echo $mlw_quiz_options->timer_limit; ?>;
180
+ window.amount = (minutes*60);
181
+ document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
182
+ window.counter=setInterval(timer, 1000); //1000 will run it every 1 second
183
+ function timer()
184
+ {
185
+ window.amount=window.amount-1;
186
+ document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
187
+ if (window.amount <= 0)
188
+ {
189
+ clearInterval(window.counter);
190
+ document.quizForm.submit();
191
+ return;
192
+ }
193
+ }
194
+ function minToSec(amount)
195
+ {
196
+ var minutes = Math.floor(amount/60);
197
+ var seconds = amount - (minutes * 60);
198
+ if (seconds == '0')
199
+ {
200
+ seconds = "00";
201
+ }
202
+ else if (seconds < 10)
203
+ {
204
+ seconds = '0' + seconds;
205
+ }
206
+ return minutes+":"+seconds;
207
+ }
208
+ </script>
209
+ <style type="text/css">
210
+ #mlw_qmn_timer {
211
+ position:fixed;
212
+ top:200px;
213
+ right:0px;
214
+ width:130px;
215
+ color:#00CCFF;
216
+ border-radius: 15px;
217
+ background:#000000;
218
+ text-align: center;
219
+ padding: 15px 15px 15px 15px
220
+ }
221
+ </style>
222
+ <?php
223
+ }
224
+
225
  ?>
226
  <script type="text/javascript">
227
  var myVar=setInterval("mlwQmnTimer();",1000);
231
  x = x + 1;
232
  document.getElementById("timer").value = x;
233
  }
234
+
235
  </script>
236
  <style type="text/css">
237
+ div.mlw_qmn_quiz input[type=radio],
238
+ div.mlw_qmn_quiz input[type=submit],
239
+ div.mlw_qmn_quiz label {
240
  cursor: pointer;
241
  }
242
+ div.mlw_qmn_quiz input:not([type=submit]):focus,
243
+ div.mlw_qmn_quiz textarea:focus {
244
  background: #eaeaea;
245
  }
246
+ div.mlw_qmn_quiz_section
247
+ {
248
+
249
+ }
250
+ </style>
251
  <?
252
  //Update the quiz views
253
  $mlw_views = $mlw_quiz_options->quiz_views;
326
  }
327
  </script>";
328
 
 
329
  //Begin the quiz
330
+ $mlw_display .= "<div class='mlw_qmn_quiz'>";
331
+ $mlw_display .= "<form name='quizForm' action='' method='post' class='mlw_quiz_form' onsubmit='return mlw_validateForm()' >";
332
+ $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
333
  $mlw_message_before = $mlw_quiz_options->message_before;
334
  $mlw_message_before = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_before);
335
  $mlw_display .= "<span>".$mlw_message_before."</span><br />";
336
  $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
 
337
 
338
  if ($mlw_quiz_options->contact_info_location == 0)
339
  {
340
  $mlw_display .= mlwDisplayContactInfo($mlw_quiz_options);
341
  }
342
+ $mlw_display .= "</div>";
343
 
344
  //Display the questions
345
  foreach($mlw_questions as $mlw_question) {
346
+ $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
347
+ $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
348
  $mlw_display .= "<span style='font-weight:bold;'>".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
349
  if ($mlw_question->question_type == 0)
350
  {
351
  if ($mlw_question->answer_one != "")
352
  {
353
+ $mlw_display .= "<input type='radio' checked='checked' required 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>";
354
  $mlw_display .= "<br />";
355
  }
356
  if ($mlw_question->answer_two != "")
383
  {
384
  if ($mlw_question->answer_one != "")
385
  {
386
+ $mlw_display .= "<input type='radio' checked='checked' required name='question".$mlw_question->question_id."' value='1' />".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES);
387
  }
388
  if ($mlw_question->answer_two != "")
389
  {
452
  $mlw_display .= "<span title=\"".htmlspecialchars_decode($mlw_question->hints, ENT_QUOTES)."\" style=\"text-decoration:underline;color:rgb(0,0,255);\">Hint</span>";
453
  $mlw_display .= "<br /><br />";
454
  }
455
+ $mlw_display .= "</div>";
456
+ if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br />"; }
457
  }
458
 
459
  //Display comment box if needed
460
  if ($mlw_quiz_options->comment_section == 0)
461
  {
462
+ $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
463
+ $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
464
  $mlw_message_comments = $mlw_quiz_options->message_comment;
465
  $mlw_message_comments = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_comments);
466
  $mlw_display .= "<label for='mlwQuizComments' style='font-weight:bold;'>".$mlw_message_comments."</label>";
467
  $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
468
+ $mlw_display .= "</div>";
469
+ if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br /><br />"; }
470
  }
471
+ $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
472
+ $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count." quiz_end'>";
473
  if ($mlw_quiz_options->message_end_template != '')
474
  {
475
  $mlw_message_end = $mlw_quiz_options->message_end_template;
488
  $mlw_display .= "<input type='submit' value='".$mlw_quiz_options->submit_button_text."' />";
489
  $mlw_display .= "<span name='mlw_error_message_bottom' id='mlw_error_message_bottom' style='color: red;'></span><br />";
490
  $mlw_display .= "</form>";
491
+ $mlw_display .= "</div>";
492
+ $mlw_display .= "</div>";
493
 
494
  }
495
  //Display Completion Screen
768
  $mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
769
  $mlw_display .= $mlw_message_after;
770
  }
771
+
772
+ if ($mlw_quiz_options->social_media == 1)
773
+ {
774
+ $mlw_social_message = str_replace( "%POINT_SCORE%" , $mlw_points, $mlw_quiz_options->social_media_text);
775
+ $mlw_social_message = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $mlw_social_message);
776
+ $mlw_social_message = str_replace( "%AMOUNT_CORRECT%" , $mlw_correct, $mlw_social_message);
777
+ $mlw_social_message = str_replace( "%TOTAL_QUESTIONS%" , $mlw_total_questions, $mlw_social_message);
778
+ $mlw_social_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_social_message);
779
+ $mlw_social_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_social_message);
780
+ $mlw_social_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_social_message);
781
+ $mlw_display .= "<br />
782
+ <a href=\"https://twitter.com/share\" data-size=\"large\" data-text=\"".esc_attr($mlw_social_message)."\" class=\"twitter-share-button\" data-lang=\"en\">Tweet</a>
783
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"https://platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>
784
+ <br />";
785
+ }
786
 
787
  //Prepare and send the user email
788
  $mlw_message = "";
includes/mlw_quiz_admin.php CHANGED
@@ -30,8 +30,8 @@ function mlw_generate_quiz_admin()
30
  5. %FIFTH_PLACE_NAME%-%FIFTH_PLACE_SCORE%<br />";
31
  $mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
32
  $insert = "INSERT INTO " . $table_name .
33
- "(quiz_id, quiz_name, message_before, message_after, message_comment, message_end_template, user_email_template, admin_email_template, submit_button_text, name_field_text, business_field_text, email_field_text, phone_field_text, comment_field_text, email_from_text, question_answer_template, leaderboard_template, system, randomness_order, loggedin_user_contact, show_score, send_user_email, send_admin_email, contact_info_location, user_name, user_comp, user_email, user_phone, admin_email, comment_section, question_from_total, total_user_tries, total_user_tries_text, certificate_template, quiz_views, quiz_taken, deleted) " .
34
- "VALUES (NULL , '" . $quiz_name . "' , 'Enter your text here', 'Enter your text here', 'Enter your text here', '', 'Enter your text here', 'Enter your text here', 'Submit Quiz', 'Name', 'Business', 'Email', 'Phone Number', 'Comments', 'Wordpress', '".$mlw_question_answer_default."', '".$mlw_leaderboard_default."', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '".get_option( 'admin_email', 'Enter email' )."', 0, 0, 0, 'Enter Your Text Here', 'Enter Your Text Here!', 0, 0, 0)";
35
  $results = $wpdb->query( $insert );
36
  if ($results != false)
37
  {
@@ -120,7 +120,7 @@ function mlw_generate_quiz_admin()
120
  $mlw_duplicate_quiz_id = $_POST["duplicate_quiz_id"];
121
  $mlw_duplicate_quiz_name = $_POST["duplicate_new_quiz_name"];
122
  $mlw_qmn_duplicate_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "mlw_quizzes WHERE quiz_id=%d", $mlw_duplicate_quiz_id ) );
123
- $results = $wpdb->query( "INSERT INTO ".$table_name." (quiz_id, quiz_name, message_before, message_after, message_comment, message_end_template, user_email_template, admin_email_template, submit_button_text, name_field_text, business_field_text, email_field_text, phone_field_text, comment_field_text, email_from_text, question_answer_template, leaderboard_template, system, randomness_order, loggedin_user_contact, show_score, send_user_email, send_admin_email, contact_info_location, user_name, user_comp, user_email, user_phone, admin_email, comment_section, question_from_total, total_user_tries, total_user_tries_text, certificate_template, quiz_views, quiz_taken, deleted) VALUES (NULL , '".$mlw_duplicate_quiz_name."' , '".$mlw_qmn_duplicate_data->message_before."', '".$mlw_qmn_duplicate_data->message_after."', '".$mlw_qmn_duplicate_data->message_comment."', '".$mlw_qmn_duplicate_data->message_end_template."', '".$mlw_qmn_duplicate_data->user_email_template."', '".$mlw_qmn_duplicate_data->admin_email_template."', '".$mlw_qmn_duplicate_data->submit_button_text."', '".$mlw_qmn_duplicate_data->name_field_text."', '".$mlw_qmn_duplicate_data->business_field_text."', '".$mlw_qmn_duplicate_data->email_field_text."', '".$mlw_qmn_duplicate_data->phone_field_text."', '".$mlw_qmn_duplicate_data->comment_field_text."', '".$mlw_qmn_duplicate_data->email_from_text."', '".$mlw_qmn_duplicate_data->question_answer_template."', '".$mlw_qmn_duplicate_data->leaderboard_template."', ".$mlw_qmn_duplicate_data->system.", ".$mlw_qmn_duplicate_data->randomness_order.", ".$mlw_qmn_duplicate_data->loggedin_user_contact.", ".$mlw_qmn_duplicate_data->show_score.", ".$mlw_qmn_duplicate_data->send_user_email.", ".$mlw_qmn_duplicate_data->send_admin_email.", ".$mlw_qmn_duplicate_data->contact_info_location.", ".$mlw_qmn_duplicate_data->user_name.", ".$mlw_qmn_duplicate_data->user_comp.", ".$mlw_qmn_duplicate_data->user_email.", ".$mlw_qmn_duplicate_data->user_phone.", '".get_option( 'admin_email', 'Enter email' )."', ".$mlw_qmn_duplicate_data->comment_section.", ".$mlw_qmn_duplicate_data->question_from_total.", ".$mlw_qmn_duplicate_data->total_user_tries.", '".$mlw_qmn_duplicate_data->total_user_tries_text."', '".$mlw_qmn_duplicate_data->certificate_template."', 0, 0, 0)" );
124
  if ($results != false)
125
  {
126
  $hasDuplicatedQuiz = true;
30
  5. %FIFTH_PLACE_NAME%-%FIFTH_PLACE_SCORE%<br />";
31
  $mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
32
  $insert = "INSERT INTO " . $table_name .
33
+ "(quiz_id, quiz_name, message_before, message_after, message_comment, message_end_template, user_email_template, admin_email_template, submit_button_text, name_field_text, business_field_text, email_field_text, phone_field_text, comment_field_text, email_from_text, question_answer_template, leaderboard_template, system, randomness_order, loggedin_user_contact, show_score, send_user_email, send_admin_email, contact_info_location, user_name, user_comp, user_email, user_phone, admin_email, comment_section, question_from_total, total_user_tries, total_user_tries_text, certificate_template, social_media, social_media_text, pagination, pagination_text, timer_limit, quiz_views, quiz_taken, deleted) " .
34
+ "VALUES (NULL , '" . $quiz_name . "' , 'Enter your text here', 'Enter your text here', 'Enter your text here', '', 'Enter your text here', 'Enter your text here', 'Submit Quiz', 'Name', 'Business', 'Email', 'Phone Number', 'Comments', 'Wordpress', '".$mlw_question_answer_default."', '".$mlw_leaderboard_default."', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '".get_option( 'admin_email', 'Enter email' )."', 0, 0, 0, 'Enter Your Text Here', 'Enter Your Text Here!', 0, 'I just score a %CORRECT_SCORE%% on %QUIZ_NAME%!', 0, 'Next', 0, 0, 0, 0)";
35
  $results = $wpdb->query( $insert );
36
  if ($results != false)
37
  {
120
  $mlw_duplicate_quiz_id = $_POST["duplicate_quiz_id"];
121
  $mlw_duplicate_quiz_name = $_POST["duplicate_new_quiz_name"];
122
  $mlw_qmn_duplicate_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "mlw_quizzes WHERE quiz_id=%d", $mlw_duplicate_quiz_id ) );
123
+ $results = $wpdb->query( "INSERT INTO ".$table_name." (quiz_id, quiz_name, message_before, message_after, message_comment, message_end_template, user_email_template, admin_email_template, submit_button_text, name_field_text, business_field_text, email_field_text, phone_field_text, comment_field_text, email_from_text, question_answer_template, leaderboard_template, system, randomness_order, loggedin_user_contact, show_score, send_user_email, send_admin_email, contact_info_location, user_name, user_comp, user_email, user_phone, admin_email, comment_section, question_from_total, total_user_tries, total_user_tries_text, certificate_template, social_media, social_media_text, pagination, pagination_text, timer_limit, quiz_views, quiz_taken, deleted) VALUES (NULL , '".$mlw_duplicate_quiz_name."' , '".$mlw_qmn_duplicate_data->message_before."', '".$mlw_qmn_duplicate_data->message_after."', '".$mlw_qmn_duplicate_data->message_comment."', '".$mlw_qmn_duplicate_data->message_end_template."', '".$mlw_qmn_duplicate_data->user_email_template."', '".$mlw_qmn_duplicate_data->admin_email_template."', '".$mlw_qmn_duplicate_data->submit_button_text."', '".$mlw_qmn_duplicate_data->name_field_text."', '".$mlw_qmn_duplicate_data->business_field_text."', '".$mlw_qmn_duplicate_data->email_field_text."', '".$mlw_qmn_duplicate_data->phone_field_text."', '".$mlw_qmn_duplicate_data->comment_field_text."', '".$mlw_qmn_duplicate_data->email_from_text."', '".$mlw_qmn_duplicate_data->question_answer_template."', '".$mlw_qmn_duplicate_data->leaderboard_template."', ".$mlw_qmn_duplicate_data->system.", ".$mlw_qmn_duplicate_data->randomness_order.", ".$mlw_qmn_duplicate_data->loggedin_user_contact.", ".$mlw_qmn_duplicate_data->show_score.", ".$mlw_qmn_duplicate_data->send_user_email.", ".$mlw_qmn_duplicate_data->send_admin_email.", ".$mlw_qmn_duplicate_data->contact_info_location.", ".$mlw_qmn_duplicate_data->user_name.", ".$mlw_qmn_duplicate_data->user_comp.", ".$mlw_qmn_duplicate_data->user_email.", ".$mlw_qmn_duplicate_data->user_phone.", '".get_option( 'admin_email', 'Enter email' )."', ".$mlw_qmn_duplicate_data->comment_section.", ".$mlw_qmn_duplicate_data->question_from_total.", ".$mlw_qmn_duplicate_data->total_user_tries.", '".$mlw_qmn_duplicate_data->total_user_tries_text."', '".$mlw_qmn_duplicate_data->certificate_template."', ".$mlw_qmn_duplicate_data->social_media.", '".$mlw_qmn_duplicate_data->social_media_text."', ".$mlw_qmn_duplicate_data->pagination.", '".$mlw_qmn_duplicate_data->pagination_text."', ".$mlw_qmn_duplicate_data->timer_limit.", 0, 0, 0)" );
124
  if ($results != false)
125
  {
126
  $hasDuplicatedQuiz = true;
includes/mlw_quiz_install.php CHANGED
@@ -81,6 +81,16 @@ function mlw_quiz_activate()
81
  total_user_tries_text TEXT NOT NULL,
82
 
83
  certificate_template TEXT NOT NULL,
 
 
 
 
 
 
 
 
 
 
84
 
85
  quiz_views INT NOT NULL,
86
 
81
  total_user_tries_text TEXT NOT NULL,
82
 
83
  certificate_template TEXT NOT NULL,
84
+
85
+ social_media INT NOT NULL,
86
+
87
+ social_media_text TEXT NOT NULL,
88
+
89
+ pagination INT NOT NULL,
90
+
91
+ pagination_text TEXT NOT NULL,
92
+
93
+ timer_limit INT NOT NULL,
94
 
95
  quiz_views INT NOT NULL,
96
 
includes/mlw_quiz_options.php CHANGED
@@ -188,7 +188,7 @@ function mlw_generate_quiz_options()
188
  //Variables for save templates form
189
  $mlw_before_message = $_POST["mlw_quiz_before_message"];
190
  $mlw_qmn_message_end = $_POST["message_end_template"];
191
- //$mlw_after_message = $_POST["mlw_quiz_after_message"];
192
  $mlw_user_tries_text = $_POST["mlw_quiz_total_user_tries_text"];
193
  $mlw_user_email_template = $_POST["mlw_quiz_user_email_template"];
194
  $mlw_admin_email_template = $_POST["mlw_quiz_admin_email_template"];
@@ -199,11 +199,12 @@ function mlw_generate_quiz_options()
199
  $mlw_phone_field_text = $_POST["mlw_phoneText"];
200
  $mlw_before_comments = $_POST["mlw_quiz_before_comments"];
201
  $mlw_comment_field_text = $_POST["mlw_commentText"];
 
202
  $mlw_email_from_text = $_POST["emailFromText"];
203
  $mlw_question_answer_template = $_POST["mlw_quiz_question_answer_template"];
204
  $quiz_id = $_POST["quiz_id"];
205
 
206
- $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET message_before='".$mlw_before_message."', message_comment='".$mlw_before_comments."', message_end_template='".$mlw_qmn_message_end."', comment_field_text='".$mlw_comment_field_text."', email_from_text='".$mlw_email_from_text."', question_answer_template='".$mlw_question_answer_template."', submit_button_text='".$mlw_submit_button_text."', name_field_text='".$mlw_name_field_text."', business_field_text='".$mlw_business_field_text."', email_field_text='".$mlw_email_field_text."', phone_field_text='".$mlw_phone_field_text."', user_email_template='".$mlw_user_email_template."', admin_email_template='".$mlw_admin_email_template."', total_user_tries_text='".$mlw_user_tries_text."' WHERE quiz_id=".$quiz_id;
207
  $results = $wpdb->query( $update );
208
  if ($results != false)
209
  {
@@ -235,6 +236,9 @@ function mlw_generate_quiz_options()
235
  {
236
  //Variables for save options form
237
  $mlw_system = $_POST["system"];
 
 
 
238
  $mlw_qmn_questions_from_total = $_POST["question_from_total"];
239
  $mlw_randomness_order = $_POST["randomness_order"];
240
  $mlw_total_user_tries = intval($_POST["total_user_tries"]);
@@ -250,7 +254,7 @@ function mlw_generate_quiz_options()
250
  $mlw_qmn_loggedin_contact = $_POST["loggedin_user_contact"];
251
  $quiz_id = $_POST["quiz_id"];
252
 
253
- $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET system='".$mlw_system."', send_user_email='".$mlw_send_user_email."', send_admin_email='".$mlw_send_admin_email."', loggedin_user_contact='".$mlw_qmn_loggedin_contact."', contact_info_location=".$mlw_contact_location.", user_name='".$mlw_user_name."', user_comp='".$mlw_user_comp."', user_email='".$mlw_user_email."', user_phone='".$mlw_user_phone."', admin_email='".$mlw_admin_email."', comment_section='".$mlw_comment_section."', randomness_order='".$mlw_randomness_order."', question_from_total=".$mlw_qmn_questions_from_total.", total_user_tries=".$mlw_total_user_tries." WHERE quiz_id=".$quiz_id;
254
  $results = $wpdb->query( $update );
255
  if ($results != false)
256
  {
@@ -680,9 +684,15 @@ function mlw_generate_quiz_options()
680
  $j(function() {
681
  $j( "#userPhone" ).buttonset();
682
  });
 
 
 
683
  $j(function() {
684
  $j( "#commentSection" ).buttonset();
685
  });
 
 
 
686
  $j(function() {
687
  $j( "#comments" ).buttonset();
688
  });
@@ -1504,6 +1514,10 @@ function mlw_generate_quiz_options()
1504
  <th scope="row"><label for="mlw_commentText">Text for comments field</label></th>
1505
  <td><input name="mlw_commentText" type="text" id="mlw_commentText" value="<?php echo $mlw_quiz_options->comment_field_text; ?>" class="regular-text" /></td>
1506
  </tr>
 
 
 
 
1507
  <tr valign="top">
1508
  <th scope="row"><label for="emailFromText">What is the From Name for the email sent to users and admin?</label></th>
1509
  <td><input name="emailFromText" type="text" id="emailFromText" value="<?php echo $mlw_quiz_options->email_from_text; ?>" class="regular-text" /></td>
@@ -1524,6 +1538,22 @@ function mlw_generate_quiz_options()
1524
  <td><textarea cols="80" rows="15" id="mlw_quiz_question_answer_template" name="mlw_quiz_question_answer_template"><?php echo $mlw_quiz_options->question_answer_template; ?></textarea>
1525
  </td>
1526
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1527
  </table>
1528
 
1529
  </div>
@@ -1547,6 +1577,25 @@ function mlw_generate_quiz_options()
1547
  <input type="radio" id="radio3" name="system" <?php if ($mlw_quiz_options->system == 2) {echo 'checked="checked"';} ?> value='2' /><label for="radio3">Not Graded</label>
1548
  </div></td>
1549
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1550
  <tr valign="top">
1551
  <th scope="row"><label for="question_from_total">How many questions should be loaded for quiz? (Leave 0 to load all questions)</label></th>
1552
  <td>
@@ -1559,13 +1608,7 @@ function mlw_generate_quiz_options()
1559
  <input type="radio" id="radio23" name="randomness_order" <?php if ($mlw_quiz_options->randomness_order == 0) {echo 'checked="checked"';} ?> value='0' /><label for="radio23">No</label>
1560
  <input type="radio" id="radio24" name="randomness_order" <?php if ($mlw_quiz_options->randomness_order == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio24">Yes</label>
1561
  </div></td>
1562
- </tr>
1563
- <tr valign="top">
1564
- <th scope="row"><label for="total_user_tries">How many times can a user take this quiz? (Leave 0 for as many times as the user wants to. Currently only works for registered users)</label></th>
1565
- <td>
1566
- <input name="total_user_tries" type="number" step="1" min="0" id="total_user_tries" value="<?php echo $mlw_quiz_options->total_user_tries; ?>" class="regular-text" />
1567
- </td>
1568
- </tr>
1569
  <tr valign="top">
1570
  <th scope="row"><label for="contact_info_location">Would you like to ask for the contact information at the beginning or at the end of the quiz?</label></th>
1571
  <td><div id="contact_info_location">
@@ -1637,6 +1680,13 @@ function mlw_generate_quiz_options()
1637
  <th scope="row"><label for="adminEmail">What email should we send the admin email to?</label></th>
1638
  <td><input name="adminEmail" type="email" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
1639
  </tr>
 
 
 
 
 
 
 
1640
  </table>
1641
  <button id="save_options_button" onclick="javascript: document.quiz_options_form.submit();">Save Options</button>
1642
  <?php echo "</form>"; ?>
188
  //Variables for save templates form
189
  $mlw_before_message = $_POST["mlw_quiz_before_message"];
190
  $mlw_qmn_message_end = $_POST["message_end_template"];
191
+ $mlw_qmn_social_medi_text = $_POST["mlw_quiz_social_media_text_template"];
192
  $mlw_user_tries_text = $_POST["mlw_quiz_total_user_tries_text"];
193
  $mlw_user_email_template = $_POST["mlw_quiz_user_email_template"];
194
  $mlw_admin_email_template = $_POST["mlw_quiz_admin_email_template"];
199
  $mlw_phone_field_text = $_POST["mlw_phoneText"];
200
  $mlw_before_comments = $_POST["mlw_quiz_before_comments"];
201
  $mlw_comment_field_text = $_POST["mlw_commentText"];
202
+ $mlw_qmn_next_field = $_POST["pagination_text"];
203
  $mlw_email_from_text = $_POST["emailFromText"];
204
  $mlw_question_answer_template = $_POST["mlw_quiz_question_answer_template"];
205
  $quiz_id = $_POST["quiz_id"];
206
 
207
+ $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET message_before='".$mlw_before_message."', message_comment='".$mlw_before_comments."', message_end_template='".$mlw_qmn_message_end."', comment_field_text='".$mlw_comment_field_text."', email_from_text='".$mlw_email_from_text."', question_answer_template='".$mlw_question_answer_template."', submit_button_text='".$mlw_submit_button_text."', name_field_text='".$mlw_name_field_text."', business_field_text='".$mlw_business_field_text."', email_field_text='".$mlw_email_field_text."', phone_field_text='".$mlw_phone_field_text."', user_email_template='".$mlw_user_email_template."', admin_email_template='".$mlw_admin_email_template."', total_user_tries_text='".$mlw_user_tries_text."', social_media_text='".$mlw_qmn_social_medi_text."', pagination_text='".$mlw_qmn_next_field."' WHERE quiz_id=".$quiz_id;
208
  $results = $wpdb->query( $update );
209
  if ($results != false)
210
  {
236
  {
237
  //Variables for save options form
238
  $mlw_system = $_POST["system"];
239
+ $mlw_qmn_pagination = intval($_POST["pagination"]);
240
+ $mlw_qmn_social_media = intval($_POST["social_media"]);
241
+ $mlw_qmn_timer = intval($_POST["timer_limit"]);
242
  $mlw_qmn_questions_from_total = $_POST["question_from_total"];
243
  $mlw_randomness_order = $_POST["randomness_order"];
244
  $mlw_total_user_tries = intval($_POST["total_user_tries"]);
254
  $mlw_qmn_loggedin_contact = $_POST["loggedin_user_contact"];
255
  $quiz_id = $_POST["quiz_id"];
256
 
257
+ $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET system='".$mlw_system."', send_user_email='".$mlw_send_user_email."', send_admin_email='".$mlw_send_admin_email."', loggedin_user_contact='".$mlw_qmn_loggedin_contact."', contact_info_location=".$mlw_contact_location.", user_name='".$mlw_user_name."', user_comp='".$mlw_user_comp."', user_email='".$mlw_user_email."', user_phone='".$mlw_user_phone."', admin_email='".$mlw_admin_email."', comment_section='".$mlw_comment_section."', randomness_order='".$mlw_randomness_order."', question_from_total=".$mlw_qmn_questions_from_total.", total_user_tries=".$mlw_total_user_tries.", social_media=".$mlw_qmn_social_media.", pagination=".$mlw_qmn_pagination.", timer_limit=".$mlw_qmn_timer." WHERE quiz_id=".$quiz_id;
258
  $results = $wpdb->query( $update );
259
  if ($results != false)
260
  {
684
  $j(function() {
685
  $j( "#userPhone" ).buttonset();
686
  });
687
+ $j(function() {
688
+ $j( "#pagination" ).buttonset();
689
+ });
690
  $j(function() {
691
  $j( "#commentSection" ).buttonset();
692
  });
693
+ $j(function() {
694
+ $j( "#social_media" ).buttonset();
695
+ });
696
  $j(function() {
697
  $j( "#comments" ).buttonset();
698
  });
1514
  <th scope="row"><label for="mlw_commentText">Text for comments field</label></th>
1515
  <td><input name="mlw_commentText" type="text" id="mlw_commentText" value="<?php echo $mlw_quiz_options->comment_field_text; ?>" class="regular-text" /></td>
1516
  </tr>
1517
+ <tr valign="top">
1518
+ <th scope="row"><label for="pagination_text">Text for next button</label></th>
1519
+ <td><input name="pagination_text" type="text" id="pagination_text" value="<?php echo $mlw_quiz_options->pagination_text; ?>" class="regular-text" /></td>
1520
+ </tr>
1521
  <tr valign="top">
1522
  <th scope="row"><label for="emailFromText">What is the From Name for the email sent to users and admin?</label></th>
1523
  <td><input name="emailFromText" type="text" id="emailFromText" value="<?php echo $mlw_quiz_options->email_from_text; ?>" class="regular-text" /></td>
1538
  <td><textarea cols="80" rows="15" id="mlw_quiz_question_answer_template" name="mlw_quiz_question_answer_template"><?php echo $mlw_quiz_options->question_answer_template; ?></textarea>
1539
  </td>
1540
  </tr>
1541
+ <tr>
1542
+ <td width="30%">
1543
+ <strong>Social Media Sharing Text</strong>
1544
+ <br />
1545
+ <p>Allowed Variables: </p>
1546
+ <p style="margin: 2px 0">- %POINT_SCORE%</p>
1547
+ <p style="margin: 2px 0">- %AVERAGE_POINT%</p>
1548
+ <p style="margin: 2px 0">- %AMOUNT_CORRECT%</p>
1549
+ <p style="margin: 2px 0">- %TOTAL_QUESTIONS%</p>
1550
+ <p style="margin: 2px 0">- %CORRECT_SCORE%</p>
1551
+ <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1552
+ <p style="margin: 2px 0">- %TIMER%</p>
1553
+ </td>
1554
+ <td><textarea cols="80" rows="15" id="mlw_quiz_social_media_text_template" name="mlw_quiz_social_media_text_template"><?php echo $mlw_quiz_options->social_media_text; ?></textarea>
1555
+ </td>
1556
+ </tr>
1557
  </table>
1558
 
1559
  </div>
1577
  <input type="radio" id="radio3" name="system" <?php if ($mlw_quiz_options->system == 2) {echo 'checked="checked"';} ?> value='2' /><label for="radio3">Not Graded</label>
1578
  </div></td>
1579
  </tr>
1580
+ <tr valign="top">
1581
+ <th scope="row"><label for="pagination">Would you like all the questions on one page or would you rather one question per page?</label></th>
1582
+ <td><div id="pagination">
1583
+ <input type="radio" id="pagination_radio" name="pagination" <?php if ($mlw_quiz_options->pagination == 0) {echo 'checked="checked"';} ?> value='0' /><label for="pagination_radio">All On One Page</label>
1584
+ <input type="radio" id="pagination_radio2" name="pagination" <?php if ($mlw_quiz_options->pagination == 1) {echo 'checked="checked"';} ?> value='1' /><label for="pagination_radio2">One Question Per Page</label>
1585
+ </div></td>
1586
+ </tr>
1587
+ <tr valign="top">
1588
+ <th scope="row"><label for="timer_limit">How many minutes does the user have to finish the quiz? (Leave 0 for no time limit)</label></th>
1589
+ <td>
1590
+ <input name="timer_limit" type="number" step="1" min="0" id="timer_limit" value="<?php echo $mlw_quiz_options->timer_limit; ?>" class="regular-text" />
1591
+ </td>
1592
+ </tr>
1593
+ <tr valign="top">
1594
+ <th scope="row"><label for="total_user_tries">How many times can a user take this quiz? (Leave 0 for as many times as the user wants to. Currently only works for registered users)</label></th>
1595
+ <td>
1596
+ <input name="total_user_tries" type="number" step="1" min="0" id="total_user_tries" value="<?php echo $mlw_quiz_options->total_user_tries; ?>" class="regular-text" />
1597
+ </td>
1598
+ </tr>
1599
  <tr valign="top">
1600
  <th scope="row"><label for="question_from_total">How many questions should be loaded for quiz? (Leave 0 to load all questions)</label></th>
1601
  <td>
1608
  <input type="radio" id="radio23" name="randomness_order" <?php if ($mlw_quiz_options->randomness_order == 0) {echo 'checked="checked"';} ?> value='0' /><label for="radio23">No</label>
1609
  <input type="radio" id="radio24" name="randomness_order" <?php if ($mlw_quiz_options->randomness_order == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio24">Yes</label>
1610
  </div></td>
1611
+ </tr>
 
 
 
 
 
 
1612
  <tr valign="top">
1613
  <th scope="row"><label for="contact_info_location">Would you like to ask for the contact information at the beginning or at the end of the quiz?</label></th>
1614
  <td><div id="contact_info_location">
1680
  <th scope="row"><label for="adminEmail">What email should we send the admin email to?</label></th>
1681
  <td><input name="adminEmail" type="email" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
1682
  </tr>
1683
+ <tr valign="top">
1684
+ <th scope="row"><label for="social_media">Show social media sharing buttons? (Twitter only so far)</label></th>
1685
+ <td><div id="social_media">
1686
+ <input type="radio" id="social_media_radio" name="social_media" <?php if ($mlw_quiz_options->social_media == 0) {echo 'checked="checked"';} ?> value='0' /><label for="social_media_radio">No</label>
1687
+ <input type="radio" id="social_media_radio2" name="social_media" <?php if ($mlw_quiz_options->social_media == 1) {echo 'checked="checked"';} ?> value='1' /><label for="social_media_radio2">Yes</label>
1688
+ </div></td>
1689
+ </tr>
1690
  </table>
1691
  <button id="save_options_button" onclick="javascript: document.quiz_options_form.submit();">Save Options</button>
1692
  <?php echo "</form>"; ?>
includes/mlw_update.php CHANGED
@@ -6,7 +6,7 @@ function mlw_quiz_update()
6
  {
7
 
8
  //Update this variable each update. This is what is checked when the plugin is deciding to run the upgrade script or not.
9
- $data = "1.8.2";
10
  if ( ! get_option('mlw_quiz_master_version'))
11
  {
12
  add_option('mlw_quiz_master_version' , $data);
@@ -130,6 +130,43 @@ function mlw_quiz_update()
130
  $results = $wpdb->query( $update_sql );
131
  }
132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  global $wpdb;
134
  $table_name = $wpdb->prefix . "mlw_questions";
135
  //Update 0.5
6
  {
7
 
8
  //Update this variable each update. This is what is checked when the plugin is deciding to run the upgrade script or not.
9
+ $data = "1.9.1";
10
  if ( ! get_option('mlw_quiz_master_version'))
11
  {
12
  add_option('mlw_quiz_master_version' , $data);
130
  $results = $wpdb->query( $update_sql );
131
  }
132
 
133
+ //Update 1.9.1
134
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'social_media'") != "social_media")
135
+ {
136
+ $sql = "ALTER TABLE ".$table_name." ADD social_media INT NOT NULL AFTER certificate_template";
137
+ $results = $wpdb->query( $sql );
138
+ $update_sql = "UPDATE ".$table_name." SET social_media='0'";
139
+ $results = $wpdb->query( $update_sql );
140
+ }
141
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'social_media_text'") != "social_media_text")
142
+ {
143
+ $sql = "ALTER TABLE ".$table_name." ADD social_media_text TEXT NOT NULL AFTER social_media";
144
+ $results = $wpdb->query( $sql );
145
+ $update_sql = "UPDATE ".$table_name." SET social_media_text='I just score a %CORRECT_SCORE%% on %QUIZ_NAME%!'";
146
+ $results = $wpdb->query( $update_sql );
147
+ }
148
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'pagination'") != "pagination")
149
+ {
150
+ $sql = "ALTER TABLE ".$table_name." ADD pagination INT NOT NULL AFTER social_media_text";
151
+ $results = $wpdb->query( $sql );
152
+ $update_sql = "UPDATE ".$table_name." SET pagination=0";
153
+ $results = $wpdb->query( $update_sql );
154
+ }
155
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'pagination_text'") != "pagination_text")
156
+ {
157
+ $sql = "ALTER TABLE ".$table_name." ADD pagination_text TEXT NOT NULL AFTER pagination";
158
+ $results = $wpdb->query( $sql );
159
+ $update_sql = "UPDATE ".$table_name." SET pagination_text='Next'";
160
+ $results = $wpdb->query( $update_sql );
161
+ }
162
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'timer_limit'") != "timer_limit")
163
+ {
164
+ $sql = "ALTER TABLE ".$table_name." ADD timer_limit INT NOT NULL AFTER pagination_text";
165
+ $results = $wpdb->query( $sql );
166
+ $update_sql = "UPDATE ".$table_name." SET timer_limit=0";
167
+ $results = $wpdb->query( $update_sql );
168
+ }
169
+
170
  global $wpdb;
171
  $table_name = $wpdb->prefix . "mlw_questions";
172
  //Update 0.5
mlw_quizmaster2.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Quiz Master Next
5
  Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
6
- Version: 1.8.2
7
  Author: Frank Corso
8
  Author URI: http://www.mylocalwebstop.com/
9
  Plugin URI: http://www.mylocalwebstop.com/
3
  /*
4
  Plugin Name: Quiz Master Next
5
  Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
6
+ Version: 1.9.1
7
  Author: Frank Corso
8
  Author URI: http://www.mylocalwebstop.com/
9
  Plugin URI: http://www.mylocalwebstop.com/
readme.txt CHANGED
@@ -4,50 +4,58 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: quiz, test, score, survey, contact, form, email, answer, question
5
  Requires at least: 3.3
6
  Tested up to: 3.8.1
7
- Stable tag: 1.8.2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- Use this plugin to add multiple quizzes, tests, surveys, or contact forms to your website.
11
 
12
  == Description ==
13
 
14
- Use this plugin to add multiple quizzes, tests, and surveys 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
- = Features =
 
17
 
18
- * Allows for Unlimited Quizzes, Tests, Surveys, Contact Forms, etc..
19
- * Allows for Unlimited Questions in each Quiz
20
- * Allows for Unlimited landing pages for each quiz based on the user's score
21
- * Allows for you to create certificates for the user
22
- * Can use HTML for questions
23
- * Can embed Youtube videos in questions
24
- * Can ask for user's contact information at beginning or end of quiz
25
- * Can email user after taking the quiz
26
- * Can email an admin after a user takes the quiz
27
- * Can score the quiz using an incorrect/correct system, a points based system, or a not-graded system
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  * Can set amount of tries a user has to take the quiz
29
- * Can enable comment boxes for each question and/or comment section at the end of the quiz
30
- * Can enable hints for questions
31
  * Can show user why the answer is the correct answer
32
- * Can load set number of questions from question bank or all questions
33
- * Saves the results after a user takes the quiz
34
- * Saves the users answers and comments after taking the quiz
35
- * Features audit trail so admins can keep track of who adds, edits, or deletes quizzes and questions
36
- * Features useful statistics for how many have quizzes been taken
37
- * Create surveys by utilizing the comment boxes instead of answers
38
- * Create Contact Forms
39
- * Customize templates for landing page after the quiz has been taken
40
- * Customize emails that are sent to users and admins
41
  * Questions can be in predetermined order or random
42
- * Leaderboards for every quiz which can be used as shortcode or in included widget
 
 
 
43
 
44
- Be sure to check out all of our plugins in our Master Suite. Visit our plugins page for details: (http://mylocalwebstop.com/wordpress-plugins/)
45
 
46
 
47
  == Installation ==
48
 
49
  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.
50
- (http://mylocalwebstop.com/services/)
51
 
52
  **Or**
53
 
@@ -71,10 +79,10 @@ On each page, there is a "?" next to the page title. Clicking on it will bring u
71
  There is a How-To page that has many useful how-to's to assist you on using the plugin. 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.
72
 
73
  = I need a lot of help setting up my quiz, what can you do to help? =
74
- We now offer a monthly premium support plan that offers priority response, access to a premium support-only forum, and includes 1-on-1 training! For details, visit our services page: (http://mylocalwebstop.com/services/)
75
 
76
  = Do you offer any 1-on-1 training to assist me in using this plugin? =
77
- We now offer an installation service that includes 1-on-1 training as well as a monthly support plan that includes 1-on-1 training. For details, visit our services page: (http://mylocalwebstop.com/services/)
78
 
79
  = I have an idea, how do I contact you? =
80
  Feel free to use the widget on the quiz dashboard within the plugin or from the contact page at mylocalwebstop.com.
@@ -91,6 +99,13 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
91
 
92
  == Changelog ==
93
 
 
 
 
 
 
 
 
94
  = 1.8.2 (March 11, 2014) =
95
  * Minor Bug Fixes
96
 
@@ -345,6 +360,9 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
345
 
346
  == Upgrade Notice ==
347
 
 
 
 
348
  = 1.8.1 =
349
  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.
350
 
4
  Tags: quiz, test, score, survey, contact, form, email, answer, question
5
  Requires at least: 3.3
6
  Tested up to: 3.8.1
7
+ Stable tag: 1.9.1
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, and surveys 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! 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
+ = Mulitple Landing Pages For Each Quiz =
23
+ Each quiz can have **unlimited** results pages that can be customized with your text. Show different results pages based on the users score!
24
+
25
+ = Emails After Completion Of Quiz =
26
+ 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.
27
+
28
+ = Very Flexible =
29
+ 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 fields are required. You can decide to use all the questions or only a select few chosen at random.
30
+
31
+ = Useful For Businesses =
32
+ 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!
33
+
34
+ = Saves The Results For Later Use =
35
+ The plugin will **save** the results, the user's answers, the user's comments, and more!
36
+
37
+ = Other Useful Features =
38
+
39
+ * Allow the user to share the results on *social networks*
40
+ * Show all questions on one page or have only one question per page
41
+ * Allows for you to create **certificates** for the user
42
  * Can set amount of tries a user has to take the quiz
43
+ * Can enable **comment boxes** for each question and/or comment section at the end of the quiz
44
+ * Can enable **hints** for questions
45
  * Can show user why the answer is the correct answer
 
 
 
 
 
 
 
 
 
46
  * Questions can be in predetermined order or random
47
+ * **Leaderboards** for every quiz which can be used as shortcode or in included widget
48
+ * Keep track how long a user takes on the quiz
49
+ * Able to set up time limits on the quiz
50
+ * And **Much** More...
51
 
52
+ Be sure to check out all of our plugins in our Master Suite. Visit our plugins page for details: [My Local Webstop Plugins](http://mylocalwebstop.com/wordpress-plugins/)
53
 
54
 
55
  == Installation ==
56
 
57
  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.
58
+ [My Local Webstop Services](http://mylocalwebstop.com/services/)
59
 
60
  **Or**
61
 
79
  There is a How-To page that has many useful how-to's to assist you on using the plugin. 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.
80
 
81
  = I need a lot of help setting up my quiz, what can you do to help? =
82
+ We now offer a monthly premium support plan that offers priority response, access to a premium support-only forum, and includes 1-on-1 training! For details, visit our services page: [My Local Webstop Services](http://mylocalwebstop.com/services/)
83
 
84
  = Do you offer any 1-on-1 training to assist me in using this plugin? =
85
+ We now offer an installation service that includes 1-on-1 training as well as a monthly support plan that includes 1-on-1 training. For details, visit our services page: [My Local Webstop Services](http://mylocalwebstop.com/services/)
86
 
87
  = I have an idea, how do I contact you? =
88
  Feel free to use the widget on the quiz dashboard within the plugin or from the contact page at mylocalwebstop.com.
99
 
100
  == Changelog ==
101
 
102
+ = 1.9.1 (March 13, 2014) =
103
+ * Added Ability To Show One Question At A Time Instead Of All At Once
104
+ * Added Ability To Allow Users To Share Results On Twitter
105
+ * Added Ability To Set Time Limits On Quiz
106
+ * Minor Design Changes To Quiz
107
+ * Minor Bug Fixes
108
+
109
  = 1.8.2 (March 11, 2014) =
110
  * Minor Bug Fixes
111
 
360
 
361
  == Upgrade Notice ==
362
 
363
+ = 1.9.1 =
364
+ 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.
365
+
366
  = 1.8.1 =
367
  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.
368