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

Version Description

Upgrade for several new features and bug fixes

Download this release

Release Info

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

Code changes from version 0.8.6 to 0.9

assets/screenshot-4.png CHANGED
Binary file
assets/screenshot-7.png ADDED
Binary file
includes/mlw_main_page.php CHANGED
@@ -159,10 +159,22 @@ function quiz_wpss_mrt_meta_box2()
159
  <div>
160
  <table width='100%'>
161
  <tr>
162
- <td align='left'>0.8.6 (January 2, 2013))</td>
163
  </tr>
164
  <tr>
165
- <td align='left'>* Minor Bug Fixes</td>
 
 
 
 
 
 
 
 
 
 
 
 
166
  </tr>
167
  </table>
168
  </div>
159
  <div>
160
  <table width='100%'>
161
  <tr>
162
+ <td align='left'>0.9 (January 5, 2014)</td>
163
  </tr>
164
  <tr>
165
+ <td align='left'>* Added Ability To Edit Quiz Name</td>
166
+ </tr>
167
+ <tr>
168
+ <td align='left'>* Added Ability To Display Question As Drop Down</td>
169
+ </tr>
170
+ <tr>
171
+ <td align='left'>* Added Quiz Name To Completion Email's Subject</td>
172
+ </tr>
173
+ <tr>
174
+ <td align='left'>* Minor Design Changes To Quiz Options Page</td>
175
+ </tr>
176
+ <tr>
177
+ <td align='left'>* Design Changes To Quiz</td>
178
  </tr>
179
  </table>
180
  </div>
includes/mlw_quiz.php CHANGED
@@ -140,77 +140,130 @@ function mlw_quiz_shortcode($atts)
140
  $mlw_display .= "<br />";
141
  $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
142
  $mlw_display .= "<form name='quizForm' action='" . $PHP_SELF . "' method='post' onsubmit='return mlw_validateForm()' >";
143
- $mlw_display .= "<table>";
144
- $mlw_display .= "<thead>";
145
 
146
  //See if the site wants to ask for any contact information, then ask for it
147
  if ($mlw_quiz_options->user_name != 2)
148
  {
149
- $mlw_display .= "<tr valign='top'>";
150
- $mlw_display .= "<th scope='row'>".$mlw_quiz_options->name_field_text."</th>";
151
- $mlw_display .= "<td><input type='text' name='mlwUserName' value='' /></td>";
152
- $mlw_display .= "</tr>";
153
 
154
  }
155
  if ($mlw_quiz_options->user_comp != 2)
156
  {
157
- $mlw_display .= "<tr valign='top'>";
158
- $mlw_display .= "<th scope='row'>".$mlw_quiz_options->business_field_text."</th>";
159
- $mlw_display .= "<td><input type='text' name='mlwUserComp' value='' /></td>";
160
- $mlw_display .= "</tr>";
161
 
162
  }
163
  if ($mlw_quiz_options->user_email != 2)
164
  {
165
- $mlw_display .= "<tr valign='top'>";
166
- $mlw_display .= "<th scope='row'>".$mlw_quiz_options->email_field_text."</th>";
167
- $mlw_display .= "<td><input type='text' name='mlwUserEmail' value='' /></td>";
168
- $mlw_display .= "</tr>";
169
 
170
  }
171
  if ($mlw_quiz_options->user_phone != 2)
172
  {
173
- $mlw_display .= "<tr valign='top'>";
174
- $mlw_display .= "<th scope='row'>".$mlw_quiz_options->phone_field_text."</th>";
175
- $mlw_display .= "<td><input type='text' name='mlwUserPhone' value='' /></td>";
176
- $mlw_display .= "</tr>";
177
 
178
  }
179
- $mlw_display .= "</thead>";
180
- $mlw_display .= "</table>";
181
  $mlw_display .= "<br />";
182
 
183
  //Display the questions
184
  foreach($mlw_questions as $mlw_question) {
185
- $mlw_display .= "<h4>".$mlw_question->question_name."</h4>";
186
- if ($mlw_question->answer_one != "")
187
  {
188
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='1' />".$mlw_question->answer_one;
189
- $mlw_display .= "<br />";
190
- }
191
- if ($mlw_question->answer_two != "")
192
- {
193
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='2' />".$mlw_question->answer_two;
194
- $mlw_display .= "<br />";
195
- }
196
- if ($mlw_question->answer_three != "")
197
- {
198
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='3' />".$mlw_question->answer_three;
199
- $mlw_display .= "<br />";
200
- }
201
- if ($mlw_question->answer_four != "")
202
- {
203
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='4' />".$mlw_question->answer_four;
204
- $mlw_display .= "<br />";
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  }
206
- if ($mlw_question->answer_five != "")
207
  {
208
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='5' />".$mlw_question->answer_five;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  $mlw_display .= "<br />";
210
  }
211
- if ($mlw_question->answer_six != "")
212
  {
213
- $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='6' />".$mlw_question->answer_six;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  $mlw_display .= "<br />";
215
  }
216
  if ($mlw_question->comments == 0)
@@ -365,7 +418,7 @@ function mlw_quiz_shortcode($atts)
365
  $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
366
  $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
367
  $mlw_message = str_replace( "%COMMENT_SECTION%" , $_POST["mlwQuizComments"], $mlw_message);
368
- wp_mail($mlw_user_email, "Quiz Results", $mlw_message);
369
  }
370
  }
371
 
@@ -386,7 +439,7 @@ function mlw_quiz_shortcode($atts)
386
  $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
387
  $mlw_message = str_replace( "%COMMENT_SECTION%" , $_POST["mlwQuizComments"], $mlw_message);
388
  $mlw_message .= " This email was generated by the Quiz Master Next script by Frank Corso";
389
- wp_mail($mlw_quiz_options->admin_email, "Quiz Results", $mlw_message);
390
  }
391
 
392
  //Save the results into database
140
  $mlw_display .= "<br />";
141
  $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
142
  $mlw_display .= "<form name='quizForm' action='" . $PHP_SELF . "' method='post' onsubmit='return mlw_validateForm()' >";
 
 
