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

Version Description

Upgrade for redesigned admin results pages, new global settings page, ability to edit facebook app id, and more.

Download this release

Release Info

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

Code changes from version 4.0.1 to 4.1.0

includes/css/qmn_admin.css ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .template_list_holder
2
+ {
3
+ width: 100%;
4
+ }
5
+ .template_variable
6
+ {
7
+ width: 50%;
8
+ float: left;
9
+ font-size: 14px;
10
+ }
11
+ .template_name
12
+ {
13
+ font-weight: bold;
14
+ }
includes/js/qmn_social_share.js CHANGED
@@ -1,4 +1,4 @@
1
- function mlw_qmn_share(network, mlw_qmn_social_text, mlw_qmn_title)
2
  {
3
  var sTop = window.screen.height/2-(218);
4
  var sLeft = window.screen.width/2-(313);
@@ -9,7 +9,7 @@ function mlw_qmn_share(network, mlw_qmn_social_text, mlw_qmn_title)
9
  {
10
  var Url = "https://www.facebook.com/dialog/feed?"
11
  + "display=popup&"
12
- + "app_id=483815031724529&"
13
  + "link=" + pageUrlEncoded + "&"
14
  + "name=" + encodeURIComponent(mlw_qmn_social_text) + "&"
15
  + "description= &"
1
+ function mlw_qmn_share(network, mlw_qmn_social_text, mlw_qmn_title, facebook_id)
2
  {
3
  var sTop = window.screen.height/2-(218);
4
  var sLeft = window.screen.width/2-(313);
9
  {
10
  var Url = "https://www.facebook.com/dialog/feed?"
11
  + "display=popup&"
12
+ + "app_id="+facebook_id+"&"
13
  + "link=" + pageUrlEncoded + "&"
14
  + "name=" + encodeURIComponent(mlw_qmn_social_text) + "&"
15
  + "description= &"
includes/qmn_credits.php CHANGED
@@ -8,8 +8,8 @@ Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com)
8
 
9
  function mlw_generate_about_page()
10
  {
11
- //Page Variables
12
- $mlw_quiz_version = get_option('mlw_quiz_master_version');
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" />
@@ -94,17 +94,20 @@ function mlw_generate_about_page()
94
  <?php _e('Requested Features', 'quiz-master-next'); ?></a>
95
  </h2>
96
  <div id="mlw_quiz_what_new">
97
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Categories</h2>
98
- <p style="text-align: center;">You can now assign a category when editing a question or adding a new question. You can then use the new variables to show the user their score in a particular category or an average of the categories.</p>
99
  <br />
100
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Enhanced Required System</h2>
101
- <p style="text-align: center;">You can now require multiple choice and multiple response questions to be answered before submitting the quiz.</p>
102
  <br />
103
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Enhanced Results Pages</h2>
104
- <p style="text-align: center;">You now use the WordPress editor when editing the Results Pages. You can also now use some shortcodes!</p>
105
  <br />
106
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Settings Page Designs</h2>
107
- <p style="text-align: center;">You will notice many design changes on the settings page as we are still converting our design to a more WordPress feel.</p>
 
 
 
108
  <br />
109
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">This Plugin Is Now Translation Ready!</h2>
110
  <p style="text-align: center;">For those who wish to assist in translating, you can find the POT in the languages folder. If you do not know what that is, feel free to contact me and I will assist you with it.</p>
@@ -112,31 +115,30 @@ function mlw_generate_about_page()
112
  <hr />
113
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">For Developers:</h2>
114
  <br />
115
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Plugin Helper Class</h2>
116
- <p style="text-align: center;">Our new plugin helper class has many functions to assist you in extending the plugin.</p>
117
- <br />
118
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Converted To Extendable Question Types</h2>
119
- <p style="text-align: center;">With the new system, you can use the plugin helper class to create custom question types.</p>
120
- <br />
121
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">20 New Filters And Hooks</h2>
122
- <p style="text-align: center;">We added lots of filters and hooks throughout the code especially in the redesigned quiz shortcode file.</p>
123
- <br />
124
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Rewrote 75% Of Quiz Shortcode File</h2>
125
- <p style="text-align: center;">We took the time to rewrite almost all of the quiz shortcode file as it severly needed it. We created the new Quiz Manager class here as well.</p>
126
  <br />
127
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">We Are On GitHub Now</h2>
128
  <p style="text-align: center;">We have had several users ask for this so we thought we would try it out. We now love github! Be sure to <a href="https://github.com/fpcorso/quiz_master_next/">make suggestions or contribute</a>.</p>
129
  <br />
130
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Please Take Our Survey To Better Improve This Plugin</h2>
131
- <p style="text-align: center;">When you have a moment, please take our survey for this plugin. By filling out the survey, you are helping us improve this plugin. Users who take the survey between now and December 31st, 2014 will be emailed a 25% off coupon for our WordPress Store. When you are ready, please <a href='http://mylocalwebstop.com/quiz-master-next-survey/'>take our survey</a>.</p>
132
- <br />
133
  </div>
134
  <div id="mlw_quiz_changelog" style="display: none;">
135
- <h3><?php echo $mlw_quiz_version; ?> (January 21, 2015)</h3>
136
  <ul>
137
- <li>* Results HTML Bug Fix</li>
138
- <li>* Question HTML Bug Fix</li>
139
- <li>* Multiple Response Points Bug Fix</li>
 
 
 
 
 
 
 
 
 
 
 
140
  </ul>
141
  </div>
142
  <div id="mlw_quiz_requested" style="display: none;">
@@ -153,7 +155,6 @@ function mlw_generate_about_page()
153
  <li>Allow Quiz To Not Show Start Page</li>
154
  <li>Progress Bar For Timer</li>
155
  <li>Ability To Redirect User Instead Of Showing Results Page</li>
156
- <li>Multi-Delete Option For Quiz Results</li>
157
  <li>Graphical Click Aware Questions</li>
158
  <li>Results Bar Graph For Users Taking Polls</li>
159
  <li>Head To Head Comparison Questions</li>
8
 
9
  function mlw_generate_about_page()
10
  {
11
+ global $mlwQuizMasterNext;
12
+ $mlw_quiz_version = $mlwQuizMasterNext->version;
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" />
94
  <?php _e('Requested Features', 'quiz-master-next'); ?></a>
95
  </h2>
96
  <div id="mlw_quiz_what_new">
97
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Admin Result Pages Redesigned</h2>
98
+ <p style="text-align: center;">This version redesigned the admin result pages. You can now multi-delete results. You can now go to the previous/next results when viewing results.</p>
99
  <br />
100
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Restore Deleted Quizzes</h2>
101
+ <p style="text-align: center;">You can now restore quizzes that you have deleted! To do so, visit the Tools page.</p>
102
  <br />
103
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Quizzes Have Direct URLs</h2>
104
+ <p style="text-align: center;">We have started to incorporate the custom post type system. As such, newer quizzes will have direct urls. Users can search for quizzes and view an archive of your quizzes. To disable these features, navigate to our new Settings page in the Quizzes menu.</p>
105
  <br />
106
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Ability To Use Own Facebook App ID</h2>
107
+ <p style="text-align: center;">Many users have been asking to use their own app ID instead. You can now use your own app by changing the app id on the new Settings page.</p>
108
+ <br />
109
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Please Take Our Survey To Better Improve This Plugin</h2>
110
+ <p style="text-align: center;">When you have a moment, please take our survey for this plugin. By filling out the survey, you are helping us improve this plugin. Users who take the survey between now and March 31st, 2015 will be emailed a 25% off coupon for our WordPress Store. When you are ready, please <a href='http://mylocalwebstop.com/quiz-master-next-survey/'>take our survey</a>.</p>
111
  <br />
112
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">This Plugin Is Now Translation Ready!</h2>
113
  <p style="text-align: center;">For those who wish to assist in translating, you can find the POT in the languages folder. If you do not know what that is, feel free to contact me and I will assist you with it.</p>
115
  <hr />
116
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">For Developers:</h2>
117
  <br />
118
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Hook For The Template Variable List</h2>
119
+ <p style="text-align: center;">You can now display your custom variables using the new qmn_template_variable_list hook.</p>
 
 
 
 
 
 
 
 
 
120
  <br />
121
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">We Are On GitHub Now</h2>
122
  <p style="text-align: center;">We have had several users ask for this so we thought we would try it out. We now love github! Be sure to <a href="https://github.com/fpcorso/quiz_master_next/">make suggestions or contribute</a>.</p>
123
  <br />
 
 
 
124
  </div>
125
  <div id="mlw_quiz_changelog" style="display: none;">
126
+ <h3><?php echo $mlw_quiz_version; ?> (February 11, 2015)</h3>
127
  <ul>
128
+ <li>* Added Ability To Restore Deleted Quizzes <a href="https://github.com/fpcorso/quiz_master_next/issues/107" target="_blank">GitHub Issue #107</a></li>
129
+ <li>* Added Ability To Multi-Delete Results <a href="https://github.com/fpcorso/quiz_master_next/issues/4" target="_blank">GitHub Issue #4</a></li>
130
+ <li>* Redesigned Admin Results Pages <a href="https://github.com/fpcorso/quiz_master_next/issues/106" target="_blank">GitHub Issue #106</a></li>
131
+ <li>* Added Ability To Go To Next/Previous Results <a href="https://github.com/fpcorso/quiz_master_next/issues/71" target="_blank">GitHub Issue #71</a></li>
132
+ <li>* Quizzes Now Have Direct URL And Archive <a href="https://github.com/fpcorso/quiz_master_next/issues/104" target="_blank">GitHub Issue #104</a></li>
133
+ <li>* Added Ability To Use Own Facebook App ID <a href="https://github.com/fpcorso/quiz_master_next/issues/137" target="_blank">GitHub Issue #137</a></li>
134
+ <li>* In Code: New Hook For Template Variable List</li>
135
+ <li>* In Code: Certificate On Admin Results Now Hooked Into New Template Variable System</li>
136
+ <li>* In Code: Converted Support Widget To Remote Post <a href="https://github.com/fpcorso/quiz_master_next/issues/114" target="_blank">GitHub Issue #114</a></li>
137
+ <li>* In Code: Added Uninstall File Direct Access Check</li>
138
+ <li>* Bug Fix: Fixed Dashboard Widget No Quiz Bug <a href="https://github.com/fpcorso/quiz_master_next/issues/119" target="_blank">GitHub Issue #119</a></li>
139
+ <li>* Bug Fix: Fixed Shortcode No Quiz Bug <a href="https://github.com/fpcorso/quiz_master_next/issues/120" target="_blank">GitHub Issue #120</a></li>
140
+ <li>* Bug Fix: Fixed Required Contact User Bug <a href="https://github.com/fpcorso/quiz_master_next/issues/123" target="_blank">GitHub Issue #123</a></li>
141
+ <li>* Bug Fix: Fixed Text Template Bug <a href="https://github.com/fpcorso/quiz_master_next/issues/117" target="_blank">GitHub Issue #117</a></li>
142
  </ul>
143
  </div>
144
  <div id="mlw_quiz_requested" style="display: none;">
155
  <li>Allow Quiz To Not Show Start Page</li>
156
  <li>Progress Bar For Timer</li>
157
  <li>Ability To Redirect User Instead Of Showing Results Page</li>
 
158
  <li>Graphical Click Aware Questions</li>
159
  <li>Results Bar Graph For Users Taking Polls</li>
160
  <li>Head To Head Comparison Questions</li>
includes/qmn_dashboard_widgets.php CHANGED
@@ -173,13 +173,13 @@ function qmn_snapshot_dashboard_widget()
173
  </li>
174
  <li class="qmn_dashboard_element qmn_half_width">
175
  <div class="qmn_dashboard_inside">
176
- <strong><?php echo $mlw_stat_most_popular_quiz->quiz_name; ?></strong>
177
  <?php _e('most popular quiz', 'quiz-master-next'); ?>
178
  </div>
179
  </li>
180
  <li class="qmn_dashboard_element qmn_half_width">
181
  <div class="qmn_dashboard_inside">
182
- <strong><?php echo $mlw_stat_least_popular_quiz->quiz_name; ?></strong>
183
  <?php _e('least popular quiz', 'quiz-master-next'); ?>
184
  </div>
185
  </li>
173
  </li>
174
  <li class="qmn_dashboard_element qmn_half_width">
175
  <div class="qmn_dashboard_inside">
176
+ <strong><?php if (!is_null($mlw_stat_most_popular_quiz)) { echo $mlw_stat_most_popular_quiz->quiz_name; } ?></strong>
177
  <?php _e('most popular quiz', 'quiz-master-next'); ?>
178
  </div>
179
  </li>
180
  <li class="qmn_dashboard_element qmn_half_width">
181
  <div class="qmn_dashboard_inside">
182
+ <strong><?php if (!is_null($mlw_stat_least_popular_quiz)) { echo $mlw_stat_least_popular_quiz->quiz_name; } ?></strong>
183
  <?php _e('least popular quiz', 'quiz-master-next'); ?>
184
  </div>
185
  </li>
includes/qmn_global_settings.php ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Generates The Settings Page For The Plugin
4
+ *
5
+ * @since 4.1.0
6
+ */
7
+ class QMNGlobalSettingsPage
8
+ {
9
+
10
+ /**
11
+ * Main Construct Function
12
+ *
13
+ * Call functions within class
14
+ *
15
+ * @since 4.1.0
16
+ * @uses QMNGlobalSettingsPage::load_dependencies() Loads required filed
17
+ * @uses QMNGlobalSettingsPage::add_hooks() Adds actions to hooks and filters
18
+ * @return void
19
+ */
20
+ function __construct()
21
+ {
22
+ $this->load_dependencies();
23
+ $this->add_hooks();
24
+ }
25
+
26
+ /**
27
+ * Load File Dependencies
28
+ *
29
+ * @since 4.1.0
30
+ * @return void
31
+ */
32
+ private function load_dependencies()
33
+ {
34
+
35
+ }
36
+
37
+ /**
38
+ * Add Hooks
39
+ *
40
+ * Adds functions to relavent hooks and filters
41
+ *
42
+ * @since 4.1.0
43
+ * @return void
44
+ */
45
+ private function add_hooks()
46
+ {
47
+ add_action("admin_init", array($this, 'init'));
48
+ }
49
+
50
+ /**
51
+ * Prepares Settings Fields And Sections
52
+ *
53
+ * @since 4.1.0
54
+ * @return void
55
+ */
56
+ public function init()
57
+ {
58
+ register_setting( 'qmn-settings-group', 'qmn-settings' );
59
+ add_settings_section( 'qmn-global-section', 'Main Settings', array($this, 'global_section'), 'qmn_global_settings' );
60
+ add_settings_field( 'usage-tracker', 'Allow Usage Tracking?', array($this, 'usage_tracker_field'), 'qmn_global_settings', 'qmn-global-section' );
61
+ add_settings_field( 'cpt-search', 'Disable Quiz Posts From Being Searched?', array($this, 'cpt_search_field'), 'qmn_global_settings', 'qmn-global-section' );
62
+ add_settings_field( 'cpt-archive', 'Disable Quiz Archive?', array($this, 'cpt_archive_field'), 'qmn_global_settings', 'qmn-global-section' );
63
+ add_settings_field( 'cpt-slug', 'Quiz Url Slug', array($this, 'cpt_slug_field'), 'qmn_global_settings', 'qmn-global-section' );
64
+ add_settings_field( 'facebook-app-id', 'Facebook App Id', array($this, 'facebook_app_id'), 'qmn_global_settings', 'qmn-global-section' );
65
+ add_settings_field( 'results-details', 'Template For Admin Results Details', array($this, 'results_details_template'), 'qmn_global_settings', 'qmn-global-section' );
66
+ }
67
+
68
+ /**
69
+ * Generates Section Text
70
+ *
71
+ * Generates the section text. If page has been saved, flush rewrite rules for updated post type slug
72
+ *
73
+ * @since 4.1.0
74
+ * @return void
75
+ */
76
+ public function global_section()
77
+ {
78
+ echo 'These settings are applied to the entire plugin and all quizzes.';
79
+ if (isset($_GET["settings-updated"]) && $_GET["settings-updated"])
80
+ {
81
+ flush_rewrite_rules(true);
82
+ echo "<span style='color:red;'>Settings have been updated!</span>";
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Generates Setting Field For App Id
88
+ *
89
+ * @since 4.1.0
90
+ * @return void
91
+ */
92
+ public function facebook_app_id()
93
+ {
94
+ $settings = (array) get_option( 'qmn-settings' );
95
+ $facebook_app_id = '483815031724529';
96
+ if (isset($settings['facebook_app_id']))
97
+ {
98
+ $facebook_app_id = esc_attr( $settings['facebook_app_id'] );
99
+ }
100
+ echo "<input type='text' name='qmn-settings[facebook_app_id]' id='qmn-settings[facebook_app_id]' value='$facebook_app_id' />";
101
+ }
102
+
103
+ /**
104
+ * Generates Setting Field For Post Slug
105
+ *
106
+ * @since 4.1.0
107
+ * @return void
108
+ */
109
+ public function cpt_slug_field()
110
+ {
111
+ $settings = (array) get_option( 'qmn-settings' );
112
+ $cpt_slug = 'quiz';
113
+ if (isset($settings['cpt_slug']))
114
+ {
115
+ $cpt_slug = esc_attr( $settings['cpt_slug'] );
116
+ }
117
+ echo "<input type='text' name='qmn-settings[cpt_slug]' id='qmn-settings[cpt_slug]' value='$cpt_slug' />";
118
+ }
119
+
120
+ /**
121
+ * Generates Setting Field For Exclude Search
122
+ *
123
+ * @since 4.1.0
124
+ * @return void
125
+ */
126
+ public function cpt_search_field()
127
+ {
128
+ $settings = (array) get_option( 'qmn-settings' );
129
+ $cpt_search = '0';
130
+ if (isset($settings['cpt_search']))
131
+ {
132
+ $cpt_search = esc_attr( $settings['cpt_search'] );
133
+ }
134
+ $checked = '';
135
+ if ($cpt_search == '1')
136
+ {
137
+ $checked = " checked='checked'";
138
+ }
139
+ echo "<input type='checkbox' name='qmn-settings[cpt_search]' id='qmn-settings[cpt_search]' value='1'$checked />";
140
+ }
141
+
142
+ /**
143
+ * Generates Setting Field For Post Archive
144
+ *
145
+ * @since 4.1.0
146
+ * @return void
147
+ */
148
+ public function cpt_archive_field()
149
+ {
150
+ $settings = (array) get_option( 'qmn-settings' );
151
+ $cpt_archive = '0';
152
+ if (isset($settings['cpt_archive']))
153
+ {
154
+ $cpt_archive = esc_attr( $settings['cpt_archive'] );
155
+ }
156
+ $checked = '';
157
+ if ($cpt_archive == '1')
158
+ {
159
+ $checked = " checked='checked'";
160
+ }
161
+ echo "<input type='checkbox' name='qmn-settings[cpt_archive]' id='qmn-settings[cpt_archive]' value='1'$checked />";
162
+ }
163
+
164
+ /**
165
+ * Generates Setting Field For Results Details Template
166
+ *
167
+ * @since 4.1.0
168
+ * @return void
169
+ */
170
+ public function results_details_template()
171
+ {
172
+ $settings = (array) get_option( 'qmn-settings' );
173
+ if (isset($settings['results_details_template']))
174
+ {
175
+ $template = htmlspecialchars_decode($settings['results_details_template'], ENT_QUOTES);
176
+ }
177
+ else
178
+ {
179
+ $template = "<h2>Quiz Results for %QUIZ_NAME%</h2>
180
+ <p>Name Provided: %USER_NAME%</p>
181
+ <p>Business Provided: %USER_BUSINESS%</p>
182
+ <p>Phone Provided: %USER_PHONE%</p>
183
+ <p>Email Provided: %USER_EMAIL%</p>
184
+ <p>Score Received: %AMOUNT_CORRECT%/%TOTAL_QUESTIONS% or %CORRECT_SCORE%% or %POINT_SCORE% points</p>
185
+ <h2>Answers Provided:</h2>
186
+ <p>The user took %TIMER% to complete quiz.</p>
187
+ <p>Comments entered were: %COMMENT_SECTION%</p>
188
+ <p>The answers were as follows:</p>
189
+ %QUESTIONS_ANSWERS%";
190
+ }
191
+ wp_editor( $template, 'results_template', array('textarea_name' => 'qmn-settings[results_details_template]') );
192
+ }
193
+
194
+ /**
195
+ * Generates Setting Field For Usage Tracker Authorization
196
+ *
197
+ * @since 4.1.0
198
+ * @return void
199
+ */
200
+ public function usage_tracker_field()
201
+ {
202
+ $settings = (array) get_option( 'qmn-settings' );
203
+ $tracking_allowed = '0';
204
+ if (isset($settings['tracking_allowed']))
205
+ {
206
+ $tracking_allowed = esc_attr( $settings['tracking_allowed'] );
207
+ }
208
+ $checked = '';
209
+ if ($tracking_allowed == '1')
210
+ {
211
+ $checked = " checked='checked'";
212
+ }
213
+ echo "<input type='checkbox' name='qmn-settings[tracking_allowed]' id='qmn-settings[tracking_allowed]' value='1'$checked />";
214
+ echo "<label for='qmn-settings[tracking_allowed]'>Allow Quiz Master Next to anonymously track this plugin's usage and help us make this plugin better.</label>";
215
+ }
216
+
217
+ /**
218
+ * Generates Settings Page
219
+ *
220
+ * @since 4.1.0
221
+ * @return void
222
+ */
223
+ public static function display_page()
224
+ {
225
+ ?>
226
+ <div class="wrap">
227
+ <h2>Global Settings</h2>
228
+ <form action="options.php" method="POST">
229
+ <?php settings_fields( 'qmn-settings-group' ); ?>
230
+ <?php do_settings_sections( 'qmn_global_settings' ); ?>
231
+ <?php submit_button(); ?>
232
+ </form>
233
+ </div>
234
+ <?php
235
+ }
236
+ }
237
+
238
+ $qmnGlobalSettingsPage = new QMNGlobalSettingsPage();
239
+ ?>
includes/qmn_help.php CHANGED
@@ -51,23 +51,31 @@ function qmn_support_meta_box_content()
51
  {
52
  $quiz_master_email_message = "";
53
  $mlw_quiz_version = get_option('mlw_quiz_master_version');
54
- if(isset($_POST["action"]))
55
  {
56
- $quiz_master_email_success = $_POST["action"];
57
  $user_name = $_POST["username"];
58
  $user_email = $_POST["email"];
59
  $user_message = $_POST["message"];
60
  $user_quiz_url = $_POST["quiz_url"];
61
  $current_user = wp_get_current_user();
62
  $mlw_site_info = qmn_get_system_info();
63
- $mlw_site_info = str_replace("<br />", "\n", $mlw_site_info);
64
- $mlw_site_info = str_replace("<h3>", "\n", $mlw_site_info);
65
- $mlw_site_info = str_replace("</h3>", "\n", $mlw_site_info);
66
- if ($quiz_master_email_success == 'update')
67
- {
68
- $mlw_message = "Message from ".$user_name." at ".$user_email." It says: \n \n ".$user_message."\n Version: ".$mlw_quiz_version."\n Quiz URL Provided: ".$user_quiz_url."\n User ".$current_user->display_name." from ".$current_user->user_email."\n Wordpress Info: ".$mlw_site_info;
69
- wp_mail('fpcorso@mylocalwebstop.com' ,'Support From Quiz Master Next Plugin', $mlw_message);
70
- $quiz_master_email_message = "**Message Sent**";
 
 
 
 
 
 
 
 
 
71
  }
72
  }
73
  ?>
@@ -104,11 +112,11 @@ function qmn_support_meta_box_content()
104
  </script>
105
  <div class='quiz_email_support'>
106
  <form action="<?php echo $_SERVER['PHP_SELF']; ?>?page=mlw_quiz_help" method='post' name='emailForm' onsubmit='return mlw_validateForm()'>
107
- <input type='hidden' name='action' value='update' />
108
  <table>
109
  <tr>
110
  <td>If there is something you would like to suggest to add or even if you just want
111
- to let me know if you like the plugin or not, feel free to use the email form below.</td>
112
  </tr>
113
  <tr>
114
  <td><span name='mlw_support_message' id='mlw_support_message' style="color: red;"><?php echo $quiz_master_email_message; ?></span></td>
@@ -138,7 +146,7 @@ function qmn_support_meta_box_content()
138
  <td align='left'><TEXTAREA NAME="message" COLS=40 ROWS=6></TEXTAREA></td>
139
  </tr>
140
  <tr>
141
- <td align='left'><input type='submit' class="button-primary" value='Send Email' /></td>
142
  </tr>
143
  <tr>
144
  <td align='left'></td>
51
  {
52
  $quiz_master_email_message = "";
53
  $mlw_quiz_version = get_option('mlw_quiz_master_version');
54
+ if(isset($_POST["support_email"]) && $_POST["support_email"] == 'confirmation')
55
  {
 
56
  $user_name = $_POST["username"];
57
  $user_email = $_POST["email"];
58
  $user_message = $_POST["message"];
59
  $user_quiz_url = $_POST["quiz_url"];
60
  $current_user = wp_get_current_user();
61
  $mlw_site_info = qmn_get_system_info();
62
+ $mlw_message = $user_message."<br> Version: ".$mlw_quiz_version."<br> Quiz URL Provided: ".$user_quiz_url."<br> User ".$current_user->display_name." from ".$current_user->user_email."<br> Wordpress Info: ".$mlw_site_info;
63
+ $response = wp_remote_post( "http://mylocalwebstop.com/contact-us/", array(
64
+ 'method' => 'POST',
65
+ 'timeout' => 45,
66
+ 'redirection' => 5,
67
+ 'httpversion' => '1.0',
68
+ 'blocking' => true,
69
+ 'headers' => array(),
70
+ 'body' => array( 'mlwUserName' => $user_name, 'mlwUserComp' => '', 'mlwUserEmail' => $user_email, 'question1' => 'Email', 'question3' => 'Quiz Master Next', 'question2' => $mlw_message, 'qmn_question_list' => '1Q3Q2Q', 'complete_quiz' => 'confirmation' ),
71
+ 'cookies' => array()
72
+ )
73
+ );
74
+ if ( is_wp_error( $response ) ) {
75
+ $error_message = $response->get_error_message();
76
+ $quiz_master_email_message = "Something went wrong: $error_message";
77
+ } else {
78
+ $quiz_master_email_message = "**Message Sent**";
79
  }
80
  }
81
  ?>
112
  </script>
113
  <div class='quiz_email_support'>
114
  <form action="<?php echo $_SERVER['PHP_SELF']; ?>?page=mlw_quiz_help" method='post' name='emailForm' onsubmit='return mlw_validateForm()'>
115
+ <input type='hidden' name='support_email' value='confirmation' />
116
  <table>
117
  <tr>
118
  <td>If there is something you would like to suggest to add or even if you just want
119
+ to let me know if you like the plugin or not, feel free to use the support ticket form below.</td>
120
  </tr>
121
  <tr>
122
  <td><span name='mlw_support_message' id='mlw_support_message' style="color: red;"><?php echo $quiz_master_email_message; ?></span></td>
146
  <td align='left'><TEXTAREA NAME="message" COLS=40 ROWS=6></TEXTAREA></td>
147
  </tr>
148
  <tr>
149
+ <td align='left'><input type='submit' class="button-primary" value='Submit Support Ticket' /></td>
150
  </tr>
151
  <tr>
152
  <td align='left'></td>
includes/qmn_helper.php CHANGED
@@ -17,6 +17,14 @@ class QMNPluginHelper
17
  */
18
  public $addon_tabs = array();
19
 
 
 
 
 
 
 
 
 
20
  /**
21
  * Settings Page tabs array
22
  *
@@ -147,7 +155,7 @@ class QMNPluginHelper
147
  $qmn_total_questions += 1;
148
  if ($quiz_options->question_numbering == 1)
149
  {
150
- $display .= "<span class='mlw_qmn_question'>$qmn_total_questions)</span>";
151
  }
152
  }
153
  $display .= call_user_func($type['display'], intval($question_id), $question->question_name, $answers);
@@ -299,6 +307,40 @@ class QMNPluginHelper
299
  return $this->addon_tabs;
300
  }
301
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
  /**
303
  * Registers Quiz Settings Tab
304
  *
17
  */
18
  public $addon_tabs = array();
19
 
20
+ /**
21
+ * Results Page tabs array
22
+ *
23
+ * @var array
24
+ * @since 4.1.0
25
+ */
26
+ public $results_tabs = array();
27
+
28
  /**
29
  * Settings Page tabs array
30
  *
155
  $qmn_total_questions += 1;
156
  if ($quiz_options->question_numbering == 1)
157
  {
158
+ $display .= "<span class='mlw_qmn_question_number'>$qmn_total_questions) </span>";
159
  }
160
  }
161
  $display .= call_user_func($type['display'], intval($question_id), $question->question_name, $answers);
307
  return $this->addon_tabs;
308
  }
309
 
310
+ /**
311
+ * Registers Results Tab
312
+ *
313
+ * Registers a new tab on the results page
314
+ *
315
+ * @since 4.1.0
316
+ * @param string $title The name of the tab
317
+ * @param string $function The function that displays the tab's content
318
+ * @return void
319
+ */
320
+ public function register_results_settings_tab($title, $function)
321
+ {
322
+ $slug = strtolower(str_replace( " ", "-", $title));
323
+ $new_tab = array(
324
+ 'title' => $title,
325
+ 'function' => $function,
326
+ 'slug' => $slug
327
+ );
328
+ $this->results_tabs[] = $new_tab;
329
+ }
330
+
331
+ /**
332
+ * Retrieves Results Tab Array
333
+ *
334
+ * Retrieves the array of titles and functions of the registered tabs
335
+ *
336
+ * @since 4.1.0
337
+ * @return array The array of registered tabs
338
+ */
339
+ public function get_results_tabs()
340
+ {
341
+ return $this->results_tabs;
342
+ }
343
+
344
  /**
345
  * Registers Quiz Settings Tab
346
  *
includes/qmn_options_email_tab.php CHANGED
@@ -124,6 +124,7 @@ function mlw_options_emails_tab_content()
124
  $mlw_send_user_email = $_POST["sendUserEmail"];
125
  $mlw_send_admin_email = $_POST["sendAdminEmail"];
126
  $mlw_admin_email = $_POST["adminEmail"];
 
127
 
128
  //Create new array
129
  $i = 1;
@@ -157,7 +158,7 @@ function mlw_options_emails_tab_content()
157
  }
158
  $mlw_qmn_new_email_array = serialize($mlw_qmn_new_email_array);
159
  $mlw_qmn_new_admin_array = serialize($mlw_qmn_new_admin_array);
160
- $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET send_user_email='%s', send_admin_email='%s', admin_email='%s', user_email_template='%s', admin_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_send_user_email, $mlw_send_admin_email, $mlw_admin_email, $mlw_qmn_new_email_array, $mlw_qmn_new_admin_array, $mlw_qmn_email_id ) );
161
  if ($mlw_new_email_results != false)
162
  {
163
  $mlwQuizMasterNext->alertManager->newAlert(__('The email has been updated successfully.', 'quiz-master-next'), 'success');
@@ -207,6 +208,7 @@ function mlw_options_emails_tab_content()
207
  "subject" => 'Quiz Results For %QUIZ_NAME%'
208
  ));
209
  }
 
210
  ?>
211
  <script type="text/javascript">
212
  var $j = jQuery.noConflict();
@@ -226,57 +228,83 @@ function mlw_options_emails_tab_content()
226
  document.mlw_quiz_save_email_form.submit();
227
  }
228
  </script>
229
- <h3><?php _e('Template Variables', 'quiz-master-next'); ?></h3>
230
- <table class="form-table">
231
- <tr>
232
- <td><strong>%POINT_SCORE%</strong> - <?php _e('Score for the quiz when using points', 'quiz-master-next'); ?></td>
233
- <td><strong>%AVERAGE_POINT%</strong> - <?php _e('The average amount of points user had per question', 'quiz-master-next'); ?></td>
234
- </tr>
235
-
236
- <tr>
237
- <td><strong>%AMOUNT_CORRECT%</strong> - <?php _e('The number of correct answers the user had', 'quiz-master-next'); ?></td>
238
- <td><strong>%TOTAL_QUESTIONS%</strong> - <?php _e('The total number of questions in the quiz', 'quiz-master-next'); ?></td>
239
- </tr>
240
-
241
- <tr>
242
- <td><strong>%CORRECT_SCORE%</strong> - <?php _e('Score for the quiz when using correct answers', 'quiz-master-next'); ?></td>
243
- </tr>
244
-
245
- <tr>
246
- <td><strong>%USER_NAME%</strong> - <?php _e('The name the user entered before the quiz', 'quiz-master-next'); ?></td>
247
- <td><strong>%USER_BUSINESS%</strong> - <?php _e('The business the user entered before the quiz', 'quiz-master-next'); ?></td>
248
- </tr>
249
-
250
- <tr>
251
- <td><strong>%USER_PHONE%</strong> - <?php _e('The phone number the user entered before the quiz', 'quiz-master-next'); ?></td>
252
- <td><strong>%USER_EMAIL%</strong> - <?php _e('The email the user entered before the quiz', 'quiz-master-next'); ?></td>
253
- </tr>
254
-
255
- <tr>
256
- <td><strong>%QUIZ_NAME%</strong> - <?php _e('The name of the quiz', 'quiz-master-next'); ?></td>
257
- <td><strong>%QUESTIONS_ANSWERS%</strong> - <?php _e('Shows the question, the answer the user provided, and the correct answer', 'quiz-master-next'); ?></td>
258
- </tr>
259
-
260
- <tr>
261
- <td><strong>%COMMENT_SECTION%</strong> - <?php _e('The comments the user entered into comment box if enabled', 'quiz-master-next'); ?></td>
262
- <td><strong>%TIMER%</strong> - <?php _e('The amount of time user spent of quiz', 'quiz-master-next'); ?></td>
263
- </tr>
264
- <tr>
265
- <td><strong>%CERTIFICATE_LINK%</strong> - <?php _e('The link to the certificate after completing the quiz', 'quiz-master-next'); ?></td>
266
- </tr>
267
- <tr>
268
- <td><strong>%CATEGORY_POINTS%%/CATEGORY_POINTS%</strong> - <?php _e('The amount of points a specific category earned.', 'quiz-master-next'); ?></td>
269
- <td><strong>%CATEGORY_SCORE%%/CATEGORY_SCORE%</strong> - <?php _e('The score a specific category earned.', 'quiz-master-next'); ?></td>
270
- </tr>
271
- <tr>
272
- <td><strong>Example: %CATEGORY_POINTS%Tech%/CATEGORY_POINTS%</strong></td>
273
- <td><strong>Example: %CATEGORY_SCORE%Tech%/CATEGORY_SCORE%</strong></td>
274
- </tr>
275
- <tr>
276
- <td><strong>%CATEGORY_AVERAGE_POINTS%</strong> - <?php _e('The average points from all categories.', 'quiz-master-next'); ?></td>
277
- <td><strong>%CATEGORY_AVERAGE_SCORE%</strong> - <?php _e('The average score from all categories.', 'quiz-master-next'); ?></td>
278
- </tr>
279
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  <br />
281
  <br />
282
  <form method="post" action="" name="mlw_quiz_add_email_form">
@@ -308,6 +336,10 @@ function mlw_options_emails_tab_content()
308
  <th scope="row"><label for="adminEmail"><?php _e('What emails should we send the admin email to? Separate emails with a comma.', 'quiz-master-next'); ?></label></th>
309
  <td><input name="adminEmail" type="text" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
310
  </tr>
 
 
 
 
311
  </table>
312
  <br />
313
  <br />
124
  $mlw_send_user_email = $_POST["sendUserEmail"];
125
  $mlw_send_admin_email = $_POST["sendAdminEmail"];
126
  $mlw_admin_email = $_POST["adminEmail"];
127
+ $mlw_email_from_text = $_POST["emailFromText"];
128
 
129
  //Create new array
130
  $i = 1;
158
  }
159
  $mlw_qmn_new_email_array = serialize($mlw_qmn_new_email_array);
160
  $mlw_qmn_new_admin_array = serialize($mlw_qmn_new_admin_array);
161
+ $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET send_user_email='%s', send_admin_email='%s', admin_email='%s', email_from_text='%s', user_email_template='%s', admin_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_send_user_email, $mlw_send_admin_email, $mlw_admin_email, $mlw_email_from_text, $mlw_qmn_new_email_array, $mlw_qmn_new_admin_array, $mlw_qmn_email_id ) );
162
  if ($mlw_new_email_results != false)
163
  {
164
  $mlwQuizMasterNext->alertManager->newAlert(__('The email has been updated successfully.', 'quiz-master-next'), 'success');
208
  "subject" => 'Quiz Results For %QUIZ_NAME%'
209
  ));
210
  }
211
+ wp_enqueue_style( 'qmn_admin_style', plugins_url( 'css/qmn_admin.css' , __FILE__ ) );
212
  ?>
213
  <script type="text/javascript">
214
  var $j = jQuery.noConflict();
228
  document.mlw_quiz_save_email_form.submit();
229
  }
230
  </script>
231
+ <h3 style="text-align: center;"><?php _e('Template Variables', 'quiz-master-next'); ?></h3>
232
+ <div class="template_list_holder">
233
+ <div class="template_variable">
234
+ <span class="template_name">%POINT_SCORE%</span> - <?php _e('Score for the quiz when using points', 'quiz-master-next'); ?>
235
+ </div>
236
+ <div class="template_variable">
237
+ <span class="template_name">%AVERAGE_POINT%</span> - <?php _e('The average amount of points user had per question', 'quiz-master-next'); ?>
238
+ </div>
239
+ <div class="template_variable">
240
+ <span class="template_name">%AMOUNT_CORRECT%</span> - <?php _e('The number of correct answers the user had', 'quiz-master-next'); ?>
241
+ </div>
242
+ <div class="template_variable">
243
+ <span class="template_name">%TOTAL_QUESTIONS%</span> - <?php _e('The total number of questions in the quiz', 'quiz-master-next'); ?>
244
+ </div>
245
+ <div class="template_variable">
246
+ <span class="template_name">%CORRECT_SCORE%</span> - <?php _e('Score for the quiz when using correct answers', 'quiz-master-next'); ?>
247
+ </div>
248
+ <div class="template_variable">
249
+ <span class="template_name">%USER_NAME%</span> - <?php _e('The name the user entered before the quiz', 'quiz-master-next'); ?>
250
+ </div>
251
+ <div class="template_variable">
252
+ <span class="template_name">%USER_BUSINESS%</span> - <?php _e('The business the user entered before the quiz', 'quiz-master-next'); ?>
253
+ </div>
254
+ <div class="template_variable">
255
+ <span class="template_name">%USER_PHONE%</span> - <?php _e('The phone number the user entered before the quiz', 'quiz-master-next'); ?>
256
+ </div>
257
+ <div class="template_variable">
258
+ <span class="template_name">%USER_EMAIL%</span> - <?php _e('The email the user entered before the quiz', 'quiz-master-next'); ?>
259
+ </div>
260
+ <div class="template_variable">
261
+ <span class="template_name">%QUIZ_NAME%</span> - <?php _e('The name of the quiz', 'quiz-master-next'); ?>
262
+ </div>
263
+ <div class="template_variable">
264
+ <span class="template_name">%QUESTIONS_ANSWERS%</span> - <?php _e('Shows the question, the answer the user provided, and the correct answer', 'quiz-master-next'); ?>
265
+ </div>
266
+ <div class="template_variable">
267
+ <span class="template_name">%COMMENT_SECTION%</span> - <?php _e('The comments the user entered into comment box if enabled', 'quiz-master-next'); ?>
268
+ </div>
269
+ <div class="template_variable">
270
+ <span class="template_name">%TIMER%</span> - <?php _e('The amount of time user spent of quiz', 'quiz-master-next'); ?>
271
+ </div>
272
+ <div class="template_variable">
273
+ <span class="template_name">%CERTIFICATE_LINK%</span> - <?php _e('The link to the certificate after completing the quiz', 'quiz-master-next'); ?>
274
+ </div>
275
+ <div class="template_variable">
276
+ <span class="template_name">%CATEGORY_POINTS%%/CATEGORY_POINTS%</span> - <?php _e('The amount of points a specific category earned.', 'quiz-master-next'); ?>
277
+ </div>
278
+ <div class="template_variable">
279
+ <span class="template_name">%CATEGORY_SCORE%%/CATEGORY_SCORE%</span> - <?php _e('The score a specific category earned.', 'quiz-master-next'); ?>
280
+ </div>
281
+ <div class="template_variable">
282
+ <span class="template_name">%CATEGORY_AVERAGE_POINTS%</span> - <?php _e('The average points from all categories.', 'quiz-master-next'); ?>
283
+ </div>
284
+ <div class="template_variable">
285
+ <span class="template_name">%CATEGORY_AVERAGE_SCORE%</span> - <?php _e('The average score from all categories.', 'quiz-master-next'); ?>
286
+ </div>
287
+ <div class="template_variable">
288
+ <span class="template_name">%QUESTION%</span> - <?php _e('The question that the user answered', 'quiz-master-next'); ?>
289
+ </div>
290
+ <div class="template_variable">
291
+ <span class="template_name">%USER_ANSWER%</span> - <?php _e('The answer the user gave for the question', 'quiz-master-next'); ?>
292
+ </div>
293
+ <div class="template_variable">
294
+ <span class="template_name">%CORRECT_ANSWER%</span> - <?php _e('The correct answer for the question', 'quiz-master-next'); ?>
295
+ </div>
296
+ <div class="template_variable">
297
+ <span class="template_name">%USER_COMMENTS%</span> - <?php _e('The comments the user provided in the comment field for the question', 'quiz-master-next'); ?>
298
+ </div>
299
+ <div class="template_variable">
300
+ <span class="template_name">%CORRECT_ANSWER_INFO%</span> - <?php _e('Reason why the correct answer is the correct answer', 'quiz-master-next'); ?>
301
+ </div>
302
+ <div class="template_variable">
303
+ <span class="template_name">%CURRENT_DATE%</span> - <?php _e('The Current Date', 'quiz-master-next'); ?>
304
+ </div>
305
+ <?php do_action('qmn_template_variable_list'); ?>
306
+ </div>
307
+ <div style="clear:both;"></div>
308
  <br />
309
  <br />
310
  <form method="post" action="" name="mlw_quiz_add_email_form">
336
  <th scope="row"><label for="adminEmail"><?php _e('What emails should we send the admin email to? Separate emails with a comma.', 'quiz-master-next'); ?></label></th>
337
  <td><input name="adminEmail" type="text" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
338
  </tr>
339
+ <tr valign="top">
340
+ <th scope="row"><label for="emailFromText"><?php _e("What is the From Name for the email sent to users and admin?", 'quiz-master-next'); ?></label></th>
341
+ <td><input name="emailFromText" type="text" id="emailFromText" value="<?php echo $mlw_quiz_options->email_from_text; ?>" class="regular-text" /></td>
342
+ </tr>
343
  </table>
344
  <br />
345
  <br />
includes/qmn_options_results_page_tab.php CHANGED
@@ -109,6 +109,7 @@ function mlw_options_results_tab_content()
109
  {
110
  $mlw_message_after_array = array(array(0, 0, $mlw_quiz_options->message_after));
111
  }
 
112
  ?>
113
  <div id="tabs-6" class="mlw_tab_content">
114
  <script>
@@ -129,57 +130,65 @@ function mlw_options_results_tab_content()
129
  document.mlw_quiz_save_landing_form.submit();
130
  }
131
  </script>
132
- <h3>Template Variables</h3>
133
- <table class="form-table">
134
- <tr>
135
- <td><strong>%POINT_SCORE%</strong> - <?php _e('Score for the quiz when using points', 'quiz-master-next'); ?></td>
136
- <td><strong>%AVERAGE_POINT%</strong> - <?php _e('The average amount of points user had per question', 'quiz-master-next'); ?></td>
137
- </tr>
138
-
139
- <tr>
140
- <td><strong>%AMOUNT_CORRECT%</strong> - <?php _e('The number of correct answers the user had', 'quiz-master-next'); ?></td>
141
- <td><strong>%TOTAL_QUESTIONS%</strong> - <?php _e('The total number of questions in the quiz', 'quiz-master-next'); ?></td>
142
- </tr>
143
-
144
- <tr>
145
- <td><strong>%CORRECT_SCORE%</strong> - <?php _e('Score for the quiz when using correct answers', 'quiz-master-next'); ?></td>
146
- </tr>
147
-
148
- <tr>
149
- <td><strong>%USER_NAME%</strong> - <?php _e('The name the user entered before the quiz', 'quiz-master-next'); ?></td>
150
- <td><strong>%USER_BUSINESS%</strong> - <?php _e('The business the user entered before the quiz', 'quiz-master-next'); ?></td>
151
- </tr>
152
-
153
- <tr>
154
- <td><strong>%USER_PHONE%</strong> - <?php _e('The phone number the user entered before the quiz', 'quiz-master-next'); ?></td>
155
- <td><strong>%USER_EMAIL%</strong> - <?php _e('The email the user entered before the quiz', 'quiz-master-next'); ?></td>
156
- </tr>
157
-
158
- <tr>
159
- <td><strong>%QUIZ_NAME%</strong> - <?php _e('The name of the quiz', 'quiz-master-next'); ?></td>
160
- <td><strong>%QUESTIONS_ANSWERS%</strong> - <?php _e('Shows the question, the answer the user provided, and the correct answer', 'quiz-master-next'); ?></td>
161
- </tr>
162
-
163
- <tr>
164
- <td><strong>%COMMENT_SECTION%</strong> - <?php _e('The comments the user entered into comment box if enabled', 'quiz-master-next'); ?></td>
165
- <td><strong>%TIMER%</strong> - <?php _e('The amount of time user spent of quiz', 'quiz-master-next'); ?></td>
166
- </tr>
167
- <tr>
168
- <td><strong>%CERTIFICATE_LINK%</strong> - <?php _e('The link to the certificate after completing the quiz', 'quiz-master-next'); ?></td>
169
- </tr>
170
- <tr>
171
- <td><strong>%CATEGORY_POINTS%%/CATEGORY_POINTS%</strong> - <?php _e('The amount of points a specific category earned.', 'quiz-master-next'); ?></td>
172
- <td><strong>%CATEGORY_SCORE%%/CATEGORY_SCORE%</strong> - <?php _e('The score a specific category earned.', 'quiz-master-next'); ?></td>
173
- </tr>
174
- <tr>
175
- <td><strong>Example: %CATEGORY_POINTS%Tech%/CATEGORY_POINTS%</strong></td>
176
- <td><strong>Example: %CATEGORY_SCORE%Tech%/CATEGORY_SCORE%</strong></td>
177
- </tr>
178
- <tr>
179
- <td><strong>%CATEGORY_AVERAGE_POINTS%</strong> - <?php _e('The average points from all categories.', 'quiz-master-next'); ?></td>
180
- <td><strong>%CATEGORY_AVERAGE_SCORE%</strong> - <?php _e('The average score from all categories.', 'quiz-master-next'); ?></td>
181
- </tr>
182
- </table>
 
 
 
 
 
 
 
 
183
  <button id="save_landing_button" class="button" onclick="javascript: document.mlw_quiz_save_landing_form.submit();"><?php _e('Save Results Pages', 'quiz-master-next'); ?></button>
184
  <button id="new_landing_button" class="button" onclick="javascript: document.mlw_quiz_add_landing_form.submit();"><?php _e('Add New Results Page', 'quiz-master-next'); ?></button>
185
  <form method="post" action="" name="mlw_quiz_save_landing_form" style=" display:inline!important;">
109
  {
110
  $mlw_message_after_array = array(array(0, 0, $mlw_quiz_options->message_after));
111
  }
112
+ wp_enqueue_style( 'qmn_admin_style', plugins_url( 'css/qmn_admin.css' , __FILE__ ) );
113
  ?>
114
  <div id="tabs-6" class="mlw_tab_content">
115
  <script>
130
  document.mlw_quiz_save_landing_form.submit();
131
  }
132
  </script>
133
+ <h3 style="text-align: center;"><?php _e("Template Variables", 'quiz-master-next'); ?></h3>
134
+ <div class="template_list_holder">
135
+ <div class="template_variable">
136
+ <span class="template_name">%POINT_SCORE%</span> - <?php _e('Score for the quiz when using points', 'quiz-master-next'); ?>
137
+ </div>
138
+ <div class="template_variable">
139
+ <span class="template_name">%AVERAGE_POINT%</span> - <?php _e('The average amount of points user had per question', 'quiz-master-next'); ?>
140
+ </div>
141
+ <div class="template_variable">
142
+ <span class="template_name">%AMOUNT_CORRECT%</span> - <?php _e('The number of correct answers the user had', 'quiz-master-next'); ?>
143
+ </div>
144
+ <div class="template_variable">
145
+ <span class="template_name">%TOTAL_QUESTIONS%</span> - <?php _e('The total number of questions in the quiz', 'quiz-master-next'); ?>
146
+ </div>
147
+ <div class="template_variable">
148
+ <span class="template_name">%CORRECT_SCORE%</span> - <?php _e('Score for the quiz when using correct answers', 'quiz-master-next'); ?>
149
+ </div>
150
+ <div class="template_variable">
151
+ <span class="template_name">%USER_NAME%</span> - <?php _e('The name the user entered before the quiz', 'quiz-master-next'); ?>
152
+ </div>
153
+ <div class="template_variable">
154
+ <span class="template_name">%USER_BUSINESS%</span> - <?php _e('The business the user entered before the quiz', 'quiz-master-next'); ?>
155
+ </div>
156
+ <div class="template_variable">
157
+ <span class="template_name">%USER_PHONE%</span> - <?php _e('The phone number the user entered before the quiz', 'quiz-master-next'); ?>
158
+ </div>
159
+ <div class="template_variable">
160
+ <span class="template_name">%USER_EMAIL%</span> - <?php _e('The email the user entered before the quiz', 'quiz-master-next'); ?>
161
+ </div>
162
+ <div class="template_variable">
163
+ <span class="template_name">%QUIZ_NAME%</span> - <?php _e('The name of the quiz', 'quiz-master-next'); ?>
164
+ </div>
165
+ <div class="template_variable">
166
+ <span class="template_name">%QUESTIONS_ANSWERS%</span> - <?php _e('Shows the question, the answer the user provided, and the correct answer', 'quiz-master-next'); ?>
167
+ </div>
168
+ <div class="template_variable">
169
+ <span class="template_name">%COMMENT_SECTION%</span> - <?php _e('The comments the user entered into comment box if enabled', 'quiz-master-next'); ?>
170
+ </div>
171
+ <div class="template_variable">
172
+ <span class="template_name">%TIMER%</span> - <?php _e('The amount of time user spent of quiz', 'quiz-master-next'); ?>
173
+ </div>
174
+ <div class="template_variable">
175
+ <span class="template_name">%CERTIFICATE_LINK%</span> - <?php _e('The link to the certificate after completing the quiz', 'quiz-master-next'); ?>
176
+ </div>
177
+ <div class="template_variable">
178
+ <span class="template_name">%CATEGORY_POINTS%%/CATEGORY_POINTS%</span> - <?php _e('The amount of points a specific category earned.', 'quiz-master-next'); ?>
179
+ </div>
180
+ <div class="template_variable">
181
+ <span class="template_name">%CATEGORY_SCORE%%/CATEGORY_SCORE%</span> - <?php _e('The score a specific category earned.', 'quiz-master-next'); ?>
182
+ </div>
183
+ <div class="template_variable">
184
+ <span class="template_name">%CATEGORY_AVERAGE_POINTS%</span> - <?php _e('The average points from all categories.', 'quiz-master-next'); ?>
185
+ </div>
186
+ <div class="template_variable">
187
+ <span class="template_name">%CATEGORY_AVERAGE_SCORE%</span> - <?php _e('The average score from all categories.', 'quiz-master-next'); ?>
188
+ </div>
189
+ <?php do_action('qmn_template_variable_list'); ?>
190
+ </div>
191
+ <div style="clear:both;"></div>
192
  <button id="save_landing_button" class="button" onclick="javascript: document.mlw_quiz_save_landing_form.submit();"><?php _e('Save Results Pages', 'quiz-master-next'); ?></button>
193
  <button id="new_landing_button" class="button" onclick="javascript: document.mlw_quiz_add_landing_form.submit();"><?php _e('Add New Results Page', 'quiz-master-next'); ?></button>
194
  <form method="post" action="" name="mlw_quiz_save_landing_form" style=" display:inline!important;">
includes/qmn_options_style_tab.php CHANGED
@@ -99,52 +99,7 @@ function mlw_options_styling_tab_content()
99
 
100
  <table class="form-table">
101
  <tr>
102
- <td width="66%"><textarea style="width: 100%; height: 100%;" id="quiz_css" name="quiz_css"><?php echo $mlw_quiz_options->quiz_stye; ?></textarea>
103
- </td>
104
- <td width="30%">
105
- <strong><?php _e('Default:', 'quiz-master-next'); ?></strong><br />
106
- div.mlw_qmn_quiz input[type=radio],<br />
107
- div.mlw_qmn_quiz input[type=submit],<br />
108
- div.mlw_qmn_quiz label {<br />
109
- cursor: pointer;<br />
110
- }<br />
111
- div.mlw_qmn_quiz input:not([type=submit]):focus,<br />
112
- div.mlw_qmn_quiz textarea:focus {<br />
113
- background: #eaeaea;<br />
114
- }<br />
115
- div.mlw_qmn_quiz {<br />
116
- text-align: left;<br />
117
- }<br />
118
- div.quiz_section {<br />
119
- <br />
120
- }<br />
121
- div.mlw_qmn_timer {<br />
122
- position:fixed;<br />
123
- top:200px;<br />
124
- right:0px;<br />
125
- width:130px;<br />
126
- color:#00CCFF;<br />
127
- border-radius: 15px;<br />
128
- background:#000000;<br />
129
- text-align: center;<br />
130
- padding: 15px 15px 15px 15px<br />
131
- }<br />
132
- div.mlw_qmn_quiz input[type=submit],<br />
133
- a.mlw_qmn_quiz_link<br />
134
- {<br />
135
- border-radius: 4px;<br />
136
- position: relative;<br />
137
- background-image: linear-gradient(#fff,#dedede);<br />
138
- background-color: #eee;<br />
139
- border: #ccc solid 1px;<br />
140
- color: #333;<br />
141
- text-shadow: 0 1px 0 rgba(255,255,255,.5);<br />
142
- box-sizing: border-box;<br />
143
- display: inline-block;<br />
144
- padding: 5px 5px 5px 5px;<br />
145
- margin: auto;<br />
146
- }<br />
147
- </td>
148
  </tr>
149
  </table>
150
  <button id="save_styles_button" class="button" onclick="javascript: document.quiz_style_form.submit();"><?php _e('Save Quiz Style', 'quiz-master-next'); ?></button>
99
 
100
  <table class="form-table">
101
  <tr>
102
+ <td><textarea style="width: 100%; height: 700px;" id="quiz_css" name="quiz_css"><?php echo $mlw_quiz_options->quiz_stye; ?></textarea></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  </tr>
104
  </table>
105
  <button id="save_styles_button" class="button" onclick="javascript: document.quiz_style_form.submit();"><?php _e('Save Quiz Style', 'quiz-master-next'); ?></button>
includes/qmn_options_text_tab.php CHANGED
@@ -30,11 +30,11 @@ function mlw_options_text_tab_content()
30
  $mlw_limit_total_entries_text = htmlspecialchars($_POST["mlw_limit_total_entries_text"], ENT_QUOTES);
31
  $mlw_qmn_pagination_field = serialize(array( $_POST["pagination_prev_text"], $_POST["pagination_next_text"] ));
32
  $qmn_social_media_text = serialize(array('twitter' => $_POST["mlw_quiz_twitter_text_template"], 'facebook' => $_POST["mlw_quiz_facebook_text_template"]));
33
- $mlw_email_from_text = $_POST["emailFromText"];
34
  $mlw_question_answer_template = htmlspecialchars($_POST["mlw_quiz_question_answer_template"], ENT_QUOTES);
35
  $quiz_id = $_POST["quiz_id"];
36
 
37
- $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET message_before='".$mlw_before_message."', message_comment='".$mlw_before_comments."', message_end_template='".$mlw_qmn_message_end."', comment_field_text='".$mlw_comment_field_text."', email_from_text='".$mlw_email_from_text."', question_answer_template='".$mlw_question_answer_template."', submit_button_text='".$mlw_submit_button_text."', name_field_text='".$mlw_name_field_text."', business_field_text='".$mlw_business_field_text."', email_field_text='".$mlw_email_field_text."', phone_field_text='".$mlw_phone_field_text."', total_user_tries_text='".$mlw_user_tries_text."', social_media_text='".$qmn_social_media_text."', pagination_text='".$mlw_qmn_pagination_field."', require_log_in_text='".$mlw_require_log_in_text."', limit_total_entries_text='".$mlw_limit_total_entries_text."', last_activity='".date("Y-m-d H:i:s")."', scheduled_timeframe_text='".$mlw_scheduled_timeframe_text."' WHERE quiz_id=".$quiz_id;
38
  $results = $wpdb->query( $update );
39
  if ($results != false)
40
  {
@@ -85,61 +85,86 @@ function mlw_options_text_tab_content()
85
  'facebook' => $mlw_quiz_options->social_media_text
86
  );
87
  }
 
88
  ?>
89
  <div id="tabs-2" class="mlw_tab_content">
90
  <h3 style="text-align: center;"><?php _e("Template Variables", 'quiz-master-next'); ?></h3>
91
- <table class="form-table">
92
- <tr>
93
- <td><strong>%POINT_SCORE%</strong> - <?php _e("Total points user earned when taking quiz", 'quiz-master-next'); ?></td>
94
- <td><strong>%AVERAGE_POINT%</strong> - <?php _e("The average amount of points user had per question", 'quiz-master-next'); ?></td>
95
- </tr>
96
-
97
- <tr>
98
- <td><strong>%AMOUNT_CORRECT%</strong> - <?php _e("The number of correct answers the user had", 'quiz-master-next'); ?></td>
99
- <td><strong>%TOTAL_QUESTIONS%</strong> - <?php _e("The total number of questions in the quiz", 'quiz-master-next'); ?></td>
100
- </tr>
101
-
102
- <tr>
103
- <td><strong>%CORRECT_SCORE%</strong> - <?php _e("The percent score for the quiz showing percent of total quetions answered correctly", 'quiz-master-next'); ?></td>
104
- </tr>
105
-
106
- <tr>
107
- <td><strong>%USER_NAME%</strong> - <?php _e("The name the user entered before the quiz", 'quiz-master-next'); ?></td>
108
- <td><strong>%USER_BUSINESS%</strong> - <?php _e("The business the user entered before the quiz", 'quiz-master-next'); ?></td>
109
- </tr>
110
-
111
- <tr>
112
- <td><strong>%USER_PHONE%</strong> - <?php _e("The phone number the user entered before the quiz", 'quiz-master-next'); ?></td>
113
- <td><strong>%USER_EMAIL%</strong> - <?php _e("The email the user entered before the quiz", 'quiz-master-next'); ?></td>
114
- </tr>
115
-
116
- <tr>
117
- <td><strong>%QUIZ_NAME%</strong> - <?php _e("The name of the quiz", 'quiz-master-next'); ?></td>
118
- <td><strong>%QUESTIONS_ANSWERS%</strong> - <?php _e("Shows the question, the answer the user provided, and the correct answer", 'quiz-master-next'); ?></td>
119
- </tr>
120
-
121
- <tr>
122
- <td><strong>%COMMENT_SECTION%</strong> - <?php _e("The comments the user entered into comment box if enabled", 'quiz-master-next'); ?></td>
123
- <td><strong>%QUESTION%</strong> - <?php _e("The question that the user answered", 'quiz-master-next'); ?></td>
124
- </tr>
125
-
126
- <tr>
127
- <td><strong>%USER_ANSWER%</strong> - <?php _e("The answer the user gave for the question", 'quiz-master-next'); ?></td>
128
- <td><strong>%CORRECT_ANSWER%</strong> - <?php _e("The correct answer for the question", 'quiz-master-next'); ?></td>
129
- </tr>
130
-
131
- <tr>
132
- <td><strong>%USER_COMMENTS%</strong> - <?php _e("The comments the user provided in the comment field for the question", 'quiz-master-next'); ?></td>
133
- <td><strong>%CORRECT_ANSWER_INFO%</strong> - <?php _e("Reason why the correct answer is the correct answer", 'quiz-master-next'); ?></td>
134
- </tr>
135
- <tr>
136
- <td><strong>%TIMER%</strong> - <?php _e("The amount of time user spent of quiz", 'quiz-master-next'); ?></td>
137
- <td><strong>%CERTIFICATE_LINK%</strong> - <?php _e("The link to the certificate after completing the quiz", 'quiz-master-next'); ?></td>
138
- </tr>
139
- <tr>
140
- <td><strong>%CURRENT_DATE%</strong> - <?php _e("The Current Date", 'quiz-master-next'); ?></td>
141
- </tr>
142
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  <button id="save_template_button" class="button" onclick="javascript: document.quiz_template_form.submit();"><?php _e("Save Templates", 'quiz-master-next'); ?></button>
144
  <?php
145
  echo "<form action='' method='post' name='quiz_template_form'>";
@@ -299,10 +324,6 @@ function mlw_options_text_tab_content()
299
  <th scope="row"><label for="pagination_next_text"><?php _e("Text for next button", 'quiz-master-next'); ?></label></th>
300
  <td><input name="pagination_next_text" type="text" id="pagination_next_text" value="<?php echo $mlw_qmn_pagination_text[1]; ?>" class="regular-text" /></td>
301
  </tr>
302
- <tr valign="top">
303
- <th scope="row"><label for="emailFromText"><?php _e("What is the From Name for the email sent to users and admin?", 'quiz-master-next'); ?></label></th>
304
- <td><input name="emailFromText" type="text" id="emailFromText" value="<?php echo $mlw_quiz_options->email_from_text; ?>" class="regular-text" /></td>
305
- </tr>
306
  </table>
307
  <button id="save_template_button" class="button" onclick="javascript: document.quiz_template_form.submit();"><?php _e("Save Templates", 'quiz-master-next'); ?></button>
308
  <?php echo "</form>"; ?>
30
  $mlw_limit_total_entries_text = htmlspecialchars($_POST["mlw_limit_total_entries_text"], ENT_QUOTES);
31
  $mlw_qmn_pagination_field = serialize(array( $_POST["pagination_prev_text"], $_POST["pagination_next_text"] ));
32
  $qmn_social_media_text = serialize(array('twitter' => $_POST["mlw_quiz_twitter_text_template"], 'facebook' => $_POST["mlw_quiz_facebook_text_template"]));
33
+
34
  $mlw_question_answer_template = htmlspecialchars($_POST["mlw_quiz_question_answer_template"], ENT_QUOTES);
35
  $quiz_id = $_POST["quiz_id"];
36
 
37
+ $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET message_before='".$mlw_before_message."', message_comment='".$mlw_before_comments."', message_end_template='".$mlw_qmn_message_end."', comment_field_text='".$mlw_comment_field_text."', question_answer_template='".$mlw_question_answer_template."', submit_button_text='".$mlw_submit_button_text."', name_field_text='".$mlw_name_field_text."', business_field_text='".$mlw_business_field_text."', email_field_text='".$mlw_email_field_text."', phone_field_text='".$mlw_phone_field_text."', total_user_tries_text='".$mlw_user_tries_text."', social_media_text='".$qmn_social_media_text."', pagination_text='".$mlw_qmn_pagination_field."', require_log_in_text='".$mlw_require_log_in_text."', limit_total_entries_text='".$mlw_limit_total_entries_text."', last_activity='".date("Y-m-d H:i:s")."', scheduled_timeframe_text='".$mlw_scheduled_timeframe_text."' WHERE quiz_id=".$quiz_id;
38
  $results = $wpdb->query( $update );
39
  if ($results != false)
40
  {
85
  'facebook' => $mlw_quiz_options->social_media_text
86
  );
87
  }
88
+ wp_enqueue_style( 'qmn_admin_style', plugins_url( 'css/qmn_admin.css' , __FILE__ ) );
89
  ?>
90
  <div id="tabs-2" class="mlw_tab_content">
91
  <h3 style="text-align: center;"><?php _e("Template Variables", 'quiz-master-next'); ?></h3>
92
+ <div class="template_list_holder">
93
+ <div class="template_variable">
94
+ <span class="template_name">%POINT_SCORE%</span> - <?php _e('Score for the quiz when using points', 'quiz-master-next'); ?>
95
+ </div>
96
+ <div class="template_variable">
97
+ <span class="template_name">%AVERAGE_POINT%</span> - <?php _e('The average amount of points user had per question', 'quiz-master-next'); ?>
98
+ </div>
99
+ <div class="template_variable">
100
+ <span class="template_name">%AMOUNT_CORRECT%</span> - <?php _e('The number of correct answers the user had', 'quiz-master-next'); ?>
101
+ </div>
102
+ <div class="template_variable">
103
+ <span class="template_name">%TOTAL_QUESTIONS%</span> - <?php _e('The total number of questions in the quiz', 'quiz-master-next'); ?>
104
+ </div>
105
+ <div class="template_variable">
106
+ <span class="template_name">%CORRECT_SCORE%</span> - <?php _e('Score for the quiz when using correct answers', 'quiz-master-next'); ?>
107
+ </div>
108
+ <div class="template_variable">
109
+ <span class="template_name">%USER_NAME%</span> - <?php _e('The name the user entered before the quiz', 'quiz-master-next'); ?>
110
+ </div>
111
+ <div class="template_variable">
112
+ <span class="template_name">%USER_BUSINESS%</span> - <?php _e('The business the user entered before the quiz', 'quiz-master-next'); ?>
113
+ </div>
114
+ <div class="template_variable">
115
+ <span class="template_name">%USER_PHONE%</span> - <?php _e('The phone number the user entered before the quiz', 'quiz-master-next'); ?>
116
+ </div>
117
+ <div class="template_variable">
118
+ <span class="template_name">%USER_EMAIL%</span> - <?php _e('The email the user entered before the quiz', 'quiz-master-next'); ?>
119
+ </div>
120
+ <div class="template_variable">
121
+ <span class="template_name">%QUIZ_NAME%</span> - <?php _e('The name of the quiz', 'quiz-master-next'); ?>
122
+ </div>
123
+ <div class="template_variable">
124
+ <span class="template_name">%QUESTIONS_ANSWERS%</span> - <?php _e('Shows the question, the answer the user provided, and the correct answer', 'quiz-master-next'); ?>
125
+ </div>
126
+ <div class="template_variable">
127
+ <span class="template_name">%COMMENT_SECTION%</span> - <?php _e('The comments the user entered into comment box if enabled', 'quiz-master-next'); ?>
128
+ </div>
129
+ <div class="template_variable">
130
+ <span class="template_name">%TIMER%</span> - <?php _e('The amount of time user spent of quiz', 'quiz-master-next'); ?>
131
+ </div>
132
+ <div class="template_variable">
133
+ <span class="template_name">%CERTIFICATE_LINK%</span> - <?php _e('The link to the certificate after completing the quiz', 'quiz-master-next'); ?>
134
+ </div>
135
+ <div class="template_variable">
136
+ <span class="template_name">%CATEGORY_POINTS%%/CATEGORY_POINTS%</span> - <?php _e('The amount of points a specific category earned.', 'quiz-master-next'); ?>
137
+ </div>
138
+ <div class="template_variable">
139
+ <span class="template_name">%CATEGORY_SCORE%%/CATEGORY_SCORE%</span> - <?php _e('The score a specific category earned.', 'quiz-master-next'); ?>
140
+ </div>
141
+ <div class="template_variable">
142
+ <span class="template_name">%CATEGORY_AVERAGE_POINTS%</span> - <?php _e('The average points from all categories.', 'quiz-master-next'); ?>
143
+ </div>
144
+ <div class="template_variable">
145
+ <span class="template_name">%CATEGORY_AVERAGE_SCORE%</span> - <?php _e('The average score from all categories.', 'quiz-master-next'); ?>
146
+ </div>
147
+ <div class="template_variable">
148
+ <span class="template_name">%QUESTION%</span> - <?php _e('The question that the user answered', 'quiz-master-next'); ?>
149
+ </div>
150
+ <div class="template_variable">
151
+ <span class="template_name">%USER_ANSWER%</span> - <?php _e('The answer the user gave for the question', 'quiz-master-next'); ?>
152
+ </div>
153
+ <div class="template_variable">
154
+ <span class="template_name">%CORRECT_ANSWER%</span> - <?php _e('The correct answer for the question', 'quiz-master-next'); ?>
155
+ </div>
156
+ <div class="template_variable">
157
+ <span class="template_name">%USER_COMMENTS%</span> - <?php _e('The comments the user provided in the comment field for the question', 'quiz-master-next'); ?>
158
+ </div>
159
+ <div class="template_variable">
160
+ <span class="template_name">%CORRECT_ANSWER_INFO%</span> - <?php _e('Reason why the correct answer is the correct answer', 'quiz-master-next'); ?>
161
+ </div>
162
+ <div class="template_variable">
163
+ <span class="template_name">%CURRENT_DATE%</span> - <?php _e('The Current Date', 'quiz-master-next'); ?>
164
+ </div>
165
+ <?php do_action('qmn_template_variable_list'); ?>
166
+ </div>
167
+ <div style="clear:both;"></div>
168
  <button id="save_template_button" class="button" onclick="javascript: document.quiz_template_form.submit();"><?php _e("Save Templates", 'quiz-master-next'); ?></button>
169
  <?php
170
  echo "<form action='' method='post' name='quiz_template_form'>";
324
  <th scope="row"><label for="pagination_next_text"><?php _e("Text for next button", 'quiz-master-next'); ?></label></th>
325
  <td><input name="pagination_next_text" type="text" id="pagination_next_text" value="<?php echo $mlw_qmn_pagination_text[1]; ?>" class="regular-text" /></td>
326
  </tr>
 
 
 
 
327
  </table>
328
  <button id="save_template_button" class="button" onclick="javascript: document.quiz_template_form.submit();"><?php _e("Save Templates", 'quiz-master-next'); ?></button>
329
  <?php echo "</form>"; ?>
includes/qmn_quiz.php CHANGED
@@ -57,10 +57,18 @@ class QMNQuizManager
57
  global $qmn_allowed_visit;
58
  $qmn_allowed_visit = true;
59
  $mlwQuizMasterNext->quizCreator->set_id($quiz);
60
- date_default_timezone_set(get_option('timezone_string'));
 
 
 
61
  $return_display = '';
62
  $qmn_quiz_options = $this->load_quiz_options($quiz);
63
 
 
 
 
 
 
64
  $qmn_array_for_variables = array(
65
  'quiz_id' => $qmn_quiz_options->quiz_id,
66
  'quiz_name' => $qmn_quiz_options->quiz_name,
@@ -264,7 +272,7 @@ class QMNQuizManager
264
  global $mlw_qmn_section_count;
265
  $section_display = "<div class='quiz_section quiz_begin slide$mlw_qmn_section_count'>";
266
 
267
- $message_before = htmlspecialchars_decode($qmn_quiz_options->message_before, ENT_QUOTES);
268
  $message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_before, $qmn_array_for_variables);
269
 
270
  $section_display .= "<span class='mlw_qmn_message_before'>$message_before</span><br />";
@@ -345,10 +353,10 @@ class QMNQuizManager
345
  {
346
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
347
  $comment_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
348
- $message_comments = htmlspecialchars_decode($qmn_quiz_options->message_comment, ENT_QUOTES);
349
  $message_comments = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_comments, $qmn_array_for_variables);
350
  $comment_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text'>$message_comments</label><br />";
351
- $comment_display .= "<textarea cols='60' rows='10' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
352
  $comment_display .= "</div>";
353
  if ( $qmn_quiz_options->pagination == 0) { $comment_display .= "<br /><br />"; }
354
  }
@@ -374,7 +382,7 @@ class QMNQuizManager
374
  $section_display .= "<div class='quiz_section slide$mlw_qmn_section_count quiz_end'>";
375
  if ($qmn_quiz_options->message_end_template != '')
376
  {
377
- $message_end = htmlspecialchars_decode($qmn_quiz_options->message_end_template, ENT_QUOTES);
378
  $message_end = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_end, $qmn_array_for_variables);
379
  $section_display .= "<span class='mlw_qmn_message_end'>$message_end</span>";
380
  $section_display .= "<br /><br />";
@@ -774,6 +782,12 @@ EOC;
774
  if ($qmn_quiz_options->social_media == 1)
775
  {
776
  wp_enqueue_script( 'qmn_quiz_social_share', plugins_url( 'js/qmn_social_share.js' , __FILE__ ) );
 
 
 
 
 
 
777
 
778
  //Load Social Media Text
779
  $qmn_social_media_text = "";
@@ -791,7 +805,7 @@ EOC;
791
  $qmn_social_media_text["twitter"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["twitter"], $qmn_array_for_variables);
792
  $qmn_social_media_text["facebook"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["facebook"], $qmn_array_for_variables);
793
  $social_display .= "<br />
794
- <a class=\"mlw_qmn_quiz_link\" onclick=\"mlw_qmn_share('facebook', '".esc_js($qmn_social_media_text["facebook"])."', '".esc_js($qmn_quiz_options->quiz_name)."');\">Facebook</a>
795
  <a class=\"mlw_qmn_quiz_link\" onclick=\"mlw_qmn_share('twitter', '".esc_js($qmn_social_media_text["twitter"])."', '".esc_js($qmn_quiz_options->quiz_name)."');\">Twitter</a>
796
  <br />";
797
  }
@@ -993,7 +1007,7 @@ function qmn_require_login_check($display, $qmn_quiz_options, $qmn_array_for_var
993
  if ( $qmn_quiz_options->require_log_in == 1 && !is_user_logged_in() )
994
  {
995
  $qmn_allowed_visit = false;
996
- $mlw_message = htmlspecialchars_decode($qmn_quiz_options->require_log_in_text, ENT_QUOTES);
997
  $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables);
998
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
999
  $display .= $mlw_message;
@@ -1016,7 +1030,7 @@ function qmn_scheduled_timeframe_check($display, $qmn_quiz_options, $qmn_array_f
1016
  if (time() < $qmn_scheduled_start | time() > $qmn_scheduled_end)
1017
  {
1018
  $qmn_allowed_visit = false;
1019
- $mlw_message = htmlspecialchars_decode($qmn_quiz_options->scheduled_timeframe_text, ENT_QUOTES);
1020
  $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables);
1021
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1022
  $display .= $mlw_message;
@@ -1038,7 +1052,7 @@ function qmn_total_user_tries_check($display, $qmn_quiz_options, $qmn_array_for_
1038
  if ($mlw_qmn_user_try_count >= $qmn_quiz_options->total_user_tries)
1039
  {
1040
  $qmn_allowed_visit = false;
1041
- $mlw_message = htmlspecialchars_decode($qmn_quiz_options->total_user_tries_text, ENT_QUOTES);
1042
  $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables);
1043
  $display .= $mlw_message;
1044
  }
@@ -1046,18 +1060,6 @@ function qmn_total_user_tries_check($display, $qmn_quiz_options, $qmn_array_for_
1046
  return $display;
1047
  }
1048
 
1049
- add_filter('qmn_begin_shortcode', 'qmn_quiz_name_check', 10, 3);
1050
- function qmn_quiz_name_check($display, $qmn_quiz_options, $qmn_array_for_variables)
1051
- {
1052
- global $qmn_allowed_visit;
1053
- if ($qmn_quiz_options->quiz_name == "")
1054
- {
1055
- $qmn_allowed_visit = false;
1056
- $display .= __("It appears that this quiz is not set up correctly.", 'quiz-master-next');
1057
- }
1058
- return $display;
1059
- }
1060
-
1061
  add_filter('qmn_begin_quiz', 'qmn_total_tries_check', 10, 3);
1062
  function qmn_total_tries_check($display, $qmn_quiz_options, $qmn_array_for_variables)
1063
  {
@@ -1068,7 +1070,7 @@ function qmn_total_tries_check($display, $qmn_quiz_options, $qmn_array_for_varia
1068
  $mlw_qmn_entries_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(quiz_id) FROM ".$wpdb->prefix."mlw_results WHERE deleted='0' AND quiz_id=%d", $qmn_array_for_variables['quiz_id'] ) );
1069
  if ($mlw_qmn_entries_count >= $qmn_quiz_options->limit_total_entries)
1070
  {
1071
- $mlw_message = htmlspecialchars_decode($qmn_quiz_options->limit_total_entries_text, ENT_QUOTES);
1072
  $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables);
1073
  $display .= $mlw_message;
1074
  $qmn_allowed_visit = false;
@@ -1200,7 +1202,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1200
  if ($mlw_quiz_options->user_name != 2)
1201
  {
1202
  $mlw_contact_class = "class=\"\"";
1203
- if ($mlw_quiz_options->user_name == 1)
1204
  {
1205
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1206
  }
@@ -1212,7 +1214,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1212
  if ($mlw_quiz_options->user_comp != 2)
1213
  {
1214
  $mlw_contact_class = "class=\"\"";
1215
- if ($mlw_quiz_options->user_comp == 1)
1216
  {
1217
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1218
  }
@@ -1223,7 +1225,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1223
  if ($mlw_quiz_options->user_email != 2)
1224
  {
1225
  $mlw_contact_class = "class=\"mlwEmail\"";
1226
- if ($mlw_quiz_options->user_email == 1)
1227
  {
1228
  $mlw_contact_class = "class=\"mlwEmail mlwRequiredText\"";
1229
  }
@@ -1234,7 +1236,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1234
  if ($mlw_quiz_options->user_phone != 2)
1235
  {
1236
  $mlw_contact_class = "class=\"\"";
1237
- if ($mlw_quiz_options->user_phone == 1)
1238
  {
1239
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1240
  }
57
  global $qmn_allowed_visit;
58
  $qmn_allowed_visit = true;
59
  $mlwQuizMasterNext->quizCreator->set_id($quiz);
60
+ if (get_option('timezone_string') != '' && get_option('timezone_string') !== false)
61
+ {
62
+ date_default_timezone_set(get_option('timezone_string'));
63
+ }
64
  $return_display = '';
65
  $qmn_quiz_options = $this->load_quiz_options($quiz);
66
 
67
+ if (is_null($qmn_quiz_options) || $qmn_quiz_options->quiz_name == '')
68
+ {
69
+ return "It appears that this quiz is not set up correctly";
70
+ }
71
+
72
  $qmn_array_for_variables = array(
73
  'quiz_id' => $qmn_quiz_options->quiz_id,
74
  'quiz_name' => $qmn_quiz_options->quiz_name,
272
  global $mlw_qmn_section_count;
273
  $section_display = "<div class='quiz_section quiz_begin slide$mlw_qmn_section_count'>";
274
 
275
+ $message_before = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_before, ENT_QUOTES));
276
  $message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_before, $qmn_array_for_variables);
277
 
278
  $section_display .= "<span class='mlw_qmn_message_before'>$message_before</span><br />";
353
  {
354
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
355
  $comment_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
356
+ $message_comments = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_comment, ENT_QUOTES));
357
  $message_comments = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_comments, $qmn_array_for_variables);
358
  $comment_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text'>$message_comments</label><br />";
359
+ $comment_display .= "<textarea cols='60' rows='10' id='mlwQuizComments' name='mlwQuizComments' class='qmn_comment_section'></textarea>";
360
  $comment_display .= "</div>";
361
  if ( $qmn_quiz_options->pagination == 0) { $comment_display .= "<br /><br />"; }
362
  }
382
  $section_display .= "<div class='quiz_section slide$mlw_qmn_section_count quiz_end'>";
383
  if ($qmn_quiz_options->message_end_template != '')
384
  {
385
+ $message_end = wpautop(htmlspecialchars_decode($qmn_quiz_options->message_end_template, ENT_QUOTES));
386
  $message_end = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_end, $qmn_array_for_variables);
387
  $section_display .= "<span class='mlw_qmn_message_end'>$message_end</span>";
388
  $section_display .= "<br /><br />";
782
  if ($qmn_quiz_options->social_media == 1)
783
  {
784
  wp_enqueue_script( 'qmn_quiz_social_share', plugins_url( 'js/qmn_social_share.js' , __FILE__ ) );
785
+ $settings = (array) get_option( 'qmn-settings' );
786
+ $facebook_app_id = '483815031724529';
787
+ if (isset($settings['facebook_app_id']))
788
+ {
789
+ $facebook_app_id = esc_js( $settings['facebook_app_id'] );
790
+ }
791
 
792
  //Load Social Media Text
793
  $qmn_social_media_text = "";
805
  $qmn_social_media_text["twitter"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["twitter"], $qmn_array_for_variables);
806
  $qmn_social_media_text["facebook"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["facebook"], $qmn_array_for_variables);
807
  $social_display .= "<br />
808
+ <a class=\"mlw_qmn_quiz_link\" onclick=\"mlw_qmn_share('facebook', '".esc_js($qmn_social_media_text["facebook"])."', '".esc_js($qmn_quiz_options->quiz_name)."', '$facebook_app_id');\">Facebook</a>
809
  <a class=\"mlw_qmn_quiz_link\" onclick=\"mlw_qmn_share('twitter', '".esc_js($qmn_social_media_text["twitter"])."', '".esc_js($qmn_quiz_options->quiz_name)."');\">Twitter</a>
810
  <br />";
811
  }
1007
  if ( $qmn_quiz_options->require_log_in == 1 && !is_user_logged_in() )
1008
  {
1009
  $qmn_allowed_visit = false;
1010
+ $mlw_message = wpautop(htmlspecialchars_decode($qmn_quiz_options->require_log_in_text, ENT_QUOTES));
1011
  $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables);
1012
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1013
  $display .= $mlw_message;
1030
  if (time() < $qmn_scheduled_start | time() > $qmn_scheduled_end)
1031
  {
1032
  $qmn_allowed_visit = false;
1033
+ $mlw_message = wpautop(htmlspecialchars_decode($qmn_quiz_options->scheduled_timeframe_text, ENT_QUOTES));
1034
  $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables);
1035
  $mlw_message = str_replace( "\n" , "<br>", $mlw_message);
1036
  $display .= $mlw_message;
1052
  if ($mlw_qmn_user_try_count >= $qmn_quiz_options->total_user_tries)
1053
  {
1054
  $qmn_allowed_visit = false;
1055
+ $mlw_message = wpautop(htmlspecialchars_decode($qmn_quiz_options->total_user_tries_text, ENT_QUOTES));
1056
  $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables);
1057
  $display .= $mlw_message;
1058
  }
1060
  return $display;
1061
  }
1062
 
 
 
 
 
 
 
 
 
 
 
 
 
1063
  add_filter('qmn_begin_quiz', 'qmn_total_tries_check', 10, 3);
1064
  function qmn_total_tries_check($display, $qmn_quiz_options, $qmn_array_for_variables)
1065
  {
1070
  $mlw_qmn_entries_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(quiz_id) FROM ".$wpdb->prefix."mlw_results WHERE deleted='0' AND quiz_id=%d", $qmn_array_for_variables['quiz_id'] ) );
1071
  if ($mlw_qmn_entries_count >= $qmn_quiz_options->limit_total_entries)
1072
  {
1073
+ $mlw_message = wpautop(htmlspecialchars_decode($qmn_quiz_options->limit_total_entries_text, ENT_QUOTES));
1074
  $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables);
1075
  $display .= $mlw_message;
1076
  $qmn_allowed_visit = false;
1202
  if ($mlw_quiz_options->user_name != 2)
1203
  {
1204
  $mlw_contact_class = "class=\"\"";
1205
+ if ($mlw_quiz_options->user_name == 1 && $mlw_quiz_options->loggedin_user_contact != 1)
1206
  {
1207
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1208
  }
1214
  if ($mlw_quiz_options->user_comp != 2)
1215
  {
1216
  $mlw_contact_class = "class=\"\"";
1217
+ if ($mlw_quiz_options->user_comp == 1 && $mlw_quiz_options->loggedin_user_contact != 1)
1218
  {
1219
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1220
  }
1225
  if ($mlw_quiz_options->user_email != 2)
1226
  {
1227
  $mlw_contact_class = "class=\"mlwEmail\"";
1228
+ if ($mlw_quiz_options->user_email == 1 && $mlw_quiz_options->loggedin_user_contact != 1)
1229
  {
1230
  $mlw_contact_class = "class=\"mlwEmail mlwRequiredText\"";
1231
  }
1236
  if ($mlw_quiz_options->user_phone != 2)
1237
  {
1238
  $mlw_contact_class = "class=\"\"";
1239
+ if ($mlw_quiz_options->user_phone == 1 && $mlw_quiz_options->loggedin_user_contact != 1)
1240
  {
1241
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1242
  }
includes/qmn_quiz_admin.php CHANGED
@@ -55,6 +55,18 @@ function mlw_generate_quiz_admin()
55
  $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT quiz_id, quiz_name, quiz_views, quiz_taken, last_activity
56
  FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted='0'
57
  ORDER BY quiz_id DESC LIMIT %d, %d", $mlw_qmn_quiz_begin, $mlw_qmn_table_limit ) );
 
 
 
 
 
 
 
 
 
 
 
 
58
  ?>
59
  <!-- css -->
60
  <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
@@ -168,7 +180,20 @@ function mlw_generate_quiz_admin()
168
  <div class='mlw_quiz_options'>
169
  <h2><?php _e('Quizzes', 'quiz-master-next'); ?><a id="new_quiz_button" href="javascript:();" class="add-new-h2"><?php _e('Add New', 'quiz-master-next'); ?></a></h2>
170
  <?php $mlwQuizMasterNext->alertManager->showAlerts(); ?>
171
- <div style="width: 85%; float: left;">
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  <div class="tablenav top">
173
  <div class="tablenav-pages">
174
  <span class="displaying-num"><?php echo sprintf(_n('One quiz', '%s quizzes', $mlw_qmn_quiz_count, 'quiz-master-next'), number_format_i18n($mlw_qmn_quiz_count)); ?></span>
@@ -217,6 +242,7 @@ function mlw_generate_quiz_admin()
217
  <tr>
218
  <th>Quiz ID</th>
219
  <th><?php _e('Quiz Name', 'quiz-master-next'); ?></th>
 
220
  <th><?php _e('Quiz Shortcode', 'quiz-master-next'); ?></th>
221
  <th><?php _e('Leaderboard Shortcode', 'quiz-master-next'); ?></th>
222
  <th><?php _e('Quiz Views', 'quiz-master-next'); ?></th>
@@ -241,6 +267,14 @@ function mlw_generate_quiz_admin()
241
  | <a href='javascript:();' class='linkOptions' onclick=\"duplicateQuiz('".$mlw_quiz_info->quiz_id."','".esc_js($mlw_quiz_info->quiz_name)."')\">".__('Duplicate', 'quiz-master-next')."</a>
242
  | <a class='linkOptions linkDelete' onclick=\"deleteQuiz('".$mlw_quiz_info->quiz_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='javascript:();'>".__('Delete', 'quiz-master-next')."</a>
243
  </div></td>";
 
 
 
 
 
 
 
 
244
  $quotes_list .= "<td><span style='font-size:16px;'>[mlw_quizmaster quiz=".$mlw_quiz_info->quiz_id."]</span></td>";
245
  $quotes_list .= "<td><span style='font-size:16px;'>[mlw_quizmaster_leaderboard mlw_quiz=".$mlw_quiz_info->quiz_id."]</span></td>";
246
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_views . "</span></td>";
@@ -263,35 +297,42 @@ function mlw_generate_quiz_admin()
263
  </tfoot>
264
  </table>
265
  </div>
266
- <div style="width: 15%; float:right;">
267
- <h3 style="text-align: center;">My Local Webstop News</h3>
268
- <?php
269
- $qmn_rss = array();
270
- $qmn_feed = fetch_feed('http://mylocalwebstop.com/category/our-blog/feed');
271
- if (!is_wp_error($qmn_feed)) {
272
- $qmn_feed_items = $qmn_feed->get_items(0, 5);
273
- foreach ($qmn_feed_items as $feed_item) {
274
- $qmn_rss[] = array(
275
- 'link' => $feed_item->get_link(),
276
- 'title' => $feed_item->get_title(),
277
- 'description' => $feed_item->get_description(),
278
- 'date' => $feed_item->get_date( 'F j Y' ),
279
- 'author' => $feed_item->get_author()->get_name()
280
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  }
282
- }
283
- foreach($qmn_rss as $item)
284
- {
285
  ?>
286
- <h3><a target='_blank' href="<?php echo $item['link']; ?>"><?php echo $item['title']; ?></a></h3>
287
- <p>By <?php echo $item['author']; ?> on <?php echo $item['date']; ?></p>
288
- <div>
289
- <?php echo $item['description']; ?>
290
- </div>
291
- <?php
292
- }
293
- ?>
294
- </div>
295
  <div style="clear: both;"></div>
296
  <?php echo mlw_qmn_show_adverts(); ?>
297
  <!--Dialogs-->
55
  $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT quiz_id, quiz_name, quiz_views, quiz_taken, last_activity
56
  FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted='0'
57
  ORDER BY quiz_id DESC LIMIT %d, %d", $mlw_qmn_quiz_begin, $mlw_qmn_table_limit ) );
58
+
59
+ $post_to_quiz_array = array();
60
+ $my_query = new WP_Query( array('post_type' => 'quiz') );
61
+ if( $my_query->have_posts() )
62
+ {
63
+ while( $my_query->have_posts() )
64
+ {
65
+ $my_query->the_post();
66
+ $post_to_quiz_array[get_post_meta( get_the_ID(), 'quiz_id', true )] = get_the_permalink();
67
+ }
68
+ }
69
+ wp_reset_postdata();
70
  ?>
71
  <!-- css -->
72
  <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
180
  <div class='mlw_quiz_options'>
181
  <h2><?php _e('Quizzes', 'quiz-master-next'); ?><a id="new_quiz_button" href="javascript:();" class="add-new-h2"><?php _e('Add New', 'quiz-master-next'); ?></a></h2>
182
  <?php $mlwQuizMasterNext->alertManager->showAlerts(); ?>
183
+ <?php
184
+ if ( get_option('mlw_advert_shows') == 'true' )
185
+ {
186
+ ?>
187
+ <div style="width: 85%; float: left;">
188
+ <?php
189
+ }
190
+ else
191
+ {
192
+ ?>
193
+ <div style="width: 100%; float: left;">
194
+ <?php
195
+ }
196
+ ?>
197
  <div class="tablenav top">
198
  <div class="tablenav-pages">
199
  <span class="displaying-num"><?php echo sprintf(_n('One quiz', '%s quizzes', $mlw_qmn_quiz_count, 'quiz-master-next'), number_format_i18n($mlw_qmn_quiz_count)); ?></span>
242
  <tr>
243
  <th>Quiz ID</th>
244
  <th><?php _e('Quiz Name', 'quiz-master-next'); ?></th>
245
+ <th><?php _e('URL', 'quiz-master-next'); ?></th>
246
  <th><?php _e('Quiz Shortcode', 'quiz-master-next'); ?></th>
247
  <th><?php _e('Leaderboard Shortcode', 'quiz-master-next'); ?></th>
248
  <th><?php _e('Quiz Views', 'quiz-master-next'); ?></th>
267
  | <a href='javascript:();' class='linkOptions' onclick=\"duplicateQuiz('".$mlw_quiz_info->quiz_id."','".esc_js($mlw_quiz_info->quiz_name)."')\">".__('Duplicate', 'quiz-master-next')."</a>
268
  | <a class='linkOptions linkDelete' onclick=\"deleteQuiz('".$mlw_quiz_info->quiz_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='javascript:();'>".__('Delete', 'quiz-master-next')."</a>
269
  </div></td>";
270
+ if (isset($post_to_quiz_array[$mlw_quiz_info->quiz_id]))
271
+ {
272
+ $quotes_list .= "<td><span style='font-size:16px;'><a href='".$post_to_quiz_array[$mlw_quiz_info->quiz_id]."'>".$post_to_quiz_array[$mlw_quiz_info->quiz_id]."</a></span></td>";
273
+ }
274
+ else
275
+ {
276
+ $quotes_list .= "<td><span style='font-size:16px;'></span></td>";
277
+ }
278
  $quotes_list .= "<td><span style='font-size:16px;'>[mlw_quizmaster quiz=".$mlw_quiz_info->quiz_id."]</span></td>";
279
  $quotes_list .= "<td><span style='font-size:16px;'>[mlw_quizmaster_leaderboard mlw_quiz=".$mlw_quiz_info->quiz_id."]</span></td>";
280
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_views . "</span></td>";
297
  </tfoot>
298
  </table>
299
  </div>
300
+ <?php
301
+ if ( get_option('mlw_advert_shows') == 'true' )
302
+ {
303
+ ?>
304
+ <div style="width: 15%; float:right;">
305
+ <h3 style="text-align: center;">My Local Webstop News</h3>
306
+ <?php
307
+ $qmn_rss = array();
308
+ $qmn_feed = fetch_feed('http://mylocalwebstop.com/category/our-blog/feed');
309
+ if (!is_wp_error($qmn_feed)) {
310
+ $qmn_feed_items = $qmn_feed->get_items(0, 5);
311
+ foreach ($qmn_feed_items as $feed_item) {
312
+ $qmn_rss[] = array(
313
+ 'link' => $feed_item->get_link(),
314
+ 'title' => $feed_item->get_title(),
315
+ 'description' => $feed_item->get_description(),
316
+ 'date' => $feed_item->get_date( 'F j Y' ),
317
+ 'author' => $feed_item->get_author()->get_name()
318
+ );
319
+ }
320
+ }
321
+ foreach($qmn_rss as $item)
322
+ {
323
+ ?>
324
+ <h3><a target='_blank' href="<?php echo $item['link']; ?>"><?php echo $item['title']; ?></a></h3>
325
+ <p>By <?php echo $item['author']; ?> on <?php echo $item['date']; ?></p>
326
+ <div>
327
+ <?php echo $item['description']; ?>
328
+ </div>
329
+ <?php
330
  }
 
 
 
331
  ?>
332
+ </div>
333
+ <?php
334
+ }
335
+ ?>
 
 
 
 
 
336
  <div style="clear: both;"></div>
337
  <?php echo mlw_qmn_show_adverts(); ?>
338
  <!--Dialogs-->
includes/qmn_quiz_creator.php CHANGED
@@ -180,7 +180,7 @@ class QMNQuizCreator
180
  }
181
  .mlw_horizontal_choice
182
  {
183
- margin-right: 20px;
184
  }
185
  div.mlw_qmn_timer {
186
  position:fixed;
@@ -205,7 +205,7 @@ class QMNQuizCreator
205
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
206
  box-sizing: border-box;
207
  display: inline-block;
208
- padding: 5px 5px 5px 5px;
209
  margin: auto;
210
  font-weight: bold;
211
  cursor: pointer;
@@ -214,9 +214,29 @@ class QMNQuizCreator
214
  {
215
  font-weight: bold;
216
  }
 
 
 
 
217
  .mlw_qmn_comment_section_text
218
  {
219
  font-weight: bold;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  }";
221
  $mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
222
  $results = $wpdb->insert(
@@ -332,6 +352,19 @@ class QMNQuizCreator
332
  );
333
  if ($results != false)
334
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  $mlwQuizMasterNext->alertManager->newAlert(__('Your new quiz has been created successfully. To begin editing your quiz, click the Edit link on the new quiz.', 'quiz-master-next'), 'success');
336
  //Insert Action Into Audit Trail
337
  global $current_user;
@@ -341,12 +374,12 @@ class QMNQuizCreator
341
  "(trail_id, action_user, action, time) " .
342
  "VALUES (NULL , '" . $current_user->display_name . "' , 'New Quiz Has Been Created: ".$quiz_name."' , '" . date("h:i:s A m/d/Y") . "')";
343
  $results = $wpdb->query( $insert );
 
344
  }
345
  else
346
  {
347
  $mlwQuizMasterNext->alertManager->newAlert(sprintf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0001'), 'error');
348
  }
349
- do_action('qmn_quiz_created', $wpdb->insert_id);
350
  }
351
 
352
  /**
@@ -384,6 +417,20 @@ class QMNQuizCreator
384
  );
385
  if ($results != false)
386
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  $mlwQuizMasterNext->alertManager->newAlert(__('Your quiz has been deleted successfully.', 'quiz-master-next'), 'success');
388
 
389
  //Insert Action Into Audit Trail
180
  }
181
  .mlw_horizontal_choice
182
  {
183
+ margin-right: 20px;
184
  }
185
  div.mlw_qmn_timer {
186
  position:fixed;
205
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
206
  box-sizing: border-box;
207
  display: inline-block;
208
+ padding: 7px 7px 7px 7px;
209
  margin: auto;
210
  font-weight: bold;
211
  cursor: pointer;
214
  {
215
  font-weight: bold;
216
  }
217
+ .mlw_qmn_question_number
218
+ {
219
+ font-weight: bold;
220
+ }
221
  .mlw_qmn_comment_section_text
222
  {
223
  font-weight: bold;
224
+ }
225
+ .mlw_next
226
+ {
227
+ float: right;
228
+ }
229
+ .mlw_previous
230
+ {
231
+ float: left;
232
+ }
233
+ .mlw_qmn_question_comment, .mlw_answer_open_text, .qmn_comment_section {
234
+ width: 100%;
235
+ border-radius: 7px;
236
+ padding: 2px 10px;
237
+ -webkit-box-shadow: inset 0 3px 3px rgba(0,0,0,.075);
238
+ box-shadow: inset 0 3px 3px rgba(0,0,0,.075);
239
+ border: 1px solid #ccc;
240
  }";
241
  $mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
242
  $results = $wpdb->insert(
352
  );
353
  if ($results != false)
354
  {
355
+ $new_quiz = $wpdb->insert_id;
356
+ global $current_user;
357
+ get_currentuserinfo();
358
+ $quiz_post = array(
359
+ 'post_title' => $quiz_name,
360
+ 'post_content' => "[mlw_quizmaster quiz=$new_quiz]",
361
+ 'post_status' => 'publish',
362
+ 'post_author' => $current_user->ID,
363
+ 'post_type' => 'quiz'
364
+ );
365
+ $quiz_post_id = wp_insert_post( $quiz_post );
366
+ add_post_meta( $quiz_post_id, 'quiz_id', $new_quiz );
367
+
368
  $mlwQuizMasterNext->alertManager->newAlert(__('Your new quiz has been created successfully. To begin editing your quiz, click the Edit link on the new quiz.', 'quiz-master-next'), 'success');
369
  //Insert Action Into Audit Trail
370
  global $current_user;
374
  "(trail_id, action_user, action, time) " .
375
  "VALUES (NULL , '" . $current_user->display_name . "' , 'New Quiz Has Been Created: ".$quiz_name."' , '" . date("h:i:s A m/d/Y") . "')";
376
  $results = $wpdb->query( $insert );
377
+ do_action('qmn_quiz_created', $new_quiz);
378
  }
379
  else
380
  {
381
  $mlwQuizMasterNext->alertManager->newAlert(sprintf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0001'), 'error');
382
  }
 
383
  }
384
 
385
  /**
417
  );
418
  if ($results != false)
419
  {
420
+ $my_query = new WP_Query( array('post_type' => 'quiz', 'meta_key' => 'quiz_id', 'meta_value' => $quiz_id) );
421
+ if( $my_query->have_posts() )
422
+ {
423
+ while( $my_query->have_posts() )
424
+ {
425
+ $my_query->the_post();
426
+ $my_post = array(
427
+ 'ID' => get_the_ID(),
428
+ 'post_status' => 'draft'
429
+ );
430
+ wp_update_post( $my_post );
431
+ }
432
+ }
433
+ wp_reset_postdata();
434
  $mlwQuizMasterNext->alertManager->newAlert(__('Your quiz has been deleted successfully.', 'quiz-master-next'), 'success');
435
 
436
  //Insert Action Into Audit Trail
includes/qmn_results.php CHANGED
@@ -33,6 +33,36 @@ function mlw_generate_quiz_results()
33
  }
34
  }
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  global $wpdb;
37
  $mlw_qmn_table_limit = 30;
38
  $mlw_qmn_results_count = $wpdb->get_var( "SELECT COUNT(result_id) FROM " . $wpdb->prefix . "mlw_results WHERE deleted='0'" );
@@ -114,112 +144,140 @@ function mlw_generate_quiz_results()
114
  }
115
  </style>
116
  <div class="wrap">
117
- <div class='mlw_quiz_options'>
118
- <h2><?php _e('Quiz Results','quiz-master-next'); ?></h2>
119
- <?php
120
- $mlwQuizMasterNext->alertManager->showAlerts();
121
-
122
- if( $mlw_qmn_result_page > 0 )
123
- {
124
- $mlw_qmn_previous_page = $mlw_qmn_result_page - 2;
125
- echo "<a id=\"prev_page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_previous_page\">".sprintf(__('Previous %s Results','quiz-master-next'),$mlw_qmn_table_limit)."</a>";
126
- if( $mlw_qmn_result_left > $mlw_qmn_table_limit )
127
- {
128
- echo "<a id=\"next_page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_result_page\">".sprintf(__('Next %s Results','quiz-master-next'),$mlw_qmn_table_limit)."</a>";
129
- }
130
- }
131
- else if( $mlw_qmn_result_page == 0 )
132
- {
133
- if( $mlw_qmn_result_left > $mlw_qmn_table_limit )
134
- {
135
- echo "<a id=\"next_page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_result_page\">".sprintf(__('Next %s Results','quiz-master-next'),$mlw_qmn_table_limit)."</a>";
136
- }
137
- }
138
- else if( $mlw_qmn_result_left < $mlw_qmn_table_limit )
139
- {
140
- $mlw_qmn_previous_page = $mlw_qmn_result_page - 2;
141
- echo "<a id=\"prev_page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_previous_page\">".sprintf(__('Previous %s Results','quiz-master-next'),$mlw_qmn_table_limit)."</a>";
142
- }
143
- ?>
144
- <table class=widefat>
145
- <thead>
146
- <tr>
147
- <th><?php _e('Actions','quiz-master-next'); ?></th>
148
- <th><?php _e('Quiz Name','quiz-master-next'); ?></th>
149
- <th><?php _e('Score','quiz-master-next'); ?></th>
150
- <th><?php _e('Time To Complete','quiz-master-next'); ?></th>
151
- <th><?php _e('Name','quiz-master-next'); ?></th>
152
- <th><?php _e('Business','quiz-master-next'); ?></th>
153
- <th><?php _e('Email','quiz-master-next'); ?></th>
154
- <th><?php _e('Phone','quiz-master-next'); ?></th>
155
- <th><?php _e('Time Taken','quiz-master-next'); ?></th>
156
- </tr>
157
- </thead>
158
- <?php
159
- $quotes_list = "";
160
- $display = "";
161
- $alternate = "";
162
- foreach($mlw_quiz_data as $mlw_quiz_info) {
163
- if($alternate) $alternate = "";
164
- else $alternate = " class=\"alternate\"";
165
- $mlw_complete_time = '';
166
- $mlw_qmn_results_array = @unserialize($mlw_quiz_info->quiz_results);
167
- if (is_array($mlw_qmn_results_array))
168
- {
169
- $mlw_complete_hours = floor($mlw_qmn_results_array[0] / 3600);
170
- if ($mlw_complete_hours > 0)
171
- {
172
- $mlw_complete_time .= "$mlw_complete_hours hours ";
173
- }
174
- $mlw_complete_minutes = floor(($mlw_qmn_results_array[0] % 3600) / 60);
175
- if ($mlw_complete_minutes > 0)
176
- {
177
- $mlw_complete_time .= "$mlw_complete_minutes minutes ";
178
- }
179
- $mlw_complete_seconds = $mlw_qmn_results_array[0] % 60;
180
- $mlw_complete_time .= "$mlw_complete_seconds seconds";
181
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
- $quotes_list .= "<tr{$alternate}>";
184
- $quotes_list .= "<td><span style='color:green;font-size:16px;'><a href='admin.php?page=mlw_quiz_result_details&&result_id=".$mlw_quiz_info->result_id."'>View</a>|<a onclick=\"deleteResults('".$mlw_quiz_info->result_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='#'>Delete</a></span></td>";
185
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_name . "</span></td>";
186
- if ($mlw_quiz_info->quiz_system == 0)
187
- {
188
- $quotes_list .= "<td class='post-title column-title'><span style='font-size:16px;'>" . $mlw_quiz_info->correct ." out of ".$mlw_quiz_info->total." or ".$mlw_quiz_info->correct_score."%</span></td>";
189
- }
190
- if ($mlw_quiz_info->quiz_system == 1)
191
- {
192
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->point_score . " Points</span></td>";
193
- }
194
- if ($mlw_quiz_info->quiz_system == 2)
195
- {
196
- $quotes_list .= "<td><span style='font-size:16px;'>".__('Not Graded','quiz-master-next')."</span></td>";
197
- }
198
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_complete_time ."</span></td>";
199
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->name ."</span></td>";
200
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->business ."</span></td>";
201
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->email ."</span></td>";
202
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->phone ."</span></td>";
203
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->time_taken ."</span></td>";
204
- $quotes_list .= "</tr>";
205
- }
206
- $display .= "<tbody id=\"the-list\">{$quotes_list}</tbody>";
207
- echo $display;
208
- ?>
209
- </table>
210
-
211
- <?php echo mlw_qmn_show_adverts(); ?>
 
212
 
213
- <div id="delete_dialog" title="Delete Results?" style="display:none;">
214
- <h3><b><?php _e('Are you sure you want to delete these results?','quiz-master-next'); ?></b></h3>
215
- <form action='' method='post'>
216
- <input type='hidden' name='delete_results' value='confirmation' />
217
- <input type='hidden' id='result_id' name='result_id' value='' />
218
- <input type='hidden' id='delete_quiz_name' name='delete_quiz_name' value='' />
219
- <p class='submit'><input type='submit' class='button-primary' value='<?php _e('Delete Results','quiz-master-next'); ?>' /></p>
220
- </form>
221
- </div>
222
- </div>
223
  </div>
224
  <?php
225
  }
33
  }
34
  }
35
 
36
+ if (isset($_POST["bulk_delete"]) && $_POST["bulk_delete"] == "confirmation")
37
+ {
38
+ $results = $_POST["delete_results"];
39
+ if (is_array($results))
40
+ {
41
+ foreach($results as $result)
42
+ {
43
+ $wpdb->update(
44
+ $wpdb->prefix."mlw_results",
45
+ array(
46
+ 'deleted' => 1,
47
+ ),
48
+ array( 'result_id' => $result ),
49
+ array(
50
+ '%d'
51
+ ),
52
+ array( '%d' )
53
+ );
54
+ }
55
+ //Insert Action Into Audit Trail
56
+ global $current_user;
57
+ get_currentuserinfo();
58
+ $table_name = $wpdb->prefix . "mlw_qm_audit_trail";
59
+ $insert = "INSERT INTO " . $table_name .
60
+ "(trail_id, action_user, action, time) " .
61
+ "VALUES (NULL , '" . $current_user->display_name . "' , 'Results Has Been Bulk Deleted' , '" . date("h:i:s A m/d/Y") . "')";
62
+ $results = $wpdb->query( $insert );
63
+ }
64
+ }
65
+
66
  global $wpdb;
67
  $mlw_qmn_table_limit = 30;
68
  $mlw_qmn_results_count = $wpdb->get_var( "SELECT COUNT(result_id) FROM " . $wpdb->prefix . "mlw_results WHERE deleted='0'" );
144
  }
145
  </style>
146
  <div class="wrap">
147
+ <div class='mlw_quiz_options'>
148
+ <h2><?php _e('Quiz Results','quiz-master-next'); ?></h2>
149
+ <?php
150
+ $mlwQuizMasterNext->alertManager->showAlerts();
151
+ ?>
152
+ <div class="tablenav top">
153
+ <div class="alignleft actions bulkactions">
154
+ <a href="javascript: document.bulk_delete_form.submit();" class="button action">Bulk Delete</a>
155
+ </div>
156
+ <div class="tablenav-pages">
157
+ <span class="displaying-num"><?php echo sprintf(_n('One result', '%s results', $mlw_qmn_results_count, 'quiz-master-next'), number_format_i18n($mlw_qmn_results_count)); ?></span>
158
+ <span class="pagination-links">
159
+ <?php
160
+ $mlw_qmn_previous_page = 0;
161
+ $mlw_current_page = $mlw_qmn_result_page+1;
162
+ $mlw_total_pages = ceil($mlw_qmn_results_count/$mlw_qmn_table_limit);
163
+ if( $mlw_qmn_result_page > 0 )
164
+ {
165
+ $mlw_qmn_previous_page = $mlw_qmn_result_page - 2;
166
+ echo "<a class=\"prev-page\" title=\"Go to the previous page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_previous_page\"><</a>";
167
+ echo "<span class=\"paging-input\">$mlw_current_page of $mlw_total_pages</span>";
168
+ if( $mlw_qmn_result_left > $mlw_qmn_table_limit )
169
+ {
170
+ echo "<a class=\"next-page\" title=\"Go to the next page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_result_page\">></a>";
171
+ }
172
+ else
173
+ {
174
+ echo "<a class=\"next-page disabled\" title=\"Go to the next page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_result_page\">></a>";
175
+ }
176
+ }
177
+ else if( $mlw_qmn_result_page == 0 )
178
+ {
179
+ if( $mlw_qmn_result_left > $mlw_qmn_table_limit )
180
+ {
181
+ echo "<a class=\"prev-page disabled\" title=\"Go to the previous page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_previous_page\"><</a>";
182
+ echo "<span class=\"paging-input\">$mlw_current_page of $mlw_total_pages</span>";
183
+ echo "<a class=\"next-page\" title=\"Go to the next page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_result_page\">></a>";
184
+ }
185
+ }
186
+ else if( $mlw_qmn_result_left < $mlw_qmn_table_limit )
187
+ {
188
+ $mlw_qmn_previous_page = $mlw_qmn_result_page - 2;
189
+ echo "<a class=\"prev-page\" title=\"Go to the previous page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_previous_page\"><</a>";
190
+ echo "<span class=\"paging-input\">$mlw_current_page of $mlw_total_pages</span>";
191
+ echo "<a class=\"next-page disabled\" title=\"Go to the next page\" href=\"?page=mlw_quiz_results&&mlw_result_page=$mlw_qmn_result_page\">></a>";
192
+ }
193
+ ?>
194
+ </span>
195
+ <br class="clear">
196
+ </div>
197
+ </div>
198
+ <form action="" method="post" name="bulk_delete_form">
199
+ <input type="hidden" name="bulk_delete" value="confirmation" />
200
+ <table class=widefat>
201
+ <thead>
202
+ <tr>
203
+ <th></th>
204
+ <th><?php _e('Actions','quiz-master-next'); ?></th>
205
+ <th><?php _e('Quiz Name','quiz-master-next'); ?></th>
206
+ <th><?php _e('Score','quiz-master-next'); ?></th>
207
+ <th><?php _e('Time To Complete','quiz-master-next'); ?></th>
208
+ <th><?php _e('Name','quiz-master-next'); ?></th>
209
+ <th><?php _e('Business','quiz-master-next'); ?></th>
210
+ <th><?php _e('Email','quiz-master-next'); ?></th>
211
+ <th><?php _e('Phone','quiz-master-next'); ?></th>
212
+ <th><?php _e('Time Taken','quiz-master-next'); ?></th>
213
+ </tr>
214
+ </thead>
215
+ <?php
216
+ $quotes_list = "";
217
+ $display = "";
218
+ $alternate = "";
219
+ foreach($mlw_quiz_data as $mlw_quiz_info) {
220
+ if($alternate) $alternate = "";
221
+ else $alternate = " class=\"alternate\"";
222
+ $mlw_complete_time = '';
223
+ $mlw_qmn_results_array = @unserialize($mlw_quiz_info->quiz_results);
224
+ if (is_array($mlw_qmn_results_array))
225
+ {
226
+ $mlw_complete_hours = floor($mlw_qmn_results_array[0] / 3600);
227
+ if ($mlw_complete_hours > 0)
228
+ {
229
+ $mlw_complete_time .= "$mlw_complete_hours hours ";
230
+ }
231
+ $mlw_complete_minutes = floor(($mlw_qmn_results_array[0] % 3600) / 60);
232
+ if ($mlw_complete_minutes > 0)
233
+ {
234
+ $mlw_complete_time .= "$mlw_complete_minutes minutes ";
235
+ }
236
+ $mlw_complete_seconds = $mlw_qmn_results_array[0] % 60;
237
+ $mlw_complete_time .= "$mlw_complete_seconds seconds";
238
+ }
239
 
240
+ $quotes_list .= "<tr{$alternate}>";
241
+ $quotes_list .= "<td><input type='checkbox' name='delete_results[]' value='".$mlw_quiz_info->result_id. "' /></td>";
242
+ $quotes_list .= "<td><span style='color:green;font-size:16px;'><a href='admin.php?page=mlw_quiz_result_details&&result_id=".$mlw_quiz_info->result_id."'>View</a>|<a onclick=\"deleteResults('".$mlw_quiz_info->result_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='#'>Delete</a></span></td>";
243
+ $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->quiz_name . "</span></td>";
244
+ if ($mlw_quiz_info->quiz_system == 0)
245
+ {
246
+ $quotes_list .= "<td class='post-title column-title'><span style='font-size:16px;'>" . $mlw_quiz_info->correct ." out of ".$mlw_quiz_info->total." or ".$mlw_quiz_info->correct_score."%</span></td>";
247
+ }
248
+ if ($mlw_quiz_info->quiz_system == 1)
249
+ {
250
+ $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->point_score . " Points</span></td>";
251
+ }
252
+ if ($mlw_quiz_info->quiz_system == 2)
253
+ {
254
+ $quotes_list .= "<td><span style='font-size:16px;'>".__('Not Graded','quiz-master-next')."</span></td>";
255
+ }
256
+ $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_complete_time ."</span></td>";
257
+ $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->name ."</span></td>";
258
+ $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->business ."</span></td>";
259
+ $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->email ."</span></td>";
260
+ $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->phone ."</span></td>";
261
+ $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->time_taken ."</span></td>";
262
+ $quotes_list .= "</tr>";
263
+ }
264
+ $display .= "<tbody id=\"the-list\">{$quotes_list}</tbody>";
265
+ echo $display;
266
+ ?>
267
+ </table>
268
+ </form>
269
+ <?php echo mlw_qmn_show_adverts(); ?>
270
 
271
+ <div id="delete_dialog" title="Delete Results?" style="display:none;">
272
+ <h3><b><?php _e('Are you sure you want to delete these results?','quiz-master-next'); ?></b></h3>
273
+ <form action='' method='post'>
274
+ <input type='hidden' name='delete_results' value='confirmation' />
275
+ <input type='hidden' id='result_id' name='result_id' value='' />
276
+ <input type='hidden' id='delete_quiz_name' name='delete_quiz_name' value='' />
277
+ <p class='submit'><input type='submit' class='button-primary' value='<?php _e('Delete Results','quiz-master-next'); ?>' /></p>
278
+ </form>
279
+ </div>
280
+ </div>
281
  </div>
282
  <?php
283
  }
includes/qmn_results_details.php CHANGED
@@ -8,301 +8,203 @@ Copyright 2013, My Local Webstop (email : fpcorso@mylocalwebstop.com)
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
 
16
- //Check if user wants to create certificate
17
- if (isset($_POST["create_certificate"]) && $_POST["create_certificate"] == "confirmation")
18
- {
19
- $mlw_certificate_id = intval($_GET["result_id"]);
20
- $mlw_quiz_results = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."mlw_results WHERE result_id=%d", $mlw_certificate_id ) );
 
21
 
22
- $mlw_certificate_results = $wpdb->get_var( $wpdb->prepare( "SELECT certificate_template FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_quiz_results->quiz_id ) );
 
 
 
 
 
 
 
23
 
24
- //Prepare Certificate
 
 
 
 
25
  $mlw_certificate_options = unserialize($mlw_certificate_results);
26
- if (!is_array($mlw_certificate_options)) {
27
- // something went wrong, initialize to empty array
28
- $mlw_certificate_options = array('Enter title here', 'Enter text here', '', '');
29
- }
30
- $mlw_message_certificate = $mlw_certificate_options[1];
31
- $mlw_message_certificate = str_replace( "%POINT_SCORE%" , $mlw_quiz_results->point_score, $mlw_message_certificate);
32
- $mlw_message_certificate = str_replace( "%AVERAGE_POINT%" , $mlw_quiz_results->point_score/$mlw_quiz_results->total, $mlw_message_certificate);
33
- $mlw_message_certificate = str_replace( "%AMOUNT_CORRECT%" , $mlw_quiz_results->correct, $mlw_message_certificate);
34
- $mlw_message_certificate = str_replace( "%TOTAL_QUESTIONS%" , $mlw_quiz_results->total, $mlw_message_certificate);
35
- $mlw_message_certificate = str_replace( "%CORRECT_SCORE%" , $mlw_quiz_results->correct_score, $mlw_message_certificate);
36
- $mlw_message_certificate = str_replace( "%QUIZ_NAME%" , $mlw_quiz_results->quiz_name, $mlw_message_certificate);
37
- $mlw_message_certificate = str_replace( "%USER_NAME%" , $mlw_quiz_results->name, $mlw_message_certificate);
38
- $mlw_message_certificate = str_replace( "%USER_BUSINESS%" , $mlw_quiz_results->business, $mlw_message_certificate);
39
- $mlw_message_certificate = str_replace( "%USER_PHONE%" , $mlw_quiz_results->email, $mlw_message_certificate);
40
- $mlw_message_certificate = str_replace( "%USER_EMAIL%" , $mlw_quiz_results->phone, $mlw_message_certificate);
41
- $mlw_message_certificate = str_replace( "\n" , "<br>", $mlw_message_certificate);
42
- $plugindirpath=plugin_dir_path( __FILE__ );
43
- $mlw_qmn_certificate_file=<<<EOC
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  <?php
45
  include("$plugindirpath/fpdf/WriteHTML.php");
46
  \$pdf=new PDF_HTML();
47
  \$pdf->AddPage('L');
48
  EOC;
49
- $mlw_qmn_certificate_file.=$mlw_certificate_options[3] != '' ? '$pdf->Image("'.$mlw_certificate_options[3].'",0,0,$pdf->w, $pdf->h);' : '';
50
- $mlw_qmn_certificate_file.=<<<EOC
51
  \$pdf->Ln(20);
52
  \$pdf->SetFont('Arial','B',24);
53
  \$pdf->MultiCell(280,20,'$mlw_certificate_options[0]',0,'C');
54
  \$pdf->Ln(15);
55
  \$pdf->SetFont('Arial','',16);
56
- \$pdf->WriteHTML("<p align='center'>$mlw_message_certificate</p>");
57
  EOC;
58
- $mlw_qmn_certificate_file.=$mlw_certificate_options[2] != '' ? '$pdf->Image("'.$mlw_certificate_options[2].'",110,130);' : '';
59
- $mlw_qmn_certificate_file.=<<<EOC
60
  \$pdf->Output('mlw_qmn_certificate.pdf','D');
61
  unlink(__FILE__);
62
  EOC;
63
- $mlw_qmn_certificate_filename = "../".str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis")."admin.php";
64
- file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file);
65
- $mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis")."admin.php";
66
- }
67
-
68
-
69
- //Load Results
70
- $mlw_results_data = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "mlw_results WHERE result_id=".intval($mlw_result_id));
71
-
72
- ?>
73
- <!-- css -->
74
- <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
75
- <!-- jquery scripts -->
76
- <?php
77
- wp_enqueue_script( 'jquery' );
78
- wp_enqueue_script( 'jquery-ui-core' );
79
- wp_enqueue_script( 'jquery-ui-dialog' );
80
- wp_enqueue_script( 'jquery-ui-button' );
81
- wp_enqueue_script( 'jquery-ui-tooltip' );
82
- wp_enqueue_script( 'jquery-ui-tabs' );
83
- wp_enqueue_script( 'jquery-effects-blind' );
84
- wp_enqueue_script( 'jquery-effects-explode' );
85
- ?>
86
- <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
87
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>-->
88
- <script type="text/javascript">
89
- var $j = jQuery.noConflict();
90
- // increase the default animation speed to exaggerate the effect
91
- $j.fx.speeds._default = 1000;
92
- $j(function() {
93
- $j('#dialog').dialog({
94
- autoOpen: false,
95
- show: 'blind',
96
- hide: 'explode',
97
- buttons: {
98
- Ok: function() {
99
- $j(this).dialog('close');
100
- }
101
- }
102
- });
103
-
104
- $j('#opener').click(function() {
105
- $j('#dialog').dialog('open');
106
- return false;
107
- });
108
- $j("button").button();
109
- $j( "#tabs" ).tabs();
110
- });
111
- </script>
112
- <style>
113
- label {
114
- display: inline-block;
115
- width: 5em;
116
- }
117
- </style>
118
- <style type="text/css">
119
- div.mlw_quiz_options input[type='text'] {
120
- border-color:#000000;
121
- color:#3300CC;
122
- cursor:hand;
123
- }
124
- </style>
125
- <div class="wrap">
126
- <div class='mlw_quiz_options'>
127
- <h2><?php _e('Quiz Results', 'quiz-master-next'); ?></h2>
128
- <div id="tabs">
129
- <ul>
130
- <li><a href="#tabs-1"><?php _e('Quiz Results', 'quiz-master-next'); ?></a></li>
131
- <li><a href="#tabs-2"><?php _e('Quiz Tools', 'quiz-master-next'); ?></a></li>
132
- </ul>
133
- <div id="tabs-1">
134
- <h2><?php _e('Quiz Results', 'quiz-master-next'); ?>: <?php echo $mlw_results_data->quiz_name; ?></h2>
135
- <table>
136
- <tr>
137
- <td><?php _e('Time Taken', 'quiz-master-next'); ?>: </td>
138
- <td><?php echo $mlw_results_data->time_taken; ?></td>
139
- </tr>
140
- <tr>
141
- <td><?php _e('Name Provided', 'quiz-master-next'); ?>: </td>
142
- <td><?php echo $mlw_results_data->name; ?></td>
143
- </tr>
144
- <tr>
145
- <td><?php _e('Business Provided', 'quiz-master-next'); ?>: </td>
146
- <td><?php echo $mlw_results_data->business; ?></td>
147
- </tr>
148
- <tr>
149
- <td><?php _e('Email Provided', 'quiz-master-next'); ?>: </td>
150
- <td><?php echo $mlw_results_data->email; ?></td>
151
- </tr>
152
- <tr>
153
- <td><?php _e('Phone Provided', 'quiz-master-next'); ?>: </td>
154
- <td><?php echo $mlw_results_data->phone; ?></td>
155
- </tr>
156
- <tr>
157
- <td>&nbsp;</td>
158
- </tr>
159
- <tr>
160
- <?php
161
- if ($mlw_results_data->quiz_system == 0)
162
- {
163
- ?>
164
- <td><?php _e('Score Received', 'quiz-master-next'); ?>:</td>
165
- <td><?php echo $mlw_results_data->correct."/".$mlw_results_data->total." or ".$mlw_results_data->correct_score."%"; ?></td>
166
- <?php
167
- }
168
- else if ($mlw_results_data->quiz_system == 1)
169
- {
170
- ?>
171
- <td><?php _e('Score Received', 'quiz-master-next'); ?>:</td>
172
- <td><?php echo $mlw_results_data->point_score." Points"; ?></td>
173
- <?php
174
- }
175
- ?>
176
- </tr>
177
- </table>
178
- <br />
179
- <br />
180
- <h3><?php _e('Answers Provided', 'quiz-master-next'); ?></h3>
181
- <?php
182
- $mlw_qmn_results_array = @unserialize($mlw_results_data->quiz_results);
183
- if (!is_array($mlw_qmn_results_array)) {
184
- echo htmlspecialchars_decode($mlw_results_data->quiz_results, ENT_QUOTES);
185
- }
186
- else
187
- {
188
- $mlw_complete_time = '';
189
- $mlw_complete_hours = floor($mlw_qmn_results_array[0] / 3600);
190
- if ($mlw_complete_hours > 0)
191
- {
192
- $mlw_complete_time .= "$mlw_complete_hours ".__('hours','quiz-master-next')." ";
193
- }
194
- $mlw_complete_minutes = floor(($mlw_qmn_results_array[0] % 3600) / 60);
195
- if ($mlw_complete_minutes > 0)
196
- {
197
- $mlw_complete_time .= "$mlw_complete_minutes ".__('minutes','quiz-master-next')." ";
198
- }
199
- $mlw_complete_seconds = $mlw_qmn_results_array[0] % 60;
200
- $mlw_complete_time .= "$mlw_complete_seconds ".__('seconds','quiz-master-next');
201
- ?>
202
- <p><?php
203
- /* translators: The %s will be replaces with the amount of time the user took on quiz. For example: 5 minutes 34 seconds */
204
- echo sprintf(__('The user took %s to complete this quiz.','quiz-master-next'), $mlw_complete_time);
205
- ?></p><br />
206
- <br />
207
- <?php _e('The comments entered into the comment box (if enabled)', 'quiz-master-next'); ?>:<br />
208
- <?php echo $mlw_qmn_results_array[2]; ?><br />
209
- <br />
210
- <p><?php _e('The answers were as follows', 'quiz-master-next'); ?>:</p>
211
- <br />
212
- <?php
213
- $mlw_qmn_answer_array = $mlw_qmn_results_array[1];
214
- foreach( $mlw_qmn_answer_array as $mlw_each )
215
- {
216
- echo htmlspecialchars_decode($mlw_each[0], ENT_QUOTES)."<br />";
217
- echo __('Answer Provided: ','quiz-master-next').htmlspecialchars_decode($mlw_each[1], ENT_QUOTES)."<br />";
218
- echo __("Correct Answer: ",'quiz-master-next').htmlspecialchars_decode($mlw_each[2], ENT_QUOTES)."<br />";
219
- echo __("Comments Entered:" ,'quiz-master-next')."<br />".htmlspecialchars_decode($mlw_each[3], ENT_QUOTES)."<br />";
220
- echo "<br /><br />";
221
- }
222
- ?>
223
- <?php
224
- }
225
- ?>
226
- </div>
227
- <div id="tabs-2">
228
- <form action="" method="post" name="create_certificate_form">
229
- <input type="hidden" name="create_certificate" value="confirmation" />
230
- <input type="submit" value="<?php _e('Create Certificate','quiz-master-next'); ?>" />
231
- </form>
232
- <?php
233
- if (isset($_POST["create_certificate"]) && $_POST["create_certificate"] == "confirmation")
234
- {
235
- echo "<a href='".$mlw_qmn_certificate_filename."' style='color: blue;'>".__('Download Certificate Here','quiz-master-next')."</a><br />";
236
- }
237
- ?>
238
- </div>
239
- </div>
240
- <?php echo mlw_qmn_show_adverts(); ?>
241
- </div>
242
- </div>
243
-
244
- <?php
245
  }
246
- else
 
 
 
 
 
 
247
  {
248
- ?>
249
- <!-- css -->
250
- <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
251
- <!-- jquery scripts -->
252
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
253
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
254
- <script type="text/javascript">
255
- var $j = jQuery.noConflict();
256
- // increase the default animation speed to exaggerate the effect
257
- $j.fx.speeds._default = 1000;
258
- $j(function() {
259
- $j('#dialog').dialog({
260
- autoOpen: false,
261
- show: 'blind',
262
- hide: 'explode',
263
- buttons: {
264
- Ok: function() {
265
- $j(this).dialog('close');
266
- }
267
- }
268
- });
269
-
270
- $j('#opener').click(function() {
271
- $j('#dialog').dialog('open');
272
- return false;
273
- } );
274
- });
275
- $j(function() {
276
- $j( document ).tooltip();
277
- });
278
- $j(function() {
279
- $j("button").button();
280
-
281
- });
282
- </script>
283
- <style>
284
- label {
285
- display: inline-block;
286
- width: 5em;
287
- }
288
- </style>
289
- <style type="text/css">
290
- div.mlw_quiz_options input[type='text'] {
291
- border-color:#000000;
292
- color:#3300CC;
293
- cursor:hand;
294
- }
295
- </style>
296
- <div class="wrap">
297
- <div class='mlw_quiz_options'>
298
- <h2><?php _e('Quiz Results','quiz-master-next'); ?></h2>
299
- <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
300
- <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
301
- <strong><?php _e('Error!','quiz-master-next'); ?></strong> <?php _e('Please go to the Quiz Results page and click on the View link from the result you wish to see.','quiz-master-next'); ?></p>
302
- </div>
303
- </div>
304
- </div>
305
- <?php
306
  }
307
  }
 
 
 
 
 
 
 
308
  ?>
8
 
9
  function mlw_generate_result_details()
10
  {
11
+ global $mlwQuizMasterNext;
12
+ $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'results';
13
+ $tab_array = $mlwQuizMasterNext->pluginHelper->get_results_tabs();
14
+ ?>
15
+ <div class="wrap">
16
+ <h2><?php _e('Quiz Results', 'quiz-master-next'); ?></h2>
17
+ <h2 class="nav-tab-wrapper">
18
+ <?php
19
+ foreach($tab_array as $tab)
20
+ {
21
+ $active_class = '';
22
+ if ($active_tab == $tab['slug'])
23
+ {
24
+ $active_class = 'nav-tab-active';
25
+ }
26
+ echo "<a href=\"?page=mlw_quiz_result_details&&result_id=".intval($_GET["result_id"])."&&tab=".$tab['slug']."\" class=\"nav-tab $active_class\">".$tab['title']."</a>";
27
+ }
28
+ ?>
29
+ </h2>
30
+ <div>
31
+ <?php
32
+ foreach($tab_array as $tab)
33
+ {
34
+ if ($active_tab == $tab['slug'])
35
+ {
36
+ call_user_func($tab['function']);
37
+ }
38
+ }
39
+ ?>
40
+ </div>
41
+ </div>
42
+ <?php
43
+ }
44
+
45
+ function qmn_generate_results_details_tab()
46
+ {
47
+ echo "<br><br>";
48
+ $mlw_result_id = intval($_GET["result_id"]);
49
+ global $wpdb;
50
+ $mlw_results_data = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "mlw_results WHERE result_id=".intval($mlw_result_id));
51
+
52
+ $previous_results = $wpdb->get_var("SELECT result_id FROM " . $wpdb->prefix . "mlw_results WHERE result_id = (SELECT MAX(result_id) FROM " . $wpdb->prefix . "mlw_results WHERE deleted=0 AND result_id < ".$mlw_result_id.")");
53
+ $next_results = $wpdb->get_var("SELECT result_id FROM " . $wpdb->prefix . "mlw_results WHERE result_id = (SELECT MIN(result_id) FROM " . $wpdb->prefix . "mlw_results WHERE deleted=0 AND result_id > ".$mlw_result_id.")");
54
+ if (!is_null($previous_results) && $previous_results)
55
  {
56
+ echo "<a class='button' href=\"?page=mlw_quiz_result_details&&result_id=".intval($previous_results)."\" >View Previous Results</a> ";
57
+ }
58
+ if (!is_null($next_results) && $next_results)
59
+ {
60
+ echo " <a class='button' href=\"?page=mlw_quiz_result_details&&result_id=".intval($next_results)."\" >View Next Results</a>";
61
+ }
62
+ $settings = (array) get_option( 'qmn-settings' );
63
+ if (isset($settings['results_details_template']))
64
+ {
65
+ $template = htmlspecialchars_decode($settings['results_details_template'], ENT_QUOTES);
66
+ }
67
+ else
68
+ {
69
+ $template = "<h2>Quiz Results for %QUIZ_NAME%</h2>
70
+ <p>Name Provided: %USER_NAME%</p>
71
+ <p>Business Provided: %USER_BUSINESS%</p>
72
+ <p>Phone Provided: %USER_PHONE%</p>
73
+ <p>Email Provided: %USER_EMAIL%</p>
74
+ <p>Score Received: %AMOUNT_CORRECT%/%TOTAL_QUESTIONS% or %CORRECT_SCORE%% or %POINT_SCORE% points</p>
75
+ <h2>Answers Provided:</h2>
76
+ <p>The user took %TIMER% to complete quiz.</p>
77
+ <p>Comments entered were: %COMMENT_SECTION%</p>
78
+ <p>The answers were as follows:</p>
79
+ %QUESTIONS_ANSWERS%";
80
+ }
81
+ if (is_serialized($mlw_results_data->quiz_results) && is_array(@unserialize($mlw_results_data->quiz_results)))
82
+ {
83
+ $results = unserialize($mlw_results_data->quiz_results);
84
+ }
85
+ else
86
+ {
87
+ $template = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_results_data->quiz_results, $template);
88
+ $template = str_replace( "%TIMER%" , '', $template);
89
+ $template = str_replace( "%COMMENT_SECTION%" , '', $template);
90
+ }
91
+ $qmn_array_for_variables = array(
92
+ 'quiz_id' => $mlw_results_data->quiz_id,
93
+ 'quiz_name' => $mlw_results_data->quiz_name,
94
+ 'quiz_system' => $mlw_results_data->quiz_system,
95
+ 'user_name' => $mlw_results_data->name,
96
+ 'user_business' => $mlw_results_data->business,
97
+ 'user_email' => $mlw_results_data->email,
98
+ 'user_phone' => $mlw_results_data->phone,
99
+ 'user_id' => $mlw_results_data->user,
100
+ 'timer' => $results[0],
101
+ 'total_points' => $mlw_results_data->point_score,
102
+ 'total_score' => $mlw_results_data->correct_score,
103
+ 'total_correct' => $mlw_results_data->correct,
104
+ 'total_questions' => $mlw_results_data->total,
105
+ 'comments' => $results[2],
106
+ 'question_answers_array' => $results[1]
107
+ );
108
+ $template = apply_filters( 'mlw_qmn_template_variable_results_page', $template, $qmn_array_for_variables);
109
+ $template = str_replace( "\n" , "<br>", $template);
110
+ echo $template;
111
+ }
112
 
113
+ function qmn_results_details_tab()
114
+ {
115
+ global $mlwQuizMasterNext;
116
+ $mlwQuizMasterNext->pluginHelper->register_results_settings_tab(__("Results", 'quiz-master-next'), "qmn_generate_results_details_tab");
117
+ }
118
+ add_action("plugins_loaded", 'qmn_results_details_tab');
119
 
120
+ function qmn_generate_results_certificate_tab()
121
+ {
122
+ //Check if user wants to create certificate
123
+ if (isset($_POST["create_certificate"]) && $_POST["create_certificate"] == "confirmation")
124
+ {
125
+ global $wpdb;
126
+ $mlw_certificate_id = intval($_GET["result_id"]);
127
+ $mlw_quiz_results = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."mlw_results WHERE result_id=%d", $mlw_certificate_id ) );
128
 
129
+ $mlw_certificate_results = $wpdb->get_var( $wpdb->prepare( "SELECT certificate_template FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_quiz_results->quiz_id ) );
130
+
131
+ //Prepare Certificate
132
+ if (is_serialized($mlw_certificate_results) && is_array(@unserialize($mlw_certificate_results)))
133
+ {
134
  $mlw_certificate_options = unserialize($mlw_certificate_results);
135
+ }
136
+ else
137
+ {
138
+ $mlw_certificate_options = array('Enter title here', 'Enter text here', '', '');
139
+ }
140
+ if (is_serialized($mlw_quiz_results->quiz_results) && is_array(@unserialize($mlw_quiz_results->quiz_results)))
141
+ {
142
+ $results = unserialize($mlw_quiz_results->quiz_results);
143
+ }
144
+ else
145
+ {
146
+ $results = array( 0, '', '');
147
+ }
148
+ $qmn_array_for_variables = array(
149
+ 'quiz_id' => $mlw_quiz_results->quiz_id,
150
+ 'quiz_name' => $mlw_quiz_results->quiz_name,
151
+ 'quiz_system' => $mlw_quiz_results->quiz_system,
152
+ 'user_name' => $mlw_quiz_results->name,
153
+ 'user_business' => $mlw_quiz_results->business,
154
+ 'user_email' => $mlw_quiz_results->email,
155
+ 'user_phone' => $mlw_quiz_results->phone,
156
+ 'user_id' => $mlw_quiz_results->user,
157
+ 'timer' => $results[0],
158
+ 'total_points' => $mlw_quiz_results->point_score,
159
+ 'total_score' => $mlw_quiz_results->correct_score,
160
+ 'total_correct' => $mlw_quiz_results->correct,
161
+ 'total_questions' => $mlw_quiz_results->total,
162
+ 'comments' => $results[2],
163
+ 'question_answers_array' => $results[1]
164
+ );
165
+ $template = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_certificate_options[1], $qmn_array_for_variables);
166
+ $template = str_replace( "\n" , "<br>", $template);
167
+ $plugindirpath=plugin_dir_path( __FILE__ );
168
+ $mlw_qmn_certificate_file=<<<EOC
169
  <?php
170
  include("$plugindirpath/fpdf/WriteHTML.php");
171
  \$pdf=new PDF_HTML();
172
  \$pdf->AddPage('L');
173
  EOC;
174
+ $mlw_qmn_certificate_file.=$mlw_certificate_options[3] != '' ? '$pdf->Image("'.$mlw_certificate_options[3].'",0,0,$pdf->w, $pdf->h);' : '';
175
+ $mlw_qmn_certificate_file.=<<<EOC
176
  \$pdf->Ln(20);
177
  \$pdf->SetFont('Arial','B',24);
178
  \$pdf->MultiCell(280,20,'$mlw_certificate_options[0]',0,'C');
179
  \$pdf->Ln(15);
180
  \$pdf->SetFont('Arial','',16);
181
+ \$pdf->WriteHTML("<p align='center'>$template</p>");
182
  EOC;
183
+ $mlw_qmn_certificate_file.=$mlw_certificate_options[2] != '' ? '$pdf->Image("'.$mlw_certificate_options[2].'",110,130);' : '';
184
+ $mlw_qmn_certificate_file.=<<<EOC
185
  \$pdf->Output('mlw_qmn_certificate.pdf','D');
186
  unlink(__FILE__);
187
  EOC;
188
+ $mlw_qmn_certificate_filename = "../".str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis")."admin.php";
189
+ file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file);
190
+ $mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis")."admin.php";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  }
192
+ ?>
193
+ <form action="" method="post" name="create_certificate_form">
194
+ <input type="hidden" name="create_certificate" value="confirmation" />
195
+ <input type="submit" value="<?php _e('Create Certificate','quiz-master-next'); ?>" class="button"/>
196
+ </form>
197
+ <?php
198
+ if (isset($_POST["create_certificate"]) && $_POST["create_certificate"] == "confirmation")
199
  {
200
+ echo "<a href='".$mlw_qmn_certificate_filename."' style='color: blue;'>".__('Download Certificate Here','quiz-master-next')."</a><br />";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  }
202
  }
203
+
204
+ function qmn_results_certificate_tab()
205
+ {
206
+ global $mlwQuizMasterNext;
207
+ $mlwQuizMasterNext->pluginHelper->register_results_settings_tab(__("Certificate", 'quiz-master-next'), "qmn_generate_results_certificate_tab");
208
+ }
209
+ add_action("plugins_loaded", 'qmn_results_certificate_tab');
210
  ?>
includes/qmn_template_variables.php CHANGED
@@ -54,7 +54,14 @@ function mlw_qmn_variable_point_score($content, $mlw_quiz_array)
54
  }
55
  function mlw_qmn_variable_average_point($content, $mlw_quiz_array)
56
  {
57
- $mlw_average_points = $mlw_quiz_array["total_points"]/$mlw_quiz_array["total_questions"];
 
 
 
 
 
 
 
58
  $content = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $content);
59
  return $content;
60
  }
@@ -111,7 +118,7 @@ function mlw_qmn_variable_question_answers($content, $mlw_quiz_array)
111
  global $wpdb;
112
  $display = '';
113
  $qmn_question_answer_template = $wpdb->get_var( $wpdb->prepare( "SELECT question_answer_template FROM " . $wpdb->prefix . "mlw_quizzes WHERE quiz_id=%d", $mlw_quiz_array['quiz_id'] ) );
114
- $qmn_questions_sql = $wpdb->get_results( $wpdb->prepare( "SELECT question_id, question_answer_info FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted=0", $mlw_quiz_array['quiz_id'] ) );
115
  $qmn_questions = array();
116
  foreach($qmn_questions_sql as $question)
117
  {
@@ -121,7 +128,7 @@ function mlw_qmn_variable_question_answers($content, $mlw_quiz_array)
121
  {
122
  $mlw_question_answer_display = htmlspecialchars_decode($qmn_question_answer_template, ENT_QUOTES);
123
  $mlw_question_answer_display = str_replace( "%QUESTION%" , htmlspecialchars_decode($answer[0], ENT_QUOTES), $mlw_question_answer_display);
124
- $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , $answer[1], $mlw_question_answer_display);
125
  $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER%" , $answer[2], $mlw_question_answer_display);
126
  $mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $answer[3], $mlw_question_answer_display);
127
  $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($qmn_questions[$answer['id']], ENT_QUOTES), $mlw_question_answer_display);
