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

Version Description

Upgrade for new Horizontal Multiple Response question type and to be able to duplicate questions when duplicating quizzes. Also, fixes several major and minor bugs.

Download this release

Release Info

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

Code changes from version 3.2.2 to 3.3.1

includes/mlw_qmn_credits.php CHANGED
@@ -89,23 +89,32 @@ function mlw_generate_about_page()
89
  <div class="mlw_qmn_icon_wrap">Version <?php echo $mlw_quiz_version; ?></div>
90
  <h2 class="nav-tab-wrapper">
91
  <a href="javascript:mlw_qmn_setTab(1);" id="mlw_qmn_tab_1" class="nav-tab nav-tab-active">
92
- What&#8217;s New In 3.2</a>
93
  <a href="javascript:mlw_qmn_setTab(2);" id="mlw_qmn_tab_2" class="nav-tab">
94
  Changelog For <?php echo $mlw_quiz_version; ?> </a>
95
  <a href="javascript:mlw_qmn_setTab(3);" id="mlw_qmn_tab_3" class="nav-tab">
96
  Requested Features</a>
97
  </h2>
98
  <div id="mlw_quiz_what_new">
 
 
 
99
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Question Type</h2>
100
- <p style="text-align: center;">You can now use the captcha question type to help fight spam!</p>
101
  <br />
102
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Our Premium Add-Ons!</h2>
103
  <p style="text-align: center;">We have several new premium add-ons in our WordPress Store: MailPoet Integration (subscribes users to your MailPoet list), MailChimp Integration (subscribes users to your Mailchimp list), Export Results (exports your quiz results), Extra Shortcodes (gives you extra shortcodes to use), User Dashboard (allow users to see the results from all the quizzes they have taken), and Advertisement Be Gone (gets rid of blue-border ads). Visit our <a href="http://mylocalwebstop.com/shop/">WordPress Store</a> for details! </p>
104
  </div>
105
  <div id="mlw_quiz_changelog" style="display: none;">
106
- <h3><?php echo $mlw_quiz_version; ?> (October 4, 2014)</h3>
107
  <ul>
108
- <li>* Minor Bug Fixes</li>
 
 
 
 
 
 
109
  </ul>
110
  </div>
111
  <div id="mlw_quiz_requested" style="display: none;">
@@ -122,7 +131,6 @@ function mlw_generate_about_page()
122
  <li>More Social Media Integration</li>
123
  <li>Show Question Amount On Pagination</li>
124
  <li>Required Questions</li>
125
- <li>Duplicate Question</li>
126
  <li>Allow Quiz To Not Show Start Page</li>
127
  <li>Progress Bar For Timer</li>
128
  <li>Ability To Redirect User Instead Of Showing Results Page</li>
@@ -134,7 +142,9 @@ function mlw_generate_about_page()
134
  <li>Enhanced Leaderboard</li>
135
  <li>Different Social Media Sharing Text For Different Social Media</li>
136
  <li>Ability To Highlight Incorrect Answers</li>
137
- <li>Delete Multiple Results</li>
 
 
138
  </ul>
139
  </div>
140
  </div>
89
  <div class="mlw_qmn_icon_wrap">Version <?php echo $mlw_quiz_version; ?></div>
90
  <h2 class="nav-tab-wrapper">
91
  <a href="javascript:mlw_qmn_setTab(1);" id="mlw_qmn_tab_1" class="nav-tab nav-tab-active">
92
+ What&#8217;s New In 3.3</a>
93
  <a href="javascript:mlw_qmn_setTab(2);" id="mlw_qmn_tab_2" class="nav-tab">
94
  Changelog For <?php echo $mlw_quiz_version; ?> </a>
95
  <a href="javascript:mlw_qmn_setTab(3);" id="mlw_qmn_tab_3" class="nav-tab">
96
  Requested Features</a>
97
  </h2>
98
  <div id="mlw_quiz_what_new">
99
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Duplicate Questions With Quizzes</h2>
100
+ <p style="text-align: center;">You can now duplicate your questions with your quizzes when duplicating!</p>
101
+ <br />
102
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Question Type</h2>
103
+ <p style="text-align: center;">You can now use the new Horizontal Multiple Response type to have your multiple reponse check boxes go horizontally instead of vertically.</p>
104
  <br />
105
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Our Premium Add-Ons!</h2>
106
  <p style="text-align: center;">We have several new premium add-ons in our WordPress Store: MailPoet Integration (subscribes users to your MailPoet list), MailChimp Integration (subscribes users to your Mailchimp list), Export Results (exports your quiz results), Extra Shortcodes (gives you extra shortcodes to use), User Dashboard (allow users to see the results from all the quizzes they have taken), and Advertisement Be Gone (gets rid of blue-border ads). Visit our <a href="http://mylocalwebstop.com/shop/">WordPress Store</a> for details! </p>
107
  </div>
108
  <div id="mlw_quiz_changelog" style="display: none;">
109
+ <h3><?php echo $mlw_quiz_version; ?> (October 15, 2014)</h3>
110
  <ul>
111
+ <li>* Added Horizontal Multiple Response Question Type</li>
112
+ <li>* Added Ability To Duplicate Questions When Duplicate Quizzes</li>
113
+ <li>* Added Last Modified Column To Table On Quizzes Page</li>
114
+ <li>* Fixed Number Question Type Grading Bug</li>
115
+ <li>* Fixed Missing theme_selected Column Installation Bug</li>
116
+ <li>* Fixed Missing theme_selected Column Duplication Bug</li>
117
+ <li>* Fixed Numerous Small Bugs</li>
118
  </ul>
119
  </div>
120
  <div id="mlw_quiz_requested" style="display: none;">
