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

Version Description

(March 30, 2014) = * Added Ability To Show Question Numbers * Added More CSS Classes To Quiz Page For Better Styling Options * Changed Timer To Disable Fields Instead Of Submit Form When Time Is Up * Fixed Pagination Javascript Bug * Minor Design Change To Quiz * Minor Design Change To Quiz Options Page

Download this release

Release Info

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

Code changes from version 2.1.1 to 2.2.1

includes/mlw_qmn_credits.php CHANGED
@@ -87,23 +87,28 @@ function mlw_generate_about_page()
87
  <a href="#" class="nav-tab nav-tab-active">
88
  What&#8217;s New In <?php echo $mlw_quiz_version; ?> </a>
89
  </h2>
90
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Now you can edit the style for each quiz!</h2>
91
- <p>This new version brings the ability to edit the css for each quiz. Simply go to the new Quiz Style tab on the Quiz options page to see the current css as well as the recommended default css. The css classes for the page are listed at the top of the tab with an explanation as to what they are assigned to.</p>
92
  <br />
93
  <h3>Changelog For <?php echo $mlw_quiz_version; ?></h3>
94
  <ul>
95
- <li>Added Ability To Edit Style For Each Quiz</li>
96
- <li>Fixed Tried Quiz Too Many Times Text Bug</li>
97
- <li>Fixed Dashboard Quartely Widget Bug</li>
98
- <li>Minor Design Changes To Quiz Options Page</li>
 
 
99
  </ul>
100
  <h3>What's Coming Soon</h3>
101
  <ul>
102
  <li>Importing Questions</li>
103
  <li>Stats For Each Quiz</li>
104
- <li>Multiple Right Answers</li>
105
  <li>Graded Open Text Answers</li>
106
  <li>Exporting Of Results</li>
 
 
 
107
  </ul>
108
 
109
  <div id="dialog" title="Help">
87
  <a href="#" class="nav-tab nav-tab-active">
88
  What&#8217;s New In <?php echo $mlw_quiz_version; ?> </a>
89
  </h2>
90
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Now you can show question numbers on your quiz!</h2>
91
+ <p>This new version brings the ability to show the question number next to the question. Navigate to the Quiz Options tab to change the "Show question number on quiz?" option to Yes.</p>
92
  <br />
93
  <h3>Changelog For <?php echo $mlw_quiz_version; ?></h3>
94
  <ul>
95
+ <li>Added Ability To Show Question Numbers</li>
96
+ <li>Added More CSS Classes To Quiz Page For Better Styling Options</li>
97
+ <li>Changed Timer To Disable Fields Instead Of Submit Form When Time Is Up</li>
98
+ <li>Fixed Pagination Javascript Bug</li>
99
+ <li>Minor Design Change To Quiz</li>
100
+ <li>Minor Design Change To Quiz Options Page</li>
101
  </ul>
102
  <h3>What's Coming Soon</h3>
103
  <ul>
104
  <li>Importing Questions</li>
105
  <li>Stats For Each Quiz</li>
106
+ <li>Multiple Right Answers (Checkboxes)</li>
107
  <li>Graded Open Text Answers</li>
108
  <li>Exporting Of Results</li>
109
+ <li>Unlimited Amount Of Answers</li>
110
+ <li>Randomized Answers</li>
111
+ <li>Force Login/Register Option</li>
112
  </ul>
113
 
114
  <div id="dialog" title="Help">
includes/mlw_quiz.php CHANGED
@@ -15,7 +15,7 @@ function mlw_quiz_shortcode($atts)
15
  */
16
 
17
  //Variables needed throughout script
18
- $mlw_quiz_id = $quiz;
19
  $mlw_display = "";
20
  global $wpdb;
21
  $mlw_qmn_isAllowed = true;
@@ -137,22 +137,31 @@ function mlw_quiz_shortcode($atts)
137
  }
138
  ?>
139
  <script type="text/javascript">
140
- var $j = jQuery.noConflict();
141
- $j(function() {
142
- $j( ".quiz_section" ).hide();
143
- $j( ".quiz_section" ).append( "<br />" );
144
- $j( ".quiz_section" ).not( ".quiz_begin" ).append( "<a class=\"mlw_qmn_quiz_link\" href='#' onclick=\"prevSlide();\"><?php echo $mlw_qmn_pagination_text[0]; ?></a>" );
145
- $j( ".quiz_section" ).not( ".quiz_end" ).append( "<a class=\"mlw_qmn_quiz_link\" href='#' onclick=\"nextSlide();\"><?php echo $mlw_qmn_pagination_text[1]; ?></a>" );
146
- window.mlw_quiz_slide = 0;
147
- window.mlw_quiz_total_slides = <?php echo $mlw_qmn_section_limit; ?>;
148
- nextSlide();
149
- });
 
 
 
 
 
 
 
 
 