143
 
144
  //See if the site wants to ask for any contact information, then ask for it
145
  if ($mlw_quiz_options->user_name != 2)
146
  {
147
+ $mlw_display .= "<span style='font-weight:bold;';>".$mlw_quiz_options->name_field_text."</span><br />";
148
+ $mlw_display .= "<input type='text' name='mlwUserName' value='' />";
149
+ $mlw_display .= "<br /><br />";
 
150
 
151
  }
152
  if ($mlw_quiz_options->user_comp != 2)
153
  {
154
+ $mlw_display .= "<span style='font-weight:bold;';>".$mlw_quiz_options->business_field_text."</span><br />";
155
+ $mlw_display .= "<input type='text' name='mlwUserComp' value='' />";
156
+ $mlw_display .= "<br /><br />";
 
157
 
158
  }
159
  if ($mlw_quiz_options->user_email != 2)
160
  {
161
+ $mlw_display .= "<span style='font-weight:bold;';>".$mlw_quiz_options->email_field_text."</span><br />";
162
+ $mlw_display .= "<input type='text' name='mlwUserEmail' value='' />";
163
+ $mlw_display .= "<br /><br />";
 
164
 
165
  }
166
  if ($mlw_quiz_options->user_phone != 2)
167
  {
168
+ $mlw_display .= "<span style='font-weight:bold;';>".$mlw_quiz_options->phone_field_text."</span><br />";
169
+ $mlw_display .= "<input type='text' name='mlwUserPhone' value='' />";
170
+ $mlw_display .= "<br /><br />";
 
171
 
172
  }
 
 
173
  $mlw_display .= "<br />";
174
 
175
  //Display the questions
176
  foreach($mlw_questions as $mlw_question) {
177
+ $mlw_display .= "<span style='font-weight:bold;';>".$mlw_question->question_name."</span><br />";
178
+ if ($mlw_question->question_type == 0)
179
  {
180
+ if ($mlw_question->answer_one != "")
181
+ {
182
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='1' />".$mlw_question->answer_one;
183
+ $mlw_display .= "<br />";
184
+ }
185
+ if ($mlw_question->answer_two != "")
186
+ {
187
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='2' />".$mlw_question->answer_two;
188
+ $mlw_display .= "<br />";
189
+ }
190
+ if ($mlw_question->answer_three != "")
191
+ {
192
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='3' />".$mlw_question->answer_three;
193
+ $mlw_display .= "<br />";
194
+ }
195
+ if ($mlw_question->answer_four != "")
196
+ {
197
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='4' />".$mlw_question->answer_four;
198
+ $mlw_display .= "<br />";
199
+ }
200
+ if ($mlw_question->answer_five != "")
201
+ {
202
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='5' />".$mlw_question->answer_five;
203
+ $mlw_display .= "<br />";
204
+ }
205
+ if ($mlw_question->answer_six != "")
206
+ {
207
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='6' />".$mlw_question->answer_six;
208
+ $mlw_display .= "<br />";
209
+ }
210
  }
211
+ elseif ($mlw_question->question_type == 1)
212
  {
213
+ if ($mlw_question->answer_one != "")
214
+ {
215
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='1' />".$mlw_question->answer_one;
216
+ }
217
+ if ($mlw_question->answer_two != "")
218
+ {
219
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='2' />".$mlw_question->answer_two;
220
+ }
221
+ if ($mlw_question->answer_three != "")
222
+ {
223
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='3' />".$mlw_question->answer_three;
224
+ }
225
+ if ($mlw_question->answer_four != "")
226
+ {
227
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='4' />".$mlw_question->answer_four;
228
+ }
229
+ if ($mlw_question->answer_five != "")
230
+ {
231
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='5' />".$mlw_question->answer_five;
232
+ }
233
+ if ($mlw_question->answer_six != "")
234
+ {
235
+ $mlw_display .= "<input type='radio' name='question".$mlw_question->question_id."' value='6' />".$mlw_question->answer_six;
236
+ }
237
  $mlw_display .= "<br />";
238
  }
239
+ else
240
  {
241
+ $mlw_display .= "<select name='question".$mlw_question->question_id."'>";
242
+ if ($mlw_question->answer_one != "")
243
+ {
244
+ $mlw_display .= "<option value='1'>".$mlw_question->answer_one."</option>";
245
+ }
246
+ if ($mlw_question->answer_two != "")
247
+ {
248
+ $mlw_display .= "<option value='2'>".$mlw_question->answer_two."</option>";
249
+ }
250
+ if ($mlw_question->answer_three != "")
251
+ {
252
+ $mlw_display .= "<option value='3'>".$mlw_question->answer_three."</option>";
253
+ }
254
+ if ($mlw_question->answer_four != "")
255
+ {
256
+ $mlw_display .= "<option value='4'>".$mlw_question->answer_four."</option>";
257
+ }
258
+ if ($mlw_question->answer_five != "")
259
+ {
260
+ $mlw_display .= "<option value='5'>".$mlw_question->answer_five."</option>";
261
+ }
262
+ if ($mlw_question->answer_six != "")
263
+ {
264
+ $mlw_display .= "<option value='6'>".$mlw_question->answer_six."</option>";
265
+ }
266
+ $mlw_display .= "</select>";
267
  $mlw_display .= "<br />";
268
  }
269
  if ($mlw_question->comments == 0)
418
  $mlw_message = str_replace( "%USER_EMAIL%" , $mlw_user_email, $mlw_message);
419
  $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
420
  $mlw_message = str_replace( "%COMMENT_SECTION%" , $_POST["mlwQuizComments"], $mlw_message);
421
+ wp_mail($mlw_user_email, "Quiz Results For ".$mlw_quiz_options->quiz_name, $mlw_message);
422
  }
423
  }
424
 
439
  $mlw_message = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message);
440
  $mlw_message = str_replace( "%COMMENT_SECTION%" , $_POST["mlwQuizComments"], $mlw_message);
441
  $mlw_message .= " This email was generated by the Quiz Master Next script by Frank Corso";