131
  <li>More Social Media Integration</li>
132
  <li>Show Question Amount On Pagination</li>
133
  <li>Required Questions</li>
 
134
  <li>Allow Quiz To Not Show Start Page</li>
135
  <li>Progress Bar For Timer</li>
136
  <li>Ability To Redirect User Instead Of Showing Results Page</li>
142
  <li>Enhanced Leaderboard</li>
143
  <li>Different Social Media Sharing Text For Different Social Media</li>
144
  <li>Ability To Highlight Incorrect Answers</li>
145
+ <li>Set Default Question Type</li>
146
+ <li>Show Pop-Up When Clicking Submit</li>
147
+ <li>Conditional Continuation To Next Quiz</li>
148
  </ul>
149
  </div>
150
  </div>
includes/mlw_quiz.php CHANGED
@@ -583,13 +583,38 @@ function mlw_quiz_shortcode($atts)
583
  $mlw_answer_total++;
584
  if ($mlw_qmn_answer_each[0] != "")
585
  {
586
- $mlw_display .= "<input type='hidden' name='question".$mlw_question->question_id."' value='This value doesn't matter' />";
587
  $mlw_display .= "<input type='checkbox' name='question".$mlw_question->question_id."_".$mlw_answer_total."' id='question".$mlw_question->question_id."_".$mlw_answer_total."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> <label for='question".$mlw_question->question_id."_".$mlw_answer_total."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."</label>";
588
  $mlw_display .= "<br />";
589
  }
590
  }
591
  }
592
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
  elseif ($mlw_question->question_type == 1)
594
  {
595
  $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
@@ -928,7 +953,7 @@ function mlw_quiz_shortcode($atts)
928
  }
929
  }
930
  }
931
- elseif ( $mlw_question->question_type == 3 || $mlw_question->question_type == 5)
932
  {
933
  if (isset($_POST["question".$mlw_question->question_id]))
934
  {
@@ -951,7 +976,7 @@ function mlw_quiz_shortcode($atts)
951
  }
952
  }
953
  }
954
- elseif ( $mlw_question->question_type == 4 )
955
  {
956
  $mlw_qmn_user_correct_answers = 0;
957
  $mlw_qmn_total_correct_answers = 0;
583
  $mlw_answer_total++;
584
  if ($mlw_qmn_answer_each[0] != "")
585
  {
586
+ $mlw_display .= "<input type='hidden' name='question".$mlw_question->question_id."' value='This value does not matter' />";
587
  $mlw_display .= "<input type='checkbox' name='question".$mlw_question->question_id."_".$mlw_answer_total."' id='question".$mlw_question->question_id."_".$mlw_answer_total."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> <label for='question".$mlw_question->question_id."_".$mlw_answer_total."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."</label>";
588
  $mlw_display .= "<br />";
589
  }
590
  }
591
  }
592
  }
593
+ elseif ($mlw_question->question_type == 10)
594
+ {
595
+ $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
596
+ $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
597
+ if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
598
+ $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
599
+ $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id];
600
+ if (is_array($mlw_qmn_answer_array))
601
+ {
602
+ if ($mlw_quiz_options->randomness_order == 2)
603
+ {
604
+ shuffle($mlw_qmn_answer_array);
605
+ }
606
+ $mlw_answer_total = 0;
607
+ foreach($mlw_qmn_answer_array as $mlw_qmn_answer_each)
608
+ {
609
+ $mlw_answer_total++;
610
+ if ($mlw_qmn_answer_each[0] != "")
611
+ {
612
+ $mlw_display .= "<input type='hidden' name='question".$mlw_question->question_id."' value='This value does not matter' />";
613
+ $mlw_display .= "<span class='mlw_horizontal_multiple'><input type='checkbox' name='question".$mlw_question->question_id."_".$mlw_answer_total."' id='question".$mlw_question->question_id."_".$mlw_answer_total."' value='".esc_attr($mlw_qmn_answer_each[0])."' /> <label for='question".$mlw_question->question_id."_".$mlw_answer_total."'>".htmlspecialchars_decode($mlw_qmn_answer_each[0], ENT_QUOTES)."&nbsp;</label></span>";
614
+ }
615
+ }
616
+ }
617
+ }
618
  elseif ($mlw_question->question_type == 1)
619
  {
620
  $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
953
  }
954
  }
955
  }
956
+ elseif ( $mlw_question->question_type == 3 || $mlw_question->question_type == 5 || $mlw_question->question_type == 7)
957
  {
958
  if (isset($_POST["question".$mlw_question->question_id]))
959
  {
976
  }
977
  }
978
  }
979
+ elseif ( $mlw_question->question_type == 4 || $mlw_question->question_type == 10)
980
  {
981
  $mlw_qmn_user_correct_answers = 0;
982
  $mlw_qmn_total_correct_answers = 0;
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, question_numbering, quiz_settings, 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,7 +162,107 @@ 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, 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;
@@ -180,7 +280,73 @@ function mlw_generate_quiz_admin()
180
  {
181
  $mlw_qmn_error_code = '0011';
182
  $mlw_qmn_isQueryError = true;
183
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  }
185
 
186
  //Retrieve list of quizzes
@@ -199,7 +365,7 @@ function mlw_generate_quiz_admin()
199
  $mlw_qmn_quiz_begin = 0;
200
  }
201
  $mlw_qmn_quiz_left = $mlw_qmn_quiz_count - ($mlw_qmn_quiz_page * $mlw_qmn_table_limit);
202
- $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT quiz_id, quiz_name, quiz_views, quiz_taken
203
  FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted='0'
