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

Version Description

Upgrade to fix minor bugs, view new how-to page, and new stats on main page.

Download this release

Release Info

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

Code changes from version 0.8.3 to 0.7

{assets → assests}/screenshot-1.png RENAMED
File without changes
{assets → assests}/screenshot-2.png RENAMED
File without changes
{assets → assests}/screenshot-3.png RENAMED
File without changes
{assets → assests}/screenshot-4.png RENAMED
File without changes
{assets → assests}/screenshot-5.png RENAMED
File without changes
includes/mlw_dashboard.php CHANGED
@@ -8,12 +8,8 @@ Copyright 2013, My Local Webstop (email : fpcorso@mylocalwebstop.com)
8
 
9
  function mlw_generate_quiz_dashboard(){
10
  $mlw_quiz_version = get_option('mlw_quiz_master_version');
11
-
12
- ///Creates the widgets
13
- add_meta_box("wpss_mrts", 'Quiz Daily Stats', "mlw_dashboard_box", "quiz_wpss");
14
  add_meta_box("wpss_mrts", 'Help', "mlw_dashboard_box_two", "quiz_wpss2");
15
- add_meta_box("wpss_mrts", 'Quiz Total Stats', "mlw_dashboard_box_three", "quiz_wpss3");
16
- add_meta_box("wpss_mrts", 'Quiz Weekly Stats', "mlw_dashboard_box_four", "quiz_wpss4");
17
  ?>
18
  <!-- css -->
19
  <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
@@ -43,7 +39,7 @@ function mlw_generate_quiz_dashboard(){
43
  } );
44
  });
45
  $j(function() {
46
- $j('.inlinesparkline').sparkline('html', {type: 'line', width: '400', height: '200'});
47
  });
48
  </script>
49
  <style type="text/css">
@@ -68,27 +64,17 @@ function mlw_generate_quiz_dashboard(){
68
  <?php do_meta_boxes('quiz_wpss','advanced',''); ?>
69
  </div>
70
 
71
- <div style="float:right; width:36%;" class="inner-sidebar1">
72
- <?php do_meta_boxes('quiz_wpss3','advanced',''); ?>
73
- </div>
74
-
75
- <!--<div style="clear:both"></div>-->
76
-
77
- <div style="float:left; width:60%;" class="inner-sidebar1">
78
- <?php do_meta_boxes('quiz_wpss4','advanced',''); ?>
79
- </div>
80
-
81
  <div style="float:right; width:36%; " class="inner-sidebar1">
82
  <?php do_meta_boxes('quiz_wpss2','advanced',''); ?>
83
  </div>
84
-
85
  <!--<div style="clear:both"></div>-->
 
86
  <div id="dialog" title="Help">
87
  <h3><b>Help</b></h3>
88
  <p>This page is the main admin page for the Quiz Master Next.</p>
89
- <p>The first widget shows the times all quizzes have been taken over the last week.</p>
90
  <p>The second widget gives tips to better use the plugin.</p>
91
- <p>The third widget lists the total quiz statistics.</p>
92
  </div>
93
 
94
  </div>
@@ -97,87 +83,6 @@ function mlw_generate_quiz_dashboard(){
97
 
98
  function mlw_dashboard_box()
99
  {
100
- //Gather the weekly stats, one variable for each day for the graph
101
- global $wpdb;
102
- $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')";
103
- $mlw_quiz_taken_today = $wpdb->get_results($sql);
104
- $mlw_quiz_taken_today = $wpdb->num_rows;
105
-
106
- $mlw_yesterday = mktime(0, 0, 0, date("m") , date("d")-1, date("Y"));
107
- $mlw_yesterday = date("Y-m-d", $mlw_yesterday);
108
- $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')";
109
- $mlw_quiz_taken_yesterday = $wpdb->get_results($sql);
110
- $mlw_quiz_taken_yesterday = $wpdb->num_rows;
111
-
112
- $mlw_three_days_ago = mktime(0, 0, 0, date("m") , date("d")-2, date("Y"));
113
- $mlw_three_days_ago = date("Y-m-d", $mlw_three_days_ago);
114
- $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_three_days_ago." 00:00:00' AND '".$mlw_three_days_ago." 23:59:59')";
115
- $mlw_quiz_taken_three_days = $wpdb->get_results($sql);
116
- $mlw_quiz_taken_three_days = $wpdb->num_rows;
117
-
118
- $mlw_four_days_ago = mktime(0, 0, 0, date("m") , date("d")-3, date("Y"));
119
- $mlw_four_days_ago = date("Y-m-d", $mlw_four_days_ago);
120
- $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_four_days_ago." 00:00:00' AND '".$mlw_four_days_ago." 23:59:59')";
121
- $mlw_quiz_taken_four_days = $wpdb->get_results($sql);
122
- $mlw_quiz_taken_four_days = $wpdb->num_rows;
123
-
124
- $mlw_five_days_ago = mktime(0, 0, 0, date("m") , date("d")-4, date("Y"));
125
- $mlw_five_days_ago = date("Y-m-d", $mlw_five_days_ago);
126
- $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_five_days_ago." 00:00:00' AND '".$mlw_five_days_ago." 23:59:59')";
127
- $mlw_quiz_taken_five_days = $wpdb->get_results($sql);
128
- $mlw_quiz_taken_five_days = $wpdb->num_rows;
129
-
130
- $mlw_six_days_ago = mktime(0, 0, 0, date("m") , date("d")-5, date("Y"));
131
- $mlw_six_days_ago = date("Y-m-d", $mlw_six_days_ago);
132
- $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_six_days_ago." 00:00:00' AND '".$mlw_six_days_ago." 23:59:59')";
133
- $mlw_quiz_taken_six_days = $wpdb->get_results($sql);
134
- $mlw_quiz_taken_six_days = $wpdb->num_rows;
135
-
136
- $mlw_last_week = mktime(0, 0, 0, date("m") , date("d")-6, date("Y"));
137
- $mlw_last_week = date("Y-m-d", $mlw_last_week);
138
- $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_week." 00:00:00' AND '".$mlw_last_week." 23:59:59')";
139
- $mlw_quiz_taken_week = $wpdb->get_results($sql);
140
- $mlw_quiz_taken_week = $wpdb->num_rows;
141
- ?>
142
- <div>
143
- <span class="inlinesparkline"><?php echo $mlw_quiz_taken_week.",".$mlw_quiz_taken_six_days.",".$mlw_quiz_taken_five_days.",".$mlw_quiz_taken_four_days.",".$mlw_quiz_taken_three_days.",".$mlw_quiz_taken_yesterday.",".$mlw_quiz_taken_today; ?></span>
144
- </div>
145
- <?php
146
- }
147
-
148
- function mlw_dashboard_box_two()
149
- {
150
- ?>
151
- <div>
152
- <table width='100%'>
153
- <tr>
154
- <td align='left'>There is a (?) next to the title of each page. Click on it to bring up the help for that page.</td>
155
- </tr>
156
- <tr>
157
- <td align='left'>If the help does not answer your question, take a look at the How-To section from the menu.</td>
158
- </tr>
159
- <tr>
160
- <td align='left'>If you still are having trouble, feel free to use the support section from the support page to contact me.</td>
161
- </tr>
162
- <tr>
163
- <td align='left'></td>
164
- </tr>
165
- <tr>
166
- <td align='left'></td>
167
- </tr>
168
- <tr>
169
- <td align='left'></td>
170
- </tr>
171
- <tr>
172
- <td align='left'></td>
173
- </tr>
174
- </table>
175
- </div>
176
- <?php
177
- }
178
- function mlw_dashboard_box_three()
179
- {
180
- //Gather some other useful stats
181
  global $wpdb;
182
  $sql = "SELECT SUM(quiz_views) AS QuizViews FROM " . $wpdb->prefix . "mlw_quizzes";
183
  $mlw_quiz_views = $wpdb->get_results($sql);
@@ -226,8 +131,51 @@ function mlw_dashboard_box_three()
226
  $mlw_quiz_most_taken = $mlw_eaches->quiz_name;
227
  break;
228
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  ?>
230
  <div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  <table width='100%'>
232
  <tr>
233
  <td align='left'>Total Times All Quizzes Have Been Viewed</td>
@@ -254,29 +202,39 @@ function mlw_dashboard_box_three()
254
  <td align='right'><?php echo $mlw_quiz_most_taken; ?></td>
255
  </tr>
256
  </table>
 
 
257
  </div>
258
- <?php
259
  }
260
- function mlw_dashboard_box_four()
 
261
  {
262
- //Gather the weekly stats, one variable for each day for the graph
263
- global $wpdb;
264
- $mlw_this_week = mktime(0, 0, 0, date("m") , date("d")-6, date("Y"));
265
- $mlw_this_week = date("Y-m-d", $mlw_this_week);
266
- $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_this_week." 00:00:00' AND '".date("Y-m-d")." 23:59:59')";
267
- $mlw_quiz_taken_this_week = $wpdb->get_results($sql);
268
- $mlw_quiz_taken_this_week = $wpdb->num_rows;
269
-
270
- $mlw_last_week_first = mktime(0, 0, 0, date("m") , date("d")-13, date("Y"));
271
- $mlw_last_week_first = date("Y-m-d", $mlw_last_week_first);
272
- $mlw_last_week_last = mktime(0, 0, 0, date("m") , date("d")-7, date("Y"));
273
- $mlw_last_week_last = date("Y-m-d", $mlw_last_week_last);
274
- $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_week_first." 00:00:00' AND '".$mlw_last_week_last." 23:59:59')";
275
- $mlw_quiz_taken_last_week = $wpdb->get_results($sql);
276
- $mlw_quiz_taken_last_week = $wpdb->num_rows;
277
  ?>
278
  <div>
279
- <span class="inlinesparkline"><?php echo $mlw_quiz_taken_last_week.",".$mlw_quiz_taken_this_week; ?></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  </div>
281
  <?php
282
  }
8
 
9
  function mlw_generate_quiz_dashboard(){
10
  $mlw_quiz_version = get_option('mlw_quiz_master_version');
11
+ add_meta_box("wpss_mrts", 'Quiz Stats', "mlw_dashboard_box", "quiz_wpss");
 
 
12
  add_meta_box("wpss_mrts", 'Help', "mlw_dashboard_box_two", "quiz_wpss2");
 
 
13
  ?>
14
  <!-- css -->
15
  <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
39
  } );
40
  });
