diff --git a/includes/certificates/index.php b/includes/certificates/index.php new file mode 100644 index 000000000..6eff33c4e --- /dev/null +++ b/includes/certificates/index.php @@ -0,0 +1,4 @@ + diff --git a/includes/mlw_dashboard.php b/includes/mlw_dashboard.php index f11355d4b..6ad0a0666 100644 --- a/includes/mlw_dashboard.php +++ b/includes/mlw_dashboard.php @@ -6,59 +6,20 @@ Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com) */ -function mlw_generate_quiz_dashboard(){ - - //Support Email Validation Script - echo " - - "; - +function mlw_generate_quiz_dashboard() +{ //Page Variables $mlw_quiz_version = get_option('mlw_quiz_master_version'); - ///Creates the widgets add_meta_box("wpss_mrts", 'Quiz Daily Stats - Times Taken', "mlw_dashboard_box", "quiz_wpss"); add_meta_box("wpss_mrts", 'Quiz Total Stats', "mlw_dashboard_box_three", "quiz_wpss3"); add_meta_box("wpss_mrts", 'Quiz Weekly Stats - Times Taken', "mlw_dashboard_box_four", "quiz_wpss4"); add_meta_box("wpss_mrts", 'Quiz Monthly Stats - Times Taken', "mlw_dashboard_box_five", "quiz_wpss5"); - add_meta_box("wpss_mrts", 'Support', "mlw_dashboard_box_seven", "quiz_wpss7"); if ( get_option('mlw_advert_shows') == 'true' ) { add_meta_box("wpss_mrts", 'My Local Webstop Services', "mlw_dashboard_box_six", "quiz_wpss6"); - add_meta_box("wpss_mrts", 'Contribution', "mlw_dashboard_box_eight", "quiz_wpss8"); } - add_meta_box("wpss_mrts", 'News From My Local Webstop', "mlw_dashboard_box_nine", "quiz_wpss9"); add_meta_box("wpss_mrts", 'Quizzes Taken Today', "mlw_qmn_daily_percent_taken_widget", "quiz_wpss10"); add_meta_box("wpss_mrts", 'Quizzes Taken Last 7 Days', "mlw_qmn_weekly_percent_taken_widget", "quiz_wpss11"); add_meta_box("wpss_mrts", 'Quizzes Taken Last 30 Days', "mlw_qmn_monthly_percent_taken_widget", "quiz_wpss12"); @@ -70,11 +31,8 @@ function mlw_validateForm() -
-

Quiz Master Next Version (?)

+

Quiz Master Next Version Statistics

@@ -187,36 +92,6 @@ function mlw_validateForm()
- -
- -
- -
- -
- -
- -
- -
- - - - -
display_name." from ".$current_user->user_email."\n Wordpress Info: ".$mlw_site_info; - wp_mail('fpcorso@mylocalwebstop.com' ,'Support From Quiz Master Next Plugin', $mlw_message); - $quiz_master_email_message = "**Message Sent**"; - } - } - ?> -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If there is something you would like to suggest to add or even if you just want - to let me know if you like the plugin or not, feel free to use the email form below.
Name (Required):
Email (Required):
URL To Quiz (Not Required):
Message (Required):
-
-

Disclaimer: In order to better assist you, this form will also send some useful information about your WordPress installation such as version of plugin, version of WordPress, and website url along with your message.

-
- -
- - - - - - - - - - - - - - - - -
- Quiz Master Next is and always will be a free plugin. I have spent a lot of time and effort developing and maintaining this plugin. If it has been beneficial to your site, please consider supporting this plugin by making a donation. -
 
 
-
-

-

- - - - -
-

-
-
-

Thank you to those who have contributed so far!

