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

Version Description

Upgrade to set up your quizzes to randomize the questions

Download this release

Release Info

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

Code changes from version 0.9.3 to 0.9.4

includes/mlw_dashboard.php CHANGED
@@ -63,7 +63,7 @@ function mlw_generate_quiz_dashboard(){
63
  <h2>Quiz Master Next Dashboard<a id="opener" href="">(?)</a></h2>
64
 
65
  <h3>Version <?php echo $mlw_quiz_version; ?></h3>
66
- <p>Thank you for trying out my new plugin. I hope you find it beneficial to your website. If it is, please consider donating from the support page. Or, please consider rating this plugin <a href="http://wordpress.org/support/view/plugin-reviews/quiz-master-next">here</a>.</p>
67
 
68
  <div style="float:left; width:60%;" class="inner-sidebar1">
69
  <?php do_meta_boxes('quiz_wpss','advanced',''); ?>
@@ -322,9 +322,17 @@ function mlw_dashboard_box_five()
322
  $mlw_quiz_taken_last_month = $wpdb->get_results($sql);
323
  $mlw_quiz_taken_last_month = $wpdb->num_rows;
324
 
 
 
 
 
 
 
 
 
325
  ?>
326
  <div>
327
- <span class="inlinesparkline"><?php echo $mlw_quiz_taken_last_month.",".$mlw_quiz_taken_this_month; ?></span>
328
  </div>
329
  <?php
330
  }
63
  <h2>Quiz Master Next Dashboard<a id="opener" href="">(?)</a></h2>
64
 
65
  <h3>Version <?php echo $mlw_quiz_version; ?></h3>
66
+ <p>Thank you for trying out this plugin. I hope you find it beneficial to your website. If it is, please consider donating from the support page. Or, please consider rating this plugin <a href="http://wordpress.org/support/view/plugin-reviews/quiz-master-next">here</a>.</p>
67
 
68
  <div style="float:left; width:60%;" class="inner-sidebar1">
69
  <?php do_meta_boxes('quiz_wpss','advanced',''); ?>
322
  $mlw_quiz_taken_last_month = $wpdb->get_results($sql);
323
  $mlw_quiz_taken_last_month = $wpdb->num_rows;
324
 
325
+ $mlw_two_month_first = mktime(0, 0, 0, date("m") , date("d")-60, date("Y"));
326
+ $mlw_two_month_first = date("Y-m-d", $mlw_two_month_first);
327
+ $mlw_two_month_last = mktime(0, 0, 0, date("m") , date("d")-31, date("Y"));
328
+ $mlw_two_month_last = date("Y-m-d", $mlw_two_month_last);
329
+ $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_two_month_first." 00:00:00' AND '".$mlw_two_month_last." 23:59:59')";
330
+ $mlw_quiz_taken_two_month = $wpdb->get_results($sql);
331
+ $mlw_quiz_taken_two_month = $wpdb->num_rows;
332
+
333
  ?>
334
  <div>
335
+ <span class="inlinesparkline"><?php echo $mlw_quiz_taken_two_month.",".$mlw_quiz_taken_last_month.",".$mlw_quiz_taken_this_month; ?></span>
336
  </div>
337
  <?php
338
  }
includes/mlw_main_page.php CHANGED
@@ -159,13 +159,13 @@ function quiz_wpss_mrt_meta_box2()
159
  <div>
160
  <table width='100%'>
161
  <tr>
162
- <td align='left'>0.9.3 (January 14, 2014)</td>
163
  </tr>
164
  <tr>
165
- <td align='left'>* Logged-In Users Now See Contact Information</td>
166
  </tr>
167
  <tr>
168
- <td align='left'>* Bug Fixes</td>
169
  </tr>
170
  </table>
171
  </div>
159
  <div>
160
  <table width='100%'>
161
  <tr>
162
+ <td align='left'>0.9.4 (January 16, 2014)</td>
163
  </tr>
164
  <tr>
165
+ <td align='left'>* Added Ability To Randomly Order Questions</td>
166
  </tr>
167
  <tr>
168
+ <td align='left'>* Updated Monthly Stat Widget</td>
169
  </tr>
170
  </table>
171
  </div>
includes/mlw_quiz.php CHANGED
@@ -29,7 +29,15 @@ function mlw_quiz_shortcode($atts)
29
 
30
 
31
  //Load questions
32
- $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' ORDER BY question_order ASC";
 
 
 
 
 
 
 
 
33
  $mlw_questions = $wpdb->get_results($sql);