54
  }
55
  function mlw_qmn_variable_average_point($content, $mlw_quiz_array)
56
  {
57
+ if ($mlw_quiz_array["total_questions"] != 0)
58
+ {
59
+ $mlw_average_points = $mlw_quiz_array["total_points"]/$mlw_quiz_array["total_questions"];
60
+ }
61
+ else
62
+ {
63
+ $mlw_average_points = 0;
64
+ }
65
  $content = str_replace( "%AVERAGE_POINT%" , $mlw_average_points, $content);
66
  return $content;
67
  }
118
  global $wpdb;
119
  $display = '';
120
  $qmn_question_answer_template = $wpdb->get_var( $wpdb->prepare( "SELECT question_answer_template FROM " . $wpdb->prefix . "mlw_quizzes WHERE quiz_id=%d", $mlw_quiz_array['quiz_id'] ) );
121
+ $qmn_questions_sql = $wpdb->get_results( $wpdb->prepare( "SELECT question_id, question_answer_info FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d", $mlw_quiz_array['quiz_id'] ) );
122
  $qmn_questions = array();
123
  foreach($qmn_questions_sql as $question)
124
  {
128
  {
129
  $mlw_question_answer_display = htmlspecialchars_decode($qmn_question_answer_template, ENT_QUOTES);
130
  $mlw_question_answer_display = str_replace( "%QUESTION%" , htmlspecialchars_decode($answer[0], ENT_QUOTES), $mlw_question_answer_display);
131
+ $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , htmlspecialchars_decode($answer[1], ENT_QUOTES), $mlw_question_answer_display);
132
  $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER%" , $answer[2], $mlw_question_answer_display);
133
  $mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $answer[3], $mlw_question_answer_display);