442
+ wp_mail($mlw_quiz_options->admin_email, "Quiz Results For ".$mlw_quiz_options->quiz_name, $mlw_message);
443
  }
444
 
445
  //Save the results into database
includes/mlw_quiz_admin.php CHANGED
@@ -60,9 +60,29 @@ function mlw_generate_quiz_admin()
60
  $results = $wpdb->query( $insert );
61
  }
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
 
64
  global $wpdb;
65
-
66
  $sql = "SELECT quiz_id, quiz_name, quiz_views, quiz_taken
67
  FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted='0'";
68
  $sql .= "ORDER BY quiz_id DESC";
@@ -139,6 +159,21 @@ function mlw_generate_quiz_admin()
139
  idHidden.value = id;
140
  idHiddenName = quizName;
141
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  </script>
143
  <style>
144
  label {
@@ -176,6 +211,16 @@ function mlw_generate_quiz_admin()
176
  <?php
177
  }
178
  ?>
 
 
 
 
 
 
 
 
 
 
179
 
180
  <?php
181
  $quotes_list = "";
@@ -185,7 +230,7 @@ function mlw_generate_quiz_admin()
185
  else $alternate = " class=\"alternate\"";
186
  $quotes_list .= "<tr{$alternate}>";
187
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_id . "</span></td>";
188
- $quotes_list .= "<td class='post-title column-title'><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_name ."</span><div><span style='color:green;font-size:12px;'><a href='admin.php?page=mlw_quiz_options&&quiz_id=".$mlw_quiz_info->quiz_id."'>Edit</a> | <a onclick=\"deleteQuiz('".$mlw_quiz_info->quiz_id."','".$mlw_quiz_info->quiz_name."')\" href='#'>Delete</a> | <a href='admin.php?page=mlw_quiz_results&&quiz_id=".$mlw_quiz_info->quiz_id."'>Results</a></span></div></td>";
189
  $quotes_list .= "<td><span style='font-size:16px;'>[mlw_quizmaster quiz=".$mlw_quiz_info->quiz_id."]</span></td>";
190
  $quotes_list .= "<td><span style='font-size:16px;'>[mlw_quizmaster_leaderboard mlw_quiz=".$mlw_quiz_info->quiz_id."]</span></td>";
191
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_views . "</span></td>";
@@ -242,7 +287,17 @@ function mlw_generate_quiz_admin()
242
  echo "</form>";
243
  ?>
244
  </div>
245
-
 
 
 
 
 
 
 
 
 
 
246
  <div id="delete_dialog" title="Delete Quiz?" style="display:none;">
247
  <h3><b>Are you sure you want to delete Quiz <span id="delete_quiz_id"></span>?</b></h3>
248
  <?php
60
  $results = $wpdb->query( $insert );
61
  }
62
 
63
+ //Edit Quiz Name
64
+ if ($_POST["quiz_name_editted"] == "confirmation")
65
+ {
66
+ $mlw_edit_quiz_id = $_POST["edit_quiz_id"];
67
+ $mlw_edit_quiz_name = $_POST["edit_quiz_name"];
68
+ $mlw_update_quiz_table = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_name='".$mlw_edit_quiz_name."' WHERE quiz_id=".$mlw_edit_quiz_id;
69
+ $results = $wpdb->query( $mlw_update_quiz_table );
70
+ $hasUpdatedQuizName = true;
71
+
72
+ //Insert Action Into Audit Trail
73
+ global $current_user;
74
+ get_currentuserinfo();
75
+ $table_name = $wpdb->prefix . "mlw_qm_audit_trail";
76
+ $insert = "INSERT INTO " . $table_name .
77
+ "(trail_id, action_user, action, time) " .
78
+ "VALUES (NULL , '" . $current_user->display_name . "' , 'Quiz Name Has Been Edited: ".$mlw_edit_quiz_name."' , '" . date("h:i:s A m/d/Y") . "')";
79
+ $results = $wpdb->query( $insert );
80
+
81
+
82
+ }
83
 
84
+ //Retrieve list of quizzes
85
  global $wpdb;
 
86
  $sql = "SELECT quiz_id, quiz_name, quiz_views, quiz_taken
87
  FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted='0'";
88
  $sql .= "ORDER BY quiz_id DESC";
159
  idHidden.value = id;
160
  idHiddenName = quizName;
161
  };
162
+ function editQuizName(id, quizName){
163
+ $j("#edit_dialog").dialog({
164
+ autoOpen: false,
165
+ show: 'blind',
166
+ hide: 'explode',
167
+ buttons: {
168
+ Cancel: function() {
169
+ $j(this).dialog('close');
170
+ }
171
+ }
172
+ });
173
+ $j("#edit_dialog").dialog('open');
174
+ document.getElementById("edit_quiz_name").value = quizName;
175
+ document.getElementById("edit_quiz_id"). value = id;
176
+ }
177
  </script>
178
  <style>
179
  label {
211
  <?php
212
  }
213
  ?>
214
+ <?php if ($hasUpdatedQuizName)
215
+ {
216
+ ?>
217
+ <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
218
+ <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
219
+ <strong>Hey!</strong> The quiz name has been updated.</p>
220
+ </div>
221
+ <?php
222
+ }
223
+ ?>
224
 
225
  <?php
226
  $quotes_list = "";
230
  else $alternate = " class=\"alternate\"";
231
  $quotes_list .= "<tr{$alternate}>";
232
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_id . "</span></td>";
233
+ $quotes_list .= "<td class='post-title column-title'><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_name ." </span><span style='color:green;font-size:12px;'><a onclick=\"editQuizName('".$mlw_quiz_info->quiz_id."','".$mlw_quiz_info->quiz_name."')\" href='#'>(Edit Name)</a></span><div><span style='color:green;font-size:12px;'><a href='admin.php?page=mlw_quiz_options&&quiz_id=".$mlw_quiz_info->quiz_id."'>Edit</a> | <a onclick=\"deleteQuiz('".$mlw_quiz_info->quiz_id."','".$mlw_quiz_info->quiz_name."')\" href='#'>Delete</a> | <a href='admin.php?page=mlw_quiz_results&&quiz_id=".$mlw_quiz_info->quiz_id."'>Results</a></span></div></td>";
234
  $quotes_list .= "<td><span style='font-size:16px;'>[mlw_quizmaster quiz=".$mlw_quiz_info->quiz_id."]</span></td>";