204
  ORDER BY quiz_id DESC LIMIT %d, %d", $mlw_qmn_quiz_begin, $mlw_qmn_table_limit ) );
205
  ?>
@@ -317,12 +483,6 @@ function mlw_generate_quiz_admin()
317
  document.getElementById("duplicate_quiz_id"). value = id;
318
  }
319
  </script>
320
- <style>
321
- label {
322
- display: inline-block;
323
- width: 5em;
324
- }
325
- </style>
326
  <style type="text/css">
327
  div.mlw_quiz_options input[type='text'] {
328
  border-color:#000000;
@@ -396,6 +556,7 @@ function mlw_generate_quiz_admin()
396
  $quotes_list .= "<td><span style='font-size:16px;'>[mlw_quizmaster_leaderboard mlw_quiz=".$mlw_quiz_info->quiz_id."]</span></td>";
397
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_views . "</span></td>";
398
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_taken ."</span></td>";
 
399
  $quotes_list .= "</tr>";
400
  }
401
 
@@ -431,6 +592,7 @@ function mlw_generate_quiz_admin()
431
  <th>Leaderboard Shortcode</th>
432
  <th>Quiz Views</th>
433
  <th>Quiz Taken</th>
 
434
  </tr></thead>";
435
  $display .= "<tbody id=\"the-list\">{$quotes_list}</tbody>";
436
  $display .= "<tfoot><tr>
@@ -440,6 +602,7 @@ function mlw_generate_quiz_admin()
440
  <th>Leaderboard Shortcode</th>
441
  <th>Quiz Views</th>
442
  <th>Quiz Taken</th>
 
443
  </tr></tfoot>";
444
  $display .= "</table>";
445
  echo $display;
@@ -498,14 +661,14 @@ function mlw_generate_quiz_admin()
498
 
499
  <!--Duplicate Quiz Dialog-->
500
  <div id="duplicate_dialog" title="Duplicate Quiz" style="display:none;">
501
- <h3>This will create a new quiz with the same settings as <span id="duplicate_quiz_name"></span>. </h3><br />
502
- <p>This does not currently duplicate the questions, only the options, templates, settings, etc...</p>
503
  <form action='' method='post'>
504
- Name Of New Quiz:
505
- <input type="text" id="duplicate_new_quiz_name" name="duplicate_new_quiz_name" />
506
- <input type="hidden" id="duplicate_quiz_id" name="duplicate_quiz_id" />
507
- <input type='hidden' name='duplicate_quiz' value='confirmation' />
508
- <input type="submit" class="button-primary" value="Duplicate" />
 
509
  </form>
510
  </div>
511
 
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_settings, theme_selected, last_activity, 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, '', 'default', '".date("Y-m-d H:i:s")."', 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->insert(
166
+ $table_name,
167
+ array(
168
+ 'quiz_name' => $mlw_duplicate_quiz_name,
169
+ 'message_before' => $mlw_qmn_duplicate_data->message_before,
170
+ 'message_after' => $mlw_qmn_duplicate_data->message_after,
171
+ 'message_comment' => $mlw_qmn_duplicate_data->message_comment,
172
+ 'message_end_template' => $mlw_qmn_duplicate_data->message_end_template,
173
+ 'user_email_template' => $mlw_qmn_duplicate_data->user_email_template,
174
+ 'admin_email_template' => $mlw_qmn_duplicate_data->admin_email_template,
175
+ 'submit_button_text' => $mlw_qmn_duplicate_data->submit_button_text,
176
+ 'name_field_text' => $mlw_qmn_duplicate_data->name_field_text,
177
+ 'business_field_text' => $mlw_qmn_duplicate_data->business_field_text,
178
+ 'email_field_text' => $mlw_qmn_duplicate_data->email_field_text,
179
+ 'phone_field_text' => $mlw_qmn_duplicate_data->phone_field_text,
180
+ 'comment_field_text' => $mlw_qmn_duplicate_data->comment_field_text,
181
+ 'email_from_text' => $mlw_qmn_duplicate_data->email_from_text,
182
+ 'question_answer_template' => $mlw_qmn_duplicate_data->question_answer_template,
183
+ 'leaderboard_template' => $mlw_qmn_duplicate_data->leaderboard_template,
184
+ 'system' => $mlw_qmn_duplicate_data->system,
185
+ 'randomness_order' => $mlw_qmn_duplicate_data->randomness_order,
186
+ 'loggedin_user_contact' => $mlw_qmn_duplicate_data->loggedin_user_contact,
187
+ 'show_score' => $mlw_qmn_duplicate_data->show_score,
188
+ 'send_user_email' => $mlw_qmn_duplicate_data->send_user_email,
189
+ 'send_admin_email' => $mlw_qmn_duplicate_data->send_admin_email,
190
+ 'contact_info_location' => $mlw_qmn_duplicate_data->contact_info_location,
191
+ 'user_name' => $mlw_qmn_duplicate_data->user_name,
192
+ 'user_comp' => $mlw_qmn_duplicate_data->user_comp,
193
+ 'user_email' => $mlw_qmn_duplicate_data->user_email,
194
+ 'user_phone' => $mlw_qmn_duplicate_data->user_phone,
195
+ 'admin_email' => get_option( 'admin_email', 'Enter email' ),
196
+ 'comment_section' => $mlw_qmn_duplicate_data->comment_section,
197
+ 'question_from_total' => $mlw_qmn_duplicate_data->question_from_total,
198
+ 'total_user_tries' => $mlw_qmn_duplicate_data->total_user_tries,
199
+ 'total_user_tries_text' => $mlw_qmn_duplicate_data->total_user_tries_text,
200
+ 'certificate_template' => $mlw_qmn_duplicate_data->certificate_template,
201
+ 'social_media' => $mlw_qmn_duplicate_data->social_media,
202
+ 'social_media_text' => $mlw_qmn_duplicate_data->social_media_text,
203
+ 'pagination' => $mlw_qmn_duplicate_data->pagination,
204
+ 'pagination_text' => $mlw_qmn_duplicate_data->pagination_text,
205
+ 'timer_limit' => $mlw_qmn_duplicate_data->timer_limit,
206
+ 'quiz_stye' => $mlw_qmn_duplicate_data->quiz_stye,
207
+ 'question_numbering' => $mlw_qmn_duplicate_data->question_numbering,
208
+ 'quiz_settings' => $mlw_qmn_duplicate_data->quiz_settings,
209
+ 'theme_selected' => $mlw_qmn_duplicate_data->theme_selected,
210
+ 'last_activity' => date("Y-m-d H:i:s"),
211
+ 'quiz_views' => 0,
212
+ 'quiz_taken' => 0,
213
+ 'deleted' => 0
214
+ ),
215
+ array(
216
+ '%s',
217
+ '%s',
218
+ '%s',
219
+ '%s',
220
+ '%s',
221
+ '%s',
222
+ '%s',
223
+ '%s',
224
+ '%s',
225
+ '%s',
226
+ '%s',
227
+ '%s',
228
+ '%s',
229
+ '%s',
230
+ '%s',
231
+ '%s',
232
+ '%d',
233
+ '%d',
234
+ '%d',
235
+ '%d',
236
+ '%d',
237
+ '%d',
238
+ '%d',
239
+ '%d',
240
+ '%d',
241
+ '%d',
242
+ '%d',
243
+ '%s',
244
+ '%d',
245
+ '%d',
246
+ '%d',
247
+ '%s',
248
+ '%s',
249
+ '%d',
250
+ '%s',
251
+ '%d',
252
+ '%s',
253
+ '%d',
254
+ '%s',
255
+ '%d',
256
+ '%s',
257
+ '%s',
258
+ '%s',
259
+ '%d',
260
+ '%d',
261
+ '%d',
262
+ )
263
+ );
264
+ $mlw_new_id = $wpdb->insert_id;
265
+ //$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)" );
266
  if ($results != false)