-
- -
- - - - -
-
- \ No newline at end of file +?> diff --git a/includes/mlw_help.php b/includes/mlw_help.php index af12a1903..48e82aebb 100644 --- a/includes/mlw_help.php +++ b/includes/mlw_help.php @@ -8,70 +8,202 @@ function mlw_generate_help_page() { + ///Creates the widgets + add_meta_box("wpss_mrts", 'Plugin Documentation', "qmn_documentation_meta_box_content", "meta_box_help"); + add_meta_box("wpss_mrts", 'Support', "qmn_support_meta_box_content", "meta_box_support"); + add_meta_box("wpss_mrts", 'System Info', "qmn_system_meta_box_content", "meta_box_sys_info"); ?> - - - +
+

QMN Help

+ + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +

Need help with the plugin? Try any of the following:

+ ", "\n", $mlw_site_info); + $mlw_site_info = str_replace("

", "\n", $mlw_site_info); + $mlw_site_info = str_replace("

", "\n", $mlw_site_info); + if ($quiz_master_email_success == 'update') + { + $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; + wp_mail('fpcorso@mylocalwebstop.com' ,'Support From Quiz Master Next Plugin', $mlw_message); + $quiz_master_email_message = "**Message Sent**"; + } + } ?> - - - - -
-
-

How-To(?)

- Please visit our new Documentation for using this plugin. It is a work in progress, but we will be deleting this page once it is finished. -
-
-

Help

-

This page contains numerous how-to's for using the plugin.

-
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
If there is something you would like to suggest to add or even if you just want + to let me know if you like the plugin or not, feel free to use the email form below.
Name (Required):
Email (Required):
URL To Quiz (Not Required):
Message (Required):
+
+

Disclaimer: In order to better assist you, this form will also send the system info from below with your message.

-
- \ No newline at end of file + +function qmn_get_system_info() +{ + global $wpdb; + $qmn_sys_info = ""; + + $theme_data = wp_get_theme(); + $theme = $theme_data->Name . ' ' . $theme_data->Version; + + $qmn_sys_info .= "

Site Information


"; + $qmn_sys_info .= "Site URL: ".site_url()."
"; + $qmn_sys_info .= "Home URL: ".home_url()."
"; + $qmn_sys_info .= "Multisite: ".( is_multisite() ? 'Yes' : 'No' )."
"; + + $qmn_sys_info .= "

WordPress Information


"; + $qmn_sys_info .= "Version: ".get_bloginfo( 'version' )."
"; + $qmn_sys_info .= "Language: ".( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' )."
"; + $qmn_sys_info .= "Active Theme: ".$theme."
"; + $qmn_sys_info .= "Debug Mode: ".( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' )."
"; + $qmn_sys_info .= "Memory Limit: ".WP_MEMORY_LIMIT."
"; + + $qmn_sys_info .= "

Plugins Information


"; + $qmn_plugin_mu = get_mu_plugins(); + if( count( $qmn_plugin_mu > 0 ) ) { + $qmn_sys_info .= "

Must Use


"; + foreach( $qmn_plugin_mu as $plugin => $plugin_data ) { + $qmn_sys_info .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "
"; + } + } + $qmn_sys_info .= "

Active


"; + $plugins = get_plugins(); + $active_plugins = get_option( 'active_plugins', array() ); + foreach( $plugins as $plugin_path => $plugin ) { + if( !in_array( $plugin_path, $active_plugins ) ) + continue; + $qmn_sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . "
"; + } + $qmn_sys_info .= "

Inactive


"; + foreach( $plugins as $plugin_path => $plugin ) { + if( in_array( $plugin_path, $active_plugins ) ) + continue; + $qmn_sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . "
"; + } + + $qmn_sys_info .= "

Server Information


"; + $qmn_sys_info .= "PHP : ".PHP_VERSION."
"; + $qmn_sys_info .= "MySQL : ".$wpdb->db_version()."
"; + $qmn_sys_info .= "Webserver : ".$_SERVER['SERVER_SOFTWARE']."
"; + + return $qmn_sys_info; +} + +?> diff --git a/includes/mlw_qmn_credits.php b/includes/mlw_qmn_credits.php index 80b59eba2..e127d18f7 100644 --- a/includes/mlw_qmn_credits.php +++ b/includes/mlw_qmn_credits.php @@ -10,8 +10,6 @@ function mlw_generate_about_page() { //Page Variables $mlw_quiz_version = get_option('mlw_quiz_master_version'); - - ?> @@ -89,15 +87,24 @@ function mlw_qmn_setTab(tab) {
Version
-

Ability To Schedule When Quiz Is Active

-

You can now set a time-frame of when the quiz is active. On the quiz options tab, you will see a spot to put in two dates. The quiz will now only be active during that time. Leave those fields blank to leave the quiz always active.

+

Ability To Send Different Admin Emails Based On Score

+

You can now set up different admin emails based on score similarly to the user emails. You can also now customize the admin email's seubject.

+
+

New Dashboard Widget

+

We added a new dashboard widget that shows a snapshot of how your quizzes are doing. Includes daily total, most popular quiz, and more.

+
+

New Help Page

+

There is now a new page in the menu titled "Help". This page now has the support widget on it and a link to the documentation. We also added a system info widget on this page to better assist when trying to solve errors.

+
+

For Developers:

+

We added 4 new hooks in the Quiz Creator class. You can now hook into when a quiz is created, duplicated, deleted, or its name is changed. We also begun work on a few quiz settings helper functions in the class as well.


Please Take Our Survey To Better Improve This Plugin

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 take our survey.

@@ -109,11 +116,15 @@ function mlw_qmn_setTab(tab) {

Our Popular Add-On Pack is now only $45 for 6 add-ons! Now is the time to save almost 50%! Visit our WordPress Store for details.

diff --git a/includes/mlw_quiz.php b/includes/mlw_quiz.php index ceab4f291..8a41a81c2 100644 --- a/includes/mlw_quiz.php +++ b/includes/mlw_quiz.php @@ -8,6 +8,8 @@ function mlw_quiz_shortcode($atts) 'quiz' => 0 ), $atts)); + global $mlwQuizMasterNext; + $mlwQuizMasterNext->quizCreator->set_id($quiz); date_default_timezone_set(get_option('timezone_string')); /* @@ -459,23 +461,24 @@ function clear_field(field) function mlw_validateForm() { mlw_validateResult = true; - if (document.forms['quizForm']['mlwUserEmail'].value != '') - { - var x=document.forms['quizForm']['mlwUserEmail'].value; - var atpos=x.indexOf('@'); - var dotpos=x.lastIndexOf('.'); - if (atpos<1 || dotpos=x.length) - { - document.getElementById('mlw_error_message').innerHTML = '**Not a valid e-mail address!**'; - document.getElementById('mlw_error_message_bottom').innerHTML = '**Not a valid e-mail address!**'; - mlw_validateResult = false; - } - } jQuery('#quizForm *').filter(':input').each(function(){ jQuery(this).css("outline", ""); if (jQuery(this).attr('class')) { + if(jQuery(this).attr('class').indexOf('mlwEmail') > -1 && this.value != "") + { + var x=this.value; + var atpos=x.indexOf('@'); + var dotpos=x.lastIndexOf('.'); + if (atpos<1 || dotpos=x.length) + { + document.getElementById('mlw_error_message').innerHTML = '**Not a valid e-mail address!**'; + document.getElementById('mlw_error_message_bottom').innerHTML = '**Not a valid e-mail address!**'; + mlw_validateResult = false; + jQuery(this).css("outline", "2px solid red"); + } + } if(jQuery(this).attr('class').indexOf('mlwRequiredNumber') > -1 && this.value == "" && +this.value != NaN) { document.getElementById('mlw_error_message').innerHTML = '**This field must be a number!**'; @@ -905,6 +908,10 @@ function mlw_validateForm() //Display Completion Screen else { + $mlw_display .= "
"; + $mlw_display .= ""; ?>

Template Variables

@@ -1867,6 +1960,10 @@ function delete_email(id) + + + +
@@ -1957,31 +2054,86 @@ function delete_email(id)

Email Sent To Admin

-
- - - - + Add New Email +
- Email sent to admin after completion (If turned on in options) -
-

Allowed Variables:

-

- %POINT_SCORE%

-

- %AVERAGE_POINT%

-

- %AMOUNT_CORRECT%

-

- %TOTAL_QUESTIONS%

-

- %CORRECT_SCORE%

-

- %USER_NAME%

-

- %USER_BUSINESS%

-

- %USER_PHONE%

-

- %USER_EMAIL%

-

- %QUIZ_NAME%

-

- %COMMENT_SECTION%

-

- %QUESTIONS_ANSWERS%

-

- %TIMER%

-

- %CURRENT_DATE%

-
-
+ + + + + + + + + + + "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + break; + } + else + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + } + ?> + + + + + + + + + +
IDScore Greater Than Or Equal ToScore Less Than Or Equal ToSubjectEmail To Send
"; + echo "Default"; + echo ""; + echo "-"; + echo ""; + echo "-"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo $mlw_admin_count."
Are you sure?
Yes|No
"; + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
IDScore Greater Than Or Equal ToScore Less Than Or Equal ToSubjectEmail To Send
+ Add New Email +
diff --git a/includes/mlw_update.php b/includes/mlw_update.php index c6e171e55..f952a2b9c 100644 --- a/includes/mlw_update.php +++ b/includes/mlw_update.php @@ -6,7 +6,7 @@ function mlw_quiz_update() { //Update this variable each update. This is what is checked when the plugin is deciding to run the upgrade script or not. - $data = "3.7.1"; + $data = "3.8.1"; if ( ! get_option('mlw_quiz_master_version')) { add_option('mlw_quiz_master_version' , $data); diff --git a/includes/qmn_dashboard_widgets.php b/includes/qmn_dashboard_widgets.php new file mode 100644 index 000000000..9d9817074 --- /dev/null +++ b/includes/qmn_dashboard_widgets.php @@ -0,0 +1,142 @@ +get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".date("Y-m-d")." 00:00:00' AND '".date("Y-m-d")." 23:59:59') AND deleted=0"); + $mlw_last_week = mktime(0, 0, 0, date("m") , date("d")-7, date("Y")); + $mlw_last_week = date("Y-m-d", $mlw_last_week); + $mlw_qmn_last_weekday_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_week." 00:00:00' AND '".$mlw_last_week." 23:59:59') AND deleted=0"); + if ($mlw_qmn_last_weekday_taken != 0) + { + $mlw_qmn_analyze_today = round((($mlw_qmn_today_taken - $mlw_qmn_last_weekday_taken) / $mlw_qmn_last_weekday_taken) * 100, 2); + } + else + { + $mlw_qmn_analyze_today = $mlw_qmn_today_taken * 100; + } + + $mlw_stat_total_active_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes WHERE deleted=0 LIMIT 1" ); + $mlw_stat_total_questions = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_questions WHERE deleted=0 LIMIT 1" ); + + $mlw_stat_most_popular_quiz = $wpdb->get_row( "SELECT quiz_name FROM ".$wpdb->prefix."mlw_quizzes WHERE deleted=0 ORDER BY quiz_taken Desc LIMIT 1" ); + $mlw_stat_least_popular_quiz = $wpdb->get_row( "SELECT quiz_name FROM ".$wpdb->prefix."mlw_quizzes WHERE deleted=0 ORDER BY quiz_taken ASC LIMIT 1" ); + ?> + + + diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 09f7da032..ee79ad957 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -3,7 +3,7 @@ /* Plugin Name: Quiz Master Next Description: Use this plugin to add multiple quizzes, tests, or surveys to your website. -Version: 3.7.1 +Version: 3.8.1 Author: Frank Corso Author URI: http://www.mylocalwebstop.com/ Plugin URI: http://www.mylocalwebstop.com/ @@ -83,15 +83,14 @@ private function load_dependencies() include("includes/mlw_qmn_credits.php"); include("includes/mlw_template_variables.php"); include("includes/mlw_adverts.php"); - include("includes/mlw_alerts.php"); + include("includes/mlw_help.php"); + include("includes/qmn_dashboard_widgets.php"); + include("includes/mlw_alerts.php"); $this->alertManager = new MlwQmnAlertManager(); - if (is_admin()) - { - include("includes/mlw_quiz_creator.php"); - $this->quizCreator = new QMNQuizCreator(); - } + include("includes/mlw_quiz_creator.php"); + $this->quizCreator = new QMNQuizCreator(); } /** @@ -124,12 +123,13 @@ public function setup_admin_menu() { if (function_exists('add_menu_page')) { - add_menu_page('Quiz Master Next', 'Quiz Dashboard', 'moderate_comments', __FILE__, 'mlw_generate_quiz_dashboard', 'dashicons-feedback'); - add_submenu_page(__FILE__, 'Quizzes', 'Quizzes', 'moderate_comments', 'mlw_quiz_admin', 'mlw_generate_quiz_admin'); + add_menu_page('Quiz Master Next', 'Quizzes', 'moderate_comments', __FILE__, 'mlw_generate_quiz_admin', 'dashicons-feedback'); add_submenu_page(__FILE__, 'Quiz Settings', 'Quiz Settings', 'moderate_comments', 'mlw_quiz_options', 'mlw_generate_quiz_options'); add_submenu_page(__FILE__, 'Quiz Results', 'Quiz Results', 'moderate_comments', 'mlw_quiz_results', 'mlw_generate_quiz_results'); add_submenu_page(__FILE__, 'Quiz Result Details', 'Quiz Result Details', 'moderate_comments', 'mlw_quiz_result_details', 'mlw_generate_result_details'); - add_submenu_page(__FILE__, 'Tools', 'Tools', 'manage_options', 'mlw_quiz_tools', 'mlw_generate_quiz_tools'); + add_submenu_page(__FILE__, 'QMN Stats', 'QMN Stats', 'moderate_comments', 'mlw_quiz_stats', 'mlw_generate_quiz_dashboard'); + add_submenu_page(__FILE__, 'QMN Tools', 'QMN Tools', 'manage_options', 'mlw_quiz_tools', 'mlw_generate_quiz_tools'); + add_submenu_page(__FILE__, 'QMN Help', 'QMN Help', 'moderate_comments', 'mlw_quiz_help', 'mlw_generate_help_page'); add_submenu_page(__FILE__, 'QMN About', 'QMN About', 'manage_options', 'mlw_qmn_about', 'mlw_generate_about_page'); } } diff --git a/readme.txt b/readme.txt index 989ea1c61..e0518453d 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: fpcorso Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RTGYAETX36ZQJ Tags: quiz, test, score, exam, survey, contact, form, email, answer, question Requires at least: 3.8.1 -Tested up to: 4.0.1 -Stable tag: 3.7.1 +Tested up to: 4.1 +Stable tag: 3.8.1 License URI: http://www.gnu.org/licenses/gpl-2.0.html The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website. @@ -101,7 +101,7 @@ We now offer a premium support plan that offers priority response, priority feat 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/shop/) = I have an idea, how do I contact you? = -Feel free to use the widget on the quiz dashboard within the plugin or from the contact page at mylocalwebstop.com. +Feel free to use the widget on the help page within the plugin or from the contact page at mylocalwebstop.com. == Screenshots == @@ -116,6 +116,15 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the == Changelog == += 3.8.1 (December 17, 2014) = + * Added Ability To Send Different Admin Emails Based On Score + * Added Ability To Customize Admin Email Subject + * Added New Dashboard Widget For Quick Snapshot Of Status + * Added New Help Page With Link To Documentation + * Create New System Info Widget On Help Page + * In Code: Added 4 New Hooks Throughout The Quiz Creator Class + * In Code: Added 3 New Quiz Settings Helper Functions In Quiz Creator Class + = 3.7.1 (December 10, 2014) = * Added Ability To Schedule A Timeframe That The Quiz Is Active In * Added Labels To Horizontal Radio Type For Better Use @@ -569,6 +578,9 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the == Upgrade Notice == += 3.8.1 = +Upgrade for ability for different admin emails based on score. Also, new help page is included. Added new dashboard widget as well. + = 3.7.1 = Upgrade for ability to schedule when quiz will be active