235
  $quotes_list .= "<td><span style='font-size:16px;'>[mlw_quizmaster_leaderboard mlw_quiz=".$mlw_quiz_info->quiz_id."]</span></td>";
236
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_views . "</span></td>";
287
  echo "</form>";
288
  ?>
289
  </div>
290
+ <div id="edit_dialog" title="Edit Quiz Name" style="display:none;">
291
+ <h3>Quiz Name:</h3><br />
292
+ <?php
293
+ echo "<form action='" . $PHP_SELF . "' method='post'>";
294
+ ?>
295
+ <input type="text" id="edit_quiz_name" name="edit_quiz_name" />
296
+ <input type="hidden" id="edit_quiz_id" name="edit_quiz_id" />
297
+ <input type='hidden' name='quiz_name_editted' value='confirmation' />
298
+ <input type="submit" class="button-primary" value="Edit" />
299
+ </form>
300
+ </div>
301
  <div id="delete_dialog" title="Delete Quiz?" style="display:none;">
302
  <h3><b>Are you sure you want to delete Quiz <span id="delete_quiz_id"></span>?</b></h3>
303
  <?php
includes/mlw_quiz_install.php CHANGED
@@ -122,6 +122,8 @@ function mlw_quiz_activate()
122
  hints TEXT NOT NULL,
123
 
124
  question_order INT NOT NULL,
 
 
125
 
126
  deleted INT NOT NULL,
127
 
122
  hints TEXT NOT NULL,
123
 
124
  question_order INT NOT NULL,
125
+
126
+ question_type INT NOT NULL,
127
 
128
  deleted INT NOT NULL,
129
 
includes/mlw_quiz_options.php CHANGED
@@ -33,6 +33,7 @@ function mlw_generate_quiz_options()
33
  $answer_six = htmlspecialchars($_POST["answer_six"], ENT_QUOTES);
34
  $answer_six_points = $_POST["answer_six_points"];
35
  $correct_answer = $_POST["correct_answer"];
 
36
  $comments = $_POST["comments"];
37
  $hint = $_POST["hint"];
38
 
@@ -53,6 +54,7 @@ function mlw_generate_quiz_options()
53
  $edit_answer_six_points = $_POST["edit_answer_six_points"];
54
  $edit_correct_answer = $_POST["edit_correct_answer"];
55
  $mlw_edit_question_id = $_POST["edit_question_id"];
 
56
  $edit_comments = $_POST["edit_comments"];
57
  $edit_hint = $_POST["edit_hint"];
58
  $edit_question_order = $_POST["edit_question_order"];
@@ -61,7 +63,7 @@ function mlw_generate_quiz_options()
61
  if ($edit_question_success == "confirmation")
62
  {
63
  $quiz_id = $_POST["quiz_id"];
64
- $update = "UPDATE " . $wpdb->prefix . "mlw_questions" . " SET question_name='".$edit_question_name."', answer_one='".$edit_answer_one."', answer_one_points='".$edit_answer_one_points."', answer_two='".$edit_answer_two."', answer_two_points='".$edit_answer_two_points."', answer_three='".$edit_answer_three."', answer_three_points='".$edit_answer_three_points."', answer_four='".$edit_answer_four."', answer_four_points='".$edit_answer_four_points."', answer_five='".$edit_answer_five."', answer_five_points='".$edit_answer_five_points."', answer_six='".$edit_answer_six."', answer_six_points='".$edit_answer_six_points."', correct_answer='".$edit_correct_answer."', comments='".$edit_comments."', hints='".$edit_hint."', question_order='".$edit_question_order."' WHERE question_id=".$mlw_edit_question_id;
65
  $results = $wpdb->query( $update );
66
  $hasUpdatedQuestion = true;
67
 
@@ -71,7 +73,7 @@ function mlw_generate_quiz_options()
71
  $table_name = $wpdb->prefix . "mlw_qm_audit_trail";
72
  $insert = "INSERT INTO " . $table_name .
73
  "(trail_id, action_user, action, time) " .
74
- "VALUES (NULL , '" . $current_user->display_name . "' , 'Question Has Been Edited: ".$edit_question_name."' , '" . date("m/d/Y") . "')";
75
  $results = $wpdb->query( $insert );
76
  }
77
 
@@ -103,7 +105,7 @@ function mlw_generate_quiz_options()
103
  $quiz_id = $_POST["quiz_id"];
104
  $table_name = $wpdb->prefix . "mlw_questions";
105
  $insert = "INSERT INTO " . $table_name .
106
- " (question_id, quiz_id, question_name, answer_one, answer_one_points, answer_two, answer_two_points, answer_three, answer_three_points, answer_four, answer_four_points, answer_five, answer_five_points, answer_six, answer_six_points, correct_answer, comments, hints, question_order, deleted) VALUES (NULL , ".$quiz_id.", '" . $question_name . "' , '" . $answer_one . "', ".$answer_one_points.", '" . $answer_two . "', ".$answer_two_points.", '" . $answer_three . "', ".$answer_three_points.", '" . $answer_four . "', ".$answer_four_points.", '" . $answer_five . "', ".$answer_five_points.", '" . $answer_six . "', ".$answer_six_points.", ".$correct_answer.", '".$comments."', '".$hint."', 1, 0)";
107
  $results = $wpdb->query( $insert );
108
  $hasCreatedQuestion = true;
109
 
@@ -374,10 +376,11 @@ function mlw_generate_quiz_options()
374
  idText.innerHTML = id;
375
  idHidden.value = id;
376
  };