41
  $j(function() {
42
+ $j('.inlinesparkline').sparkline('html', {type: 'line', width: '200', height: '200'});
43
  });
44
  </script>
45
  <style type="text/css">
64
  <?php do_meta_boxes('quiz_wpss','advanced',''); ?>
65
  </div>
66
 
 
 
 
 
 
 
 
 
 
 
67
  <div style="float:right; width:36%; " class="inner-sidebar1">
68
  <?php do_meta_boxes('quiz_wpss2','advanced',''); ?>
69
  </div>
70
+
71
  <!--<div style="clear:both"></div>-->
72
+
73
  <div id="dialog" title="Help">
74
  <h3><b>Help</b></h3>
75
  <p>This page is the main admin page for the Quiz Master Next.</p>
76
+ <p>The first widget lists all the statistics collected so far.</p>
77
  <p>The second widget gives tips to better use the plugin.</p>
 
78
  </div>
79
 
80
  </div>
83
 
84
  function mlw_dashboard_box()
85
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  global $wpdb;
87
  $sql = "SELECT SUM(quiz_views) AS QuizViews FROM " . $wpdb->prefix . "mlw_quizzes";
88
  $mlw_quiz_views = $wpdb->get_results($sql);
131
  $mlw_quiz_most_taken = $mlw_eaches->quiz_name;
132
  break;
133
  }
134
+
135
+ $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')";
136
+ $mlw_quiz_taken_today = $wpdb->get_results($sql);
137
+ $mlw_quiz_taken_today = $wpdb->num_rows;
138
+
139
+ $mlw_yesterday = mktime(0, 0, 0, date("m") , date("d")-1, date("Y"));
140
+ $mlw_yesterday = date("Y-m-d", $mlw_yesterday);
141
+ $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')";
142
+ $mlw_quiz_taken_yesterday = $wpdb->get_results($sql);
143
+ $mlw_quiz_taken_yesterday = $wpdb->num_rows;
144
+
145
+ $mlw_three_days_ago = mktime(0, 0, 0, date("m") , date("d")-2, date("Y"));
146
+ $mlw_three_days_ago = date("Y-m-d", $mlw_three_days_ago);
147
+ $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_three_days_ago." 00:00:00' AND '".$mlw_three_days_ago." 23:59:59')";
148
+ $mlw_quiz_taken_three_days = $wpdb->get_results($sql);
149
+ $mlw_quiz_taken_three_days = $wpdb->num_rows;
150
+
151
+ $mlw_last_week = mktime(0, 0, 0, date("m") , date("d")-7, date("Y"));
152
+ $mlw_last_week = date("Y-m-d", $mlw_last_week);
153
+ $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_week." 00:00:00' AND '".date("Y-m-d")." 23:59:59')";
154
+ $mlw_quiz_taken_week = $wpdb->get_results($sql);
155
+ $mlw_quiz_taken_week = $wpdb->num_rows;
156
+
157
+ $mlw_last_month = mktime(0, 0, 0, date("m") , date("d")-30, date("Y"));
158
+ $mlw_last_month = date("Y-m-d", $mlw_last_month);
159
+ $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_month." 00:00:00' AND '".date("Y-m-d")." 23:59:59')";
160
+ $mlw_quiz_taken_month = $wpdb->get_results($sql);
161
+ $mlw_quiz_taken_month = $wpdb->num_rows;
162
  ?>