150
  function nextSlide()
151
  {
152
  window.mlw_quiz_slide++;
153
  if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
154
  {
155
- $j(".quiz_link").html("Submit");
156
  }
157
  if (window.mlw_quiz_slide > window.mlw_quiz_total_slides)
158
  {
@@ -160,8 +169,8 @@ function mlw_quiz_shortcode($atts)
160
  exit();
161
  }
162
  y = window.mlw_quiz_slide-1;
163
- $j( ".quiz_section.slide"+y ).hide();
164
- $j( ".quiz_section.slide"+window.mlw_quiz_slide ).show( "slide", {direction: "right"}, 300 );
165
 
166
  }
167
  function prevSlide()
@@ -169,7 +178,7 @@ function mlw_quiz_shortcode($atts)
169
  window.mlw_quiz_slide--;
170
  if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
171
  {
172
- $j(".quiz_link").html("Submit");
173
  }
174
  if (window.mlw_quiz_slide > window.mlw_quiz_total_slides)
175
  {
@@ -177,8 +186,8 @@ function mlw_quiz_shortcode($atts)
177
  exit();
178
  }
179
  y = window.mlw_quiz_slide+1;
180
- $j( ".quiz_section.slide"+y ).hide();
181
- $j( ".quiz_section.slide"+window.mlw_quiz_slide ).show( "slide", {direction: "left"}, 300 );
182
  }
183
  </script>
184
  <?php
@@ -201,7 +210,9 @@ function mlw_quiz_shortcode($atts)
201
  if (window.amount <= 0)
202
  {
203
  clearInterval(window.counter);
204
- document.quizForm.submit();
 
 
205
  return;
206
  }
207
  }
@@ -315,6 +326,8 @@ function mlw_quiz_shortcode($atts)
315
  }
316
  </script>";
317
 
 
 
318
  //Begin the quiz
319
  $mlw_display .= "<div class='mlw_qmn_quiz'>";
320
  $mlw_display .= "<form name='quizForm' action='' method='post' class='mlw_quiz_form' onsubmit='return mlw_validateForm()' >";
@@ -322,7 +335,7 @@ function mlw_quiz_shortcode($atts)
322
  $mlw_message_before = htmlspecialchars_decode($mlw_quiz_options->message_before, ENT_QUOTES);
323
  $mlw_message_before = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_before);
324
  $mlw_message_before = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_before);
325
- $mlw_display .= "<span>".$mlw_message_before."</span><br />";
326
  $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
327
 
328
  if ($mlw_quiz_options->contact_info_location == 0)
@@ -336,7 +349,9 @@ function mlw_quiz_shortcode($atts)
336
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
337
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
338
  $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
339
- $mlw_display .= "<span style='font-weight:bold;'>".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
 
 
340
  if ($mlw_question->question_type == 0)
341
  {
342
  if ($mlw_question->answer_one != "")
@@ -430,12 +445,12 @@ function mlw_quiz_shortcode($atts)
430
  }
431
  if ($mlw_question->comments == 0)
432
  {
433
- $mlw_display .= "<input type='text' 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)'/>";
434
  $mlw_display .= "<br />";
435
  }
436
  if ($mlw_question->comments == 2)
437
  {
438
- $mlw_display .= "<textarea cols='70' rows='5' 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>";
439
  $mlw_display .= "<br />";
440
  }
441
  if ($mlw_question->hints != "")
@@ -455,7 +470,7 @@ function mlw_quiz_shortcode($atts)
455
  $mlw_message_comments = htmlspecialchars_decode($mlw_quiz_options->message_comment, ENT_QUOTES);
456
  $mlw_message_comments = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_comments);
457
  $mlw_message_comments = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_comments);
458
- $mlw_display .= "<label for='mlwQuizComments' style='font-weight:bold;'>".$mlw_message_comments."</label><br />";
459
  $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
460
  $mlw_display .= "</div>";
461
  if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br /><br />"; }
@@ -467,7 +482,7 @@ function mlw_quiz_shortcode($atts)
467
  $mlw_message_end = htmlspecialchars_decode($mlw_quiz_options->message_end_template, ENT_QUOTES);