377
- function editQuestion(id, question, answerOne, answerOnePoints, answerTwo, answerTwoPoints, answerThree, answerThreePoints, answerFour, answerFourPoints, answerFive, answerFivePoints, answerSix, answerSixPoints, correctAnswer, comments, hint, question_order){
378
  $j("#edit_question_dialog").dialog({
379
  autoOpen: false,
380
  show: 'blind',
 
381
  hide: 'explode',
382
  buttons: {
383
  Cancel: function() {
@@ -409,17 +412,14 @@ function mlw_generate_quiz_options()
409
  if (correctAnswer == 4) document.getElementById("edit_correct_four").checked = true;
410
  if (correctAnswer == 5) document.getElementById("edit_correct_five").checked = true;
411
  if (correctAnswer == 6) document.getElementById("edit_correct_six").checked = true;
 
 
 
412
  if (comments == 0) document.getElementById("editCommentRadio1").checked = true;
413
  if (comments == 1) document.getElementById("editCommentRadio2").checked = true;
414
  if (comments == 2) document.getElementById("editCommentRadio3").checked = true;
415
  };
416
  </script>
417
- <style>
418
- label {
419
- display: inline-block;
420
- width: 5em;
421
- }
422
- </style>
423
  <style type="text/css">
424
  div.mlw_quiz_options input[type='text'] {
425
  border-color:#000000;
@@ -499,7 +499,7 @@ function mlw_generate_quiz_options()
499
  else $alternate = " class=\"alternate\"";
500
  $question_list .= "<tr{$alternate}>";
501
  $question_list .= "<td><span style='font-size:16px;'>" . $mlw_question_info->question_order . "</span></td>";
502
- $question_list .= "<td class='post-title column-title'><span style='font-size:16px;'>" . $mlw_question_info->question_name ."</span><div><span style='color:green;font-size:12px;'><a onclick=\"editQuestion('".$mlw_question_info->question_id."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->question_name, ENT_QUOTES))."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_one, ENT_QUOTES))."','".$mlw_question_info->answer_one_points."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_two, ENT_QUOTES))."','".$mlw_question_info->answer_two_points."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_three, ENT_QUOTES))."','".$mlw_question_info->answer_three_points."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_four, ENT_QUOTES))."','".$mlw_question_info->answer_four_points."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_five, ENT_QUOTES))."','".$mlw_question_info->answer_five_points."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_six, ENT_QUOTES))."','".$mlw_question_info->answer_six_points."','".$mlw_question_info->correct_answer."','".$mlw_question_info->comments."','".$mlw_question_info->hints."', '".$mlw_question_info->question_order."')\" href='#'>Edit</a> | <a onclick=\"deleteQuestion('".$mlw_question_info->question_id."')\" href='#'>Delete</a></span></div></td>";
503
  $question_list .= "</tr>";
504
  }
505
 
@@ -627,6 +627,12 @@ function mlw_generate_quiz_options()
627
  <tr><td>&nbsp;</td></tr>
628
  <tr><td>&nbsp;</td></tr>
629
  <tr valign="top">
 
 
 
 
 
 
630
  <th scope="row">Comment Field?</th>
631
  <td><input type="radio" id="commentsRadio1" name="comments" checked="checked" value=0 /><label for="commentsRadio1">Small Text Field</label></td>
632
  <td><input type="radio" id="commentsRadio3" name="comments" value=2 /><label for="commentsRadio3">Large Text Field</label></td>
@@ -764,6 +770,12 @@ function mlw_generate_quiz_options()
764
  <tr><td>&nbsp;</td></tr>
765
  <tr><td>&nbsp;</td></tr>
766
  <tr valign="top">
 
 
 
 
 
 
767
  <th scope="row">Comment Field?</th>
768
  <td><input type="radio" id="editCommentRadio1" name="edit_comments" value=0 /><label for="editCommentRadio1">Small Text Field</label></td>
769
  <td><input type="radio" id="editCommentRadio3" name="edit_comments" value=2 /><label for="editCommentRadio3">Large Text Field</label></td>
@@ -959,7 +971,7 @@ function mlw_generate_quiz_options()
959
  echo "<input type='hidden' name='save_options' value='confirmation' />";
960
  echo "<input type='hidden' name='quiz_id' value='".$quiz_id."' />";
961
  ?>
962
- <table class="form-table">
963
  <tr valign="top">
964
  <th scope="row"><label for="system">Which system is this quiz graded on?</label></th>
965
  <td><div id="system">
@@ -968,13 +980,6 @@ function mlw_generate_quiz_options()
968
  <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>
969
  </div></td>
970
  </tr>
