Version Description
Upgrade to enjoy several new features including saved results and leaderboards!
Download this release
Release Info
Developer | fpcorso |
Plugin | Quiz And Survey Master (Formerly Quiz Master Next) |
Version | 0.6 |
Comparing to | |
See all releases |
Code changes from version 0.5.3 to 0.6
- includes/mlw_dashboard.php +18 -0
- includes/mlw_leaderboard.php +44 -0
- includes/mlw_main_page.php +10 -4
- includes/mlw_quiz.php +49 -12
- includes/mlw_quiz_admin.php +4 -2
- includes/mlw_quiz_install.php +25 -2
- includes/mlw_results.php +2 -2
- includes/mlw_results_details.php +152 -0
- mlw_quizmaster2.php +6 -2
- readme.txt +11 -1
includes/mlw_dashboard.php
CHANGED
@@ -127,6 +127,16 @@ function mlw_dashboard_box()
|
|
127 |
$mlw_quiz_most_taken = $mlw_eaches->quiz_name;
|
128 |
break;
|
129 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
?>
|
131 |
<div>
|
132 |
<table width='100%'>
|
@@ -154,6 +164,14 @@ function mlw_dashboard_box()
|
|
154 |
<td align='left'>Quiz That Has Been Taken The Most</td>
|
155 |
<td align='right'><?php echo $mlw_quiz_most_taken; ?></td>
|
156 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
</table>
|
158 |
</div>
|
159 |
<?php
|
127 |
$mlw_quiz_most_taken = $mlw_eaches->quiz_name;
|
128 |
break;
|
129 |
}
|
130 |
+
|
131 |
+
$sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".date("Y-m-d")." 00:00:00' AND '".date("Y-m-d")." 23:59:59')";
|
132 |
+
$mlw_quiz_taken_today = $wpdb->get_results($sql);
|
133 |
+
$mlw_quiz_taken_today = $wpdb->num_rows;
|
134 |
+
|
135 |
+
$mlw_yesterday = mktime(0, 0, 0, date("m") , date("d")-1, date("Y"));
|
136 |
+
$mlw_yesterday = date("Y-m-d", $mlw_yesterday);
|
137 |
+
$sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_yesterday." 00:00:00' AND '".$mlw_yesterday." 23:59:59')";
|
138 |
+
$mlw_quiz_taken_yesterday = $wpdb->get_results($sql);
|
139 |
+
$mlw_quiz_taken_yesterday = $wpdb->num_rows;
|
140 |
?>
|
141 |
<div>
|
142 |
<table width='100%'>
|
164 |
<td align='left'>Quiz That Has Been Taken The Most</td>
|
165 |
<td align='right'><?php echo $mlw_quiz_most_taken; ?></td>
|
166 |
</tr>
|
167 |
+
<tr>
|
168 |
+
<td align='left'>Times Taken Today</td>
|
169 |
+
<td align='right'><?php echo $mlw_quiz_taken_today; ?></td>
|
170 |
+
</tr>
|
171 |
+
<tr>
|
172 |
+
<td align='left'>Times Taken Yesterday</td>
|
173 |
+
<td align='right'><?php echo $mlw_quiz_taken_yesterday; ?></td>
|
174 |
+
</tr>
|
175 |
</table>
|
176 |
</div>
|
177 |
<?php
|
includes/mlw_leaderboard.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
This function creates the leaderboard from the shortcode.
|
4 |
+
*/
|
5 |
+
function mlw_quiz_leaderboard_shortcode($atts)
|
6 |
+
{
|
7 |
+
extract(shortcode_atts(array(
|
8 |
+
'mlw_quiz' => 0
|
9 |
+
), $atts));
|
10 |
+
$mlw_quiz_id = $mlw_quiz;
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
global $wpdb;
|
15 |
+
$sql = "SELECT * FROM " . $wpdb->prefix . "mlw_quizzes" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0'";
|
16 |
+
$mlw_quiz_options = $wpdb->get_results($sql);
|
17 |
+
foreach($mlw_quiz_options as $mlw_eaches) {
|
18 |
+
$mlw_quiz_options = $mlw_eaches;
|
19 |
+
break;
|
20 |
+
}
|
21 |
+
$sql = "SELECT * FROM " . $wpdb->prefix . "mlw_results WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' LIMIT 10";
|
22 |
+
$mlw_result_data = $wpdb->get_results($sql);
|
23 |
+
|
24 |
+
?>
|
25 |
+
<h3><?php echo $mlw_quiz_options->quiz_name; ?>'s Leaderboard</h3>
|
26 |
+
<?php
|
27 |
+
$leader_count = 0;
|
28 |
+
foreach($mlw_result_data as $mlw_eaches) {
|
29 |
+
$leader_count++;
|
30 |
+
if ($mlw_quiz_options->system == 0)
|
31 |
+
{
|
32 |
+
echo $leader_count.". ".$mlw_eaches->name." - ".$mlw_eaches->correct_score."%";
|
33 |
+
}
|
34 |
+
if ($mlw_quiz_options->system == 1)
|
35 |
+
{
|
36 |
+
echo $leader_count.". ".$mlw_eaches->name." - ".$mlw_eaches->point_score." Points";
|
37 |
+
}
|
38 |
+
echo "<br />";
|
39 |
+
}
|
40 |
+
?>
|
41 |
+
<br />
|
42 |
+
<?php
|
43 |
+
}
|
44 |
+
?>
|
includes/mlw_main_page.php
CHANGED
@@ -194,13 +194,19 @@ function quiz_wpss_mrt_meta_box2()
|
|
194 |
<div>
|
195 |
<table width='100%'>
|
196 |
<tr>
|
197 |
-
<td align='left'>0.
|
198 |
</tr>
|
199 |
<tr>
|
200 |
-
<td align='left'>*
|
|
|
|
|
|
|
201 |
</tr>
|
202 |
<tr>
|
203 |
-
<td align='left'>*
|
|
|
|
|
|
|
204 |
</tr>
|
205 |
</table>
|
206 |
</div>
|
@@ -310,7 +316,7 @@ function quiz_wpss_mrt_meta_box5()
|
|
310 |
<div>
|
311 |
<table width='100%'>
|
312 |
<tr>
|
313 |
-
<td align='left'><iframe src="http://www.mylocalwebstop.com/mlw_news.html" seamless="seamless" style="width: 100%; height: 550px;"></iframe></td>
|
314 |
</tr>
|
315 |
</table>
|
316 |
</div>
|
194 |
<div>
|
195 |
<table width='100%'>
|
196 |
<tr>
|
197 |
+
<td align='left'>0.6 (October 19, 2013)</td>
|
198 |
</tr>
|
199 |
<tr>
|
200 |
+
<td align='left'>* Started Developing Quiz Leaderboards</td>
|
201 |
+
</tr>
|
202 |
+
<tr>
|
203 |
+
<td align='left'>* Added Ability To Save User Answers And Comments</td>
|
204 |
</tr>
|
205 |
<tr>
|
206 |
+
<td align='left'>* Added More Statistics To Quiz Dashboard</td>
|
207 |
+
</tr>
|
208 |
+
<tr>
|
209 |
+
<td align='left'>* Bug Fixes</td>
|
210 |
</tr>
|
211 |
</table>
|
212 |
</div>
|
316 |
<div>
|
317 |
<table width='100%'>
|
318 |
<tr>
|
319 |
+
<td align='left'><iframe src="http://www.mylocalwebstop.com/mlw_news.html?cache=<?php echo rand(); ?>" seamless="seamless" style="width: 100%; height: 550px;"></iframe></td>
|
320 |
</tr>
|
321 |
</table>
|
322 |
</div>
|
includes/mlw_quiz.php
CHANGED
@@ -47,7 +47,7 @@ function mlw_quiz_shortcode($atts)
|
|
47 |
//If there is no quiz for the shortcode provided
|
48 |
if ($mlw_quiz_options->quiz_name == "")
|
49 |
{
|
50 |
-
$mlw_display .= "It appears this quiz is not set up correctly.";
|
51 |
return $mlw_display;
|
52 |
}
|
53 |
|
@@ -228,7 +228,9 @@ function mlw_quiz_shortcode($atts)
|
|
228 |
//Display comment box if needed
|
229 |
if ($mlw_quiz_options->comment_section == 0)
|
230 |
{
|
231 |
-
$
|
|
|
|
|
232 |
$mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
|
233 |
$mlw_display .= "<br />";
|
234 |
}
|
@@ -256,22 +258,55 @@ function mlw_quiz_shortcode($atts)
|
|
256 |
|
257 |
//See which answers were correct and award points if necessary
|
258 |
foreach($mlw_questions as $mlw_question) {
|
|
|
|
|
259 |
$mlw_total_questions += 1;
|
260 |
$mlw_user_answer = $_POST["question".$mlw_question->question_id];
|
261 |
if ($mlw_user_answer == $mlw_question->correct_answer)
|
262 |
{
|
263 |
$mlw_correct += 1;
|
264 |
}
|
265 |
-
if ($mlw_user_answer == 1)
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
if ($mlw_user_answer ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
$mlw_question_answers .= $mlw_question->question_name . "\n";
|
273 |
-
$mlw_question_answers .= "Your Answer: " . $
|
274 |
-
$mlw_question_answers .= "Correct Answer: " . $
|
275 |
if ($mlw_question->comments == 0)
|
276 |
{
|
277 |
$mlw_question_answers .= "Your Comments: " . $_POST["mlwComment".$mlw_question->question_id] . "\n";
|
@@ -341,11 +376,13 @@ function mlw_quiz_shortcode($atts)
|
|
341 |
}
|
342 |
|
343 |
//Save the results into database
|
|
|
|
|
344 |
global $wpdb;
|
345 |
$table_name = $wpdb->prefix . "mlw_results";
|
346 |
$insert = "INSERT INTO " . $table_name .
|
347 |
-
"(result_id, quiz_id, quiz_name, quiz_system, point_score, correct_score, correct, total, name, business, email, phone, time_taken, deleted) " .
|
348 |
-
"VALUES (NULL , " . $mlw_quiz_id . " , '".$mlw_quiz_options->quiz_name."', ".$mlw_quiz_options->system.", ".$mlw_points.", ".$mlw_total_score.", ".$mlw_correct.", ".$mlw_total_questions.", '".$mlw_user_name."', '".$mlw_user_comp."', '".$mlw_user_email."', '".$mlw_user_phone."', '".date("h:i:s A m/d/Y")."', 0)";
|
349 |
$results = $wpdb->query( $insert );
|
350 |
}
|
351 |
return $mlw_display;
|
47 |
//If there is no quiz for the shortcode provided
|
48 |
if ($mlw_quiz_options->quiz_name == "")
|
49 |
{
|
50 |
+
$mlw_display .= "It appears that this quiz is not set up correctly.";
|
51 |
return $mlw_display;
|
52 |
}
|
53 |
|
228 |
//Display comment box if needed
|
229 |
if ($mlw_quiz_options->comment_section == 0)
|
230 |
{
|
231 |
+
$mlw_message_comments = $mlw_quiz_options->message_comment;
|
232 |
+
$mlw_message_comments = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_comments);
|
233 |
+
$mlw_display .= "<label for='mlwQuizComments'>".$mlw_message_comments."</label>";
|
234 |
$mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
|
235 |
$mlw_display .= "<br />";
|
236 |
}
|
258 |
|
259 |
//See which answers were correct and award points if necessary
|
260 |
foreach($mlw_questions as $mlw_question) {
|
261 |
+
$mlw_user_text;
|
262 |
+
$mlw_correct_text;
|
263 |
$mlw_total_questions += 1;
|
264 |
$mlw_user_answer = $_POST["question".$mlw_question->question_id];
|
265 |
if ($mlw_user_answer == $mlw_question->correct_answer)
|
266 |
{
|
267 |
$mlw_correct += 1;
|
268 |
}
|
269 |
+
if ($mlw_user_answer == 1)
|
270 |
+
{
|
271 |
+
$mlw_points += $mlw_question->answer_one_points;
|
272 |
+
$mlw_user_text = $mlw_question->answer_one;
|
273 |
+
}
|
274 |
+
if ($mlw_user_answer == 2)
|
275 |
+
{
|
276 |
+
$mlw_points += $mlw_question->answer_two_points;
|
277 |
+
$mlw_user_text = $mlw_question->answer_two;
|
278 |
+
}
|
279 |
+
if ($mlw_user_answer == 3)
|
280 |
+
{
|
281 |
+
$mlw_points += $mlw_question->answer_three_points;
|
282 |
+
$mlw_user_text = $mlw_question->answer_three;
|
283 |
+
}
|
284 |
+
if ($mlw_user_answer == 4)
|
285 |
+
{
|
286 |
+
$mlw_points += $mlw_question->answer_four_points;
|
287 |
+
$mlw_user_text = $mlw_question->answer_four;
|
288 |
+
}
|
289 |
+
if ($mlw_user_answer == 5)
|
290 |
+
{
|
291 |
+
$mlw_points += $mlw_question->answer_five_points;
|
292 |
+
$mlw_user_text = $mlw_question->answer_five;
|
293 |
+
}
|
294 |
+
if ($mlw_user_answer == 6)
|
295 |
+
{
|
296 |
+
$mlw_points += $mlw_question->answer_six_points;
|
297 |
+
$mlw_user_text = $mlw_question->answer_six;
|
298 |
+
}
|
299 |
+
|
300 |
+
if ($mlw_question->correct_answer == 1) {$mlw_correct_text = $mlw_question->answer_one;}
|
301 |
+
if ($mlw_question->correct_answer == 2) {$mlw_correct_text = $mlw_question->answer_two;}
|
302 |
+
if ($mlw_question->correct_answer == 3) {$mlw_correct_text = $mlw_question->answer_three;}
|
303 |
+
if ($mlw_question->correct_answer == 4) {$mlw_correct_text = $mlw_question->answer_four;}
|
304 |
+
if ($mlw_question->correct_answer == 5) {$mlw_correct_text = $mlw_question->answer_five;}
|
305 |
+
if ($mlw_question->correct_answer == 6) {$mlw_correct_text = $mlw_question->answer_six;}
|
306 |
|
307 |
$mlw_question_answers .= $mlw_question->question_name . "\n";
|
308 |
+
$mlw_question_answers .= "Your Answer: " . $mlw_user_text . "\n";
|
309 |
+
$mlw_question_answers .= "Correct Answer: " . $mlw_correct_text . "\n";
|
310 |
if ($mlw_question->comments == 0)
|
311 |
{
|
312 |
$mlw_question_answers .= "Your Comments: " . $_POST["mlwComment".$mlw_question->question_id] . "\n";
|
376 |
}
|
377 |
|
378 |
//Save the results into database
|
379 |
+
$mlw_quiz_results = $mlw_question_answers."\n".$_POST["mlwQuizComments"];
|
380 |
+
$mlw_quiz_results = str_replace( "\n" , "<br>", $mlw_quiz_results);
|
381 |
global $wpdb;
|
382 |
$table_name = $wpdb->prefix . "mlw_results";
|
383 |
$insert = "INSERT INTO " . $table_name .
|
384 |
+
"(result_id, quiz_id, quiz_name, quiz_system, point_score, correct_score, correct, total, name, business, email, phone, time_taken, time_taken_real, quiz_results, deleted) " .
|
385 |
+
"VALUES (NULL , " . $mlw_quiz_id . " , '".$mlw_quiz_options->quiz_name."', ".$mlw_quiz_options->system.", ".$mlw_points.", ".$mlw_total_score.", ".$mlw_correct.", ".$mlw_total_questions.", '".$mlw_user_name."', '".$mlw_user_comp."', '".$mlw_user_email."', '".$mlw_user_phone."', '".date("h:i:s A m/d/Y")."', '".date("Y-m-d H:i:s")."', '".$mlw_quiz_results."', 0)";
|
386 |
$results = $wpdb->query( $insert );
|
387 |
}
|
388 |
return $mlw_display;
|
includes/mlw_quiz_admin.php
CHANGED
@@ -161,7 +161,7 @@ function mlw_generate_quiz_admin()
|
|
161 |
?>
|
162 |
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
|
163 |
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
|
164 |
-
<strong>Hey!</strong> Your new quiz has been created successfully.</p>
|
165 |
</div>
|
166 |
<?php
|
167 |
}
|
@@ -187,6 +187,7 @@ function mlw_generate_quiz_admin()
|
|
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_quiz_info->quiz_views . "</span></td>";
|
191 |
$quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_taken ."</span></td>";
|
192 |
$quotes_list .= "</tr>";
|
@@ -196,7 +197,8 @@ function mlw_generate_quiz_admin()
|
|
196 |
$display .= "<thead><tr>
|
197 |
<th>Quiz ID</th>
|
198 |
<th>Quiz Name</th>
|
199 |
-
<th>Shortcode</th>
|
|
|
200 |
<th>Quiz Views</th>
|
201 |
<th>Quiz Taken</th>
|
202 |
</tr></thead>";
|
161 |
?>
|
162 |
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
|
163 |
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
|
164 |
+
<strong>Hey!</strong> Your new quiz has been created successfully. To begin editing option and adding questions to your quiz, click on the edit link for that quiz.</p>
|
165 |
</div>
|
166 |
<?php
|
167 |
}
|
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>";
|
192 |
$quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_taken ."</span></td>";
|
193 |
$quotes_list .= "</tr>";
|
197 |
$display .= "<thead><tr>
|
198 |
<th>Quiz ID</th>
|
199 |
<th>Quiz Name</th>
|
200 |
+
<th>Quiz Shortcode</th>
|
201 |
+
<th>Leaderboard Shortcode</th>
|
202 |
<th>Quiz Views</th>
|
203 |
<th>Quiz Taken</th>
|
204 |
</tr></thead>";
|
includes/mlw_quiz_install.php
CHANGED
@@ -211,6 +211,10 @@ function mlw_quiz_activate()
|
|
211 |
phone TEXT NOT NULL,
|
212 |
|
213 |
time_taken TEXT NOT NULL,
|
|
|
|
|
|
|
|
|
214 |
|
215 |
deleted INT NOT NULL,
|
216 |
|
@@ -224,6 +228,25 @@ function mlw_quiz_activate()
|
|
224 |
dbDelta($sql);
|
225 |
}
|
226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
global $wpdb;
|
228 |
|
229 |
$table_name = $wpdb->prefix . "mlw_qm_audit_trail";
|
@@ -252,7 +275,7 @@ function mlw_quiz_activate()
|
|
252 |
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
253 |
dbDelta($sql);
|
254 |
}
|
255 |
-
$data = "0.
|
256 |
if ( ! get_option('mlw_quiz_master_version'))
|
257 |
{
|
258 |
add_option('mlw_quiz_master_version' , $data);
|
@@ -268,4 +291,4 @@ function mlw_quiz_deactivate()
|
|
268 |
|
269 |
|
270 |
}
|
271 |
-
?>
|
211 |
phone TEXT NOT NULL,
|
212 |
|
213 |
time_taken TEXT NOT NULL,
|
214 |
+
|
215 |
+
time_taken_real DATETIME NOT NULL,
|
216 |
+
|
217 |
+
quiz_results TEXT NOT NULL,
|
218 |
|
219 |
deleted INT NOT NULL,
|
220 |
|
228 |
dbDelta($sql);
|
229 |
}
|
230 |
|
231 |
+
else
|
232 |
+
|
233 |
+
{
|
234 |
+
if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'time_taken_real'") != "time_taken_real")
|
235 |
+
{
|
236 |
+
$sql = "ALTER TABLE ".$table_name." ADD time_taken_real DATETIME NOT NULL AFTER time_taken";
|
237 |
+
|
238 |
+
$results = $wpdb->query( $sql );
|
239 |
+
|
240 |
+
$sql = "ALTER TABLE ".$table_name." ADD quiz_results TEXT NOT NULL AFTER time_taken_real";
|
241 |
+
|
242 |
+
$results = $wpdb->query( $sql );
|
243 |
+
|
244 |
+
$update_sql = "UPDATE ".$table_name." SET quiz_results='This quiz was taken before this plugin began saving answers.', hints=''";
|
245 |
+
|
246 |
+
$results = $wpdb->query( $update_sql );
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
global $wpdb;
|
251 |
|
252 |
$table_name = $wpdb->prefix . "mlw_qm_audit_trail";
|
275 |
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
276 |
dbDelta($sql);
|
277 |
}
|
278 |
+
$data = "0.6";
|
279 |
if ( ! get_option('mlw_quiz_master_version'))
|
280 |
{
|
281 |
add_option('mlw_quiz_master_version' , $data);
|
291 |
|
292 |
|
293 |
}
|
294 |
+
?>
|
includes/mlw_results.php
CHANGED
@@ -78,7 +78,7 @@ function mlw_generate_quiz_results()
|
|
78 |
if($alternate) $alternate = "";
|
79 |
else $alternate = " class=\"alternate\"";
|
80 |
$quotes_list .= "<tr{$alternate}>";
|
81 |
-
$quotes_list .= "<td><span style='font-size:16px;'
|
82 |
$quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_name . "</span></td>";
|
83 |
if ($mlw_quiz_info->quiz_system == 0)
|
84 |
{
|
@@ -102,7 +102,7 @@ function mlw_generate_quiz_results()
|
|
102 |
|
103 |
$display .= "<table class=\"widefat\">";
|
104 |
$display .= "<thead><tr>
|
105 |
-
<th>
|
106 |
<th>Quiz Name</th>
|
107 |
<th>Score</th>
|
108 |
<th>Name</th>
|
78 |
if($alternate) $alternate = "";
|
79 |
else $alternate = " class=\"alternate\"";
|
80 |
$quotes_list .= "<tr{$alternate}>";
|
81 |
+
$quotes_list .= "<td><span style='font-size:16px;'><a href='admin.php?page=mlw_quiz_result_details&&result_id=".$mlw_quiz_info->result_id."'>View</a></span></td>";
|
82 |
$quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_name . "</span></td>";
|
83 |
if ($mlw_quiz_info->quiz_system == 0)
|
84 |
{
|
102 |
|
103 |
$display .= "<table class=\"widefat\">";
|
104 |
$display .= "<thead><tr>
|
105 |
+
<th>View Answers</th>
|
106 |
<th>Quiz Name</th>
|
107 |
<th>Score</th>
|
108 |
<th>Name</th>
|
includes/mlw_results_details.php
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
This page allows for the viewing of the quiz results.
|
4 |
+
*/
|
5 |
+
/*
|
6 |
+
Copyright 2013, My Local Webstop (email : fpcorso@mylocalwebstop.com)
|
7 |
+
*/
|
8 |
+
|
9 |
+
function mlw_generate_result_details()
|
10 |
+
{
|
11 |
+
$mlw_result_id = $_GET["result_id"];
|
12 |
+
if ($mlw_result_id != "")
|
13 |
+
{
|
14 |
+
global $wpdb;
|
15 |
+
$table_name = $wpdb->prefix . "mlw_results";
|
16 |
+
$sql = "SELECT quiz_results FROM " . $wpdb->prefix . "mlw_results WHERE result_id=".$mlw_result_id."";
|
17 |
+
$mlw_results_data = $wpdb->get_results($sql);
|
18 |
+
?>
|
19 |
+
<!-- css -->
|
20 |
+
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
|
21 |
+
<!-- jquery scripts -->
|
22 |
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
|
23 |
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
|
24 |
+
<script type="text/javascript">
|
25 |
+
var $j = jQuery.noConflict();
|
26 |
+
// increase the default animation speed to exaggerate the effect
|
27 |
+
$j.fx.speeds._default = 1000;
|
28 |
+
$j(function() {
|
29 |
+
$j('#dialog').dialog({
|
30 |
+
autoOpen: false,
|
31 |
+
show: 'blind',
|
32 |
+
hide: 'explode',
|
33 |
+
buttons: {
|
34 |
+
Ok: function() {
|
35 |
+
$j(this).dialog('close');
|
36 |
+
}
|
37 |
+
}
|
38 |
+
});
|
39 |
+
|
40 |
+
$j('#opener').click(function() {
|
41 |
+
$j('#dialog').dialog('open');
|
42 |
+
return false;
|
43 |
+
} );
|
44 |
+
});
|
45 |
+
$j(function() {
|
46 |
+
$j( document ).tooltip();
|
47 |
+
});
|
48 |
+
$j(function() {
|
49 |
+
$j("button").button();
|
50 |
+
|
51 |
+
});
|
52 |
+
</script>
|
53 |
+
<style>
|
54 |
+
label {
|
55 |
+
display: inline-block;
|
56 |
+
width: 5em;
|
57 |
+
}
|
58 |
+
</style>
|
59 |
+
<style type="text/css">
|
60 |
+
div.mlw_quiz_options input[type='text'] {
|
61 |
+
border-color:#000000;
|
62 |
+
color:#3300CC;
|
63 |
+
cursor:hand;
|
64 |
+
}
|
65 |
+
</style>
|
66 |
+
<div class="wrap">
|
67 |
+
<div class='mlw_quiz_options'>
|
68 |
+
<h2>Quiz Results<a id="opener" href="">(?)</a></h2>
|
69 |
+
<?php
|
70 |
+
foreach($mlw_results_data as $mlw_results_info) {
|
71 |
+
echo $mlw_results_info->quiz_results;
|
72 |
+
}
|
73 |
+
?>
|
74 |
+
<div id="dialog" title="Help">
|
75 |
+
<h3><b>Help</b></h3>
|
76 |
+
<p>This page shows the results from the taken quiz.</p>
|
77 |
+
<p>The top section shows the question, the user's answer, and the correct answer.</p>
|
78 |
+
<p>The bottom section shows the text from the comment box if enabled.</p>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<?php
|
84 |
+
}
|
85 |
+
else
|
86 |
+
{
|
87 |
+
?>
|
88 |
+
<!-- css -->
|
89 |
+
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
|
90 |
+
<!-- jquery scripts -->
|
91 |
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
|
92 |
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
|
93 |
+
<script type="text/javascript">
|
94 |
+
var $j = jQuery.noConflict();
|
95 |
+
// increase the default animation speed to exaggerate the effect
|
96 |
+
$j.fx.speeds._default = 1000;
|
97 |
+
$j(function() {
|
98 |
+
$j('#dialog').dialog({
|
99 |
+
autoOpen: false,
|
100 |
+
show: 'blind',
|
101 |
+
hide: 'explode',
|
102 |
+
buttons: {
|
103 |
+
Ok: function() {
|
104 |
+
$j(this).dialog('close');
|
105 |
+
}
|
106 |
+
}
|
107 |
+
});
|
108 |
+
|
109 |
+
$j('#opener').click(function() {
|
110 |
+
$j('#dialog').dialog('open');
|
111 |
+
return false;
|
112 |
+
} );
|
113 |
+
});
|
114 |
+
$j(function() {
|
115 |
+
$j( document ).tooltip();
|
116 |
+
});
|
117 |
+
$j(function() {
|
118 |
+
$j("button").button();
|
119 |
+
|
120 |
+
});
|
121 |
+
</script>
|
122 |
+
<style>
|
123 |
+
label {
|
124 |
+
display: inline-block;
|
125 |
+
width: 5em;
|
126 |
+
}
|
127 |
+
</style>
|
128 |
+
<style type="text/css">
|
129 |
+
div.mlw_quiz_options input[type='text'] {
|
130 |
+
border-color:#000000;
|
131 |
+
color:#3300CC;
|
132 |
+
cursor:hand;
|
133 |
+
}
|
134 |
+
</style>
|
135 |
+
<div class="wrap">
|
136 |
+
<div class='mlw_quiz_options'>
|
137 |
+
<h2>Quiz Results<a id="opener" href="">(?)</a></h2>
|
138 |
+
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
|
139 |
+
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
|
140 |
+
<strong>Hey!</strong> Please go to the Quiz Results page and click on the View link from the result you wish to see.</p>
|
141 |
+
</div>
|
142 |
+
<div id="dialog" title="Help">
|
143 |
+
<h3><b>Help</b></h3>
|
144 |
+
<p>You are getting this error page because this page could not find the results.</p>
|
145 |
+
<p>You must go to the Quiz Results page and click on the result you want to see from that table.</p>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
</div>
|
149 |
+
<?php
|
150 |
+
}
|
151 |
+
}
|
152 |
+
?>
|
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.
|
7 |
Author: Frank Corso
|
8 |
Author URI: http://www.mylocalwebstop.com/
|
9 |
Plugin URI: http://www.mylocalwebstop.com/
|
@@ -29,12 +29,15 @@ include("includes/mlw_quiz_admin.php");
|
|
29 |
include("includes/mlw_quiz_options.php");
|
30 |
include("includes/mlw_quiz_install.php");
|
31 |
include("includes/mlw_results.php");
|
|
|
32 |
include("includes/mlw_tools.php");
|
|
|
33 |
|
34 |
|
35 |
///Activation Actions
|
36 |
add_action('admin_menu', 'mlw_add_menu');
|
37 |
add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode');
|
|
|
38 |
register_activation_hook( __FILE__, 'mlw_quiz_activate');
|
39 |
register_deactivation_hook( __FILE__, 'mlw_quiz_deactivate');
|
40 |
|
@@ -48,6 +51,7 @@ function mlw_add_menu()
|
|
48 |
add_submenu_page(__FILE__, 'Quizzes', 'Quizzes', 8, 'mlw_quiz_admin', 'mlw_generate_quiz_admin');
|
49 |
add_submenu_page(__FILE__, 'Quiz Options', 'Quiz Options', 8, 'mlw_quiz_options', 'mlw_generate_quiz_options');
|
50 |
add_submenu_page(__FILE__, 'Quiz Results', 'Quiz Results', 8, 'mlw_quiz_results', 'mlw_generate_quiz_results');
|
|
|
51 |
add_submenu_page(__FILE__, 'Tools', 'Tools', 8, 'mlw_quiz_tools', 'mlw_generate_quiz_tools');
|
52 |
add_submenu_page(__FILE__, 'Support', 'Support', 8, 'mlw_quiz_support', 'mlw_generate_main_page');
|
53 |
}
|
@@ -56,4 +60,4 @@ function mlw_add_menu()
|
|
56 |
|
57 |
|
58 |
*/
|
59 |
-
?>
|
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.6
|
7 |
Author: Frank Corso
|
8 |
Author URI: http://www.mylocalwebstop.com/
|
9 |
Plugin URI: http://www.mylocalwebstop.com/
|
29 |
include("includes/mlw_quiz_options.php");
|
30 |
include("includes/mlw_quiz_install.php");
|
31 |
include("includes/mlw_results.php");
|
32 |
+
include("includes/mlw_results_details.php");
|
33 |
include("includes/mlw_tools.php");
|
34 |
+
include("includes/mlw_leaderboard.php");
|
35 |
|
36 |
|
37 |
///Activation Actions
|
38 |
add_action('admin_menu', 'mlw_add_menu');
|
39 |
add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode');
|
40 |
+
add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
|
41 |
register_activation_hook( __FILE__, 'mlw_quiz_activate');
|
42 |
register_deactivation_hook( __FILE__, 'mlw_quiz_deactivate');
|
43 |
|
51 |
add_submenu_page(__FILE__, 'Quizzes', 'Quizzes', 8, 'mlw_quiz_admin', 'mlw_generate_quiz_admin');
|
52 |
add_submenu_page(__FILE__, 'Quiz Options', 'Quiz Options', 8, 'mlw_quiz_options', 'mlw_generate_quiz_options');
|
53 |
add_submenu_page(__FILE__, 'Quiz Results', 'Quiz Results', 8, 'mlw_quiz_results', 'mlw_generate_quiz_results');
|
54 |
+
add_submenu_page(__FILE__, 'Quiz Result Details', 'Quiz Result Details', 8, 'mlw_quiz_result_details', 'mlw_generate_result_details');
|
55 |
add_submenu_page(__FILE__, 'Tools', 'Tools', 8, 'mlw_quiz_tools', 'mlw_generate_quiz_tools');
|
56 |
add_submenu_page(__FILE__, 'Support', 'Support', 8, 'mlw_quiz_support', 'mlw_generate_main_page');
|
57 |
}
|
60 |
|
61 |
|
62 |
*/
|
63 |
+
?>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: fpcorso
|
|
3 |
Tags: quiz, test, score, survey
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 3.6.1
|
6 |
-
Stable tag: 0.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -26,6 +26,7 @@ Features include:
|
|
26 |
* Can enable comment boxes for each question and/or comment section at the end of the quiz
|
27 |
* Can enable hints for questions
|
28 |
* Saves the results after a user takes the quiz
|
|
|
29 |
* Features audit trail so admins can keep track of who adds, edits, or deletes quizzes and questions
|
30 |
* Create surveys by utilizing the comment boxes instead of answers
|
31 |
|
@@ -49,6 +50,12 @@ Feel free to use the support option on the main page of the plugin or from the c
|
|
49 |
|
50 |
== Changelog ==
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
= 0.5.3 (October 11, 2013) =
|
53 |
* Bug Fixes
|
54 |
* Started Redesigning Quiz Look
|
@@ -97,6 +104,9 @@ Feel free to use the support option on the main page of the plugin or from the c
|
|
97 |
|
98 |
== Upgrade Notice ==
|
99 |
|
|
|
|
|
|
|
100 |
= 0.5.3 =
|
101 |
Upgrade to fix some minor bug fixes.
|
102 |
|
3 |
Tags: quiz, test, score, survey
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 3.6.1
|
6 |
+
Stable tag: 0.6
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
26 |
* Can enable comment boxes for each question and/or comment section at the end of the quiz
|
27 |
* Can enable hints for questions
|
28 |
* Saves the results after a user takes the quiz
|
29 |
+
* Now saves the users answers and comments after taking the quiz
|
30 |
* Features audit trail so admins can keep track of who adds, edits, or deletes quizzes and questions
|
31 |
* Create surveys by utilizing the comment boxes instead of answers
|
32 |
|
50 |
|
51 |
== Changelog ==
|
52 |
|
53 |
+
= 0.6 (October 19, 2013) =
|
54 |
+
* Started Developing Quiz Leaderboards
|
55 |
+
* Added Ability To Save User Answers And Comments
|
56 |
+
* Added More Statistics To Quiz Dashboard
|
57 |
+
* Bug Fixes
|
58 |
+
|
59 |
= 0.5.3 (October 11, 2013) =
|
60 |
* Bug Fixes
|
61 |
* Started Redesigning Quiz Look
|
104 |
|
105 |
== Upgrade Notice ==
|
106 |
|
107 |
+
= 0.6 =
|
108 |
+
Upgrade to enjoy several new features including saved results and leaderboards!
|
109 |
+
|
110 |
= 0.5.3 =
|
111 |
Upgrade to fix some minor bug fixes.
|
112 |
|