163
  <div>
164
+ <table cellpadding="10">
165
+ <tr>
166
+ <td>Taken Today: </td>
167
+ <td style="padding: 10px; text-align: right;"><?php echo $mlw_quiz_taken_today; ?></td>
168
+ <td>Taken Yesterday: </td>
169
+ <td style="padding: 10px; text-align: right;"><?php echo $mlw_quiz_taken_yesterday; ?></td>
170
+ </tr>
171
+ <tr>
172
+ <td>Taken Last 7 Days: </td>
173
+ <td style="padding: 10px; text-align: right;"><?php echo $mlw_quiz_taken_week; ?></td>
174
+ <td>Taken Last 30 Days: </td>
175
+ <td style="padding: 10px; text-align: right;"><?php echo $mlw_quiz_taken_month; ?></td>
176
+ </tr>
177
+ </table>
178
+ <br />
179
  <table width='100%'>
180
  <tr>
181
  <td align='left'>Total Times All Quizzes Have Been Viewed</td>
202
  <td align='right'><?php echo $mlw_quiz_most_taken; ?></td>
203
  </tr>
204
  </table>
205
+ <p>Beginnings of line graph for stats. Times all quizzes have been taken over last three days:</p>
206
+ <span class="inlinesparkline"><?php echo $mlw_quiz_taken_three_days.",".$mlw_quiz_taken_yesterday.",".$mlw_quiz_taken_today; ?></span>.
207
  </div>
208
+ <?php
209
  }
210
+
211
+ function mlw_dashboard_box_two()
212
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  ?>
214
  <div>
215
+ <table width='100%'>
216
+ <tr>
217
+ <td align='left'>There is a (?) next to the title of each page. Click on it to bring up the help for that page.</td>
218
+ </tr>
219
+ <tr>
220
+ <td align='left'></td>
221
+ </tr>
222
+ <tr>
223
+ <td align='left'></td>
224
+ </tr>
225
+ <tr>
226
+ <td align='left'></td>
227
+ </tr>
228
+ <tr>
229
+ <td align='left'></td>
230
+ </tr>
231
+ <tr>
232
+ <td align='left'></td>
233
+ </tr>
234
+ <tr>
235
+ <td align='left'></td>
236
+ </tr>
237
+ </table>
238
  </div>
239
  <?php
240
  }
includes/mlw_help.php CHANGED
@@ -41,12 +41,9 @@ function mlw_generate_help_page()
41
  $j(function() {
42
  $j("button").button();
43
  });
44
- $j(function() {
45
- $j("#accordion").accordion({
46
- heightStyle: "content"
47
- });
48
-
49
- });
50
  </script>
51
  <style>
52
  label {
@@ -64,38 +61,22 @@ function mlw_generate_help_page()
64
  <div class="wrap">
65
  <div class='mlw_quiz_options'>
66
  <h2>How-To<a id="opener" href="">(?)</a></h2>
67
- <div id="accordion">
68
- <h3><a href="#">How To Create A Quiz</a></h3>
69
- <div>
 
 
 
70
  In order to create a quiz, test, or survey you must first click on the Quizzes link from the side menu. Once you are on the page, you will see a Create New Quiz button. Click on this button.
71
  Doing so will open a pop-up that will ask for the name of the quiz you would like to create. Once you entered the name in, click on the button that says Create Quiz. You should your
72
  new quiz added to the table.
73
  </div>
74
- <h3><a href="#">How To Add A Question To Your Quiz</a></h3>
75
- <div>
76
  In order to add a question, you must first click on the Quizzes link from the side menu. Once you are on the page, click the edit link on the quiz you wish to add a question to. Once you are on the
77
  Quiz Options page, navigate to the Quiz Questions tab. On the Quiz Questions tab, click on the button that says Add Question. Doing so will open a pop-up that will ask for the question, answers, hint,
78
  correct answer, points, and whether you want a comment box. Once you fill in all the necessary information, click the button that says Create Question. Your question will be added to the list of questions
79
  on the Quiz Questions tab.
80
  </div>
81
- <h3><a href="#">How To Edit The Text Shown Before A Quiz Or After Quiz Has Been Taken</a></h3>
82
- <div>
83
- First, go to the Quizzes page. From there, click edit on the quiz you would like to edit. Once the Quiz Options page loads, click on the Quiz Text tab. This tab is used to edit all the text that can be customized
84
- on the quiz. At the top of the page, you will see a list of variables. If you put a variable in a section of text, it will be replaced by its corresponding values when the quiz is taken by the user. Go to
85
- the section labeled Message Templates. In this section you will see a text box for the Message Displayed Before Quiz and the text box for the Message Displayed After Quiz. By customizing these boxes, you will
86
- edit the text shown to the user before the quiz and after the quiz has been taken. Once finished, click the Save Templates button.
87
- </div>
88
- <h3><a href="#">How To Set-Up Your Quiz For A Correct/Incorrect System</a></h3>
89
- <div>
90
- First, go to the Quizzes page. From there, click edit on the quiz you would like to edit. Once the Quiz Options page loads, click on the Quiz Options tab. Ensure that the "Which system is this quiz graded on?"
91
- option is set to Correct. Now, go back to the Quiz Question tab. When you add or edit a question, fill in the question and the answers. Leave the points fields at 0, and then select the correct answer using
92
- the radio buttons to the right of the answers. Fill out the rest of the question options any way you need to. Your quiz will now be graded on a correct or incorrect system.
93
- </div>
94
- <h3><a href="#">How To Add Your Quiz To A Post Or Page</a></h3>
95
- <div>
96
- First go to the Quizzes page. Once there, copy the shortcode for your quiz from the Quiz Shortcode column. It should look similar to [mlw_quizmaster quiz=1]. Once you have copied your shortcode, go edit the post or
97
- page you would like to add the quiz to. Once on the edit page, paste the shortcode into the textbox. Then click Update. Now when you visit that post or page, your quiz will appear in place of the shortcode.
98
- </div>
99
  </div>
100
  <div id="dialog" title="Help">
101
  <h3><b>Help</b></h3>
41
  $j(function() {
42
  $j("button").button();
43
  });
44
+ $j(function() {
45
+ $j( "#tabs" ).tabs();
46
+ });
 
 
 
47
  </script>
48
  <style>
49
  label {
61
  <div class="wrap">
62
  <div class='mlw_quiz_options'>
63
  <h2>How-To<a id="opener" href="">(?)</a></h2>
64
+ <div id="tabs">
65
+ <ul>
66
+ <li><a href="#tabs-1">How To Create A Quiz</a></li>
67
+ <li><a href="#tabs-2">How To Add A Question To Your Quiz</a></li>
68
+ </ul>
69
+ <div id="tabs-1">
70
  In order to create a quiz, test, or survey you must first click on the Quizzes link from the side menu. Once you are on the page, you will see a Create New Quiz button. Click on this button.
71
  Doing so will open a pop-up that will ask for the name of the quiz you would like to create. Once you entered the name in, click on the button that says Create Quiz. You should your
72
  new quiz added to the table.
73
  </div>
74
+ <div id="tabs-2">
 
75
  In order to add a question, you must first click on the Quizzes link from the side menu. Once you are on the page, click the edit link on the quiz you wish to add a question to. Once you are on the
76
  Quiz Options page, navigate to the Quiz Questions tab. On the Quiz Questions tab, click on the button that says Add Question. Doing so will open a pop-up that will ask for the question, answers, hint,
77
  correct answer, points, and whether you want a comment box. Once you fill in all the necessary information, click the button that says Create Question. Your question will be added to the list of questions
78
  on the Quiz Questions tab.
79
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  </div>
81
  <div id="dialog" title="Help">
82
  <h3><b>Help</b></h3>
includes/mlw_leaderboard.php CHANGED
@@ -8,7 +8,7 @@ function mlw_quiz_leaderboard_shortcode($atts)
8
  'mlw_quiz' => 0
9
  ), $atts));