267
  {
268
  $hasDuplicatedQuiz = true;
280
  {
281
  $mlw_qmn_error_code = '0011';
282
  $mlw_qmn_isQueryError = true;
283
+ }
284
+ if (isset($_POST["duplicate_questions"]))
285
+ {
286
+ $table_name = $wpdb->prefix."mlw_questions";
287
+ $mlw_current_questions = $wpdb->get_results("SELECT * FROM ".$table_name." WHERE deleted=0 AND quiz_id=".$mlw_duplicate_quiz_id);
288
+ foreach ($mlw_current_questions as $mlw_question)
289
+ {
290
+ $question_results = $wpdb->insert(
291
+ $table_name,
292
+ array(
293
+ 'quiz_id' => $mlw_new_id,
294
+ 'question_name' => $mlw_question->question_name,
295
+ 'answer_array' => $mlw_question->answer_array,
296
+ 'answer_one' => $mlw_question->answer_one,
297
+ 'answer_one_points' => $mlw_question->answer_one_points,
298
+ 'answer_two' => $mlw_question->answer_two,
299
+ 'answer_two_points' => $mlw_question->answer_two_points,
300
+ 'answer_three' => $mlw_question->answer_three,
301
+ 'answer_three_points' => $mlw_question->answer_three_points,
302
+ 'answer_four' => $mlw_question->answer_four,
303
+ 'answer_four_points' => $mlw_question->answer_four_points,
304
+ 'answer_five' => $mlw_question->answer_five,
305
+ 'answer_five_points' => $mlw_question->answer_five_points,
306
+ 'answer_six' => $mlw_question->answer_six,
307
+ 'answer_six_points' => $mlw_question->answer_six_points,
308
+ 'correct_answer' => $mlw_question->correct_answer,
309
+ 'question_answer_info' => $mlw_question->question_answer_info,
310
+ 'comments' => $mlw_question->comments,
311
+ 'hints' => $mlw_question->hints,
312
+ 'question_order' => $mlw_question->question_order,
313
+ 'question_type' => $mlw_question->question_type,
314
+ 'question_settings' => $mlw_question->question_settings,
315
+ 'deleted' => 0
316
+ ),
317
+ array(
318
+ '%d',
319
+ '%s',
320
+ '%s',
321
+ '%s',
322
+ '%d',
323
+ '%s',
324
+ '%d',
325
+ '%s',
326
+ '%d',
327
+ '%s',
328
+ '%d',
329
+ '%s',
330
+ '%d',
331
+ '%s',
332
+ '%d',
333
+ '%d',
334
+ '%s',
335
+ '%d',
336
+ '%s',
337
+ '%d',
338
+ '%d',
339
+ '%s',
340
+ '%d'
341
+ )
342
+ );
343
+ if ($question_results == false)
344
+ {
345
+ $mlw_qmn_error_code = '0011';
346
+ $mlw_qmn_isQueryError = true;
347
+ }
348
+ }
349
+ }
350
  }
351
 
352
  //Retrieve list of quizzes
365
  $mlw_qmn_quiz_begin = 0;
366
  }
367
  $mlw_qmn_quiz_left = $mlw_qmn_quiz_count - ($mlw_qmn_quiz_page * $mlw_qmn_table_limit);
368
+ $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT quiz_id, quiz_name, quiz_views, quiz_taken, last_activity
369
  FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted='0'
370
  ORDER BY quiz_id DESC LIMIT %d, %d", $mlw_qmn_quiz_begin, $mlw_qmn_table_limit ) );