468
  $mlw_message_end = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_end);
469
  $mlw_message_end = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_end);
470
- $mlw_display .= "<span>".$mlw_message_end."</span>";
471
  $mlw_display .= "<br /><br />";
472
  }
473
  if ($mlw_quiz_options->contact_info_location == 1)
15
  */
16
 
17
  //Variables needed throughout script
18
+ $mlw_quiz_id = intval($quiz);
19
  $mlw_display = "";
20
  global $wpdb;
21
  $mlw_qmn_isAllowed = true;
137
  }
138
  ?>
139
  <script type="text/javascript">
140
+ if (window.addEventListener)
141
+ window.addEventListener('load', mlwQmnPagination, false)
142
+ else if (window.attachEvent)
143
+ window.attachEvent('onload', mlwQmnPagination)
144
+ else
145
+ window.onload = mlwQmnPagination;
146
+ function mlwQmnPagination()
147
+ {
148
+ var $j = jQuery.noConflict();
149
+ $j(function() {
150
+ $j( ".quiz_section" ).hide();
151
+ $j( ".quiz_section" ).append( "<br />" );
152
+ $j( ".quiz_section" ).not( ".quiz_begin" ).append( "<a class=\"mlw_qmn_quiz_link\" href='#' onclick=\"prevSlide();\"><?php echo $mlw_qmn_pagination_text[0]; ?></a>" );
153
+ $j( ".quiz_section" ).not( ".quiz_end" ).append( "<a class=\"mlw_qmn_quiz_link\" href='#' onclick=\"nextSlide();\"><?php echo $mlw_qmn_pagination_text[1]; ?></a>" );
154
+ window.mlw_quiz_slide = 0;
155
+ window.mlw_quiz_total_slides = <?php echo $mlw_qmn_section_limit; ?>;
156
+ nextSlide();
157
+ });
158
+ }
159
  function nextSlide()
160
  {
161
  window.mlw_quiz_slide++;
162
  if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
163
  {
164
+ jQuery(".quiz_link").html("Submit");
165
  }
166
  if (window.mlw_quiz_slide > window.mlw_quiz_total_slides)
167
  {
169
  exit();
170
  }
171
  y = window.mlw_quiz_slide-1;
172
+ jQuery( ".quiz_section.slide"+y ).hide();
173
+ jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show( "slide", {direction: "right"}, 300 );
174
 
175
  }
176
  function prevSlide()
178
  window.mlw_quiz_slide--;
179
  if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
180
  {
181
+ jQuery(".quiz_link").html("Submit");
182
  }
183
  if (window.mlw_quiz_slide > window.mlw_quiz_total_slides)
184
  {
186
  exit();
187
  }
188
  y = window.mlw_quiz_slide+1;
189
+ jQuery( ".quiz_section.slide"+y ).hide();
190
+ jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show( "slide", {direction: "left"}, 300 );
191
  }
192
  </script>
193
  <?php
210
  if (window.amount <= 0)
211
  {
212
  clearInterval(window.counter);
213
+ jQuery( "input:radio" ).attr('disabled',true);
214
+ jQuery( ".mlw_qmn_question_comment" ).attr('disabled',true);
215
+ //document.quizForm.submit();
216
  return;
217
  }
218
  }
326
  }
327
  </script>";
328
 
329
+ if ( $mlw_quiz_options->pagination == 1) { $mlw_display .= "<style>.quiz_section { display: none; }</style>"; }
330
+
331
  //Begin the quiz
332
  $mlw_display .= "<div class='mlw_qmn_quiz'>";
333
  $mlw_display .= "<form name='quizForm' action='' method='post' class='mlw_quiz_form' onsubmit='return mlw_validateForm()' >";
335
  $mlw_message_before = htmlspecialchars_decode($mlw_quiz_options->message_before, ENT_QUOTES);
336
  $mlw_message_before = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_before);
337
  $mlw_message_before = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_before);
338
+ $mlw_display .= "<span class='mlw_qmn_message_before'>".$mlw_message_before."</span><br />";
339
  $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
340
 
341
  if ($mlw_quiz_options->contact_info_location == 0)
349
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
350
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
351
  $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
352
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
353
+ if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
354
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
355
  if ($mlw_question->question_type == 0)
356
  {
357
  if ($mlw_question->answer_one != "")
445
  }
446
  if ($mlw_question->comments == 0)
447
  {
448
+ $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)'/>";
449
  $mlw_display .= "<br />";
450
  }
451
  if ($mlw_question->comments == 2)