10
  $mlw_quiz_id = $mlw_quiz;
11
- $mlw_quiz_leaderboard_display = "";
12
 
13
 
14
  global $wpdb;
@@ -21,21 +21,24 @@ function mlw_quiz_leaderboard_shortcode($atts)
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
- $mlw_quiz_leaderboard_display .= "<h3>".$mlw_quiz_options->quiz_name."'s Leaderboard</h3>";
 
 
25
  $leader_count = 0;
26
  foreach($mlw_result_data as $mlw_eaches) {
27
  $leader_count++;
28
  if ($mlw_quiz_options->system == 0)
29
  {
30
- $mlw_quiz_leaderboard_display .= "<p>".$leader_count.".&nbsp;".$mlw_eaches->name."&nbsp; - ".$mlw_eaches->correct_score."%</p>";
31
  }
32
  if ($mlw_quiz_options->system == 1)
33
  {
34
- $mlw_quiz_leaderboard_display .= "<p>".$leader_count.".&nbsp;".$mlw_eaches->name."&nbsp; - ".$mlw_eaches->point_score." Points</p>";
35
  }
36
- $mlw_quiz_leaderboard_display .= "<br />";
37
  }
38
- $mlw_quiz_leaderboard_display .= "<br />";
39
- return $mlw_quiz_leaderboard_display;
 
40
  }
41
  ?>
8
  'mlw_quiz' => 0
9
  ), $atts));
10
  $mlw_quiz_id = $mlw_quiz;
11
+
12
 
13
 
14
  global $wpdb;
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.".&nbsp;".$mlw_eaches->name."&nbsp; - ".$mlw_eaches->correct_score."%";
33
  }
34
  if ($mlw_quiz_options->system == 1)
35
  {
36
+ echo $leader_count.".&nbsp;".$mlw_eaches->name."&nbsp; - ".$mlw_eaches->point_score." Points";
37
  }
38
+ echo "<br />";
39
  }
40
+ ?>
41
+ <br />
42
+ <?php
43
  }
44
  ?>
includes/mlw_main_page.php CHANGED
@@ -43,6 +43,7 @@ function mlw_generate_main_page()
43
  </script>
44
  ";
45
  $mlw_quiz_version = get_option('mlw_quiz_master_version');
 
46
  add_meta_box("wpss_mrts", 'In This Update', "quiz_wpss_mrt_meta_box2", "quiz_wpss2");
47
  add_meta_box("wpss_mrts", 'Support', "quiz_wpss_mrt_meta_box3", "quiz_wpss3");
48
  add_meta_box("wpss_mrts", 'Contribution', "quiz_wpss_mrt_meta_box4", "quiz_wpss4");
@@ -153,25 +154,56 @@ function mlw_generate_main_page()
153
  <?php
154
  }
155
 
156
- function quiz_wpss_mrt_meta_box2()
157
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  ?>
159
  <div>
160
  <table width='100%'>
161
  <tr>
162
- <td align='left'>0.8.3 (December 14, 2013)</td>
 
 
 
 
 
163
  </tr>
 
 
 
 
 
 
 
 
 
 
164
  <tr>
165
- <td align='left'>* Fixed Leaderboard Bug</td>
166
  </tr>
167
  <tr>
168
- <td align='left'>* Started Work On Weekly Stat Widget</td>
169
  </tr>
170
  <tr>
171
- <td align='left'>* Tweaked Some Design Throughout Admin Side</td>
172
  </tr>
173
  <tr>
174
- <td align='left'>* Minor Bug Fixes</td>
175
  </tr>
176
  </table>
177
  </div>
@@ -269,11 +301,6 @@ function quiz_wpss_mrt_meta_box4()
269
  </td>
270
  </tr>
271
  </table>
272
- <p>Thank you to those who have contributed so far.</p>
273
- <h3>Supporters</h3>
274
- <ul>
275
- <li>Tracy B</li>
276
- </ul>
277
  </div>
278
  <?php
279
  }
43
  </script>
44
  ";
45
  $mlw_quiz_version = get_option('mlw_quiz_master_version');
46
+ add_meta_box("wpss_mrts", 'Quiz Master Next', "quiz_wpss_mrt_meta_box", "quiz_wpss");
47
  add_meta_box("wpss_mrts", 'In This Update', "quiz_wpss_mrt_meta_box2", "quiz_wpss2");
48
  add_meta_box("wpss_mrts", 'Support', "quiz_wpss_mrt_meta_box3", "quiz_wpss3");
49
  add_meta_box("wpss_mrts", 'Contribution', "quiz_wpss_mrt_meta_box4", "quiz_wpss4");
154
  <?php
155
  }
156
 