371
  ?>
483
  document.getElementById("duplicate_quiz_id"). value = id;
484
  }
485
  </script>
 
 
 
 
 
 
486
  <style type="text/css">
487
  div.mlw_quiz_options input[type='text'] {
488
  border-color:#000000;
556
  $quotes_list .= "<td><span style='font-size:16px;'>[mlw_quizmaster_leaderboard mlw_quiz=".$mlw_quiz_info->quiz_id."]</span></td>";
557
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_views . "</span></td>";
558
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_taken ."</span></td>";
559
+ $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->last_activity ."</span></td>";
560
  $quotes_list .= "</tr>";
561
  }
562
 
592
  <th>Leaderboard Shortcode</th>
593
  <th>Quiz Views</th>
594
  <th>Quiz Taken</th>
595
+ <th>Last Modified</th>
596
  </tr></thead>";
597
  $display .= "<tbody id=\"the-list\">{$quotes_list}</tbody>";
598
  $display .= "<tfoot><tr>
602
  <th>Leaderboard Shortcode</th>
603
  <th>Quiz Views</th>
604
  <th>Quiz Taken</th>
605
+ <th>Last Modified</th>
606
  </tr></tfoot>";
607
  $display .= "</table>";
608
  echo $display;
661
 
662
  <!--Duplicate Quiz Dialog-->
663
  <div id="duplicate_dialog" title="Duplicate Quiz" style="display:none;">
664
+ <h3>Create a new quiz with the same settings as <span id="duplicate_quiz_name"></span>. </h3><br />
 
665
  <form action='' method='post'>
666
+ <label for="duplicate_questions">Duplicate questions with quiz</label><input type="checkbox" name="duplicate_questions" id="duplicate_questions"/><br />
667
+ <br />
668
+ <label for="duplicate_new_quiz_name">Name Of New Quiz:</label><input type="text" id="duplicate_new_quiz_name" name="duplicate_new_quiz_name" /><br />
669
+ <input type="hidden" id="duplicate_quiz_id" name="duplicate_quiz_id" />
670
+ <input type='hidden' name='duplicate_quiz' value='confirmation' />
671
+ <input type="submit" class="button-primary" value="Duplicate" />
672
  </form>
673
  </div>
674
 
includes/mlw_quiz_install.php CHANGED
@@ -97,6 +97,10 @@ function mlw_quiz_activate()
97
  question_numbering INT NOT NULL,
98
 
99
  quiz_settings TEXT NOT NULL,
 
 
 
 
100
 
101
  quiz_views INT NOT NULL,
102
 
97
  question_numbering INT NOT NULL,
98
 
99
  quiz_settings TEXT NOT NULL,
100
+
101
+ theme_selected TEXT NOT NULL,
102
+
103
+ last_activity DATETIME NOT NULL,
104
 
105
  quiz_views INT NOT NULL,
106
 
includes/mlw_quiz_options.php CHANGED
@@ -318,7 +318,7 @@ function mlw_generate_quiz_options()
318
  $mlw_question_answer_template = htmlspecialchars($_POST["mlw_quiz_question_answer_template"], ENT_QUOTES);
319
  $quiz_id = $_POST["quiz_id"];
320
 
321
- $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."', total_user_tries_text='".$mlw_user_tries_text."', social_media_text='".$mlw_qmn_social_medi_text."', pagination_text='".$mlw_qmn_pagination_field."' WHERE quiz_id=".$quiz_id;
322
  $results = $wpdb->query( $update );
323
  if ($results != false)
324
  {
@@ -369,7 +369,7 @@ function mlw_generate_quiz_options()
369
  $mlw_qmn_loggedin_contact = $_POST["loggedin_user_contact"];
370
  $quiz_id = $_POST["quiz_id"];
371
 
372
- $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;
373
  $results = $wpdb->query( $update );
374
  if ($results != false)
375
  {
@@ -401,7 +401,7 @@ function mlw_generate_quiz_options()
401
  ///Variables for save leaderboard options form
402
  $mlw_leaderboard_template = $_POST["mlw_quiz_leaderboard_template"];
403
  $mlw_leaderboard_quiz_id = $_POST["leaderboard_quiz_id"];
404
- $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET leaderboard_template='".$mlw_leaderboard_template."' WHERE quiz_id=".$mlw_leaderboard_quiz_id;
405
  $results = $wpdb->query( $update );
406
  if ($results != false)
407
  {
@@ -439,7 +439,7 @@ function mlw_generate_quiz_options()
439
  $mlw_certificate = array($mlw_certificate_title, $mlw_certificate_text, $mlw_certificate_logo, $mlw_certificate_background, $mlw_enable_certificates);
440
  $mlw_certificate_serialized = serialize($mlw_certificate);
441
 
442
- $mlw_certificate_sql_results = $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "mlw_quizzes SET certificate_template=%s WHERE quiz_id=%d", $mlw_certificate_serialized, $mlw_certificate_id ) );
443
 
444
 
445
  if ($mlw_certificate_sql_results != false)
@@ -490,7 +490,7 @@ function mlw_generate_quiz_options()
490
  $mlw_qmn_email_array = serialize($mlw_qmn_email_array);
491
  }
492
  //Update message_after with new array then check to see if worked
493
- $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET user_email_template='%s' WHERE quiz_id=%d", $mlw_qmn_email_array, $mlw_qmn_add_email_id ) );
494
  if ($mlw_new_email_results != false)
495
  {
496
  $mlw_hasAddedEmail = true;
@@ -532,7 +532,7 @@ function mlw_generate_quiz_options()
532
  $i++;
533
  }