971
- <tr valign="top">
972
- <th scope="row"><label for="sendUserEmail">Send user email upon completion?</label></th>
973
- <td><div id="sendUserEmail">
974
- <input type="radio" id="radio5" name="sendUserEmail" <?php if ($mlw_quiz_options->send_user_email == 0) {echo 'checked="checked"';} ?> value='0' /><label for="radio5">Yes</label>
975
- <input type="radio" id="radio6" name="sendUserEmail" <?php if ($mlw_quiz_options->send_user_email == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio6">No</label>
976
- </div></td>
977
- </tr>
978
  <tr valign="top">
979
  <th scope="row"><label for="userName">Should we ask for user's name?</label></th>
980
  <td><div id="userName">
@@ -1007,13 +1012,6 @@ function mlw_generate_quiz_options()
1007
  <input type="radio" id="radio18" name="userPhone" <?php if ($mlw_quiz_options->user_phone == 2) {echo 'checked="checked"';} ?> value='2' /><label for="radio18">No</label>
1008
  </div></td>
1009
  </tr>
1010
- <tr valign="top">
1011
- <th scope="row"><label for="sendAdminEmail">Send admin email upon completion?</label></th>
1012
- <td><div id="sendAdminEmail">
1013
- <input type="radio" id="radio19" name="sendAdminEmail" <?php if ($mlw_quiz_options->send_admin_email == 0) {echo 'checked="checked"';} ?> value='0' /><label for="radio19">Yes</label>
1014
- <input type="radio" id="radio20" name="sendAdminEmail" <?php if ($mlw_quiz_options->send_admin_email == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio20">No</label>
1015
- </div></td>
1016
- </tr>
1017
  <tr valign="top">
1018
  <th scope="row"><label for="commentSection">Would you like a place for the user to enter comments?</label></th>
1019
  <td><div id="commentSection">
@@ -1022,7 +1020,21 @@ function mlw_generate_quiz_options()
1022
  </div></td>
1023
  </tr>
1024
  <tr valign="top">
1025
- <th scope="row"><label for="adminEmail">What email should we send the answers to?</label></th>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1026
  <td><input name="adminEmail" type="email" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
1027
  </tr>
1028
  </table>
33
  $answer_six = htmlspecialchars($_POST["answer_six"], ENT_QUOTES);
34
  $answer_six_points = $_POST["answer_six_points"];
35
  $correct_answer = $_POST["correct_answer"];
36
+ $question_type = $_POST["question_type"];
37
  $comments = $_POST["comments"];
38
  $hint = $_POST["hint"];
39
 
54
  $edit_answer_six_points = $_POST["edit_answer_six_points"];
55
  $edit_correct_answer = $_POST["edit_correct_answer"];
56
  $mlw_edit_question_id = $_POST["edit_question_id"];
57
+ $mlw_edit_question_type = $_POST["edit_question_type"];
58
  $edit_comments = $_POST["edit_comments"];
59
  $edit_hint = $_POST["edit_hint"];
60
  $edit_question_order = $_POST["edit_question_order"];
63
  if ($edit_question_success == "confirmation")
64
  {
65
  $quiz_id = $_POST["quiz_id"];
66
+ $update = "UPDATE " . $wpdb->prefix . "mlw_questions" . " SET question_name='".$edit_question_name."', answer_one='".$edit_answer_one."', answer_one_points='".$edit_answer_one_points."', answer_two='".$edit_answer_two."', answer_two_points='".$edit_answer_two_points."', answer_three='".$edit_answer_three."', answer_three_points='".$edit_answer_three_points."', answer_four='".$edit_answer_four."', answer_four_points='".$edit_answer_four_points."', answer_five='".$edit_answer_five."', answer_five_points='".$edit_answer_five_points."', answer_six='".$edit_answer_six."', answer_six_points='".$edit_answer_six_points."', correct_answer='".$edit_correct_answer."', comments='".$edit_comments."', hints='".$edit_hint."', question_order='".$edit_question_order."', question_type='".$mlw_edit_question_type."' WHERE question_id=".$mlw_edit_question_id;
67
  $results = $wpdb->query( $update );
68
  $hasUpdatedQuestion = true;
69
 
73
  $table_name = $wpdb->prefix . "mlw_qm_audit_trail";
74
  $insert = "INSERT INTO " . $table_name .
75
  "(trail_id, action_user, action, time) " .
76
+ "VALUES (NULL , '" . $current_user->display_name . "' , 'Question Has Been Edited: ".$edit_question_name."' , '" . date("h:i:s A m/d/Y") . "')";
77
  $results = $wpdb->query( $insert );
78
  }
79
 
105
  $quiz_id = $_POST["quiz_id"];
106
  $table_name = $wpdb->prefix . "mlw_questions";
107
  $insert = "INSERT INTO " . $table_name .
108
+ " (question_id, quiz_id, question_name, answer_one, answer_one_points, answer_two, answer_two_points, answer_three, answer_three_points, answer_four, answer_four_points, answer_five, answer_five_points, answer_six, answer_six_points, correct_answer, comments, hints, question_order, question_type, deleted) VALUES (NULL , ".$quiz_id.", '" . $question_name . "' , '" . $answer_one . "', ".$answer_one_points.", '" . $answer_two . "', ".$answer_two_points.", '" . $answer_three . "', ".$answer_three_points.", '" . $answer_four . "', ".$answer_four_points.", '" . $answer_five . "', ".$answer_five_points.", '" . $answer_six . "', ".$answer_six_points.", ".$correct_answer.", '".$comments."', '".$hint."', 1, '".$question_type."', 0)";
109
  $results = $wpdb->query( $insert );
110
  $hasCreatedQuestion = true;
111
 
376
  idText.innerHTML = id;
377
  idHidden.value = id;
378
  };
379
+ function editQuestion(id, question, answerOne, answerOnePoints, answerTwo, answerTwoPoints, answerThree, answerThreePoints, answerFour, answerFourPoints, answerFive, answerFivePoints, answerSix, answerSixPoints, correctAnswer, comments, hint, question_order, question_type){
380
  $j("#edit_question_dialog").dialog({
381
  autoOpen: false,
382
  show: 'blind',
383
+ width:700,
384
  hide: 'explode',
385
  buttons: {
386
  Cancel: function() {
412
  if (correctAnswer == 4) document.getElementById("edit_correct_four").checked = true;
413
  if (correctAnswer == 5) document.getElementById("edit_correct_five").checked = true;
414
  if (correctAnswer == 6) document.getElementById("edit_correct_six").checked = true;
415
+ if (question_type == 0) document.getElementById("editTypeRadio1").checked = true;
416
+ if (question_type == 1) document.getElementById("editTypeRadio2").checked = true;
417
+ if (question_type == 2) document.getElementById("editTypeRadio3").checked = true;
418
  if (comments == 0) document.getElementById("editCommentRadio1").checked = true;
419
  if (comments == 1) document.getElementById("editCommentRadio2").checked = true;
420
  if (comments == 2) document.getElementById("editCommentRadio3").checked = true;
421
  };
422
  </script>
 
 
 
 
 
 
423
  <style type="text/css">
424
  div.mlw_quiz_options input[type='text'] {
425
  border-color:#000000;
499
  else $alternate = " class=\"alternate\"";
500
  $question_list .= "<tr{$alternate}>";
501
  $question_list .= "<td><span style='font-size:16px;'>" . $mlw_question_info->question_order . "</span></td>";
502
+ $question_list .= "<td class='post-title column-title'><span style='font-size:16px;'>" . $mlw_question_info->question_name ."</span><div><span style='color:green;font-size:12px;'><a onclick=\"editQuestion('".$mlw_question_info->question_id."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->question_name, ENT_QUOTES))."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_one, ENT_QUOTES))."','".$mlw_question_info->answer_one_points."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_two, ENT_QUOTES))."','".$mlw_question_info->answer_two_points."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_three, ENT_QUOTES))."','".$mlw_question_info->answer_three_points."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_four, ENT_QUOTES))."','".$mlw_question_info->answer_four_points."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_five, ENT_QUOTES))."','".$mlw_question_info->answer_five_points."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_six, ENT_QUOTES))."','".$mlw_question_info->answer_six_points."','".$mlw_question_info->correct_answer."','".$mlw_question_info->comments."','".$mlw_question_info->hints."', '".$mlw_question_info->question_order."', '".$mlw_question_info->question_type."')\" href='#'>Edit</a> | <a onclick=\"deleteQuestion('".$mlw_question_info->question_id."')\" href='#'>Delete</a></span></div></td>";
503
  $question_list .= "</tr>";