157
+ function quiz_wpss_mrt_meta_box()
158
  {
159
+ global $wpdb;
160
+ $sql = "SELECT SUM(quiz_views) AS QuizViews FROM " . $wpdb->prefix . "mlw_quizzes";
161
+ $mlw_quiz_views = $wpdb->get_results($sql);
162
+
163
+ foreach($mlw_quiz_views as $mlw_eaches) {
164
+ $mlw_quiz_views = $mlw_eaches->QuizViews;
165
+ break;
166
+ }
167
+
168
+ $sql = "SELECT SUM(quiz_taken) AS QuizTaken FROM " . $wpdb->prefix . "mlw_quizzes";
169
+ $mlw_quiz_taken = $wpdb->get_results($sql);
170
+
171
+ foreach($mlw_quiz_taken as $mlw_eaches) {
172
+ $mlw_quiz_taken = $mlw_eaches->QuizTaken;
173
+ break;
174
+ }
175
  ?>
176
  <div>
177
  <table width='100%'>
178
  <tr>
179
+ <td align='left'>Total Times All Quizzes Have Been Viewed</td>
180
+ <td align='right'><?php echo $mlw_quiz_views; ?></td>
181
+ </tr>
182
+ <tr>
183
+ <td align='left'>Total Times All Quizzes Have Been Taken</td>
184
+ <td align='right'><?php echo $mlw_quiz_taken; ?></td>
185
  </tr>
186
+ </table>
187
+ </div>
188
+ <?php
189
+ }
190
+
191
+ function quiz_wpss_mrt_meta_box2()
192
+ {
193
+ ?>
194
+ <div>
195
+ <table width='100%'>
196
  <tr>
197
+ <td align='left'>0.7 (November 15, 2013)</td>
198
  </tr>
199
  <tr>
200
+ <td align='left'>* Bug Fixes</td>
201
  </tr>
202
  <tr>
203
+ <td align='left'>* Begun Work On New How-To Page</td>
204
  </tr>
205
  <tr>
206
+ <td align='left'>* Continued Redesigning Plugin Dashboard</td>
207
  </tr>
208
  </table>
209
  </div>
301
  </td>
302
  </tr>
303
  </table>
 
 
 
 
 
304
  </div>
305
  <?php
306
  }
includes/mlw_quiz.php CHANGED
@@ -29,7 +29,7 @@ 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
 
@@ -39,7 +39,6 @@ function mlw_quiz_shortcode($atts)
39
  $mlw_user_comp = $_POST["mlwUserComp"];
40
  $mlw_user_email = $_POST["mlwUserEmail"];
41
  $mlw_user_phone = $_POST["mlwUserPhone"];
42
- $mlw_spam_email = $_POST["email"];
43
 