452
  {
453
+ $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>";
454
  $mlw_display .= "<br />";
455
  }
456
  if ($mlw_question->hints != "")
470
  $mlw_message_comments = htmlspecialchars_decode($mlw_quiz_options->message_comment, ENT_QUOTES);
471
  $mlw_message_comments = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_comments);
472
  $mlw_message_comments = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_comments);
473
+ $mlw_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text' style='font-weight:bold;'>".$mlw_message_comments."</label><br />";
474
  $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
475
  $mlw_display .= "</div>";
476
  if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br /><br />"; }
482
  $mlw_message_end = htmlspecialchars_decode($mlw_quiz_options->message_end_template, ENT_QUOTES);
483
  $mlw_message_end = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_end);
484
  $mlw_message_end = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_end);
485
+ $mlw_display .= "<span class='mlw_qmn_message_end'>".$mlw_message_end."</span>";
486
  $mlw_display .= "<br /><br />";
487
  }
488
  if ($mlw_quiz_options->contact_info_location == 1)
includes/mlw_quiz_admin.php CHANGED
@@ -72,8 +72,8 @@ function mlw_generate_quiz_admin()
72
  }";
73
  $mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
74
  $insert = "INSERT INTO " . $table_name .
75
- "(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_stye, quiz_views, quiz_taken, deleted) " .
76
- "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, '".$mlw_style_default."', 0, 0, 0)";
77
  $results = $wpdb->query( $insert );
78
  if ($results != false)
79
  {
@@ -162,7 +162,7 @@ function mlw_generate_quiz_admin()
162
  $mlw_duplicate_quiz_id = $_POST["duplicate_quiz_id"];
163
  $mlw_duplicate_quiz_name = htmlspecialchars($_POST["duplicate_new_quiz_name"], ENT_QUOTES);
164
  $mlw_qmn_duplicate_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "mlw_quizzes WHERE quiz_id=%d", $mlw_duplicate_quiz_id ) );
165
- $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_stye, 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.", '".$mlw_qmn_duplicate_data->quiz_stye."', 0, 0, 0)" );
166
  if ($results != false)
167
  {
168
  $hasDuplicatedQuiz = true;
72
  }";
73
  $mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
74
  $insert = "INSERT INTO " . $table_name .
75
+ "(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_stye, question_numbering, quiz_views, quiz_taken, deleted) " .
76
+ "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, '".$mlw_style_default."', 0, 0, 0, 0)";
77
  $results = $wpdb->query( $insert );
78
  if ($results != false)
79
  {
162
  $mlw_duplicate_quiz_id = $_POST["duplicate_quiz_id"];
163
  $mlw_duplicate_quiz_name = htmlspecialchars($_POST["duplicate_new_quiz_name"], ENT_QUOTES);
164
  $mlw_qmn_duplicate_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "mlw_quizzes WHERE quiz_id=%d", $mlw_duplicate_quiz_id ) );
165
+ $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_stye, question_numbering, 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.", '".$mlw_qmn_duplicate_data->quiz_stye."', ".$mlw_qmn_duplicate_data->question_numbering.", 0, 0, 0)" );
166
  if ($results != false)
167
  {
168
  $hasDuplicatedQuiz = true;
includes/mlw_quiz_install.php CHANGED
@@ -93,6 +93,8 @@ function mlw_quiz_activate()
93
  timer_limit INT NOT NULL,
94
 
95
  quiz_stye TEXT NOT NULL,
 
 
96
 
97
  quiz_views INT NOT NULL,
98
 
93
  timer_limit INT NOT NULL,
94
 
95
  quiz_stye TEXT NOT NULL,
96
+
97
+ question_numbering INT NOT NULL,
98
 
99
  quiz_views INT NOT NULL,
100
 
includes/mlw_quiz_options.php CHANGED
@@ -239,6 +239,7 @@ function mlw_generate_quiz_options()
239
  $mlw_system = $_POST["system"];
240
  $mlw_qmn_pagination = intval($_POST["pagination"]);
241
  $mlw_qmn_social_media = intval($_POST["social_media"]);
 
242
  $mlw_qmn_timer = intval($_POST["timer_limit"]);
243
  $mlw_qmn_questions_from_total = $_POST["question_from_total"];
244
  $mlw_randomness_order = $_POST["randomness_order"];
@@ -255,7 +256,7 @@ function mlw_generate_quiz_options()
255
  $mlw_qmn_loggedin_contact = $_POST["loggedin_user_contact"];
256
  $quiz_id = $_POST["quiz_id"];
257
 
258
- $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;
259
  $results = $wpdb->query( $update );
260
  if ($results != false)
261
  {
@@ -735,6 +736,7 @@ function mlw_generate_quiz_options()
735
  });