504
  }
505
 
627
  <tr><td>&nbsp;</td></tr>
628
  <tr><td>&nbsp;</td></tr>
629
  <tr valign="top">
630
+ <th scope="row">Question Type?</th>
631
+ <td><input type="radio" id="typeRadio1" name="question_type" checked="checked" value=0 /><label for="typeRadio1">Normal (Vertical Radio)</label></td>
632
+ <td><input type="radio" id="typeRadio2" name="question_type" value=1 /><label for="typeRadio2">Horizontal Radio</label></td>
633
+ <td><input type="radio" id="typeRadio3" name="question_type" value=2 /><label for="typeRadio3">Drop Down</label></td>
634
+ </tr>
635
+ <tr valign="top">
636
  <th scope="row">Comment Field?</th>
637
  <td><input type="radio" id="commentsRadio1" name="comments" checked="checked" value=0 /><label for="commentsRadio1">Small Text Field</label></td>
638
  <td><input type="radio" id="commentsRadio3" name="comments" value=2 /><label for="commentsRadio3">Large Text Field</label></td>
770
  <tr><td>&nbsp;</td></tr>
771
  <tr><td>&nbsp;</td></tr>
772
  <tr valign="top">
773
+ <th scope="row">Question Type?</th>
774
+ <td><input type="radio" id="editTypeRadio1" name="edit_question_type" checked="checked" value=0 /><label for="editTypeRadio1">Normal (Vertical Radio)</label></td>
775
+ <td><input type="radio" id="editTypeRadio2" name="edit_question_type" value=1 /><label for="editTypeRadio2">Horizontal Radio</label></td>
776
+ <td><input type="radio" id="editTypeRadio3" name="edit_question_type" value=2 /><label for="editTypeRadio3">Drop Down</label></td>
777
+ </tr>
778
+ <tr valign="top">
779
  <th scope="row">Comment Field?</th>
780
  <td><input type="radio" id="editCommentRadio1" name="edit_comments" value=0 /><label for="editCommentRadio1">Small Text Field</label></td>
781
  <td><input type="radio" id="editCommentRadio3" name="edit_comments" value=2 /><label for="editCommentRadio3">Large Text Field</label></td>
971
  echo "<input type='hidden' name='save_options' value='confirmation' />";
972
  echo "<input type='hidden' name='quiz_id' value='".$quiz_id."' />";
973
  ?>
974
+ <table class="form-table" style="width: 100%;">
975
  <tr valign="top">
976
  <th scope="row"><label for="system">Which system is this quiz graded on?</label></th>
977
  <td><div id="system">
980
  <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>
981
  </div></td>
982
  </tr>
 
 
 
 
 
 
 
983
  <tr valign="top">
984
  <th scope="row"><label for="userName">Should we ask for user's name?</label></th>
985
  <td><div id="userName">
1012
  <input type="radio" id="radio18" name="userPhone" <?php if ($mlw_quiz_options->user_phone == 2) {echo 'checked="checked"';} ?> value='2' /><label for="radio18">No</label>
1013
  </div></td>
1014
  </tr>
 
 
 
 
 
 
 
1015
  <tr valign="top">
1016
  <th scope="row"><label for="commentSection">Would you like a place for the user to enter comments?</label></th>
1017
  <td><div id="commentSection">
1020
  </div></td>
1021
  </tr>
1022
  <tr valign="top">