534
  $mlw_qmn_new_email_array = serialize($mlw_qmn_new_email_array);
535
- $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET user_email_template='%s', admin_email_template='%s' WHERE quiz_id=%d", $mlw_qmn_new_email_array, $mlw_qmn_admin_email, $mlw_qmn_email_id ) );
536
  if ($mlw_new_email_results != false)
537
  {
538
  $mlw_hasSavedEmail = true;
@@ -581,7 +581,7 @@ function mlw_generate_quiz_options()
581
  }
582
 
583
  //Update message_after with new array then check to see if worked
584
- $mlw_new_landing_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET message_after=%s WHERE quiz_id=%d", $mlw_qmn_landing_array, $mlw_qmn_landing_id ) );
585
  if ($mlw_new_landing_results != false)
586
  {
587
  $mlw_hasAddedLanding = true;
@@ -622,7 +622,7 @@ function mlw_generate_quiz_options()
622
  $i++;
623
  }
624
  $mlw_qmn_new_landing_array = serialize($mlw_qmn_new_landing_array);
625
- $mlw_new_landing_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET message_after='%s' WHERE quiz_id=%d", $mlw_qmn_new_landing_array, $mlw_qmn_landing_id ) );
626
  if ($mlw_new_landing_results != false)
627
  {
628
  $mlw_hasSavedLanding = true;
@@ -655,7 +655,7 @@ function mlw_generate_quiz_options()
655
  $mlw_qmn_style = htmlspecialchars(stripslashes($_POST["quiz_css"]), ENT_QUOTES);
656
 
657
  //Save the new css
658
- $mlw_save_stle_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET quiz_stye='%s', theme_selected='%s' WHERE quiz_id=%d", $mlw_qmn_style, $mlw_qmn_theme, $mlw_qmn_style_id ) );
659
  if ($mlw_save_stle_results != false)
660
  {
661
  $mlw_hasSavedStyle = true;
@@ -686,7 +686,7 @@ function mlw_generate_quiz_options()
686
  {
687
  //Variables from reset stats form
688
  $mlw_reset_stats_quiz_id = $_POST["mlw_reset_quiz_id"];
689
- $mlw_reset_update_sql = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views=0, quiz_taken=0 WHERE quiz_id=".$mlw_reset_stats_quiz_id;
690
  $mlw_reset_sql_results = $wpdb->query( $mlw_reset_update_sql );
691
  if ($mlw_reset_sql_results != false)
692
  {
@@ -1260,6 +1260,9 @@ function mlw_generate_quiz_options()
1260
  case 9:
1261
  $mlw_question_type_text = "Captcha";
1262
  break;
 
 
 
1263
  default:
1264
  $mlw_question_type_text = "Error Code ";
1265
  }
@@ -1355,6 +1358,7 @@ function mlw_generate_quiz_options()
1355
  <option value="3" <?php if ($mlw_question_info->question_type == 3) { echo 'selected="selected"'; } ?>>Open Answer (Text Input)</option>
1356
  <option value="5" <?php if ($mlw_question_info->question_type == 5) { echo 'selected="selected"'; } ?>>Open Answer (Large Text Input)</option>
1357
  <option value="4" <?php if ($mlw_question_info->question_type == 4) { echo 'selected="selected"'; } ?>>Multiple Response (Checkbox)</option>
 
1358
  <option value="6" <?php if ($mlw_question_info->question_type == 6) { echo 'selected="selected"'; } ?>>Text Block</option>
1359
  <option value="7" <?php if ($mlw_question_info->question_type == 7) { echo 'selected="selected"'; } ?>>Number</option>
1360
  <option value="8" <?php if ($mlw_question_info->question_type == 8) { echo 'selected="selected"'; } ?>>Accept</option>
@@ -1388,6 +1392,7 @@ function mlw_generate_quiz_options()
1388
  </div></td>
1389
  </tr>
1390
  </table>
 
1391
  <input type="hidden" name="question_<?php echo $mlw_question_info->question_id; ?>_answer_total" id="question_<?php echo $mlw_question_info->question_id; ?>_answer_total" value="<?php echo $mlw_answer_total; ?>" />
1392
  <p class='submit'><input type='submit' class='button-primary' value='Edit Question' /></p>
1393
  </form>
@@ -1510,6 +1515,7 @@ function mlw_generate_quiz_options()
1510
  <option value="3">Open Answer (Text Input)</option>
1511
  <option value="5">Open Answer (Large Text Input)</option>
1512
  <option value="4">Multiple Response (Checkbox)</option>
 
1513
  <option value="6">Text Block</option>
1514
  <option value="7">Number</option>
1515
  <option value="8">Accept</option>
@@ -1543,6 +1549,7 @@ function mlw_generate_quiz_options()
1543
  </div></td>
1544
  </tr>
1545
  </table>
 
1546
  <input type="hidden" name="new_question_answer_total" id="new_question_answer_total" value="<?php echo $mlw_answer_total; ?>" />
1547
  <?php
1548
  echo "<p class='submit'><input type='submit' class='button-primary' value='Create Question' /></p>";
@@ -2328,6 +2335,7 @@ function mlw_generate_quiz_options()
2328
  <p>The message displayed at end of quiz is a span with class 'mlw_qmn_message_end'</p>
2329
  <p>Each button shown for pagination (i.e Next/Previous) is wrapped in class 'mlw_qmn_quiz_link'</p>
2330
  <p>Timer is wrapped in class 'mlw_qmn_timer'</p>
 
2331
  <button id="save_styles_button" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
2332
 
2333
  <table class="form-table">
318
  $mlw_question_answer_template = htmlspecialchars($_POST["mlw_quiz_question_answer_template"], ENT_QUOTES);
319
  $quiz_id = $_POST["quiz_id"];
320
 
321
+ $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."', total_user_tries_text='".$mlw_user_tries_text."', social_media_text='".$mlw_qmn_social_medi_text."', pagination_text='".$mlw_qmn_pagination_field."', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=".$quiz_id;
322
  $results = $wpdb->query( $update );
323
  if ($results != false)
324
  {
369
  $mlw_qmn_loggedin_contact = $_POST["loggedin_user_contact"];
370
  $quiz_id = $_POST["quiz_id"];
371
 
372
+ $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.", last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=".$quiz_id;
373
  $results = $wpdb->query( $update );
374
  if ($results != false)
375
  {
401
  ///Variables for save leaderboard options form
402
  $mlw_leaderboard_template = $_POST["mlw_quiz_leaderboard_template"];
403
  $mlw_leaderboard_quiz_id = $_POST["leaderboard_quiz_id"];
404
+ $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET leaderboard_template='".$mlw_leaderboard_template."', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=".$mlw_leaderboard_quiz_id;
405
  $results = $wpdb->query( $update );
406
  if ($results != false)
407
  {
439
  $mlw_certificate = array($mlw_certificate_title, $mlw_certificate_text, $mlw_certificate_logo, $mlw_certificate_background, $mlw_enable_certificates);
440
  $mlw_certificate_serialized = serialize($mlw_certificate);
441
 
442
+ $mlw_certificate_sql_results = $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "mlw_quizzes SET certificate_template=%s, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_certificate_serialized, $mlw_certificate_id ) );
443
 
444
 
445
  if ($mlw_certificate_sql_results != false)
490
  $mlw_qmn_email_array = serialize($mlw_qmn_email_array);
491
  }
492
  //Update message_after with new array then check to see if worked
493
+ $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET user_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_email_array, $mlw_qmn_add_email_id ) );
494
  if ($mlw_new_email_results != false)
495
  {
496
  $mlw_hasAddedEmail = true;
532
  $i++;
533
  }
534
  $mlw_qmn_new_email_array = serialize($mlw_qmn_new_email_array);
535
+ $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET user_email_template='%s', admin_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_new_email_array, $mlw_qmn_admin_email, $mlw_qmn_email_id ) );
536
  if ($mlw_new_email_results != false)
537
  {
538
  $mlw_hasSavedEmail = true;
581
  }
582
 
583
  //Update message_after with new array then check to see if worked
584
+ $mlw_new_landing_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET message_after=%s, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_landing_array, $mlw_qmn_landing_id ) );
585
  if ($mlw_new_landing_results != false)