736
  $j(function() {
737
  $j( "#social_media" ).buttonset();
 
738
  });
739
  $j(function() {
740
  $j( "#comments" ).buttonset();
@@ -1373,7 +1375,7 @@ function mlw_generate_quiz_options()
1373
  <h3>Template Variables</h3>
1374
  <table class="form-table">
1375
  <tr>
1376
- <td><strong>%POINT_SCORE%</strong> - Score for the quiz when using points</td>
1377
  <td><strong>%AVERAGE_POINT%</strong> - The average amount of points user had per question</td>
1378
  </tr>
1379
 
@@ -1383,7 +1385,7 @@ function mlw_generate_quiz_options()
1383
  </tr>
1384
 
1385
  <tr>
1386
- <td><strong>%CORRECT_SCORE%</strong> - Score for the quiz when using correct answers</td>
1387
  </tr>
1388
 
1389
  <tr>
@@ -1753,11 +1755,18 @@ function mlw_generate_quiz_options()
1753
  <th scope="row"><label for="adminEmail">What email should we send the admin email to?</label></th>
1754
  <td><input name="adminEmail" type="email" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
1755
  </tr>
 
 
 
 
 
 
 
1756
  <tr valign="top">
1757
  <th scope="row"><label for="social_media">Show social media sharing buttons? (Twitter only so far)</label></th>
1758
  <td><div id="social_media">
1759
- <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>
1760
- <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>
1761
  </div></td>
1762
  </tr>
1763
  </table>
@@ -2016,6 +2025,11 @@ function mlw_generate_quiz_options()
2016
  <p>This page allows you to edit the css styles for the quiz.</p>
2017
  <p>Entire quiz is wrapped in class 'mlw_qmn_quiz'</p>
2018
  <p>Each page of the quiz is wrapped in class 'quiz_section'</p>
 
 
 
 
 
2019
  <p>Each button shown for pagination (i.e Next/Previous) is wrapped in class 'mlw_qmn_quiz_link'</p>
2020
  <p>Timer is wrapped in class 'mlw_qmn_timer'</p>
2021
  <button id="save_styles_button" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
239
  $mlw_system = $_POST["system"];
240
  $mlw_qmn_pagination = intval($_POST["pagination"]);
241
  $mlw_qmn_social_media = intval($_POST["social_media"]);
242
+ $mlw_qmn_question_numbering = intval($_POST["question_numbering"]);
243
  $mlw_qmn_timer = intval($_POST["timer_limit"]);
244
  $mlw_qmn_questions_from_total = $_POST["question_from_total"];
245
  $mlw_randomness_order = $_POST["randomness_order"];
256
  $mlw_qmn_loggedin_contact = $_POST["loggedin_user_contact"];
257
  $quiz_id = $_POST["quiz_id"];
258
 
259
+ $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.", question_numbering=".$mlw_qmn_question_numbering." WHERE quiz_id=".$quiz_id;
260
  $results = $wpdb->query( $update );
261
  if ($results != false)
262
  {
736
  });
737
  $j(function() {
738
  $j( "#social_media" ).buttonset();
739
+ $j( "#question_numbering" ).buttonset();
740
  });
741
  $j(function() {
742
  $j( "#comments" ).buttonset();
1375
  <h3>Template Variables</h3>
1376
  <table class="form-table">
1377
  <tr>
1378
+ <td><strong>%POINT_SCORE%</strong> - Total points user earned when taking quiz</td>
1379
  <td><strong>%AVERAGE_POINT%</strong> - The average amount of points user had per question</td>
1380
  </tr>
1381
 
1385
  </tr>
1386
 
1387
  <tr>
1388
+ <td><strong>%CORRECT_SCORE%</strong> - The percent score for the quiz showing percent of total quetions answered correctly</td>
1389
  </tr>
1390
 
1391
  <tr>
1755
  <th scope="row"><label for="adminEmail">What email should we send the admin email to?</label></th>
1756
  <td><input name="adminEmail" type="email" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
1757
  </tr>
1758
+ <tr valign="top">
1759
+ <th scope="row"><label for="question_numbering">Show question number on quiz?</label></th>
1760
+ <td><div id="question_numbering">
1761
+ <input type="radio" id="question_numbering_radio2" name="question_numbering" <?php if ($mlw_quiz_options->question_numbering == 1) {echo 'checked="checked"';} ?> value='1' /><label for="question_numbering_radio2">Yes</label>
1762
+ <input type="radio" id="question_numbering_radio" name="question_numbering" <?php if ($mlw_quiz_options->question_numbering == 0) {echo 'checked="checked"';} ?> value='0' /><label for="question_numbering_radio">No</label>
1763
+ </div></td>
1764
+ </tr>
1765
  <tr valign="top">
1766
  <th scope="row"><label for="social_media">Show social media sharing buttons? (Twitter only so far)</label></th>
1767
  <td><div id="social_media">
1768
+ <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>
1769
+ <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>
1770
  </div></td>
1771
  </tr>
1772
  </table>
2025
  <p>This page allows you to edit the css styles for the quiz.</p>
2026
  <p>Entire quiz is wrapped in class 'mlw_qmn_quiz'</p>
2027
  <p>Each page of the quiz is wrapped in class 'quiz_section'</p>
2028
+ <p>Message before quiz text is wrapped in class 'mlw_qmn_message_before'</p>
2029
+ <p>The text for each question is wrapped in class 'mlw_qmn_question'</p>
2030
+ <p>Each comment field for the questions is wrapped in class 'mlw_qmn_question_comment'</p>
2031
+ <p>Label text for comment section is wrapped in class 'mlw_qmn_comment_section_text'</p>
2032
+ <p>The message displayed at end of quiz is wrapped in class 'mlw_qmn_message_end'</p>
2033
  <p>Each button shown for pagination (i.e Next/Previous) is wrapped in class 'mlw_qmn_quiz_link'</p>
2034
  <p>Timer is wrapped in class 'mlw_qmn_timer'</p>
2035
  <button id="save_styles_button" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
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 = "2.1.1";
10
  if ( ! get_option('mlw_quiz_master_version'))
11
  {
12
  add_option('mlw_quiz_master_version' , $data);
@@ -218,6 +218,15 @@ function mlw_quiz_update()
218
  $results = $wpdb->query( $update_sql );
219
  }
220
 
 
 
 
 
 
 
 
 
 
221
 
222
  global $wpdb;
223
  $table_name = $wpdb->prefix . "mlw_questions";
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 = "2.2.1";
10
  if ( ! get_option('mlw_quiz_master_version'))
11
  {
12
  add_option('mlw_quiz_master_version' , $data);
218
  $results = $wpdb->query( $update_sql );
219
  }
220
 
221
+ //Update 2.2.1
222
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'question_numbering'") != "question_numbering")
223
+ {
224
+ $sql = "ALTER TABLE ".$table_name." ADD question_numbering INT NOT NULL AFTER quiz_stye";
225
+ $results = $wpdb->query( $sql );
226
+ $update_sql = "UPDATE ".$table_name." SET question_numbering='0'";
227
+ $results = $wpdb->query( $update_sql );
228
+ }
229
+
230
 
231
  global $wpdb;
232
  $table_name = $wpdb->prefix . "mlw_questions";
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: 2.1.1
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: 2.2.1
7
  Author: Frank Corso
8
  Author URI: http://www.mylocalwebstop.com/
9
  Plugin URI: http://www.mylocalwebstop.com/
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.6
6
  Tested up to: 3.8.1
7
- Stable tag: 2.1.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.
@@ -99,6 +99,14 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
99
 
100
  == Changelog ==
101
 
 
 
 
 
 
 
 
 
102
  = 2.1.1 (March 26, 2014) =
103
  * Added Ability To Edit Style For Each Quiz
104
  * Fixed Tried Quiz Too Many Times Text Bug
4
  Tags: quiz, test, score, survey, contact, form, email, answer, question
5
  Requires at least: 3.6
6
  Tested up to: 3.8.1
7
+ Stable tag: 2.2.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.
99
 
100
  == Changelog ==
101
 
102
+ = 2.2.1 (March 30, 2014) =
103
+ * Added Ability To Show Question Numbers
104
+ * Added More CSS Classes To Quiz Page For Better Styling Options
105
+ * Changed Timer To Disable Fields Instead Of Submit Form When Time Is Up
106
+ * Fixed Pagination Javascript Bug
107
+ * Minor Design Change To Quiz
108
+ * Minor Design Change To Quiz Options Page
109
+
110
  = 2.1.1 (March 26, 2014) =
111
  * Added Ability To Edit Style For Each Quiz
112
  * Fixed Tried Quiz Too Many Times Text Bug