1023
+ <th scope="row"><label for="sendUserEmail">Send user email upon completion?</label></th>
1024
+ <td><div id="sendUserEmail">
1025
+ <input type="radio" id="radio5" name="sendUserEmail" <?php if ($mlw_quiz_options->send_user_email == 0) {echo 'checked="checked"';} ?> value='0' /><label for="radio5">Yes</label>
1026
+ <input type="radio" id="radio6" name="sendUserEmail" <?php if ($mlw_quiz_options->send_user_email == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio6">No</label>
1027
+ </div></td>
1028
+ </tr>
1029
+ <tr valign="top">
1030
+ <th scope="row"><label for="sendAdminEmail">Send admin email upon completion?</label></th>
1031
+ <td><div id="sendAdminEmail">
1032
+ <input type="radio" id="radio19" name="sendAdminEmail" <?php if ($mlw_quiz_options->send_admin_email == 0) {echo 'checked="checked"';} ?> value='0' /><label for="radio19">Yes</label>
1033
+ <input type="radio" id="radio20" name="sendAdminEmail" <?php if ($mlw_quiz_options->send_admin_email == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio20">No</label>
1034
+ </div></td>
1035
+ </tr>
1036
+ <tr valign="top">
1037
+ <th scope="row"><label for="adminEmail">What email should we send the admin email to?</label></th>
1038
  <td><input name="adminEmail" type="email" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
1039
  </tr>
1040
  </table>
includes/mlw_update.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  function mlw_quiz_update()
4
  {
5
- $data = "0.8.6";
6
  if ( ! get_option('mlw_quiz_master_version'))
7
  {
8
  add_option('mlw_quiz_master_version' , $data);
@@ -11,6 +11,7 @@ function mlw_quiz_update()
11
  {
12
  global $wpdb;
13
  $table_name = $wpdb->prefix . "mlw_quizzes";
 
14
  if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'comment_section'") != "comment_section")
15
  {
16
  $sql = "ALTER TABLE ".$table_name." ADD comment_field_text TEXT NOT NULL AFTER phone_field_text";
@@ -22,8 +23,10 @@ function mlw_quiz_update()
22
  $update_sql = "UPDATE ".$table_name." SET comment_field_text='Comments', comment_section=1, message_comment='Enter You Text Here'";
23
  $results = $wpdb->query( $update_sql );
24
  }
 
25
  global $wpdb;
26
  $table_name = $wpdb->prefix . "mlw_questions";
 
27
  if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'comments'") != "comments")
28
  {
29
  $sql = "ALTER TABLE ".$table_name." ADD comments INT NOT NULL AFTER correct_answer";
@@ -33,7 +36,7 @@ function mlw_quiz_update()
33
  $update_sql = "UPDATE ".$table_name." SET comments=1, hints=''";
34
  $results = $wpdb->query( $update_sql );
35
  }
36
-
37
  if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'question_order'") != "question_order")
38
  {
39
  $sql = "ALTER TABLE ".$table_name." ADD question_order INT NOT NULL AFTER hints";
@@ -41,6 +44,14 @@ function mlw_quiz_update()
41
  $update_sql = "UPDATE ".$table_name." SET question_order=0";
42
  $results = $wpdb->query( $update_sql );
43
  }
 
 
 
 
 
 
 
 
44
  update_option('mlw_quiz_master_version' , $data);
45
  }
46
  }
2
 
3
  function mlw_quiz_update()
4
  {
5
+ $data = "0.9";
6
  if ( ! get_option('mlw_quiz_master_version'))
7
  {
8
  add_option('mlw_quiz_master_version' , $data);
11
  {
12
  global $wpdb;
13
  $table_name = $wpdb->prefix . "mlw_quizzes";
14
+ //Update 0.5
15
  if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'comment_section'") != "comment_section")
16
  {
17
  $sql = "ALTER TABLE ".$table_name." ADD comment_field_text TEXT NOT NULL AFTER phone_field_text";
23
  $update_sql = "UPDATE ".$table_name." SET comment_field_text='Comments', comment_section=1, message_comment='Enter You Text Here'";
24
  $results = $wpdb->query( $update_sql );
25
  }
26
+
27
  global $wpdb;
28
  $table_name = $wpdb->prefix . "mlw_questions";
29
+ //Update 0.5
30
  if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'comments'") != "comments")
31
  {
32
  $sql = "ALTER TABLE ".$table_name." ADD comments INT NOT NULL AFTER correct_answer";
36
  $update_sql = "UPDATE ".$table_name." SET comments=1, hints=''";
37
  $results = $wpdb->query( $update_sql );
38
  }
39
+ //Update 0.8
40
  if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'question_order'") != "question_order")
41
  {
42
  $sql = "ALTER TABLE ".$table_name." ADD question_order INT NOT NULL AFTER hints";
44
  $update_sql = "UPDATE ".$table_name." SET question_order=0";
45
  $results = $wpdb->query( $update_sql );
46
  }
47
+
48
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'question_type'") != "question_type")
49
+ {
50
+ $sql = "ALTER TABLE ".$table_name." ADD question_type INT NOT NULL AFTER question_order";
51
+ $results = $wpdb->query( $sql );
52
+ $update_sql = "UPDATE ".$table_name." SET question_type=0";
53
+ $results = $wpdb->query( $update_sql );
54
+ }
55
  update_option('mlw_quiz_master_version' , $data);
56
  }
57
  }
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.8.6
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
7
  Author: Frank Corso
8
  Author URI: http://www.mylocalwebstop.com/
9
  Plugin URI: http://www.mylocalwebstop.com/
readme.txt CHANGED
@@ -3,10 +3,10 @@ Contributors: fpcorso
3
  Tags: quiz, test, score, survey
4
  Requires at least: 3.0.1
5
  Tested up to: 3.8
6
- Stable tag: 0.8.6
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
 
9
- Use this plugin to add multiple quizzes, tests, or surveys to your website.
10
 
11
  == Description ==
12
 
@@ -27,6 +27,7 @@ Features include:
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
 
31
  == Installation ==
32
 
@@ -46,13 +47,21 @@ Feel free to use the support option on the main page of the plugin or from the c
46
  4. Example Quiz
47
  5. Example Survey
48
  6. Quiz Results Page
 
49
 
50
  == Changelog ==
51
 
52
- = 0.8.6 (January 2, 2013) =
 
 
 
 
 
 
 
53
  * Bug Fixes
54
 
55
- = 0.8.5 (January 1, 2013) =
56
  * New Screenshots Added
57
  * Minor Design Changes
58
  * Bug Fixes
@@ -157,6 +166,9 @@ Feel free to use the support option on the main page of the plugin or from the c
157
 
158
  == Upgrade Notice ==
159
 
 
 
 
160
  = 0.8.6 =
161
  Upgrade to fix minor bugs
162
 
3
  Tags: quiz, test, score, survey
4
  Requires at least: 3.0.1
5
  Tested up to: 3.8
6
+ Stable tag: 0.9
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.
10
 
11
  == Description ==
12
 
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
 
47
  4. Example Quiz
48
  5. Example Survey
49
  6. Quiz Results Page
50
+ 7. Example Contact Form
51
 
52
  == Changelog ==
53
 
54
+ = 0.9 (January 5, 2014) =
55
+ * Added Ability To Edit Quiz Name
56
+ * Added Ability To Display Question As Drop Down
57
+ * Added Quiz Name To Completion Email's Subject
58
+ * Minor Design Changes To Quiz Options Page
59
+ * Design Changes To Quiz
60
+
61
+ = 0.8.6 (January 2, 2014) =
62
  * Bug Fixes
63
 
64
+ = 0.8.5 (January 1, 2014) =
65
  * New Screenshots Added
66
  * Minor Design Changes
67
  * Bug Fixes
166
 
167
  == Upgrade Notice ==
168
 
169
+ = 0.9 =
170
+ Upgrade for several new features and bug fixes
171
+
172
  = 0.8.6 =
173
  Upgrade to fix minor bugs
174