44
  /*
45
  The following code is for displaying the quiz and completion screen
@@ -143,7 +142,7 @@ function mlw_quiz_shortcode($atts)
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'>";
@@ -235,8 +234,6 @@ function mlw_quiz_shortcode($atts)
235
  $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
236
  $mlw_display .= "<br />";
237
  }
238
- $mlw_display .= "<span style='display: none;'>If you are human, leave this field blank or you will be considered spam:</span>";
239
- $mlw_display .= "<input style='display: none;' type='text' name='email' id='email' />";
240
  $mlw_display .= "<input type='hidden' name='complete_quiz' value='confirmation' />";
241
  $mlw_display .= "<input type='submit' value='".$mlw_quiz_options->submit_button_text."' />";
242
  $mlw_display .= "<span name='mlw_error_message_bottom' id='mlw_error_message_bottom' style='color: red;'></span><br />";
@@ -246,8 +243,6 @@ function mlw_quiz_shortcode($atts)
246
  //Display Completion Screen
247
  else
248
  {
249
- if (empty($mlw_spam_email))
250
- {
251
  //Variables needed for scoring
252
  $mlw_points = 0;
253
  $mlw_correct = 0;
@@ -389,11 +384,6 @@ function mlw_quiz_shortcode($atts)
389
  "(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) " .
390
  "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)";
391
  $results = $wpdb->query( $insert );
392
- }
393
- else
394
- {
395
- $mlw_display .= "Thank you.";
396
- }
397
  }
398
  return $mlw_display;
399
  }
29
 
30
 
31
  //Load questions
32
+ $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0'";
33
  $mlw_questions = $wpdb->get_results($sql);
34
 
35
 
39
  $mlw_user_comp = $_POST["mlwUserComp"];
40
  $mlw_user_email = $_POST["mlwUserEmail"];
41
  $mlw_user_phone = $_POST["mlwUserPhone"];
 
42
 
43
  /*
44
  The following code is for displaying the quiz and completion screen
142
  $mlw_display .= "<table>";
143
  $mlw_display .= "<thead>";
144
 
145
+ //See if the site wants to ask for anything, then ask for it
146
  if ($mlw_quiz_options->user_name != 2)
147
  {
148
  $mlw_display .= "<tr valign='top'>";
234
  $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
235
  $mlw_display .= "<br />";
236
  }
 
 
237
  $mlw_display .= "<input type='hidden' name='complete_quiz' value='confirmation' />";
238
  $mlw_display .= "<input type='submit' value='".$mlw_quiz_options->submit_button_text."' />";
239
  $mlw_display .= "<span name='mlw_error_message_bottom' id='mlw_error_message_bottom' style='color: red;'></span><br />";
243
  //Display Completion Screen
244
  else
245
  {
 
 
246
  //Variables needed for scoring
247
  $mlw_points = 0;
248
  $mlw_correct = 0;
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;
389
  }
includes/mlw_quiz_admin.php CHANGED
@@ -8,6 +8,16 @@ Copyright 2013, My Local Webstop (email : fpcorso@mylocalwebstop.com)
8
 
9
  function mlw_generate_quiz_admin()
10
  {
 
 
 
 
 
 
 
 
 
 
11
  global $wpdb;
12
  $table_name = $wpdb->prefix . "mlw_quizzes";
13
  $success = $_POST["create_quiz"];
8
 
9
  function mlw_generate_quiz_admin()
10
  {
11
+ $data = "0.7";
12
+ if ( ! get_option('mlw_quiz_master_version'))
13
+ {
14
+ add_option('mlw_quiz_master_version' , $data);
15
+ }
16
+ else
17
+ {
18
+ update_option('mlw_quiz_master_version' , $data);
19
+ }
20
+
21
  global $wpdb;
22
  $table_name = $wpdb->prefix . "mlw_quizzes";
23
  $success = $_POST["create_quiz"];
includes/mlw_quiz_install.php CHANGED
@@ -75,6 +75,30 @@ function mlw_quiz_activate()
75
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
76
  dbDelta($sql);
77
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  global $wpdb;
79
 
80
  $table_name = $wpdb->prefix . "mlw_questions";
@@ -120,8 +144,6 @@ function mlw_quiz_activate()
120
  comments INT NOT NULL,
121
 
122
  hints TEXT NOT NULL,
123
-
124
- question_order INT NOT NULL,
125
 
126
  deleted INT NOT NULL,
127
 
@@ -135,6 +157,25 @@ function mlw_quiz_activate()
135
  dbDelta($sql);
136
  }
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  global $wpdb;
139
 
140
  $table_name = $wpdb->prefix . "mlw_results";
@@ -234,6 +275,15 @@ function mlw_quiz_activate()
234
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
235
  dbDelta($sql);
236
  }
 
 
 
 
 
 
 
 
 
237
  }
238
 
239
  function mlw_quiz_deactivate()
75
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
76
  dbDelta($sql);
77
  }
78
+
79
+ else
80
+
81
+ {
82
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'comment_section'") != "comment_section")
83
+ {
84
+ $sql = "ALTER TABLE ".$table_name." ADD comment_field_text TEXT NOT NULL AFTER phone_field_text";
85
+
86
+ $results = $wpdb->query( $sql );
87
+
88
+ $sql = "ALTER TABLE ".$table_name." ADD comment_section INT NOT NULL AFTER admin_email";
89
+
90
+ $results = $wpdb->query( $sql );
91
+
92
+ $sql = "ALTER TABLE ".$table_name." ADD message_comment TEXT NOT NULL AFTER message_after";
93
+
94
+ $results = $wpdb->query( $sql );
95
+
96
+ $update_sql = "UPDATE ".$table_name." SET comment_field_text='Comments', comment_section=1, message_comment='Enter You Text Here'";
97
+
98
+ $results = $wpdb->query( $update_sql );
99
+ }
100
+ }
101
+
102
  global $wpdb;
103
 
104
  $table_name = $wpdb->prefix . "mlw_questions";
144
  comments INT NOT NULL,
145
 
146
  hints TEXT NOT NULL,
 
 
147
 
148
  deleted INT NOT NULL,
149
 
157
  dbDelta($sql);
158
  }
159
 
160
+ else
161
+
162
+ {
163
+ if($wpdb->get_var("SHOW COLUMNS FROM ".$table_name." LIKE 'comments'") != "comments")
164
+ {
165
+ $sql = "ALTER TABLE ".$table_name." ADD comments INT NOT NULL AFTER correct_answer";
166
+
167
+ $results = $wpdb->query( $sql );
168
+
169
+ $sql = "ALTER TABLE ".$table_name." ADD hints TEXT NOT NULL AFTER comments";
170
+
171
+ $results = $wpdb->query( $sql );
172
+
173
+ $update_sql = "UPDATE ".$table_name." SET comments=1, hints=''";
174
+
175
+ $results = $wpdb->query( $update_sql );
176
+ }
177
+ }
178
+
179
  global $wpdb;
180
 
181
  $table_name = $wpdb->prefix . "mlw_results";
275
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
276
  dbDelta($sql);
277
  }
278
+ $data = "0.7";
279
+ if ( ! get_option('mlw_quiz_master_version'))
280
+ {
281
+ add_option('mlw_quiz_master_version' , $data);
282
+ }
283
+ else
284
+ {
285
+ update_option('mlw_quiz_master_version' , $data);
286
+ }
287
  }
288
 
289
  function mlw_quiz_deactivate()
includes/mlw_quiz_options.php CHANGED
@@ -55,13 +55,12 @@ function mlw_generate_quiz_options()
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"];
59
 
60
  //Edit question
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
 
@@ -103,7 +102,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
 
@@ -123,7 +122,7 @@ function mlw_generate_quiz_options()
123
  global $wpdb;
124
  $table_name = $wpdb->prefix . "mlw_questions";
125
  $sql = "SELECT * FROM " . $table_name . " WHERE quiz_id=".$quiz_id." AND deleted=0";
126
- $sql .= " ORDER BY question_order ASC";
127
  $mlw_question_data = $wpdb->get_results($sql);
128
  $is_new_quiz = $wpdb->num_rows;
129
  }
@@ -374,7 +373,7 @@ 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',
@@ -402,7 +401,6 @@ function mlw_generate_quiz_options()
402
  document.getElementById("edit_answer_five_points").value = answerFivePoints;
403
  document.getElementById("edit_answer_six_points").value = answerSixPoints;
404
  document.getElementById("edit_hint").value = hint;
405
- document.getElementById("edit_question_order").value = question_order;
406
  if (correctAnswer == 1) document.getElementById("edit_correct_one").checked = true;
407
  if (correctAnswer == 2) document.getElementById("edit_correct_two").checked = true;
408
  if (correctAnswer == 3) document.getElementById("edit_correct_three").checked = true;
@@ -497,8 +495,8 @@ function mlw_generate_quiz_options()
497
  if($alternate) $alternate = "";
498
  else $alternate = " class=\"alternate\"";
499
  $question_list .= "<tr{$alternate}>";
500
- $question_list .= "<td><span style='font-size:16px;'>" . $mlw_question_info->question_order . "</span></td>";
501
- $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."','".$mlw_question_info->question_name."','".$mlw_question_info->answer_one."','".$mlw_question_info->answer_one_points."','".$mlw_question_info->answer_two."','".$mlw_question_info->answer_two_points."','".$mlw_question_info->answer_three."','".$mlw_question_info->answer_three_points."','".$mlw_question_info->answer_four."','".$mlw_question_info->answer_four_points."','".$mlw_question_info->answer_five."','".$mlw_question_info->answer_five_points."','".$mlw_question_info->answer_six."','".$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>";
502
  $question_list .= "</tr>";
503
  }
504
 
@@ -522,11 +520,10 @@ function mlw_generate_quiz_options()
522
  ?>
523
  <tr valign="top">
524
  <th scope="row">Question</th>
525
- <td colspan="3">
526
  <input type="text" name="question_name" value="" style="border-color:#000000;
527
  color:#3300CC;
528
- cursor:hand;
529
- width: 100%;"/>
530
  </td>
531
  </tr>
532
  <tr valign="top">
@@ -623,8 +620,6 @@ function mlw_generate_quiz_options()
623
  </td>
624
  <td><input type="radio" name="correct_answer" value=6 /></td>
625
  </tr>
626
- <tr><td>&nbsp;</td></tr>
627
- <tr><td>&nbsp;</td></tr>
628
  <tr valign="top">
629
  <th scope="row">Comments?</th>
630
  <td><input type="radio" id="commentsRadio1" name="comments" checked="checked" value=0 /><label for="commentsRadio1">Yes</label></td>
@@ -658,11 +653,10 @@ function mlw_generate_quiz_options()
658
  ?>
659
  <tr valign="top">
660
  <th scope="row">Question</th>
661
- <td colspan="3">
662
  <input type="text" name="edit_question_name" id="edit_question_name" value="" style="border-color:#000000;
663
  color:#3300CC;
664
- cursor:hand;
665
- width: 100%;"/>
666
  </td>
667
  </tr>
668
  <tr valign="top">
@@ -759,8 +753,6 @@ function mlw_generate_quiz_options()
759
  </td>
760
  <td><input type="radio" id="edit_correct_six" name="edit_correct_answer" value=6 /></td>
761
  </tr>
762
- <tr><td>&nbsp;</td></tr>
763
- <tr><td>&nbsp;</td></tr>
764
  <tr valign="top">
765
  <th scope="row">Comments?</th>
766
  <td><input type="radio" id="editCommentRadio1" name="edit_comments" value=0 /><label for="editCommentRadio1">Yes</label></td>
@@ -774,14 +766,6 @@ function mlw_generate_quiz_options()
774
  cursor:hand;"/>
775
  </td>
776
  </tr>
777
- <tr valign="top">
778
- <th scope="row">Question Order</th>
779
- <td>
780
- <input type="text" name="edit_question_order" value="" id="edit_question_order" style="border-color:#000000;
781
- color:#3300CC;
782
- cursor:hand;"/>
783
- </td>
784
- </tr>
785
  </thead>
786
  </table>
787
  <?php
@@ -1011,6 +995,10 @@ function mlw_generate_quiz_options()
1011
  <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>
1012
  </div></td>
1013
  </tr>
 
 
 
 
1014
  <tr valign="top">
1015
  <th scope="row"><label for="commentSection">Would you like a place for the user to enter comments?</label></th>
1016
  <td><div id="commentSection">
@@ -1018,10 +1006,6 @@ function mlw_generate_quiz_options()
1018
  <input type="radio" id="radio22" name="commentSection" <?php if ($mlw_quiz_options->comment_section == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio22">No</label>
1019
  </div></td>
1020
  </tr>
1021
- <tr valign="top">
1022
- <th scope="row"><label for="adminEmail">What email should we send the answers to?</label></th>
1023
- <td><input name="adminEmail" type="email" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
1024
- </tr>
1025
  </table>
1026
  <?php echo "</form>"; ?>
1027
  </div>
55
  $mlw_edit_question_id = $_POST["edit_question_id"];
56
  $edit_comments = $_POST["edit_comments"];
57
  $edit_hint = $_POST["edit_hint"];
 
58
 
59
  //Edit question
60
  if ($edit_question_success == "confirmation")
61
  {
62
  $quiz_id = $_POST["quiz_id"];
63
+ $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."' WHERE question_id=".$mlw_edit_question_id;
64
  $results = $wpdb->query( $update );
65
  $hasUpdatedQuestion = true;
66
 
102
  $quiz_id = $_POST["quiz_id"];
103
  $table_name = $wpdb->prefix . "mlw_questions";
104
  $insert = "INSERT INTO " . $table_name .
105
+ " (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, 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."', 0)";
106
  $results = $wpdb->query( $insert );
107
  $hasCreatedQuestion = true;
108
 
122
  global $wpdb;
123
  $table_name = $wpdb->prefix . "mlw_questions";
124
  $sql = "SELECT * FROM " . $table_name . " WHERE quiz_id=".$quiz_id." AND deleted=0";
125
+ $sql .= " ORDER BY question_id ASC";
126
  $mlw_question_data = $wpdb->get_results($sql);
127
  $is_new_quiz = $wpdb->num_rows;
128
  }
373
  idText.innerHTML = id;
374
  idHidden.value = id;
375
  };
376
+ function editQuestion(id, question, answerOne, answerOnePoints, answerTwo, answerTwoPoints, answerThree, answerThreePoints, answerFour, answerFourPoints, answerFive, answerFivePoints, answerSix, answerSixPoints, correctAnswer, comments, hint){
377
  $j("#edit_question_dialog").dialog({
378
  autoOpen: false,
379
  show: 'blind',
401
  document.getElementById("edit_answer_five_points").value = answerFivePoints;
402
  document.getElementById("edit_answer_six_points").value = answerSixPoints;
403
  document.getElementById("edit_hint").value = hint;
 
404
  if (correctAnswer == 1) document.getElementById("edit_correct_one").checked = true;
405
  if (correctAnswer == 2) document.getElementById("edit_correct_two").checked = true;
406
  if (correctAnswer == 3) document.getElementById("edit_correct_three").checked = true;
495
  if($alternate) $alternate = "";
496
  else $alternate = " class=\"alternate\"";
497
  $question_list .= "<tr{$alternate}>";
498
+ $question_list .= "<td><span style='font-size:16px;'>" . $mlw_question_info->question_id . "</span></td>";
499
+ $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."','".$mlw_question_info->question_name."','".$mlw_question_info->answer_one."','".$mlw_question_info->answer_one_points."','".$mlw_question_info->answer_two."','".$mlw_question_info->answer_two_points."','".$mlw_question_info->answer_three."','".$mlw_question_info->answer_three_points."','".$mlw_question_info->answer_four."','".$mlw_question_info->answer_four_points."','".$mlw_question_info->answer_five."','".$mlw_question_info->answer_five_points."','".$mlw_question_info->answer_six."','".$mlw_question_info->answer_six_points."','".$mlw_question_info->correct_answer."','".$mlw_question_info->comments."','".$mlw_question_info->hints."')\" href='#'>Edit</a> | <a onclick=\"deleteQuestion('".$mlw_question_info->question_id."')\" href='#'>Delete</a></span></div></td>";
500
  $question_list .= "</tr>";
501
  }
502
 
520
  ?>
521
  <tr valign="top">
522
  <th scope="row">Question</th>
523
+ <td>
524
  <input type="text" name="question_name" value="" style="border-color:#000000;
525
  color:#3300CC;
526
+ cursor:hand;"/>
 
527
  </td>
528
  </tr>
529
  <tr valign="top">
620
  </td>
621
  <td><input type="radio" name="correct_answer" value=6 /></td>
622
  </tr>
 
 
623
  <tr valign="top">
624
  <th scope="row">Comments?</th>
625
  <td><input type="radio" id="commentsRadio1" name="comments" checked="checked" value=0 /><label for="commentsRadio1">Yes</label></td>
653
  ?>
654
  <tr valign="top">
655
  <th scope="row">Question</th>
656
+ <td>
657
  <input type="text" name="edit_question_name" id="edit_question_name" value="" style="border-color:#000000;
658
  color:#3300CC;
659
+ cursor:hand;"/>
 
660
  </td>
661
  </tr>
662
  <tr valign="top">
753
  </td>
754
  <td><input type="radio" id="edit_correct_six" name="edit_correct_answer" value=6 /></td>
755
  </tr>
 
 
756
  <tr valign="top">
757
  <th scope="row">Comments?</th>
758
  <td><input type="radio" id="editCommentRadio1" name="edit_comments" value=0 /><label for="editCommentRadio1">Yes</label></td>
766
  cursor:hand;"/>
767
  </td>
768
  </tr>
 
 
 
 
 
 
 
 
769
  </thead>
770
  </table>
771
  <?php
995
  <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>
996
  </div></td>
997
  </tr>
998
+ <tr valign="top">
999
+ <th scope="row"><label for="adminEmail">What email should we send the answers to?</label></th>
1000
+ <td><input name="adminEmail" type="email" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
1001
+ </tr>
1002
  <tr valign="top">
1003
  <th scope="row"><label for="commentSection">Would you like a place for the user to enter comments?</label></th>
1004
  <td><div id="commentSection">
1006
  <input type="radio" id="radio22" name="commentSection" <?php if ($mlw_quiz_options->comment_section == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio22">No</label>
1007
  </div></td>
1008
  </tr>
 
 
 
 
1009
  </table>
1010
  <?php echo "</form>"; ?>
1011
  </div>
includes/mlw_update.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
-
3
- function mlw_quiz_update()
4
- {
5
- $data = "0.8.3";
6
- if ( ! get_option('mlw_quiz_master_version'))
7
- {
8
- add_option('mlw_quiz_master_version' , $data);
9
- }
10
- elseif (get_option('mlw_quiz_master_version') != $data)
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";
17
- $results = $wpdb->query( $sql );
18
- $sql = "ALTER TABLE ".$table_name." ADD comment_section INT NOT NULL AFTER admin_email";
19
- $results = $wpdb->query( $sql );
20
- $sql = "ALTER TABLE ".$table_name." ADD message_comment TEXT NOT NULL AFTER message_after";
21
- $results = $wpdb->query( $sql );
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";
30
- $results = $wpdb->query( $sql );
31
- $sql = "ALTER TABLE ".$table_name." ADD hints TEXT NOT NULL AFTER comments";
32
- $results = $wpdb->query( $sql );
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";
40
- $results = $wpdb->query( $sql );
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
- }
47
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.3
7
  Author: Frank Corso
8
  Author URI: http://www.mylocalwebstop.com/
9
  Plugin URI: http://www.mylocalwebstop.com/
@@ -33,12 +33,10 @@ include("includes/mlw_results_details.php");
33
  include("includes/mlw_tools.php");
34
  include("includes/mlw_leaderboard.php");
35
  include("includes/mlw_help.php");
36
- include("includes/mlw_update.php");
37
 
38
 
39
  ///Activation Actions
40
  add_action('admin_menu', 'mlw_add_menu');
41
- add_action('init', 'mlw_quiz_update');
42
  add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode');
43
  add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
44
  register_activation_hook( __FILE__, 'mlw_quiz_activate');
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
7
  Author: Frank Corso
8
  Author URI: http://www.mylocalwebstop.com/
9
  Plugin URI: http://www.mylocalwebstop.com/
33
  include("includes/mlw_tools.php");
34
  include("includes/mlw_leaderboard.php");
35
  include("includes/mlw_help.php");
 
36
 
37
 
38
  ///Activation Actions
39
  add_action('admin_menu', 'mlw_add_menu');
 
40
  add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode');
41
  add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
42
  register_activation_hook( __FILE__, 'mlw_quiz_activate');
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.7.1
6
- Stable tag: 0.8.3
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.
@@ -47,34 +47,6 @@ Feel free to use the support option on the main page of the plugin or from the c
47
 
48
  == Changelog ==
49
 
50
- = 0.8.3 (December 14, 2013) =
51
- * Fixed Leaderboard Bug
52
- * Started Work On Weekly Stat Widget
53
- * Tweaked Some Design Throughout Admin Side
54
- * Minor Bug Fixes
55
-
56
- = 0.8.2 (December 10, 2013) =
57
- * Fixed Disappearing Question Bug Completely
58
- * Updated Update Process
59
-
60
- = 0.8.1 (December 9, 2013) =
61
- * Fixed Disappearing Question Bug
62
-
63
- = 0.8 (December 1, 2013) =
64
- * Added Spam Prevention Techniques To Backend
65
- * Added Ability To Reorder Questions
66
- * Added New Section On How-To Page
67
- * Bug Fixes
68
-
69
- = 0.7.2 (November 24, 2013) =
70
- * Bug Fixes
71
- * Added New Section On How-To Page
72
-
73
- = 0.7.1 (November 19, 2013) =
74
- * Changed Design For How-To Page
75
- * Added New Section In How-To Page
76
- * Added New Widget On Plugin Dashboard For Daily Stats
77
-
78
  = 0.7 (November 15, 2013) =
79
  * Bug Fixes
80
  * Begun Work On New How-To Page
@@ -142,24 +114,6 @@ Feel free to use the support option on the main page of the plugin or from the c
142
 
143
  == Upgrade Notice ==
144
 
145
- = 0.8.3 =
146
- Upgrade to enjoy small tweaks throughout admin side
147
-
148
- = 0.8.2 =
149
- Upgrade to fix bug that made questions vanish.
150
-
151
- = 0.8.1 =
152
- Upgrade to fix bug that made questions vanish.
153
-
154
- = 0.8 =
155
- Upgrade to enjoy several new features and minor bug fixes.
156
-
157
- = 0.7.2 =
158
- Upgrade to fix minor bugs and view new section on how-to page.
159
-
160
- = 0.7.1 =
161
- Upgrade to fix minor bugs, view new section how-to page, and new stats on main page.
162
-
163
  = 0.7 =
164
  Upgrade to fix minor bugs, view new how-to page, and new stats on main page.
165
 
3
  Tags: quiz, test, score, survey
4
  Requires at least: 3.0.1
5
  Tested up to: 3.7.1
6
+ Stable tag: 0.7
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.
47
 
48
  == Changelog ==
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  = 0.7 (November 15, 2013) =
51
  * Bug Fixes
52
  * Begun Work On New How-To Page
114
 
115
  == Upgrade Notice ==
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  = 0.7 =
118
  Upgrade to fix minor bugs, view new how-to page, and new stats on main page.
119