34
 
35
 
29
 
30
 
31
  //Load questions
32
+ $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' ";
33
+ if ($mlw_quiz_options->randomness_order == 0)
34
+ {
35
+ $sql .= "ORDER BY question_order ASC";
36
+ }
37
+ if ($mlw_quiz_options->randomness_order == 1)
38
+ {
39
+ $sql .= "ORDER BY rand()";
40
+ }
41
  $mlw_questions = $wpdb->get_results($sql);
42
 
43
 
includes/mlw_quiz_admin.php CHANGED
@@ -26,8 +26,8 @@ function mlw_generate_quiz_admin()
26
  4. %FOURTH_PLACE_NAME%-%FOURTH_PLACE_SCORE%<br />
27
  5. %FIFTH_PLACE_NAME%-%FIFTH_PLACE_SCORE%<br />";
28
  $insert = "INSERT INTO " . $table_name .
29
- "(quiz_id, quiz_name, message_before, message_after, message_comment, user_email_template, admin_email_template, submit_button_text, name_field_text, business_field_text, email_field_text, phone_field_text, comment_field_text, leaderboard_template, system, show_score, send_user_email, send_admin_email, user_name, user_comp, user_email, user_phone, admin_email, comment_section, quiz_views, quiz_taken, deleted) " .
30
- "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', '".$mlw_leaderboard_default."', 0, 0, 0, 0, 0, 0, 0, 0, '".get_option( 'admin_email', 'Enter email' )."', 0, 0, 0, 0)";
31
  $results = $wpdb->query( $insert );
32
  $hasCreatedQuiz = true;
33
 
26
  4. %FOURTH_PLACE_NAME%-%FOURTH_PLACE_SCORE%<br />
27
  5. %FIFTH_PLACE_NAME%-%FIFTH_PLACE_SCORE%<br />";
28
  $insert = "INSERT INTO " . $table_name .
29
+ "(quiz_id, quiz_name, message_before, message_after, message_comment, user_email_template, admin_email_template, submit_button_text, name_field_text, business_field_text, email_field_text, phone_field_text, comment_field_text, leaderboard_template, system, randomness_order, show_score, send_user_email, send_admin_email, user_name, user_comp, user_email, user_phone, admin_email, comment_section, quiz_views, quiz_taken, deleted) " .
30
+ "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', '".$mlw_leaderboard_default."', 0, 0, 0, 0, 0, 0, 0, 0, 0, '".get_option( 'admin_email', 'Enter email' )."', 0, 0, 0, 0)";
31
  $results = $wpdb->query( $insert );
32
  $hasCreatedQuiz = true;
33
 
includes/mlw_quiz_install.php CHANGED
@@ -43,6 +43,8 @@ function mlw_quiz_activate()
43
  leaderboard_template TEXT NOT NULL,
44
 
45
  system INT NOT NULL,
 
 
46
 
47
  show_score INT NOT NULL,
48
 
43
  leaderboard_template TEXT NOT NULL,
44
 
45
  system INT NOT NULL,
46
+
47
+ randomness_order INT NOT NULL,
48
 
49
  show_score INT NOT NULL,
50
 
includes/mlw_quiz_options.php CHANGED
@@ -174,6 +174,7 @@ function mlw_generate_quiz_options()
174
  //Variables for save options form
175
  $save_options_success = $_POST["save_options"];
176
  $mlw_system = $_POST["system"];
 
177
  $mlw_send_user_email = $_POST["sendUserEmail"];
178
  $mlw_send_admin_email = $_POST["sendAdminEmail"];
179
  $mlw_user_name = $_POST["userName"];
@@ -187,7 +188,7 @@ function mlw_generate_quiz_options()
187
  if ($save_options_success == "confirmation")