134
  $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($qmn_questions[$answer['id']], ENT_QUOTES), $mlw_question_answer_display);
includes/qmn_tools.php CHANGED
@@ -6,8 +6,10 @@ This page creates the main dashboard for the Quiz Master Next plugin
6
  Copyright 2013, My Local Webstop (email : fpcorso@mylocalwebstop.com)
7
  */
8
 
9
- function mlw_generate_quiz_tools(){
10
- add_meta_box("wpss_mrts", 'Audit Trail', "mlw_tools_box", "quiz_wpss");
 
 
11
  ?>
12
  <!-- css -->
13
  <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
@@ -51,7 +53,7 @@ function mlw_generate_quiz_tools(){
51
  <h2><?php _e('Tools', 'quiz-master-next'); ?></h2>
52
 
53
  <div style="float:left; width:100%;" class="inner-sidebar1">
54
- <?php do_meta_boxes('quiz_wpss','advanced',''); ?>
55
  </div>
56
 
57
  <div style="clear:both"></div>
@@ -61,7 +63,65 @@ function mlw_generate_quiz_tools(){
61
  </div>
62
  <?php
63
  }
64
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  function mlw_tools_box()
66
  {
67
  global $wpdb;
6
  Copyright 2013, My Local Webstop (email : fpcorso@mylocalwebstop.com)
7
  */
8
 
9
+ function mlw_generate_quiz_tools()
10
+ {
11
+ add_meta_box("qmn_restore_box", 'Restore Quiz', "qmn_restore_function", "quiz_wpss");
12
+ add_meta_box("qmn_audit_box", 'Audit Trail', "mlw_tools_box", "quiz_wpss");
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" />
53
  <h2><?php _e('Tools', 'quiz-master-next'); ?></h2>
54
 
55
  <div style="float:left; width:100%;" class="inner-sidebar1">
56
+ <?php do_meta_boxes('quiz_wpss','advanced',null); ?>
57
  </div>
58
 
59
  <div style="clear:both"></div>
63
  </div>
64
  <?php
65
  }
66
+ function qmn_restore_function()
67
+ {
68
+ global $wpdb;
69
+ if (isset($_POST["restore_quiz"]))
70
+ {
71
+ $restore = $wpdb->update(
72
+ $wpdb->prefix.'mlw_quizzes',
73
+ array(
74
+ 'deleted' => 0
75
+ ),
76
+ array(
77
+ 'quiz_id' => intval($_POST["restore_quiz"])
78
+ ),
79
+ array(
80
+ '%d'
81
+ ),
82
+ array(
83
+ '%d'
84
+ )
85
+ );
86
+ if (!$restore)
87
+ {
88
+ echo "<span style='color:red;'>".__("There has been an error! Please try again.", "quiz-master-next")."</span>";
89
+ }
90
+ else
91
+ {
92
+ $my_query = new WP_Query( array('post_type' => 'quiz', 'meta_key' => 'quiz_id', 'meta_value' => intval($_POST["restore_quiz"])) );
93
+ if( $my_query->have_posts() )
94
+ {
95
+ while( $my_query->have_posts() )
96
+ {
97
+ $my_query->the_post();
98
+ $my_post = array(
99
+ 'ID' => get_the_ID(),
100
+ 'post_status' => 'publish'
101
+ );
102
+ wp_update_post( $my_post );
103
+ }
104
+ }
105
+ wp_reset_postdata();
106
+ echo "<span style='color:red;'>".__("Quiz Has Been Restored!", "quiz-master-next")."</span>";
107
+ }
108
+ }
109
+ $quizzes = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."mlw_quizzes WHERE deleted=1");
110
+ ?>
111
+ <h3><?php _e("Choose a quiz in the drop down and then click the button to restore a deleted quiz.", "quiz-master-next"); ?></h3>
112
+ <form action='' method="post">
113
+ <select name="restore_quiz">
114
+ <?php
115
+ foreach($quizzes as $quiz)
116
+ {
117
+ echo "<option value='".$quiz->quiz_id."'>".$quiz->quiz_name."</option>";
118
+ }
119
+ ?>
120
+ </select>
121
+ <input type="submit" value="<?php _e('Restore Quiz', "quiz-master-next"); ?>" class="button" />
122
+ </form>
123
+ <?php
124
+ }
125
  function mlw_tools_box()
126
  {
127
  global $wpdb;
includes/qmn_update.php CHANGED
@@ -299,7 +299,6 @@ function mlw_quiz_update()
299
  $results = $wpdb->query( $update_sql );
300
  }
301
 
302
-
303
  global $wpdb;
304
  $table_name = $wpdb->prefix . "mlw_questions";
305
  //Update 0.5
299
  $results = $wpdb->query( $update_sql );
300
  }
301
 
 
302
  global $wpdb;
303
  $table_name = $wpdb->prefix . "mlw_questions";
304
  //Update 0.5
includes/qmn_usage_tracking.php ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Exit if accessed directly
3
+ if ( !defined( 'ABSPATH' ) ) exit;
4
+
5
+ /**
6
+ * Class To Send Tracking Information Back To My Website
7
+ *
8
+ * @since 4.1.0
9
+ */
10
+ class QMNTracking
11
+ {
12
+ /**
13
+ * Date To Send Home
14
+ *
15
+ * @var array
16
+ * @since 4.1.0
17
+ */
18
+ private $data;
19
+
20
+ /**
21
+ * Main Construct Function
22
+ *
23
+ * Call functions within class
24
+ *
25
+ * @since 4.1.0
26
+ * @uses QMNTracking::load_dependencies() Loads required filed
27
+ * @uses QMNTracking::add_hooks() Adds actions to hooks and filters
28
+ * @return void
29
+ */
30
+ function __construct()
31
+ {
32
+ $this->load_dependencies();
33
+ $this->add_hooks();
34
+ $this->track_check();
35
+ }
36
+
37
+ /**
38
+ * Load File Dependencies
39
+ *
40
+ * @since 4.1.0
41
+ * @return void
42
+ */
43
+ private function load_dependencies()
44
+ {
45
+
46
+ }
47
+
48
+ /**
49
+ * Add Hooks
50
+ *
51
+ * Adds functions to relavent hooks and filters
52
+ *
53
+ * @since 4.1.0
54
+ * @return void
55
+ */
56
+ private function add_hooks()
57
+ {
58
+ add_action( 'admin_notices', array( $this, 'admin_notice' ) );
59
+ add_action( 'admin_init', array($this, 'admin_notice_check'));
60
+ }
61
+
62
+ /**
63
+ * Determines If Ready To Send Data Home
64
+ *
65
+ * Determines if the plugin has been authorized to send the data home in the settings page. Then checks if it has been at least a week since the last send.
66
+ *
67
+ * @since 4.1.0
68
+ * @uses QMNTracking::load_data()
69
+ * @uses QMNTracking::send_data()
70
+ * @return void
71
+ */
72
+ private function track_check()
73
+ {
74
+ $settings = (array) get_option( 'qmn-settings' );
75
+ $tracking_allowed = '0';
76
+ if (isset($settings['tracking_allowed']))
77
+ {
78
+ $tracking_allowed = $settings['tracking_allowed'];
79
+ }
80
+ $last_time = get_option( 'qmn_tracker_last_time' );
81
+ if ($tracking_allowed == '1' && (($last_time && $last_time < strtotime( '-1 week' )) || !$last_time))
82
+ {
83
+ $this->load_data();
84
+ $this->send_data();
85
+ update_option( 'qmn_tracker_last_time', time() );
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Sends The Data Home
91
+ *
92
+ * @since 4.1.0
93
+ * @return void
94
+ */
95
+ private function send_data()
96
+ {
97
+ $response = wp_remote_post( 'http://mylocalwebstop.com/?usage_track=confirmation', array(
98
+ 'method' => 'POST',
99
+ 'timeout' => 45,
100
+ 'redirection' => 5,
101
+ 'httpversion' => '1.0',
102
+ 'blocking' => true,
103
+ 'body' => $this->data,
104
+ 'user-agent' => 'QMN Usage Tracker'
105
+ ) );
106
+ if ( is_wp_error( $response ) ) {
107
+ $error_message = $response->get_error_message();
108
+ echo "Something went wrong: $error_message";
109
+ } else {
110
+ echo "**Message Sent**";
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Prepares The Data To Be Sent
116
+ *
117
+ * @since 4.1.0
118
+ * @return void
119
+ */
120
+ private function load_data()
121
+ {
122
+ global $wpdb;
123
+ $data = array();
124
+ $data["plugin"] = "QMN";
125
+
126
+ $data['url'] = home_url();
127
+ $data["wp_version"] = get_bloginfo( 'version' );
128
+ $data["php_version"] = PHP_VERSION;
129
+ $data["mysql_version"] = $wpdb->db_version();
130
+ $data["server_app"] = $_SERVER['SERVER_SOFTWARE'];
131
+
132
+ // Retrieve current plugin information
133
+ if( ! function_exists( 'get_plugins' ) ) {
134
+ include ABSPATH . '/wp-admin/includes/plugin.php';
135
+ }
136
+ $plugins = array_keys( get_plugins() );
137
+ $active_plugins = get_option( 'active_plugins', array() );
138
+ foreach ( $plugins as $key => $plugin ) {
139
+ if ( in_array( $plugin, $active_plugins ) ) {
140
+ // Remove active plugins from list so we can show active and inactive separately
141
+ unset( $plugins[ $key ] );
142
+ }
143
+ }
144
+ $data['active_plugins'] = $active_plugins;
145
+ $data['inactive_plugins'] = $plugins;
146
+
147
+ $theme_data = wp_get_theme();
148
+ $theme = $theme_data->Name . ' ' . $theme_data->Version;
149
+ $data['theme'] = $theme;
150
+
151
+ $mlw_stat_total_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes" );
152
+ $mlw_stat_total_active_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes WHERE deleted=0" );
153
+ $mlw_stat_total_questions = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_questions" );
154
+ $mlw_stat_total_active_questions = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_questions WHERE deleted=0" );
155
+
156
+ $data["total_quizzes"] = $mlw_stat_total_quiz;
157
+ $data["total_active_quizzes"] = $mlw_stat_total_active_quiz;
158
+ $data["total_questions"] = $mlw_stat_total_questions;
159
+ $data["total_active_questions"] = $mlw_stat_total_active_questions;
160
+
161
+ $this->data = $data;
162
+ }
163
+
164
+ /**
165
+ * Adds Admin Notice To Dashboard
166
+ *
167
+ * Adds an admin notice asking for authorization to send data home
168
+ *
169
+ * @since 4.1.0
170
+ * @return void
171
+ */
172
+ public function admin_notice()
173
+ {
174
+ $show_notice = get_option( 'qmn-tracking-notice' );
175
+ $settings = (array) get_option( 'qmn-settings' );
176
+
177
+ if ($show_notice)
178
+ return;
179
+
180
+ if (isset($settings['tracking_allowed']) && $settings['tracking_allowed'] == '1')
181
+ return;
182
+
183
+ if(!current_user_can('manage_options'))
184
+ return;
185
+
186
+ if(stristr(network_site_url('/'), 'dev') !== false || stristr(network_site_url('/'), 'localhost') !== false || stristr(network_site_url('/'), ':8888') !== false)
187
+ {
188
+ update_option( 'qmn-tracking-notice', '1' );
189
+ }
190
+ else
191
+ {
192
+ $optin_url = add_query_arg( 'qmn_track_check', 'opt_into_tracking' );
193
+ $optout_url = add_query_arg( 'qmn_track_check', 'opt_out_of_tracking' );
194
+ echo '<div class="updated"><p>';
195
+ echo __( "Allow Quiz Master Next to anonymously track this plugin's usage and help us make this plugin better? No sensitive data is tracked.", 'quiz-master-next' );
196
+ echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'quiz-master-next' ) . '</a>';
197
+ echo '&nbsp;<a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'quiz-master-next' ) . '</a>';
198
+ echo '</p></div>';
199
+ }
200
+ }
201
+
202
+ /**
203
+ * Checks If User Has Clicked On Notice
204
+ *
205
+ * @since 4.1.0
206
+ * @return void
207
+ */
208
+ public function admin_notice_check()
209
+ {
210
+ if (isset($_GET["qmn_track_check"]))
211
+ {
212
+ if ($_GET["qmn_track_check"] == 'opt_into_tracking')
213
+ {
214
+ $settings = (array) get_option( 'qmn-settings' );
215
+ $settings['tracking_allowed'] = '1';
216
+ update_option( 'qmn-settings', $settings );
217
+ }
218
+ else
219
+ {
220
+ $settings = (array) get_option( 'qmn-settings' );
221
+ $settings['tracking_allowed'] = '0';
222
+ update_option( 'qmn-settings', $settings );
223
+ }
224
+ update_option( 'qmn-tracking-notice', '1' );
225
+ }
226
+ }
227
+ }
228
+ $qmnTracking = new QMNTracking();
229
+
230
+ ?>
languages/quiz-master-next.pot CHANGED
@@ -5,7 +5,7 @@ msgid ""
5
  msgstr ""
6
  "Project-Id-Version: Quiz Master Next\n"
7
  "Report-Msgid-Bugs-To: Frank Corso <fpcorso@mylocalwebstop.com>\n"
8
- "POT-Creation-Date: 2015-01-13 11:37-0500\n"
9
  "PO-Revision-Date: \n"
10
  "Last-Translator: Your Name <you@example.com>\n"
11
  "Language-Team: My Local Webstop <fpcorso@mylocalwebstop.com>\n"
@@ -40,7 +40,6 @@ msgid "Success!"
40
  msgstr ""
41
 
42
  #: includes/qmn_alerts.php:22 includes/qmn_quiz_options.php:91
43
- #: includes/qmn_results_details.php:301
44
  msgid "Error!"
45
  msgstr ""
46
 
@@ -203,7 +202,7 @@ msgstr ""
203
  #: includes/qmn_options_certificate_tab.php:44
204
  #: includes/qmn_options_email_tab.php:54
205
  #: includes/qmn_options_email_tab.php:113
206
- #: includes/qmn_options_email_tab.php:176
207
  #: includes/qmn_options_leaderboard_tab.php:37
208
  #: includes/qmn_options_option_tab.php:55
209
  #: includes/qmn_options_questions_tab.php:117
@@ -213,9 +212,9 @@ msgstr ""
213
  #: includes/qmn_options_results_page_tab.php:53
214
  #: includes/qmn_options_results_page_tab.php:93
215
  #: includes/qmn_options_style_tab.php:38 includes/qmn_options_text_tab.php:54
216
- #: includes/qmn_options_tools_tab.php:35 includes/qmn_quiz_creator.php:347
217
- #: includes/qmn_quiz_creator.php:400 includes/qmn_quiz_creator.php:442
218
- #: includes/qmn_quiz_creator.php:588 includes/qmn_quiz_creator.php:653
219
  #: includes/qmn_results.php:32
220
  #, php-format
221
  msgid ""
@@ -257,8 +256,8 @@ msgid "Enable Certificates For This Quiz?"
257
  msgstr ""
258
 
259
  #: includes/qmn_options_certificate_tab.php:82
260
- #: includes/qmn_options_email_tab.php:296
261
- #: includes/qmn_options_email_tab.php:303
262
  #: includes/qmn_options_option_tab.php:101
263
  #: includes/qmn_options_option_tab.php:162
264
  #: includes/qmn_options_option_tab.php:169
@@ -270,13 +269,13 @@ msgstr ""
270
  #: includes/qmn_options_option_tab.php:215
271
  #: includes/qmn_options_questions_tab.php:672
272
  #: includes/qmn_options_questions_tab.php:827
273
- #: includes/qmn_options_results_page_tab.php:227
274
  msgid "Yes"
275
  msgstr ""
276
 
277
  #: includes/qmn_options_certificate_tab.php:83
278
- #: includes/qmn_options_email_tab.php:297
279
- #: includes/qmn_options_email_tab.php:304
280
  #: includes/qmn_options_option_tab.php:102
281
  #: includes/qmn_options_option_tab.php:149
282
  #: includes/qmn_options_option_tab.php:163
@@ -289,7 +288,7 @@ msgstr ""
289
  #: includes/qmn_options_option_tab.php:216
290
  #: includes/qmn_options_questions_tab.php:673
291
  #: includes/qmn_options_questions_tab.php:828
292
- #: includes/qmn_options_results_page_tab.php:227
293
  msgid "No"
294
  msgstr ""
295
 
@@ -303,11 +302,11 @@ msgstr ""
303
 
304
  #: includes/qmn_options_certificate_tab.php:97
305
  #: includes/qmn_options_leaderboard_tab.php:90
306
- #: includes/qmn_options_text_tab.php:155 includes/qmn_options_text_tab.php:165
307
- #: includes/qmn_options_text_tab.php:175 includes/qmn_options_text_tab.php:185
308
- #: includes/qmn_options_text_tab.php:195 includes/qmn_options_text_tab.php:205
309
- #: includes/qmn_options_text_tab.php:215 includes/qmn_options_text_tab.php:225
310
- #: includes/qmn_options_text_tab.php:238 includes/qmn_options_text_tab.php:255
311
  msgid "Allowed Variables:"
312
  msgstr ""
313
 
@@ -328,185 +327,226 @@ msgstr ""
328
  msgid "The email has been added successfully."
329
  msgstr ""
330
 
331
- #: includes/qmn_options_email_tab.php:163
332
  msgid "The email has been updated successfully."
333
  msgstr ""
334
 
335
- #: includes/qmn_options_email_tab.php:229
336
  #: includes/qmn_options_leaderboard_tab.php:48
337
- #: includes/qmn_options_text_tab.php:90
 
338
  msgid "Template Variables"
339
  msgstr ""
340
 
341
- #: includes/qmn_options_email_tab.php:232
342
- #: includes/qmn_options_results_page_tab.php:135
 
343
  msgid "Score for the quiz when using points"
344
  msgstr ""
345
 
346
- #: includes/qmn_options_email_tab.php:233
347
- #: includes/qmn_options_results_page_tab.php:136
348
- #: includes/qmn_options_text_tab.php:94
349
  msgid "The average amount of points user had per question"
350
  msgstr ""
351
 
352
- #: includes/qmn_options_email_tab.php:237
353
- #: includes/qmn_options_results_page_tab.php:140
354
- #: includes/qmn_options_text_tab.php:98
355
  msgid "The number of correct answers the user had"
356
  msgstr ""
357
 
358
- #: includes/qmn_options_email_tab.php:238
359
- #: includes/qmn_options_results_page_tab.php:141
360
- #: includes/qmn_options_text_tab.php:99
361
  msgid "The total number of questions in the quiz"
362
  msgstr ""
363
 
364
- #: includes/qmn_options_email_tab.php:242
365
- #: includes/qmn_options_results_page_tab.php:145
 
366
  msgid "Score for the quiz when using correct answers"
367
  msgstr ""
368
 
369
- #: includes/qmn_options_email_tab.php:246
370
- #: includes/qmn_options_results_page_tab.php:149
371
- #: includes/qmn_options_text_tab.php:107
372
  msgid "The name the user entered before the quiz"
373
  msgstr ""
374
 
375
- #: includes/qmn_options_email_tab.php:247
376
- #: includes/qmn_options_results_page_tab.php:150
377
- #: includes/qmn_options_text_tab.php:108
378
  msgid "The business the user entered before the quiz"
379
  msgstr ""
380
 
381
- #: includes/qmn_options_email_tab.php:251
382
- #: includes/qmn_options_results_page_tab.php:154
383
- #: includes/qmn_options_text_tab.php:112
384
  msgid "The phone number the user entered before the quiz"
385
  msgstr ""
386
 
387
- #: includes/qmn_options_email_tab.php:252
388
- #: includes/qmn_options_results_page_tab.php:155
389
- #: includes/qmn_options_text_tab.php:113
390
  msgid "The email the user entered before the quiz"
391
  msgstr ""
392
 
393
- #: includes/qmn_options_email_tab.php:256
394
  #: includes/qmn_options_leaderboard_tab.php:76
395
- #: includes/qmn_options_results_page_tab.php:159
396
- #: includes/qmn_options_text_tab.php:117
397
  msgid "The name of the quiz"
398
  msgstr ""
399
 
400
- #: includes/qmn_options_email_tab.php:257
401
- #: includes/qmn_options_results_page_tab.php:160
402
- #: includes/qmn_options_text_tab.php:118
403
  msgid ""
404
  "Shows the question, the answer the user provided, and the correct answer"
405
  msgstr ""
406
 
407
- #: includes/qmn_options_email_tab.php:261
408
- #: includes/qmn_options_results_page_tab.php:164
409
- #: includes/qmn_options_text_tab.php:122
410
  msgid "The comments the user entered into comment box if enabled"
411
  msgstr ""
412
 
413
- #: includes/qmn_options_email_tab.php:262
414
- #: includes/qmn_options_results_page_tab.php:165
415
- #: includes/qmn_options_text_tab.php:136
416
  msgid "The amount of time user spent of quiz"
417
  msgstr ""
418
 
419
- #: includes/qmn_options_email_tab.php:265
420
- #: includes/qmn_options_results_page_tab.php:168
421
- #: includes/qmn_options_text_tab.php:137
422
  msgid "The link to the certificate after completing the quiz"
423
  msgstr ""
424
 
425
- #: includes/qmn_options_email_tab.php:268
426
- #: includes/qmn_options_results_page_tab.php:171
 
427
  msgid "The amount of points a specific category earned."
428
  msgstr ""
429
 
430
- #: includes/qmn_options_email_tab.php:269
431
- #: includes/qmn_options_results_page_tab.php:172
 
432
  msgid "The score a specific category earned."
433
  msgstr ""
434
 
435
- #: includes/qmn_options_email_tab.php:276
436
- #: includes/qmn_options_results_page_tab.php:179
 
437
  msgid "The average points from all categories."
438
  msgstr ""
439
 
440
- #: includes/qmn_options_email_tab.php:277
441
- #: includes/qmn_options_results_page_tab.php:180
 
442
  msgid "The average score from all categories."
443
  msgstr ""
444
 
445
- #: includes/qmn_options_email_tab.php:290
446
- #: includes/qmn_options_email_tab.php:485
447
- msgid "Save Email Templates And Settings"
 
 
 
 
 
448
  msgstr ""
449
 
450
  #: includes/qmn_options_email_tab.php:294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
  msgid "Send user email upon completion?"
452
  msgstr ""
453
 
454
- #: includes/qmn_options_email_tab.php:301
455
  msgid "Send admin email upon completion?"
456
  msgstr ""
457
 
458
- #: includes/qmn_options_email_tab.php:308
459
  msgid ""
460
  "What emails should we send the admin email to? Separate emails with a comma."
461
  msgstr ""
462
 
463
- #: includes/qmn_options_email_tab.php:314
 
 
 
 
464
  msgid "Email Sent To User"
465
  msgstr ""
466
 
467
- #: includes/qmn_options_email_tab.php:315
468
- #: includes/qmn_options_email_tab.php:393
469
  msgid "Add New User Email"
470
  msgstr ""
471
 
472
- #: includes/qmn_options_email_tab.php:320
473
- #: includes/qmn_options_email_tab.php:386
474
- #: includes/qmn_options_email_tab.php:407
475
- #: includes/qmn_options_email_tab.php:473
476
- #: includes/qmn_options_results_page_tab.php:190
477
- #: includes/qmn_options_results_page_tab.php:247
478
  msgid "Score Greater Than Or Equal To"
479
  msgstr ""
480
 
481
- #: includes/qmn_options_email_tab.php:321
482
- #: includes/qmn_options_email_tab.php:387
483
- #: includes/qmn_options_email_tab.php:408
484
- #: includes/qmn_options_email_tab.php:474
485
- #: includes/qmn_options_results_page_tab.php:191
486
- #: includes/qmn_options_results_page_tab.php:248
487
  msgid "Score Less Than Or Equal To"
488
  msgstr ""
489
 
490
- #: includes/qmn_options_email_tab.php:322
491
- #: includes/qmn_options_email_tab.php:388
492
- #: includes/qmn_options_email_tab.php:409
493
- #: includes/qmn_options_email_tab.php:475
494
  msgid "Subject"
495
  msgstr ""
496
 
497
- #: includes/qmn_options_email_tab.php:323
498
- #: includes/qmn_options_email_tab.php:389
499
- #: includes/qmn_options_email_tab.php:410
500
- #: includes/qmn_options_email_tab.php:476
501
  msgid "Email To Send"
502
  msgstr ""
503
 
504
- #: includes/qmn_options_email_tab.php:401
505
  msgid "Email Sent To Admin"
506
  msgstr ""
507
 
508
- #: includes/qmn_options_email_tab.php:402
509
- #: includes/qmn_options_email_tab.php:480
510
  msgid "Add New Admin Email"
511
  msgstr ""
512
 
@@ -592,7 +632,7 @@ msgstr ""
592
  msgid "Points"
593
  msgstr ""
594
 
595
- #: includes/qmn_options_option_tab.php:95 includes/qmn_results.php:196
596
  msgid "Not Graded"
597
  msgstr ""
598
 
@@ -754,18 +794,18 @@ msgid_plural "%s questions"
754
  msgstr[0] ""
755
  msgstr[1] ""
756
 
757
- #: includes/qmn_options_questions_tab.php:556 includes/qmn_quiz_admin.php:239
758
  msgid "Edit"
759
  msgstr ""
760
 
761
- #: includes/qmn_options_questions_tab.php:556 includes/qmn_quiz_admin.php:241
762
- #: includes/qmn_quiz_admin.php:350
763
  msgid "Duplicate"
764
  msgstr ""
765
 
766
  #: includes/qmn_options_questions_tab.php:556
767
- #: includes/qmn_options_results_page_tab.php:227
768
- #: includes/qmn_quiz_admin.php:242
769
  msgid "Delete"
770
  msgstr ""
771
 
@@ -802,7 +842,7 @@ msgid "Correct Answer Info"
802
  msgstr ""
803
 
804
  #: includes/qmn_options_questions_tab.php:621
805
- #: includes/qmn_options_questions_tab.php:784 includes/qmn_quiz.php:320
806
  msgid "Hint"
807
  msgstr ""
808
 
@@ -895,22 +935,22 @@ msgstr ""
895
  msgid "The results page has been saved successfully."
896
  msgstr ""
897
 
898
- #: includes/qmn_options_results_page_tab.php:183
899
- #: includes/qmn_options_results_page_tab.php:256
900
  msgid "Save Results Pages"
901
  msgstr ""
902
 
903
- #: includes/qmn_options_results_page_tab.php:184
904
- #: includes/qmn_options_results_page_tab.php:261
905
  msgid "Add New Results Page"
906
  msgstr ""
907
 
908
- #: includes/qmn_options_results_page_tab.php:192
909
- #: includes/qmn_options_results_page_tab.php:249
910
  msgid "Results Page Shown"
911
  msgstr ""
912
 
913
- #: includes/qmn_options_results_page_tab.php:227
914
  msgid "Are you sure?"
915
  msgstr ""
916
 
@@ -935,7 +975,7 @@ msgid "Custom"
935
  msgstr ""
936
 
937
  #: includes/qmn_options_style_tab.php:93
938
- #: includes/qmn_options_style_tab.php:150
939
  msgid "Save Quiz Style"
940
  msgstr ""
941
 
@@ -949,10 +989,6 @@ msgid ""
949
  "in this plugin, please visit the following link:"
950
  msgstr ""
951
 
952
- #: includes/qmn_options_style_tab.php:105
953
- msgid "Default:"
954
- msgstr ""
955
-
956
  #: includes/qmn_options_text_tab.php:5
957
  msgid "Text"
958
  msgstr ""
@@ -961,136 +997,98 @@ msgstr ""
961
  msgid "The templates has been updated successfully."
962
  msgstr ""
963
 
964
- #: includes/qmn_options_text_tab.php:72 includes/qmn_quiz.php:1110
965
  msgid "Previous"
966
  msgstr ""
967
 
968
- #: includes/qmn_options_text_tab.php:93
969
- msgid "Total points user earned when taking quiz"
970
- msgstr ""
971
-
972
- #: includes/qmn_options_text_tab.php:103
973
- msgid ""
974
- "The percent score for the quiz showing percent of total quetions answered "
975
- "correctly"
976
- msgstr ""
977
-
978
- #: includes/qmn_options_text_tab.php:123
979
- msgid "The question that the user answered"
980
- msgstr ""
981
-
982
- #: includes/qmn_options_text_tab.php:127
983
- msgid "The answer the user gave for the question"
984
- msgstr ""
985
-
986
- #: includes/qmn_options_text_tab.php:128
987
- msgid "The correct answer for the question"
988
- msgstr ""
989
-
990
- #: includes/qmn_options_text_tab.php:132
991
- msgid "The comments the user provided in the comment field for the question"
992
- msgstr ""
993
-
994
- #: includes/qmn_options_text_tab.php:133
995
- msgid "Reason why the correct answer is the correct answer"
996
- msgstr ""
997
-
998
- #: includes/qmn_options_text_tab.php:140
999
- msgid "The Current Date"
1000
- msgstr ""
1001
-
1002
- #: includes/qmn_options_text_tab.php:143 includes/qmn_options_text_tab.php:307
1003
  msgid "Save Templates"
1004
  msgstr ""
1005
 
1006
- #: includes/qmn_options_text_tab.php:149
1007
  msgid "Message Templates"
1008
  msgstr ""
1009
 
1010
- #: includes/qmn_options_text_tab.php:153
1011
  msgid "Message Displayed Before Quiz"
1012
  msgstr ""
1013
 
1014
- #: includes/qmn_options_text_tab.php:163
1015
  msgid "Message Displayed Before Comments Box If Enabled"
1016
  msgstr ""
1017
 
1018
- #: includes/qmn_options_text_tab.php:173
1019
  msgid "Message Displayed At End Of Quiz (Leave Blank To Omit Text Section)"
1020
  msgstr ""
1021
 
1022
- #: includes/qmn_options_text_tab.php:183
1023
  msgid "Message Displayed If User Has Tried Quiz Too Many Times"
1024
  msgstr ""
1025
 
1026
- #: includes/qmn_options_text_tab.php:193
1027
  msgid ""
1028
  "Message Displayed If User Is Not Logged In And Quiz Requires Users To Be "
1029
  "Logged In"
1030
  msgstr ""
1031
 
1032
- #: includes/qmn_options_text_tab.php:203
1033
  msgid "Message Displayed If Date Is Outside Scheduled Timeframe"
1034
  msgstr ""
1035
 
1036
- #: includes/qmn_options_text_tab.php:213
1037
  msgid "Message Displayed If The Limit Of Total Entries Has Been Reached"
1038
  msgstr ""
1039
 
1040
- #: includes/qmn_options_text_tab.php:223
1041
  msgid "%QUESTIONS_ANSWERS% Text"
1042
  msgstr ""
1043
 
1044
- #: includes/qmn_options_text_tab.php:236
1045
  msgid "Twitter Sharing Text"
1046
  msgstr ""
1047
 
1048
- #: includes/qmn_options_text_tab.php:253
1049
  msgid "Facebook Sharing Text"
1050
  msgstr ""
1051
 
1052
- #: includes/qmn_options_text_tab.php:268
1053
  msgid "Other Templates"
1054
  msgstr ""
1055
 
1056
- #: includes/qmn_options_text_tab.php:271
1057
  msgid "Text for submit button"
1058
  msgstr ""
1059
 
1060
- #: includes/qmn_options_text_tab.php:275
1061
  msgid "Text for name field"
1062
  msgstr ""
1063
 
1064
- #: includes/qmn_options_text_tab.php:279
1065
  msgid "Text for business field"
1066
  msgstr ""
1067
 
1068
- #: includes/qmn_options_text_tab.php:283
1069
  msgid "Text for email field"
1070
  msgstr ""
1071
 
1072
- #: includes/qmn_options_text_tab.php:287
1073
  msgid "Text for phone number field"
1074
  msgstr ""
1075
 
1076
- #: includes/qmn_options_text_tab.php:291
1077
  msgid "Text for comments field"
1078
  msgstr ""
1079
 
1080
- #: includes/qmn_options_text_tab.php:295
1081
  msgid "Text for previous button"
1082
  msgstr ""
1083
 
1084
- #: includes/qmn_options_text_tab.php:299
1085
  msgid "Text for next button"
1086
  msgstr ""
1087
 
1088
- #: includes/qmn_options_text_tab.php:303
1089
- msgid "What is the From Name for the email sent to users and admin?"
1090
- msgstr ""
1091
-
1092
- #: includes/qmn_options_tools_tab.php:5 includes/qmn_tools.php:51
1093
- #: mlw_quizmaster2.php:161
1094
  msgid "Tools"
1095
  msgstr ""
1096
 
@@ -1162,121 +1160,121 @@ msgstr ""
1162
  msgid "Horizontal Multiple Response"
1163
  msgstr ""
1164
 
1165
- #: includes/qmn_quiz.php:206
1166
  msgid "Not a valid e-mail address!"
1167
  msgstr ""
1168
 
1169
- #: includes/qmn_quiz.php:207
1170
  msgid "This field must be a number!"
1171
  msgstr ""
1172
 
1173
- #: includes/qmn_quiz.php:208
1174
  msgid "The entered text is not correct!"
1175
  msgstr ""
1176
 
1177
- #: includes/qmn_quiz.php:209
1178
  msgid "Please complete all required fields!"
1179
  msgstr ""
1180
 
1181
- #: includes/qmn_quiz.php:1056
1182
- msgid "It appears that this quiz is not set up correctly."
1183
- msgstr ""
1184
-
1185
- #: includes/qmn_quiz_admin.php:169 mlw_quizmaster2.php:156
1186
  msgid "Quizzes"
1187
  msgstr ""
1188
 
1189
- #: includes/qmn_quiz_admin.php:169
1190
  msgid "Add New"
1191
  msgstr ""
1192
 
1193
- #: includes/qmn_quiz_admin.php:174
1194
  #, php-format
1195
  msgid "One quiz"
1196
  msgid_plural "%s quizzes"
1197
  msgstr[0] ""
1198
  msgstr[1] ""
1199
 
1200
- #: includes/qmn_quiz_admin.php:219 includes/qmn_quiz_admin.php:256
1201
- #: includes/qmn_quiz_admin.php:317 includes/qmn_results.php:148
1202
  msgid "Quiz Name"
1203
  msgstr ""
1204
 
1205
- #: includes/qmn_quiz_admin.php:220 includes/qmn_quiz_admin.php:257
 
 
 
 
1206
  msgid "Quiz Shortcode"
1207
  msgstr ""
1208
 
1209
- #: includes/qmn_quiz_admin.php:221 includes/qmn_quiz_admin.php:258
1210
  msgid "Leaderboard Shortcode"
1211
  msgstr ""
1212
 
1213
- #: includes/qmn_quiz_admin.php:222 includes/qmn_quiz_admin.php:259
1214
  msgid "Quiz Views"
1215
  msgstr ""
1216
 
1217
- #: includes/qmn_quiz_admin.php:223 includes/qmn_quiz_admin.php:260
1218
  msgid "Quiz Taken"
1219
  msgstr ""
1220
 
1221
- #: includes/qmn_quiz_admin.php:224 includes/qmn_quiz_admin.php:261
1222
  msgid "Last Modified"
1223
  msgstr ""
1224
 
1225
- #: includes/qmn_quiz_admin.php:237
1226
  msgid "Edit Name"
1227
  msgstr ""
1228
 
1229
- #: includes/qmn_quiz_admin.php:240
1230
  msgid "Results"
1231
  msgstr ""
1232
 
1233
- #: includes/qmn_quiz_admin.php:312
1234
  msgid "Create New Quiz"
1235
  msgstr ""
1236
 
1237
- #: includes/qmn_quiz_admin.php:326
1238
  msgid "Create Quiz"
1239
  msgstr ""
1240
 
1241
- #: includes/qmn_quiz_admin.php:332
1242
  msgid "Quiz Name:"
1243
  msgstr ""
1244
 
1245
- #: includes/qmn_quiz_admin.php:343
1246
  msgid "Duplicate this quiz?"
1247
  msgstr ""
1248
 
1249
- #: includes/qmn_quiz_admin.php:345
1250
  msgid "Duplicate questions with quiz"
1251
  msgstr ""
1252
 
1253
- #: includes/qmn_quiz_admin.php:347
1254
  msgid "Name Of New Quiz:"
1255
  msgstr ""
1256
 
1257
- #: includes/qmn_quiz_admin.php:356
1258
  msgid "Are you sure you want to delete this quiz?"
1259
  msgstr ""
1260
 
1261
- #: includes/qmn_quiz_admin.php:361
1262
  msgid "Delete Quiz"
1263
  msgstr ""
1264
 
1265
- #: includes/qmn_quiz_creator.php:335
1266
  msgid ""
1267
  "Your new quiz has been created successfully. To begin editing your quiz, "
1268
  "click the Edit link on the new quiz."
1269
  msgstr ""
1270
 
1271
- #: includes/qmn_quiz_creator.php:387
1272
  msgid "Your quiz has been deleted successfully."
1273
  msgstr ""
1274
 
1275
- #: includes/qmn_quiz_creator.php:429
1276
  msgid "Your quiz name has been updated successfully."
1277
  msgstr ""
1278
 
1279
- #: includes/qmn_quiz_creator.php:575
1280
  msgid "Your quiz has been duplicated successfully."
1281
  msgstr ""
1282
 
@@ -1296,164 +1294,124 @@ msgstr ""
1296
  msgid "Your results has been deleted successfully."
1297
  msgstr ""
1298
 
1299
- #: includes/qmn_results.php:118 includes/qmn_results_details.php:127
1300
- #: includes/qmn_results_details.php:130 includes/qmn_results_details.php:134
1301
- #: includes/qmn_results_details.php:298 mlw_quizmaster2.php:158
1302
  msgid "Quiz Results"
1303
  msgstr ""
1304
 
1305
- #: includes/qmn_results.php:125 includes/qmn_results.php:141
1306
- #, php-format
1307
- msgid "Previous %s Results"
1308
- msgstr ""
1309
-
1310
- #: includes/qmn_results.php:128 includes/qmn_results.php:135
1311
  #, php-format
1312
- msgid "Next %s Results"
1313
- msgstr ""
 
 
1314
 
1315
- #: includes/qmn_results.php:147
1316
  msgid "Actions"
1317
  msgstr ""
1318
 
1319
- #: includes/qmn_results.php:149
1320
  msgid "Score"
1321
  msgstr ""
1322
 
1323
- #: includes/qmn_results.php:150
1324
  msgid "Time To Complete"
1325
  msgstr ""
1326
 
1327
- #: includes/qmn_results.php:151
1328
  msgid "Name"
1329
  msgstr ""
1330
 
1331
- #: includes/qmn_results.php:152
1332
  msgid "Business"
1333
  msgstr ""
1334
 
1335
- #: includes/qmn_results.php:153
1336
  msgid "Email"
1337
  msgstr ""
1338
 
1339
- #: includes/qmn_results.php:154
1340
  msgid "Phone"
1341
  msgstr ""
1342
 
1343
- #: includes/qmn_results.php:155 includes/qmn_results_details.php:137
1344
  msgid "Time Taken"
1345
  msgstr ""
1346
 
1347
- #: includes/qmn_results.php:214
1348
  msgid "Are you sure you want to delete these results?"
1349
  msgstr ""
1350
 
1351
- #: includes/qmn_results.php:219
1352
  msgid "Delete Results"
1353
  msgstr ""
1354
 
1355
- #: includes/qmn_results_details.php:131
1356
- msgid "Quiz Tools"
1357
- msgstr ""
1358
-
1359
- #: includes/qmn_results_details.php:141
1360
- msgid "Name Provided"
1361
- msgstr ""
1362
-
1363
- #: includes/qmn_results_details.php:145
1364
- msgid "Business Provided"
1365
- msgstr ""
1366
-
1367
- #: includes/qmn_results_details.php:149
1368
- msgid "Email Provided"
1369
- msgstr ""
1370
-
1371
- #: includes/qmn_results_details.php:153
1372
- msgid "Phone Provided"
1373
- msgstr ""
1374
-
1375
- #: includes/qmn_results_details.php:164 includes/qmn_results_details.php:171
1376
- msgid "Score Received"
1377
- msgstr ""
1378
-
1379
- #: includes/qmn_results_details.php:180
1380
- msgid "Answers Provided"
1381
- msgstr ""
1382
-
1383
- #: includes/qmn_results_details.php:192
1384
- msgid "hours"
1385
- msgstr ""
1386
-
1387
- #: includes/qmn_results_details.php:197
1388
- msgid "minutes"
1389
  msgstr ""
1390
 
1391
  #: includes/qmn_results_details.php:200
1392
- msgid "seconds"
1393
- msgstr ""
1394
-
1395
- #. translators: The %s will be replaces with the amount of time the user took on quiz. For example: 5 minutes 34 seconds
1396
- #: includes/qmn_results_details.php:204
1397
- #, php-format
1398
- msgid "The user took %s to complete this quiz."
1399
  msgstr ""
1400
 
1401
  #: includes/qmn_results_details.php:207
1402
- msgid "The comments entered into the comment box (if enabled)"
1403
- msgstr ""
1404
-
1405
- #: includes/qmn_results_details.php:210
1406
- msgid "The answers were as follows"
1407
- msgstr ""
1408
-
1409
- #: includes/qmn_results_details.php:217
1410
- msgid "Answer Provided: "
1411
  msgstr ""
1412
 
1413
- #: includes/qmn_results_details.php:218
1414
- msgid "Correct Answer: "
1415
  msgstr ""
1416
 
1417
- #: includes/qmn_results_details.php:219
1418
- msgid "Comments Entered:"
1419
  msgstr ""
1420
 
1421
- #: includes/qmn_results_details.php:230
1422
- msgid "Create Certificate"
1423
- msgstr ""
1424
-
1425
- #: includes/qmn_results_details.php:235
1426
- msgid "Download Certificate Here"
1427
  msgstr ""
1428
 
1429
- #: includes/qmn_results_details.php:301
1430
- msgid ""
1431
- "Please go to the Quiz Results page and click on the View link from the "
1432
- "result you wish to see."
1433
  msgstr ""
1434
 
1435
- #: includes/qmn_tools.php:90 includes/qmn_tools.php:106
1436
  #, php-format
1437
  msgid "Previous %s Audits"
1438
  msgstr ""
1439
 
1440
- #: includes/qmn_tools.php:93 includes/qmn_tools.php:100
1441
  #, php-format
1442
  msgid "Next %s Audits"
1443
  msgstr ""
1444
 
1445
- #: includes/qmn_tools.php:113
1446
  msgid "User"
1447
  msgstr ""
1448
 
1449
- #: includes/qmn_tools.php:114
1450
  msgid "Action"
1451
  msgstr ""
1452
 
1453
- #: includes/qmn_tools.php:115
1454
  msgid "Time"
1455
  msgstr ""
1456
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1457
  #: includes/qmn_widgets.php:10
1458
  msgid "Quiz Master Next Leaderboard Widget"
1459
  msgstr ""
@@ -1466,26 +1424,30 @@ msgstr ""
1466
  msgid "Quiz ID"
1467
  msgstr ""
1468
 
1469
- #: mlw_quizmaster2.php:157
1470
  msgid "Quiz Settings"
1471
  msgstr ""
1472
 
1473
- #: mlw_quizmaster2.php:159
1474
  msgid "Quiz Result Details"
1475
  msgstr ""
1476
 
1477
- #: mlw_quizmaster2.php:160
1478
- msgid "Stats"
1479
  msgstr ""
1480
 
1481
- #: mlw_quizmaster2.php:162
1482
- msgid "Help"
1483
  msgstr ""
1484
 
1485
- #: mlw_quizmaster2.php:163
1486
  msgid "Addon Settings"
1487
  msgstr ""
1488
 
1489
- #: mlw_quizmaster2.php:166 mlw_quizmaster2.php:167
 
 
 
 
1490
  msgid "QMN About"
1491
  msgstr ""
5
  msgstr ""
6
  "Project-Id-Version: Quiz Master Next\n"
7
  "Report-Msgid-Bugs-To: Frank Corso <fpcorso@mylocalwebstop.com>\n"
8
+ "POT-Creation-Date: 2015-02-10 15:55-0500\n"
9
  "PO-Revision-Date: \n"
10
  "Last-Translator: Your Name <you@example.com>\n"
11
  "Language-Team: My Local Webstop <fpcorso@mylocalwebstop.com>\n"
40
  msgstr ""
41
 
42
  #: includes/qmn_alerts.php:22 includes/qmn_quiz_options.php:91
 
43
  msgid "Error!"
44
  msgstr ""
45
 
202
  #: includes/qmn_options_certificate_tab.php:44
203
  #: includes/qmn_options_email_tab.php:54
204
  #: includes/qmn_options_email_tab.php:113
205
+ #: includes/qmn_options_email_tab.php:177
206
  #: includes/qmn_options_leaderboard_tab.php:37
207
  #: includes/qmn_options_option_tab.php:55
208
  #: includes/qmn_options_questions_tab.php:117
212
  #: includes/qmn_options_results_page_tab.php:53
213
  #: includes/qmn_options_results_page_tab.php:93
214
  #: includes/qmn_options_style_tab.php:38 includes/qmn_options_text_tab.php:54
215
+ #: includes/qmn_options_tools_tab.php:35 includes/qmn_quiz_creator.php:381
216
+ #: includes/qmn_quiz_creator.php:447 includes/qmn_quiz_creator.php:489
217
+ #: includes/qmn_quiz_creator.php:635 includes/qmn_quiz_creator.php:700
218
  #: includes/qmn_results.php:32
219
  #, php-format
220
  msgid ""
256
  msgstr ""
257
 
258
  #: includes/qmn_options_certificate_tab.php:82
259
+ #: includes/qmn_options_email_tab.php:324
260
+ #: includes/qmn_options_email_tab.php:331
261
  #: includes/qmn_options_option_tab.php:101
262
  #: includes/qmn_options_option_tab.php:162
263
  #: includes/qmn_options_option_tab.php:169
269
  #: includes/qmn_options_option_tab.php:215
270
  #: includes/qmn_options_questions_tab.php:672
271
  #: includes/qmn_options_questions_tab.php:827
272
+ #: includes/qmn_options_results_page_tab.php:236
273
  msgid "Yes"
274
  msgstr ""
275
 
276
  #: includes/qmn_options_certificate_tab.php:83
277
+ #: includes/qmn_options_email_tab.php:325
278
+ #: includes/qmn_options_email_tab.php:332
279
  #: includes/qmn_options_option_tab.php:102
280
  #: includes/qmn_options_option_tab.php:149
281
  #: includes/qmn_options_option_tab.php:163
288
  #: includes/qmn_options_option_tab.php:216
289
  #: includes/qmn_options_questions_tab.php:673
290
  #: includes/qmn_options_questions_tab.php:828
291
+ #: includes/qmn_options_results_page_tab.php:236
292
  msgid "No"
293
  msgstr ""
294
 
302
 
303
  #: includes/qmn_options_certificate_tab.php:97
304
  #: includes/qmn_options_leaderboard_tab.php:90
305
+ #: includes/qmn_options_text_tab.php:180 includes/qmn_options_text_tab.php:190
306
+ #: includes/qmn_options_text_tab.php:200 includes/qmn_options_text_tab.php:210
307
+ #: includes/qmn_options_text_tab.php:220 includes/qmn_options_text_tab.php:230
308
+ #: includes/qmn_options_text_tab.php:240 includes/qmn_options_text_tab.php:250
309
+ #: includes/qmn_options_text_tab.php:263 includes/qmn_options_text_tab.php:280
310
  msgid "Allowed Variables:"
311
  msgstr ""
312
 
327
  msgid "The email has been added successfully."
328
  msgstr ""
329
 
330
+ #: includes/qmn_options_email_tab.php:164
331
  msgid "The email has been updated successfully."
332
  msgstr ""
333
 
334
+ #: includes/qmn_options_email_tab.php:231
335
  #: includes/qmn_options_leaderboard_tab.php:48
336
+ #: includes/qmn_options_results_page_tab.php:133
337
+ #: includes/qmn_options_text_tab.php:91
338
  msgid "Template Variables"
339
  msgstr ""
340
 
341
+ #: includes/qmn_options_email_tab.php:234
342
+ #: includes/qmn_options_results_page_tab.php:136
343
+ #: includes/qmn_options_text_tab.php:94
344
  msgid "Score for the quiz when using points"
345
  msgstr ""
346
 
347
+ #: includes/qmn_options_email_tab.php:237
348
+ #: includes/qmn_options_results_page_tab.php:139
349
+ #: includes/qmn_options_text_tab.php:97
350
  msgid "The average amount of points user had per question"
351
  msgstr ""
352
 
353
+ #: includes/qmn_options_email_tab.php:240
354
+ #: includes/qmn_options_results_page_tab.php:142
355
+ #: includes/qmn_options_text_tab.php:100
356
  msgid "The number of correct answers the user had"
357
  msgstr ""
358
 
359
+ #: includes/qmn_options_email_tab.php:243
360
+ #: includes/qmn_options_results_page_tab.php:145
361
+ #: includes/qmn_options_text_tab.php:103
362
  msgid "The total number of questions in the quiz"
363
  msgstr ""
364
 
365
+ #: includes/qmn_options_email_tab.php:246
366
+ #: includes/qmn_options_results_page_tab.php:148
367
+ #: includes/qmn_options_text_tab.php:106
368
  msgid "Score for the quiz when using correct answers"
369
  msgstr ""
370
 
371
+ #: includes/qmn_options_email_tab.php:249
372
+ #: includes/qmn_options_results_page_tab.php:151
373
+ #: includes/qmn_options_text_tab.php:109
374
  msgid "The name the user entered before the quiz"
375
  msgstr ""
376
 
377
+ #: includes/qmn_options_email_tab.php:252
378
+ #: includes/qmn_options_results_page_tab.php:154
379
+ #: includes/qmn_options_text_tab.php:112
380
  msgid "The business the user entered before the quiz"
381
  msgstr ""
382
 
383
+ #: includes/qmn_options_email_tab.php:255
384
+ #: includes/qmn_options_results_page_tab.php:157
385
+ #: includes/qmn_options_text_tab.php:115
386
  msgid "The phone number the user entered before the quiz"
387
  msgstr ""
388
 
389
+ #: includes/qmn_options_email_tab.php:258
390
+ #: includes/qmn_options_results_page_tab.php:160
391
+ #: includes/qmn_options_text_tab.php:118
392
  msgid "The email the user entered before the quiz"
393
  msgstr ""
394
 
395
+ #: includes/qmn_options_email_tab.php:261
396
  #: includes/qmn_options_leaderboard_tab.php:76
397
+ #: includes/qmn_options_results_page_tab.php:163
398
+ #: includes/qmn_options_text_tab.php:121
399
  msgid "The name of the quiz"
400
  msgstr ""
401
 
402
+ #: includes/qmn_options_email_tab.php:264
403
+ #: includes/qmn_options_results_page_tab.php:166
404
+ #: includes/qmn_options_text_tab.php:124
405
  msgid ""
406
  "Shows the question, the answer the user provided, and the correct answer"
407
  msgstr ""
408
 
409
+ #: includes/qmn_options_email_tab.php:267
410
+ #: includes/qmn_options_results_page_tab.php:169
411
+ #: includes/qmn_options_text_tab.php:127
412
  msgid "The comments the user entered into comment box if enabled"
413
  msgstr ""
414
 
415
+ #: includes/qmn_options_email_tab.php:270
416
+ #: includes/qmn_options_results_page_tab.php:172
417
+ #: includes/qmn_options_text_tab.php:130
418
  msgid "The amount of time user spent of quiz"
419
  msgstr ""
420
 
421
+ #: includes/qmn_options_email_tab.php:273
422
+ #: includes/qmn_options_results_page_tab.php:175
423
+ #: includes/qmn_options_text_tab.php:133
424
  msgid "The link to the certificate after completing the quiz"
425
  msgstr ""
426
 
427
+ #: includes/qmn_options_email_tab.php:276
428
+ #: includes/qmn_options_results_page_tab.php:178
429
+ #: includes/qmn_options_text_tab.php:136
430
  msgid "The amount of points a specific category earned."
431
  msgstr ""
432
 
433
+ #: includes/qmn_options_email_tab.php:279
434
+ #: includes/qmn_options_results_page_tab.php:181
435
+ #: includes/qmn_options_text_tab.php:139
436
  msgid "The score a specific category earned."
437
  msgstr ""
438
 
439
+ #: includes/qmn_options_email_tab.php:282
440
+ #: includes/qmn_options_results_page_tab.php:184
441
+ #: includes/qmn_options_text_tab.php:142
442
  msgid "The average points from all categories."
443
  msgstr ""
444
 
445
+ #: includes/qmn_options_email_tab.php:285
446
+ #: includes/qmn_options_results_page_tab.php:187
447
+ #: includes/qmn_options_text_tab.php:145
448
  msgid "The average score from all categories."
449
  msgstr ""
450
 
451
+ #: includes/qmn_options_email_tab.php:288
452
+ #: includes/qmn_options_text_tab.php:148
453
+ msgid "The question that the user answered"
454
+ msgstr ""
455
+
456
+ #: includes/qmn_options_email_tab.php:291
457
+ #: includes/qmn_options_text_tab.php:151
458
+ msgid "The answer the user gave for the question"
459
  msgstr ""
460
 
461
  #: includes/qmn_options_email_tab.php:294
462
+ #: includes/qmn_options_text_tab.php:154
463
+ msgid "The correct answer for the question"
464
+ msgstr ""
465
+
466
+ #: includes/qmn_options_email_tab.php:297
467
+ #: includes/qmn_options_text_tab.php:157
468
+ msgid "The comments the user provided in the comment field for the question"
469
+ msgstr ""
470
+
471
+ #: includes/qmn_options_email_tab.php:300
472
+ #: includes/qmn_options_text_tab.php:160
473
+ msgid "Reason why the correct answer is the correct answer"
474
+ msgstr ""
475
+
476
+ #: includes/qmn_options_email_tab.php:303
477
+ #: includes/qmn_options_text_tab.php:163
478
+ msgid "The Current Date"
479
+ msgstr ""
480
+
481
+ #: includes/qmn_options_email_tab.php:318
482
+ #: includes/qmn_options_email_tab.php:517
483
+ msgid "Save Email Templates And Settings"
484
+ msgstr ""
485
+
486
+ #: includes/qmn_options_email_tab.php:322
487
  msgid "Send user email upon completion?"
488
  msgstr ""
489
 
490
+ #: includes/qmn_options_email_tab.php:329
491
  msgid "Send admin email upon completion?"
492
  msgstr ""
493
 
494
+ #: includes/qmn_options_email_tab.php:336
495
  msgid ""
496
  "What emails should we send the admin email to? Separate emails with a comma."
497
  msgstr ""
498
 
499
+ #: includes/qmn_options_email_tab.php:340
500
+ msgid "What is the From Name for the email sent to users and admin?"
501
+ msgstr ""
502
+
503
+ #: includes/qmn_options_email_tab.php:346
504
  msgid "Email Sent To User"
505
  msgstr ""
506
 
507
+ #: includes/qmn_options_email_tab.php:347
508
+ #: includes/qmn_options_email_tab.php:425
509
  msgid "Add New User Email"
510
  msgstr ""
511
 
512
+ #: includes/qmn_options_email_tab.php:352
513
+ #: includes/qmn_options_email_tab.php:418
514
+ #: includes/qmn_options_email_tab.php:439
515
+ #: includes/qmn_options_email_tab.php:505
516
+ #: includes/qmn_options_results_page_tab.php:199
517
+ #: includes/qmn_options_results_page_tab.php:256
518
  msgid "Score Greater Than Or Equal To"
519
  msgstr ""
520
 
521
+ #: includes/qmn_options_email_tab.php:353
522
+ #: includes/qmn_options_email_tab.php:419
523
+ #: includes/qmn_options_email_tab.php:440
524
+ #: includes/qmn_options_email_tab.php:506
525
+ #: includes/qmn_options_results_page_tab.php:200
526
+ #: includes/qmn_options_results_page_tab.php:257
527
  msgid "Score Less Than Or Equal To"
528
  msgstr ""
529
 
530
+ #: includes/qmn_options_email_tab.php:354
531
+ #: includes/qmn_options_email_tab.php:420
532
+ #: includes/qmn_options_email_tab.php:441
533
+ #: includes/qmn_options_email_tab.php:507
534
  msgid "Subject"
535
  msgstr ""
536
 
537
+ #: includes/qmn_options_email_tab.php:355
538
+ #: includes/qmn_options_email_tab.php:421
539
+ #: includes/qmn_options_email_tab.php:442
540
+ #: includes/qmn_options_email_tab.php:508
541
  msgid "Email To Send"
542
  msgstr ""
543
 
544
+ #: includes/qmn_options_email_tab.php:433
545
  msgid "Email Sent To Admin"
546
  msgstr ""
547
 
548
+ #: includes/qmn_options_email_tab.php:434
549
+ #: includes/qmn_options_email_tab.php:512
550
  msgid "Add New Admin Email"
551
  msgstr ""
552
 
632
  msgid "Points"
633
  msgstr ""
634
 
635
+ #: includes/qmn_options_option_tab.php:95 includes/qmn_results.php:254
636
  msgid "Not Graded"
637
  msgstr ""
638
 
794
  msgstr[0] ""
795
  msgstr[1] ""
796
 
797
+ #: includes/qmn_options_questions_tab.php:556 includes/qmn_quiz_admin.php:265
798
  msgid "Edit"
799
  msgstr ""
800
 
801
+ #: includes/qmn_options_questions_tab.php:556 includes/qmn_quiz_admin.php:267
802
+ #: includes/qmn_quiz_admin.php:391
803
  msgid "Duplicate"
804
  msgstr ""
805
 
806
  #: includes/qmn_options_questions_tab.php:556
807
+ #: includes/qmn_options_results_page_tab.php:236
808
+ #: includes/qmn_quiz_admin.php:268
809
  msgid "Delete"
810
  msgstr ""
811
 
842
  msgstr ""
843
 
844
  #: includes/qmn_options_questions_tab.php:621
845
+ #: includes/qmn_options_questions_tab.php:784 includes/qmn_quiz.php:328
846
  msgid "Hint"
847
  msgstr ""
848
 
935
  msgid "The results page has been saved successfully."
936
  msgstr ""
937
 
938
+ #: includes/qmn_options_results_page_tab.php:192
939
+ #: includes/qmn_options_results_page_tab.php:265
940
  msgid "Save Results Pages"
941
  msgstr ""
942
 
943
+ #: includes/qmn_options_results_page_tab.php:193
944
+ #: includes/qmn_options_results_page_tab.php:270
945
  msgid "Add New Results Page"
946
  msgstr ""
947
 
948
+ #: includes/qmn_options_results_page_tab.php:201
949
+ #: includes/qmn_options_results_page_tab.php:258
950
  msgid "Results Page Shown"
951
  msgstr ""
952
 
953
+ #: includes/qmn_options_results_page_tab.php:236
954
  msgid "Are you sure?"
955
  msgstr ""
956
 
975
  msgstr ""
976
 
977
  #: includes/qmn_options_style_tab.php:93
978
+ #: includes/qmn_options_style_tab.php:105
979
  msgid "Save Quiz Style"
980
  msgstr ""
981
 
989
  "in this plugin, please visit the following link:"
990
  msgstr ""
991
 
 
 
 
 
992
  #: includes/qmn_options_text_tab.php:5
993
  msgid "Text"
994
  msgstr ""
997
  msgid "The templates has been updated successfully."
998
  msgstr ""
999
 
1000
+ #: includes/qmn_options_text_tab.php:72 includes/qmn_quiz.php:1112
1001
  msgid "Previous"
1002
  msgstr ""
1003
 
1004
+ #: includes/qmn_options_text_tab.php:168 includes/qmn_options_text_tab.php:328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1005
  msgid "Save Templates"
1006
  msgstr ""
1007
 
1008
+ #: includes/qmn_options_text_tab.php:174
1009
  msgid "Message Templates"
1010
  msgstr ""
1011
 
1012
+ #: includes/qmn_options_text_tab.php:178
1013
  msgid "Message Displayed Before Quiz"
1014
  msgstr ""
1015
 
1016
+ #: includes/qmn_options_text_tab.php:188
1017
  msgid "Message Displayed Before Comments Box If Enabled"
1018
  msgstr ""
1019
 
1020
+ #: includes/qmn_options_text_tab.php:198
1021
  msgid "Message Displayed At End Of Quiz (Leave Blank To Omit Text Section)"
1022
  msgstr ""
1023
 
1024
+ #: includes/qmn_options_text_tab.php:208
1025
  msgid "Message Displayed If User Has Tried Quiz Too Many Times"
1026
  msgstr ""
1027
 
1028
+ #: includes/qmn_options_text_tab.php:218
1029
  msgid ""
1030
  "Message Displayed If User Is Not Logged In And Quiz Requires Users To Be "
1031
  "Logged In"
1032
  msgstr ""
1033
 
1034
+ #: includes/qmn_options_text_tab.php:228
1035
  msgid "Message Displayed If Date Is Outside Scheduled Timeframe"
1036
  msgstr ""
1037
 
1038
+ #: includes/qmn_options_text_tab.php:238
1039
  msgid "Message Displayed If The Limit Of Total Entries Has Been Reached"
1040
  msgstr ""
1041
 
1042
+ #: includes/qmn_options_text_tab.php:248
1043
  msgid "%QUESTIONS_ANSWERS% Text"
1044
  msgstr ""
1045
 
1046
+ #: includes/qmn_options_text_tab.php:261
1047
  msgid "Twitter Sharing Text"
1048
  msgstr ""
1049
 
1050
+ #: includes/qmn_options_text_tab.php:278
1051
  msgid "Facebook Sharing Text"
1052
  msgstr ""
1053
 
1054
+ #: includes/qmn_options_text_tab.php:293
1055
  msgid "Other Templates"
1056
  msgstr ""
1057
 
1058
+ #: includes/qmn_options_text_tab.php:296
1059
  msgid "Text for submit button"
1060
  msgstr ""
1061
 
1062
+ #: includes/qmn_options_text_tab.php:300
1063
  msgid "Text for name field"
1064
  msgstr ""
1065
 
1066
+ #: includes/qmn_options_text_tab.php:304
1067
  msgid "Text for business field"
1068
  msgstr ""
1069
 
1070
+ #: includes/qmn_options_text_tab.php:308
1071
  msgid "Text for email field"
1072
  msgstr ""
1073
 
1074
+ #: includes/qmn_options_text_tab.php:312
1075
  msgid "Text for phone number field"
1076
  msgstr ""
1077
 
1078
+ #: includes/qmn_options_text_tab.php:316
1079
  msgid "Text for comments field"
1080
  msgstr ""
1081
 
1082
+ #: includes/qmn_options_text_tab.php:320
1083
  msgid "Text for previous button"
1084
  msgstr ""
1085
 
1086
+ #: includes/qmn_options_text_tab.php:324
1087
  msgid "Text for next button"
1088
  msgstr ""
1089
 
1090
+ #: includes/qmn_options_tools_tab.php:5 includes/qmn_tools.php:53
1091
+ #: mlw_quizmaster2.php:222
 
 
 
 
1092
  msgid "Tools"
1093
  msgstr ""
1094
 
1160
  msgid "Horizontal Multiple Response"
1161
  msgstr ""
1162
 
1163
+ #: includes/qmn_quiz.php:214
1164
  msgid "Not a valid e-mail address!"
1165
  msgstr ""
1166
 
1167
+ #: includes/qmn_quiz.php:215
1168
  msgid "This field must be a number!"
1169
  msgstr ""
1170
 
1171
+ #: includes/qmn_quiz.php:216
1172
  msgid "The entered text is not correct!"
1173
  msgstr ""
1174
 
1175
+ #: includes/qmn_quiz.php:217
1176
  msgid "Please complete all required fields!"
1177
  msgstr ""
1178
 
1179
+ #: includes/qmn_quiz_admin.php:181 mlw_quizmaster2.php:217
 
 
 
 
1180
  msgid "Quizzes"
1181
  msgstr ""
1182
 
1183
+ #: includes/qmn_quiz_admin.php:181
1184
  msgid "Add New"
1185
  msgstr ""
1186
 
1187
+ #: includes/qmn_quiz_admin.php:199
1188
  #, php-format
1189
  msgid "One quiz"
1190
  msgid_plural "%s quizzes"
1191
  msgstr[0] ""
1192
  msgstr[1] ""
1193
 
1194
+ #: includes/qmn_quiz_admin.php:244 includes/qmn_quiz_admin.php:290
1195
+ #: includes/qmn_quiz_admin.php:358 includes/qmn_results.php:205
1196
  msgid "Quiz Name"
1197
  msgstr ""
1198
 
1199
+ #: includes/qmn_quiz_admin.php:245
1200
+ msgid "URL"
1201
+ msgstr ""
1202
+
1203
+ #: includes/qmn_quiz_admin.php:246 includes/qmn_quiz_admin.php:291
1204
  msgid "Quiz Shortcode"
1205
  msgstr ""
1206
 
1207
+ #: includes/qmn_quiz_admin.php:247 includes/qmn_quiz_admin.php:292
1208
  msgid "Leaderboard Shortcode"
1209
  msgstr ""
1210
 
1211
+ #: includes/qmn_quiz_admin.php:248 includes/qmn_quiz_admin.php:293
1212
  msgid "Quiz Views"
1213
  msgstr ""
1214
 
1215
+ #: includes/qmn_quiz_admin.php:249 includes/qmn_quiz_admin.php:294
1216
  msgid "Quiz Taken"
1217
  msgstr ""
1218
 
1219
+ #: includes/qmn_quiz_admin.php:250 includes/qmn_quiz_admin.php:295
1220
  msgid "Last Modified"
1221
  msgstr ""
1222
 
1223
+ #: includes/qmn_quiz_admin.php:263
1224
  msgid "Edit Name"
1225
  msgstr ""
1226
 
1227
+ #: includes/qmn_quiz_admin.php:266 includes/qmn_results_details.php:116
1228
  msgid "Results"
1229
  msgstr ""
1230
 
1231
+ #: includes/qmn_quiz_admin.php:353
1232
  msgid "Create New Quiz"
1233
  msgstr ""
1234
 
1235
+ #: includes/qmn_quiz_admin.php:367
1236
  msgid "Create Quiz"
1237
  msgstr ""
1238
 
1239
+ #: includes/qmn_quiz_admin.php:373
1240
  msgid "Quiz Name:"
1241
  msgstr ""
1242
 
1243
+ #: includes/qmn_quiz_admin.php:384
1244
  msgid "Duplicate this quiz?"
1245
  msgstr ""
1246
 
1247
+ #: includes/qmn_quiz_admin.php:386
1248
  msgid "Duplicate questions with quiz"
1249
  msgstr ""
1250
 
1251
+ #: includes/qmn_quiz_admin.php:388
1252
  msgid "Name Of New Quiz:"
1253
  msgstr ""
1254
 
1255
+ #: includes/qmn_quiz_admin.php:397
1256
  msgid "Are you sure you want to delete this quiz?"
1257
  msgstr ""
1258
 
1259
+ #: includes/qmn_quiz_admin.php:402
1260
  msgid "Delete Quiz"
1261
  msgstr ""
1262
 
1263
+ #: includes/qmn_quiz_creator.php:368
1264
  msgid ""
1265
  "Your new quiz has been created successfully. To begin editing your quiz, "
1266
  "click the Edit link on the new quiz."
1267
  msgstr ""
1268
 
1269
+ #: includes/qmn_quiz_creator.php:434
1270
  msgid "Your quiz has been deleted successfully."
1271
  msgstr ""
1272
 
1273
+ #: includes/qmn_quiz_creator.php:476
1274
  msgid "Your quiz name has been updated successfully."
1275
  msgstr ""
1276
 
1277
+ #: includes/qmn_quiz_creator.php:622
1278
  msgid "Your quiz has been duplicated successfully."
1279
  msgstr ""
1280
 
1294
  msgid "Your results has been deleted successfully."
1295
  msgstr ""
1296
 
1297
+ #: includes/qmn_results.php:148 includes/qmn_results_details.php:16
1298
+ #: mlw_quizmaster2.php:219
 
1299
  msgid "Quiz Results"
1300
  msgstr ""
1301
 
1302
+ #: includes/qmn_results.php:157
 
 
 
 
 
1303
  #, php-format
1304
+ msgid "One result"
1305
+ msgid_plural "%s results"
1306
+ msgstr[0] ""
1307
+ msgstr[1] ""
1308
 
1309
+ #: includes/qmn_results.php:204
1310
  msgid "Actions"
1311
  msgstr ""
1312
 
1313
+ #: includes/qmn_results.php:206
1314
  msgid "Score"
1315
  msgstr ""
1316
 
1317
+ #: includes/qmn_results.php:207
1318
  msgid "Time To Complete"
1319
  msgstr ""
1320
 
1321
+ #: includes/qmn_results.php:208
1322
  msgid "Name"
1323
  msgstr ""
1324
 
1325
+ #: includes/qmn_results.php:209
1326
  msgid "Business"
1327
  msgstr ""
1328
 
1329
+ #: includes/qmn_results.php:210
1330
  msgid "Email"
1331
  msgstr ""
1332
 
1333
+ #: includes/qmn_results.php:211
1334
  msgid "Phone"
1335
  msgstr ""
1336
 
1337
+ #: includes/qmn_results.php:212
1338
  msgid "Time Taken"
1339
  msgstr ""
1340
 
1341
+ #: includes/qmn_results.php:272
1342
  msgid "Are you sure you want to delete these results?"
1343
  msgstr ""
1344
 
1345
+ #: includes/qmn_results.php:277
1346
  msgid "Delete Results"
1347
  msgstr ""
1348
 
1349
+ #: includes/qmn_results_details.php:195
1350
+ msgid "Create Certificate"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1351
  msgstr ""
1352
 
1353
  #: includes/qmn_results_details.php:200
1354
+ msgid "Download Certificate Here"
 
 
 
 
 
 
1355
  msgstr ""
1356
 
1357
  #: includes/qmn_results_details.php:207
1358
+ msgid "Certificate"
 
 
 
 
 
 
 
 
1359
  msgstr ""
1360
 
1361
+ #: includes/qmn_tools.php:88
1362
+ msgid "There has been an error! Please try again."
1363
  msgstr ""
1364
 
1365
+ #: includes/qmn_tools.php:106
1366
+ msgid "Quiz Has Been Restored!"
1367
  msgstr ""
1368
 
1369
+ #: includes/qmn_tools.php:111
1370
+ msgid ""
1371
+ "Choose a quiz in the drop down and then click the button to restore a "
1372
+ "deleted quiz."
 
 
1373
  msgstr ""
1374
 
1375
+ #: includes/qmn_tools.php:121
1376
+ msgid "Restore Quiz"
 
 
1377
  msgstr ""
1378
 
1379
+ #: includes/qmn_tools.php:150 includes/qmn_tools.php:166
1380
  #, php-format
1381
  msgid "Previous %s Audits"
1382
  msgstr ""
1383
 
1384
+ #: includes/qmn_tools.php:153 includes/qmn_tools.php:160
1385
  #, php-format
1386
  msgid "Next %s Audits"
1387
  msgstr ""
1388
 
1389
+ #: includes/qmn_tools.php:173
1390
  msgid "User"
1391
  msgstr ""
1392
 
1393
+ #: includes/qmn_tools.php:174
1394
  msgid "Action"
1395
  msgstr ""
1396
 
1397
+ #: includes/qmn_tools.php:175
1398
  msgid "Time"
1399
  msgstr ""
1400
 
1401
+ #: includes/qmn_usage_tracking.php:195
1402
+ msgid ""
1403
+ "Allow Quiz Master Next to anonymously track this plugin's usage and help us "
1404
+ "make this plugin better? No sensitive data is tracked."
1405
+ msgstr ""
1406
+
1407
+ #: includes/qmn_usage_tracking.php:196
1408
+ msgid "Allow"
1409
+ msgstr ""
1410
+
1411
+ #: includes/qmn_usage_tracking.php:197
1412
+ msgid "Do not allow"
1413
+ msgstr ""
1414
+
1415
  #: includes/qmn_widgets.php:10
1416
  msgid "Quiz Master Next Leaderboard Widget"
1417
  msgstr ""
1424
  msgid "Quiz ID"
1425
  msgstr ""
1426
 
1427
+ #: mlw_quizmaster2.php:218
1428
  msgid "Quiz Settings"
1429
  msgstr ""
1430
 
1431
+ #: mlw_quizmaster2.php:220
1432
  msgid "Quiz Result Details"
1433
  msgstr ""
1434
 
1435
+ #: mlw_quizmaster2.php:221
1436
+ msgid "Settings"
1437
  msgstr ""
1438
 
1439
+ #: mlw_quizmaster2.php:223
1440
+ msgid "Stats"
1441
  msgstr ""
1442
 
1443
+ #: mlw_quizmaster2.php:224
1444
  msgid "Addon Settings"
1445
  msgstr ""
1446
 
1447
+ #: mlw_quizmaster2.php:225
1448
+ msgid "Help"
1449
+ msgstr ""
1450
+
1451
+ #: mlw_quizmaster2.php:228 mlw_quizmaster2.php:229
1452
  msgid "QMN About"
1453
  msgstr ""
mlw_quizmaster2.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Quiz Master Next
4
  * Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
5
- * Version: 4.0.1
6
  * Author: Frank Corso
7
  * Author URI: http://www.mylocalwebstop.com/
8
  * Plugin URI: http://www.mylocalwebstop.com/
@@ -16,7 +16,7 @@
16
  * You understand that you install, operate, and unistall the plugin at your own discretion and risk.
17
  *
18
  * @author Frank Corso
19
- * @version 4.0.1
20
  */
21
 
22
  /**
@@ -34,7 +34,7 @@ class MLWQuizMasterNext
34
  * @var string
35
  * @since 4.0.0
36
  */
37
- public $version = '4.0.1';
38
 
39
  /**
40
  * QMN Alert Manager Object
@@ -84,33 +84,38 @@ class MLWQuizMasterNext
84
  */
85
  private function load_dependencies()
86
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  include("includes/qmn_quiz.php");
88
- include("includes/qmn_dashboard.php");
89
- include("includes/qmn_quiz_admin.php");
90
- include("includes/qmn_quiz_options.php");
91
  include("includes/qmn_quiz_install.php");
92
- include("includes/qmn_results.php");
93
- include("includes/qmn_results_details.php");
94
- include("includes/qmn_tools.php");
95
  include("includes/qmn_leaderboard.php");
96
  include("includes/qmn_update.php");
97
  include("includes/qmn_widgets.php");
98
- include("includes/qmn_credits.php");
99
  include("includes/qmn_template_variables.php");
100
  include("includes/qmn_adverts.php");
101
- include("includes/qmn_help.php");
102
- include("includes/qmn_dashboard_widgets.php");
103
- include("includes/qmn_options_questions_tab.php");
104
- include("includes/qmn_options_text_tab.php");
105
- include("includes/qmn_options_option_tab.php");
106
- include("includes/qmn_options_leaderboard_tab.php");
107
- include("includes/qmn_options_certificate_tab.php");
108
- include("includes/qmn_options_email_tab.php");
109
- include("includes/qmn_options_results_page_tab.php");
110
- include("includes/qmn_options_style_tab.php");
111
- include("includes/qmn_options_tools_tab.php");
112
- include("includes/qmn_options_preview_tab.php");
113
- include("includes/qmn_addons.php");
114
  include("includes/qmn_question_types.php");
115
 
116
  include("includes/qmn_alerts.php");
@@ -134,11 +139,67 @@ class MLWQuizMasterNext
134
  private function add_hooks()
135
  {
136
  add_action('admin_menu', array( $this, 'setup_admin_menu'));
137
- add_action('admin_head', array( $this, 'admin_head'));
138
  add_action('admin_init', 'mlw_quiz_update');
139
  add_action('widgets_init', create_function('', 'return register_widget("Mlw_Qmn_Leaderboard_Widget");'));
140
  add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
141
  add_action('plugins_loaded', array( $this, 'setup_translations'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  }
143
 
144
  /**
@@ -157,10 +218,11 @@ class MLWQuizMasterNext
157
  add_submenu_page(__FILE__, __('Quiz Settings', 'quiz-master-next'), __('Quiz Settings', 'quiz-master-next'), 'moderate_comments', 'mlw_quiz_options', 'mlw_generate_quiz_options');
158
  add_submenu_page(__FILE__, __('Quiz Results', 'quiz-master-next'), __('Quiz Results', 'quiz-master-next'), 'moderate_comments', 'mlw_quiz_results', 'mlw_generate_quiz_results');
159
  add_submenu_page(__FILE__, __('Quiz Result Details', 'quiz-master-next'), __('Quiz Result Details', 'quiz-master-next'), 'moderate_comments', 'mlw_quiz_result_details', 'mlw_generate_result_details');
160
- add_submenu_page(__FILE__, __('Stats', 'quiz-master-next'), __('Stats', 'quiz-master-next'), 'moderate_comments', 'mlw_quiz_stats', 'mlw_generate_quiz_dashboard');
161
  add_submenu_page(__FILE__, __('Tools', 'quiz-master-next'), __('Tools', 'quiz-master-next'), 'manage_options', 'mlw_quiz_tools', 'mlw_generate_quiz_tools');
162
- add_submenu_page(__FILE__, __('Help', 'quiz-master-next'), __('Help', 'quiz-master-next'), 'moderate_comments', 'mlw_quiz_help', 'mlw_generate_help_page');
163
  add_submenu_page(__FILE__, __('Addon Settings', 'quiz-master-next'), __('Addon Settings', 'quiz-master-next'), 'manage_options', 'qmn_addons', 'qmn_addons_page');
 
164
 
165
  add_dashboard_page(
166
  __( 'QMN About', 'quiz' ),
@@ -172,9 +234,19 @@ class MLWQuizMasterNext
172
  }
173
  }
174
 
 
 
 
 
 
 
 
 
175
  public function admin_head()
176
  {
177
  remove_submenu_page( 'index.php', 'mlw_qmn_about' );
 
 
178
  }
179
 
180
  /**
2
  /**
3
  * Plugin Name: Quiz Master Next
4
  * Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
5
+ * Version: 4.1.0
6
  * Author: Frank Corso
7
  * Author URI: http://www.mylocalwebstop.com/
8
  * Plugin URI: http://www.mylocalwebstop.com/
16
  * You understand that you install, operate, and unistall the plugin at your own discretion and risk.
17
  *
18
  * @author Frank Corso
19
+ * @version 4.1.0
20
  */
21
 
22
  /**
34
  * @var string
35
  * @since 4.0.0
36
  */
37
+ public $version = '4.1.0';
38
 
39
  /**
40
  * QMN Alert Manager Object
84
  */
85
  private function load_dependencies()
86
  {
87
+ if (is_admin())
88
+ {
89
+ include("includes/qmn_dashboard.php");
90
+ include("includes/qmn_quiz_admin.php");
91
+ include("includes/qmn_quiz_options.php");
92
+ include("includes/qmn_results.php");
93
+ include("includes/qmn_results_details.php");
94
+ include("includes/qmn_tools.php");
95
+ include("includes/qmn_credits.php");
96
+ include("includes/qmn_help.php");
97
+ include("includes/qmn_dashboard_widgets.php");
98
+ include("includes/qmn_options_questions_tab.php");
99
+ include("includes/qmn_options_text_tab.php");
100
+ include("includes/qmn_options_option_tab.php");
101
+ include("includes/qmn_options_leaderboard_tab.php");
102
+ include("includes/qmn_options_certificate_tab.php");
103
+ include("includes/qmn_options_email_tab.php");
104
+ include("includes/qmn_options_results_page_tab.php");
105
+ include("includes/qmn_options_style_tab.php");
106
+ include("includes/qmn_options_tools_tab.php");
107
+ include("includes/qmn_options_preview_tab.php");
108
+ include("includes/qmn_addons.php");
109
+ include("includes/qmn_global_settings.php");
110
+ include("includes/qmn_usage_tracking.php");
111
+ }
112
  include("includes/qmn_quiz.php");
 
 
 
113
  include("includes/qmn_quiz_install.php");
 
 
 
114
  include("includes/qmn_leaderboard.php");
115
  include("includes/qmn_update.php");
116
  include("includes/qmn_widgets.php");
 
117
  include("includes/qmn_template_variables.php");
118
  include("includes/qmn_adverts.php");
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  include("includes/qmn_question_types.php");
120
 
121
  include("includes/qmn_alerts.php");
139
  private function add_hooks()
140
  {
141
  add_action('admin_menu', array( $this, 'setup_admin_menu'));
142
+ add_action('admin_head', array( $this, 'admin_head'), 900);
143
  add_action('admin_init', 'mlw_quiz_update');
144
  add_action('widgets_init', create_function('', 'return register_widget("Mlw_Qmn_Leaderboard_Widget");'));
145
  add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
146
  add_action('plugins_loaded', array( $this, 'setup_translations'));
147
+ add_action('init', array( $this, 'register_quiz_post_types'));
148
+ }
149
+
150
+ /**
151
+ * Creates Custom Quiz Post Type
152
+ *
153
+ * @since 4.1.0
154
+ * @return void
155
+ */
156
+ public function register_quiz_post_types()
157
+ {
158
+ $quiz_labels = array(
159
+ 'name' => 'Quizzes',
160
+ 'singular_name' => 'Quiz',
161
+ 'menu_name' => 'Quiz',
162
+ 'name_admin_bar' => 'Quiz',
163
+ 'add_new' => 'Add New',
164
+ 'add_new_item' => 'Add New Quiz',
165
+ 'new_item' => 'New Quiz',
166
+ 'edit_item' => 'Edit Quiz',
167
+ 'view_item' => 'View Quiz',
168
+ 'all_items' => 'All Quizzes',
169
+ 'search_items' => 'Search Quizzes',
170
+ 'parent_item_colon' => 'Parent Quiz:',
171
+ 'not_found' => 'No Quiz Found',
172
+ 'not_found_in_trash' => 'No Quiz Found In Trash'
173
+ );
174
+ $has_archive = true;
175
+ $exclude_search = false;
176
+ $cpt_slug = 'quiz';
177
+ $settings = (array) get_option( 'qmn-settings' );
178
+ if (isset($settings['cpt_archive']) && $settings['cpt_archive'] == '1')
179
+ {
180
+ $has_archive = false;
181
+ }
182
+ if (isset($settings['cpt_search']) && $settings['cpt_search'] == '1')
183
+ {
184
+ $exclude_search = true;
185
+ }
186
+ if (isset($settings['cpt_slug']))
187
+ {
188
+ $cpt_slug = trim(strtolower(str_replace(" ", "-", $settings['cpt_slug'])));
189
+ }
190
+ $quiz_args = array(
191
+ 'show_ui' => false,
192
+ 'show_in_nav_menus' => true,
193
+ 'labels' => $quiz_labels,
194
+ 'publicly_queryable' => true,
195
+ 'exclude_from_search' => $exclude_search,
196
+ 'label' => 'Quizzes',
197
+ 'rewrite' => array('slug' => $cpt_slug),
198
+ 'has_archive' => $has_archive,
199
+ 'supports' => array( 'title', 'editor', 'author' )
200
+ );
201
+
202
+ register_post_type( 'quiz', $quiz_args );
203
  }
204
 
205
  /**
218
  add_submenu_page(__FILE__, __('Quiz Settings', 'quiz-master-next'), __('Quiz Settings', 'quiz-master-next'), 'moderate_comments', 'mlw_quiz_options', 'mlw_generate_quiz_options');
219
  add_submenu_page(__FILE__, __('Quiz Results', 'quiz-master-next'), __('Quiz Results', 'quiz-master-next'), 'moderate_comments', 'mlw_quiz_results', 'mlw_generate_quiz_results');
220
  add_submenu_page(__FILE__, __('Quiz Result Details', 'quiz-master-next'), __('Quiz Result Details', 'quiz-master-next'), 'moderate_comments', 'mlw_quiz_result_details', 'mlw_generate_result_details');
221
+ add_submenu_page(__FILE__, __('Settings', 'quiz-master-next'), __('Settings', 'quiz-master-next'), 'manage_options', 'qmn_global_settings', array('QMNGlobalSettingsPage', 'display_page'));
222
  add_submenu_page(__FILE__, __('Tools', 'quiz-master-next'), __('Tools', 'quiz-master-next'), 'manage_options', 'mlw_quiz_tools', 'mlw_generate_quiz_tools');
223
+ add_submenu_page(__FILE__, __('Stats', 'quiz-master-next'), __('Stats', 'quiz-master-next'), 'moderate_comments', 'mlw_quiz_stats', 'mlw_generate_quiz_dashboard');
224
  add_submenu_page(__FILE__, __('Addon Settings', 'quiz-master-next'), __('Addon Settings', 'quiz-master-next'), 'manage_options', 'qmn_addons', 'qmn_addons_page');
225
+ add_submenu_page(__FILE__, __('Help', 'quiz-master-next'), __('Help', 'quiz-master-next'), 'moderate_comments', 'mlw_quiz_help', 'mlw_generate_help_page');
226
 
227
  add_dashboard_page(
228
  __( 'QMN About', 'quiz' ),
234
  }
235
  }
236
 
237
+ /**
238
+ * Removes Unnecessary Admin Page
239
+ *
240
+ * Removes the update, quiz settings, and quiz results pages from the Quiz Menu
241
+ *
242
+ * @since 4.1.0
243
+ * @return void
244
+ */
245
  public function admin_head()
246
  {
247
  remove_submenu_page( 'index.php', 'mlw_qmn_about' );
248
+ remove_submenu_page( 'quiz-master-next/mlw_quizmaster2.php', 'mlw_quiz_options' );
249
+ remove_submenu_page( 'quiz-master-next/mlw_quizmaster2.php', 'mlw_quiz_result_details' );
250
  }
251
 
252
  /**
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Quiz Master Next ===
2
  Contributors: fpcorso
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RTGYAETX36ZQJ
4
- Tags: quiz, test, score, exam, survey, contact, form, email, answer, question
5
  Requires at least: 3.8.1
6
  Tested up to: 4.1
7
- Stable tag: 4.0.1
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
@@ -77,11 +77,6 @@ While Quiz Master Next is fully functional and is packed full of features that w
77
 
78
  == Installation ==
79
 
80
- We now offer an installation service to assist you in this process. We will install any or all of our plugins and spend up to 2 hours with you for consultaion and training. Visit our website for details.
81
- [My Local Webstop Plugin Installation](http://mylocalwebstop.com/downloads/plugin-installation/)
82
-
83
- **Or**
84
-
85
  * Navigate to Add New Plugin page within your WordPress
86
  * Search for Quiz Master Next
87
  * Click Install Now link on the plugin and follow the prompts
@@ -102,7 +97,7 @@ We have begun creating documentation for the plugin. You can view the documentat
102
  We now offer a premium support plan that offers priority response, technical support, and priority feature requests! For details, visit our services page: [My Local Webstop Services](http://mylocalwebstop.com/downloads/plugin-premium-support/)
103
 
104
  = Do you offer any 1-on-1 training to assist me in using this plugin? =
105
- We now offer an installation service that includes 1-on-1 training as well as a premium support that offers 1-on-1 training. For details, visit our [Wordpress Store](http://mylocalwebstop.com/store/)
106
 
107
  = I have an idea, how do I contact you? =
108
  Feel free to use the widget on the help page within the plugin or from the contact page at mylocalwebstop.com.
@@ -120,6 +115,22 @@ Feel free to use the widget on the help page within the plugin or from the conta
120
 
121
  == Changelog ==
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  = 4.0.1 (January 21, 2015) =
124
  * Results HTML Bug Fix
125
  * Question HTML Bug Fix
@@ -612,6 +623,9 @@ Feel free to use the widget on the help page within the plugin or from the conta
612
 
613
  == Upgrade Notice ==
614
 
 
 
 
615
  = 4.0.1 =
616
  Upgrade for various bug fixes.
617
 
1
  === Quiz Master Next ===
2
  Contributors: fpcorso
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RTGYAETX36ZQJ
4
+ Tags: quiz, test, score, exam, survey, contact, form, email, answer, question, certificate, points, results, math
5
  Requires at least: 3.8.1
6
  Tested up to: 4.1
7
+ Stable tag: 4.1.0
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
77
 
78
  == Installation ==
79
 
 
 
 
 
 
80
  * Navigate to Add New Plugin page within your WordPress
81
  * Search for Quiz Master Next
82
  * Click Install Now link on the plugin and follow the prompts
97
  We now offer a premium support plan that offers priority response, technical support, and priority feature requests! For details, visit our services page: [My Local Webstop Services](http://mylocalwebstop.com/downloads/plugin-premium-support/)
98
 
99
  = Do you offer any 1-on-1 training to assist me in using this plugin? =
100
+ We now offer 1-on-1 training for consulting and training. For details, visit our [Wordpress Store](http://mylocalwebstop.com/store/)
101
 
102
  = I have an idea, how do I contact you? =
103
  Feel free to use the widget on the help page within the plugin or from the contact page at mylocalwebstop.com.
115
 
116
  == Changelog ==
117
 
118
+ = 4.1.0 (February 11, 2015) =
119
+ * Added Ability To Restore Deleted Quizzes ([GitHub Issue #107](https://github.com/fpcorso/quiz_master_next/issues/107))
120
+ * Added Ability To Multi-Delete Results ([GitHub Issue #4](https://github.com/fpcorso/quiz_master_next/issues/4))
121
+ * Redesigned Admin Results Pages ([GitHub Issue #106](https://github.com/fpcorso/quiz_master_next/issues/106))
122
+ * Added Ability To Go To Next/Previous Results ([GitHub Issue #71](https://github.com/fpcorso/quiz_master_next/issues/71))
123
+ * Quizzes Now Have Direct URL And Archive ([GitHub Issue #104](https://github.com/fpcorso/quiz_master_next/issues/104))
124
+ * Added Ability To Use Own Facebook App ID ([GitHub Issue #137](https://github.com/fpcorso/quiz_master_next/issues/137))
125
+ * In Code: New Hook For Template Variable List
126
+ * In Code: Certificate On Admin Results Now Hooked Into New Template Variable System
127
+ * In Code: Converted Support Widget To Remote Post ([GitHub Issue #114](https://github.com/fpcorso/quiz_master_next/issues/114))
128
+ * In Code: Added Uninstall File Direct Access Check
129
+ * Bug Fix: Fixed Dashboard Widget No Quiz Bug ([GitHub Issue #119](https://github.com/fpcorso/quiz_master_next/issues/119))
130
+ * Bug Fix: Fixed Shortcode No Quiz Bug ([GitHub Issue #120](https://github.com/fpcorso/quiz_master_next/issues/120))
131
+ * Bug Fix: Fixed Required Contact User Bug ([GitHub Issue #123](https://github.com/fpcorso/quiz_master_next/issues/123))
132
+ * Bug Fix: Fixed Text Template Bug ([GitHub Issue #117](https://github.com/fpcorso/quiz_master_next/issues/117))
133
+
134
  = 4.0.1 (January 21, 2015) =
135
  * Results HTML Bug Fix
136
  * Question HTML Bug Fix
623
 
624
  == Upgrade Notice ==
625
 
626
+ = 4.1.0 =
627
+ Upgrade for redesigned admin results pages, new global settings page, ability to edit facebook app id, and more.
628
+
629
  = 4.0.1 =
630
  Upgrade for various bug fixes.
631
 
uninstall.php CHANGED
@@ -1,33 +1,24 @@
1
  <?php
2
- global $wpdb;
3
-
4
- $table_name = $wpdb->prefix . "mlw_results";
5
-
6
- $sql = "DROP TABLE IF EXISTS ".$table_name;
7
 
8
- $results = $wpdb->query( $sql );
9
-
10
- $table_name = $wpdb->prefix . "mlw_quizzes";
11
-
12
- $sql = "DROP TABLE IF EXISTS ".$table_name;
13
 
14
- $results = $wpdb->query( $sql );
 
15
 
16
- $table_name = $wpdb->prefix . "mlw_questions";
 
17
 
18
- $sql = "DROP TABLE IF EXISTS ".$table_name;
19
-
20
- $results = $wpdb->query( $sql );
21
-
22
- $table_name = $wpdb->prefix . "mlw_qm_audit_trail";
23
 
24
- $sql = "DROP TABLE IF EXISTS ".$table_name;
25
-
26
- $results = $wpdb->query( $sql );
27
-
28
- delete_option('mlw_quiz_master_version');
29
-
30
- delete_option('mlw_qmn_review_notice');
31
-
32
- delete_option('mlw_advert_shows');
33
- ?>
1
  <?php
2
+ //if uninstall not called from WordPress, then exit
3
+ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
4
+ {
5
+ exit();
6
+ }
7
 
8
+ global $wpdb;
9
+ $table_name = $wpdb->prefix . "mlw_results";
10
+ $results = $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
 
 
11
 
12
+ $table_name = $wpdb->prefix . "mlw_quizzes";
13
+ $results = $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
14
 
15
+ $table_name = $wpdb->prefix . "mlw_questions";
16
+ $results = $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
17
 
18
+ $table_name = $wpdb->prefix . "mlw_qm_audit_trail";
19
+ $results = $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
 
 
 
20
 
21
+ delete_option('mlw_quiz_master_version');
22
+ delete_option('mlw_qmn_review_notice');
23
+ delete_option('mlw_advert_shows');
24
+ ?>