586
  {
587
  $mlw_hasAddedLanding = true;
622
  $i++;
623
  }
624
  $mlw_qmn_new_landing_array = serialize($mlw_qmn_new_landing_array);
625
+ $mlw_new_landing_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET message_after='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_new_landing_array, $mlw_qmn_landing_id ) );
626
  if ($mlw_new_landing_results != false)
627
  {
628
  $mlw_hasSavedLanding = true;
655
  $mlw_qmn_style = htmlspecialchars(stripslashes($_POST["quiz_css"]), ENT_QUOTES);
656
 
657
  //Save the new css
658
+ $mlw_save_stle_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET quiz_stye='%s', theme_selected='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_style, $mlw_qmn_theme, $mlw_qmn_style_id ) );
659
  if ($mlw_save_stle_results != false)
660
  {
661
  $mlw_hasSavedStyle = true;
686
  {
687
  //Variables from reset stats form
688
  $mlw_reset_stats_quiz_id = $_POST["mlw_reset_quiz_id"];
689
+ $mlw_reset_update_sql = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views=0, quiz_taken=0, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=".$mlw_reset_stats_quiz_id;
690
  $mlw_reset_sql_results = $wpdb->query( $mlw_reset_update_sql );
691
  if ($mlw_reset_sql_results != false)
692
  {
1260
  case 9:
1261
  $mlw_question_type_text = "Captcha";
1262
  break;
1263
+ case 10:
1264
+ $mlw_question_type_text = "Horizontal Multiple Response";
1265
+ break;
1266
  default:
1267
  $mlw_question_type_text = "Error Code ";
1268
  }
1358
  <option value="3" <?php if ($mlw_question_info->question_type == 3) { echo 'selected="selected"'; } ?>>Open Answer (Text Input)</option>
1359
  <option value="5" <?php if ($mlw_question_info->question_type == 5) { echo 'selected="selected"'; } ?>>Open Answer (Large Text Input)</option>
1360
  <option value="4" <?php if ($mlw_question_info->question_type == 4) { echo 'selected="selected"'; } ?>>Multiple Response (Checkbox)</option>
1361
+ <option value="10" <?php if ($mlw_question_info->question_type == 10) { echo 'selected="selected"'; } ?>>Horizontal Multiple Response (Checkbox)</option>
1362
  <option value="6" <?php if ($mlw_question_info->question_type == 6) { echo 'selected="selected"'; } ?>>Text Block</option>
1363
  <option value="7" <?php if ($mlw_question_info->question_type == 7) { echo 'selected="selected"'; } ?>>Number</option>
1364
  <option value="8" <?php if ($mlw_question_info->question_type == 8) { echo 'selected="selected"'; } ?>>Accept</option>
1392
  </div></td>
1393
  </tr>
1394
  </table>
1395
+ <p> *Required currently only works on open answer, number, and captcha question types</p>
1396
  <input type="hidden" name="question_<?php echo $mlw_question_info->question_id; ?>_answer_total" id="question_<?php echo $mlw_question_info->question_id; ?>_answer_total" value="<?php echo $mlw_answer_total; ?>" />
1397
  <p class='submit'><input type='submit' class='button-primary' value='Edit Question' /></p>
1398
  </form>
1515
  <option value="3">Open Answer (Text Input)</option>
1516
  <option value="5">Open Answer (Large Text Input)</option>
1517
  <option value="4">Multiple Response (Checkbox)</option>
1518
+ <option value="10">Horizontal Multiple Response (Checkbox)</option>
1519
  <option value="6">Text Block</option>
1520
  <option value="7">Number</option>
1521
  <option value="8">Accept</option>
1549
  </div></td>
1550
  </tr>
1551
  </table>
1552
+ <p> *Required currently only works on open answer, number, and captcha question types</p>
1553
  <input type="hidden" name="new_question_answer_total" id="new_question_answer_total" value="<?php echo $mlw_answer_total; ?>" />
1554
  <?php
1555
  echo "<p class='submit'><input type='submit' class='button-primary' value='Create Question' /></p>";
2335
  <p>The message displayed at end of quiz is a span with class 'mlw_qmn_message_end'</p>
2336
  <p>Each button shown for pagination (i.e Next/Previous) is wrapped in class 'mlw_qmn_quiz_link'</p>
2337
  <p>Timer is wrapped in class 'mlw_qmn_timer'</p>
2338
+ <p>Each horizontal multiple response is wrapped in a span with class 'mlw_horizontal_multiple'</p>
2339
  <button id="save_styles_button" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
2340
 
2341
  <table class="form-table">
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 = "3.2.2";
10
  if ( ! get_option('mlw_quiz_master_version'))
11
  {
12
  add_option('mlw_quiz_master_version' , $data);
@@ -245,6 +245,15 @@ function mlw_quiz_update()
245
  $results = $wpdb->query( $update_sql );
246
  }
247
 
 
 
 
 
 
 
 
 
 
248
 
249
  global $wpdb;
250
  $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 = "3.3.1";
10
  if ( ! get_option('mlw_quiz_master_version'))
11
  {
12
  add_option('mlw_quiz_master_version' , $data);
245
  $results = $wpdb->query( $update_sql );
246
  }
247
 
248
+ //Update 3.3.1
249
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'last_activity'") != "last_activity")
250
+ {
251
+ $sql = "ALTER TABLE ".$table_name." ADD last_activity DATETIME NOT NULL AFTER theme_selected";
252
+ $results = $wpdb->query( $sql );
253
+ $update_sql = "UPDATE ".$table_name." SET last_activity='".date("Y-m-d H:i:s")."'";
254
+ $results = $wpdb->query( $update_sql );
255
+ }
256
+
257
 
258
  global $wpdb;
259
  $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: 3.2.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: 3.3.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, exam, survey, contact, form, email, answer, question
5
  Requires at least: 3.8.1
6
  Tested up to: 4.0
7
- Stable tag: 3.2.2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
@@ -20,7 +20,7 @@ Each of your quizzes can have **unlimited** questions and each of those question
20
  All the text your users see can be **customized**. Everything from the text blocks throughout the quiz to the submit button.
21
 
22
  = Different Types Of Questions =
23
- You can have **multiple choice** (radio buttons), **true and false**, **open answer** question, **drop down**, and **multiple response** (checkboxes). More types are being supported in future updates!
24
 
25
  = Mulitple Landing Pages For Each Quiz =
26
  Each quiz can have **unlimited** results pages that can be customized with your text. Show different results pages based on the users score!
@@ -104,6 +104,15 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
104
 
105
  == Changelog ==
106
 
 
 
 
 
 
 
 
 
 
107
  = 3.2.2 (October 4, 2014) =
108
  * Minor Bug Fixes
109
 
@@ -507,6 +516,9 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
507
 
508
  == Upgrade Notice ==
509
 
 
 
 
510
  = 3.2.1 =
511
  Upgrade for new Captcha question types!
512
 
4
  Tags: quiz, test, score, exam, survey, contact, form, email, answer, question
5
  Requires at least: 3.8.1
6
  Tested up to: 4.0
7
+ Stable tag: 3.3.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.
20
  All the text your users see can be **customized**. Everything from the text blocks throughout the quiz to the submit button.
21
 
22
  = Different Types Of Questions =
23
+ You can have **multiple choice** (radio buttons), **true and false**, **open answer** question, **drop down**, **multiple response** (checkboxes), **number**, **captcha**, and **accept**. More types are being supported in future updates!
24
 
25
  = Mulitple Landing Pages For Each Quiz =
26
  Each quiz can have **unlimited** results pages that can be customized with your text. Show different results pages based on the users score!
104
 
105
  == Changelog ==
106
 
107
+ = 3.3.1 (October 15, 2014) =
108
+ * Added Horizontal Multiple Response Question Type
109
+ * Added Ability To Duplicate Questions When Duplicate Quizzes
110
+ * Added Last Modified Column To Table On Quizzes Page
111
+ * Fixed Number Question Type Grading Bug
112
+ * Fixed Missing theme_selected Column Installation Bug
113
+ * Fixed Missing theme_selected Column Duplication Bug
114
+ * Fixed Numerous Small Bugs
115
+
116
  = 3.2.2 (October 4, 2014) =
117
  * Minor Bug Fixes
118
 
516
 
517
  == Upgrade Notice ==
518
 
519
+ = 3.3.1 =
520
+ Upgrade for new Horizontal Multiple Response question type and to be able to duplicate questions when duplicating quizzes. Also, fixes several major and minor bugs.
521
+
522
  = 3.2.1 =
523
  Upgrade for new Captcha question types!
524