188
  {
189
  $quiz_id = $_POST["quiz_id"];
190
- $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET system='".$mlw_system."', send_user_email='".$mlw_send_user_email."', send_admin_email='".$mlw_send_admin_email."', 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."' WHERE quiz_id=".$quiz_id;
191
  $results = $wpdb->query( $update );
192
  $hasUpdatedOptions = true;
193
 
@@ -210,7 +211,7 @@ function mlw_generate_quiz_options()
210
  $mlw_leaderboard_quiz_id = $_POST["leaderboard_quiz_id"];
211
  $mlw_leaderboard_saved = $_POST["save_leaderboard_options"];
212
 
213
- ///Submit saved options into database
214
  if ($mlw_leaderboard_saved == "confirmation")
215
  {
216
  $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET leaderboard_template='".$mlw_leaderboard_template."' WHERE quiz_id=".$mlw_leaderboard_quiz_id;
@@ -353,6 +354,9 @@ function mlw_generate_quiz_options()
353
  $j(function() {
354
  $j( "#system" ).buttonset();
355
  });
 
 
 
356
  $j(function() {
357
  $j( "#sendUserEmail" ).buttonset();
358
  });
@@ -1034,6 +1038,13 @@ function mlw_generate_quiz_options()
1034
  <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>
1035
  </div></td>
1036
  </tr>
 
 
 
 
 
 
 
1037
  <tr valign="top">
1038
  <th scope="row"><label for="userName">Should we ask for user's name?</label></th>
1039
  <td><div id="userName">
174
  //Variables for save options form
175
  $save_options_success = $_POST["save_options"];
176
  $mlw_system = $_POST["system"];
177
+ $mlw_randomness_order = $_POST["randomness_order"];
178
  $mlw_send_user_email = $_POST["sendUserEmail"];
179
  $mlw_send_admin_email = $_POST["sendAdminEmail"];
180
  $mlw_user_name = $_POST["userName"];
188
  if ($save_options_success == "confirmation")
189
  {
190
  $quiz_id = $_POST["quiz_id"];
191
+ $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET system='".$mlw_system."', send_user_email='".$mlw_send_user_email."', send_admin_email='".$mlw_send_admin_email."', 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."' WHERE quiz_id=".$quiz_id;
192
  $results = $wpdb->query( $update );
193
  $hasUpdatedOptions = true;
194
 
211
  $mlw_leaderboard_quiz_id = $_POST["leaderboard_quiz_id"];
212
  $mlw_leaderboard_saved = $_POST["save_leaderboard_options"];
213
 
214
+ ///Submit saved leaderboard template into database
215
  if ($mlw_leaderboard_saved == "confirmation")
216
  {
217
  $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET leaderboard_template='".$mlw_leaderboard_template."' WHERE quiz_id=".$mlw_leaderboard_quiz_id;
354
  $j(function() {
355
  $j( "#system" ).buttonset();
356
  });
357
+ $j(function() {
358
+ $j( "#randomness_order" ).buttonset();
359
+ });
360
  $j(function() {
361
  $j( "#sendUserEmail" ).buttonset();
362
  });
1038
  <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>
1039
  </div></td>
1040
  </tr>
1041
+ <tr valign="top">
1042
+ <th scope="row"><label for="randomness_order">Are the questions random? (Question Order will not apply if this is yes)</label></th>
1043
+ <td><div id="randomness_order">
1044
+ <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>
1045
+ <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>
1046
+ </div></td>
1047
+ </tr>
1048
  <tr valign="top">
1049
  <th scope="row"><label for="userName">Should we ask for user's name?</label></th>
1050
  <td><div id="userName">
includes/mlw_update.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  function mlw_quiz_update()
4
  {
5
- $data = "0.9.3";
6
  if ( ! get_option('mlw_quiz_master_version'))
7
  {
8
  add_option('mlw_quiz_master_version' , $data);
@@ -39,6 +39,15 @@ function mlw_quiz_update()
39
  $results = $wpdb->query( $update_sql );
40
  }
41
 
 
 
 
 
 
 
 
 
 
42
 
43
  global $wpdb;
44
  $table_name = $wpdb->prefix . "mlw_questions";
2
 
3
  function mlw_quiz_update()
4
  {
5
+ $data = "0.9.4";
6
  if ( ! get_option('mlw_quiz_master_version'))
7
  {
8
  add_option('mlw_quiz_master_version' , $data);
39
  $results = $wpdb->query( $update_sql );
40
  }
41
 
42
+ //Update 0.9.4
43
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'randomness_order'") != "randomness_order")
44
+ {
45
+ $sql = "ALTER TABLE ".$table_name." ADD randomness_order INT NOT NULL AFTER system";
46
+ $results = $wpdb->query( $sql );
47
+ $update_sql = "UPDATE ".$table_name." SET randomness_order=0";
48
+ $results = $wpdb->query( $update_sql );
49
+ }
50
+
51
 
52
  global $wpdb;
53
  $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: 0.9.3
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: 0.9.4
7
  Author: Frank Corso
8
  Author URI: http://www.mylocalwebstop.com/
9
  Plugin URI: http://www.mylocalwebstop.com/
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: fpcorso
3
  Tags: quiz, test, score, survey, contact
4
  Requires at least: 3.0.1
5
  Tested up to: 3.8
6
- Stable tag: 0.9.3
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
 
9
  Use this plugin to add multiple quizzes, tests, surveys, or contact forms to your website.
@@ -14,7 +14,7 @@ Use this plugin to add multiple quizzes, tests, and surveys to your website. Thi
14
 
15
  Features include:
16
 
17
- * Allows for Unlimited Quizzes, Tests, or Surveys
18
  * Allows for Unlimited Questions in each Quiz
19
  * Can ask for user's contact information
20
  * Can email user after taking the quiz
@@ -23,11 +23,15 @@ Features include:
23
  * Can enable comment boxes for each question and/or comment section at the end of the quiz
24
  * Can enable hints for questions
25
  * Saves the results after a user takes the quiz
26
- * Now saves the users answers and comments after taking the quiz
27
  * Features audit trail so admins can keep track of who adds, edits, or deletes quizzes and questions
28
  * Features useful statistics for how quizzes been taken
29
  * Create surveys by utilizing the comment boxes instead of answers
30
  * Create Contact Forms
 
 
 
 
31
 
32
  == Installation ==
33
 
@@ -36,8 +40,14 @@ Features include:
36
 
37
  == Frequently Asked Questions ==
38
 
 
 
 
 
 
 
39
  = I have an idea, how do I contact you? =
40
- Feel free to use the support option on the main page of the plugin or from the contact page at mylocalwebstop.com.
41
 
42
  == Screenshots ==
43
 
@@ -51,6 +61,10 @@ Feel free to use the support option on the main page of the plugin or from the c
51
 
52
  == Changelog ==
53
 
 
 
 
 
54
  = 0.9.3 (January 14, 2014) =
55
  * Logged-In Users Now See Contact Information
56
  * Minor Bug Fixes
@@ -181,6 +195,9 @@ Feel free to use the support option on the main page of the plugin or from the c
181
 
182
  == Upgrade Notice ==
183
 
 
 
 
184
  = 0.9.3 =
185
  Upgrade for minor bug fixes.
186
 
3
  Tags: quiz, test, score, survey, contact
4
  Requires at least: 3.0.1
5
  Tested up to: 3.8
6
+ Stable tag: 0.9.4
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
 
9
  Use this plugin to add multiple quizzes, tests, surveys, or contact forms to your website.
14
 
15
  Features include:
16
 
17
+ * Allows for Unlimited Quizzes, Tests, Surveys, Contact Forms, etc..
18
  * Allows for Unlimited Questions in each Quiz
19
  * Can ask for user's contact information
20
  * Can email user after taking the quiz
23
  * Can enable comment boxes for each question and/or comment section at the end of the quiz
24
  * Can enable hints for questions
25
  * Saves the results after a user takes the quiz
26
+ * Saves the users answers and comments after taking the quiz
27
  * Features audit trail so admins can keep track of who adds, edits, or deletes quizzes and questions
28
  * Features useful statistics for how quizzes been taken
29
  * Create surveys by utilizing the comment boxes instead of answers
30
  * Create Contact Forms
31
+ * Customize templates for landing page after the quiz has been taken
32
+ * Customize emails that are sent to users and admins
33
+ * Questions can be in predetermined order or random
34
+ * Leaderboards for every quiz
35
 
36
  == Installation ==
37
 
40
 
41
  == Frequently Asked Questions ==
42
 
43
+ = What does the option do on that page? =
44
+ On each page, there is a "?" next to the page title. Clicking on it will bring up a small help window that will assist you on that page.
45
+
46
+ = How do you use that feature? =
47
+ 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 support page to contact me and I will help you.
48
+
49
  = I have an idea, how do I contact you? =
50
+ Feel free to use the support page of the plugin or from the contact page at mylocalwebstop.com.
51
 
52
  == Screenshots ==
53
 
61
 
62
  == Changelog ==
63
 
64
+ = 0.9.4 (January 16, 2014) =
65
+ * Added Ability To Randomly Order Questions
66
+ * Updated Monthly Stat Widget
67
+
68
  = 0.9.3 (January 14, 2014) =
69
  * Logged-In Users Now See Contact Information
70
  * Minor Bug Fixes
195
 
196
  == Upgrade Notice ==
197
 
198
+ = 0.9.4 =
199
+ Upgrade to set up your quizzes to randomize the questions
200
+
201
  = 0.9.3 =
202
  Upgrade for minor bug fixes.
203