From 9e5d9e0c5fd423045939a17a7526144abba8fc9f Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Mon, 29 Dec 2014 22:33:32 -0500 Subject: [PATCH 001/184] Updated So Only Author Or Higher Sees Widget --- includes/qmn_dashboard_widgets.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/includes/qmn_dashboard_widgets.php b/includes/qmn_dashboard_widgets.php index a95567985..5f89bef3a 100644 --- a/includes/qmn_dashboard_widgets.php +++ b/includes/qmn_dashboard_widgets.php @@ -1,11 +1,14 @@ Date: Fri, 2 Jan 2015 16:57:09 -0500 Subject: [PATCH 002/184] Rename mlw_adverts.php to qmn_adverts.php --- includes/{mlw_adverts.php => qmn_adverts.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_adverts.php => qmn_adverts.php} (100%) diff --git a/includes/mlw_adverts.php b/includes/qmn_adverts.php similarity index 100% rename from includes/mlw_adverts.php rename to includes/qmn_adverts.php From 4097030b5f0e58257e54cf333b6d21b1022181e8 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:57:20 -0500 Subject: [PATCH 003/184] Rename mlw_alerts.php to qmn_alerts.php --- includes/{mlw_alerts.php => qmn_alerts.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_alerts.php => qmn_alerts.php} (100%) diff --git a/includes/mlw_alerts.php b/includes/qmn_alerts.php similarity index 100% rename from includes/mlw_alerts.php rename to includes/qmn_alerts.php From b57c19bbc3938f56f62c66b0bbdb51f71bdd2945 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:57:31 -0500 Subject: [PATCH 004/184] Rename mlw_dashboard.php to qmn_dashboard.php --- includes/{mlw_dashboard.php => qmn_dashboard.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_dashboard.php => qmn_dashboard.php} (100%) diff --git a/includes/mlw_dashboard.php b/includes/qmn_dashboard.php similarity index 100% rename from includes/mlw_dashboard.php rename to includes/qmn_dashboard.php From 1e87d0fd6e2d4ec44020e6c01065cd1da4b63b5d Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:57:43 -0500 Subject: [PATCH 005/184] Rename mlw_help.php to qmn_help.php --- includes/{mlw_help.php => qmn_help.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_help.php => qmn_help.php} (100%) diff --git a/includes/mlw_help.php b/includes/qmn_help.php similarity index 100% rename from includes/mlw_help.php rename to includes/qmn_help.php From 0cfadfd105b625b313fe2d1a67dc2bbb51b4bf7e Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:57:53 -0500 Subject: [PATCH 006/184] Rename mlw_leaderboard.php to qmn_leaderboard.php --- includes/{mlw_leaderboard.php => qmn_leaderboard.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename includes/{mlw_leaderboard.php => qmn_leaderboard.php} (99%) diff --git a/includes/mlw_leaderboard.php b/includes/qmn_leaderboard.php similarity index 99% rename from includes/mlw_leaderboard.php rename to includes/qmn_leaderboard.php index 535c8234c..3b8b03a05 100644 --- a/includes/mlw_leaderboard.php +++ b/includes/qmn_leaderboard.php @@ -72,4 +72,4 @@ function mlw_quiz_leaderboard_shortcode($atts) return $mlw_quiz_leaderboard_display; } -?> \ No newline at end of file +?> From bc3a652b748d867e7947f30a7a193ee9df3f328a Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:58:16 -0500 Subject: [PATCH 007/184] Rename mlw_qmn_credits.php to qmn_credits.php --- includes/{mlw_qmn_credits.php => qmn_credits.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_qmn_credits.php => qmn_credits.php} (100%) diff --git a/includes/mlw_qmn_credits.php b/includes/qmn_credits.php similarity index 100% rename from includes/mlw_qmn_credits.php rename to includes/qmn_credits.php From 1214451313d96b736d3adc9510b8276b4dd33758 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:58:25 -0500 Subject: [PATCH 008/184] Rename mlw_qmn_widgets.php to qmn_widgets.php --- includes/{mlw_qmn_widgets.php => qmn_widgets.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename includes/{mlw_qmn_widgets.php => qmn_widgets.php} (99%) diff --git a/includes/mlw_qmn_widgets.php b/includes/qmn_widgets.php similarity index 99% rename from includes/mlw_qmn_widgets.php rename to includes/qmn_widgets.php index 7c98b98b0..f73f7f304 100644 --- a/includes/mlw_qmn_widgets.php +++ b/includes/qmn_widgets.php @@ -122,4 +122,4 @@ function widget($args, $instance) { echo $after_widget; } } -?> \ No newline at end of file +?> From 550bd4e289221797be411abca0cc28fb277994ad Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:58:39 -0500 Subject: [PATCH 009/184] Rename mlw_quiz.php to qmn_quiz.php --- includes/{mlw_quiz.php => qmn_quiz.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_quiz.php => qmn_quiz.php} (100%) diff --git a/includes/mlw_quiz.php b/includes/qmn_quiz.php similarity index 100% rename from includes/mlw_quiz.php rename to includes/qmn_quiz.php From 8c09f964d9953ee7f28af23ab653ed48031b7536 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:58:52 -0500 Subject: [PATCH 010/184] Rename mlw_quiz_admin.php to qmn_quiz_admin.php --- includes/{mlw_quiz_admin.php => qmn_quiz_admin.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_quiz_admin.php => qmn_quiz_admin.php} (100%) diff --git a/includes/mlw_quiz_admin.php b/includes/qmn_quiz_admin.php similarity index 100% rename from includes/mlw_quiz_admin.php rename to includes/qmn_quiz_admin.php From bbc7a725021d9a237e2ba69a522b4a4d348e63fe Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:59:03 -0500 Subject: [PATCH 011/184] Rename mlw_quiz_creator.php to qmn_quiz_creator.php --- includes/{mlw_quiz_creator.php => qmn_quiz_creator.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_quiz_creator.php => qmn_quiz_creator.php} (100%) diff --git a/includes/mlw_quiz_creator.php b/includes/qmn_quiz_creator.php similarity index 100% rename from includes/mlw_quiz_creator.php rename to includes/qmn_quiz_creator.php From 3d5910aefefcdbd0856e495f253012d271e11cdc Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:59:14 -0500 Subject: [PATCH 012/184] Rename mlw_quiz_install.php to qmn_quiz_install.php --- includes/{mlw_quiz_install.php => qmn_quiz_install.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_quiz_install.php => qmn_quiz_install.php} (100%) diff --git a/includes/mlw_quiz_install.php b/includes/qmn_quiz_install.php similarity index 100% rename from includes/mlw_quiz_install.php rename to includes/qmn_quiz_install.php From 704164dbcedf80b00ce0eeb3e55836298739f643 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:59:29 -0500 Subject: [PATCH 013/184] Rename mlw_quiz_options.php to qmn_quiz_options.php --- includes/{mlw_quiz_options.php => qmn_quiz_options.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_quiz_options.php => qmn_quiz_options.php} (100%) diff --git a/includes/mlw_quiz_options.php b/includes/qmn_quiz_options.php similarity index 100% rename from includes/mlw_quiz_options.php rename to includes/qmn_quiz_options.php From c44c1245be65530d6cd3e4cbd8a884d524c4394b Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:59:40 -0500 Subject: [PATCH 014/184] Rename mlw_results.php to qmn_results.php --- includes/{mlw_results.php => qmn_results.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_results.php => qmn_results.php} (100%) diff --git a/includes/mlw_results.php b/includes/qmn_results.php similarity index 100% rename from includes/mlw_results.php rename to includes/qmn_results.php From d2031eff6470343fc80348f67e73acc80887f2d2 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 16:59:49 -0500 Subject: [PATCH 015/184] Rename mlw_results_details.php to qmn_results_details.php --- includes/{mlw_results_details.php => qmn_results_details.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_results_details.php => qmn_results_details.php} (100%) diff --git a/includes/mlw_results_details.php b/includes/qmn_results_details.php similarity index 100% rename from includes/mlw_results_details.php rename to includes/qmn_results_details.php From 1bf790799819593ed8737dfdf28b7680b7b465b9 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 17:00:00 -0500 Subject: [PATCH 016/184] Rename mlw_template_variables.php to qmn_template_variables.php --- .../{mlw_template_variables.php => qmn_template_variables.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_template_variables.php => qmn_template_variables.php} (100%) diff --git a/includes/mlw_template_variables.php b/includes/qmn_template_variables.php similarity index 100% rename from includes/mlw_template_variables.php rename to includes/qmn_template_variables.php From d1063eaa8eebd8e818cde60514d13e21a1c59448 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 17:00:09 -0500 Subject: [PATCH 017/184] Rename mlw_tools.php to qmn_tools.php --- includes/{mlw_tools.php => qmn_tools.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename includes/{mlw_tools.php => qmn_tools.php} (99%) diff --git a/includes/mlw_tools.php b/includes/qmn_tools.php similarity index 99% rename from includes/mlw_tools.php rename to includes/qmn_tools.php index e063e968e..afe2b49d9 100644 --- a/includes/mlw_tools.php +++ b/includes/qmn_tools.php @@ -162,4 +162,4 @@ function mlw_tools_box() \ No newline at end of file +?> From fcc0ed8eebdb91d850f191a939e62a18e91d2ed2 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 17:00:19 -0500 Subject: [PATCH 018/184] Rename mlw_update.php to qmn_update.php --- includes/{mlw_update.php => qmn_update.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{mlw_update.php => qmn_update.php} (100%) diff --git a/includes/mlw_update.php b/includes/qmn_update.php similarity index 100% rename from includes/mlw_update.php rename to includes/qmn_update.php From f0a0c05e0af4f34761b1b779da8c4ceceae7a845 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 17:01:41 -0500 Subject: [PATCH 019/184] Changed File Paths Changed the file paths to accommodate new qmn_ prefix --- mlw_quizmaster2.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 1b46aa593..51c8654e9 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -69,27 +69,27 @@ public function __construct() */ private function load_dependencies() { - include("includes/mlw_quiz.php"); - include("includes/mlw_dashboard.php"); - include("includes/mlw_quiz_admin.php"); - include("includes/mlw_quiz_options.php"); - include("includes/mlw_quiz_install.php"); - include("includes/mlw_results.php"); - include("includes/mlw_results_details.php"); - include("includes/mlw_tools.php"); - include("includes/mlw_leaderboard.php"); - include("includes/mlw_update.php"); - include("includes/mlw_qmn_widgets.php"); - include("includes/mlw_qmn_credits.php"); - include("includes/mlw_template_variables.php"); - include("includes/mlw_adverts.php"); - include("includes/mlw_help.php"); + include("includes/qmn_quiz.php"); + include("includes/qmn_dashboard.php"); + include("includes/qmn_quiz_admin.php"); + include("includes/qmn_quiz_options.php"); + include("includes/qmn_quiz_install.php"); + include("includes/qmn_results.php"); + include("includes/qmn_results_details.php"); + include("includes/qmn_tools.php"); + include("includes/qmn_leaderboard.php"); + include("includes/qmn_update.php"); + include("includes/qmn_widgets.php"); + include("includes/qmn_credits.php"); + include("includes/qmn_template_variables.php"); + include("includes/qmn_adverts.php"); + include("includes/qmn_help.php"); include("includes/qmn_dashboard_widgets.php"); - include("includes/mlw_alerts.php"); + include("includes/qmn_alerts.php"); $this->alertManager = new MlwQmnAlertManager(); - include("includes/mlw_quiz_creator.php"); + include("includes/qmn_quiz_creator.php"); $this->quizCreator = new QMNQuizCreator(); } From 8c80b101c1946e14dfc9ba21938b290d17b69e2b Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 17:08:29 -0500 Subject: [PATCH 020/184] Moved fpdf content to own folder --- includes/{ => fpdf}/WriteHTML.php | 0 includes/{ => fpdf}/font/courier.php | 0 includes/{ => fpdf}/font/courierb.php | 0 includes/{ => fpdf}/font/courierbi.php | 0 includes/{ => fpdf}/font/courieri.php | 0 includes/{ => fpdf}/font/helvetica.php | 0 includes/{ => fpdf}/font/helveticab.php | 0 includes/{ => fpdf}/font/helveticabi.php | 0 includes/{ => fpdf}/font/helveticai.php | 0 includes/{ => fpdf}/font/symbol.php | 0 includes/{ => fpdf}/font/times.php | 0 includes/{ => fpdf}/font/timesb.php | 0 includes/{ => fpdf}/font/timesbi.php | 0 includes/{ => fpdf}/font/timesi.php | 0 includes/{ => fpdf}/font/zapfdingbats.php | 0 includes/{ => fpdf}/fpdf.php | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename includes/{ => fpdf}/WriteHTML.php (100%) rename includes/{ => fpdf}/font/courier.php (100%) rename includes/{ => fpdf}/font/courierb.php (100%) rename includes/{ => fpdf}/font/courierbi.php (100%) rename includes/{ => fpdf}/font/courieri.php (100%) rename includes/{ => fpdf}/font/helvetica.php (100%) rename includes/{ => fpdf}/font/helveticab.php (100%) rename includes/{ => fpdf}/font/helveticabi.php (100%) rename includes/{ => fpdf}/font/helveticai.php (100%) rename includes/{ => fpdf}/font/symbol.php (100%) rename includes/{ => fpdf}/font/times.php (100%) rename includes/{ => fpdf}/font/timesb.php (100%) rename includes/{ => fpdf}/font/timesbi.php (100%) rename includes/{ => fpdf}/font/timesi.php (100%) rename includes/{ => fpdf}/font/zapfdingbats.php (100%) rename includes/{ => fpdf}/fpdf.php (100%) diff --git a/includes/WriteHTML.php b/includes/fpdf/WriteHTML.php similarity index 100% rename from includes/WriteHTML.php rename to includes/fpdf/WriteHTML.php diff --git a/includes/font/courier.php b/includes/fpdf/font/courier.php similarity index 100% rename from includes/font/courier.php rename to includes/fpdf/font/courier.php diff --git a/includes/font/courierb.php b/includes/fpdf/font/courierb.php similarity index 100% rename from includes/font/courierb.php rename to includes/fpdf/font/courierb.php diff --git a/includes/font/courierbi.php b/includes/fpdf/font/courierbi.php similarity index 100% rename from includes/font/courierbi.php rename to includes/fpdf/font/courierbi.php diff --git a/includes/font/courieri.php b/includes/fpdf/font/courieri.php similarity index 100% rename from includes/font/courieri.php rename to includes/fpdf/font/courieri.php diff --git a/includes/font/helvetica.php b/includes/fpdf/font/helvetica.php similarity index 100% rename from includes/font/helvetica.php rename to includes/fpdf/font/helvetica.php diff --git a/includes/font/helveticab.php b/includes/fpdf/font/helveticab.php similarity index 100% rename from includes/font/helveticab.php rename to includes/fpdf/font/helveticab.php diff --git a/includes/font/helveticabi.php b/includes/fpdf/font/helveticabi.php similarity index 100% rename from includes/font/helveticabi.php rename to includes/fpdf/font/helveticabi.php diff --git a/includes/font/helveticai.php b/includes/fpdf/font/helveticai.php similarity index 100% rename from includes/font/helveticai.php rename to includes/fpdf/font/helveticai.php diff --git a/includes/font/symbol.php b/includes/fpdf/font/symbol.php similarity index 100% rename from includes/font/symbol.php rename to includes/fpdf/font/symbol.php diff --git a/includes/font/times.php b/includes/fpdf/font/times.php similarity index 100% rename from includes/font/times.php rename to includes/fpdf/font/times.php diff --git a/includes/font/timesb.php b/includes/fpdf/font/timesb.php similarity index 100% rename from includes/font/timesb.php rename to includes/fpdf/font/timesb.php diff --git a/includes/font/timesbi.php b/includes/fpdf/font/timesbi.php similarity index 100% rename from includes/font/timesbi.php rename to includes/fpdf/font/timesbi.php diff --git a/includes/font/timesi.php b/includes/fpdf/font/timesi.php similarity index 100% rename from includes/font/timesi.php rename to includes/fpdf/font/timesi.php diff --git a/includes/font/zapfdingbats.php b/includes/fpdf/font/zapfdingbats.php similarity index 100% rename from includes/font/zapfdingbats.php rename to includes/fpdf/font/zapfdingbats.php diff --git a/includes/fpdf.php b/includes/fpdf/fpdf.php similarity index 100% rename from includes/fpdf.php rename to includes/fpdf/fpdf.php From 3979af05c9912dbfe3bb5cee78b91914666db2dc Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 17:08:52 -0500 Subject: [PATCH 021/184] Moved js to own folder --- includes/{ => js}/jquery_sparkline.js | 0 includes/{ => js}/qmn_pagination.js | 0 includes/{ => js}/qmn_quiz.js | 0 includes/{ => js}/qmn_social_share.js | 0 includes/{ => js}/qmn_timer.js | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename includes/{ => js}/jquery_sparkline.js (100%) rename includes/{ => js}/qmn_pagination.js (100%) rename includes/{ => js}/qmn_quiz.js (100%) rename includes/{ => js}/qmn_social_share.js (100%) rename includes/{ => js}/qmn_timer.js (100%) diff --git a/includes/jquery_sparkline.js b/includes/js/jquery_sparkline.js similarity index 100% rename from includes/jquery_sparkline.js rename to includes/js/jquery_sparkline.js diff --git a/includes/qmn_pagination.js b/includes/js/qmn_pagination.js similarity index 100% rename from includes/qmn_pagination.js rename to includes/js/qmn_pagination.js diff --git a/includes/qmn_quiz.js b/includes/js/qmn_quiz.js similarity index 100% rename from includes/qmn_quiz.js rename to includes/js/qmn_quiz.js diff --git a/includes/qmn_social_share.js b/includes/js/qmn_social_share.js similarity index 100% rename from includes/qmn_social_share.js rename to includes/js/qmn_social_share.js diff --git a/includes/qmn_timer.js b/includes/js/qmn_timer.js similarity index 100% rename from includes/qmn_timer.js rename to includes/js/qmn_timer.js From 71ae84e70d80d26fd0c6256be40f945e5a246ae1 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 17:09:12 -0500 Subject: [PATCH 022/184] Moved css to own folder --- includes/{ => css}/qmn_quiz.css | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/{ => css}/qmn_quiz.css (100%) diff --git a/includes/qmn_quiz.css b/includes/css/qmn_quiz.css similarity index 100% rename from includes/qmn_quiz.css rename to includes/css/qmn_quiz.css From c9bfe905e743dacc6fc665b0f3b730f90cb64e08 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 17:09:35 -0500 Subject: [PATCH 023/184] Moved sparkline into own folder --- includes/js/{ => sparkline}/jquery_sparkline.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename includes/js/{ => sparkline}/jquery_sparkline.js (100%) diff --git a/includes/js/jquery_sparkline.js b/includes/js/sparkline/jquery_sparkline.js similarity index 100% rename from includes/js/jquery_sparkline.js rename to includes/js/sparkline/jquery_sparkline.js From 9709c79322cf71a6adbc5e6707b9be352ed6a7d1 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 17:14:57 -0500 Subject: [PATCH 024/184] Updated Sparkline URL --- includes/qmn_dashboard.php | 140 ++++++++++++++++++------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/includes/qmn_dashboard.php b/includes/qmn_dashboard.php index f7de6d8f7..95f6e4d04 100644 --- a/includes/qmn_dashboard.php +++ b/includes/qmn_dashboard.php @@ -2,7 +2,7 @@ /* This page creates the main dashboard for the Quiz Master Next plugin */ -/* +/* Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com) */ @@ -10,15 +10,15 @@ 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 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"); 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", 'My Local Webstop Services', "mlw_dashboard_box_six", "quiz_wpss6"); } 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"); @@ -34,7 +34,7 @@ function mlw_generate_quiz_dashboard() wp_enqueue_script( 'jquery-ui-button' ); wp_enqueue_script( 'jquery-ui-tooltip' ); ?> - +

Quiz Master Next Version Statistics

- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- + - +
- +
- +
- +
- +
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_quiz_taken_today = $wpdb->get_results($sql); $mlw_quiz_taken_today = $wpdb->num_rows; - + $mlw_yesterday = mktime(0, 0, 0, date("m") , date("d")-1, date("Y")); $mlw_yesterday = date("Y-m-d", $mlw_yesterday); $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_yesterday." 00:00:00' AND '".$mlw_yesterday." 23:59:59') AND deleted=0"; $mlw_quiz_taken_yesterday = $wpdb->get_results($sql); $mlw_quiz_taken_yesterday = $wpdb->num_rows; - + $mlw_two_days_ago = mktime(0, 0, 0, date("m") , date("d")-2, date("Y")); $mlw_two_days_ago = date("Y-m-d", $mlw_two_days_ago); $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_two_days_ago." 00:00:00' AND '".$mlw_two_days_ago." 23:59:59') AND deleted=0"; $mlw_quiz_taken_two_days = $wpdb->get_results($sql); $mlw_quiz_taken_two_days = $wpdb->num_rows; - + $mlw_three_days_ago = mktime(0, 0, 0, date("m") , date("d")-3, date("Y")); $mlw_three_days_ago = date("Y-m-d", $mlw_three_days_ago); $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_three_days_ago." 00:00:00' AND '".$mlw_three_days_ago." 23:59:59') AND deleted=0"; $mlw_quiz_taken_three_days = $wpdb->get_results($sql); $mlw_quiz_taken_three_days = $wpdb->num_rows; - + $mlw_four_days_ago = mktime(0, 0, 0, date("m") , date("d")-4, date("Y")); $mlw_four_days_ago = date("Y-m-d", $mlw_four_days_ago); $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_four_days_ago." 00:00:00' AND '".$mlw_four_days_ago." 23:59:59') AND deleted=0"; $mlw_quiz_taken_four_days = $wpdb->get_results($sql); $mlw_quiz_taken_four_days = $wpdb->num_rows; - + $mlw_five_days_ago = mktime(0, 0, 0, date("m") , date("d")-5, date("Y")); $mlw_five_days_ago = date("Y-m-d", $mlw_five_days_ago); $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_five_days_ago." 00:00:00' AND '".$mlw_five_days_ago." 23:59:59') AND deleted=0"; $mlw_quiz_taken_five_days = $wpdb->get_results($sql); $mlw_quiz_taken_five_days = $wpdb->num_rows; - + $mlw_six_days_ago = mktime(0, 0, 0, date("m") , date("d")-6, date("Y")); $mlw_six_days_ago = date("Y-m-d", $mlw_six_days_ago); $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_six_days_ago." 00:00:00' AND '".$mlw_six_days_ago." 23:59:59') AND deleted=0"; $mlw_quiz_taken_six_days = $wpdb->get_results($sql); $mlw_quiz_taken_six_days = $wpdb->num_rows; - + $mlw_last_week = mktime(0, 0, 0, date("m") , date("d")-7, date("Y")); $mlw_last_week = date("Y-m-d", $mlw_last_week); $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_week." 00:00:00' AND '".$mlw_last_week." 23:59:59') AND deleted=0"; @@ -158,16 +158,16 @@ function mlw_dashboard_box_three() { //Function Variables global $wpdb; - + //Stats From Quiz Table $mlw_stat_total_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes" ); $mlw_stat_total_deleted_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes WHERE deleted=1" ); $mlw_stat_total_active_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes WHERE deleted=0" ); - + //Stats From Question Table $mlw_stat_total_questions = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_questions" ); - - + + $sql = "SELECT SUM(quiz_views) AS QuizViews FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted=0"; $mlw_quiz_views = $wpdb->get_results($sql); @@ -183,7 +183,7 @@ function mlw_dashboard_box_three() $mlw_quiz_taken = $mlw_eaches->QuizTaken; break; } - + $sql = "SELECT ROUND(AVG(quiz_views), 0) AS AvgViews FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted=0"; $mlw_average_views = $wpdb->get_results($sql); @@ -191,7 +191,7 @@ function mlw_dashboard_box_three() $mlw_average_views = $mlw_eaches->AvgViews; break; } - + $sql = "SELECT ROUND(AVG(quiz_taken), 0) AS AvgTaken FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted=0"; $mlw_average_taken = $wpdb->get_results($sql); @@ -199,7 +199,7 @@ function mlw_dashboard_box_three() $mlw_average_taken = $mlw_eaches->AvgTaken; break; } - + $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted=0 ORDER BY quiz_views DESC LIMIT 1"; $mlw_quiz_most_viewed = $wpdb->get_results($sql); @@ -207,7 +207,7 @@ function mlw_dashboard_box_three() $mlw_quiz_most_viewed = $mlw_eaches->quiz_name; break; } - + $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted=0 ORDER BY quiz_taken DESC LIMIT 1"; $mlw_quiz_most_taken = $wpdb->get_results($sql); @@ -260,18 +260,18 @@ function mlw_dashboard_box_three()
-prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_this_week." 00:00:00' AND '".date("Y-m-d")." 23:59:59') AND deleted=0"; $mlw_quiz_taken_this_week = $wpdb->get_results($sql); $mlw_quiz_taken_this_week = $wpdb->num_rows; - + $mlw_last_week_first = mktime(0, 0, 0, date("m") , date("d")-13, date("Y")); $mlw_last_week_first = date("Y-m-d", $mlw_last_week_first); $mlw_last_week_last = mktime(0, 0, 0, date("m") , date("d")-7, date("Y")); @@ -279,7 +279,7 @@ function mlw_dashboard_box_four() $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_week_first." 00:00:00' AND '".$mlw_last_week_last." 23:59:59') AND deleted=0"; $mlw_quiz_taken_last_week = $wpdb->get_results($sql); $mlw_quiz_taken_last_week = $wpdb->num_rows; - + $mlw_two_week_first = mktime(0, 0, 0, date("m") , date("d")-20, date("Y")); $mlw_two_week_first = date("Y-m-d", $mlw_two_week_first); $mlw_two_week_last = mktime(0, 0, 0, date("m") , date("d")-14, date("Y")); @@ -287,7 +287,7 @@ function mlw_dashboard_box_four() $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_two_week_first." 00:00:00' AND '".$mlw_two_week_last." 23:59:59') AND deleted=0"; $mlw_quiz_taken_two_week = $wpdb->get_results($sql); $mlw_quiz_taken_two_week = $wpdb->num_rows; - + $mlw_three_week_first = mktime(0, 0, 0, date("m") , date("d")-27, date("Y")); $mlw_three_week_first = date("Y-m-d", $mlw_three_week_first); $mlw_three_week_last = mktime(0, 0, 0, date("m") , date("d")-21, date("Y")); @@ -304,13 +304,13 @@ function mlw_dashboard_box_four() function mlw_dashboard_box_five() { //Gather the monthly stats, one variable for each day for the graph - global $wpdb; + global $wpdb; $mlw_this_month = mktime(0, 0, 0, date("m") , date("d")-29, date("Y")); $mlw_this_month = date("Y-m-d", $mlw_this_month); $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_this_month." 00:00:00' AND '".date("Y-m-d")." 23:59:59') AND deleted=0"; $mlw_quiz_taken_this_month = $wpdb->get_results($sql); $mlw_quiz_taken_this_month = $wpdb->num_rows; - + $mlw_last_month_first = mktime(0, 0, 0, date("m") , date("d")-59, date("Y")); $mlw_last_month_first = date("Y-m-d", $mlw_last_month_first); $mlw_last_month_last = mktime(0, 0, 0, date("m") , date("d")-30, date("Y")); @@ -318,7 +318,7 @@ function mlw_dashboard_box_five() $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_month_first." 00:00:00' AND '".$mlw_last_month_last." 23:59:59') AND deleted=0"; $mlw_quiz_taken_last_month = $wpdb->get_results($sql); $mlw_quiz_taken_last_month = $wpdb->num_rows; - + $mlw_two_month_first = mktime(0, 0, 0, date("m") , date("d")-89, date("Y")); $mlw_two_month_first = date("Y-m-d", $mlw_two_month_first); $mlw_two_month_last = mktime(0, 0, 0, date("m") , date("d")-60, date("Y")); @@ -326,7 +326,7 @@ function mlw_dashboard_box_five() $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_two_month_first." 00:00:00' AND '".$mlw_two_month_last." 23:59:59') AND deleted=0"; $mlw_quiz_taken_two_month = $wpdb->get_results($sql); $mlw_quiz_taken_two_month = $wpdb->num_rows; - + $mlw_three_month_first = mktime(0, 0, 0, date("m") , date("d")-119, date("Y")); $mlw_three_month_first = date("Y-m-d", $mlw_three_month_first); $mlw_three_month_last = mktime(0, 0, 0, date("m") , date("d")-90, date("Y")); @@ -334,7 +334,7 @@ function mlw_dashboard_box_five() $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_three_month_first." 00:00:00' AND '".$mlw_three_month_last." 23:59:59') AND deleted=0"; $mlw_quiz_taken_three_month = $wpdb->get_results($sql); $mlw_quiz_taken_three_month = $wpdb->num_rows; - + $mlw_four_month_first = mktime(0, 0, 0, date("m") , date("d")-149, date("Y")); $mlw_four_month_first = date("Y-m-d", $mlw_four_month_first); $mlw_four_month_last = mktime(0, 0, 0, date("m") , date("d")-120, date("Y")); @@ -342,7 +342,7 @@ function mlw_dashboard_box_five() $sql = "SELECT quiz_name FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_four_month_first." 00:00:00' AND '".$mlw_four_month_last." 23:59:59') AND deleted=0"; $mlw_quiz_taken_four_month = $wpdb->get_results($sql); $mlw_quiz_taken_four_month = $wpdb->num_rows; - + ?>
@@ -357,7 +357,7 @@ function mlw_dashboard_box_six()

Plugin Premium Support

Get access to premium support and always be a priority in our support. We will provide technical support and even access your site to solve your problems. With premium support, we will answer your responses as quickly as possible and your feature requests will be priorities in our future updates.

For details, visit our Plugin Premium Support page.

-
+

Plugin Installation Services

We will install and configure any or all of our WordPress plugins on your existing WordPress site.

For details, visit our Plugin Installation page.

@@ -372,17 +372,17 @@ function mlw_dashboard_box_six() function mlw_qmn_weekly_percent_taken_widget() { global $wpdb; - + $mlw_this_week = mktime(0, 0, 0, date("m") , date("d")-6, date("Y")); $mlw_this_week = date("Y-m-d", $mlw_this_week); $mlw_qmn_this_week_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_this_week." 00:00:00' AND '".date("Y-m-d")." 23:59:59') AND deleted=0"); - + $mlw_last_week_start = mktime(0, 0, 0, date("m") , date("d")-13, date("Y")); $mlw_last_week_start = date("Y-m-d", $mlw_last_week_start); $mlw_last_week_end = mktime(0, 0, 0, date("m") , date("d")-7, date("Y")); $mlw_last_week_end = date("Y-m-d", $mlw_last_week_end); $mlw_qmn_last_week_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_week_start." 00:00:00' AND '".$mlw_last_week_end." 23:59:59') AND deleted=0"); - + if ($mlw_qmn_last_week_taken != 0) { $mlw_qmn_analyze_week = round((($mlw_qmn_this_week_taken - $mlw_qmn_last_week_taken) / $mlw_qmn_last_week_taken) * 100, 2); @@ -401,8 +401,8 @@ function mlw_qmn_weekly_percent_taken_widget()
- ".$mlw_qmn_analyze_week."%"; + ".$mlw_qmn_analyze_week."%"; if ($mlw_qmn_analyze_week >= 0) { echo ""; @@ -444,8 +444,8 @@ function mlw_qmn_daily_percent_taken_widget()
- ".$mlw_qmn_analyze_today."%"; + ".$mlw_qmn_analyze_today."%"; if ($mlw_qmn_analyze_today >= 0) { echo ""; @@ -465,17 +465,17 @@ function mlw_qmn_daily_percent_taken_widget() function mlw_qmn_monthly_percent_taken_widget() { global $wpdb; - + $mlw_this_month = mktime(0, 0, 0, date("m") , date("d")-29, date("Y")); $mlw_this_month = date("Y-m-d", $mlw_this_month); $mlw_qmn_this_month_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_this_month." 00:00:00' AND '".date("Y-m-d")." 23:59:59') AND deleted=0"); - + $mlw_last_month_start = mktime(0, 0, 0, date("m") , date("d")-59, date("Y")); $mlw_last_month_start = date("Y-m-d", $mlw_last_month_start); $mlw_last_month_end = mktime(0, 0, 0, date("m") , date("d")-30, date("Y")); $mlw_last_month_end = date("Y-m-d", $mlw_last_month_end); $mlw_qmn_last_month_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_month_start." 00:00:00' AND '".$mlw_last_month_end." 23:59:59') AND deleted=0"); - + if ($mlw_qmn_last_month_taken != 0) { $mlw_qmn_analyze_month = round((($mlw_qmn_this_month_taken - $mlw_qmn_last_month_taken) / $mlw_qmn_last_month_taken) * 100, 2); @@ -494,8 +494,8 @@ function mlw_qmn_monthly_percent_taken_widget()
- ".$mlw_qmn_analyze_month."%"; + ".$mlw_qmn_analyze_month."%"; if ($mlw_qmn_analyze_month >= 0) { echo ""; @@ -515,17 +515,17 @@ function mlw_qmn_monthly_percent_taken_widget() function mlw_qmn_quaterly_percent_taken_widget() { global $wpdb; - + $mlw_this_quater = mktime(0, 0, 0, date("m") , date("d")-89, date("Y")); $mlw_this_quater = date("Y-m-d", $mlw_this_quater); $mlw_qmn_this_quater_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_this_quater." 00:00:00' AND '".date("Y-m-d")." 23:59:59') AND deleted=0"); - + $mlw_last_quater_start = mktime(0, 0, 0, date("m") , date("d")-179, date("Y")); $mlw_last_quater_start = date("Y-m-d", $mlw_last_quater_start); $mlw_last_quater_end = mktime(0, 0, 0, date("m") , date("d")-90, date("Y")); $mlw_last_quater_end = date("Y-m-d", $mlw_last_quater_end); $mlw_qmn_last_quater_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_quater_start." 00:00:00' AND '".$mlw_last_quater_end." 23:59:59') AND deleted=0"); - + if ($mlw_qmn_last_quater_taken != 0) { $mlw_qmn_analyze_quater = round((($mlw_qmn_this_quater_taken - $mlw_qmn_last_quater_taken) / $mlw_qmn_last_quater_taken) * 100, 2); @@ -544,8 +544,8 @@ function mlw_qmn_quaterly_percent_taken_widget()
- ".$mlw_qmn_analyze_quater."%"; + ".$mlw_qmn_analyze_quater."%"; if ($mlw_qmn_analyze_quater >= 0) { echo ""; From c130e25a80c1fa1c3fb42fc8b9d6dc0eee503ae0 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 17:16:21 -0500 Subject: [PATCH 025/184] Updated JS/CSS Urls --- includes/qmn_quiz.php | 140 +++++++++++++++++++++--------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index 7d6c6842c..81dc05952 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -7,7 +7,7 @@ function mlw_quiz_shortcode($atts) extract(shortcode_atts(array( 'quiz' => 0 ), $atts)); - + global $mlwQuizMasterNext; $mlwQuizMasterNext->quizCreator->set_id($quiz); date_default_timezone_set(get_option('timezone_string')); @@ -15,7 +15,7 @@ function mlw_quiz_shortcode($atts) /* Code before loading the quiz */ - + //Variables needed throughout script $mlw_quiz_id = intval($quiz); $GLOBALS['mlw_qmn_quiz'] = $mlw_quiz_id; @@ -34,12 +34,12 @@ function mlw_quiz_shortcode($atts) $mlw_quiz_options = $mlw_eaches; break; } - + $mlw_qmn_quiz_options_array = array( 'quiz_name' => $mlw_quiz_options->quiz_name, 'quiz_id' => $mlw_quiz_options->quiz_id ); - + //Check if user is required to be checked in if ( $mlw_quiz_options->require_log_in == 1 && !is_user_logged_in() ) { @@ -51,9 +51,9 @@ function mlw_quiz_shortcode($atts) return $mlw_display; $mlw_qmn_isAllowed = false; } - + //Check if date is inside scheduled timeframe - if (is_serialized($mlw_quiz_options->scheduled_timeframe) && is_array(@unserialize($mlw_quiz_options->scheduled_timeframe))) + if (is_serialized($mlw_quiz_options->scheduled_timeframe) && is_array(@unserialize($mlw_quiz_options->scheduled_timeframe))) { $qmn_scheduled_timeframe = @unserialize($mlw_quiz_options->scheduled_timeframe); if ($qmn_scheduled_timeframe["start"] != '' && $qmn_scheduled_timeframe["end"] != '') @@ -67,11 +67,11 @@ function mlw_quiz_shortcode($atts) $mlw_message = str_replace( "\n" , "
", $mlw_message); $mlw_display = $mlw_message; return $mlw_display; - $mlw_qmn_isAllowed = false; + $mlw_qmn_isAllowed = false; } } } - + //Check to see if there is limit on the amount of tries if ( $mlw_quiz_options->total_user_tries != 0 && is_user_logged_in() ) { @@ -82,7 +82,7 @@ function mlw_quiz_shortcode($atts) //Load questions - $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' "; + $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' "; if ($mlw_quiz_options->randomness_order == 0) { $sql .= "ORDER BY question_order ASC"; @@ -96,12 +96,12 @@ function mlw_quiz_shortcode($atts) $sql .= " LIMIT ".$mlw_quiz_options->question_from_total; } $mlw_questions = $wpdb->get_results($sql); - - + + //Load and prepare answer arrays $mlw_qmn_answer_arrays = array(); foreach($mlw_questions as $mlw_question_info) { - if (is_serialized($mlw_question_info->answer_array) && is_array(@unserialize($mlw_question_info->answer_array))) + if (is_serialized($mlw_question_info->answer_array) && is_array(@unserialize($mlw_question_info->answer_array))) { $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array); $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each; @@ -132,7 +132,7 @@ function mlw_quiz_shortcode($atts) $mlw_qmn_timer = isset($_POST["timer"]) ? $_POST["timer"] : 0; $mlw_spam_email = $_POST["email"]; } - + wp_enqueue_script( 'json2' ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'jquery-ui-core' ); @@ -142,9 +142,9 @@ function mlw_quiz_shortcode($atts) wp_enqueue_script( 'jquery-ui-button' ); wp_enqueue_script( 'jquery-ui-tooltip' ); wp_enqueue_style( 'qmn_jquery_redmond_theme', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css' ); - - wp_enqueue_script( 'qmn_quiz', plugins_url( 'qmn_quiz.js' , __FILE__ ) ); - wp_enqueue_style( 'qmn_quiz_style', plugins_url( 'qmn_quiz.css' , __FILE__ ) ); + + wp_enqueue_script( 'qmn_quiz', plugins_url( 'js/qmn_quiz.js' , __FILE__ ) ); + wp_enqueue_style( 'qmn_quiz_style', plugins_url( 'css/qmn_quiz.css' , __FILE__ ) ); wp_enqueue_script( 'math_jax', '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' ); if ($mlw_quiz_options->theme_selected == "default") @@ -155,11 +155,11 @@ function mlw_quiz_shortcode($atts) { echo "theme_selected)."' rel='stylesheet' />"; } - + /* The following code is for displaying the quiz and completion screen */ - + //If there is no quiz for the shortcode provided if ($mlw_quiz_options->quiz_name == "") { @@ -194,10 +194,10 @@ function mlw_quiz_shortcode($atts) { $mlw_qmn_section_limit = $mlw_qmn_section_limit + 1; } - + //Gather text for pagination buttons $mlw_qmn_pagination_text = ""; - if (is_serialized($mlw_quiz_options->pagination_text) && is_array(@unserialize($mlw_quiz_options->pagination_text))) + if (is_serialized($mlw_quiz_options->pagination_text) && is_array(@unserialize($mlw_quiz_options->pagination_text))) { $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text); } @@ -213,7 +213,7 @@ function mlw_quiz_shortcode($atts) var qmn_pagination_next_text = ''; timer_limit != 0) { @@ -224,17 +224,17 @@ function mlw_quiz_shortcode($atts) var qmn_timer_limit = timer_limit; ?>; quiz_views; $mlw_views += 1; $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views='".$mlw_views."' WHERE quiz_id=".$mlw_quiz_id; $results = $wpdb->query( $update ); - + if ( $mlw_quiz_options->pagination != 0) { $mlw_display .= ""; } - + //Begin the quiz $mlw_display .= "
"; $mlw_display .= "
"; @@ -250,10 +250,10 @@ function mlw_quiz_shortcode($atts) $mlw_display .= mlwDisplayContactInfo($mlw_quiz_options); } $mlw_display .= "
"; - + //Display the questions foreach($mlw_questions as $mlw_question) { - if (is_serialized($mlw_question->question_settings) && is_array(@unserialize($mlw_question->question_settings))) + if (is_serialized($mlw_question->question_settings) && is_array(@unserialize($mlw_question->question_settings))) { $mlw_question_settings = @unserialize($mlw_question->question_settings); } @@ -554,7 +554,7 @@ function mlw_quiz_shortcode($atts) $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
"; if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredText";} else {$mlw_requireClass = "";} $mlw_display .= ""; - $mlw_display .= "
"; + $mlw_display .= "
"; } if ($mlw_question->comments == 0) { @@ -574,7 +574,7 @@ function mlw_quiz_shortcode($atts) $mlw_display .= "
"; if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "
"; } } - + //Display comment box if needed if ($mlw_quiz_options->comment_section == 0) { @@ -615,14 +615,14 @@ function mlw_quiz_shortcode($atts) $mlw_display .= ""; $mlw_display .= "
"; $mlw_display .= "
"; - + } //Display Completion Screen else { $mlw_display .= "
"; $mlw_display .= ""; ?> @@ -309,7 +309,7 @@ function mlw_generate_result_details()

Help

You are getting this error page because this page could not find the results.

You must go to the Quiz Results page and click on the result you want to see from that table.

-
+
Date: Fri, 2 Jan 2015 23:03:14 -0500 Subject: [PATCH 028/184] Moved Questions Tab Functions To Own File --- includes/qmn_options_questions_tab.php | 765 +++++++++++++++++++++++++ 1 file changed, 765 insertions(+) create mode 100644 includes/qmn_options_questions_tab.php diff --git a/includes/qmn_options_questions_tab.php b/includes/qmn_options_questions_tab.php new file mode 100644 index 000000000..9f7acdb7f --- /dev/null +++ b/includes/qmn_options_questions_tab.php @@ -0,0 +1,765 @@ +Questions"; +} + +function mlw_options_questions_tab_content() +{ + global $wpdb; + global $mlwQuizMasterNext; + $quiz_id = $_GET["quiz_id"]; + + //Edit question + if ( isset($_POST["edit_question"]) && $_POST["edit_question"] == "confirmation") + { + //Variables from edit question form + $edit_question_name = trim(preg_replace('/\s+/',' ', nl2br(htmlspecialchars($_POST["edit_question_name"], ENT_QUOTES)))); + $edit_question_answer_info = $_POST["edit_correct_answer_info"]; + $mlw_edit_question_id = intval($_POST["edit_question_id"]); + $mlw_edit_question_type = $_POST["edit_question_type"]; + $edit_comments = htmlspecialchars($_POST["edit_comments"], ENT_QUOTES); + $edit_hint = htmlspecialchars($_POST["edit_hint"], ENT_QUOTES); + $edit_question_order = intval($_POST["edit_question_order"]); + $mlw_edit_answer_total = intval($_POST["question_".$mlw_edit_question_id."_answer_total"]); + $mlw_row_settings = $wpdb->get_row( $wpdb->prepare( "SELECT question_settings FROM " . $wpdb->prefix . "mlw_questions" . " WHERE question_id=%d", $mlw_edit_question_id ) ); + if (is_serialized($mlw_row_settings->question_settings) && is_array(@unserialize($mlw_row_settings->question_settings))) + { + $mlw_settings = @unserialize($mlw_row_settings->question_settings); + } + else + { + $mlw_settings = array(); + $mlw_settings['required'] = intval($_POST["edit_required"]); + } + if ( !isset($mlw_settings['required'])) + { + $mlw_settings['required'] = intval($_POST["edit_required"]); + } + $mlw_settings['required'] = intval($_POST["edit_required"]); + $mlw_settings = serialize($mlw_settings); + $i = 1; + $mlw_qmn_new_answer_array = array(); + while ($i <= $mlw_edit_answer_total) + { + if ($_POST["edit_answer_".$i] != "") + { + $mlw_qmn_correct = 0; + if (isset($_POST["edit_answer_".$i."_correct"]) && $_POST["edit_answer_".$i."_correct"] == 1) + { + $mlw_qmn_correct = 1; + } + $mlw_qmn_answer_each = array(htmlspecialchars(stripslashes($_POST["edit_answer_".$i]), ENT_QUOTES), floatval($_POST["edit_answer_".$i."_points"]), $mlw_qmn_correct); + $mlw_qmn_new_answer_array[] = $mlw_qmn_answer_each; + } + $i++; + } + $mlw_qmn_new_answer_array = serialize($mlw_qmn_new_answer_array); + $quiz_id = $_POST["quiz_id"]; + + $update = "UPDATE " . $wpdb->prefix . "mlw_questions" . " SET question_name='".$edit_question_name."',answer_array='".$mlw_qmn_new_answer_array."', question_answer_info='".$edit_question_answer_info."', comments='".$edit_comments."', hints='".$edit_hint."', question_order='".$edit_question_order."', question_type='".$mlw_edit_question_type."', question_settings='".$mlw_settings."' WHERE question_id=".$mlw_edit_question_id; + $results = $wpdb->query( $update ); + if ($results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The question has been updated successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Question Has Been Edited: ".$edit_question_name."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0004.', 'error'); + } + } + //Delete question from quiz + if ( isset($_POST["delete_question"]) && $_POST["delete_question"] == "confirmation") + { + //Variables from delete question form + $mlw_question_id = intval($_POST["question_id"]); + $quiz_id = $_POST["quiz_id"]; + + $update = "UPDATE " . $wpdb->prefix . "mlw_questions" . " SET deleted=1 WHERE question_id=".$mlw_question_id; + $results = $wpdb->query( $update ); + if ($results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The question has been deleted successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Question Has Been Deleted: ".$mlw_question_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0005.', 'error'); + } + } + + //Duplicate Questions + if ( isset($_POST["duplicate_question"]) && $_POST["duplicate_question"] == "confirmation") + { + //Variables from delete question form + $mlw_question_id = intval($_POST["duplicate_question_id"]); + $quiz_id = $_POST["quiz_id"]; + + $mlw_original = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."mlw_questions WHERE question_id=%d", $mlw_question_id ), ARRAY_A ); + + $results = $wpdb->insert( + $wpdb->prefix."mlw_questions", + array( + 'quiz_id' => $mlw_original['quiz_id'], + 'question_name' => $mlw_original['question_name'], + 'answer_array' => $mlw_original['answer_array'], + 'answer_one' => $mlw_original['answer_one'], + 'answer_one_points' => $mlw_original['answer_one_points'], + 'answer_two' => $mlw_original['answer_two'], + 'answer_two_points' => $mlw_original['answer_two_points'], + 'answer_three' => $mlw_original['answer_three'], + 'answer_three_points' => $mlw_original['answer_three_points'], + 'answer_four' => $mlw_original['answer_four'], + 'answer_four_points' => $mlw_original['answer_four_points'], + 'answer_five' => $mlw_original['answer_five'], + 'answer_five_points' => $mlw_original['answer_five_points'], + 'answer_six' => $mlw_original['answer_six'], + 'answer_six_points' => $mlw_original['answer_six_points'], + 'correct_answer' => $mlw_original['correct_answer'], + 'question_answer_info' => $mlw_original['question_answer_info'], + 'comments' => $mlw_original['comments'], + 'hints' => $mlw_original['hints'], + 'question_order' => $mlw_original['question_order'], + 'question_type' => $mlw_original['question_type'], + 'question_settings' => $mlw_original['question_settings'], + 'deleted' => $mlw_original['deleted'] + ), + array( + '%d', + '%s', + '%s', + '%s', + '%d', + '%s', + '%d', + '%s', + '%d', + '%s', + '%d', + '%s', + '%d', + '%s', + '%d', + '%d', + '%s', + '%d', + '%s', + '%d', + '%d', + '%s', + '%d' + ) + ); + + if ($results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The question has been duplicated successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Question Has Been Duplicated: ".$mlw_question_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0019.', 'error'); + } + } + + //Submit new question into database + if ( isset($_POST["create_question"]) && $_POST["create_question"] == "confirmation") + { + //Variables from new question form + $question_name = trim(preg_replace('/\s+/',' ', nl2br(htmlspecialchars($_POST["question_name"], ENT_QUOTES)))); + $question_answer_info = $_POST["correct_answer_info"]; + $question_type = $_POST["question_type"]; + $comments = htmlspecialchars($_POST["comments"], ENT_QUOTES); + $hint = htmlspecialchars($_POST["hint"], ENT_QUOTES); + $new_question_order = intval($_POST["new_question_order"]); + $mlw_answer_total = intval($_POST["new_question_answer_total"]); + $mlw_settings = array(); + $mlw_settings['required'] = intval($_POST["required"]); + $mlw_settings = serialize($mlw_settings); + $i = 1; + $mlw_qmn_new_answer_array = array(); + while ($i <= $mlw_answer_total) + { + if ($_POST["answer_".$i] != "") + { + $mlw_qmn_correct = 0; + if (isset($_POST["answer_".$i."_correct"]) && $_POST["answer_".$i."_correct"] == 1) + { + $mlw_qmn_correct = 1; + } + $mlw_qmn_answer_each = array(htmlspecialchars(stripslashes($_POST["answer_".$i]), ENT_QUOTES), floatval($_POST["answer_".$i."_points"]), $mlw_qmn_correct); + $mlw_qmn_new_answer_array[] = $mlw_qmn_answer_each; + } + $i++; + } + $mlw_qmn_new_answer_array = serialize($mlw_qmn_new_answer_array); + $quiz_id = $_POST["quiz_id"]; + $table_name = $wpdb->prefix . "mlw_questions"; + $insert = "INSERT INTO " . $table_name . + " (question_id, quiz_id, question_name, answer_array, question_answer_info, comments, hints, question_order, question_type, question_settings, deleted) VALUES (NULL , ".$quiz_id.", '" . $question_name . "' , '".$mlw_qmn_new_answer_array."', '".$question_answer_info."', '".$comments."', '".$hint."', ".$new_question_order.", '".$question_type."', '".$mlw_settings."', 0)"; + $results = $wpdb->query( $insert ); + if ($results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The question has been created successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Question Has Been Added: ".$question_name."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0006.', 'error'); + } + } + + if (isset($_GET["quiz_id"])) + { + $table_name = $wpdb->prefix . "mlw_quizzes"; + $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); + } + $mlw_qmn_table_limit = 10; + $mlw_qmn_question_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(question_id) FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted='0'", $quiz_id ) ); + + if( isset($_GET{'mlw_question_page'} ) ) + { + $mlw_qmn_question_page = $_GET{'mlw_question_page'} + 1; + $mlw_qmn_question_begin = $mlw_qmn_table_limit * $mlw_qmn_question_page ; + } + else + { + $mlw_qmn_question_page = 0; + $mlw_qmn_question_begin = 0; + } + $mlw_qmn_question_left = $mlw_qmn_question_count - ($mlw_qmn_question_page * $mlw_qmn_table_limit); + + $mlw_question_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted='0' + ORDER BY question_order ASC LIMIT %d, %d", $quiz_id, $mlw_qmn_question_begin, $mlw_qmn_table_limit ) ); + + //Load and prepare answer arrays + $mlw_qmn_answer_arrays = array(); + foreach($mlw_question_data as $mlw_question_info) { + if (is_serialized($mlw_question_info->answer_array) && is_array(@unserialize($mlw_question_info->answer_array))) + { + $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array); + $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each; + } + else + { + $mlw_answer_array_correct = array(0, 0, 0, 0, 0, 0); + $mlw_answer_array_correct[$mlw_question_info->correct_answer-1] = 1; + $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = array( + array($mlw_question_info->answer_one, $mlw_question_info->answer_one_points, $mlw_answer_array_correct[0]), + array($mlw_question_info->answer_two, $mlw_question_info->answer_two_points, $mlw_answer_array_correct[1]), + array($mlw_question_info->answer_three, $mlw_question_info->answer_three_points, $mlw_answer_array_correct[2]), + array($mlw_question_info->answer_four, $mlw_question_info->answer_four_points, $mlw_answer_array_correct[3]), + array($mlw_question_info->answer_five, $mlw_question_info->answer_five_points, $mlw_answer_array_correct[4]), + array($mlw_question_info->answer_six, $mlw_question_info->answer_six_points, $mlw_answer_array_correct[5])); + } + } + $is_new_quiz = $wpdb->num_rows; + ?> +
+ + + +
+ question_settings) && is_array(@unserialize($mlw_question_info->question_settings))) + { + $mlw_question_settings = @unserialize($mlw_question_info->question_settings); + } + else + { + $mlw_question_settings = array(); + $mlw_question_settings['required'] = 1; + } + $mlw_question_type_text = ""; + switch ($mlw_question_info->question_type) { + case 0: + $mlw_question_type_text = "Multiple Choice"; + break; + case 1: + $mlw_question_type_text = "Horizontal Multiple Choice"; + break; + case 2: + $mlw_question_type_text = "Drop Down"; + break; + case 3: + $mlw_question_type_text = "Small Open Answer"; + break; + case 4: + $mlw_question_type_text = "Multiple Response"; + break; + case 5: + $mlw_question_type_text = "Large Open Answer"; + break; + case 6: + $mlw_question_type_text = "Text Block"; + break; + case 7: + $mlw_question_type_text = "Number"; + break; + case 8: + $mlw_question_type_text = "Accept"; + break; + case 9: + $mlw_question_type_text = "Captcha"; + break; + case 10: + $mlw_question_type_text = "Horizontal Multiple Response"; + break; + default: + $mlw_question_type_text = "Error Code "; + } + if($alternate) $alternate = ""; + else $alternate = " class=\"alternate\""; + $question_list .= ""; + $question_list .= "" . $mlw_question_info->question_order . ""; + $question_list .= "" . $mlw_question_type_text . ""; + $question_list .= "" . $mlw_question_info->question_name .""; + $question_list .= ""; + + + $mlw_question_answer_array = $mlw_qmn_answer_arrays[$mlw_question_info->question_id]; + ?> + + + 0 ) + { + $mlw_qmn_previous_page = $mlw_qmn_question_page - 2; + $display .= "Previous 10 Questions"; + if( $mlw_qmn_question_left > $mlw_qmn_table_limit ) + { + $display .= "Next 10 Questions"; + } + } + else if( $mlw_qmn_question_page == 0 ) + { + if( $mlw_qmn_question_left > $mlw_qmn_table_limit ) + { + $display .= "Next 10 Questions"; + } + } + else if( $mlw_qmn_question_left < $mlw_qmn_table_limit ) + { + $mlw_qmn_previous_page = $mlw_qmn_question_page - 2; + $display .= "Previous 10 Questions"; + } + $display .= ""; + $display .= " + + + + "; + $display .= "{$question_list}"; + $display .= " + + + + "; + $display .= "
Question OrderQuestion TypeQuestion
Question OrderQuestion TypeQuestion
"; + echo $display; + ?> + + + + + + +
+ From 5234bd03cd25897a2ecfe99880470ed1c78b6118 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:05:11 -0500 Subject: [PATCH 029/184] Moved Text Tab Functions To Own File --- includes/qmn_options_text_tab.php | 310 ++++++++++++++++++++++++++++++ 1 file changed, 310 insertions(+) create mode 100644 includes/qmn_options_text_tab.php diff --git a/includes/qmn_options_text_tab.php b/includes/qmn_options_text_tab.php new file mode 100644 index 000000000..a3d7c6b70 --- /dev/null +++ b/includes/qmn_options_text_tab.php @@ -0,0 +1,310 @@ +Text"; +} + +function mlw_options_text_tab_content() +{ + global $wpdb; + global $mlwQuizMasterNext; + $quiz_id = $_GET["quiz_id"]; + //Submit saved templates into database + if ( isset($_POST["save_templates"]) && $_POST["save_templates"] == "confirmation") + { + //Variables for save templates form + $mlw_before_message = htmlspecialchars($_POST["mlw_quiz_before_message"], ENT_QUOTES); + $mlw_qmn_message_end = htmlspecialchars($_POST["message_end_template"], ENT_QUOTES); + $mlw_user_tries_text = htmlspecialchars($_POST["mlw_quiz_total_user_tries_text"], ENT_QUOTES); + $mlw_submit_button_text = htmlspecialchars($_POST["mlw_submitText"], ENT_QUOTES); + $mlw_name_field_text = htmlspecialchars($_POST["mlw_nameText"], ENT_QUOTES); + $mlw_business_field_text = htmlspecialchars($_POST["mlw_businessText"], ENT_QUOTES); + $mlw_email_field_text = htmlspecialchars($_POST["mlw_emailText"], ENT_QUOTES); + $mlw_phone_field_text = htmlspecialchars($_POST["mlw_phoneText"], ENT_QUOTES); + $mlw_before_comments = htmlspecialchars($_POST["mlw_quiz_before_comments"], ENT_QUOTES); + $mlw_comment_field_text = htmlspecialchars($_POST["mlw_commentText"], ENT_QUOTES); + $mlw_require_log_in_text = htmlspecialchars($_POST["mlw_require_log_in_text"], ENT_QUOTES); + $mlw_scheduled_timeframe_text = htmlspecialchars($_POST["mlw_scheduled_timeframe_text"], ENT_QUOTES); + $mlw_limit_total_entries_text = htmlspecialchars($_POST["mlw_limit_total_entries_text"], ENT_QUOTES); + $mlw_qmn_pagination_field = serialize(array( $_POST["pagination_prev_text"], $_POST["pagination_next_text"] )); + $qmn_social_media_text = serialize(array('twitter' => $_POST["mlw_quiz_twitter_text_template"], 'facebook' => $_POST["mlw_quiz_facebook_text_template"])); + $mlw_email_from_text = $_POST["emailFromText"]; + $mlw_question_answer_template = htmlspecialchars($_POST["mlw_quiz_question_answer_template"], ENT_QUOTES); + $quiz_id = $_POST["quiz_id"]; + + $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; + $results = $wpdb->query( $update ); + if ($results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The templates has been updated successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Templates Have Been Edited For Quiz Number ".$quiz_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0007.', 'error'); + } + } + + if (isset($_GET["quiz_id"])) + { + $table_name = $wpdb->prefix . "mlw_quizzes"; + $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); + } + + //Load Pagination Text + $mlw_qmn_pagination_text = ""; + if (is_serialized($mlw_quiz_options->pagination_text) && is_array(@unserialize($mlw_quiz_options->pagination_text))) + { + $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text); + } + else + { + $mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text); + } + + //Load Social Media Text + $qmn_social_media_text = ""; + if (is_serialized($mlw_quiz_options->social_media_text) && is_array(@unserialize($mlw_quiz_options->social_media_text))) + { + $qmn_social_media_text = @unserialize($mlw_quiz_options->social_media_text); + } + else + { + $qmn_social_media_text = array( + 'twitter' => $mlw_quiz_options->social_media_text, + 'facebook' => $mlw_quiz_options->social_media_text + ); + } + ?> +
+

Template Variables

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
%POINT_SCORE% - Total points user earned when taking quiz%AVERAGE_POINT% - The average amount of points user had per question
%AMOUNT_CORRECT% - The number of correct answers the user had%TOTAL_QUESTIONS% - The total number of questions in the quiz
%CORRECT_SCORE% - The percent score for the quiz showing percent of total quetions answered correctly
%USER_NAME% - The name the user entered before the quiz%USER_BUSINESS% - The business the user entered before the quiz
%USER_PHONE% - The phone number the user entered before the quiz%USER_EMAIL% - The email the user entered before the quiz
%QUIZ_NAME% - The name of the quiz%QUESTIONS_ANSWERS% - Shows the question, the answer the user provided, and the correct answer
%COMMENT_SECTION% - The comments the user entered into comment box if enabled%QUESTION% - The question that the user answered
%USER_ANSWER% - The answer the user gave for the question%CORRECT_ANSWER% - The correct answer for the question
%USER_COMMENTS% - The comments the user provided in the comment field for the question%CORRECT_ANSWER_INFO% - Reason why the correct answer is the correct answer
%TIMER% - The amount of time user spent of quiz%CERTIFICATE_LINK% - The link to the certificate after completing the quiz
%CURRENT_DATE% - The Current Date
+ + "; + echo ""; + echo ""; + ?> +

Message Templates

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Message Displayed Before Quiz +
+

Allowed Variables:

+

- %QUIZ_NAME%

+

- %CURRENT_DATE%

+
message_before, ENT_QUOTES), 'mlw_quiz_before_message' ); ?>
+ Message Displayed Before Comments Box If Enabled +
+

Allowed Variables:

+

- %QUIZ_NAME%

+

- %CURRENT_DATE%

+
message_comment, ENT_QUOTES), 'mlw_quiz_before_comments' ); ?>
+ Message Displayed At End Of Quiz (Leave Blank To Omit Text Section) +
+

Allowed Variables:

+

- %QUIZ_NAME%

+

- %CURRENT_DATE%

+
message_end_template, ENT_QUOTES), 'message_end_template' ); ?>
+ Message Displayed If User Has Tried Quiz Too Many Times +
+

Allowed Variables:

+

- %QUIZ_NAME%

+

- %CURRENT_DATE%

+
total_user_tries_text, ENT_QUOTES), 'mlw_quiz_total_user_tries_text' ); ?>
+ Message Displayed If User Is Not Logged In And Quiz Requires Users To Be Logged In +
+

Allowed Variables:

+

- %QUIZ_NAME%

+

- %CURRENT_DATE%

+
require_log_in_text, ENT_QUOTES), 'mlw_require_log_in_text' ); ?>
+ Message Displayed If Date Is Outside Scheduled Timeframe +
+

Allowed Variables:

+

- %QUIZ_NAME%

+

- %CURRENT_DATE%

+
scheduled_timeframe_text, ENT_QUOTES), 'mlw_scheduled_timeframe_text' ); ?>
+ Message Displayed If The Limit Of Total Entries Has Been Reached +
+

Allowed Variables:

+

- %QUIZ_NAME%

+

- %CURRENT_DATE%

+
limit_total_entries_text, ENT_QUOTES), 'mlw_limit_total_entries_text' ); ?>
+ %QUESTIONS_ANSWERS% Text +
+

Allowed Variables:

+

- %QUESTION%

+

- %USER_ANSWER%

+

- %CORRECT_ANSWER%

+

- %USER_COMMENTS%

+

- %CORRECT_ANSWER_INFO%

+
question_answer_template, ENT_QUOTES), 'mlw_quiz_question_answer_template' ); ?>
+ Twitter Sharing Text +
+

Allowed Variables:

+

- %POINT_SCORE%

+

- %AVERAGE_POINT%

+

- %AMOUNT_CORRECT%

+

- %TOTAL_QUESTIONS%

+

- %CORRECT_SCORE%

+

- %QUIZ_NAME%

+

- %TIMER%

+

- %CURRENT_DATE%

+
+ Facebook Sharing Text +
+

Allowed Variables:

+

- %POINT_SCORE%

+

- %AVERAGE_POINT%

+

- %AMOUNT_CORRECT%

+

- %TOTAL_QUESTIONS%

+

- %CORRECT_SCORE%

+

- %QUIZ_NAME%

+

- %TIMER%

+

- %CURRENT_DATE%

+
+

Other Templates

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + "; ?> +
+ From 94e840221f7ffed7896ef2a9e263551dad9d95f0 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:06:03 -0500 Subject: [PATCH 030/184] Moved Options Tab Function To Own File --- includes/qmn_options_option_tab.php | 223 ++++++++++++++++++++++++++++ 1 file changed, 223 insertions(+) create mode 100644 includes/qmn_options_option_tab.php diff --git a/includes/qmn_options_option_tab.php b/includes/qmn_options_option_tab.php new file mode 100644 index 000000000..e804119fe --- /dev/null +++ b/includes/qmn_options_option_tab.php @@ -0,0 +1,223 @@ +Options"; +} + +function mlw_options_option_tab_content() +{ + global $wpdb; + global $mlwQuizMasterNext; + $quiz_id = $_GET["quiz_id"]; + //Submit saved options into database + if ( isset($_POST["save_options"]) && $_POST["save_options"] == "confirmation") + { + //Variables for save options form + $mlw_system = $_POST["system"]; + $mlw_qmn_pagination = intval($_POST["pagination"]); + $mlw_qmn_social_media = intval($_POST["social_media"]); + $mlw_qmn_question_numbering = intval($_POST["question_numbering"]); + $mlw_qmn_timer = intval($_POST["timer_limit"]); + $mlw_qmn_questions_from_total = $_POST["question_from_total"]; + $mlw_randomness_order = $_POST["randomness_order"]; + $mlw_total_user_tries = intval($_POST["total_user_tries"]); + $mlw_require_log_in = $_POST["require_log_in"]; + $mlw_limit_total_entries = $_POST["limit_total_entries"]; + $mlw_contact_location = $_POST["contact_info_location"]; + $mlw_user_name = $_POST["userName"]; + $mlw_user_comp = $_POST["userComp"]; + $mlw_user_email = $_POST["userEmail"]; + $mlw_user_phone = $_POST["userPhone"]; + $mlw_comment_section = $_POST["commentSection"]; + $mlw_qmn_loggedin_contact = $_POST["loggedin_user_contact"]; + $qmn_scheduled_timeframe = serialize(array("start" => $_POST["scheduled_time_start"], "end" => $_POST["scheduled_time_end"])); + $quiz_id = $_POST["quiz_id"]; + + $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET system='".$mlw_system."', loggedin_user_contact='".$mlw_qmn_loggedin_contact."', contact_info_location=".$mlw_contact_location.", user_name='".$mlw_user_name."', user_comp='".$mlw_user_comp."', user_email='".$mlw_user_email."', user_phone='".$mlw_user_phone."', comment_section='".$mlw_comment_section."', randomness_order='".$mlw_randomness_order."', question_from_total=".$mlw_qmn_questions_from_total.", total_user_tries=".$mlw_total_user_tries.", social_media=".$mlw_qmn_social_media.", pagination=".$mlw_qmn_pagination.", timer_limit=".$mlw_qmn_timer.", question_numbering=".$mlw_qmn_question_numbering.", require_log_in=".$mlw_require_log_in.", limit_total_entries=".$mlw_limit_total_entries.", last_activity='".date("Y-m-d H:i:s")."', scheduled_timeframe='".$qmn_scheduled_timeframe."' WHERE quiz_id=".$quiz_id; + $results = $wpdb->query( $update ); + if ($results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The options has been updated successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Options Have Been Edited For Quiz Number ".$quiz_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0008.', 'error'); + } + } + + if (isset($_GET["quiz_id"])) + { + $table_name = $wpdb->prefix . "mlw_quizzes"; + $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); + } + + //Load Scheduled Timeframe + $qmn_scheduled_timeframe = ""; + if (is_serialized($mlw_quiz_options->scheduled_timeframe) && is_array(@unserialize($mlw_quiz_options->scheduled_timeframe))) + { + $qmn_scheduled_timeframe = @unserialize($mlw_quiz_options->scheduled_timeframe); + } + else + { + $qmn_scheduled_timeframe = array("start" => '', "end" => ''); + } + ?> +
+ + + "; + echo ""; + echo ""; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ system == 0) {echo 'checked="checked"';} ?> value='0' /> + system == 1) {echo 'checked="checked"';} ?> value='1' /> + system == 2) {echo 'checked="checked"';} ?> value='2' /> +
+ require_log_in == 1) {echo 'checked="checked"';} ?> value='1' /> + require_log_in == 0) {echo 'checked="checked"';} ?> value='0' /> +
+ +
+ +
+ +
+ +
+ +
+ " class="regular-text" /> + + " class="regular-text" /> +
+ randomness_order == 1) {echo 'checked="checked"';} ?> value='1' /> + randomness_order == 2) {echo 'checked="checked"';} ?> value='2' /> + randomness_order == 0) {echo 'checked="checked"';} ?> value='0' /> +
+ contact_info_location == 0) {echo 'checked="checked"';} ?> value='0' /> + contact_info_location == 1) {echo 'checked="checked"';} ?> value='1' /> +
+ loggedin_user_contact == 0) {echo 'checked="checked"';} ?> value='0' /> + loggedin_user_contact == 1) {echo 'checked="checked"';} ?> value='1' /> +
+ user_name == 0) {echo 'checked="checked"';} ?> value='0' /> + user_name == 1) {echo 'checked="checked"';} ?> value='1' /> + user_name == 2) {echo 'checked="checked"';} ?> value='2' /> +
+ user_comp == 0) {echo 'checked="checked"';} ?> value='0' /> + user_comp == 1) {echo 'checked="checked"';} ?> value='1' /> + user_comp == 2) {echo 'checked="checked"';} ?> value='2' /> +
+ user_email == 0) {echo 'checked="checked"';} ?> value='0' /> + user_email == 1) {echo 'checked="checked"';} ?> value='1'/> + user_email == 2) {echo 'checked="checked"';} ?> value='2' /> +
+ user_phone == 0) {echo 'checked="checked"';} ?> value='0' /> + user_phone == 1) {echo 'checked="checked"';} ?> value='1' /> + user_phone == 2) {echo 'checked="checked"';} ?> value='2' /> +
+ comment_section == 0) {echo 'checked="checked"';} ?> value='0' /> + comment_section == 1) {echo 'checked="checked"';} ?> value='1' /> +
+ question_numbering == 1) {echo 'checked="checked"';} ?> value='1' /> + question_numbering == 0) {echo 'checked="checked"';} ?> value='0' /> +
+ social_media == 1) {echo 'checked="checked"';} ?> value='1' /> + social_media == 0) {echo 'checked="checked"';} ?> value='0' /> +
+ + "; ?> +
+ From 6790f8409d9052b7a36f1bf50a77baf22e431e2a Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:06:54 -0500 Subject: [PATCH 031/184] Moved Leaderboard Tab Function To Own File --- includes/qmn_options_leaderboard_tab.php | 110 +++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 includes/qmn_options_leaderboard_tab.php diff --git a/includes/qmn_options_leaderboard_tab.php b/includes/qmn_options_leaderboard_tab.php new file mode 100644 index 000000000..f32d8faee --- /dev/null +++ b/includes/qmn_options_leaderboard_tab.php @@ -0,0 +1,110 @@ +Leaderboard"; +} + +function mlw_options_leaderboard_tab_content() +{ + global $wpdb; + global $mlwQuizMasterNext; + $quiz_id = $_GET["quiz_id"]; + ///Submit saved leaderboard template into database + if ( isset($_POST["save_leaderboard_options"]) && $_POST["save_leaderboard_options"] == "confirmation") + { + ///Variables for save leaderboard options form + $mlw_leaderboard_template = $_POST["mlw_quiz_leaderboard_template"]; + $mlw_leaderboard_quiz_id = $_POST["leaderboard_quiz_id"]; + $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET leaderboard_template='".$mlw_leaderboard_template."', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=".$mlw_leaderboard_quiz_id; + $results = $wpdb->query( $update ); + if ($results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The leaderboards has been updated successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Leaderboard Options Have Been Edited For Quiz Number ".$mlw_leaderboard_quiz_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0009.', 'error'); + } + } + + if (isset($_GET["quiz_id"])) + { + $table_name = $wpdb->prefix . "mlw_quizzes"; + $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); + } + ?> +
+

Template Variables

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
%FIRST_PLACE_NAME% - The name of the user who is in first place%FIRST_PLACE_SCORE% - The score from the first place's quiz
%SECOND_PLACE_NAME% - The name of the user who is in second place%SECOND_PLACE_SCORE% - The score from the second place's quiz
%THIRD_PLACE_NAME% - The name of the user who is in third place%THIRD_PLACE_SCORE% - The score from the third place's quiz
%FOURTH_PLACE_NAME% - The name of the user who is in fourth place%FOURTH_PLACE_SCORE% - The score from the fourth place's quiz
%FIFTH_PLACE_NAME% - The name of the user who is in fifth place%FIFTH_PLACE_SCORE% - The score from the fifth place's quiz
%QUIZ_NAME% - The name of the quiz
+ + "; + echo ""; + echo ""; + ?> + + + + + +
+ Leaderboard Template +
+

Allowed Variables:

+

- %QUIZ_NAME%

+

- %FIRST_PLACE_NAME%

+

- %FIRST_PLACE_SCORE%

+

- %SECOND_PLACE_NAME%

+

- %SECOND_PLACE_SCORE%

+

- %THIRD_PLACE_NAME%

+

- %THIRD_PLACE_SCORE%

+

- %FOURTH_PLACE_NAME%

+

- %FOURTH_PLACE_SCORE%

+

- %FIFTH_PLACE_NAME%

+

- %FIFTH_PLACE_SCORE%

+
+
+ + +
+ From a5278659e4064bb908dd9341dcd224fa41b743be Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:07:44 -0500 Subject: [PATCH 032/184] Moved Certificate Tab Function To Own File --- includes/qmn_options_certificate_tab.php | 131 +++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 includes/qmn_options_certificate_tab.php diff --git a/includes/qmn_options_certificate_tab.php b/includes/qmn_options_certificate_tab.php new file mode 100644 index 000000000..88f6d98c1 --- /dev/null +++ b/includes/qmn_options_certificate_tab.php @@ -0,0 +1,131 @@ +Certificate (Beta)"; +} + +function mlw_options_certificate_tab_content() +{ + global $wpdb; + global $mlwQuizMasterNext; + $quiz_id = $_GET["quiz_id"]; + //Saved Certificate Options + if (isset($_POST["save_certificate_options"]) && $_POST["save_certificate_options"] == "confirmation") + { + $mlw_certificate_id = intval($_POST["certificate_quiz_id"]); + $mlw_certificate_title = $_POST["certificate_title"]; + $mlw_certificate_text = $_POST["certificate_template"]; + $mlw_certificate_logo = $_POST["certificate_logo"]; + $mlw_certificate_background = $_POST["certificate_background"]; + $mlw_enable_certificates = intval($_POST["enableCertificates"]); + $mlw_certificate = array($mlw_certificate_title, $mlw_certificate_text, $mlw_certificate_logo, $mlw_certificate_background, $mlw_enable_certificates); + $mlw_certificate_serialized = serialize($mlw_certificate); + + $mlw_certificate_sql_results = $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "mlw_quizzes SET certificate_template=%s, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_certificate_serialized, $mlw_certificate_id ) ); + + + if ($mlw_certificate_sql_results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The certificate has been updated successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Certificate Options Have Been Edited For Quiz Number ".$mlw_certificate_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0012.', 'error'); + } + } + if (isset($_GET["quiz_id"])) + { + $table_name = $wpdb->prefix . "mlw_quizzes"; + $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); + } + + //Load Certificate Options Variables + if (is_serialized($mlw_quiz_options->certificate_template) && is_array(@unserialize($mlw_quiz_options->certificate_template))) + { + $mlw_certificate_options = @unserialize($mlw_quiz_options->certificate_template); + } + else + { + $mlw_certificate_options = array('Enter title here', 'Enter text here', '', '', 1); + } + ?> +
+ +

Quiz Certificate (Beta)

+

Enter in your text here to fill in the certificate for this quiz. Be sure to enter in the link variable into the templates on the Quiz Text tab so the user can access the certificate.

+

These fields cannot contain HTML.

+ + "; + echo ""; + echo ""; + ?> + + + + + + + + + + + + + + + + + + + + + +
+ value='0' /> + value='1' /> +
+ Certificate Title + +
+ Message Displayed On Certificate +
+

Allowed Variables:

+

- %POINT_SCORE%

+

- %AVERAGE_POINT%

+

- %AMOUNT_CORRECT%

+

- %TOTAL_QUESTIONS%

+

- %CORRECT_SCORE%

+

- %QUIZ_NAME%

+

- %USER_NAME%

+

- %USER_BUSINESS%

+

- %USER_PHONE%

+

- %USER_EMAIL%

+

- %CURRENT_DATE%

+
+
+ URL To Logo (Must be JPG, JPEG, PNG or GIF) + +
+ URL To Background Img (Must be JPG, JPEG, PNG or GIF) + +
+ + +
+ From 1065d14cd4fc2e56bb177dec9d7d1987a4785385 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:08:35 -0500 Subject: [PATCH 033/184] Moved Emails Tab Function To Own File --- includes/qmn_options_email_tab.php | 468 +++++++++++++++++++++++++++++ 1 file changed, 468 insertions(+) create mode 100644 includes/qmn_options_email_tab.php diff --git a/includes/qmn_options_email_tab.php b/includes/qmn_options_email_tab.php new file mode 100644 index 000000000..5b62edeea --- /dev/null +++ b/includes/qmn_options_email_tab.php @@ -0,0 +1,468 @@ +Emails"; +} + +function mlw_options_emails_tab_content() +{ + global $wpdb; + global $mlwQuizMasterNext; + $quiz_id = $_GET["quiz_id"]; + //Check to add new user email template + if (isset($_POST["mlw_add_email_page"]) && $_POST["mlw_add_email_page"] == "confirmation") + { + //Function variables + $mlw_qmn_add_email_id = intval($_POST["mlw_add_email_quiz_id"]); + $mlw_qmn_user_email = $wpdb->get_var( $wpdb->prepare( "SELECT user_email_template FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_qmn_add_email_id ) ); + + //Load user email and check if it is array already. If not, turn it into one + if (is_serialized($mlw_qmn_user_email) && is_array(@unserialize($mlw_qmn_user_email))) + { + $mlw_qmn_email_array = @unserialize($mlw_qmn_user_email); + $mlw_new_landing_array = array(0, 100, 'Enter Your Text Here', 'Quiz Results For %QUIZ_NAME%'); + array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); + $mlw_qmn_email_array = serialize($mlw_qmn_email_array); + + } + else + { + $mlw_qmn_email_array = array(array(0, 0, $mlw_qmn_user_email, 'Quiz Results For %QUIZ_NAME%')); + $mlw_new_landing_array = array(0, 100, 'Enter Your Text Here', 'Quiz Results For %QUIZ_NAME%'); + array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); + $mlw_qmn_email_array = serialize($mlw_qmn_email_array); + } + //Update email template with new array then check to see if worked + $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET user_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_email_array, $mlw_qmn_add_email_id ) ); + if ($mlw_new_email_results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The email has been added successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'New User Email Has Been Created For Quiz Number ".$mlw_qmn_add_email_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0016.', 'error'); + } + } + + //Check to add new admin email template + if (isset($_POST["mlw_add_admin_email_page"]) && $_POST["mlw_add_admin_email_page"] == "confirmation") + { + //Function variables + $mlw_qmn_add_email_id = intval($_POST["mlw_add_admin_email_quiz_id"]); + $mlw_qmn_admin_email = $wpdb->get_var( $wpdb->prepare( "SELECT admin_email_template FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_qmn_add_email_id ) ); + + //Load user email and check if it is array already. If not, turn it into one + if (is_serialized($mlw_qmn_admin_email) && is_array(@unserialize($mlw_qmn_admin_email))) + { + $mlw_qmn_email_array = @unserialize($mlw_qmn_admin_email); + $mlw_new_landing_array = array( + "begin_score" => 0, + "end_score" => 100, + "message" => 'Enter Your Text Here', + "subject" => 'Quiz Results For %QUIZ_NAME%' + ); + array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); + $mlw_qmn_email_array = serialize($mlw_qmn_email_array); + + } + else + { + $mlw_qmn_email_array = array(array( + "begin_score" => 0, + "end_score" => 0, + "message" => $mlw_qmn_admin_email, + "subject" => 'Quiz Results For %QUIZ_NAME%' + )); + $mlw_new_landing_array = array( + "begin_score" => 0, + "end_score" => 100, + "message" => 'Enter Your Text Here', + "subject" => 'Quiz Results For %QUIZ_NAME%' + ); + array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); + $mlw_qmn_email_array = serialize($mlw_qmn_email_array); + } + //Update email template with new array then check to see if worked + $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET admin_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_email_array, $mlw_qmn_add_email_id ) ); + if ($mlw_new_email_results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The email has been added successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'New Admin Email Has Been Created For Quiz Number ".$mlw_qmn_add_email_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0016.', 'error'); + } + } + + //Check to save email templates + if (isset($_POST["mlw_save_email_template"]) && $_POST["mlw_save_email_template"] == "confirmation") + { + //Function Variables + $mlw_qmn_email_id = intval($_POST["mlw_email_quiz_id"]); + $mlw_qmn_email_template_total = intval($_POST["mlw_email_template_total"]); + $mlw_qmn_email_admin_total = intval($_POST["mlw_email_admin_total"]); + $mlw_send_user_email = $_POST["sendUserEmail"]; + $mlw_send_admin_email = $_POST["sendAdminEmail"]; + $mlw_admin_email = $_POST["adminEmail"]; + + //Create new array + $i = 1; + $mlw_qmn_new_email_array = array(); + while ($i <= $mlw_qmn_email_template_total) + { + if ($_POST["user_email_".$i] != "Delete") + { + $mlw_qmn_email_each = array(intval($_POST["user_email_begin_".$i]), intval($_POST["user_email_end_".$i]), htmlspecialchars(stripslashes($_POST["user_email_".$i]), ENT_QUOTES), htmlspecialchars(stripslashes($_POST["user_email_subject_".$i]), ENT_QUOTES)); + $mlw_qmn_new_email_array[] = $mlw_qmn_email_each; + } + $i++; + } + + //Create new array + $i = 1; + $mlw_qmn_new_admin_array = array(); + while ($i <= $mlw_qmn_email_admin_total) + { + if ($_POST["admin_email_".$i] != "Delete") + { + $mlw_qmn_email_each = array( + "begin_score" => intval($_POST["admin_email_begin_".$i]), + "end_score" => intval($_POST["admin_email_end_".$i]), + "message" => htmlspecialchars(stripslashes($_POST["admin_email_".$i]), ENT_QUOTES), + "subject" => htmlspecialchars(stripslashes($_POST["admin_email_subject_".$i]), ENT_QUOTES) + ); + $mlw_qmn_new_admin_array[] = $mlw_qmn_email_each; + } + $i++; + } + $mlw_qmn_new_email_array = serialize($mlw_qmn_new_email_array); + $mlw_qmn_new_admin_array = serialize($mlw_qmn_new_admin_array); + $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 ) ); + if ($mlw_new_email_results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The email has been updated successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Email Templates Have Been Saved For Quiz Number ".$mlw_qmn_email_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0017.', 'error'); + } + } + + if (isset($_GET["quiz_id"])) + { + $table_name = $wpdb->prefix . "mlw_quizzes"; + $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); + } + + //Load User Email Templates + if (is_serialized($mlw_quiz_options->user_email_template) && is_array(@unserialize($mlw_quiz_options->user_email_template))) + { + $mlw_qmn_user_email_array = @unserialize($mlw_quiz_options->user_email_template); + } + else + { + $mlw_qmn_user_email_array = array(array(0, 0, $mlw_quiz_options->user_email_template, 'Quiz Results For %QUIZ_NAME%')); + } + + //Load Admin Email Templates + if (is_serialized($mlw_quiz_options->admin_email_template) && is_array(@unserialize($mlw_quiz_options->admin_email_template))) + { + $mlw_qmn_admin_email_array = @unserialize($mlw_quiz_options->admin_email_template); + } + else + { + $mlw_qmn_admin_email_array = array(array( + "begin_score" => 0, + "end_score" => 0, + "message" => $mlw_quiz_options->admin_email_template, + "subject" => 'Quiz Results For %QUIZ_NAME%' + )); + } + ?> + +
+ +

Template Variables

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
%POINT_SCORE% - Score for the quiz when using points%AVERAGE_POINT% - The average amount of points user had per question
%AMOUNT_CORRECT% - The number of correct answers the user had%TOTAL_QUESTIONS% - The total number of questions in the quiz
%CORRECT_SCORE% - Score for the quiz when using correct answers
%USER_NAME% - The name the user entered before the quiz%USER_BUSINESS% - The business the user entered before the quiz
%USER_PHONE% - The phone number the user entered before the quiz%USER_EMAIL% - The email the user entered before the quiz
%QUIZ_NAME% - The name of the quiz%QUESTIONS_ANSWERS% - Shows the question, the answer the user provided, and the correct answer
%COMMENT_SECTION% - The comments the user entered into comment box if enabled%TIMER% - The amount of time user spent of quiz
+
+
+
+ + +
+
+ + +
+ +
+ + + + + + + + + + + + + +
+ send_user_email == 0) {echo 'checked="checked"';} ?> value='0' /> + send_user_email == 1) {echo 'checked="checked"';} ?> value='1' /> +
+ send_admin_email == 0) {echo 'checked="checked"';} ?> value='0' /> + send_admin_email == 1) {echo 'checked="checked"';} ?> value='1' /> +
+
+
+

Email Sent To User

+ Add New User Email + + + + + + + + + + + + "; + 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_each_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 User Email + + + +
+
+
+
+

Email Sent To Admin

+ Add New Admin Email + + + + + + + + + + + + "; + 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 Admin Email + +
+
+
+ +
+ From 87c8e306f82d5f5db78fdb218b088df7353c6056 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:09:21 -0500 Subject: [PATCH 034/184] Moved Results Page Tab Function To Own File --- includes/qmn_options_results_page_tab.php | 240 ++++++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 includes/qmn_options_results_page_tab.php diff --git a/includes/qmn_options_results_page_tab.php b/includes/qmn_options_results_page_tab.php new file mode 100644 index 000000000..c4537b587 --- /dev/null +++ b/includes/qmn_options_results_page_tab.php @@ -0,0 +1,240 @@ +Results Page"; +} +function mlw_options_results_tab_content() +{ + global $wpdb; + global $mlwQuizMasterNext; + $quiz_id = $_GET["quiz_id"]; + //Check to add new results page + if (isset($_POST["mlw_add_landing_page"]) && $_POST["mlw_add_landing_page"] == "confirmation") + { + //Function variables + $mlw_qmn_landing_id = intval($_POST["mlw_add_landing_quiz_id"]); + $mlw_qmn_message_after = $wpdb->get_var( $wpdb->prepare( "SELECT message_after FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_qmn_landing_id ) ); + //Load message_after and check if it is array already. If not, turn it into one + if (is_serialized($mlw_qmn_message_after) && is_array(@unserialize($mlw_qmn_message_after))) + { + $mlw_qmn_landing_array = @unserialize($mlw_qmn_message_after); + $mlw_new_landing_array = array(0, 100, 'Enter Your Text Here'); + array_unshift($mlw_qmn_landing_array , $mlw_new_landing_array); + $mlw_qmn_landing_array = serialize($mlw_qmn_landing_array); + + } + else + { + $mlw_qmn_landing_array = array(array(0, 0, $mlw_qmn_message_after)); + $mlw_new_landing_array = array(0, 100, 'Enter Your Text Here'); + array_unshift($mlw_qmn_landing_array , $mlw_new_landing_array); + $mlw_qmn_landing_array = serialize($mlw_qmn_landing_array); + } + + //Update message_after with new array then check to see if worked + $mlw_new_landing_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET message_after=%s, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_landing_array, $mlw_qmn_landing_id ) ); + if ($mlw_new_landing_results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The results page has been added successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'New Landing Page Has Been Created For Quiz Number ".$mlw_qmn_landing_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0013.', 'error'); + } + } + + //Check to save landing pages + if (isset($_POST["mlw_save_landing_pages"]) && $_POST["mlw_save_landing_pages"] == "confirmation") + { + //Function Variables + $mlw_qmn_landing_id = intval($_POST["mlw_landing_quiz_id"]); + $mlw_qmn_landing_total = intval($_POST["mlw_landing_page_total"]); + + //Create new array + $i = 1; + $mlw_qmn_new_landing_array = array(); + while ($i <= $mlw_qmn_landing_total) + { + if ($_POST["message_after_".$i] != "Delete") + { + $mlw_qmn_landing_each = array(intval($_POST["message_after_begin_".$i]), intval($_POST["message_after_end_".$i]), htmlspecialchars(stripslashes($_POST["message_after_".$i]), ENT_QUOTES)); + $mlw_qmn_new_landing_array[] = $mlw_qmn_landing_each; + } + $i++; + } + $mlw_qmn_new_landing_array = serialize($mlw_qmn_new_landing_array); + $mlw_new_landing_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET message_after='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_new_landing_array, $mlw_qmn_landing_id ) ); + if ($mlw_new_landing_results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The results page has been saved successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Landing Pages Have Been Saved For Quiz Number ".$mlw_qmn_landing_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0014.', 'error'); + } + } + + if (isset($_GET["quiz_id"])) + { + $table_name = $wpdb->prefix . "mlw_quizzes"; + $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); + } + + //Load Landing Pages + if (is_serialized($mlw_quiz_options->message_after) && is_array(@unserialize($mlw_quiz_options->message_after))) + { + $mlw_message_after_array = @unserialize($mlw_quiz_options->message_after); + } + else + { + $mlw_message_after_array = array(array(0, 0, $mlw_quiz_options->message_after)); + } + ?> +
+ +

Template Variables

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
%POINT_SCORE% - Score for the quiz when using points%AVERAGE_POINT% - The average amount of points user had per question
%AMOUNT_CORRECT% - The number of correct answers the user had%TOTAL_QUESTIONS% - The total number of questions in the quiz
%CORRECT_SCORE% - Score for the quiz when using correct answers
%USER_NAME% - The name the user entered before the quiz%USER_BUSINESS% - The business the user entered before the quiz
%USER_PHONE% - The phone number the user entered before the quiz%USER_EMAIL% - The email the user entered before the quiz
%QUIZ_NAME% - The name of the quiz%QUESTIONS_ANSWERS% - Shows the question, the answer the user provided, and the correct answer
%COMMENT_SECTION% - The comments the user entered into comment box if enabled
%TIMER% - The amount of time user spent of quiz%CERTIFICATE_LINK% - The link to the certificate after completing the quiz
+ + +
+ + + + + + + + + + + "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + break; + } + else + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + } + ?> + + + + + + + + + +
IDScore Greater Than Or Equal ToScore Less Than Or Equal ToResults Page Shown
"; + echo "Default"; + echo ""; + echo "-"; + echo ""; + echo "-"; + echo ""; + echo ""; + echo "
"; + echo $mlw_each_count."
Are you sure?
Yes|No
"; + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
IDScore Greater Than Or Equal ToScore Less Than Or Equal ToResults Page Shown
+ + + + +
+
+ + + +
+
+ From 7e18b537d83574244b1cc49c3a58c62cd4428470 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:10:04 -0500 Subject: [PATCH 035/184] Moved Style Tab Function To Own File --- includes/qmn_options_style_tab.php | 161 +++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 includes/qmn_options_style_tab.php diff --git a/includes/qmn_options_style_tab.php b/includes/qmn_options_style_tab.php new file mode 100644 index 000000000..793bdcc5c --- /dev/null +++ b/includes/qmn_options_style_tab.php @@ -0,0 +1,161 @@ +Styling"; +} + +function mlw_options_styling_tab_content() +{ + global $wpdb; + global $mlwQuizMasterNext; + $quiz_id = $_GET["quiz_id"]; + if (isset($_POST["save_style_options"]) && $_POST["save_style_options"] == "confirmation") + { + //Function Variables + $mlw_qmn_style_id = intval($_POST["style_quiz_id"]); + $mlw_qmn_theme = $_POST["save_quiz_theme"]; + $mlw_qmn_style = htmlspecialchars(stripslashes($_POST["quiz_css"]), ENT_QUOTES); + + //Save the new css + $mlw_save_stle_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET quiz_stye='%s', theme_selected='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_style, $mlw_qmn_theme, $mlw_qmn_style_id ) ); + if ($mlw_save_stle_results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The style has been saved successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Styles Have Been Saved For Quiz Number ".$mlw_qmn_style_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0015.', 'error'); + } + } + + if (isset($_GET["quiz_id"])) + { + $table_name = $wpdb->prefix . "mlw_quizzes"; + $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); + } + ?> +
+ + "; + echo ""; + echo ""; + echo ""; + ?> +

Quiz Styles

+

Choose your style:

+ +
Custom
+ + +

+ +
+

Custom Theme CSS

+

Entire quiz is a div with class 'mlw_qmn_quiz'

+

Each page of the quiz is div with class 'quiz_section'

+

Message before quiz text is a span with class 'mlw_qmn_message_before'

+

The text for each question is wrapped in class 'mlw_qmn_question'

+

Each comment field for the questions is wrapped in class 'mlw_qmn_question_comment'

+

Label text for comment section is wrapped in class 'mlw_qmn_comment_section_text'

+

The message displayed at end of quiz is a span with class 'mlw_qmn_message_end'

+

Each button shown for pagination (i.e Next/Previous) is wrapped in class 'mlw_qmn_quiz_link'

+

Timer is wrapped in class 'mlw_qmn_timer'

+

Each horizontal multiple response is wrapped in a span with class 'mlw_horizontal_multiple'

+ + + + + + + +
+ + Default:
+ div.mlw_qmn_quiz input[type=radio],
+ div.mlw_qmn_quiz input[type=submit],
+ div.mlw_qmn_quiz label {
+ cursor: pointer;
+ }
+ div.mlw_qmn_quiz input:not([type=submit]):focus,
+ div.mlw_qmn_quiz textarea:focus {
+ background: #eaeaea;
+ }
+ div.mlw_qmn_quiz {
+ text-align: left;
+ }
+ div.quiz_section {
+
+ }
+ div.mlw_qmn_timer {
+ position:fixed;
+ top:200px;
+ right:0px;
+ width:130px;
+ color:#00CCFF;
+ border-radius: 15px;
+ background:#000000;
+ text-align: center;
+ padding: 15px 15px 15px 15px
+ }
+ div.mlw_qmn_quiz input[type=submit],
+ a.mlw_qmn_quiz_link
+ {
+ border-radius: 4px;
+ position: relative;
+ background-image: linear-gradient(#fff,#dedede);
+ background-color: #eee;
+ border: #ccc solid 1px;
+ color: #333;
+ text-shadow: 0 1px 0 rgba(255,255,255,.5);
+ box-sizing: border-box;
+ display: inline-block;
+ padding: 5px 5px 5px 5px;
+ margin: auto;
+ }
+
+ + +
+ From fe14f9bd5ebb5dc1ffcc3b324322b0f0d5da14f8 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:10:52 -0500 Subject: [PATCH 036/184] Moved Tools Tab Function To Own File --- includes/qmn_options_tools_tab.php | 80 ++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 includes/qmn_options_tools_tab.php diff --git a/includes/qmn_options_tools_tab.php b/includes/qmn_options_tools_tab.php new file mode 100644 index 000000000..dee648c97 --- /dev/null +++ b/includes/qmn_options_tools_tab.php @@ -0,0 +1,80 @@ +Tools/Add-Ons"; +} +function mlw_options_tools_tab_content() +{ + global $wpdb; + global $mlwQuizMasterNext; + $quiz_id = $_GET["quiz_id"]; + //Update Quiz Table + if (isset($_POST["mlw_reset_quiz_stats"]) && $_POST["mlw_reset_quiz_stats"] == "confirmation") + { + //Variables from reset stats form + $mlw_reset_stats_quiz_id = $_POST["mlw_reset_quiz_id"]; + $mlw_reset_update_sql = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views=0, quiz_taken=0, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=".$mlw_reset_stats_quiz_id; + $mlw_reset_sql_results = $wpdb->query( $mlw_reset_update_sql ); + if ($mlw_reset_sql_results != false) + { + $mlwQuizMasterNext->alertManager->newAlert('The stats has been reset successfully.', 'success'); + + //Insert Action Into Audit Trail + global $current_user; + get_currentuserinfo(); + $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; + $insert = "INSERT INTO " . $table_name . + "(trail_id, action_user, action, time) " . + "VALUES (NULL , '" . $current_user->display_name . "' , 'Quiz Stats Have Been Reset For Quiz Number ".$mlw_leaderboard_quiz_id."' , '" . date("h:i:s A m/d/Y") . "')"; + $results = $wpdb->query( $insert ); + } + else + { + $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0010.', 'error'); + } + } + + if (isset($_GET["quiz_id"])) + { + $table_name = $wpdb->prefix . "mlw_quizzes"; + $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); + } + ?> +
+ +

Use this button to reset all the stats collected for this quiz (Quiz Views and Times Quiz Has Been Taken).

+ + + +
+ From 043f3ffb52e233419e44e5dbf600953eeb1d5805 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:11:28 -0500 Subject: [PATCH 037/184] Moved Preview Tab Function To Own File --- includes/qmn_options_preview_tab.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 includes/qmn_options_preview_tab.php diff --git a/includes/qmn_options_preview_tab.php b/includes/qmn_options_preview_tab.php new file mode 100644 index 000000000..825596a0d --- /dev/null +++ b/includes/qmn_options_preview_tab.php @@ -0,0 +1,17 @@ +Preview (Beta)"; +} + +function mlw_options_preview_tab_content() +{ + ?> +
+ +
+ From 0064919548db47cdcbdf38f15040f5ddcb45c0dc Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:11:57 -0500 Subject: [PATCH 038/184] Moved Tab Functions To Their Own Files --- includes/qmn_quiz_options.php | 2493 --------------------------------- 1 file changed, 2493 deletions(-) diff --git a/includes/qmn_quiz_options.php b/includes/qmn_quiz_options.php index 0c5425801..86efa62cc 100644 --- a/includes/qmn_quiz_options.php +++ b/includes/qmn_quiz_options.php @@ -96,48 +96,6 @@ function mlw_generate_quiz_options() add_action('mlw_qmn_options_tab', 'mlw_options_styling_tab'); add_action('mlw_qmn_options_tab', 'mlw_options_tools_tab'); add_action('mlw_qmn_options_tab', 'mlw_options_preview_tab'); - -function mlw_options_questions_tab() -{ - echo "
  • Questions
  • "; -} -function mlw_options_text_tab() -{ - echo "
  • Text
  • "; -} -function mlw_options_option_tab() -{ - echo "
  • Options
  • "; -} -function mlw_options_leaderboard_tab() -{ - echo "
  • Leaderboard
  • "; -} -function mlw_options_certificate_tab() -{ - echo "
  • Certificate (Beta)
  • "; -} -function mlw_options_emails_tab() -{ - echo "
  • Emails
  • "; -} -function mlw_options_results_tab() -{ - echo "
  • Results Page
  • "; -} -function mlw_options_styling_tab() -{ - echo "
  • Styling
  • "; -} -function mlw_options_tools_tab() -{ - echo "
  • Tools/Add-Ons
  • "; -} -function mlw_options_preview_tab() -{ - echo "
  • Preview (Beta)
  • "; -} - add_action('mlw_qmn_options_tab_content', 'mlw_options_questions_tab_content'); add_action('mlw_qmn_options_tab_content', 'mlw_options_text_tab_content'); add_action('mlw_qmn_options_tab_content', 'mlw_options_option_tab_content'); @@ -148,2455 +106,4 @@ function mlw_options_preview_tab() add_action('mlw_qmn_options_tab_content', 'mlw_options_styling_tab_content'); add_action('mlw_qmn_options_tab_content', 'mlw_options_tools_tab_content'); add_action('mlw_qmn_options_tab_content', 'mlw_options_preview_tab_content'); - -function mlw_options_questions_tab_content() -{ - global $wpdb; - global $mlwQuizMasterNext; - $quiz_id = $_GET["quiz_id"]; - - //Edit question - if ( isset($_POST["edit_question"]) && $_POST["edit_question"] == "confirmation") - { - //Variables from edit question form - $edit_question_name = trim(preg_replace('/\s+/',' ', nl2br(htmlspecialchars($_POST["edit_question_name"], ENT_QUOTES)))); - $edit_question_answer_info = $_POST["edit_correct_answer_info"]; - $mlw_edit_question_id = intval($_POST["edit_question_id"]); - $mlw_edit_question_type = $_POST["edit_question_type"]; - $edit_comments = htmlspecialchars($_POST["edit_comments"], ENT_QUOTES); - $edit_hint = htmlspecialchars($_POST["edit_hint"], ENT_QUOTES); - $edit_question_order = intval($_POST["edit_question_order"]); - $mlw_edit_answer_total = intval($_POST["question_".$mlw_edit_question_id."_answer_total"]); - $mlw_row_settings = $wpdb->get_row( $wpdb->prepare( "SELECT question_settings FROM " . $wpdb->prefix . "mlw_questions" . " WHERE question_id=%d", $mlw_edit_question_id ) ); - if (is_serialized($mlw_row_settings->question_settings) && is_array(@unserialize($mlw_row_settings->question_settings))) - { - $mlw_settings = @unserialize($mlw_row_settings->question_settings); - } - else - { - $mlw_settings = array(); - $mlw_settings['required'] = intval($_POST["edit_required"]); - } - if ( !isset($mlw_settings['required'])) - { - $mlw_settings['required'] = intval($_POST["edit_required"]); - } - $mlw_settings['required'] = intval($_POST["edit_required"]); - $mlw_settings = serialize($mlw_settings); - $i = 1; - $mlw_qmn_new_answer_array = array(); - while ($i <= $mlw_edit_answer_total) - { - if ($_POST["edit_answer_".$i] != "") - { - $mlw_qmn_correct = 0; - if (isset($_POST["edit_answer_".$i."_correct"]) && $_POST["edit_answer_".$i."_correct"] == 1) - { - $mlw_qmn_correct = 1; - } - $mlw_qmn_answer_each = array(htmlspecialchars(stripslashes($_POST["edit_answer_".$i]), ENT_QUOTES), floatval($_POST["edit_answer_".$i."_points"]), $mlw_qmn_correct); - $mlw_qmn_new_answer_array[] = $mlw_qmn_answer_each; - } - $i++; - } - $mlw_qmn_new_answer_array = serialize($mlw_qmn_new_answer_array); - $quiz_id = $_POST["quiz_id"]; - - $update = "UPDATE " . $wpdb->prefix . "mlw_questions" . " SET question_name='".$edit_question_name."',answer_array='".$mlw_qmn_new_answer_array."', question_answer_info='".$edit_question_answer_info."', comments='".$edit_comments."', hints='".$edit_hint."', question_order='".$edit_question_order."', question_type='".$mlw_edit_question_type."', question_settings='".$mlw_settings."' WHERE question_id=".$mlw_edit_question_id; - $results = $wpdb->query( $update ); - if ($results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The question has been updated successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Question Has Been Edited: ".$edit_question_name."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0004.', 'error'); - } - } - - //Delete question from quiz - if ( isset($_POST["delete_question"]) && $_POST["delete_question"] == "confirmation") - { - //Variables from delete question form - $mlw_question_id = intval($_POST["question_id"]); - $quiz_id = $_POST["quiz_id"]; - - $update = "UPDATE " . $wpdb->prefix . "mlw_questions" . " SET deleted=1 WHERE question_id=".$mlw_question_id; - $results = $wpdb->query( $update ); - if ($results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The question has been deleted successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Question Has Been Deleted: ".$mlw_question_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0005.', 'error'); - } - } - - //Duplicate Questions - if ( isset($_POST["duplicate_question"]) && $_POST["duplicate_question"] == "confirmation") - { - //Variables from delete question form - $mlw_question_id = intval($_POST["duplicate_question_id"]); - $quiz_id = $_POST["quiz_id"]; - - $mlw_original = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."mlw_questions WHERE question_id=%d", $mlw_question_id ), ARRAY_A ); - - $results = $wpdb->insert( - $wpdb->prefix."mlw_questions", - array( - 'quiz_id' => $mlw_original['quiz_id'], - 'question_name' => $mlw_original['question_name'], - 'answer_array' => $mlw_original['answer_array'], - 'answer_one' => $mlw_original['answer_one'], - 'answer_one_points' => $mlw_original['answer_one_points'], - 'answer_two' => $mlw_original['answer_two'], - 'answer_two_points' => $mlw_original['answer_two_points'], - 'answer_three' => $mlw_original['answer_three'], - 'answer_three_points' => $mlw_original['answer_three_points'], - 'answer_four' => $mlw_original['answer_four'], - 'answer_four_points' => $mlw_original['answer_four_points'], - 'answer_five' => $mlw_original['answer_five'], - 'answer_five_points' => $mlw_original['answer_five_points'], - 'answer_six' => $mlw_original['answer_six'], - 'answer_six_points' => $mlw_original['answer_six_points'], - 'correct_answer' => $mlw_original['correct_answer'], - 'question_answer_info' => $mlw_original['question_answer_info'], - 'comments' => $mlw_original['comments'], - 'hints' => $mlw_original['hints'], - 'question_order' => $mlw_original['question_order'], - 'question_type' => $mlw_original['question_type'], - 'question_settings' => $mlw_original['question_settings'], - 'deleted' => $mlw_original['deleted'] - ), - array( - '%d', - '%s', - '%s', - '%s', - '%d', - '%s', - '%d', - '%s', - '%d', - '%s', - '%d', - '%s', - '%d', - '%s', - '%d', - '%d', - '%s', - '%d', - '%s', - '%d', - '%d', - '%s', - '%d' - ) - ); - - if ($results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The question has been duplicated successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Question Has Been Duplicated: ".$mlw_question_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0019.', 'error'); - } - } - - - //Submit new question into database - if ( isset($_POST["create_question"]) && $_POST["create_question"] == "confirmation") - { - //Variables from new question form - $question_name = trim(preg_replace('/\s+/',' ', nl2br(htmlspecialchars($_POST["question_name"], ENT_QUOTES)))); - $question_answer_info = $_POST["correct_answer_info"]; - $question_type = $_POST["question_type"]; - $comments = htmlspecialchars($_POST["comments"], ENT_QUOTES); - $hint = htmlspecialchars($_POST["hint"], ENT_QUOTES); - $new_question_order = intval($_POST["new_question_order"]); - $mlw_answer_total = intval($_POST["new_question_answer_total"]); - $mlw_settings = array(); - $mlw_settings['required'] = intval($_POST["required"]); - $mlw_settings = serialize($mlw_settings); - $i = 1; - $mlw_qmn_new_answer_array = array(); - while ($i <= $mlw_answer_total) - { - if ($_POST["answer_".$i] != "") - { - $mlw_qmn_correct = 0; - if (isset($_POST["answer_".$i."_correct"]) && $_POST["answer_".$i."_correct"] == 1) - { - $mlw_qmn_correct = 1; - } - $mlw_qmn_answer_each = array(htmlspecialchars(stripslashes($_POST["answer_".$i]), ENT_QUOTES), floatval($_POST["answer_".$i."_points"]), $mlw_qmn_correct); - $mlw_qmn_new_answer_array[] = $mlw_qmn_answer_each; - } - $i++; - } - $mlw_qmn_new_answer_array = serialize($mlw_qmn_new_answer_array); - $quiz_id = $_POST["quiz_id"]; - $table_name = $wpdb->prefix . "mlw_questions"; - $insert = "INSERT INTO " . $table_name . - " (question_id, quiz_id, question_name, answer_array, question_answer_info, comments, hints, question_order, question_type, question_settings, deleted) VALUES (NULL , ".$quiz_id.", '" . $question_name . "' , '".$mlw_qmn_new_answer_array."', '".$question_answer_info."', '".$comments."', '".$hint."', ".$new_question_order.", '".$question_type."', '".$mlw_settings."', 0)"; - $results = $wpdb->query( $insert ); - if ($results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The question has been created successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Question Has Been Added: ".$question_name."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0006.', 'error'); - } - } - - if (isset($_GET["quiz_id"])) - { - $table_name = $wpdb->prefix . "mlw_quizzes"; - $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); - } - - $mlw_qmn_table_limit = 10; - $mlw_qmn_question_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(question_id) FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted='0'", $quiz_id ) ); - - if( isset($_GET{'mlw_question_page'} ) ) - { - $mlw_qmn_question_page = $_GET{'mlw_question_page'} + 1; - $mlw_qmn_question_begin = $mlw_qmn_table_limit * $mlw_qmn_question_page ; - } - else - { - $mlw_qmn_question_page = 0; - $mlw_qmn_question_begin = 0; - } - $mlw_qmn_question_left = $mlw_qmn_question_count - ($mlw_qmn_question_page * $mlw_qmn_table_limit); - - $mlw_question_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted='0' - ORDER BY question_order ASC LIMIT %d, %d", $quiz_id, $mlw_qmn_question_begin, $mlw_qmn_table_limit ) ); - - //Load and prepare answer arrays - $mlw_qmn_answer_arrays = array(); - foreach($mlw_question_data as $mlw_question_info) { - if (is_serialized($mlw_question_info->answer_array) && is_array(@unserialize($mlw_question_info->answer_array))) - { - $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array); - $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each; - } - else - { - $mlw_answer_array_correct = array(0, 0, 0, 0, 0, 0); - $mlw_answer_array_correct[$mlw_question_info->correct_answer-1] = 1; - $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = array( - array($mlw_question_info->answer_one, $mlw_question_info->answer_one_points, $mlw_answer_array_correct[0]), - array($mlw_question_info->answer_two, $mlw_question_info->answer_two_points, $mlw_answer_array_correct[1]), - array($mlw_question_info->answer_three, $mlw_question_info->answer_three_points, $mlw_answer_array_correct[2]), - array($mlw_question_info->answer_four, $mlw_question_info->answer_four_points, $mlw_answer_array_correct[3]), - array($mlw_question_info->answer_five, $mlw_question_info->answer_five_points, $mlw_answer_array_correct[4]), - array($mlw_question_info->answer_six, $mlw_question_info->answer_six_points, $mlw_answer_array_correct[5])); - } - } - $is_new_quiz = $wpdb->num_rows; - ?> -
    - - - -
    - question_settings) && is_array(@unserialize($mlw_question_info->question_settings))) - { - $mlw_question_settings = @unserialize($mlw_question_info->question_settings); - } - else - { - $mlw_question_settings = array(); - $mlw_question_settings['required'] = 1; - } - $mlw_question_type_text = ""; - switch ($mlw_question_info->question_type) { - case 0: - $mlw_question_type_text = "Multiple Choice"; - break; - case 1: - $mlw_question_type_text = "Horizontal Multiple Choice"; - break; - case 2: - $mlw_question_type_text = "Drop Down"; - break; - case 3: - $mlw_question_type_text = "Small Open Answer"; - break; - case 4: - $mlw_question_type_text = "Multiple Response"; - break; - case 5: - $mlw_question_type_text = "Large Open Answer"; - break; - case 6: - $mlw_question_type_text = "Text Block"; - break; - case 7: - $mlw_question_type_text = "Number"; - break; - case 8: - $mlw_question_type_text = "Accept"; - break; - case 9: - $mlw_question_type_text = "Captcha"; - break; - case 10: - $mlw_question_type_text = "Horizontal Multiple Response"; - break; - default: - $mlw_question_type_text = "Error Code "; - } - if($alternate) $alternate = ""; - else $alternate = " class=\"alternate\""; - $question_list .= ""; - $question_list .= "" . $mlw_question_info->question_order . ""; - $question_list .= "" . $mlw_question_type_text . ""; - $question_list .= "" . $mlw_question_info->question_name .""; - $question_list .= ""; - - - $mlw_question_answer_array = $mlw_qmn_answer_arrays[$mlw_question_info->question_id]; - ?> - - - 0 ) - { - $mlw_qmn_previous_page = $mlw_qmn_question_page - 2; - $display .= "Previous 10 Questions"; - if( $mlw_qmn_question_left > $mlw_qmn_table_limit ) - { - $display .= "Next 10 Questions"; - } - } - else if( $mlw_qmn_question_page == 0 ) - { - if( $mlw_qmn_question_left > $mlw_qmn_table_limit ) - { - $display .= "Next 10 Questions"; - } - } - else if( $mlw_qmn_question_left < $mlw_qmn_table_limit ) - { - $mlw_qmn_previous_page = $mlw_qmn_question_page - 2; - $display .= "Previous 10 Questions"; - } - - $display .= ""; - $display .= " - - - - "; - $display .= "{$question_list}"; - $display .= " - - - - "; - $display .= "
    Question OrderQuestion TypeQuestion
    Question OrderQuestion TypeQuestion
    "; - echo $display; - ?> - - - - - - -
    - $_POST["mlw_quiz_twitter_text_template"], 'facebook' => $_POST["mlw_quiz_facebook_text_template"])); - $mlw_email_from_text = $_POST["emailFromText"]; - $mlw_question_answer_template = htmlspecialchars($_POST["mlw_quiz_question_answer_template"], ENT_QUOTES); - $quiz_id = $_POST["quiz_id"]; - - $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; - $results = $wpdb->query( $update ); - if ($results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The templates has been updated successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Templates Have Been Edited For Quiz Number ".$quiz_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0007.', 'error'); - } - } - - if (isset($_GET["quiz_id"])) - { - $table_name = $wpdb->prefix . "mlw_quizzes"; - $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); - } - - //Load Pagination Text - $mlw_qmn_pagination_text = ""; - if (is_serialized($mlw_quiz_options->pagination_text) && is_array(@unserialize($mlw_quiz_options->pagination_text))) - { - $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text); - } - else - { - $mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text); - } - - //Load Social Media Text - $qmn_social_media_text = ""; - if (is_serialized($mlw_quiz_options->social_media_text) && is_array(@unserialize($mlw_quiz_options->social_media_text))) - { - $qmn_social_media_text = @unserialize($mlw_quiz_options->social_media_text); - } - else - { - $qmn_social_media_text = array( - 'twitter' => $mlw_quiz_options->social_media_text, - 'facebook' => $mlw_quiz_options->social_media_text - ); - } - ?> -
    -

    Template Variables

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    %POINT_SCORE% - Total points user earned when taking quiz%AVERAGE_POINT% - The average amount of points user had per question
    %AMOUNT_CORRECT% - The number of correct answers the user had%TOTAL_QUESTIONS% - The total number of questions in the quiz
    %CORRECT_SCORE% - The percent score for the quiz showing percent of total quetions answered correctly
    %USER_NAME% - The name the user entered before the quiz%USER_BUSINESS% - The business the user entered before the quiz
    %USER_PHONE% - The phone number the user entered before the quiz%USER_EMAIL% - The email the user entered before the quiz
    %QUIZ_NAME% - The name of the quiz%QUESTIONS_ANSWERS% - Shows the question, the answer the user provided, and the correct answer
    %COMMENT_SECTION% - The comments the user entered into comment box if enabled%QUESTION% - The question that the user answered
    %USER_ANSWER% - The answer the user gave for the question%CORRECT_ANSWER% - The correct answer for the question
    %USER_COMMENTS% - The comments the user provided in the comment field for the question%CORRECT_ANSWER_INFO% - Reason why the correct answer is the correct answer
    %TIMER% - The amount of time user spent of quiz%CERTIFICATE_LINK% - The link to the certificate after completing the quiz
    %CURRENT_DATE% - The Current Date
    - - "; - echo ""; - echo ""; - ?> -

    Message Templates

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Message Displayed Before Quiz -
    -

    Allowed Variables:

    -

    - %QUIZ_NAME%

    -

    - %CURRENT_DATE%

    -
    message_before, ENT_QUOTES), 'mlw_quiz_before_message' ); ?>
    - Message Displayed Before Comments Box If Enabled -
    -

    Allowed Variables:

    -

    - %QUIZ_NAME%

    -

    - %CURRENT_DATE%

    -
    message_comment, ENT_QUOTES), 'mlw_quiz_before_comments' ); ?>
    - Message Displayed At End Of Quiz (Leave Blank To Omit Text Section) -
    -

    Allowed Variables:

    -

    - %QUIZ_NAME%

    -

    - %CURRENT_DATE%

    -
    message_end_template, ENT_QUOTES), 'message_end_template' ); ?>
    - Message Displayed If User Has Tried Quiz Too Many Times -
    -

    Allowed Variables:

    -

    - %QUIZ_NAME%

    -

    - %CURRENT_DATE%

    -
    total_user_tries_text, ENT_QUOTES), 'mlw_quiz_total_user_tries_text' ); ?>
    - Message Displayed If User Is Not Logged In And Quiz Requires Users To Be Logged In -
    -

    Allowed Variables:

    -

    - %QUIZ_NAME%

    -

    - %CURRENT_DATE%

    -
    require_log_in_text, ENT_QUOTES), 'mlw_require_log_in_text' ); ?>
    - Message Displayed If Date Is Outside Scheduled Timeframe -
    -

    Allowed Variables:

    -

    - %QUIZ_NAME%

    -

    - %CURRENT_DATE%

    -
    scheduled_timeframe_text, ENT_QUOTES), 'mlw_scheduled_timeframe_text' ); ?>
    - Message Displayed If The Limit Of Total Entries Has Been Reached -
    -

    Allowed Variables:

    -

    - %QUIZ_NAME%

    -

    - %CURRENT_DATE%

    -
    limit_total_entries_text, ENT_QUOTES), 'mlw_limit_total_entries_text' ); ?>
    - %QUESTIONS_ANSWERS% Text -
    -

    Allowed Variables:

    -

    - %QUESTION%

    -

    - %USER_ANSWER%

    -

    - %CORRECT_ANSWER%

    -

    - %USER_COMMENTS%

    -

    - %CORRECT_ANSWER_INFO%

    -
    question_answer_template, ENT_QUOTES), 'mlw_quiz_question_answer_template' ); ?>
    - Twitter Sharing Text -
    -

    Allowed Variables:

    -

    - %POINT_SCORE%

    -

    - %AVERAGE_POINT%

    -

    - %AMOUNT_CORRECT%

    -

    - %TOTAL_QUESTIONS%

    -

    - %CORRECT_SCORE%

    -

    - %QUIZ_NAME%

    -

    - %TIMER%

    -

    - %CURRENT_DATE%

    -
    - Facebook Sharing Text -
    -

    Allowed Variables:

    -

    - %POINT_SCORE%

    -

    - %AVERAGE_POINT%

    -

    - %AMOUNT_CORRECT%

    -

    - %TOTAL_QUESTIONS%

    -

    - %CORRECT_SCORE%

    -

    - %QUIZ_NAME%

    -

    - %TIMER%

    -

    - %CURRENT_DATE%

    -
    -

    Other Templates

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - "; ?> -
    - $_POST["scheduled_time_start"], "end" => $_POST["scheduled_time_end"])); - $quiz_id = $_POST["quiz_id"]; - - $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET system='".$mlw_system."', loggedin_user_contact='".$mlw_qmn_loggedin_contact."', contact_info_location=".$mlw_contact_location.", user_name='".$mlw_user_name."', user_comp='".$mlw_user_comp."', user_email='".$mlw_user_email."', user_phone='".$mlw_user_phone."', comment_section='".$mlw_comment_section."', randomness_order='".$mlw_randomness_order."', question_from_total=".$mlw_qmn_questions_from_total.", total_user_tries=".$mlw_total_user_tries.", social_media=".$mlw_qmn_social_media.", pagination=".$mlw_qmn_pagination.", timer_limit=".$mlw_qmn_timer.", question_numbering=".$mlw_qmn_question_numbering.", require_log_in=".$mlw_require_log_in.", limit_total_entries=".$mlw_limit_total_entries.", last_activity='".date("Y-m-d H:i:s")."', scheduled_timeframe='".$qmn_scheduled_timeframe."' WHERE quiz_id=".$quiz_id; - $results = $wpdb->query( $update ); - if ($results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The options has been updated successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Options Have Been Edited For Quiz Number ".$quiz_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0008.', 'error'); - } - } - - if (isset($_GET["quiz_id"])) - { - $table_name = $wpdb->prefix . "mlw_quizzes"; - $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); - } - - //Load Scheduled Timeframe - $qmn_scheduled_timeframe = ""; - if (is_serialized($mlw_quiz_options->scheduled_timeframe) && is_array(@unserialize($mlw_quiz_options->scheduled_timeframe))) - { - $qmn_scheduled_timeframe = @unserialize($mlw_quiz_options->scheduled_timeframe); - } - else - { - $qmn_scheduled_timeframe = array("start" => '', "end" => ''); - } - ?> -
    - - - "; - echo ""; - echo ""; - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - system == 0) {echo 'checked="checked"';} ?> value='0' /> - system == 1) {echo 'checked="checked"';} ?> value='1' /> - system == 2) {echo 'checked="checked"';} ?> value='2' /> -
    - require_log_in == 1) {echo 'checked="checked"';} ?> value='1' /> - require_log_in == 0) {echo 'checked="checked"';} ?> value='0' /> -
    - -
    - -
    - -
    - -
    - -
    - " class="regular-text" /> - - " class="regular-text" /> -
    - randomness_order == 1) {echo 'checked="checked"';} ?> value='1' /> - randomness_order == 2) {echo 'checked="checked"';} ?> value='2' /> - randomness_order == 0) {echo 'checked="checked"';} ?> value='0' /> -
    - contact_info_location == 0) {echo 'checked="checked"';} ?> value='0' /> - contact_info_location == 1) {echo 'checked="checked"';} ?> value='1' /> -
    - loggedin_user_contact == 0) {echo 'checked="checked"';} ?> value='0' /> - loggedin_user_contact == 1) {echo 'checked="checked"';} ?> value='1' /> -
    - user_name == 0) {echo 'checked="checked"';} ?> value='0' /> - user_name == 1) {echo 'checked="checked"';} ?> value='1' /> - user_name == 2) {echo 'checked="checked"';} ?> value='2' /> -
    - user_comp == 0) {echo 'checked="checked"';} ?> value='0' /> - user_comp == 1) {echo 'checked="checked"';} ?> value='1' /> - user_comp == 2) {echo 'checked="checked"';} ?> value='2' /> -
    - user_email == 0) {echo 'checked="checked"';} ?> value='0' /> - user_email == 1) {echo 'checked="checked"';} ?> value='1'/> - user_email == 2) {echo 'checked="checked"';} ?> value='2' /> -
    - user_phone == 0) {echo 'checked="checked"';} ?> value='0' /> - user_phone == 1) {echo 'checked="checked"';} ?> value='1' /> - user_phone == 2) {echo 'checked="checked"';} ?> value='2' /> -
    - comment_section == 0) {echo 'checked="checked"';} ?> value='0' /> - comment_section == 1) {echo 'checked="checked"';} ?> value='1' /> -
    - question_numbering == 1) {echo 'checked="checked"';} ?> value='1' /> - question_numbering == 0) {echo 'checked="checked"';} ?> value='0' /> -
    - social_media == 1) {echo 'checked="checked"';} ?> value='1' /> - social_media == 0) {echo 'checked="checked"';} ?> value='0' /> -
    - - "; ?> -
    - prefix . "mlw_quizzes" . " SET leaderboard_template='".$mlw_leaderboard_template."', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=".$mlw_leaderboard_quiz_id; - $results = $wpdb->query( $update ); - if ($results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The leaderboards has been updated successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Leaderboard Options Have Been Edited For Quiz Number ".$mlw_leaderboard_quiz_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0009.', 'error'); - } - } - - if (isset($_GET["quiz_id"])) - { - $table_name = $wpdb->prefix . "mlw_quizzes"; - $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); - } - ?> -
    -

    Template Variables

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    %FIRST_PLACE_NAME% - The name of the user who is in first place%FIRST_PLACE_SCORE% - The score from the first place's quiz
    %SECOND_PLACE_NAME% - The name of the user who is in second place%SECOND_PLACE_SCORE% - The score from the second place's quiz
    %THIRD_PLACE_NAME% - The name of the user who is in third place%THIRD_PLACE_SCORE% - The score from the third place's quiz
    %FOURTH_PLACE_NAME% - The name of the user who is in fourth place%FOURTH_PLACE_SCORE% - The score from the fourth place's quiz
    %FIFTH_PLACE_NAME% - The name of the user who is in fifth place%FIFTH_PLACE_SCORE% - The score from the fifth place's quiz
    %QUIZ_NAME% - The name of the quiz
    - - "; - echo ""; - echo ""; - ?> - - - - - -
    - Leaderboard Template -
    -

    Allowed Variables:

    -

    - %QUIZ_NAME%

    -

    - %FIRST_PLACE_NAME%

    -

    - %FIRST_PLACE_SCORE%

    -

    - %SECOND_PLACE_NAME%

    -

    - %SECOND_PLACE_SCORE%

    -

    - %THIRD_PLACE_NAME%

    -

    - %THIRD_PLACE_SCORE%

    -

    - %FOURTH_PLACE_NAME%

    -

    - %FOURTH_PLACE_SCORE%

    -

    - %FIFTH_PLACE_NAME%

    -

    - %FIFTH_PLACE_SCORE%

    -
    -
    - - -
    - query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "mlw_quizzes SET certificate_template=%s, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_certificate_serialized, $mlw_certificate_id ) ); - - - if ($mlw_certificate_sql_results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The certificate has been updated successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Certificate Options Have Been Edited For Quiz Number ".$mlw_certificate_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0012.', 'error'); - } - } - if (isset($_GET["quiz_id"])) - { - $table_name = $wpdb->prefix . "mlw_quizzes"; - $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); - } - - //Load Certificate Options Variables - if (is_serialized($mlw_quiz_options->certificate_template) && is_array(@unserialize($mlw_quiz_options->certificate_template))) - { - $mlw_certificate_options = @unserialize($mlw_quiz_options->certificate_template); - } - else - { - $mlw_certificate_options = array('Enter title here', 'Enter text here', '', '', 1); - } - ?> -
    - -

    Quiz Certificate (Beta)

    -

    Enter in your text here to fill in the certificate for this quiz. Be sure to enter in the link variable into the templates on the Quiz Text tab so the user can access the certificate.

    -

    These fields cannot contain HTML.

    - - "; - echo ""; - echo ""; - ?> - - - - - - - - - - - - - - - - - - - - - -
    - value='0' /> - value='1' /> -
    - Certificate Title - -
    - Message Displayed On Certificate -
    -

    Allowed Variables:

    -

    - %POINT_SCORE%

    -

    - %AVERAGE_POINT%

    -

    - %AMOUNT_CORRECT%

    -

    - %TOTAL_QUESTIONS%

    -

    - %CORRECT_SCORE%

    -

    - %QUIZ_NAME%

    -

    - %USER_NAME%

    -

    - %USER_BUSINESS%

    -

    - %USER_PHONE%

    -

    - %USER_EMAIL%

    -

    - %CURRENT_DATE%

    -
    -
    - URL To Logo (Must be JPG, JPEG, PNG or GIF) - -
    - URL To Background Img (Must be JPG, JPEG, PNG or GIF) - -
    - - -
    - get_var( $wpdb->prepare( "SELECT user_email_template FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_qmn_add_email_id ) ); - - //Load user email and check if it is array already. If not, turn it into one - if (is_serialized($mlw_qmn_user_email) && is_array(@unserialize($mlw_qmn_user_email))) - { - $mlw_qmn_email_array = @unserialize($mlw_qmn_user_email); - $mlw_new_landing_array = array(0, 100, 'Enter Your Text Here', 'Quiz Results For %QUIZ_NAME%'); - array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); - $mlw_qmn_email_array = serialize($mlw_qmn_email_array); - - } - else - { - $mlw_qmn_email_array = array(array(0, 0, $mlw_qmn_user_email, 'Quiz Results For %QUIZ_NAME%')); - $mlw_new_landing_array = array(0, 100, 'Enter Your Text Here', 'Quiz Results For %QUIZ_NAME%'); - array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); - $mlw_qmn_email_array = serialize($mlw_qmn_email_array); - } - //Update email template with new array then check to see if worked - $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET user_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_email_array, $mlw_qmn_add_email_id ) ); - if ($mlw_new_email_results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The email has been added successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'New User Email Has Been Created For Quiz Number ".$mlw_qmn_add_email_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0016.', 'error'); - } - } - - //Check to add new admin email template - if (isset($_POST["mlw_add_admin_email_page"]) && $_POST["mlw_add_admin_email_page"] == "confirmation") - { - //Function variables - $mlw_qmn_add_email_id = intval($_POST["mlw_add_admin_email_quiz_id"]); - $mlw_qmn_admin_email = $wpdb->get_var( $wpdb->prepare( "SELECT admin_email_template FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_qmn_add_email_id ) ); - - //Load user email and check if it is array already. If not, turn it into one - if (is_serialized($mlw_qmn_admin_email) && is_array(@unserialize($mlw_qmn_admin_email))) - { - $mlw_qmn_email_array = @unserialize($mlw_qmn_admin_email); - $mlw_new_landing_array = array( - "begin_score" => 0, - "end_score" => 100, - "message" => 'Enter Your Text Here', - "subject" => 'Quiz Results For %QUIZ_NAME%' - ); - array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); - $mlw_qmn_email_array = serialize($mlw_qmn_email_array); - - } - else - { - $mlw_qmn_email_array = array(array( - "begin_score" => 0, - "end_score" => 0, - "message" => $mlw_qmn_admin_email, - "subject" => 'Quiz Results For %QUIZ_NAME%' - )); - $mlw_new_landing_array = array( - "begin_score" => 0, - "end_score" => 100, - "message" => 'Enter Your Text Here', - "subject" => 'Quiz Results For %QUIZ_NAME%' - ); - array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); - $mlw_qmn_email_array = serialize($mlw_qmn_email_array); - } - //Update email template with new array then check to see if worked - $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET admin_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_email_array, $mlw_qmn_add_email_id ) ); - if ($mlw_new_email_results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The email has been added successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'New Admin Email Has Been Created For Quiz Number ".$mlw_qmn_add_email_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0016.', 'error'); - } - } - - //Check to save email templates - if (isset($_POST["mlw_save_email_template"]) && $_POST["mlw_save_email_template"] == "confirmation") - { - //Function Variables - $mlw_qmn_email_id = intval($_POST["mlw_email_quiz_id"]); - $mlw_qmn_email_template_total = intval($_POST["mlw_email_template_total"]); - $mlw_qmn_email_admin_total = intval($_POST["mlw_email_admin_total"]); - $mlw_send_user_email = $_POST["sendUserEmail"]; - $mlw_send_admin_email = $_POST["sendAdminEmail"]; - $mlw_admin_email = $_POST["adminEmail"]; - - //Create new array - $i = 1; - $mlw_qmn_new_email_array = array(); - while ($i <= $mlw_qmn_email_template_total) - { - if ($_POST["user_email_".$i] != "Delete") - { - $mlw_qmn_email_each = array(intval($_POST["user_email_begin_".$i]), intval($_POST["user_email_end_".$i]), htmlspecialchars(stripslashes($_POST["user_email_".$i]), ENT_QUOTES), htmlspecialchars(stripslashes($_POST["user_email_subject_".$i]), ENT_QUOTES)); - $mlw_qmn_new_email_array[] = $mlw_qmn_email_each; - } - $i++; - } - - //Create new array - $i = 1; - $mlw_qmn_new_admin_array = array(); - while ($i <= $mlw_qmn_email_admin_total) - { - if ($_POST["admin_email_".$i] != "Delete") - { - $mlw_qmn_email_each = array( - "begin_score" => intval($_POST["admin_email_begin_".$i]), - "end_score" => intval($_POST["admin_email_end_".$i]), - "message" => htmlspecialchars(stripslashes($_POST["admin_email_".$i]), ENT_QUOTES), - "subject" => htmlspecialchars(stripslashes($_POST["admin_email_subject_".$i]), ENT_QUOTES) - ); - $mlw_qmn_new_admin_array[] = $mlw_qmn_email_each; - } - $i++; - } - $mlw_qmn_new_email_array = serialize($mlw_qmn_new_email_array); - $mlw_qmn_new_admin_array = serialize($mlw_qmn_new_admin_array); - $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 ) ); - if ($mlw_new_email_results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The email has been updated successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Email Templates Have Been Saved For Quiz Number ".$mlw_qmn_email_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0017.', 'error'); - } - } - - if (isset($_GET["quiz_id"])) - { - $table_name = $wpdb->prefix . "mlw_quizzes"; - $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); - } - - //Load User Email Templates - if (is_serialized($mlw_quiz_options->user_email_template) && is_array(@unserialize($mlw_quiz_options->user_email_template))) - { - $mlw_qmn_user_email_array = @unserialize($mlw_quiz_options->user_email_template); - } - else - { - $mlw_qmn_user_email_array = array(array(0, 0, $mlw_quiz_options->user_email_template, 'Quiz Results For %QUIZ_NAME%')); - } - - //Load Admin Email Templates - if (is_serialized($mlw_quiz_options->admin_email_template) && is_array(@unserialize($mlw_quiz_options->admin_email_template))) - { - $mlw_qmn_admin_email_array = @unserialize($mlw_quiz_options->admin_email_template); - } - else - { - $mlw_qmn_admin_email_array = array(array( - "begin_score" => 0, - "end_score" => 0, - "message" => $mlw_quiz_options->admin_email_template, - "subject" => 'Quiz Results For %QUIZ_NAME%' - )); - } - ?> - -
    - -

    Template Variables

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    %POINT_SCORE% - Score for the quiz when using points%AVERAGE_POINT% - The average amount of points user had per question
    %AMOUNT_CORRECT% - The number of correct answers the user had%TOTAL_QUESTIONS% - The total number of questions in the quiz
    %CORRECT_SCORE% - Score for the quiz when using correct answers
    %USER_NAME% - The name the user entered before the quiz%USER_BUSINESS% - The business the user entered before the quiz
    %USER_PHONE% - The phone number the user entered before the quiz%USER_EMAIL% - The email the user entered before the quiz
    %QUIZ_NAME% - The name of the quiz%QUESTIONS_ANSWERS% - Shows the question, the answer the user provided, and the correct answer
    %COMMENT_SECTION% - The comments the user entered into comment box if enabled%TIMER% - The amount of time user spent of quiz
    -
    -
    -
    - - -
    -
    - - -
    - -
    - - - - - - - - - - - - - -
    - send_user_email == 0) {echo 'checked="checked"';} ?> value='0' /> - send_user_email == 1) {echo 'checked="checked"';} ?> value='1' /> -
    - send_admin_email == 0) {echo 'checked="checked"';} ?> value='0' /> - send_admin_email == 1) {echo 'checked="checked"';} ?> value='1' /> -
    -
    -
    -

    Email Sent To User

    - Add New User Email - - - - - - - - - - - - "; - 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_each_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 User Email - - - -
    -
    -
    -
    -

    Email Sent To Admin

    - Add New Admin Email - - - - - - - - - - - - "; - 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 Admin Email - -
    -
    -
    - -
    - get_var( $wpdb->prepare( "SELECT message_after FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_qmn_landing_id ) ); - //Load message_after and check if it is array already. If not, turn it into one - if (is_serialized($mlw_qmn_message_after) && is_array(@unserialize($mlw_qmn_message_after))) - { - $mlw_qmn_landing_array = @unserialize($mlw_qmn_message_after); - $mlw_new_landing_array = array(0, 100, 'Enter Your Text Here'); - array_unshift($mlw_qmn_landing_array , $mlw_new_landing_array); - $mlw_qmn_landing_array = serialize($mlw_qmn_landing_array); - - } - else - { - $mlw_qmn_landing_array = array(array(0, 0, $mlw_qmn_message_after)); - $mlw_new_landing_array = array(0, 100, 'Enter Your Text Here'); - array_unshift($mlw_qmn_landing_array , $mlw_new_landing_array); - $mlw_qmn_landing_array = serialize($mlw_qmn_landing_array); - } - - //Update message_after with new array then check to see if worked - $mlw_new_landing_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET message_after=%s, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_landing_array, $mlw_qmn_landing_id ) ); - if ($mlw_new_landing_results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The results page has been added successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'New Landing Page Has Been Created For Quiz Number ".$mlw_qmn_landing_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0013.', 'error'); - } - } - - //Check to save landing pages - if (isset($_POST["mlw_save_landing_pages"]) && $_POST["mlw_save_landing_pages"] == "confirmation") - { - //Function Variables - $mlw_qmn_landing_id = intval($_POST["mlw_landing_quiz_id"]); - $mlw_qmn_landing_total = intval($_POST["mlw_landing_page_total"]); - - //Create new array - $i = 1; - $mlw_qmn_new_landing_array = array(); - while ($i <= $mlw_qmn_landing_total) - { - if ($_POST["message_after_".$i] != "Delete") - { - $mlw_qmn_landing_each = array(intval($_POST["message_after_begin_".$i]), intval($_POST["message_after_end_".$i]), htmlspecialchars(stripslashes($_POST["message_after_".$i]), ENT_QUOTES)); - $mlw_qmn_new_landing_array[] = $mlw_qmn_landing_each; - } - $i++; - } - $mlw_qmn_new_landing_array = serialize($mlw_qmn_new_landing_array); - $mlw_new_landing_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET message_after='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_new_landing_array, $mlw_qmn_landing_id ) ); - if ($mlw_new_landing_results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The results page has been saved successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Landing Pages Have Been Saved For Quiz Number ".$mlw_qmn_landing_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0014.', 'error'); - } - } - - if (isset($_GET["quiz_id"])) - { - $table_name = $wpdb->prefix . "mlw_quizzes"; - $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); - } - - //Load Landing Pages - if (is_serialized($mlw_quiz_options->message_after) && is_array(@unserialize($mlw_quiz_options->message_after))) - { - $mlw_message_after_array = @unserialize($mlw_quiz_options->message_after); - } - else - { - $mlw_message_after_array = array(array(0, 0, $mlw_quiz_options->message_after)); - } - ?> -
    - -

    Template Variables

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    %POINT_SCORE% - Score for the quiz when using points%AVERAGE_POINT% - The average amount of points user had per question
    %AMOUNT_CORRECT% - The number of correct answers the user had%TOTAL_QUESTIONS% - The total number of questions in the quiz
    %CORRECT_SCORE% - Score for the quiz when using correct answers
    %USER_NAME% - The name the user entered before the quiz%USER_BUSINESS% - The business the user entered before the quiz
    %USER_PHONE% - The phone number the user entered before the quiz%USER_EMAIL% - The email the user entered before the quiz
    %QUIZ_NAME% - The name of the quiz%QUESTIONS_ANSWERS% - Shows the question, the answer the user provided, and the correct answer
    %COMMENT_SECTION% - The comments the user entered into comment box if enabled
    %TIMER% - The amount of time user spent of quiz%CERTIFICATE_LINK% - The link to the certificate after completing the quiz
    - - -
    - - - - - - - - - - - "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - break; - } - else - { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - } - } - ?> - - - - - - - - - -
    IDScore Greater Than Or Equal ToScore Less Than Or Equal ToResults Page Shown
    "; - echo "Default"; - echo ""; - echo "-"; - echo ""; - echo "-"; - echo ""; - echo ""; - echo "
    "; - echo $mlw_each_count."
    Are you sure?
    Yes|No
    "; - echo "
    "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
    IDScore Greater Than Or Equal ToScore Less Than Or Equal ToResults Page Shown
    - - - - -
    -
    - - - -
    -
    - query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET quiz_stye='%s', theme_selected='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_style, $mlw_qmn_theme, $mlw_qmn_style_id ) ); - if ($mlw_save_stle_results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The style has been saved successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Styles Have Been Saved For Quiz Number ".$mlw_qmn_style_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0015.', 'error'); - } - } - - if (isset($_GET["quiz_id"])) - { - $table_name = $wpdb->prefix . "mlw_quizzes"; - $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); - } - ?> -
    - - "; - echo ""; - echo ""; - echo ""; - ?> -

    Quiz Styles

    -

    Choose your style:

    - -
    Custom
    - - -

    - -
    -

    Custom Theme CSS

    -

    Entire quiz is a div with class 'mlw_qmn_quiz'

    -

    Each page of the quiz is div with class 'quiz_section'

    -

    Message before quiz text is a span with class 'mlw_qmn_message_before'

    -

    The text for each question is wrapped in class 'mlw_qmn_question'

    -

    Each comment field for the questions is wrapped in class 'mlw_qmn_question_comment'

    -

    Label text for comment section is wrapped in class 'mlw_qmn_comment_section_text'

    -

    The message displayed at end of quiz is a span with class 'mlw_qmn_message_end'

    -

    Each button shown for pagination (i.e Next/Previous) is wrapped in class 'mlw_qmn_quiz_link'

    -

    Timer is wrapped in class 'mlw_qmn_timer'

    -

    Each horizontal multiple response is wrapped in a span with class 'mlw_horizontal_multiple'

    - - - - - - - -
    - - Default:
    - div.mlw_qmn_quiz input[type=radio],
    - div.mlw_qmn_quiz input[type=submit],
    - div.mlw_qmn_quiz label {
    - cursor: pointer;
    - }
    - div.mlw_qmn_quiz input:not([type=submit]):focus,
    - div.mlw_qmn_quiz textarea:focus {
    - background: #eaeaea;
    - }
    - div.mlw_qmn_quiz {
    - text-align: left;
    - }
    - div.quiz_section {
    -
    - }
    - div.mlw_qmn_timer {
    - position:fixed;
    - top:200px;
    - right:0px;
    - width:130px;
    - color:#00CCFF;
    - border-radius: 15px;
    - background:#000000;
    - text-align: center;
    - padding: 15px 15px 15px 15px
    - }
    - div.mlw_qmn_quiz input[type=submit],
    - a.mlw_qmn_quiz_link
    - {
    - border-radius: 4px;
    - position: relative;
    - background-image: linear-gradient(#fff,#dedede);
    - background-color: #eee;
    - border: #ccc solid 1px;
    - color: #333;
    - text-shadow: 0 1px 0 rgba(255,255,255,.5);
    - box-sizing: border-box;
    - display: inline-block;
    - padding: 5px 5px 5px 5px;
    - margin: auto;
    - }
    -
    - - -
    - prefix . "mlw_quizzes" . " SET quiz_views=0, quiz_taken=0, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=".$mlw_reset_stats_quiz_id; - $mlw_reset_sql_results = $wpdb->query( $mlw_reset_update_sql ); - if ($mlw_reset_sql_results != false) - { - $mlwQuizMasterNext->alertManager->newAlert('The stats has been reset successfully.', 'success'); - - //Insert Action Into Audit Trail - global $current_user; - get_currentuserinfo(); - $table_name = $wpdb->prefix . "mlw_qm_audit_trail"; - $insert = "INSERT INTO " . $table_name . - "(trail_id, action_user, action, time) " . - "VALUES (NULL , '" . $current_user->display_name . "' , 'Quiz Stats Have Been Reset For Quiz Number ".$mlw_leaderboard_quiz_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); - } - else - { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0010.', 'error'); - } - } - - if (isset($_GET["quiz_id"])) - { - $table_name = $wpdb->prefix . "mlw_quizzes"; - $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); - } - ?> -
    - -

    Use this button to reset all the stats collected for this quiz (Quiz Views and Times Quiz Has Been Taken).

    - - - -
    - -
    - -
    - From 1b688ada3f6971fc7faac275818981ecd7e812b7 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:15:37 -0500 Subject: [PATCH 039/184] Added Includes For New Tab Function Files --- mlw_quizmaster2.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 51c8654e9..2c7723243 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -85,6 +85,16 @@ private function load_dependencies() include("includes/qmn_adverts.php"); include("includes/qmn_help.php"); include("includes/qmn_dashboard_widgets.php"); + include("includes/qmn_options_questions_tab.php"); + include("includes/qmn_options_text_tab.php"); + include("includes/qmn_options_option_tab.php"); + include("includes/qmn_options_leaderboard_tab.php"); + include("includes/qmn_options_certificate_tab.php"); + include("includes/qmn_options_email_tab.php"); + include("includes/qmn_options_results_page_tab.php"); + include("includes/qmn_options_style_tab.php"); + include("includes/qmn_options_tools_tab.php"); + include("includes/qmn_options_preview_tab.php"); include("includes/qmn_alerts.php"); $this->alertManager = new MlwQmnAlertManager(); From ca96ff7fa8cef3488cee8bc8b51431ed7daa64a4 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:16:37 -0500 Subject: [PATCH 040/184] Added Action Calls --- includes/qmn_options_questions_tab.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/qmn_options_questions_tab.php b/includes/qmn_options_questions_tab.php index 9f7acdb7f..25f25387c 100644 --- a/includes/qmn_options_questions_tab.php +++ b/includes/qmn_options_questions_tab.php @@ -762,4 +762,7 @@ function mlw_add_answer_to_new_question() From 65e32a3c0746fe47e37b7b6041e137532f5acc0b Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:17:03 -0500 Subject: [PATCH 041/184] Added Action Calls --- includes/qmn_options_text_tab.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/qmn_options_text_tab.php b/includes/qmn_options_text_tab.php index a3d7c6b70..a9f320dfe 100644 --- a/includes/qmn_options_text_tab.php +++ b/includes/qmn_options_text_tab.php @@ -307,4 +307,6 @@ function mlw_options_text_tab_content() From 7aeb805cc33cef48636db6c314b5616ff8293dd4 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:17:25 -0500 Subject: [PATCH 042/184] Added Action Calls --- includes/qmn_options_option_tab.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/qmn_options_option_tab.php b/includes/qmn_options_option_tab.php index e804119fe..9c82b5449 100644 --- a/includes/qmn_options_option_tab.php +++ b/includes/qmn_options_option_tab.php @@ -220,4 +220,6 @@ function mlw_options_option_tab_content() From f4e562bfbf36340fdfda78758827672c8cce3a9e Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:17:44 -0500 Subject: [PATCH 043/184] Added Action Calls --- includes/qmn_options_leaderboard_tab.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/qmn_options_leaderboard_tab.php b/includes/qmn_options_leaderboard_tab.php index f32d8faee..498575ff3 100644 --- a/includes/qmn_options_leaderboard_tab.php +++ b/includes/qmn_options_leaderboard_tab.php @@ -107,4 +107,6 @@ function mlw_options_leaderboard_tab_content() From 9f3045d552cec8ad4c6cbe3d70fc8d9970050dde Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:18:09 -0500 Subject: [PATCH 044/184] Added Action Calls --- includes/qmn_options_certificate_tab.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/qmn_options_certificate_tab.php b/includes/qmn_options_certificate_tab.php index 88f6d98c1..72eaeda84 100644 --- a/includes/qmn_options_certificate_tab.php +++ b/includes/qmn_options_certificate_tab.php @@ -128,4 +128,6 @@ function mlw_options_certificate_tab_content() From 9a0bba63efe2040a973259a38eb0e57afceda73b Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:18:33 -0500 Subject: [PATCH 045/184] Added Action Calls --- includes/qmn_options_email_tab.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/qmn_options_email_tab.php b/includes/qmn_options_email_tab.php index 5b62edeea..d56ca6536 100644 --- a/includes/qmn_options_email_tab.php +++ b/includes/qmn_options_email_tab.php @@ -465,4 +465,6 @@ function delete_admin_email(id) From befc78d9a8472ae23a16ac8f3590626c4ea8d005 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:18:53 -0500 Subject: [PATCH 046/184] Added Action Calls --- includes/qmn_options_results_page_tab.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/qmn_options_results_page_tab.php b/includes/qmn_options_results_page_tab.php index c4537b587..1c6956fa2 100644 --- a/includes/qmn_options_results_page_tab.php +++ b/includes/qmn_options_results_page_tab.php @@ -237,4 +237,6 @@ function delete_landing(id) From f6f6588d2eefebb01dfa7f757c86315da2e61020 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:19:12 -0500 Subject: [PATCH 047/184] Added Action Calls --- includes/qmn_options_style_tab.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/qmn_options_style_tab.php b/includes/qmn_options_style_tab.php index 793bdcc5c..fdbf5c6b8 100644 --- a/includes/qmn_options_style_tab.php +++ b/includes/qmn_options_style_tab.php @@ -158,4 +158,6 @@ function mlw_qmn_theme(theme) From 266e30a3912b1da69d99fb79f59f136ab98d6d2b Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:19:32 -0500 Subject: [PATCH 048/184] Added Action Calls --- includes/qmn_options_tools_tab.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/qmn_options_tools_tab.php b/includes/qmn_options_tools_tab.php index dee648c97..5a6aa0177 100644 --- a/includes/qmn_options_tools_tab.php +++ b/includes/qmn_options_tools_tab.php @@ -77,4 +77,6 @@ function mlw_options_tools_tab_content() From d31cb0ac36aecbf0ed774e2fa5a9984603240b4f Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:19:48 -0500 Subject: [PATCH 049/184] Added Action Calls --- includes/qmn_options_preview_tab.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/qmn_options_preview_tab.php b/includes/qmn_options_preview_tab.php index 825596a0d..c428a8028 100644 --- a/includes/qmn_options_preview_tab.php +++ b/includes/qmn_options_preview_tab.php @@ -14,4 +14,6 @@ function mlw_options_preview_tab_content() From 367c70284e4ee8b1cd1e3c1275891261b9066d8a Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Fri, 2 Jan 2015 23:20:09 -0500 Subject: [PATCH 050/184] Moved add_action Calls To Individual Files --- includes/qmn_quiz_options.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/includes/qmn_quiz_options.php b/includes/qmn_quiz_options.php index 86efa62cc..e18eccc12 100644 --- a/includes/qmn_quiz_options.php +++ b/includes/qmn_quiz_options.php @@ -85,25 +85,4 @@ function mlw_generate_quiz_options() From 0f9c8daf001fd50d7bf59fad4327ea1994321f18 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 11:40:35 -0500 Subject: [PATCH 051/184] Initial Commit --- includes/qmn_addons.php | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 includes/qmn_addons.php diff --git a/includes/qmn_addons.php b/includes/qmn_addons.php new file mode 100644 index 000000000..0fa74f79a --- /dev/null +++ b/includes/qmn_addons.php @@ -0,0 +1,6 @@ + From 34d58b783e025e822f16babcfca552558efa549b Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 11:42:05 -0500 Subject: [PATCH 052/184] Added Include For New Addon Page --- mlw_quizmaster2.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 2c7723243..ec1ec8e16 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -95,6 +95,7 @@ private function load_dependencies() include("includes/qmn_options_style_tab.php"); include("includes/qmn_options_tools_tab.php"); include("includes/qmn_options_preview_tab.php"); + include("includes/qmn_addons.php"); include("includes/qmn_alerts.php"); $this->alertManager = new MlwQmnAlertManager(); @@ -140,6 +141,7 @@ public function setup_admin_menu() 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__, 'Addon Settings', 'Addon Settings', 'manage_options', 'qmn_addons', 'qmn_addons_page'); add_submenu_page(__FILE__, 'QMN About', 'QMN About', 'manage_options', 'mlw_qmn_about', 'mlw_generate_about_page'); } } From f7c0d4237026ca9112537bc27500b35b32735edf Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 12:02:10 -0500 Subject: [PATCH 053/184] Created Foreach Loops For Tabs --- includes/qmn_addons.php | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/includes/qmn_addons.php b/includes/qmn_addons.php index 0fa74f79a..51b58cfbc 100644 --- a/includes/qmn_addons.php +++ b/includes/qmn_addons.php @@ -1,6 +1,36 @@ +
    +

    Quiz Master Next Addon Settings

    + +
    + +
    +
    + From d7e04e5cb233c4f32257c60e8546d5ba1db997ce Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 12:10:36 -0500 Subject: [PATCH 054/184] Added Plugin Helper Function --- includes/qmn_addons.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/qmn_addons.php b/includes/qmn_addons.php index 51b58cfbc..9723ab349 100644 --- a/includes/qmn_addons.php +++ b/includes/qmn_addons.php @@ -1,8 +1,9 @@ pluginHelper->get_addon_tabs(); ?>

    Quiz Master Next Addon Settings

    @@ -21,7 +22,7 @@ function qmn_addons_page()
    Date: Sat, 3 Jan 2015 12:10:52 -0500 Subject: [PATCH 055/184] Created New Plugin Helper Class --- includes/qmn_helper.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 includes/qmn_helper.php diff --git a/includes/qmn_helper.php b/includes/qmn_helper.php new file mode 100644 index 000000000..008d7878f --- /dev/null +++ b/includes/qmn_helper.php @@ -0,0 +1,27 @@ +addon_tabs[] = $new_tab; + } + + public function get_addon_tabs() + { + return $this->addon_tabs; + } +} +?> From 7003b6736466f3bc2e7c3b1c119bbd8a4558ef3e Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 12:12:30 -0500 Subject: [PATCH 056/184] Added Includes For Plugin Helper --- mlw_quizmaster2.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 2c7723243..0a6ebf7da 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -37,6 +37,14 @@ class MLWQuizMasterNext */ public $alertManager; + /** + * QMN Plugin Helper Object + * + * @var object + * @since 4.0.0 + */ + public $pluginHelper; + /** * QMN Quiz Creator Object * @@ -101,6 +109,9 @@ private function load_dependencies() include("includes/qmn_quiz_creator.php"); $this->quizCreator = new QMNQuizCreator(); + + include("includes/qmn_helper.php"); + $this->$pluginHelper = new QMNPluginHelper(); } /** From d480b97276adf7a814933b15a6b162ccc006b84b Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 12:21:02 -0500 Subject: [PATCH 057/184] Fixed Array --- includes/qmn_helper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/qmn_helper.php b/includes/qmn_helper.php index 008d7878f..466f5e048 100644 --- a/includes/qmn_helper.php +++ b/includes/qmn_helper.php @@ -12,9 +12,9 @@ public function register_addon_settings_tab($title, $function) { $slug = strtolower(str_replace( " ", "-", $title)); $new_tab = array( - 'title' = $title, - 'function' = $function, - 'slug' = $slug + 'title' => $title, + 'function' => $function, + 'slug' => $slug ); $this->addon_tabs[] = $new_tab; } From 696fb32b87cb335503a4f7b3f89becf93f9f21e0 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 12:21:20 -0500 Subject: [PATCH 058/184] Fixed PHP Error --- mlw_quizmaster2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 0a6ebf7da..360fe0561 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -111,7 +111,7 @@ private function load_dependencies() $this->quizCreator = new QMNQuizCreator(); include("includes/qmn_helper.php"); - $this->$pluginHelper = new QMNPluginHelper(); + $this->pluginHelper = new QMNPluginHelper(); } /** From a69312fc946924cb15e7364c70dd5e0f93edec64 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 12:22:42 -0500 Subject: [PATCH 059/184] Updated Default Tab Slug --- includes/qmn_addons.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/includes/qmn_addons.php b/includes/qmn_addons.php index 9723ab349..b7460f82d 100644 --- a/includes/qmn_addons.php +++ b/includes/qmn_addons.php @@ -2,7 +2,7 @@ function qmn_addons_page() { global $mlwQuizMasterNext; - $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'qmn_available_addons'; + $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'available-addons'; $tab_array = $mlwQuizMasterNext->pluginHelper->get_addon_tabs(); ?>
    @@ -16,7 +16,7 @@ function qmn_addons_page() { $active_class = 'nav-tab-active'; } - echo "".$tab['title'].""; + echo "".$tab['title'].""; } ?> @@ -34,4 +34,19 @@ function qmn_addons_page()
    +

    Available Addons

    + pluginHelper->register_addon_settings_tab("Available Addons", "qmn_generate_available_addons"); +} +add_action("plugins_loaded", 'qmn_avaiable_addons_tab'); ?> From 4d8b22057cc286da7bd4e395e744730f70507ebf Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 12:52:02 -0500 Subject: [PATCH 060/184] Created Addons Page CSS --- includes/css/qmn_addons_page.css | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 includes/css/qmn_addons_page.css diff --git a/includes/css/qmn_addons_page.css b/includes/css/qmn_addons_page.css new file mode 100644 index 000000000..a6f7cedd4 --- /dev/null +++ b/includes/css/qmn_addons_page.css @@ -0,0 +1,18 @@ +.qmn_addons +{ + float: left; + width: 300px; + height: 300px; + border: 1px solid #ccc; + padding: 10px; + margin: 10px; + position: relative; +} +.qmn_addons_title +{ + font-size: 15px; +} +.qmn_addons_desc +{ + +} From 87b0cdcfe9a245b8164a22690c7aea775adafaa5 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 12:52:19 -0500 Subject: [PATCH 061/184] Updated Addons On Available Addons Tab --- includes/qmn_addons.php | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/includes/qmn_addons.php b/includes/qmn_addons.php index b7460f82d..bed6540de 100644 --- a/includes/qmn_addons.php +++ b/includes/qmn_addons.php @@ -2,8 +2,8 @@ function qmn_addons_page() { global $mlwQuizMasterNext; - $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'available-addons'; - $tab_array = $mlwQuizMasterNext->pluginHelper->get_addon_tabs(); + $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'available-addons'; + $tab_array = $mlwQuizMasterNext->pluginHelper->get_addon_tabs(); ?>

    Quiz Master Next Addon Settings

    @@ -38,8 +38,32 @@ function qmn_addons_page() function qmn_generate_available_addons() { + wp_enqueue_style( 'qmn_addons_style', plugins_url( 'css/qmn_addons_page.css' , __FILE__ ) ); ?> -

    Available Addons

    +

    These addons extend the functionality of Quiz Master Next

    +
    +

    Export Results

    +

    This add-on gives you the ability to export your quiz results as a CSV file.

    + Get This Addon +
    +
    +

    Advertisement Be Gone

    +

    This add-on will remove all services/add-on advertisements in all of our Master Suite plugins.

    + Get This Addon +
    +
    +

    MailPoet Integration

    +

    Grow your list of subscribers in MailPoet by using this add-on to add users who take your quizzes!

    + Get This Addon +
    +
    +

    Advanced Leaderboard

    +

    This add-on gives you 4 new leaderboard shortcodes and 2 new widgets that you can customize per use. You can edit how many results are listed, the name of the leaderboard, and the order the results are listed in.

    + Get This Addon +
    +
    +
    + Browse All Addons Date: Sat, 3 Jan 2015 13:07:49 -0500 Subject: [PATCH 062/184] Added Functions For Adding Settings Tabs --- includes/qmn_helper.php | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/includes/qmn_helper.php b/includes/qmn_helper.php index 466f5e048..83ff9733b 100644 --- a/includes/qmn_helper.php +++ b/includes/qmn_helper.php @@ -2,10 +2,12 @@ class QMNPluginHelper { public $addon_tabs = array(); + public $settings_tabs = array(); public function __construct() { - + add_action('mlw_qmn_options_tab', array($this, 'get_settings_tabs')); + add_action('mlw_qmn_options_tab_content', array($this, 'get_settings_tabs_content')); } public function register_addon_settings_tab($title, $function) @@ -23,5 +25,34 @@ public function get_addon_tabs() { return $this->addon_tabs; } + + public function register_quiz_settings_tabs($title, $function) + { + $slug = strtolower(str_replace( " ", "-", $title)); + $new_tab = array( + 'title' => $title, + 'function' => $function, + 'slug' => $slug + ); + $this->settings_tabs[] = $new_tab; + } + + public function get_settings_tabs() + { + foreach($this->settings_tab as $tab) + { + echo "
  • ".$tab["title"]."
  • "; + } + } + + public function get_settings_tabs_content() + { + foreach($this->settings_tab as $tab) + { + echo "
    "; + call_user_func($tab['function']); + echo "
    "; + } + } } ?> From a542f6b956b8c21871e9443fc167ff47b4e7e3ae Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:21:02 -0500 Subject: [PATCH 063/184] Fix PHP Error - undefined variable --- includes/qmn_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/qmn_helper.php b/includes/qmn_helper.php index 83ff9733b..5e0d0ad4e 100644 --- a/includes/qmn_helper.php +++ b/includes/qmn_helper.php @@ -39,7 +39,7 @@ public function register_quiz_settings_tabs($title, $function) public function get_settings_tabs() { - foreach($this->settings_tab as $tab) + foreach($this->settings_tabs as $tab) { echo "
  • ".$tab["title"]."
  • "; } @@ -47,7 +47,7 @@ public function get_settings_tabs() public function get_settings_tabs_content() { - foreach($this->settings_tab as $tab) + foreach($this->settings_tabs as $tab) { echo "
    "; call_user_func($tab['function']); From a3ae1535544f8966ac5c0b1ad0ab31b0564a8ce8 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:23:58 -0500 Subject: [PATCH 064/184] Added Missing # In Link Href --- includes/qmn_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/qmn_helper.php b/includes/qmn_helper.php index 5e0d0ad4e..835b1141f 100644 --- a/includes/qmn_helper.php +++ b/includes/qmn_helper.php @@ -41,7 +41,7 @@ public function get_settings_tabs() { foreach($this->settings_tabs as $tab) { - echo "
  • ".$tab["title"]."
  • "; + echo "
  • ".$tab["title"]."
  • "; } } From 8af19e6fe7e620ced551f01e42982f9faa703a1b Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:32:15 -0500 Subject: [PATCH 065/184] Use New Plugin Helper To Register Tab --- includes/qmn_options_questions_tab.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/qmn_options_questions_tab.php b/includes/qmn_options_questions_tab.php index 25f25387c..2488051be 100644 --- a/includes/qmn_options_questions_tab.php +++ b/includes/qmn_options_questions_tab.php @@ -1,8 +1,10 @@ Questions"; + global $mlwQuizMasterNext; + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Questions", 'mlw_options_questions_tab_content'); } +add_action("plugins_loaded", 'qmn_settings_questions_tab'); function mlw_options_questions_tab_content() { @@ -762,7 +764,4 @@ function mlw_add_answer_to_new_question()
    From c76169764976b6a1a61418133d3a74117ece3d3a Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:33:05 -0500 Subject: [PATCH 066/184] Use New Plugin Helper To Register Tab --- includes/qmn_options_text_tab.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/qmn_options_text_tab.php b/includes/qmn_options_text_tab.php index a9f320dfe..075d69089 100644 --- a/includes/qmn_options_text_tab.php +++ b/includes/qmn_options_text_tab.php @@ -1,8 +1,10 @@ Text"; + global $mlwQuizMasterNext; + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Text", 'mlw_options_text_tab_content'); } +add_action("plugins_loaded", 'qmn_settings_text_tab'); function mlw_options_text_tab_content() { @@ -307,6 +309,4 @@ function mlw_options_text_tab_content()
    From 2532ee15ec5cc4e2c2806a373239d09fa40a46ac Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:33:49 -0500 Subject: [PATCH 067/184] Use New Plugin Helper To Register Tab --- includes/qmn_options_option_tab.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/qmn_options_option_tab.php b/includes/qmn_options_option_tab.php index 9c82b5449..8e832718d 100644 --- a/includes/qmn_options_option_tab.php +++ b/includes/qmn_options_option_tab.php @@ -1,8 +1,10 @@ Options"; + global $mlwQuizMasterNext; + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Options", 'mlw_options_option_tab_content'); } +add_action("plugins_loaded", 'qmn_settings_options_tab'); function mlw_options_option_tab_content() { @@ -220,6 +222,4 @@ function mlw_options_option_tab_content()
    From fdd856b5ec689da4b1ac7e773ead9e64ce3c0e18 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:34:36 -0500 Subject: [PATCH 068/184] Use New Plugin Helper To Register Tab --- includes/qmn_options_leaderboard_tab.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/qmn_options_leaderboard_tab.php b/includes/qmn_options_leaderboard_tab.php index 498575ff3..1ddafd2d8 100644 --- a/includes/qmn_options_leaderboard_tab.php +++ b/includes/qmn_options_leaderboard_tab.php @@ -1,8 +1,10 @@ Leaderboard"; + global $mlwQuizMasterNext; + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Leaderboard", 'mlw_options_leaderboard_tab_content'); } +add_action("plugins_loaded", 'qmn_settings_leaderboard_tab'); function mlw_options_leaderboard_tab_content() { @@ -107,6 +109,4 @@ function mlw_options_leaderboard_tab_content()
    From d4fe858c96d9a4f3618ae7552406c83a507c79bf Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:35:18 -0500 Subject: [PATCH 069/184] Use New Plugin Helper To Register Tab --- includes/qmn_options_certificate_tab.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/qmn_options_certificate_tab.php b/includes/qmn_options_certificate_tab.php index 72eaeda84..126bf6402 100644 --- a/includes/qmn_options_certificate_tab.php +++ b/includes/qmn_options_certificate_tab.php @@ -1,8 +1,10 @@ Certificate (Beta)"; + global $mlwQuizMasterNext; + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Certificate (Beta)", 'mlw_options_certificate_tab_content'); } +add_action("plugins_loaded", 'qmn_settings_certificate_tab'); function mlw_options_certificate_tab_content() { @@ -128,6 +130,4 @@ function mlw_options_certificate_tab_content()
    From b0d612f1efea44f1e6ee53c79912c266f4e7e63a Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:36:01 -0500 Subject: [PATCH 070/184] Use New Plugin Helper To Register Tab --- includes/qmn_options_email_tab.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/qmn_options_email_tab.php b/includes/qmn_options_email_tab.php index d56ca6536..9af0136a7 100644 --- a/includes/qmn_options_email_tab.php +++ b/includes/qmn_options_email_tab.php @@ -1,8 +1,10 @@ Emails"; + global $mlwQuizMasterNext; + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Emails", 'mlw_options_emails_tab_content'); } +add_action("plugins_loaded", 'qmn_settings_email_tab'); function mlw_options_emails_tab_content() { @@ -465,6 +467,4 @@ function delete_admin_email(id) From 8f93552147505271f88c96b32726f39d0fb8f179 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:36:46 -0500 Subject: [PATCH 071/184] Use New Plugin Helper To Register Tab --- includes/qmn_options_results_page_tab.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/qmn_options_results_page_tab.php b/includes/qmn_options_results_page_tab.php index 1c6956fa2..6e753d4dc 100644 --- a/includes/qmn_options_results_page_tab.php +++ b/includes/qmn_options_results_page_tab.php @@ -1,8 +1,10 @@ Results Page"; + global $mlwQuizMasterNext; + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Results Pages", 'mlw_options_results_tab_content'); } +add_action("plugins_loaded", 'qmn_settings_results_tab'); function mlw_options_results_tab_content() { global $wpdb; @@ -237,6 +239,4 @@ function delete_landing(id) From 50b2bb3181dfbceffe4f70fa1a1818a456482959 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:37:29 -0500 Subject: [PATCH 072/184] Use New Plugin Helper To Register Tab --- includes/qmn_options_style_tab.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/qmn_options_style_tab.php b/includes/qmn_options_style_tab.php index fdbf5c6b8..d97afe3f2 100644 --- a/includes/qmn_options_style_tab.php +++ b/includes/qmn_options_style_tab.php @@ -1,8 +1,10 @@ Styling"; + global $mlwQuizMasterNext; + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Style", 'mlw_options_styling_tab_content'); } +add_action("plugins_loaded", 'qmn_settings_style_tab'); function mlw_options_styling_tab_content() { @@ -158,6 +160,4 @@ function mlw_qmn_theme(theme) From 91bbc8360dc8a7f89f208b5967300b2351f8ae00 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:38:15 -0500 Subject: [PATCH 073/184] Use New Plugin Helper To Register Tab --- includes/qmn_options_tools_tab.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/qmn_options_tools_tab.php b/includes/qmn_options_tools_tab.php index 5a6aa0177..db567a96b 100644 --- a/includes/qmn_options_tools_tab.php +++ b/includes/qmn_options_tools_tab.php @@ -1,8 +1,10 @@ Tools/Add-Ons"; + global $mlwQuizMasterNext; + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Tools", 'mlw_options_tools_tab_content'); } +add_action("plugins_loaded", 'qmn_settings_tools_tab'); function mlw_options_tools_tab_content() { global $wpdb; @@ -77,6 +79,4 @@ function mlw_options_tools_tab_content() From b087b34c9425184141a07a730145a73ac31cddea Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 13:38:46 -0500 Subject: [PATCH 074/184] Use New Plugin Helper To Register Tab --- includes/qmn_options_preview_tab.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/qmn_options_preview_tab.php b/includes/qmn_options_preview_tab.php index c428a8028..f36c2f4a3 100644 --- a/includes/qmn_options_preview_tab.php +++ b/includes/qmn_options_preview_tab.php @@ -1,8 +1,10 @@ Preview (Beta)"; + global $mlwQuizMasterNext; + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Preview", 'mlw_options_preview_tab_content'); } +add_action("plugins_loaded", 'qmn_settings_preview_tab'); function mlw_options_preview_tab_content() { @@ -14,6 +16,4 @@ function mlw_options_preview_tab_content() From 604767298964809d2fa8cc4a2384d180ec16032f Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 15:59:38 -0500 Subject: [PATCH 075/184] Started Building Quiz Manager Class --- includes/qmn_quiz.php | 53 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index 75fc04b90..5ab4d9de0 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -1,7 +1,54 @@ add_hooks(); + } + public function add_hooks() + { + add_shortcode('mlw_quizmaster', array($this, 'display_shortcode')); + } + + public function display_shortcode($atts) + { + extract(shortcode_atts(array( + 'quiz' => 0 + ), $atts)); + + global $wpdb; + global $mlwQuizMasterNext; + global $qmn_allowed_visit = true; + $mlwQuizMasterNext->quizCreator->set_id($quiz); + date_default_timezone_set(get_option('timezone_string')); + $return_display = ''; + $mlw_qmn_section_count = 1; + $mlw_qmn_section_limit = 0; + $mlw_quiz_options = $this->load_quiz_options($quiz); + } + + public function load_quiz_options($quiz_id) + { + return $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$wpdb->prefix.'mlw_quizzes WHERE quiz_id=%d AND deleted=0', $quiz_id)); + } + + public function load_questions($quiz_id, $quiz_options) + { + $order_by_sql = "ORDER BY question_order ASC"; + $limit_sql = ''; + if ($quiz_options->randomness_order == 1 || $quiz_options->randomness_order == 2) + { + $order_by_sql = "ORDER BY rand()"; + } + if ($quiz_options->question_from_total != 0) + { + $limit_sql = " LIMIT ".$mlw_quiz_options->question_from_total; + } + return $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."mlw_questions WHERE quiz_id=%d AND deleted=0 ".$order_by_sql.$limit_sql, $quiz_id)); + } +} + + function mlw_quiz_shortcode($atts) { extract(shortcode_atts(array( From dff5249c3f469423923bd7c2ed9a5a1876e34bd1 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 16:55:16 -0500 Subject: [PATCH 076/184] Continuing Converting To Quiz Manager --- includes/qmn_quiz.php | 473 ++++++++++++++++++++++-------------------- 1 file changed, 244 insertions(+), 229 deletions(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index 5ab4d9de0..9bd360a32 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -9,29 +9,50 @@ public function add_hooks() { add_shortcode('mlw_quizmaster', array($this, 'display_shortcode')); } - + public function display_shortcode($atts) { extract(shortcode_atts(array( 'quiz' => 0 ), $atts)); - + global $wpdb; global $mlwQuizMasterNext; global $qmn_allowed_visit = true; $mlwQuizMasterNext->quizCreator->set_id($quiz); date_default_timezone_set(get_option('timezone_string')); $return_display = ''; - $mlw_qmn_section_count = 1; - $mlw_qmn_section_limit = 0; - $mlw_quiz_options = $this->load_quiz_options($quiz); + $qmn_quiz_options = $this->load_quiz_options($quiz); + $qmn_quiz_questions = $this->load_questions($quiz, $qmn_quiz_options); + $qmn_quiz_answers = $this->create_answer_array($qmn_quiz_questions); + + $qmn_array_for_variables = array( + 'quiz_name' => $mlw_quiz_options->quiz_name, + 'quiz_id' => $mlw_quiz_options->quiz_id + ); + + $return_display = apply_filters('qmn_begin_shortcode', $return_display, $qmn_quiz_options, $qmn_array_for_variables); + + if ($qmn_allowed_visit && !isset($_POST["complete_quiz"]) && $qmn_quiz_options->quiz_name != '') + { + $return_display .= $this->display_quiz($return_display, $qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_answers, $qmn_array_for_variables); + } + elseif (isset($_POST["complete_quiz"]) && $_POST["complete_quiz"] == "confirmation") + { + $return_display .= $this->display_results(); + } + else + { + //return $return_display; + } + return $return_display; } - + public function load_quiz_options($quiz_id) { return $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$wpdb->prefix.'mlw_quizzes WHERE quiz_id=%d AND deleted=0', $quiz_id)); } - + public function load_questions($quiz_id, $quiz_options) { $order_by_sql = "ORDER BY question_order ASC"; @@ -46,130 +67,125 @@ public function load_questions($quiz_id, $quiz_options) } return $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."mlw_questions WHERE quiz_id=%d AND deleted=0 ".$order_by_sql.$limit_sql, $quiz_id)); } -} - - -function mlw_quiz_shortcode($atts) -{ - extract(shortcode_atts(array( - 'quiz' => 0 - ), $atts)); - - global $mlwQuizMasterNext; - $mlwQuizMasterNext->quizCreator->set_id($quiz); - date_default_timezone_set(get_option('timezone_string')); - - /* - Code before loading the quiz - */ - - //Variables needed throughout script - $mlw_quiz_id = intval($quiz); - $GLOBALS['mlw_qmn_quiz'] = $mlw_quiz_id; - $mlw_display = ""; - global $wpdb; - $mlw_qmn_isAllowed = true; - $mlw_qmn_section_count = 1; - $mlw_qmn_section_limit = 0; - - - //Load quiz - $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_quizzes" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0'"; - $mlw_quiz_options = $wpdb->get_results($sql); - - foreach($mlw_quiz_options as $mlw_eaches) { - $mlw_quiz_options = $mlw_eaches; - break; - } - - $mlw_qmn_quiz_options_array = array( - 'quiz_name' => $mlw_quiz_options->quiz_name, - 'quiz_id' => $mlw_quiz_options->quiz_id - ); - //Check if user is required to be checked in - if ( $mlw_quiz_options->require_log_in == 1 && !is_user_logged_in() ) + public function create_answer_array($questions) { - $mlw_message = htmlspecialchars_decode($mlw_quiz_options->require_log_in_text, ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array); - $mlw_message = str_replace( "\n" , "
    ", $mlw_message); - $mlw_display = $mlw_message; - $mlw_display .= wp_login_form( array('echo' => false) ); - return $mlw_display; - $mlw_qmn_isAllowed = false; + //Load and prepare answer arrays + $mlw_qmn_answer_arrays = array(); + foreach($questions as $mlw_question_info) { + if (is_serialized($mlw_question_info->answer_array) && is_array(@unserialize($mlw_question_info->answer_array))) + { + $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array); + $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each; + } + else + { + $mlw_answer_array_correct = array(0, 0, 0, 0, 0, 0); + $mlw_answer_array_correct[$mlw_question_info->correct_answer-1] = 1; + $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = array( + array($mlw_question_info->answer_one, $mlw_question_info->answer_one_points, $mlw_answer_array_correct[0]), + array($mlw_question_info->answer_two, $mlw_question_info->answer_two_points, $mlw_answer_array_correct[1]), + array($mlw_question_info->answer_three, $mlw_question_info->answer_three_points, $mlw_answer_array_correct[2]), + array($mlw_question_info->answer_four, $mlw_question_info->answer_four_points, $mlw_answer_array_correct[3]), + array($mlw_question_info->answer_five, $mlw_question_info->answer_five_points, $mlw_answer_array_correct[4]), + array($mlw_question_info->answer_six, $mlw_question_info->answer_six_points, $mlw_answer_array_correct[5])); + } + } + return $mlw_qmn_answer_arrays; } - //Check if date is inside scheduled timeframe - if (is_serialized($mlw_quiz_options->scheduled_timeframe) && is_array(@unserialize($mlw_quiz_options->scheduled_timeframe))) + public function display_quiz($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_answers, $qmn_array_for_variables) { - $qmn_scheduled_timeframe = @unserialize($mlw_quiz_options->scheduled_timeframe); - if ($qmn_scheduled_timeframe["start"] != '' && $qmn_scheduled_timeframe["end"] != '') + global $qmn_allowed_visit; + $quiz_display = ''; + $quiz_display = apply_filters('qmn_begin_quiz', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) + if (!$qmn_allowed_visit) { - $qmn_scheduled_start = strtotime($qmn_scheduled_timeframe["start"]); - $qmn_scheduled_end = strtotime($qmn_scheduled_timeframe["end"]) + 86399; ///Added seconds to bring time to 11:59:59 PM of given day - if (time() < $qmn_scheduled_start | time() > $qmn_scheduled_end) - { - $mlw_message = htmlspecialchars_decode($mlw_quiz_options->scheduled_timeframe_text, ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array); - $mlw_message = str_replace( "\n" , "
    ", $mlw_message); - $mlw_display = $mlw_message; - return $mlw_display; - $mlw_qmn_isAllowed = false; - } + return $quiz_display; + } + wp_enqueue_script( 'json2' ); + wp_enqueue_script( 'jquery' ); + wp_enqueue_script( 'jquery-ui-core' ); + wp_enqueue_script( 'jquery-effects-core' ); + wp_enqueue_script( 'jquery-effects-slide' ); + wp_enqueue_script( 'jquery-ui-dialog' ); + wp_enqueue_script( 'jquery-ui-button' ); + wp_enqueue_script( 'jquery-ui-tooltip' ); + wp_enqueue_style( 'qmn_jquery_redmond_theme', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css' ); + + wp_enqueue_script( 'qmn_quiz', plugins_url( 'js/qmn_quiz.js' , __FILE__ ) ); + wp_enqueue_style( 'qmn_quiz_style', plugins_url( 'css/qmn_quiz.css' , __FILE__ ) ); + wp_enqueue_script( 'math_jax', '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' ); + + if ($qmn_quiz_options->theme_selected == "default") + { + echo ""; + } + else + { + echo "theme_selected)."' rel='stylesheet' />"; } + + $qmn_total_questions = 0; + $mlw_qmn_section_count = 1; + $mlw_qmn_section_limit = 0; + + $quiz_display .= "
    "; + $quiz_display .= "
    "; + $quiz_display .= ""; + $quiz_display .= $this->display_begin_section($qmn_quiz_options, $qmn_array_for_variables); + $quiz_display .= $this->display_questions($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_answers); + $quiz_display .= $this->display_comment_section(); + $quiz_display .= $this->display_end_section(); + + $quiz_display .= "If you are human, leave this field blank or you will be considered spam:"; + $quiz_display .= ""; + $quiz_display .= ""; + $quiz_display .= ""; + $quiz_display .= ""; + $quiz_display .= ""; + $quiz_display .= "
    "; + $quiz_display .= "
    "; + $quiz_display .= "
    "; + $quiz_display .= ""; + + return $quiz_display; } - //Check to see if there is limit on the amount of tries - if ( $mlw_quiz_options->total_user_tries != 0 && is_user_logged_in() ) + public function display_begin_section($qmn_quiz_options, $qmn_array_for_variables) { - $current_user = wp_get_current_user(); - $mlw_qmn_user_try_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE email='%s' AND deleted='0' AND quiz_id=%d", $current_user->user_email, $mlw_quiz_id ) ); - if ($mlw_qmn_user_try_count >= $mlw_quiz_options->total_user_tries) { $mlw_qmn_isAllowed = false; } - } + $section_display = "
    "; + $message_before = htmlspecialchars_decode($qmn_quiz_options->message_before, ENT_QUOTES); + $message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_before, $qmn_array_for_variables); - //Load questions - $sql = "SELECT * FROM " . $wpdb->prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' "; - if ($mlw_quiz_options->randomness_order == 0) - { - $sql .= "ORDER BY question_order ASC"; + $section_display .= "$message_before
    "; + $section_display .= "
    "; + + if ($qmn_quiz_options->contact_info_location == 0) + { + $section_display .= mlwDisplayContactInfo($qmn_quiz_options); + } + $section_display .= "
    "; + return $section_display; } - if ($mlw_quiz_options->randomness_order == 1 || $mlw_quiz_options->randomness_order == 2) + + public function display_questions($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_answers) { - $sql .= "ORDER BY rand()"; + } - if ($mlw_quiz_options->question_from_total != 0) + + public function display_comment_section() { - $sql .= " LIMIT ".$mlw_quiz_options->question_from_total; + } - $mlw_questions = $wpdb->get_results($sql); + public function display_end_section() + { - //Load and prepare answer arrays - $mlw_qmn_answer_arrays = array(); - foreach($mlw_questions as $mlw_question_info) { - if (is_serialized($mlw_question_info->answer_array) && is_array(@unserialize($mlw_question_info->answer_array))) - { - $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array); - $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each; - } - else - { - $mlw_answer_array_correct = array(0, 0, 0, 0, 0, 0); - $mlw_answer_array_correct[$mlw_question_info->correct_answer-1] = 1; - $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = array( - array($mlw_question_info->answer_one, $mlw_question_info->answer_one_points, $mlw_answer_array_correct[0]), - array($mlw_question_info->answer_two, $mlw_question_info->answer_two_points, $mlw_answer_array_correct[1]), - array($mlw_question_info->answer_three, $mlw_question_info->answer_three_points, $mlw_answer_array_correct[2]), - array($mlw_question_info->answer_four, $mlw_question_info->answer_four_points, $mlw_answer_array_correct[3]), - array($mlw_question_info->answer_five, $mlw_question_info->answer_five_points, $mlw_answer_array_correct[4]), - array($mlw_question_info->answer_six, $mlw_question_info->answer_six_points, $mlw_answer_array_correct[5])); - } } - - //Variables to load if quiz has been taken - if (isset($_POST["complete_quiz"]) && $_POST["complete_quiz"] == "confirmation") + public function display_results() { $mlw_success = $_POST["complete_quiz"]; $mlw_user_name = isset($_POST["mlwUserName"]) ? $_POST["mlwUserName"] : 'None'; @@ -179,124 +195,21 @@ function mlw_quiz_shortcode($atts) $mlw_qmn_timer = isset($_POST["timer"]) ? $_POST["timer"] : 0; $mlw_spam_email = $_POST["email"]; } +} - wp_enqueue_script( 'json2' ); - wp_enqueue_script( 'jquery' ); - wp_enqueue_script( 'jquery-ui-core' ); - wp_enqueue_script( 'jquery-effects-core' ); - wp_enqueue_script( 'jquery-effects-slide' ); - wp_enqueue_script( 'jquery-ui-dialog' ); - wp_enqueue_script( 'jquery-ui-button' ); - wp_enqueue_script( 'jquery-ui-tooltip' ); - wp_enqueue_style( 'qmn_jquery_redmond_theme', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css' ); - - wp_enqueue_script( 'qmn_quiz', plugins_url( 'js/qmn_quiz.js' , __FILE__ ) ); - wp_enqueue_style( 'qmn_quiz_style', plugins_url( 'css/qmn_quiz.css' , __FILE__ ) ); - wp_enqueue_script( 'math_jax', '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' ); - - if ($mlw_quiz_options->theme_selected == "default") - { - echo ""; - } - else - { - echo "theme_selected)."' rel='stylesheet' />"; - } - - /* - The following code is for displaying the quiz and completion screen - */ - - //If there is no quiz for the shortcode provided - if ($mlw_quiz_options->quiz_name == "") - { - $mlw_display .= "It appears that this quiz is not set up correctly."; - return $mlw_display; - } +function mlw_quiz_shortcode($atts) +{ + //Variables needed throughout script + $mlw_quiz_id = intval($quiz); + $GLOBALS['mlw_qmn_quiz'] = $mlw_quiz_id; //Display Quiz if (!isset($_POST["complete_quiz"]) && $mlw_quiz_options->quiz_name != "" && $mlw_qmn_isAllowed) { - //Check if total entries are limited - if ( $mlw_quiz_options->limit_total_entries != 0 ) - { - $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", $mlw_quiz_id ) ); - if ($mlw_qmn_entries_count >= $mlw_quiz_options->limit_total_entries) - { - $mlw_message = htmlspecialchars_decode($mlw_quiz_options->limit_total_entries_text, ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array); - $mlw_display = $mlw_message; - return $mlw_display; - $mlw_qmn_isAllowed = false; - } - } - $mlw_qmn_total_questions = 0; - //Calculate number of pages if pagination is turned on - if ($mlw_quiz_options->pagination != 0) - { - $mlw_qmn_section_limit = 2 + count($mlw_questions); - if ($mlw_quiz_options->comment_section == 0) - { - $mlw_qmn_section_limit = $mlw_qmn_section_limit + 1; - } - //Gather text for pagination buttons - $mlw_qmn_pagination_text = ""; - if (is_serialized($mlw_quiz_options->pagination_text) && is_array(@unserialize($mlw_quiz_options->pagination_text))) - { - $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text); - } - else - { - $mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text); - } - ?> - - timer_limit != 0) - { - ?> -
    - - quiz_views; - $mlw_views += 1; - $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views='".$mlw_views."' WHERE quiz_id=".$mlw_quiz_id; - $results = $wpdb->query( $update ); - - if ( $mlw_quiz_options->pagination != 0) { $mlw_display .= ""; } - - //Begin the quiz - $mlw_display .= "
    "; - $mlw_display .= "
    "; - $mlw_display .= ""; - $mlw_display .= "
    "; - $mlw_message_before = htmlspecialchars_decode($mlw_quiz_options->message_before, ENT_QUOTES); - $mlw_message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message_before, $mlw_qmn_quiz_options_array); - $mlw_display .= "".$mlw_message_before."
    "; - $mlw_display .= "
    "; - if ($mlw_quiz_options->contact_info_location == 0) - { - $mlw_display .= mlwDisplayContactInfo($mlw_quiz_options); - } - $mlw_display .= "
    "; //Display the questions foreach($mlw_questions as $mlw_question) { @@ -652,16 +565,7 @@ function mlw_quiz_shortcode($atts) do_action('mlw_qmn_end_quiz_section'); $mlw_display .= ob_get_contents(); ob_end_clean(); - $mlw_display .= "If you are human, leave this field blank or you will be considered spam:"; - $mlw_display .= ""; - $mlw_display .= ""; - $mlw_display .= ""; - $mlw_display .= ""; - $mlw_display .= ""; - $mlw_display .= "
    "; - $mlw_display .= "
    "; - $mlw_display .= "
    "; - $mlw_display .= ""; + } //Display Completion Screen @@ -1211,6 +1115,117 @@ function mlw_quiz_shortcode($atts) } +//Check if user is required to be checked in +if ( $mlw_quiz_options->require_log_in == 1 && !is_user_logged_in() ) +{ + $mlw_message = htmlspecialchars_decode($mlw_quiz_options->require_log_in_text, ENT_QUOTES); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array); + $mlw_message = str_replace( "\n" , "
    ", $mlw_message); + $mlw_display = $mlw_message; + $mlw_display .= wp_login_form( array('echo' => false) ); + return $mlw_display; + $mlw_qmn_isAllowed = false; +} + +//Check if date is inside scheduled timeframe +if (is_serialized($mlw_quiz_options->scheduled_timeframe) && is_array(@unserialize($mlw_quiz_options->scheduled_timeframe))) +{ + $qmn_scheduled_timeframe = @unserialize($mlw_quiz_options->scheduled_timeframe); + if ($qmn_scheduled_timeframe["start"] != '' && $qmn_scheduled_timeframe["end"] != '') + { + $qmn_scheduled_start = strtotime($qmn_scheduled_timeframe["start"]); + $qmn_scheduled_end = strtotime($qmn_scheduled_timeframe["end"]) + 86399; ///Added seconds to bring time to 11:59:59 PM of given day + if (time() < $qmn_scheduled_start | time() > $qmn_scheduled_end) + { + $mlw_message = htmlspecialchars_decode($mlw_quiz_options->scheduled_timeframe_text, ENT_QUOTES); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array); + $mlw_message = str_replace( "\n" , "
    ", $mlw_message); + $mlw_display = $mlw_message; + return $mlw_display; + $mlw_qmn_isAllowed = false; + } + } +} + +//Check to see if there is limit on the amount of tries +if ( $mlw_quiz_options->total_user_tries != 0 && is_user_logged_in() ) +{ + $current_user = wp_get_current_user(); + $mlw_qmn_user_try_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE email='%s' AND deleted='0' AND quiz_id=%d", $current_user->user_email, $mlw_quiz_id ) ); + if ($mlw_qmn_user_try_count >= $mlw_quiz_options->total_user_tries) { $mlw_qmn_isAllowed = false; } +} + +//If there is no quiz for the shortcode provided +if ($mlw_quiz_options->quiz_name == "") +{ + $mlw_display .= "It appears that this quiz is not set up correctly."; + return $mlw_display; +} + +if ( $mlw_quiz_options->limit_total_entries != 0 ) +{ + $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", $mlw_quiz_id ) ); + if ($mlw_qmn_entries_count >= $mlw_quiz_options->limit_total_entries) + { + $mlw_message = htmlspecialchars_decode($mlw_quiz_options->limit_total_entries_text, ENT_QUOTES); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array); + $mlw_display = $mlw_message; + return $mlw_display; + $mlw_qmn_isAllowed = false; + } +} + +if ( $mlw_quiz_options->pagination != 0) { $mlw_display .= ""; } + +//Calculate number of pages if pagination is turned on +if ($mlw_quiz_options->pagination != 0) +{ + $mlw_qmn_section_limit = 2 + count($mlw_questions); + if ($mlw_quiz_options->comment_section == 0) + { + $mlw_qmn_section_limit = $mlw_qmn_section_limit + 1; + } + + //Gather text for pagination buttons + $mlw_qmn_pagination_text = ""; + if (is_serialized($mlw_quiz_options->pagination_text) && is_array(@unserialize($mlw_quiz_options->pagination_text))) + { + $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text); + } + else + { + $mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text); + } + ?> + + timer_limit != 0) +{ + ?> +
    + + quiz_views; +$mlw_views += 1; +$update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views='".$mlw_views."' WHERE quiz_id=".$mlw_quiz_id; +$results = $wpdb->query( $update ); + + + /* This function displays fields to ask for contact information */ From eb25e6d8dac48511dfc0eddb5403437b97368981 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 17:25:09 -0500 Subject: [PATCH 077/184] Finished Moving Quiz Page Into New Class Still have to move results page and miscellaneous functions to work on. --- includes/qmn_quiz.php | 364 +++++++++++++++++++++--------------------- 1 file changed, 184 insertions(+), 180 deletions(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index 9bd360a32..51add9c51 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -27,8 +27,8 @@ public function display_shortcode($atts) $qmn_quiz_answers = $this->create_answer_array($qmn_quiz_questions); $qmn_array_for_variables = array( - 'quiz_name' => $mlw_quiz_options->quiz_name, - 'quiz_id' => $mlw_quiz_options->quiz_id + 'quiz_name' => $qmn_quiz_options->quiz_name, + 'quiz_id' => $qmn_quiz_options->quiz_id ); $return_display = apply_filters('qmn_begin_shortcode', $return_display, $qmn_quiz_options, $qmn_array_for_variables); @@ -45,6 +45,8 @@ public function display_shortcode($atts) { //return $return_display; } + + $return_display = apply_filters('qmn_end_shortcode', $return_display, $qmn_quiz_options, $qmn_array_for_variables); return $return_display; } @@ -63,7 +65,7 @@ public function load_questions($quiz_id, $quiz_options) } if ($quiz_options->question_from_total != 0) { - $limit_sql = " LIMIT ".$mlw_quiz_options->question_from_total; + $limit_sql = " LIMIT ".$quiz_options->question_from_total; } return $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."mlw_questions WHERE quiz_id=%d AND deleted=0 ".$order_by_sql.$limit_sql, $quiz_id)); } @@ -98,7 +100,7 @@ public function display_quiz($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_a { global $qmn_allowed_visit; $quiz_display = ''; - $quiz_display = apply_filters('qmn_begin_quiz', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) + $quiz_display = apply_filters('qmn_begin_quiz', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables); if (!$qmn_allowed_visit) { return $quiz_display; @@ -126,29 +128,29 @@ public function display_quiz($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_a echo "theme_selected)."' rel='stylesheet' />"; } - $qmn_total_questions = 0; + global $qmn_total_questions = 0; $mlw_qmn_section_count = 1; $mlw_qmn_section_limit = 0; $quiz_display .= "
    "; $quiz_display .= "
    "; $quiz_display .= ""; + $quiz_display = apply_filters('qmn_begin_quiz_form', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) $quiz_display .= $this->display_begin_section($qmn_quiz_options, $qmn_array_for_variables); + $quiz_display = apply_filters('qmn_begin_quiz_questions', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) $quiz_display .= $this->display_questions($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_answers); - $quiz_display .= $this->display_comment_section(); + $quiz_display = apply_filters('qmn_before_comment_section', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) + $quiz_display .= $this->display_comment_section($qmn_quiz_options, $qmn_array_for_variables); + $quiz_display = apply_filters('qmn_after_comment_section', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) $quiz_display .= $this->display_end_section(); - - $quiz_display .= "If you are human, leave this field blank or you will be considered spam:"; - $quiz_display .= ""; $quiz_display .= ""; $quiz_display .= ""; $quiz_display .= ""; - $quiz_display .= ""; - $quiz_display .= "
    "; + $quiz_display = apply_filters('qmn_end_quiz_form', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) $quiz_display .= "
    "; $quiz_display .= "
    "; - $quiz_display .= ""; + $quiz_display = apply_filters('qmn_end_quiz', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) return $quiz_display; } @@ -172,47 +174,10 @@ public function display_begin_section($qmn_quiz_options, $qmn_array_for_variable public function display_questions($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_answers) { - - } - - public function display_comment_section() - { - - } - - public function display_end_section() - { - - } - - public function display_results() - { - $mlw_success = $_POST["complete_quiz"]; - $mlw_user_name = isset($_POST["mlwUserName"]) ? $_POST["mlwUserName"] : 'None'; - $mlw_user_comp = isset($_POST["mlwUserComp"]) ? $_POST["mlwUserComp"] : 'None'; - $mlw_user_email = isset($_POST["mlwUserEmail"]) ? $_POST["mlwUserEmail"] : 'None'; - $mlw_user_phone = isset($_POST["mlwUserPhone"]) ? $_POST["mlwUserPhone"] : 'None'; - $mlw_qmn_timer = isset($_POST["timer"]) ? $_POST["timer"] : 0; - $mlw_spam_email = $_POST["email"]; - } -} - - -function mlw_quiz_shortcode($atts) -{ - - //Variables needed throughout script - $mlw_quiz_id = intval($quiz); - $GLOBALS['mlw_qmn_quiz'] = $mlw_quiz_id; - - //Display Quiz - if (!isset($_POST["complete_quiz"]) && $mlw_quiz_options->quiz_name != "" && $mlw_qmn_isAllowed) - { - - - - //Display the questions - foreach($mlw_questions as $mlw_question) { + $question_display = ''; + global $qmn_total_questions; + foreach($qmn_quiz_questions as $mlw_question) + { if (is_serialized($mlw_question->question_settings) && is_array(@unserialize($mlw_question->question_settings))) { $mlw_question_settings = @unserialize($mlw_question->question_settings); @@ -227,17 +192,17 @@ function mlw_quiz_shortcode($atts) $mlw_question_settings['required'] = 1; } $mlw_qmn_section_count = $mlw_qmn_section_count + 1; - $mlw_display .= "
    "; + $question_display .= "
    "; if ($mlw_question->question_type == 0) { - $mlw_display .= ""; - $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1; - if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; } - $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; - $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id]; + $question_display .= ""; + $qmn_total_questions = $qmn_total_questions + 1; + if ($qmn_quiz_options->question_numbering == 1) { $question_display .= $qmn_total_questions.") "; } + $question_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; + $mlw_qmn_answer_array = $qmn_quiz_answers[$mlw_question->question_id]; if (is_array($mlw_qmn_answer_array)) { - if ($mlw_quiz_options->randomness_order == 2) + if ($qmn_quiz_options->randomness_order == 2) { shuffle($mlw_qmn_answer_array); } @@ -247,56 +212,56 @@ function mlw_quiz_shortcode($atts) $mlw_answer_total++; if ($mlw_qmn_answer_each[0] != "") { - $mlw_display .= " "; - $mlw_display .= "
    "; + $question_display .= " "; + $question_display .= "
    "; } } - $mlw_display .= ""; + $question_display .= ""; } else { if ($mlw_question->answer_one != "") { - $mlw_display .= " "; - $mlw_display .= "
    "; + $question_display .= " "; + $question_display .= "
    "; } if ($mlw_question->answer_two != "") { - $mlw_display .= " "; - $mlw_display .= "
    "; + $question_display .= " "; + $question_display .= "
    "; } if ($mlw_question->answer_three != "") { - $mlw_display .= " "; - $mlw_display .= "
    "; + $question_display .= " "; + $question_display .= "
    "; } if ($mlw_question->answer_four != "") { - $mlw_display .= " "; - $mlw_display .= "
    "; + $question_display .= " "; + $question_display .= "
    "; } if ($mlw_question->answer_five != "") { - $mlw_display .= " "; - $mlw_display .= "
    "; + $question_display .= " "; + $question_display .= "
    "; } if ($mlw_question->answer_six != "") { - $mlw_display .= " "; - $mlw_display .= "
    "; + $question_display .= " "; + $question_display .= "
    "; } } } elseif ($mlw_question->question_type == 4) { - $mlw_display .= ""; - $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1; - if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; } - $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; + $question_display .= ""; + $qmn_total_questions = $qmn_total_questions + 1; + if ($qmn_quiz_options->question_numbering == 1) { $question_display .= $qmn_total_questions.") "; } + $question_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id]; if (is_array($mlw_qmn_answer_array)) { - if ($mlw_quiz_options->randomness_order == 2) + if ($qmn_quiz_options->randomness_order == 2) { shuffle($mlw_qmn_answer_array); } @@ -306,23 +271,23 @@ function mlw_quiz_shortcode($atts) $mlw_answer_total++; if ($mlw_qmn_answer_each[0] != "") { - $mlw_display .= ""; - $mlw_display .= " "; - $mlw_display .= "
    "; + $question_display .= ""; + $question_display .= " "; + $question_display .= "
    "; } } } } elseif ($mlw_question->question_type == 10) { - $mlw_display .= ""; - $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1; - if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; } - $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; + $question_display .= ""; + $qmn_total_questions = $qmn_total_questions + 1; + if ($qmn_quiz_options->question_numbering == 1) { $question_display .= $qmn_total_questions.") "; } + $question_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id]; if (is_array($mlw_qmn_answer_array)) { - if ($mlw_quiz_options->randomness_order == 2) + if ($qmn_quiz_options->randomness_order == 2) { shuffle($mlw_qmn_answer_array); } @@ -332,22 +297,22 @@ function mlw_quiz_shortcode($atts) $mlw_answer_total++; if ($mlw_qmn_answer_each[0] != "") { - $mlw_display .= ""; - $mlw_display .= " "; + $question_display .= ""; + $question_display .= " "; } } } } elseif ($mlw_question->question_type == 1) { - $mlw_display .= ""; - $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1; - if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; } - $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; + $question_display .= ""; + $qmn_total_questions = $qmn_total_questions + 1; + if ($qmn_quiz_options->question_numbering == 1) { $question_display .= $qmn_total_questions.") "; } + $question_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id]; if (is_array($mlw_qmn_answer_array)) { - if ($mlw_quiz_options->randomness_order == 2) + if ($qmn_quiz_options->randomness_order == 2) { shuffle($mlw_qmn_answer_array); } @@ -357,51 +322,51 @@ function mlw_quiz_shortcode($atts) $mlw_answer_total++; if ($mlw_qmn_answer_each[0] != "") { - $mlw_display .= " "; + $question_display .= " "; } } - $mlw_display .= ""; + $question_display .= ""; } else { if ($mlw_question->answer_one != "") { - $mlw_display .= "".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES); + $question_display .= "".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES); } if ($mlw_question->answer_two != "") { - $mlw_display .= "".htmlspecialchars_decode($mlw_question->answer_two, ENT_QUOTES); + $question_display .= "".htmlspecialchars_decode($mlw_question->answer_two, ENT_QUOTES); } if ($mlw_question->answer_three != "") { - $mlw_display .= "".htmlspecialchars_decode($mlw_question->answer_three, ENT_QUOTES); + $question_display .= "".htmlspecialchars_decode($mlw_question->answer_three, ENT_QUOTES); } if ($mlw_question->answer_four != "") { - $mlw_display .= "".htmlspecialchars_decode($mlw_question->answer_four, ENT_QUOTES); + $question_display .= "".htmlspecialchars_decode($mlw_question->answer_four, ENT_QUOTES); } if ($mlw_question->answer_five != "") { - $mlw_display .= "".htmlspecialchars_decode($mlw_question->answer_five, ENT_QUOTES); + $question_display .= "".htmlspecialchars_decode($mlw_question->answer_five, ENT_QUOTES); } if ($mlw_question->answer_six != "") { - $mlw_display .= "".htmlspecialchars_decode($mlw_question->answer_six, ENT_QUOTES); + $question_display .= "".htmlspecialchars_decode($mlw_question->answer_six, ENT_QUOTES); } } - $mlw_display .= "
    "; + $question_display .= "
    "; } elseif ($mlw_question->question_type == 2) { - $mlw_display .= ""; - $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1; - if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; } - $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; - $mlw_display .= ""; $mlw_qmn_answer_array = $mlw_qmn_answer_arrays[$mlw_question->question_id]; if (is_array($mlw_qmn_answer_array)) { - if ($mlw_quiz_options->randomness_order == 2) + if ($qmn_quiz_options->randomness_order == 2) { shuffle($mlw_qmn_answer_array); } @@ -411,7 +376,7 @@ function mlw_quiz_shortcode($atts) $mlw_answer_total++; if ($mlw_qmn_answer_each[0] != "") { - $mlw_display .= ""; + $question_display .= ""; } } } @@ -419,76 +384,76 @@ function mlw_quiz_shortcode($atts) { if ($mlw_question->answer_one != "") { - $mlw_display .= ""; + $question_display .= ""; } if ($mlw_question->answer_two != "") { - $mlw_display .= ""; + $question_display .= ""; } if ($mlw_question->answer_three != "") { - $mlw_display .= ""; + $question_display .= ""; } if ($mlw_question->answer_four != "") { - $mlw_display .= ""; + $question_display .= ""; } if ($mlw_question->answer_five != "") { - $mlw_display .= ""; + $question_display .= ""; } if ($mlw_question->answer_six != "") { - $mlw_display .= ""; + $question_display .= ""; } } - $mlw_display .= ""; - $mlw_display .= "
    "; + $question_display .= ""; + $question_display .= "
    "; } elseif ($mlw_question->question_type == 5) { - $mlw_display .= ""; - $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1; - if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; } - $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; + $question_display .= ""; + $qmn_total_questions = $qmn_total_questions + 1; + if ($qmn_quiz_options->question_numbering == 1) { $question_display .= $qmn_total_questions.") "; } + $question_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredText";} else {$mlw_requireClass = "";} - $mlw_display .= ""; - $mlw_display .= "
    "; + $question_display .= ""; + $question_display .= "
    "; } elseif ($mlw_question->question_type == 6) { - $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES); - $mlw_display .= "
    "; + $question_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES); + $question_display .= "
    "; } elseif ($mlw_question->question_type == 7) { - $mlw_display .= ""; - $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1; - if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; } - $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; + $question_display .= ""; + $qmn_total_questions = $qmn_total_questions + 1; + if ($qmn_quiz_options->question_numbering == 1) { $question_display .= $qmn_total_questions.") "; } + $question_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredNumber";} else {$mlw_requireClass = "";} - $mlw_display .= ""; - $mlw_display .= "
    "; + $question_display .= ""; + $question_display .= "
    "; } elseif ($mlw_question->question_type == 8) { if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredCheck";} else {$mlw_requireClass = "";} - $mlw_display .= ""; - $mlw_display .= ""; - $mlw_display .= "
    "; + $question_display .= ""; + $question_display .= ""; + $question_display .= "
    "; } elseif ($mlw_question->question_type == 9) { if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredCaptcha";} else {$mlw_requireClass = "";} - $mlw_display .= "
    "; - $mlw_display .= ""; - $mlw_display .= "
    "; - $mlw_display .= ""; - $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."
    "; - $mlw_display .= ""; - $mlw_display .= ""; - $mlw_display .= "
    "; - $mlw_display .= ""; ?> @@ -585,63 +586,93 @@ function mlw_quiz_shortcode($atts) window.sessionStorage.setItem('mlw_started_quiz', "no"); prefix . "mlw_questions" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0' "; - if ($mlw_quiz_options->randomness_order == 0) - { - $sql .= "ORDER BY question_order ASC"; + $qmn_array_for_variables = array_merge($qmn_array_for_variables,$this->check_answers($qmn_quiz_questions, $qmn_quiz_answers, $qmn_quiz_options, $qmn_array_for_variables)); + $result_display = apply_filters('qmn_after_check_answers', $result_display, $qmn_quiz_options, $qmn_array_for_variables); + $qmn_array_for_variables['comments'] = $this->check_comment_section($qmn_quiz_options, $qmn_array_for_variables); + $result_display = apply_filters('qmn_after_check_comments', $result_display, $qmn_quiz_options, $qmn_array_for_variables); + $qmn_array_for_variables['certificate_link'] = $this->generate_certificate($qmn_quiz_options, $qmn_array_for_variables); + $result_display = apply_filters('qmn_after_generate_certificate', $result_display, $qmn_quiz_options, $qmn_array_for_variables); + $result_display .= $this->display_results_text($qmn_quiz_options, $qmn_array_for_variables); + $result_display = apply_filters('qmn_after_results_text', $result_display, $qmn_quiz_options, $qmn_array_for_variables); + $result_display .= $this->display_social($qmn_quiz_options, $qmn_array_for_variables); + $result_display = apply_filters('qmn_after_social_media', $result_display, $qmn_quiz_options, $qmn_array_for_variables); + $this->send_user_email($qmn_quiz_options, $qmn_array_for_variables); + $result_display = apply_filters('qmn_after_send_user_email', $result_display, $qmn_quiz_options, $qmn_array_for_variables); + $this->send_admin_email($qmn_quiz_options, $qmn_array_for_variables); + $result_display = apply_filters('qmn_after_send_admin_email', $result_display, $qmn_quiz_options, $qmn_array_for_variables); + + //Save the results into database + $mlw_quiz_results_array = array( intval($qmn_array_for_variables['timer']), $qmn_array_for_variables['question_answers_array'], htmlspecialchars(stripslashes($qmn_array_for_variables['comments']), ENT_QUOTES)); + $mlw_quiz_results = serialize($mlw_quiz_results_array); + + global $wpdb; + $table_name = $wpdb->prefix . "mlw_results"; + $results_insert = $wpdb->insert( + $table_name, + array( + 'quiz_id' => $qmn_array_for_variables['quiz_id'], + 'quiz_name' => $qmn_array_for_variables['quiz_name'], + 'quiz_system' => $qmn_array_for_variables['quiz_system'], + 'point_score' => $qmn_array_for_variables['total_points'], + 'correct_score' => $qmn_array_for_variables['total_score'], + 'correct' => $qmn_array_for_variables['total_correct'], + 'total' => $qmn_array_for_variables['total_questions'], + 'name' => $qmn_array_for_variables['user_name'], + 'business' => $qmn_array_for_variables['user_business'], + 'email' => $qmn_array_for_variables['user_email'], + 'phone' => $qmn_array_for_variables['user_phone'], + 'user' => $qmn_array_for_variables['user_id'], + 'time_taken' => date("h:i:s A m/d/Y"), + 'time_taken_real' => date("Y-m-d H:i:s"), + 'quiz_results' => $mlw_quiz_results, + 'deleted' => 0 + ), + array( + '%d', + '%s', + '%d', + '%d', + '%d', + '%d', + '%d', + '%s', + '%s', + '%s', + '%s', + '%d', + '%s', + '%s', + '%s', + '%d' + ) + ); + $result_display = apply_filters('qmn_end_results', $result_display, $qmn_quiz_options, $qmn_array_for_variables); + //Legacy Code + do_action('mlw_qmn_load_results_page', $wpdb->insert_id, $mlw_quiz_options->quiz_settings); } - if ($mlw_quiz_options->randomness_order == 1 || $mlw_quiz_options->randomness_order == 2) + else { - $sql .= "ORDER BY rand()"; - } - $mlw_questions = $wpdb->get_results($sql); - - //Load and prepare answer arrays - $mlw_qmn_loaded_answer_arrays = array(); - foreach($mlw_questions as $mlw_question_info) { - if (is_serialized($mlw_question_info->answer_array) && is_array(@unserialize($mlw_question_info->answer_array))) - { - $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array); - $mlw_qmn_loaded_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each; - } - else - { - $mlw_answer_array_correct = array(0, 0, 0, 0, 0, 0); - $mlw_answer_array_correct[$mlw_question_info->correct_answer-1] = 1; - $mlw_qmn_loaded_answer_arrays[$mlw_question_info->question_id] = array( - array($mlw_question_info->answer_one, $mlw_question_info->answer_one_points, $mlw_answer_array_correct[0]), - array($mlw_question_info->answer_two, $mlw_question_info->answer_two_points, $mlw_answer_array_correct[1]), - array($mlw_question_info->answer_three, $mlw_question_info->answer_three_points, $mlw_answer_array_correct[2]), - array($mlw_question_info->answer_four, $mlw_question_info->answer_four_points, $mlw_answer_array_correct[3]), - array($mlw_question_info->answer_five, $mlw_question_info->answer_five_points, $mlw_answer_array_correct[4]), - array($mlw_question_info->answer_six, $mlw_question_info->answer_six_points, $mlw_answer_array_correct[5])); - } + $result_display .= "Thank you."; } + return $result_display; + } - //Variables needed for scoring + public function check_answers($qmn_quiz_questions, $qmn_quiz_answers, $qmn_quiz_options, $qmn_array_for_variables) + { $mlw_points = 0; $mlw_correct = 0; - $mlw_total_questions = 0; $mlw_total_score = 0; $mlw_question_answers = ""; isset($_POST["total_questions"]) ? $mlw_total_questions = intval($_POST["total_questions"]) : $mlw_total_questions = 0; - //Update the amount of times the quiz has been taken - $mlw_taken = $mlw_quiz_options->quiz_taken; - $mlw_taken += 1; - $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_taken='".$mlw_taken."' WHERE quiz_id=".$mlw_quiz_id; - $results = $wpdb->query( $update ); - - //See which answers were correct and award points if necessary $mlw_user_text = ""; $mlw_correct_text = ""; $qmn_correct = "incorrect"; $mlw_qmn_answer_array = array(); - foreach($mlw_questions as $mlw_question) { + foreach($qmn_quiz_questions as $mlw_question) + { $mlw_user_text = ""; $mlw_correct_text = ""; $qmn_correct = "incorrect"; @@ -657,7 +688,7 @@ function mlw_quiz_shortcode($atts) { $mlw_user_answer = " "; } - $mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id]; + $mlw_qmn_question_answers_array = $qmn_quiz_answers[$mlw_question->question_id]; foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each) { if (htmlspecialchars(stripslashes($mlw_user_answer), ENT_QUOTES) == esc_attr($mlw_qmn_question_answers_each[0])) @@ -687,7 +718,7 @@ function mlw_quiz_shortcode($atts) $mlw_user_answer = " "; } $mlw_user_text .= strval(stripslashes(htmlspecialchars_decode($mlw_user_answer, ENT_QUOTES))); - $mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id]; + $mlw_qmn_question_answers_array = $qmn_quiz_answers[$mlw_question->question_id]; foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each) { $mlw_correct_text = strval(htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES)); @@ -704,7 +735,7 @@ function mlw_quiz_shortcode($atts) { $mlw_qmn_user_correct_answers = 0; $mlw_qmn_total_correct_answers = 0; - $mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id]; + $mlw_qmn_question_answers_array = $qmn_quiz_answers[$mlw_question->question_id]; $mlw_qmn_total_answers = count($mlw_qmn_question_answers_array); foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each) { @@ -751,11 +782,12 @@ function mlw_quiz_shortcode($atts) $mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $mlw_qm_question_comment, $mlw_question_answer_display); $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($mlw_question->question_answer_info, ENT_QUOTES), $mlw_question_answer_display); - $mlw_qmn_answer_array[] = array($mlw_question->question_name, htmlspecialchars($mlw_user_text, ENT_QUOTES), htmlspecialchars($mlw_correct_text, ENT_QUOTES), htmlspecialchars(stripslashes($mlw_qm_question_comment), ENT_QUOTES), "correct" => $qmn_correct, "id" => $mlw_question->question_id); + $mlw_qmn_answer_array[] = apply_filters('qmn_answer_array', array($mlw_question->question_name, htmlspecialchars($mlw_user_text, ENT_QUOTES), htmlspecialchars($mlw_correct_text, ENT_QUOTES), htmlspecialchars(stripslashes($mlw_qm_question_comment), ENT_QUOTES), "correct" => $qmn_correct, "id" => $mlw_question->question_id), $qmn_quiz_options, $qmn_array_for_variables); $mlw_question_answers .= $mlw_question_answer_display; $mlw_question_answers .= "
    "; } + } //Calculate Total Percent Score And Average Points Only If Total Questions Doesn't Equal Zero To Avoid Division By Zero Error @@ -770,54 +802,45 @@ function mlw_quiz_shortcode($atts) $mlw_average_points = 0; } - //Prepare comment section if set - if (isset($_POST["mlwQuizComments"])) - { - $mlw_qm_quiz_comments = $_POST["mlwQuizComments"]; - } - else - { - $mlw_qm_quiz_comments = ""; - } - - $mlw_qmn_result_array = array( - 'quiz_id' => $mlw_quiz_id, - 'quiz_name' => $mlw_quiz_options->quiz_name, - 'quiz_system' => $mlw_quiz_options->system, + return array( 'total_points' => $mlw_points, 'total_score' => $mlw_total_score, 'total_correct' => $mlw_correct, 'total_questions' => $mlw_total_questions, - 'user_name' => $mlw_user_name, - 'user_business' => $mlw_user_comp, - 'user_email' => $mlw_user_email, - 'user_phone' => $mlw_user_phone, - 'user_id' => get_current_user_id(), 'question_answers_display' => $mlw_question_answers, 'question_answers_array' => $mlw_qmn_answer_array, - 'timer' => $mlw_qmn_timer, - 'comments' => $mlw_qm_quiz_comments, - 'certificate_link' => '' ); + } + + public function check_comment_section($qmn_quiz_options, $qmn_array_for_variables) + { + $qmn_quiz_comments = ""; + if (isset($_POST["mlwQuizComments"])) + { + $qmn_quiz_comments = $_POST["mlwQuizComments"]; + } + return apply_filters('qmn_returned_comments', $qmn_quiz_comments, $qmn_quiz_options, $qmn_array_for_variables); + } - //Prepare Certificate + public function generate_certificate($qmn_quiz_options, $qmn_array_for_variables) + { $mlw_certificate_link = ""; - if (is_serialized($mlw_quiz_options->certificate_template) && is_array(@unserialize($mlw_quiz_options->certificate_template))) + if (is_serialized($qmn_quiz_options->certificate_template) && is_array(@unserialize($qmn_quiz_options->certificate_template))) { - $mlw_certificate_options = unserialize($mlw_quiz_options->certificate_template); + $mlw_certificate_options = unserialize($qmn_quiz_options->certificate_template); } else { $mlw_certificate_options = array('Enter title here', 'Enter text here', '', '', 1); } - if ($mlw_certificate_options[4] == 0) - { - $mlw_message_certificate = $mlw_certificate_options[1]; - $mlw_message_certificate = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_certificate, $mlw_qmn_result_array); - $mlw_message_certificate = str_replace( "\n" , "
    ", $mlw_message_certificate); - $mlw_plugindirpath = plugin_dir_path( __FILE__ ); - $plugindirpath=plugin_dir_path( __FILE__ ); - $mlw_qmn_certificate_file=<<", $mlw_message_certificate); + $mlw_plugindirpath = plugin_dir_path( __FILE__ ); + $plugindirpath=plugin_dir_path( __FILE__ ); + $mlw_qmn_certificate_file=<<Output('mlw_qmn_certificate.pdf','D'); unlink(__FILE__); EOC; - $mlw_qmn_certificate_filename = str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php"; + $mlw_qmn_certificate_filename = str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$qmn_array_for_variables['timer'].".php"; file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file); - $mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php"; - $mlw_qmn_result_array["certificate_link"] = "Download Certificate"; + $mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis").$qmn_array_for_variables['timer'].".php"; + $mlw_certificate_link = "Download Certificate"; } + return $mlw_certificate_link; + } - /* - Prepare the landing page - -First, unserialize message_after column - -Second, check for array in case user has not updated - Message array = (array( bottomvalue, topvalue, text),array( bottomvalue, topvalue, text), etc..., array(0,0,text)) - */ - if (is_serialized($mlw_quiz_options->message_after) && is_array(@unserialize($mlw_quiz_options->message_after))) + public function display_results_text($qmn_quiz_options, $qmn_array_for_variables) + { + $results_text_display = ''; + if (is_serialized($qmn_quiz_options->message_after) && is_array(@unserialize($qmn_quiz_options->message_after))) { - $mlw_message_after_array = @unserialize($mlw_quiz_options->message_after); + $mlw_message_after_array = @unserialize($qmn_quiz_options->message_after); //Cycle through landing pages foreach($mlw_message_after_array as $mlw_each) { @@ -859,9 +881,9 @@ function mlw_quiz_shortcode($atts) if ($mlw_each[0] == 0 && $mlw_each[1] == 0) { $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES); - $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $mlw_qmn_result_array); + $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $qmn_array_for_variables); $mlw_message_after = str_replace( "\n" , "
    ", $mlw_message_after); - $mlw_display .= $mlw_message_after; + $results_text_display .= $mlw_message_after; break; } else @@ -870,18 +892,18 @@ function mlw_quiz_shortcode($atts) if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1]) { $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES); - $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $mlw_qmn_result_array); + $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $qmn_array_for_variables); $mlw_message_after = str_replace( "\n" , "
    ", $mlw_message_after); - $mlw_display .= $mlw_message_after; + $results_text_display .= $mlw_message_after; break; } //Check to see if score fall in correct range if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1]) { $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES); - $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $mlw_qmn_result_array); + $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $qmn_array_for_variables); $mlw_message_after = str_replace( "\n" , "
    ", $mlw_message_after); - $mlw_display .= $mlw_message_after; + $results_text_display .= $mlw_message_after; break; } } @@ -890,53 +912,55 @@ function mlw_quiz_shortcode($atts) else { //Prepare the after quiz message - $mlw_message_after = htmlspecialchars_decode($mlw_quiz_options->message_after, ENT_QUOTES); - $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $mlw_qmn_result_array); + $mlw_message_after = htmlspecialchars_decode($qmn_quiz_options->message_after, ENT_QUOTES); + $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $qmn_array_for_variables); $mlw_message_after = str_replace( "\n" , "
    ", $mlw_message_after); - $mlw_display .= $mlw_message_after; + $results_text_display .= $mlw_message_after; } + return $results_text_display; + } - if ($mlw_quiz_options->social_media == 1) + public function display_social($qmn_quiz_options, $qmn_array_for_variables) + { + $social_display = ''; + if ($qmn_quiz_options->social_media == 1) { wp_enqueue_script( 'qmn_quiz_social_share', plugins_url( 'js/qmn_social_share.js' , __FILE__ ) ); //Load Social Media Text $qmn_social_media_text = ""; - if (is_serialized($mlw_quiz_options->social_media_text) && is_array(@unserialize($mlw_quiz_options->social_media_text))) + if (is_serialized($qmn_quiz_options->social_media_text) && is_array(@unserialize($qmn_quiz_options->social_media_text))) { - $qmn_social_media_text = @unserialize($mlw_quiz_options->social_media_text); + $qmn_social_media_text = @unserialize($qmn_quiz_options->social_media_text); } else { $qmn_social_media_text = array( - 'twitter' => $mlw_quiz_options->social_media_text, - 'facebook' => $mlw_quiz_options->social_media_text + 'twitter' => $qmn_quiz_options->social_media_text, + 'facebook' => $qmn_quiz_options->social_media_text ); } - $qmn_social_media_text["twitter"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["twitter"], $mlw_qmn_result_array); - $qmn_social_media_text["facebook"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["facebook"], $mlw_qmn_result_array); - $mlw_display .= "
    - quiz_name)."');\">Facebook - quiz_name)."');\">Twitter + $qmn_social_media_text["twitter"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["twitter"], $qmn_array_for_variables); + $qmn_social_media_text["facebook"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["facebook"], $qmn_array_for_variables); + $social_display .= "
    + quiz_name)."');\">Facebook + quiz_name)."');\">Twitter
    "; } + return apply_filters('qmn_returned_social_buttons', $social_display, $qmn_quiz_options, $qmn_array_for_variables); + } - //Switch email type to HTML + public function send_user_email($qmn_quiz_options, $qmn_array_for_variables) + { add_filter( 'wp_mail_content_type', 'mlw_qmn_set_html_content_type' ); - - /* - Prepare and send the user email - - First, check to see if user_email_template is the newer array format, if not use it as the template - - If it is an array, check to see if the score meets the parameter of one of the templates. If, not send the default - */ $mlw_message = ""; - if ($mlw_quiz_options->send_user_email == "0") + if ($qmn_quiz_options->send_user_email == "0") { if ($mlw_user_email != "") { - if (is_serialized($mlw_quiz_options->user_email_template) && is_array(@unserialize($mlw_quiz_options->user_email_template))) + if (is_serialized($qmn_quiz_options->user_email_template) && is_array(@unserialize($qmn_quiz_options->user_email_template))) { - $mlw_user_email_array = @unserialize($mlw_quiz_options->user_email_template); + $mlw_user_email_array = @unserialize($qmn_quiz_options->user_email_template); //Cycle through landing pages foreach($mlw_user_email_array as $mlw_each) @@ -947,44 +971,43 @@ function mlw_quiz_shortcode($atts) { $mlw_each[3] = "Quiz Results For %QUIZ_NAME"; } - $mlw_each[3] = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_each[3], $mlw_qmn_result_array); + $mlw_each[3] = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_each[3], $qmn_array_for_variables); //Check to see if default if ($mlw_each[0] == 0 && $mlw_each[1] == 0) { $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $qmn_array_for_variables); $mlw_message = str_replace( "\n" , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); - $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n"; + $mlw_headers = 'From: '.$qmn_quiz_options->email_from_text.' <'.$qmn_quiz_options->admin_email.'>' . "\r\n"; wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers); break; } else { - //Check to see if points fall in correct range - if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1]) + if ($qmn_quiz_options->system == 1 && $qmn_array_for_variables['total_points'] >= $mlw_each[0] && $qmn_array_for_variables['total_points'] <= $mlw_each[1]) { $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $qmn_array_for_variables); $mlw_message = str_replace( "\n" , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); - $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n"; + $mlw_headers = 'From: '.$qmn_quiz_options->email_from_text.' <'.$qmn_quiz_options->admin_email.'>' . "\r\n"; wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers); break; } //Check to see if score fall in correct range - if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1]) + if ($qmn_quiz_options->system == 0 && $qmn_array_for_variables['total_score'] >= $mlw_each[0] && $qmn_array_for_variables['total_score'] <= $mlw_each[1]) { $mlw_message = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $qmn_array_for_variables); $mlw_message = str_replace( "\n" , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); - $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n"; + $mlw_headers = 'From: '.$qmn_quiz_options->email_from_text.' <'.$qmn_quiz_options->admin_email.'>' . "\r\n"; wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers); break; } @@ -993,28 +1016,34 @@ function mlw_quiz_shortcode($atts) } else { - $mlw_message = htmlspecialchars_decode($mlw_quiz_options->user_email_template, ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array); + $mlw_message = htmlspecialchars_decode($qmn_quiz_options->user_email_template, ENT_QUOTES); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $qmn_array_for_variables); $mlw_message = str_replace( "\n" , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); - $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n"; - wp_mail($mlw_user_email, "Quiz Results For ".$mlw_quiz_options->quiz_name, $mlw_message, $mlw_headers); + $mlw_headers = 'From: '.$qmn_quiz_options->email_from_text.' <'.$qmn_quiz_options->admin_email.'>' . "\r\n"; + wp_mail($mlw_user_email, "Quiz Results For ".$qmn_quiz_options->quiz_name, $mlw_message, $mlw_headers); } } } + remove_filter( 'wp_mail_content_type', 'mlw_qmn_set_html_content_type' ); + } + + public function send_admin_email($qmn_quiz_options, $qmn_array_for_variables) + { + //Switch email type to HTML + add_filter( 'wp_mail_content_type', 'mlw_qmn_set_html_content_type' ); - //Prepare and send the admin email $mlw_message = ""; - if ($mlw_quiz_options->send_admin_email == "0") + if ($qmn_quiz_options->send_admin_email == "0") { - if ($mlw_quiz_options->admin_email != "") + if ($qmn_quiz_options->admin_email != "") { $mlw_message = ""; $mlw_subject = ""; - if (is_serialized($mlw_quiz_options->admin_email_template) && is_array(@unserialize($mlw_quiz_options->admin_email_template))) + if (is_serialized($qmn_quiz_options->admin_email_template) && is_array(@unserialize($qmn_quiz_options->admin_email_template))) { - $mlw_admin_email_array = @unserialize($mlw_quiz_options->admin_email_template); + $mlw_admin_email_array = @unserialize($qmn_quiz_options->admin_email_template); //Cycle through landing pages foreach($mlw_admin_email_array as $mlw_each) @@ -1025,13 +1054,13 @@ function mlw_quiz_shortcode($atts) { $mlw_each["subject"] = "Quiz Results For %QUIZ_NAME"; } - $mlw_each["subject"] = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_each["subject"], $mlw_qmn_result_array); + $mlw_each["subject"] = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_each["subject"], $qmn_array_for_variables); //Check to see if default if ($mlw_each["begin_score"] == 0 && $mlw_each["end_score"] == 0) { $mlw_message = htmlspecialchars_decode($mlw_each["message"], ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $qmn_array_for_variables); $mlw_message = str_replace( "\n" , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); @@ -1041,10 +1070,10 @@ function mlw_quiz_shortcode($atts) else { //Check to see if points fall in correct range - if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each["begin_score"] && $mlw_points <= $mlw_each["end_score"]) + if ($qmn_quiz_options->system == 1 && $qmn_array_for_variables['total_points'] >= $mlw_each["begin_score"] && $qmn_array_for_variables['total_points'] <= $mlw_each["end_score"]) { $mlw_message = htmlspecialchars_decode($mlw_each["message"], ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $qmn_array_for_variables); $mlw_message = str_replace( "\n" , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); @@ -1053,10 +1082,10 @@ function mlw_quiz_shortcode($atts) } //Check to see if score fall in correct range - if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each["begin_score"] && $mlw_total_score <= $mlw_each["end_score"]) + if ($qmn_quiz_options->system == 0 && $qmn_array_for_variables['total_score'] >= $mlw_each["begin_score"] && $qmn_array_for_variables['total_score'] <= $mlw_each["end_score"]) { $mlw_message = htmlspecialchars_decode($mlw_each["message"], ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $qmn_array_for_variables); $mlw_message = str_replace( "\n" , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); @@ -1068,17 +1097,17 @@ function mlw_quiz_shortcode($atts) } else { - $mlw_message = htmlspecialchars_decode($mlw_quiz_options->admin_email_template, ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $mlw_qmn_result_array); + $mlw_message = htmlspecialchars_decode($qmn_quiz_options->admin_email_template, ENT_QUOTES); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message, $qmn_array_for_variables); $mlw_message = str_replace( "\n" , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); - $mlw_subject = "Quiz Results For ".$mlw_quiz_options->quiz_name; + $mlw_subject = "Quiz Results For ".$qmn_quiz_options->quiz_name; } } if ( get_option('mlw_advert_shows') == 'true' ) {$mlw_message .= "
    This email was generated by the Quiz Master Next script by Frank Corso";} - $mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n"; - $mlw_qmn_admin_emails = explode(",", $mlw_quiz_options->admin_email); + $mlw_headers = 'From: '.$qmn_quiz_options->email_from_text.' <'.$qmn_quiz_options->admin_email.'>' . "\r\n"; + $mlw_qmn_admin_emails = explode(",", $qmn_quiz_options->admin_email); foreach($mlw_qmn_admin_emails as $admin_email) { wp_mail($admin_email, $mlw_subject, $mlw_message, $mlw_headers); @@ -1087,148 +1116,196 @@ function mlw_quiz_shortcode($atts) //Remove HTML type for emails remove_filter( 'wp_mail_content_type', 'mlw_qmn_set_html_content_type' ); - - //Save the results into database - $mlw_quiz_results_array = array( intval($mlw_qmn_timer), $mlw_qmn_answer_array, htmlspecialchars(stripslashes($mlw_qm_quiz_comments), ENT_QUOTES)); - $mlw_quiz_results = serialize($mlw_quiz_results_array); - - global $wpdb; - $table_name = $wpdb->prefix . "mlw_results"; - $results = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $table_name . " (result_id, quiz_id, quiz_name, quiz_system, point_score, correct_score, correct, total, name, business, email, phone, user, time_taken, time_taken_real, quiz_results, deleted) VALUES (NULL, %d, '%s', %d, %d, %d, %d, %d, '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', 0)", $mlw_quiz_id, $mlw_quiz_options->quiz_name, $mlw_quiz_options->system, $mlw_points, $mlw_total_score, $mlw_correct, $mlw_total_questions, $mlw_user_name, $mlw_user_comp, $mlw_user_email, $mlw_user_phone, get_current_user_id(), date("h:i:s A m/d/Y"), date("Y-m-d H:i:s"), $mlw_quiz_results) ); - - //Integration Action - do_action('mlw_qmn_load_results_page', $wpdb->insert_id, $mlw_quiz_options->quiz_settings); - } - else - { - if (!$mlw_qmn_isAllowed) - { - $current_user = wp_get_current_user(); - $mlw_message = htmlspecialchars_decode($mlw_quiz_options->total_user_tries_text, ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array); - $mlw_display .= $mlw_message; - } - elseif (isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] != $_POST["mlw_code_captcha"]) - { - $mlw_display .= "There was an issue with the captcha verification. Please try again."; - } - else { $mlw_display .= "Thank you."; } - } } -return $mlw_display; } - -//Check if user is required to be checked in -if ( $mlw_quiz_options->require_log_in == 1 && !is_user_logged_in() ) +add_filter('qmn_begin_shortcode', 'qmn_require_login_check', 10, 3); +function qmn_require_login_check($display, $qmn_quiz_options, $qmn_array_for_variables) { - $mlw_message = htmlspecialchars_decode($mlw_quiz_options->require_log_in_text, ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array); - $mlw_message = str_replace( "\n" , "
    ", $mlw_message); - $mlw_display = $mlw_message; - $mlw_display .= wp_login_form( array('echo' => false) ); - return $mlw_display; - $mlw_qmn_isAllowed = false; + global $qmn_allowed_visit; + if ( $qmn_quiz_options->require_log_in == 1 && !is_user_logged_in() ) + { + $qmn_allowed_visit = false; + $mlw_message = htmlspecialchars_decode($qmn_quiz_options->require_log_in_text, ENT_QUOTES); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables); + $mlw_message = str_replace( "\n" , "
    ", $mlw_message); + $display .= $mlw_message; + $display .= wp_login_form( array('echo' => false) ); + } + return $display; } -//Check if date is inside scheduled timeframe -if (is_serialized($mlw_quiz_options->scheduled_timeframe) && is_array(@unserialize($mlw_quiz_options->scheduled_timeframe))) +add_filter('qmn_begin_shortcode', 'qmn_scheduled_timeframe_check', 10, 3); +function qmn_scheduled_timeframe_check($display, $qmn_quiz_options, $qmn_array_for_variables) { - $qmn_scheduled_timeframe = @unserialize($mlw_quiz_options->scheduled_timeframe); - if ($qmn_scheduled_timeframe["start"] != '' && $qmn_scheduled_timeframe["end"] != '') + global $qmn_allowed_visit; + if (is_serialized($qmn_quiz_options->scheduled_timeframe) && is_array(@unserialize($qmn_quiz_options->scheduled_timeframe))) { - $qmn_scheduled_start = strtotime($qmn_scheduled_timeframe["start"]); - $qmn_scheduled_end = strtotime($qmn_scheduled_timeframe["end"]) + 86399; ///Added seconds to bring time to 11:59:59 PM of given day - if (time() < $qmn_scheduled_start | time() > $qmn_scheduled_end) + $qmn_scheduled_timeframe = @unserialize($qmn_quiz_options->scheduled_timeframe); + if ($qmn_scheduled_timeframe["start"] != '' && $qmn_scheduled_timeframe["end"] != '') { - $mlw_message = htmlspecialchars_decode($mlw_quiz_options->scheduled_timeframe_text, ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array); - $mlw_message = str_replace( "\n" , "
    ", $mlw_message); - $mlw_display = $mlw_message; - return $mlw_display; - $mlw_qmn_isAllowed = false; + $qmn_scheduled_start = strtotime($qmn_scheduled_timeframe["start"]); + $qmn_scheduled_end = strtotime($qmn_scheduled_timeframe["end"]) + 86399; ///Added seconds to bring time to 11:59:59 PM of given day + if (time() < $qmn_scheduled_start | time() > $qmn_scheduled_end) + { + $qmn_allowed_visit = false; + $mlw_message = htmlspecialchars_decode($qmn_quiz_options->scheduled_timeframe_text, ENT_QUOTES); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables); + $mlw_message = str_replace( "\n" , "
    ", $mlw_message); + $display .= $mlw_message; + } } } + return $display; } -//Check to see if there is limit on the amount of tries -if ( $mlw_quiz_options->total_user_tries != 0 && is_user_logged_in() ) +add_filter('qmn_begin_shortcode', 'qmn_total_user_tries_check', 10, 3); +function qmn_total_user_tries_check($display, $qmn_quiz_options, $qmn_array_for_variables) { - $current_user = wp_get_current_user(); - $mlw_qmn_user_try_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE email='%s' AND deleted='0' AND quiz_id=%d", $current_user->user_email, $mlw_quiz_id ) ); - if ($mlw_qmn_user_try_count >= $mlw_quiz_options->total_user_tries) { $mlw_qmn_isAllowed = false; } + global $qmn_allowed_visit; + if ( $mlw_quiz_options->total_user_tries != 0 && is_user_logged_in() ) + { + $current_user = wp_get_current_user(); + $mlw_qmn_user_try_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE email='%s' AND deleted='0' AND quiz_id=%d", $current_user->user_email, $qmn_array_for_variables['quiz_id'] ) ); + if ($mlw_qmn_user_try_count >= $qmn_quiz_options->total_user_tries) + { + $qmn_allowed_visit = false; + $mlw_message = htmlspecialchars_decode($qmn_quiz_options->total_user_tries_text, ENT_QUOTES); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables); + $display .= $mlw_message; + } + } + return $display; } -//If there is no quiz for the shortcode provided -if ($mlw_quiz_options->quiz_name == "") +add_filter('qmn_begin_shortcode', 'qmn_quiz_name_check', 10, 3); +function qmn_quiz_name_check($display, $qmn_quiz_options, $qmn_array_for_variables) { - $mlw_display .= "It appears that this quiz is not set up correctly."; - return $mlw_display; + global $qmn_allowed_visit; + if ($mlw_quiz_options->quiz_name == "") + { + $qmn_allowed_visit = false; + $display .= "It appears that this quiz is not set up correctly."; + } + return $display; } -if ( $mlw_quiz_options->limit_total_entries != 0 ) +add_filter('qmn_begin_quiz', 'qmn_total_tries_check', 10, 3); +function qmn_total_tries_check($display, $qmn_quiz_options, $qmn_array_for_variables) { - $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", $mlw_quiz_id ) ); - if ($mlw_qmn_entries_count >= $mlw_quiz_options->limit_total_entries) + global $qmn_allowed_visit; + if ( $qmn_quiz_options->limit_total_entries != 0 ) { - $mlw_message = htmlspecialchars_decode($mlw_quiz_options->limit_total_entries_text, ENT_QUOTES); - $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $mlw_qmn_quiz_options_array); - $mlw_display = $mlw_message; - return $mlw_display; - $mlw_qmn_isAllowed = false; + $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'] ) ); + if ($mlw_qmn_entries_count >= $qmn_quiz_options->limit_total_entries) + { + $mlw_message = htmlspecialchars_decode($qmn_quiz_options->limit_total_entries_text, ENT_QUOTES); + $mlw_message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables); + $display .= $mlw_message; + $qmn_allowed_visit = false; + } } + return $display; } -if ( $mlw_quiz_options->pagination != 0) { $mlw_display .= ""; } - -//Calculate number of pages if pagination is turned on -if ($mlw_quiz_options->pagination != 0) +add_filter('qmn_begin_quiz', 'qmn_pagination_check', 10, 3); +function qmn_pagination_check($display, $qmn_quiz_options, $qmn_array_for_variables) { - $mlw_qmn_section_limit = 2 + count($mlw_questions); - if ($mlw_quiz_options->comment_section == 0) + if ($qmn_quiz_options->pagination != 0) { - $mlw_qmn_section_limit = $mlw_qmn_section_limit + 1; - } + global $wpdb; + $limit_sql = ''; + if ($qmn_quiz_options->question_from_total != 0) + { + $limit_sql = " LIMIT ".$qmn_quiz_options->question_from_total; + } + $total_questions = $wpdb->get_var($wpdb->prepare("SELECT COUNT(quiz_id) FROM ".$wpdb->prefix."mlw_questions WHERE deleted=0 AND quiz_id=%d".$limit_sql, $qmn_array_for_variables["quiz_id"])); + $display .= ""; + $mlw_qmn_section_limit = 2 + $total_questions; + if ($qmn_quiz_options->comment_section == 0) + { + $mlw_qmn_section_limit = $mlw_qmn_section_limit + 1; + } - //Gather text for pagination buttons - $mlw_qmn_pagination_text = ""; - if (is_serialized($mlw_quiz_options->pagination_text) && is_array(@unserialize($mlw_quiz_options->pagination_text))) - { - $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text); + //Gather text for pagination buttons + $mlw_qmn_pagination_text = ""; + if (is_serialized($qmn_quiz_options->pagination_text) && is_array(@unserialize($qmn_quiz_options->pagination_text))) + { + $mlw_qmn_pagination_text = @unserialize($qmn_quiz_options->pagination_text); + } + else + { + $mlw_qmn_pagination_text = array('Previous', $qmn_quiz_options->pagination_text); + } + ?> + + timer_limit != 0) { - $mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text); + ?> +
    + + - - timer_limit != 0) + +add_filter('qmn_begin_quiz', 'qmn_update_views', 10, 3); +function qmn_update_views($display, $qmn_quiz_options, $qmn_array_for_variables) { - ?> -
    - - quiz_views; + $mlw_views += 1; + $results = $wpdb->update( + $wpdb->prefix . "mlw_quizzes", + array( + 'quiz_views' => $mlw_views + ), + array( 'quiz_id' => $qmn_array_for_variables["quiz_id"] ), + array( + '%d' + ), + array( '%d' ) + ); + return $display; } -//Update the quiz views -$mlw_views = $mlw_quiz_options->quiz_views; -$mlw_views += 1; -$update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views='".$mlw_views."' WHERE quiz_id=".$mlw_quiz_id; -$results = $wpdb->query( $update ); - - +add_filter('qmn_begin_results', 'qmn_update_taken', 10, 3); +function qmn_update_taken($display, $qmn_quiz_options, $qmn_array_for_variables) +{ + global $wpdb; + $mlw_taken = $qmn_quiz_options->quiz_taken; + $mlw_taken += 1; + $results = $wpdb->update( + $wpdb->prefix . "mlw_quizzes", + array( + 'quiz_taken' => $mlw_taken + ), + array( 'quiz_id' => $qmn_array_for_variables["quiz_id"] ), + array( + '%d' + ), + array( '%d' ) + ); + return $display; +} /* This function displays fields to ask for contact information From cc742d501d9a034c43fb0ea9486a3d03abec7dd0 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 22:06:26 -0500 Subject: [PATCH 079/184] Changed Variable Names --- includes/qmn_quiz.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index 00c647568..ef85020e0 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -650,7 +650,7 @@ public function display_results($qmn_quiz_options, $qmn_quiz_questions, $qmn_qui ); $result_display = apply_filters('qmn_end_results', $result_display, $qmn_quiz_options, $qmn_array_for_variables); //Legacy Code - do_action('mlw_qmn_load_results_page', $wpdb->insert_id, $mlw_quiz_options->quiz_settings); + do_action('mlw_qmn_load_results_page', $wpdb->insert_id, $qmn_quiz_options->quiz_settings); } else { @@ -775,7 +775,7 @@ public function check_answers($qmn_quiz_questions, $qmn_quiz_answers, $qmn_quiz_ $mlw_qm_question_comment = ""; } - $mlw_question_answer_display = htmlspecialchars_decode($mlw_quiz_options->question_answer_template, ENT_QUOTES); + $mlw_question_answer_display = htmlspecialchars_decode($qmn_quiz_options->question_answer_template, ENT_QUOTES); $mlw_question_answer_display = str_replace( "%QUESTION%" , htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES), $mlw_question_answer_display); $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , $mlw_user_text, $mlw_question_answer_display); $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER%" , $mlw_correct_text, $mlw_question_answer_display); @@ -889,7 +889,7 @@ public function display_results_text($qmn_quiz_options, $qmn_array_for_variables else { //Check to see if points fall in correct range - if ($mlw_quiz_options->system == 1 && $mlw_points >= $mlw_each[0] && $mlw_points <= $mlw_each[1]) + if ($qmn_quiz_options->system == 1 && $qmn_array_for_variables['total_points'] >= $mlw_each[0] && $qmn_array_for_variables['total_points'] <= $mlw_each[1]) { $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES); $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $qmn_array_for_variables); @@ -898,7 +898,7 @@ public function display_results_text($qmn_quiz_options, $qmn_array_for_variables break; } //Check to see if score fall in correct range - if ($mlw_quiz_options->system == 0 && $mlw_total_score >= $mlw_each[0] && $mlw_total_score <= $mlw_each[1]) + if ($qmn_quiz_options->system == 0 && $qmn_array_for_variables['total_score'] >= $mlw_each[0] && $qmn_array_for_variables['total_score'] <= $mlw_each[1]) { $mlw_message_after = htmlspecialchars_decode($mlw_each[2], ENT_QUOTES); $mlw_message_after = apply_filters( 'mlw_qmn_template_variable_results_page', $mlw_message_after, $qmn_array_for_variables); @@ -1163,7 +1163,7 @@ function qmn_scheduled_timeframe_check($display, $qmn_quiz_options, $qmn_array_f function qmn_total_user_tries_check($display, $qmn_quiz_options, $qmn_array_for_variables) { global $qmn_allowed_visit; - if ( $mlw_quiz_options->total_user_tries != 0 && is_user_logged_in() ) + if ( $qmn_quiz_options->total_user_tries != 0 && is_user_logged_in() ) { $current_user = wp_get_current_user(); $mlw_qmn_user_try_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE email='%s' AND deleted='0' AND quiz_id=%d", $current_user->user_email, $qmn_array_for_variables['quiz_id'] ) ); @@ -1182,7 +1182,7 @@ function qmn_total_user_tries_check($display, $qmn_quiz_options, $qmn_array_for_ function qmn_quiz_name_check($display, $qmn_quiz_options, $qmn_array_for_variables) { global $qmn_allowed_visit; - if ($mlw_quiz_options->quiz_name == "") + if ($qmn_quiz_options->quiz_name == "") { $qmn_allowed_visit = false; $display .= "It appears that this quiz is not set up correctly."; From f948d1494c8077949a25a929075dff69301c8199 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 22:13:58 -0500 Subject: [PATCH 080/184] Created Object To Initiate Class --- includes/qmn_quiz.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index ef85020e0..6db52a52e 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -1118,6 +1118,7 @@ public function send_admin_email($qmn_quiz_options, $qmn_array_for_variables) remove_filter( 'wp_mail_content_type', 'mlw_qmn_set_html_content_type' ); } } +$qmnQuizManager = new QMNQuizManager(); add_filter('qmn_begin_shortcode', 'qmn_require_login_check', 10, 3); function qmn_require_login_check($display, $qmn_quiz_options, $qmn_array_for_variables) From 65e497987919472810ef4de89ef54ffa9723f723 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 22:14:57 -0500 Subject: [PATCH 081/184] Removed Shortcode Hook Shortcode hook is now called from within the Quiz Manager class. --- mlw_quizmaster2.php | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 466c222b3..116351165 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -9,13 +9,13 @@ Plugin URI: http://www.mylocalwebstop.com/ */ -/* +/* Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com) -Disclaimer of Warranties. +Disclaimer of Warranties. -The plugin is provided "as is". My Local Webstop and its suppliers and licensors hereby disclaim all warranties of any kind, -express or implied, including, without limitation, the warranties of merchantability, fitness for a particular purpose and non-infringement. +The plugin is provided "as is". My Local Webstop and its suppliers and licensors hereby disclaim all warranties of any kind, +express or implied, including, without limitation, the warranties of merchantability, fitness for a particular purpose and non-infringement. Neither My Local Webstop nor its suppliers and licensors, makes any warranty that the plugin will be error free or that access thereto will be continuous or uninterrupted. You understand that you install, operate, and unistall the plugin at your own discretion and risk. */ @@ -36,7 +36,7 @@ class MLWQuizMasterNext * @since 3.7.1 */ public $alertManager; - + /** * QMN Plugin Helper Object * @@ -44,7 +44,7 @@ class MLWQuizMasterNext * @since 4.0.0 */ public $pluginHelper; - + /** * QMN Quiz Creator Object * @@ -52,7 +52,7 @@ class MLWQuizMasterNext * @since 3.7.1 */ public $quizCreator; - + /** * Main Construct Function * @@ -63,12 +63,12 @@ class MLWQuizMasterNext * @uses MLWQuizMasterNext::add_hooks() Adds actions to hooks and filters * @return void */ - public function __construct() + public function __construct() { $this->load_dependencies(); $this->add_hooks(); } - + /** * Load File Dependencies * @@ -104,20 +104,20 @@ private function load_dependencies() include("includes/qmn_options_tools_tab.php"); include("includes/qmn_options_preview_tab.php"); include("includes/qmn_addons.php"); - + include("includes/qmn_alerts.php"); $this->alertManager = new MlwQmnAlertManager(); - + include("includes/qmn_quiz_creator.php"); $this->quizCreator = new QMNQuizCreator(); - + include("includes/qmn_helper.php"); $this->pluginHelper = new QMNPluginHelper(); } - + /** * Add Hooks - * + * * Adds functions to relavent hooks and filters * * @since 3.6.1 @@ -128,14 +128,13 @@ private function add_hooks() add_action('admin_menu', array( $this, 'setup_admin_menu')); add_action('admin_init', 'mlw_quiz_update'); add_action('widgets_init', create_function('', 'return register_widget("Mlw_Qmn_Leaderboard_Widget");')); - add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode'); add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode'); add_action('plugins_loaded', array( $this, 'setup_translations')); } - + /** * Setup Admin Menu - * + * * Creates the admin menu and pages for the plugin and attaches functions to them * * @since 3.6.1 @@ -156,7 +155,7 @@ public function setup_admin_menu() add_submenu_page(__FILE__, 'QMN About', 'QMN About', 'manage_options', 'mlw_qmn_about', 'mlw_generate_about_page'); } } - + /** * Loads the plugin language files * From 2e9473fc9716cf308dd97ca50700ada54567e9e7 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 22:23:44 -0500 Subject: [PATCH 082/184] Fixed Various Bugs I missed a few mlw_quiz_id changes as well as the variable. --- includes/qmn_quiz.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index 6db52a52e..0a1976386 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -18,7 +18,8 @@ public function display_shortcode($atts) global $wpdb; global $mlwQuizMasterNext; - global $qmn_allowed_visit = true; + global $qmn_allowed_visit; + $qmn_allowed_visit = true; $mlwQuizMasterNext->quizCreator->set_id($quiz); date_default_timezone_set(get_option('timezone_string')); $return_display = ''; @@ -53,11 +54,13 @@ public function display_shortcode($atts) public function load_quiz_options($quiz_id) { + global $wpdb; return $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$wpdb->prefix.'mlw_quizzes WHERE quiz_id=%d AND deleted=0', $quiz_id)); } public function load_questions($quiz_id, $quiz_options) { + global $wpdb; $order_by_sql = "ORDER BY question_order ASC"; $limit_sql = ''; if ($quiz_options->randomness_order == 1 || $quiz_options->randomness_order == 2) @@ -129,28 +132,29 @@ public function display_quiz($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_a echo "theme_selected)."' rel='stylesheet' />"; } - global $qmn_total_questions = 0; + global $qmn_total_questions; + $qmn_total_questions = 0; $mlw_qmn_section_count = 1; $quiz_display .= "
    "; $quiz_display .= "
    "; $quiz_display .= ""; - $quiz_display = apply_filters('qmn_begin_quiz_form', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) + $quiz_display = apply_filters('qmn_begin_quiz_form', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables); $quiz_display .= $this->display_begin_section($qmn_quiz_options, $qmn_array_for_variables); - $quiz_display = apply_filters('qmn_begin_quiz_questions', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) + $quiz_display = apply_filters('qmn_begin_quiz_questions', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables); $quiz_display .= $this->display_questions($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_answers); - $quiz_display = apply_filters('qmn_before_comment_section', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) + $quiz_display = apply_filters('qmn_before_comment_section', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables); $quiz_display .= $this->display_comment_section($qmn_quiz_options, $qmn_array_for_variables); - $quiz_display = apply_filters('qmn_after_comment_section', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) + $quiz_display = apply_filters('qmn_after_comment_section', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables); $quiz_display .= $this->display_end_section(); $quiz_display .= ""; $quiz_display .= ""; $quiz_display .= ""; - $quiz_display = apply_filters('qmn_end_quiz_form', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) + $quiz_display = apply_filters('qmn_end_quiz_form', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables); $quiz_display .= "
    "; $quiz_display .= "
    "; - $quiz_display = apply_filters('qmn_end_quiz', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables) + $quiz_display = apply_filters('qmn_end_quiz', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables); return $quiz_display; } @@ -582,8 +586,8 @@ public function display_results($qmn_quiz_options, $qmn_quiz_questions, $qmn_qui "; ?> ", $mlw_message_certificate); $mlw_plugindirpath = plugin_dir_path( __FILE__ ); $plugindirpath=plugin_dir_path( __FILE__ ); @@ -956,7 +960,7 @@ public function send_user_email($qmn_quiz_options, $qmn_array_for_variables) $mlw_message = ""; if ($qmn_quiz_options->send_user_email == "0") { - if ($mlw_user_email != "") + if ($qmn_array_for_variables['user_email'] != "") { if (is_serialized($qmn_quiz_options->user_email_template) && is_array(@unserialize($qmn_quiz_options->user_email_template))) { From 2e0db31038543e6d8bd9d149ac09f1e4a463984d Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 22:35:12 -0500 Subject: [PATCH 083/184] Added Check For Certificate Variable --- includes/qmn_template_variables.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/qmn_template_variables.php b/includes/qmn_template_variables.php index 2669835a6..f61a6d500 100644 --- a/includes/qmn_template_variables.php +++ b/includes/qmn_template_variables.php @@ -122,7 +122,10 @@ function mlw_qmn_variable_date($content, $mlw_quiz_array) } function mlw_qmn_variable_certificate_link($content, $mlw_quiz_array) { - $content = str_replace( "%CERTIFICATE_LINK%" , $mlw_quiz_array["certificate_link"], $content); + while (strpos($content, '%CERTIFICATE_LINK%') != false) + { + $content = str_replace( "%CERTIFICATE_LINK%" , $mlw_quiz_array["certificate_link"], $content); + } return $content; } ?> From 8a6317957177443e06932033dec02d2df56590a5 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 22:35:25 -0500 Subject: [PATCH 084/184] More Minor Bug Fixes --- includes/qmn_quiz.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index 0a1976386..a205f0b14 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -134,6 +134,7 @@ public function display_quiz($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_a global $qmn_total_questions; $qmn_total_questions = 0; + global $mlw_qmn_section_count; $mlw_qmn_section_count = 1; $quiz_display .= "
    "; @@ -146,7 +147,7 @@ public function display_quiz($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_a $quiz_display = apply_filters('qmn_before_comment_section', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables); $quiz_display .= $this->display_comment_section($qmn_quiz_options, $qmn_array_for_variables); $quiz_display = apply_filters('qmn_after_comment_section', $quiz_display, $qmn_quiz_options, $qmn_array_for_variables); - $quiz_display .= $this->display_end_section(); + $quiz_display .= $this->display_end_section($qmn_quiz_options, $qmn_array_for_variables); $quiz_display .= ""; $quiz_display .= ""; $quiz_display .= ""; @@ -160,6 +161,7 @@ public function display_quiz($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_a public function display_begin_section($qmn_quiz_options, $qmn_array_for_variables) { + global $mlw_qmn_section_count; $section_display = "
    "; $message_before = htmlspecialchars_decode($qmn_quiz_options->message_before, ENT_QUOTES); @@ -180,6 +182,7 @@ public function display_questions($qmn_quiz_options, $qmn_quiz_questions, $qmn_q { $question_display = ''; global $qmn_total_questions; + global $mlw_qmn_section_count; foreach($qmn_quiz_questions as $mlw_question) { if (is_serialized($mlw_question->question_settings) && is_array(@unserialize($mlw_question->question_settings))) @@ -508,6 +511,7 @@ public function display_questions($qmn_quiz_options, $qmn_quiz_questions, $qmn_q public function display_comment_section($qmn_quiz_options, $qmn_array_for_variables) { + global $mlw_qmn_section_count; $comment_display = ''; if ($qmn_quiz_options->comment_section == 0) { @@ -515,7 +519,7 @@ public function display_comment_section($qmn_quiz_options, $qmn_array_for_variab $comment_display .= "
    "; $message_comments = htmlspecialchars_decode($qmn_quiz_options->message_comment, ENT_QUOTES); $message_comments = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_comments, $qmn_array_for_variables); - $comment_display .= "
    "; + $comment_display .= "
    "; $comment_display .= ""; $comment_display .= "
    "; if ( $qmn_quiz_options->pagination == 0) { $comment_display .= "

    "; } @@ -525,6 +529,7 @@ public function display_comment_section($qmn_quiz_options, $qmn_array_for_variab public function display_end_section($qmn_quiz_options, $qmn_array_for_variables) { + global $mlw_qmn_section_count; $section_display = ''; $section_display .= "
    "; $mlw_qmn_section_count = $mlw_qmn_section_count + 1; @@ -533,7 +538,7 @@ public function display_end_section($qmn_quiz_options, $qmn_array_for_variables) { $message_end = htmlspecialchars_decode($qmn_quiz_options->message_end_template, ENT_QUOTES); $message_end = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message_end, $qmn_array_for_variables); - $section_display .= "$mlw_message_end"; + $section_display .= "$message_end"; $section_display .= "

    "; } if ($qmn_quiz_options->contact_info_location == 1) From b0b98d72c315a13bf94dd0b01d2d86115b825272 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 22:36:26 -0500 Subject: [PATCH 085/184] User Email Bug Fix --- includes/qmn_quiz.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index a205f0b14..00c3e7b23 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -991,7 +991,7 @@ public function send_user_email($qmn_quiz_options, $qmn_array_for_variables) $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_headers = 'From: '.$qmn_quiz_options->email_from_text.' <'.$qmn_quiz_options->admin_email.'>' . "\r\n"; - wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers); + wp_mail($qmn_array_for_variables['user_email'], $mlw_each[3], $mlw_message, $mlw_headers); break; } else @@ -1004,7 +1004,7 @@ public function send_user_email($qmn_quiz_options, $qmn_array_for_variables) $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_headers = 'From: '.$qmn_quiz_options->email_from_text.' <'.$qmn_quiz_options->admin_email.'>' . "\r\n"; - wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers); + wp_mail($qmn_array_for_variables['user_email'], $mlw_each[3], $mlw_message, $mlw_headers); break; } @@ -1017,7 +1017,7 @@ public function send_user_email($qmn_quiz_options, $qmn_array_for_variables) $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_headers = 'From: '.$qmn_quiz_options->email_from_text.' <'.$qmn_quiz_options->admin_email.'>' . "\r\n"; - wp_mail($mlw_user_email, $mlw_each[3], $mlw_message, $mlw_headers); + wp_mail($qmn_array_for_variables['user_email'], $mlw_each[3], $mlw_message, $mlw_headers); break; } } @@ -1031,7 +1031,7 @@ public function send_user_email($qmn_quiz_options, $qmn_array_for_variables) $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_message = str_replace( "
    " , "
    ", $mlw_message); $mlw_headers = 'From: '.$qmn_quiz_options->email_from_text.' <'.$qmn_quiz_options->admin_email.'>' . "\r\n"; - wp_mail($mlw_user_email, "Quiz Results For ".$qmn_quiz_options->quiz_name, $mlw_message, $mlw_headers); + wp_mail($qmn_array_for_variables['user_email'], "Quiz Results For ".$qmn_quiz_options->quiz_name, $mlw_message, $mlw_headers); } } } From 122f96ebe7fbbd82802d3d6ba67fb8fca5eb389d Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 22:40:35 -0500 Subject: [PATCH 086/184] Added Style For Results Page --- includes/qmn_quiz.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index 00c3e7b23..22ecead18 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -120,9 +120,9 @@ public function display_quiz($qmn_quiz_options, $qmn_quiz_questions, $qmn_quiz_a wp_enqueue_style( 'qmn_jquery_redmond_theme', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css' ); wp_enqueue_script( 'qmn_quiz', plugins_url( 'js/qmn_quiz.js' , __FILE__ ) ); - wp_enqueue_style( 'qmn_quiz_style', plugins_url( 'css/qmn_quiz.css' , __FILE__ ) ); wp_enqueue_script( 'math_jax', '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' ); + wp_enqueue_style( 'qmn_quiz_style', plugins_url( 'css/qmn_quiz.css' , __FILE__ ) ); if ($qmn_quiz_options->theme_selected == "default") { echo ""; @@ -571,6 +571,15 @@ public function display_results($qmn_quiz_options, $qmn_quiz_questions, $qmn_qui return $result_display; } wp_enqueue_script( 'math_jax', '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' ); + wp_enqueue_style( 'qmn_quiz_style', plugins_url( 'css/qmn_quiz.css' , __FILE__ ) ); + if ($qmn_quiz_options->theme_selected == "default") + { + echo ""; + } + else + { + echo "theme_selected)."' rel='stylesheet' />"; + } $mlw_user_name = isset($_POST["mlwUserName"]) ? $_POST["mlwUserName"] : 'None'; $mlw_user_comp = isset($_POST["mlwUserComp"]) ? $_POST["mlwUserComp"] : 'None'; From b822a0f064e8d2d569b60a3236fe6a1dc2852477 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 22:44:52 -0500 Subject: [PATCH 087/184] Added Missing Wpdb --- includes/qmn_quiz.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index 22ecead18..be188d665 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -1184,6 +1184,7 @@ function qmn_total_user_tries_check($display, $qmn_quiz_options, $qmn_array_for_ global $qmn_allowed_visit; if ( $qmn_quiz_options->total_user_tries != 0 && is_user_logged_in() ) { + global $wpdb; $current_user = wp_get_current_user(); $mlw_qmn_user_try_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE email='%s' AND deleted='0' AND quiz_id=%d", $current_user->user_email, $qmn_array_for_variables['quiz_id'] ) ); if ($mlw_qmn_user_try_count >= $qmn_quiz_options->total_user_tries) @@ -1215,6 +1216,7 @@ function qmn_total_tries_check($display, $qmn_quiz_options, $qmn_array_for_varia global $qmn_allowed_visit; if ( $qmn_quiz_options->limit_total_entries != 0 ) { + global $wpdb; $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'] ) ); if ($mlw_qmn_entries_count >= $qmn_quiz_options->limit_total_entries) { From 231b57e8113cca0c4a947f3b2ce2bf5de1725bd8 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sat, 3 Jan 2015 22:49:45 -0500 Subject: [PATCH 088/184] Fixed Timer Bug Timer was still showing up even when user was not allowed to take quiz. --- includes/qmn_quiz.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index be188d665..3b4d9d683 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -1274,7 +1274,8 @@ function qmn_pagination_check($display, $qmn_quiz_options, $qmn_array_for_variab add_filter('qmn_begin_quiz', 'qmn_timer_check', 10, 3); function qmn_timer_check($display, $qmn_quiz_options, $qmn_array_for_variables) { - if ($qmn_quiz_options->timer_limit != 0) + global $qmn_allowed_visit; + if ($qmn_allowed_visit && $qmn_quiz_options->timer_limit != 0) { ?>
    From d9f6885b9e4c002663c15226cf66a87550fb50e5 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 11:25:50 -0500 Subject: [PATCH 089/184] Create New Languages Folder --- languages/index.php | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 languages/index.php diff --git a/languages/index.php b/languages/index.php new file mode 100644 index 000000000..64387dd72 --- /dev/null +++ b/languages/index.php @@ -0,0 +1,5 @@ + From b3333c7823c8db69ae1557b86f045c9639543dfa Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 11:43:48 -0500 Subject: [PATCH 090/184] Added Gettext Functions --- mlw_quizmaster2.php | 57 ++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 116351165..0742cf9d5 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -1,23 +1,22 @@ Date: Sun, 4 Jan 2015 11:45:19 -0500 Subject: [PATCH 091/184] Added Gettext Functions --- includes/qmn_addons.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/qmn_addons.php b/includes/qmn_addons.php index bed6540de..c63462cfe 100644 --- a/includes/qmn_addons.php +++ b/includes/qmn_addons.php @@ -40,7 +40,7 @@ function qmn_generate_available_addons() { wp_enqueue_style( 'qmn_addons_style', plugins_url( 'css/qmn_addons_page.css' , __FILE__ ) ); ?> -

    These addons extend the functionality of Quiz Master Next

    +

    Export Results

    This add-on gives you the ability to export your quiz results as a CSV file.

    @@ -63,14 +63,14 @@ function qmn_generate_available_addons()

    - Browse All Addons + pluginHelper->register_addon_settings_tab("Available Addons", "qmn_generate_available_addons"); + $mlwQuizMasterNext->pluginHelper->register_addon_settings_tab(__("Available Addons", 'quiz-master-next'), "qmn_generate_available_addons"); } add_action("plugins_loaded", 'qmn_avaiable_addons_tab'); ?> From cfbad2dc645c65a9b6ba125a50ac5a1c374b4122 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 11:47:02 -0500 Subject: [PATCH 092/184] Added Gettext Functions --- includes/qmn_alerts.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/qmn_alerts.php b/includes/qmn_alerts.php index 0121f0742..70d785e18 100644 --- a/includes/qmn_alerts.php +++ b/includes/qmn_alerts.php @@ -1,13 +1,13 @@ alerts[] = array( 'message' => $message, 'type' => $type ); } - + public function showAlerts() { $alert_list = ""; @@ -15,15 +15,15 @@ public function showAlerts() { if ($alert['type'] == "success") { - $alert_list .= "

    Success! ".$alert["message"]."

    "; + $alert_list .= "

    ".__('Success!', 'quiz-master-next')." ".$alert["message"]."

    "; } if ($alert['type'] == "error") { - $alert_list .= "

    Error! ".$alert["message"]."

    "; + $alert_list .= "

    ".__('Error!', 'quiz-master-next')." ".$alert["message"]."

    "; } } echo $alert_list; } - + } ?> From 165f7bdb2d42c5a8f456dcb0b4a772a0f6074abd Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 11:50:30 -0500 Subject: [PATCH 093/184] Added Gettext Functions --- includes/qmn_credits.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/includes/qmn_credits.php b/includes/qmn_credits.php index 77d13de93..423358366 100644 --- a/includes/qmn_credits.php +++ b/includes/qmn_credits.php @@ -2,7 +2,7 @@ /* This page shows the about page */ -/* +/* Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com) */ @@ -58,9 +58,9 @@ function mlw_qmn_setTab(tab) { { background: no-repeat; background: none, no-repeat; - position: absolute; - top: 0; - right: 0; + position: absolute; + top: 0; + right: 0; background-color: #0d97d8; color: yellow; background-position: center 24px; @@ -82,16 +82,16 @@ function mlw_qmn_setTab(tab) { }
    -

    Welcome To Quiz Master Next

    -
    Thank you for updating!
    -
    Version
    +

    +
    +

    New Text Editors On Text Tab

    From a150eaa64d2d9f52a0fa34131345a5a28dcaf471 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 11:52:18 -0500 Subject: [PATCH 094/184] Added Gettext Functions --- includes/qmn_dashboard_widgets.php | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/includes/qmn_dashboard_widgets.php b/includes/qmn_dashboard_widgets.php index 5f89bef3a..2bd6e8c5e 100644 --- a/includes/qmn_dashboard_widgets.php +++ b/includes/qmn_dashboard_widgets.php @@ -1,11 +1,11 @@ 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"); @@ -29,17 +29,17 @@ function qmn_snapshot_dashboard_widget() { $mlw_qmn_analyze_today = $mlw_qmn_today_taken * 100; } - + $mlw_this_week = mktime(0, 0, 0, date("m") , date("d")-6, date("Y")); $mlw_this_week = date("Y-m-d", $mlw_this_week); $mlw_qmn_this_week_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_this_week." 00:00:00' AND '".date("Y-m-d")." 23:59:59') AND deleted=0"); - + $mlw_last_week_start = mktime(0, 0, 0, date("m") , date("d")-13, date("Y")); $mlw_last_week_start = date("Y-m-d", $mlw_last_week_start); $mlw_last_week_end = mktime(0, 0, 0, date("m") , date("d")-7, date("Y")); $mlw_last_week_end = date("Y-m-d", $mlw_last_week_end); $mlw_qmn_last_week_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_week_start." 00:00:00' AND '".$mlw_last_week_end." 23:59:59') AND deleted=0"); - + if ($mlw_qmn_last_week_taken != 0) { $mlw_qmn_analyze_week = round((($mlw_qmn_this_week_taken - $mlw_qmn_last_week_taken) / $mlw_qmn_last_week_taken) * 100, 2); @@ -48,10 +48,10 @@ function qmn_snapshot_dashboard_widget() { $mlw_qmn_analyze_week = $mlw_qmn_this_week_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" ); ?> @@ -124,9 +124,9 @@ function qmn_snapshot_dashboard_widget()
  • - quizzes taken today + - = 0) { @@ -143,9 +143,9 @@ function qmn_snapshot_dashboard_widget()
  • - quizzes taken last 7 days + - = 0) { @@ -162,25 +162,25 @@ function qmn_snapshot_dashboard_widget()
  • - total active quizzes +
  • - total active questions +
  • quiz_name; ?> - most popular quiz +
  • quiz_name; ?> - least popular quiz +
  • From caa6ef98f14ddda888e5777c59f14c4838738ee0 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 11:55:54 -0500 Subject: [PATCH 095/184] Added Gettext Functions --- includes/qmn_dashboard.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/includes/qmn_dashboard.php b/includes/qmn_dashboard.php index 95f6e4d04..bc8fd15b5 100644 --- a/includes/qmn_dashboard.php +++ b/includes/qmn_dashboard.php @@ -12,18 +12,18 @@ function mlw_generate_quiz_dashboard() $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", __('Quiz Daily Stats - Times Taken', 'quiz-master-next'), "mlw_dashboard_box", "quiz_wpss"); + add_meta_box("wpss_mrts", __('Quiz Total Stats', 'quiz-master-next'), "mlw_dashboard_box_three", "quiz_wpss3"); + add_meta_box("wpss_mrts", __('Quiz Weekly Stats - Times Taken', 'quiz-master-next'), "mlw_dashboard_box_four", "quiz_wpss4"); + add_meta_box("wpss_mrts", __('Quiz Monthly Stats - Times Taken', 'quiz-master-next'), "mlw_dashboard_box_five", "quiz_wpss5"); 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", '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"); - add_meta_box("wpss_mrts", 'Quizzes Taken Last 120 Days', "mlw_qmn_quaterly_percent_taken_widget", "quiz_wpss13"); + add_meta_box("wpss_mrts", __('Quizzes Taken Today', 'quiz-master-next'), "mlw_qmn_daily_percent_taken_widget", "quiz_wpss10"); + add_meta_box("wpss_mrts", __('Quizzes Taken Last 7 Days', 'quiz-master-next'), "mlw_qmn_weekly_percent_taken_widget", "quiz_wpss11"); + add_meta_box("wpss_mrts", __('Quizzes Taken Last 30 Days', 'quiz-master-next'), "mlw_qmn_monthly_percent_taken_widget", "quiz_wpss12"); + add_meta_box("wpss_mrts", __('Quizzes Taken Last 120 Days', 'quiz-master-next'), "mlw_qmn_quaterly_percent_taken_widget", "quiz_wpss13"); ?> @@ -49,7 +49,7 @@ function mlw_generate_quiz_dashboard() });
    -

    Quiz Master Next Version Statistics

    +

    @@ -219,43 +219,43 @@ function mlw_dashboard_box_three()
    - + - + - + - + - + - + - + - + - + - +
    Total Created Quizzes
    Total Deleted Quizzes
    Total Active Quizzes
    Total Created Questions
    Total Times All Active Quizzes Have Been Viewed
    Total Times All Active Quizzes Have Been Taken
    Average Amount Each Active Quiz Has Been Viewed
    Average Amount Each Active Quiz Has Been Taken
    Quiz That Has Been Viewed The Most
    Quiz That Has Been Taken The Most
    From 2386fbb35247360baa40daf8b515faba802821cd Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 12:01:29 -0500 Subject: [PATCH 096/184] Added Gettext Functions --- includes/qmn_help.php | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/includes/qmn_help.php b/includes/qmn_help.php index 189b7629f..91a92582e 100644 --- a/includes/qmn_help.php +++ b/includes/qmn_help.php @@ -2,44 +2,44 @@ /* This page shows the user how-to's for using the plugin */ -/* +/* Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com) */ 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"); + add_meta_box("wpss_mrts", __('Need Help?', 'quiz-master-next'), "qmn_documentation_meta_box_content", "meta_box_help"); + add_meta_box("wpss_mrts", __('Support', 'quiz-master-next'), "qmn_support_meta_box_content", "meta_box_support"); + add_meta_box("wpss_mrts", __('System Info', 'quiz-master-next'), "qmn_system_meta_box_content", "meta_box_sys_info"); ?>
    -

    QMN Help

    +

    - +
    - +
    - +
    - +
    - +
    - + +
    +
    - -
    -

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

    +

      -
    • Visit our Documentation for using this plugin
    • +
    • Visit our documentation for using this plugin
    • Fill out the form in the Support widget to send us an email
    • Fill out the form on our Contact Us Page
    • Create a topic in the WordPress Support Forums
    • @@ -107,7 +107,7 @@ function mlw_validateForm() - @@ -159,22 +159,22 @@ 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 ) ) { @@ -197,24 +197,24 @@ function qmn_get_system_info() 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']."
      "; - + $mlw_stat_total_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes LIMIT 1" ); $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 LIMIT 1" ); $mlw_stat_total_active_questions = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_questions WHERE deleted=0 LIMIT 1" ); - + $qmn_sys_info .= "

      QMN Information


      "; $qmn_sys_info .= "Total Quizzes : ".$mlw_stat_total_quiz."
      "; $qmn_sys_info .= "Total Active Quizzes : ".$mlw_stat_total_active_quiz."
      "; $qmn_sys_info .= "Total Questions : ".$mlw_stat_total_questions."
      "; $qmn_sys_info .= "Total Active Questions : ".$mlw_stat_total_active_questions."
      "; - - + + return $qmn_sys_info; } From f233caef3c017dde40ea9d46a23178fd5c057027 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 12:09:23 -0500 Subject: [PATCH 097/184] Added Gettext Functions --- includes/qmn_options_certificate_tab.php | 56 ++++++++++++------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/includes/qmn_options_certificate_tab.php b/includes/qmn_options_certificate_tab.php index 126bf6402..72c8b71d8 100644 --- a/includes/qmn_options_certificate_tab.php +++ b/includes/qmn_options_certificate_tab.php @@ -2,7 +2,7 @@ function qmn_settings_certificate_tab() { global $mlwQuizMasterNext; - $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Certificate (Beta)", 'mlw_options_certificate_tab_content'); + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__("Certificate (Beta)", 'quiz-master-next'), 'mlw_options_certificate_tab_content'); } add_action("plugins_loaded", 'qmn_settings_certificate_tab'); @@ -22,14 +22,14 @@ function mlw_options_certificate_tab_content() $mlw_enable_certificates = intval($_POST["enableCertificates"]); $mlw_certificate = array($mlw_certificate_title, $mlw_certificate_text, $mlw_certificate_logo, $mlw_certificate_background, $mlw_enable_certificates); $mlw_certificate_serialized = serialize($mlw_certificate); - + $mlw_certificate_sql_results = $wpdb->query( $wpdb->prepare( "UPDATE " . $wpdb->prefix . "mlw_quizzes SET certificate_template=%s, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_certificate_serialized, $mlw_certificate_id ) ); - - + + if ($mlw_certificate_sql_results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The certificate has been updated successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The certificate has been updated successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -37,11 +37,11 @@ function mlw_options_certificate_tab_content() $insert = "INSERT INTO " . $table_name . "(trail_id, action_user, action, time) " . "VALUES (NULL , '" . $current_user->display_name . "' , 'Certificate Options Have Been Edited For Quiz Number ".$mlw_certificate_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); + $results = $wpdb->query( $insert ); } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0012.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0012'), 'error'); } } if (isset($_GET["quiz_id"])) @@ -49,15 +49,15 @@ function mlw_options_certificate_tab_content() $table_name = $wpdb->prefix . "mlw_quizzes"; $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); } - + //Load Certificate Options Variables - if (is_serialized($mlw_quiz_options->certificate_template) && is_array(@unserialize($mlw_quiz_options->certificate_template))) + if (is_serialized($mlw_quiz_options->certificate_template) && is_array(@unserialize($mlw_quiz_options->certificate_template))) { $mlw_certificate_options = @unserialize($mlw_quiz_options->certificate_template); } else { - $mlw_certificate_options = array('Enter title here', 'Enter text here', '', '', 1); + $mlw_certificate_options = array(__('Enter title here', 'quiz-master-next'), __('Enter text here', 'quiz-master-next'), '', '', 1); } ?>
      @@ -66,10 +66,10 @@ function mlw_options_certificate_tab_content() jQuery( "#enableCertificates" ).buttonset(); }); -

      Quiz Certificate (Beta)

      -

      Enter in your text here to fill in the certificate for this quiz. Be sure to enter in the link variable into the templates on the Quiz Text tab so the user can access the certificate.

      -

      These fields cannot contain HTML.

      - +

      +

      +

      + "; echo ""; @@ -77,24 +77,24 @@ function mlw_options_certificate_tab_content() ?>
      If there is something you would like to suggest to add or even if you just want + 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.
      - + - + + + +
      - value='0' /> - value='1' /> + value='0' /> + value='1' />
      - Certificate Title + -
      - Message Displayed On Certificate +
      -

      Allowed Variables:

      +

      - %POINT_SCORE%

      - %AVERAGE_POINT%

      - %AMOUNT_CORRECT%

      @@ -112,20 +112,20 @@ function mlw_options_certificate_tab_content()
      - URL To Logo (Must be JPG, JPEG, PNG or GIF) + -
      - URL To Background Img (Must be JPG, JPEG, PNG or GIF) + -
      - +
    Date: Sun, 4 Jan 2015 12:18:55 -0500 Subject: [PATCH 098/184] Added Gettext Functions --- includes/qmn_options_email_tab.php | 180 ++++++++++++++--------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/includes/qmn_options_email_tab.php b/includes/qmn_options_email_tab.php index 9af0136a7..3b7c47749 100644 --- a/includes/qmn_options_email_tab.php +++ b/includes/qmn_options_email_tab.php @@ -2,7 +2,7 @@ function qmn_settings_email_tab() { global $mlwQuizMasterNext; - $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Emails", 'mlw_options_emails_tab_content'); + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__("Emails", 'quiz-master-next'), 'mlw_options_emails_tab_content'); } add_action("plugins_loaded", 'qmn_settings_email_tab'); @@ -17,15 +17,15 @@ function mlw_options_emails_tab_content() //Function variables $mlw_qmn_add_email_id = intval($_POST["mlw_add_email_quiz_id"]); $mlw_qmn_user_email = $wpdb->get_var( $wpdb->prepare( "SELECT user_email_template FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_qmn_add_email_id ) ); - + //Load user email and check if it is array already. If not, turn it into one - if (is_serialized($mlw_qmn_user_email) && is_array(@unserialize($mlw_qmn_user_email))) + if (is_serialized($mlw_qmn_user_email) && is_array(@unserialize($mlw_qmn_user_email))) { $mlw_qmn_email_array = @unserialize($mlw_qmn_user_email); $mlw_new_landing_array = array(0, 100, 'Enter Your Text Here', 'Quiz Results For %QUIZ_NAME%'); array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); $mlw_qmn_email_array = serialize($mlw_qmn_email_array); - + } else { @@ -38,8 +38,8 @@ function mlw_options_emails_tab_content() $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET user_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_email_array, $mlw_qmn_add_email_id ) ); if ($mlw_new_email_results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The email has been added successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The email has been added successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -47,34 +47,34 @@ function mlw_options_emails_tab_content() $insert = "INSERT INTO " . $table_name . "(trail_id, action_user, action, time) " . "VALUES (NULL , '" . $current_user->display_name . "' , 'New User Email Has Been Created For Quiz Number ".$mlw_qmn_add_email_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); + $results = $wpdb->query( $insert ); } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0016.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0016'), 'error'); } } - + //Check to add new admin email template if (isset($_POST["mlw_add_admin_email_page"]) && $_POST["mlw_add_admin_email_page"] == "confirmation") { //Function variables $mlw_qmn_add_email_id = intval($_POST["mlw_add_admin_email_quiz_id"]); $mlw_qmn_admin_email = $wpdb->get_var( $wpdb->prepare( "SELECT admin_email_template FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_qmn_add_email_id ) ); - + //Load user email and check if it is array already. If not, turn it into one - if (is_serialized($mlw_qmn_admin_email) && is_array(@unserialize($mlw_qmn_admin_email))) + if (is_serialized($mlw_qmn_admin_email) && is_array(@unserialize($mlw_qmn_admin_email))) { $mlw_qmn_email_array = @unserialize($mlw_qmn_admin_email); $mlw_new_landing_array = array( "begin_score" => 0, "end_score" => 100, - "message" => 'Enter Your Text Here', + "message" => __('Enter text here', 'quiz-master-next'), "subject" => 'Quiz Results For %QUIZ_NAME%' ); array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); $mlw_qmn_email_array = serialize($mlw_qmn_email_array); - + } else { @@ -87,7 +87,7 @@ function mlw_options_emails_tab_content() $mlw_new_landing_array = array( "begin_score" => 0, "end_score" => 100, - "message" => 'Enter Your Text Here', + "message" => __('Enter text here', 'quiz-master-next'), "subject" => 'Quiz Results For %QUIZ_NAME%' ); array_unshift($mlw_qmn_email_array , $mlw_new_landing_array); @@ -97,8 +97,8 @@ function mlw_options_emails_tab_content() $mlw_new_email_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET admin_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_email_array, $mlw_qmn_add_email_id ) ); if ($mlw_new_email_results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The email has been added successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The email has been added successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -106,14 +106,14 @@ function mlw_options_emails_tab_content() $insert = "INSERT INTO " . $table_name . "(trail_id, action_user, action, time) " . "VALUES (NULL , '" . $current_user->display_name . "' , 'New Admin Email Has Been Created For Quiz Number ".$mlw_qmn_add_email_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); + $results = $wpdb->query( $insert ); } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0016.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0016'), 'error'); } } - + //Check to save email templates if (isset($_POST["mlw_save_email_template"]) && $_POST["mlw_save_email_template"] == "confirmation") { @@ -124,7 +124,7 @@ function mlw_options_emails_tab_content() $mlw_send_user_email = $_POST["sendUserEmail"]; $mlw_send_admin_email = $_POST["sendAdminEmail"]; $mlw_admin_email = $_POST["adminEmail"]; - + //Create new array $i = 1; $mlw_qmn_new_email_array = array(); @@ -137,7 +137,7 @@ function mlw_options_emails_tab_content() } $i++; } - + //Create new array $i = 1; $mlw_qmn_new_admin_array = array(); @@ -146,9 +146,9 @@ function mlw_options_emails_tab_content() if ($_POST["admin_email_".$i] != "Delete") { $mlw_qmn_email_each = array( - "begin_score" => intval($_POST["admin_email_begin_".$i]), - "end_score" => intval($_POST["admin_email_end_".$i]), - "message" => htmlspecialchars(stripslashes($_POST["admin_email_".$i]), ENT_QUOTES), + "begin_score" => intval($_POST["admin_email_begin_".$i]), + "end_score" => intval($_POST["admin_email_end_".$i]), + "message" => htmlspecialchars(stripslashes($_POST["admin_email_".$i]), ENT_QUOTES), "subject" => htmlspecialchars(stripslashes($_POST["admin_email_subject_".$i]), ENT_QUOTES) ); $mlw_qmn_new_admin_array[] = $mlw_qmn_email_each; @@ -160,8 +160,8 @@ function mlw_options_emails_tab_content() $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 ) ); if ($mlw_new_email_results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The email has been updated successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The email has been updated successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -169,22 +169,22 @@ function mlw_options_emails_tab_content() $insert = "INSERT INTO " . $table_name . "(trail_id, action_user, action, time) " . "VALUES (NULL , '" . $current_user->display_name . "' , 'Email Templates Have Been Saved For Quiz Number ".$mlw_qmn_email_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); + $results = $wpdb->query( $insert ); } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0017.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0017'), 'error'); } } - + if (isset($_GET["quiz_id"])) { $table_name = $wpdb->prefix . "mlw_quizzes"; $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); } - + //Load User Email Templates - if (is_serialized($mlw_quiz_options->user_email_template) && is_array(@unserialize($mlw_quiz_options->user_email_template))) + if (is_serialized($mlw_quiz_options->user_email_template) && is_array(@unserialize($mlw_quiz_options->user_email_template))) { $mlw_qmn_user_email_array = @unserialize($mlw_quiz_options->user_email_template); } @@ -192,70 +192,70 @@ function mlw_options_emails_tab_content() { $mlw_qmn_user_email_array = array(array(0, 0, $mlw_quiz_options->user_email_template, 'Quiz Results For %QUIZ_NAME%')); } - + //Load Admin Email Templates - if (is_serialized($mlw_quiz_options->admin_email_template) && is_array(@unserialize($mlw_quiz_options->admin_email_template))) + if (is_serialized($mlw_quiz_options->admin_email_template) && is_array(@unserialize($mlw_quiz_options->admin_email_template))) { $mlw_qmn_admin_email_array = @unserialize($mlw_quiz_options->admin_email_template); } else { $mlw_qmn_admin_email_array = array(array( - "begin_score" => 0, - "end_score" => 0, - "message" => $mlw_quiz_options->admin_email_template, + "begin_score" => 0, + "end_score" => 0, + "message" => $mlw_quiz_options->admin_email_template, "subject" => 'Quiz Results For %QUIZ_NAME%' )); } ?> - +
    -

    Template Variables

    +

    - - + + - + - - + + - + - + - + - - + + - + - - + + - + - - + + - + - - + +
    %POINT_SCORE% - Score for the quiz when using points%AVERAGE_POINT% - The average amount of points user had per question%POINT_SCORE% - %AVERAGE_POINT% -
    %AMOUNT_CORRECT% - The number of correct answers the user had%TOTAL_QUESTIONS% - The total number of questions in the quiz%AMOUNT_CORRECT% - %TOTAL_QUESTIONS% -
    %CORRECT_SCORE% - Score for the quiz when using correct answers%CORRECT_SCORE% -
    %USER_NAME% - The name the user entered before the quiz%USER_BUSINESS% - The business the user entered before the quiz%USER_NAME% - %USER_BUSINESS% -
    %USER_PHONE% - The phone number the user entered before the quiz%USER_EMAIL% - The email the user entered before the quiz%USER_PHONE% - %USER_EMAIL% -
    %QUIZ_NAME% - The name of the quiz%QUESTIONS_ANSWERS% - Shows the question, the answer the user provided, and the correct answer%QUIZ_NAME% - %QUESTIONS_ANSWERS% -
    %COMMENT_SECTION% - The comments the user entered into comment box if enabled%TIMER% - The amount of time user spent of quiz%COMMENT_SECTION% - %TIMER% -

    @@ -268,40 +268,40 @@ function delete_admin_email(id) - +
    - + - + - +
    - send_user_email == 0) {echo 'checked="checked"';} ?> value='0' /> - send_user_email == 1) {echo 'checked="checked"';} ?> value='1' /> + send_user_email == 0) {echo 'checked="checked"';} ?> value='0' /> + send_user_email == 1) {echo 'checked="checked"';} ?> value='1' />
    - send_admin_email == 0) {echo 'checked="checked"';} ?> value='0' /> - send_admin_email == 1) {echo 'checked="checked"';} ?> value='1' /> + send_admin_email == 0) {echo 'checked="checked"';} ?> value='0' /> + send_admin_email == 1) {echo 'checked="checked"';} ?> value='1' />


    -

    Email Sent To User

    - Add New User Email +

    + - - - - + + + + @@ -364,14 +364,14 @@ function delete_admin_email(id) - - - - + + + +
    IDScore Greater Than Or Equal ToScore Less Than Or Equal ToSubjectEmail To Send
    IDScore Greater Than Or Equal ToScore Less Than Or Equal ToSubjectEmail To Send
    - Add New User Email + @@ -379,16 +379,16 @@ function delete_admin_email(id)


    -

    Email Sent To Admin

    - Add New Admin Email +

    + - - - - + + + + @@ -451,19 +451,19 @@ function delete_admin_email(id) - - - - + + + +
    IDScore Greater Than Or Equal ToScore Less Than Or Equal ToSubjectEmail To Send
    IDScore Greater Than Or Equal ToScore Less Than Or Equal ToSubjectEmail To Send
    - Add New Admin Email +


    - +
    Date: Sun, 4 Jan 2015 12:22:57 -0500 Subject: [PATCH 099/184] Added Gettext Functions --- includes/qmn_options_leaderboard_tab.php | 52 ++++++++++++------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/includes/qmn_options_leaderboard_tab.php b/includes/qmn_options_leaderboard_tab.php index 1ddafd2d8..2e5b7fb1e 100644 --- a/includes/qmn_options_leaderboard_tab.php +++ b/includes/qmn_options_leaderboard_tab.php @@ -2,7 +2,7 @@ function qmn_settings_leaderboard_tab() { global $mlwQuizMasterNext; - $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Leaderboard", 'mlw_options_leaderboard_tab_content'); + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__("Leaderboard", 'quiz-master-next'), 'mlw_options_leaderboard_tab_content'); } add_action("plugins_loaded", 'qmn_settings_leaderboard_tab'); @@ -21,8 +21,8 @@ function mlw_options_leaderboard_tab_content() $results = $wpdb->query( $update ); if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The leaderboards has been updated successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The leaderboards has been updated successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -34,10 +34,10 @@ function mlw_options_leaderboard_tab_content() } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0009.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0009'), 'error'); } } - + if (isset($_GET["quiz_id"])) { $table_name = $wpdb->prefix . "mlw_quizzes"; @@ -45,38 +45,38 @@ function mlw_options_leaderboard_tab_content() } ?>
    -

    Template Variables

    +

    - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - +
    %FIRST_PLACE_NAME% - The name of the user who is in first place%FIRST_PLACE_SCORE% - The score from the first place's quiz%FIRST_PLACE_NAME% - %FIRST_PLACE_SCORE% -
    %SECOND_PLACE_NAME% - The name of the user who is in second place%SECOND_PLACE_SCORE% - The score from the second place's quiz%SECOND_PLACE_NAME% - %SECOND_PLACE_SCORE% -
    %THIRD_PLACE_NAME% - The name of the user who is in third place%THIRD_PLACE_SCORE% - The score from the third place's quiz%THIRD_PLACE_NAME% - %THIRD_PLACE_SCORE% -
    %FOURTH_PLACE_NAME% - The name of the user who is in fourth place%FOURTH_PLACE_SCORE% - The score from the fourth place's quiz%FOURTH_PLACE_NAME% - %FOURTH_PLACE_SCORE% -
    %FIFTH_PLACE_NAME% - The name of the user who is in fifth place%FIFTH_PLACE_SCORE% - The score from the fifth place's quiz%FIFTH_PLACE_NAME% - %FIFTH_PLACE_SCORE% -
    %QUIZ_NAME% - The name of the quiz%QUIZ_NAME% -
    - + "; echo ""; @@ -85,9 +85,9 @@ function mlw_options_leaderboard_tab_content()
    - Leaderboard Template +
    -

    Allowed Variables:

    +

    - %QUIZ_NAME%

    - %FIRST_PLACE_NAME%

    - %FIRST_PLACE_SCORE%

    @@ -104,7 +104,7 @@ function mlw_options_leaderboard_tab_content()
    - +
    Date: Sun, 4 Jan 2015 12:31:19 -0500 Subject: [PATCH 100/184] Added Gettext Functions --- includes/qmn_options_option_tab.php | 124 ++++++++++++++-------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/includes/qmn_options_option_tab.php b/includes/qmn_options_option_tab.php index 8e832718d..431b8d848 100644 --- a/includes/qmn_options_option_tab.php +++ b/includes/qmn_options_option_tab.php @@ -2,7 +2,7 @@ function qmn_settings_options_tab() { global $mlwQuizMasterNext; - $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Options", 'mlw_options_option_tab_content'); + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__("Options", 'quiz-master-next'), 'mlw_options_option_tab_content'); } add_action("plugins_loaded", 'qmn_settings_options_tab'); @@ -34,13 +34,13 @@ function mlw_options_option_tab_content() $mlw_qmn_loggedin_contact = $_POST["loggedin_user_contact"]; $qmn_scheduled_timeframe = serialize(array("start" => $_POST["scheduled_time_start"], "end" => $_POST["scheduled_time_end"])); $quiz_id = $_POST["quiz_id"]; - + $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET system='".$mlw_system."', loggedin_user_contact='".$mlw_qmn_loggedin_contact."', contact_info_location=".$mlw_contact_location.", user_name='".$mlw_user_name."', user_comp='".$mlw_user_comp."', user_email='".$mlw_user_email."', user_phone='".$mlw_user_phone."', comment_section='".$mlw_comment_section."', randomness_order='".$mlw_randomness_order."', question_from_total=".$mlw_qmn_questions_from_total.", total_user_tries=".$mlw_total_user_tries.", social_media=".$mlw_qmn_social_media.", pagination=".$mlw_qmn_pagination.", timer_limit=".$mlw_qmn_timer.", question_numbering=".$mlw_qmn_question_numbering.", require_log_in=".$mlw_require_log_in.", limit_total_entries=".$mlw_limit_total_entries.", last_activity='".date("Y-m-d H:i:s")."', scheduled_timeframe='".$qmn_scheduled_timeframe."' WHERE quiz_id=".$quiz_id; $results = $wpdb->query( $update ); if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The options has been updated successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The options has been updated successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -52,19 +52,19 @@ function mlw_options_option_tab_content() } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0008.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0008'), 'error'); } } - + if (isset($_GET["quiz_id"])) { $table_name = $wpdb->prefix . "mlw_quizzes"; $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); } - + //Load Scheduled Timeframe $qmn_scheduled_timeframe = ""; - if (is_serialized($mlw_quiz_options->scheduled_timeframe) && is_array(@unserialize($mlw_quiz_options->scheduled_timeframe))) + if (is_serialized($mlw_quiz_options->scheduled_timeframe) && is_array(@unserialize($mlw_quiz_options->scheduled_timeframe))) { $qmn_scheduled_timeframe = @unserialize($mlw_quiz_options->scheduled_timeframe); } @@ -80,7 +80,7 @@ function mlw_options_option_tab_content() jQuery( "#scheduled_time_start, #scheduled_time_end" ).datepicker(); }); - + "; echo ""; @@ -88,137 +88,137 @@ function mlw_options_option_tab_content() ?> - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
    - system == 0) {echo 'checked="checked"';} ?> value='0' /> - system == 1) {echo 'checked="checked"';} ?> value='1' /> - system == 2) {echo 'checked="checked"';} ?> value='2' /> + system == 0) {echo 'checked="checked"';} ?> value='0' /> + system == 1) {echo 'checked="checked"';} ?> value='1' /> + system == 2) {echo 'checked="checked"';} ?> value='2' />
    - require_log_in == 1) {echo 'checked="checked"';} ?> value='1' /> - require_log_in == 0) {echo 'checked="checked"';} ?> value='0' /> + require_log_in == 1) {echo 'checked="checked"';} ?> value='1' /> + require_log_in == 0) {echo 'checked="checked"';} ?> value='0' />
    - " class="regular-text" /> + " class="regular-text" /> - " class="regular-text" /> + " class="regular-text" />
    - randomness_order == 1) {echo 'checked="checked"';} ?> value='1' /> - randomness_order == 2) {echo 'checked="checked"';} ?> value='2' /> - randomness_order == 0) {echo 'checked="checked"';} ?> value='0' /> + randomness_order == 1) {echo 'checked="checked"';} ?> value='1' /> + randomness_order == 2) {echo 'checked="checked"';} ?> value='2' /> + randomness_order == 0) {echo 'checked="checked"';} ?> value='0' />
    - contact_info_location == 0) {echo 'checked="checked"';} ?> value='0' /> - contact_info_location == 1) {echo 'checked="checked"';} ?> value='1' /> + contact_info_location == 0) {echo 'checked="checked"';} ?> value='0' /> + contact_info_location == 1) {echo 'checked="checked"';} ?> value='1' />
    - loggedin_user_contact == 0) {echo 'checked="checked"';} ?> value='0' /> - loggedin_user_contact == 1) {echo 'checked="checked"';} ?> value='1' /> + loggedin_user_contact == 0) {echo 'checked="checked"';} ?> value='0' /> + loggedin_user_contact == 1) {echo 'checked="checked"';} ?> value='1' />
    - user_name == 0) {echo 'checked="checked"';} ?> value='0' /> - user_name == 1) {echo 'checked="checked"';} ?> value='1' /> - user_name == 2) {echo 'checked="checked"';} ?> value='2' /> + user_name == 0) {echo 'checked="checked"';} ?> value='0' /> + user_name == 1) {echo 'checked="checked"';} ?> value='1' /> + user_name == 2) {echo 'checked="checked"';} ?> value='2' />
    - user_comp == 0) {echo 'checked="checked"';} ?> value='0' /> - user_comp == 1) {echo 'checked="checked"';} ?> value='1' /> - user_comp == 2) {echo 'checked="checked"';} ?> value='2' /> + user_comp == 0) {echo 'checked="checked"';} ?> value='0' /> + user_comp == 1) {echo 'checked="checked"';} ?> value='1' /> + user_comp == 2) {echo 'checked="checked"';} ?> value='2' />
    - user_email == 0) {echo 'checked="checked"';} ?> value='0' /> - user_email == 1) {echo 'checked="checked"';} ?> value='1'/> - user_email == 2) {echo 'checked="checked"';} ?> value='2' /> + user_email == 0) {echo 'checked="checked"';} ?> value='0' /> + user_email == 1) {echo 'checked="checked"';} ?> value='1'/> + user_email == 2) {echo 'checked="checked"';} ?> value='2' />
    - user_phone == 0) {echo 'checked="checked"';} ?> value='0' /> - user_phone == 1) {echo 'checked="checked"';} ?> value='1' /> - user_phone == 2) {echo 'checked="checked"';} ?> value='2' /> + user_phone == 0) {echo 'checked="checked"';} ?> value='0' /> + user_phone == 1) {echo 'checked="checked"';} ?> value='1' /> + user_phone == 2) {echo 'checked="checked"';} ?> value='2' />
    - comment_section == 0) {echo 'checked="checked"';} ?> value='0' /> - comment_section == 1) {echo 'checked="checked"';} ?> value='1' /> + comment_section == 0) {echo 'checked="checked"';} ?> value='0' /> + comment_section == 1) {echo 'checked="checked"';} ?> value='1' />
    - question_numbering == 1) {echo 'checked="checked"';} ?> value='1' /> - question_numbering == 0) {echo 'checked="checked"';} ?> value='0' /> + question_numbering == 1) {echo 'checked="checked"';} ?> value='1' /> + question_numbering == 0) {echo 'checked="checked"';} ?> value='0' />
    - social_media == 1) {echo 'checked="checked"';} ?> value='1' /> - social_media == 0) {echo 'checked="checked"';} ?> value='0' /> + social_media == 1) {echo 'checked="checked"';} ?> value='1' /> + social_media == 0) {echo 'checked="checked"';} ?> value='0' />
    - - "; ?> + +
    Date: Sun, 4 Jan 2015 12:31:54 -0500 Subject: [PATCH 101/184] Added Gettext Functions --- includes/qmn_options_preview_tab.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/qmn_options_preview_tab.php b/includes/qmn_options_preview_tab.php index f36c2f4a3..9c8cf0e6e 100644 --- a/includes/qmn_options_preview_tab.php +++ b/includes/qmn_options_preview_tab.php @@ -2,7 +2,7 @@ function qmn_settings_preview_tab() { global $mlwQuizMasterNext; - $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Preview", 'mlw_options_preview_tab_content'); + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__("Preview", 'quiz-master-next'), 'mlw_options_preview_tab_content'); } add_action("plugins_loaded", 'qmn_settings_preview_tab'); From f86ac892e8e11ed7e044bb3a9e89914c2f77f110 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 12:59:45 -0500 Subject: [PATCH 102/184] Added Gettext Functions --- includes/qmn_options_questions_tab.php | 654 ++++++++++++------------- 1 file changed, 327 insertions(+), 327 deletions(-) diff --git a/includes/qmn_options_questions_tab.php b/includes/qmn_options_questions_tab.php index 2488051be..2f6a0b3bf 100644 --- a/includes/qmn_options_questions_tab.php +++ b/includes/qmn_options_questions_tab.php @@ -2,7 +2,7 @@ function qmn_settings_questions_tab() { global $mlwQuizMasterNext; - $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Questions", 'mlw_options_questions_tab_content'); + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__("Questions", 'quiz-master-next'), 'mlw_options_questions_tab_content'); } add_action("plugins_loaded", 'qmn_settings_questions_tab'); @@ -11,7 +11,7 @@ function mlw_options_questions_tab_content() global $wpdb; global $mlwQuizMasterNext; $quiz_id = $_GET["quiz_id"]; - + //Edit question if ( isset($_POST["edit_question"]) && $_POST["edit_question"] == "confirmation") { @@ -25,7 +25,7 @@ function mlw_options_questions_tab_content() $edit_question_order = intval($_POST["edit_question_order"]); $mlw_edit_answer_total = intval($_POST["question_".$mlw_edit_question_id."_answer_total"]); $mlw_row_settings = $wpdb->get_row( $wpdb->prepare( "SELECT question_settings FROM " . $wpdb->prefix . "mlw_questions" . " WHERE question_id=%d", $mlw_edit_question_id ) ); - if (is_serialized($mlw_row_settings->question_settings) && is_array(@unserialize($mlw_row_settings->question_settings))) + if (is_serialized($mlw_row_settings->question_settings) && is_array(@unserialize($mlw_row_settings->question_settings))) { $mlw_settings = @unserialize($mlw_row_settings->question_settings); } @@ -36,9 +36,9 @@ function mlw_options_questions_tab_content() } if ( !isset($mlw_settings['required'])) { - $mlw_settings['required'] = intval($_POST["edit_required"]); + $mlw_settings['required'] = intval($_POST["edit_required"]); } - $mlw_settings['required'] = intval($_POST["edit_required"]); + $mlw_settings['required'] = intval($_POST["edit_required"]); $mlw_settings = serialize($mlw_settings); $i = 1; $mlw_qmn_new_answer_array = array(); @@ -58,13 +58,13 @@ function mlw_options_questions_tab_content() } $mlw_qmn_new_answer_array = serialize($mlw_qmn_new_answer_array); $quiz_id = $_POST["quiz_id"]; - + $update = "UPDATE " . $wpdb->prefix . "mlw_questions" . " SET question_name='".$edit_question_name."',answer_array='".$mlw_qmn_new_answer_array."', question_answer_info='".$edit_question_answer_info."', comments='".$edit_comments."', hints='".$edit_hint."', question_order='".$edit_question_order."', question_type='".$mlw_edit_question_type."', question_settings='".$mlw_settings."' WHERE question_id=".$mlw_edit_question_id; $results = $wpdb->query( $update ); if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The question has been updated successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The question has been updated successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -76,7 +76,7 @@ function mlw_options_questions_tab_content() } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0004.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0004'), 'error'); } } //Delete question from quiz @@ -85,13 +85,13 @@ function mlw_options_questions_tab_content() //Variables from delete question form $mlw_question_id = intval($_POST["question_id"]); $quiz_id = $_POST["quiz_id"]; - + $update = "UPDATE " . $wpdb->prefix . "mlw_questions" . " SET deleted=1 WHERE question_id=".$mlw_question_id; $results = $wpdb->query( $update ); if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The question has been deleted successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The question has been deleted successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -103,62 +103,62 @@ function mlw_options_questions_tab_content() } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0005.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0005'), 'error'); } } - + //Duplicate Questions if ( isset($_POST["duplicate_question"]) && $_POST["duplicate_question"] == "confirmation") { //Variables from delete question form $mlw_question_id = intval($_POST["duplicate_question_id"]); $quiz_id = $_POST["quiz_id"]; - + $mlw_original = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."mlw_questions WHERE question_id=%d", $mlw_question_id ), ARRAY_A ); - - $results = $wpdb->insert( - $wpdb->prefix."mlw_questions", - array( - 'quiz_id' => $mlw_original['quiz_id'], + + $results = $wpdb->insert( + $wpdb->prefix."mlw_questions", + array( + 'quiz_id' => $mlw_original['quiz_id'], 'question_name' => $mlw_original['question_name'], - 'answer_array' => $mlw_original['answer_array'], + 'answer_array' => $mlw_original['answer_array'], 'answer_one' => $mlw_original['answer_one'], - 'answer_one_points' => $mlw_original['answer_one_points'], + 'answer_one_points' => $mlw_original['answer_one_points'], 'answer_two' => $mlw_original['answer_two'], - 'answer_two_points' => $mlw_original['answer_two_points'], + 'answer_two_points' => $mlw_original['answer_two_points'], 'answer_three' => $mlw_original['answer_three'], - 'answer_three_points' => $mlw_original['answer_three_points'], + 'answer_three_points' => $mlw_original['answer_three_points'], 'answer_four' => $mlw_original['answer_four'], - 'answer_four_points' => $mlw_original['answer_four_points'], + 'answer_four_points' => $mlw_original['answer_four_points'], 'answer_five' => $mlw_original['answer_five'], - 'answer_five_points' => $mlw_original['answer_five_points'], + 'answer_five_points' => $mlw_original['answer_five_points'], 'answer_six' => $mlw_original['answer_six'], - 'answer_six_points' => $mlw_original['answer_six_points'], + 'answer_six_points' => $mlw_original['answer_six_points'], 'correct_answer' => $mlw_original['correct_answer'], - 'question_answer_info' => $mlw_original['question_answer_info'], + 'question_answer_info' => $mlw_original['question_answer_info'], 'comments' => $mlw_original['comments'], - 'hints' => $mlw_original['hints'], + 'hints' => $mlw_original['hints'], 'question_order' => $mlw_original['question_order'], - 'question_type' => $mlw_original['question_type'], - 'question_settings' => $mlw_original['question_settings'], + 'question_type' => $mlw_original['question_type'], + 'question_settings' => $mlw_original['question_settings'], 'deleted' => $mlw_original['deleted'] - ), - array( - '%d', + ), + array( + '%d', '%s', - '%s', '%s', - '%d', '%s', - '%d', + '%d', '%s', - '%d', + '%d', '%s', - '%d', + '%d', '%s', - '%d', + '%d', + '%s', + '%d', '%s', - '%d', + '%d', '%d', '%s', '%d', @@ -167,13 +167,13 @@ function mlw_options_questions_tab_content() '%d', '%s', '%d' - ) + ) ); - + if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The question has been duplicated successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The question has been duplicated successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -185,10 +185,10 @@ function mlw_options_questions_tab_content() } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0019.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0019'), 'error'); } } - + //Submit new question into database if ( isset($_POST["create_question"]) && $_POST["create_question"] == "confirmation") { @@ -227,8 +227,8 @@ function mlw_options_questions_tab_content() $results = $wpdb->query( $insert ); if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The question has been created successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The question has been created successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -240,18 +240,18 @@ function mlw_options_questions_tab_content() } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0006.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0006'), 'error'); } } - + if (isset($_GET["quiz_id"])) { $table_name = $wpdb->prefix . "mlw_quizzes"; $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); } - $mlw_qmn_table_limit = 10; + $mlw_qmn_table_limit = 15; $mlw_qmn_question_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(question_id) FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted='0'", $quiz_id ) ); - + if( isset($_GET{'mlw_question_page'} ) ) { $mlw_qmn_question_page = $_GET{'mlw_question_page'} + 1; @@ -263,14 +263,14 @@ function mlw_options_questions_tab_content() $mlw_qmn_question_begin = 0; } $mlw_qmn_question_left = $mlw_qmn_question_count - ($mlw_qmn_question_page * $mlw_qmn_table_limit); - - $mlw_question_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted='0' + + $mlw_question_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted='0' ORDER BY question_order ASC LIMIT %d, %d", $quiz_id, $mlw_qmn_question_begin, $mlw_qmn_table_limit ) ); - + //Load and prepare answer arrays $mlw_qmn_answer_arrays = array(); foreach($mlw_question_data as $mlw_question_info) { - if (is_serialized($mlw_question_info->answer_array) && is_array(@unserialize($mlw_question_info->answer_array))) + if (is_serialized($mlw_question_info->answer_array) && is_array(@unserialize($mlw_question_info->answer_array))) { $mlw_qmn_answer_array_each = @unserialize($mlw_question_info->answer_array); $mlw_qmn_answer_arrays[$mlw_question_info->question_id] = $mlw_qmn_answer_array_each; @@ -304,7 +304,7 @@ function mlw_options_questions_tab_content() } } }); - + jQuery('#new_question_button').click(function() { jQuery('#new_question_dialog').dialog('open'); document.getElementById("question_name").focus(); @@ -331,7 +331,7 @@ function deleteQuestion(id){ var idText = document.getElementById("delete_question_id"); var idHidden = document.getElementById("question_id"); idText.innerHTML = id; - idHidden.value = id; + idHidden.value = id; }; function duplicateQuestion(id){ jQuery("#duplicate_dialog").dialog({ @@ -346,7 +346,7 @@ function duplicateQuestion(id){ }); jQuery("#duplicate_dialog").dialog('open'); var idHidden = document.getElementById("duplicate_question_id"); - idHidden.value = id; + idHidden.value = id; }; function editQuestion(id){ jQuery("#edit_question_dialog_"+id).dialog({ @@ -367,14 +367,14 @@ function mlw_add_new_question(id) var total_answers = parseFloat(document.getElementById("question_"+id+"_answer_total").value); total_answers = total_answers + 1; document.getElementById("question_"+id+"_answer_total").value = total_answers; - jQuery("#question_"+id+"_answers").append("Answer "+total_answers+""); + jQuery("#question_"+id+"_answers").append(" "+total_answers+""); } function mlw_add_answer_to_new_question() { var total_answers = parseFloat(document.getElementById("new_question_answer_total").value); total_answers = total_answers + 1; document.getElementById("new_question_answer_total").value = total_answers; - jQuery("#new_question_answers").append("Answer "+total_answers+""); + jQuery("#new_question_answers").append(" "+total_answers+""); } - +
    question_settings) && is_array(@unserialize($mlw_question_info->question_settings))) - { - $mlw_question_settings = @unserialize($mlw_question_info->question_settings); - } - else - { - $mlw_question_settings = array(); - $mlw_question_settings['required'] = 1; - } - $mlw_question_type_text = ""; - switch ($mlw_question_info->question_type) { - case 0: - $mlw_question_type_text = "Multiple Choice"; - break; - case 1: - $mlw_question_type_text = "Horizontal Multiple Choice"; - break; - case 2: - $mlw_question_type_text = "Drop Down"; - break; - case 3: - $mlw_question_type_text = "Small Open Answer"; - break; - case 4: - $mlw_question_type_text = "Multiple Response"; - break; - case 5: - $mlw_question_type_text = "Large Open Answer"; - break; - case 6: - $mlw_question_type_text = "Text Block"; - break; - case 7: - $mlw_question_type_text = "Number"; - break; - case 8: - $mlw_question_type_text = "Accept"; - break; - case 9: - $mlw_question_type_text = "Captcha"; - break; - case 10: - $mlw_question_type_text = "Horizontal Multiple Response"; - break; - default: - $mlw_question_type_text = "Error Code "; - } - if($alternate) $alternate = ""; - else $alternate = " class=\"alternate\""; - $question_list .= ""; - $question_list .= "" . $mlw_question_info->question_order . ""; - $question_list .= "" . $mlw_question_type_text . ""; - $question_list .= "" . $mlw_question_info->question_name .""; - $question_list .= ""; - - - $mlw_question_answer_array = $mlw_qmn_answer_arrays[$mlw_question_info->question_id]; - ?> - - - 0 ) { $mlw_qmn_previous_page = $mlw_qmn_question_page - 2; - $display .= "Previous 10 Questions"; + echo ""; if( $mlw_qmn_question_left > $mlw_qmn_table_limit ) { - $display .= "Next 10 Questions"; + echo ""; } } else if( $mlw_qmn_question_page == 0 ) { if( $mlw_qmn_question_left > $mlw_qmn_table_limit ) { - $display .= "Next 10 Questions"; + echo ""; } } else if( $mlw_qmn_question_left < $mlw_qmn_table_limit ) { $mlw_qmn_previous_page = $mlw_qmn_question_page - 2; - $display .= "Previous 10 Questions"; + echo ""; } - $display .= ""; - $display .= " - - - - "; - $display .= "{$question_list}"; - $display .= " - - - - "; - $display .= "
    Question OrderQuestion TypeQuestion
    Question OrderQuestion TypeQuestion
    "; - echo $display; ?> - + + + + + + + + + + question_settings) && is_array(@unserialize($mlw_question_info->question_settings))) + { + $mlw_question_settings = @unserialize($mlw_question_info->question_settings); + } + else + { + $mlw_question_settings = array(); + $mlw_question_settings['required'] = 1; + } + $mlw_question_type_text = ""; + switch ($mlw_question_info->question_type) { + case 0: + $mlw_question_type_text = __("Multiple Choice", 'quiz-master-next'); + break; + case 1: + $mlw_question_type_text = __("Horizontal Multiple Choice", 'quiz-master-next'); + break; + case 2: + $mlw_question_type_text = __("Drop Down", 'quiz-master-next'); + break; + case 3: + $mlw_question_type_text = __("Small Open Answer", 'quiz-master-next'); + break; + case 4: + $mlw_question_type_text = __("Multiple Response", 'quiz-master-next'); + break; + case 5: + $mlw_question_type_text = __("Large Open Answer", 'quiz-master-next'); + break; + case 6: + $mlw_question_type_text = __("Text Block", 'quiz-master-next'); + break; + case 7: + $mlw_question_type_text = __("Number", 'quiz-master-next'); + break; + case 8: + $mlw_question_type_text = __("Accept", 'quiz-master-next'); + break; + case 9: + $mlw_question_type_text = __("Captcha", 'quiz-master-next'); + break; + case 10: + $mlw_question_type_text = __("Horizontal Multiple Response", 'quiz-master-next'); + break; + default: + $mlw_question_type_text = __("Error!", 'quiz-master-next'); + } + if($alternate) $alternate = ""; + else $alternate = " class=\"alternate\""; + $question_list .= ""; + $question_list .= ""; + $question_list .= ""; + $question_list .= ""; + $question_list .= ""; + + + $mlw_question_answer_array = $mlw_qmn_answer_arrays[$mlw_question_info->question_id]; + ?> +
    " . $mlw_question_info->question_order . "" . $mlw_question_type_text . "" . $mlw_question_info->question_name ."
    + + + + + + + + + + + + + + + + + + + + + + +
    + +
      
     
    + + + + value=1 />
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
     
     
    + +
    + comments == 0) { echo 'checked="checked"'; } ?>/> + comments == 2) { echo 'checked="checked"'; } ?>/> + comments == 1) { echo 'checked="checked"'; } ?>/> +
    + +
    + +
    +

    *

    + +

    ' />

    + +
    + + {$question_list}"; + ?> + + + + + + + + + - +
    Date: Sun, 4 Jan 2015 13:05:54 -0500 Subject: [PATCH 103/184] Added Gettext Functions --- includes/qmn_options_results_page_tab.php | 101 +++++++++++----------- 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/includes/qmn_options_results_page_tab.php b/includes/qmn_options_results_page_tab.php index 6e753d4dc..2cb1857ed 100644 --- a/includes/qmn_options_results_page_tab.php +++ b/includes/qmn_options_results_page_tab.php @@ -2,7 +2,7 @@ function qmn_settings_results_tab() { global $mlwQuizMasterNext; - $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Results Pages", 'mlw_options_results_tab_content'); + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__("Results Pages", 'quiz-master-next'), 'mlw_options_results_tab_content'); } add_action("plugins_loaded", 'qmn_settings_results_tab'); function mlw_options_results_tab_content() @@ -17,13 +17,13 @@ function mlw_options_results_tab_content() $mlw_qmn_landing_id = intval($_POST["mlw_add_landing_quiz_id"]); $mlw_qmn_message_after = $wpdb->get_var( $wpdb->prepare( "SELECT message_after FROM ".$wpdb->prefix."mlw_quizzes WHERE quiz_id=%d", $mlw_qmn_landing_id ) ); //Load message_after and check if it is array already. If not, turn it into one - if (is_serialized($mlw_qmn_message_after) && is_array(@unserialize($mlw_qmn_message_after))) + if (is_serialized($mlw_qmn_message_after) && is_array(@unserialize($mlw_qmn_message_after))) { $mlw_qmn_landing_array = @unserialize($mlw_qmn_message_after); $mlw_new_landing_array = array(0, 100, 'Enter Your Text Here'); array_unshift($mlw_qmn_landing_array , $mlw_new_landing_array); $mlw_qmn_landing_array = serialize($mlw_qmn_landing_array); - + } else { @@ -32,13 +32,13 @@ function mlw_options_results_tab_content() array_unshift($mlw_qmn_landing_array , $mlw_new_landing_array); $mlw_qmn_landing_array = serialize($mlw_qmn_landing_array); } - + //Update message_after with new array then check to see if worked $mlw_new_landing_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET message_after=%s, last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_landing_array, $mlw_qmn_landing_id ) ); if ($mlw_new_landing_results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The results page has been added successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The results page has been added successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -46,21 +46,21 @@ function mlw_options_results_tab_content() $insert = "INSERT INTO " . $table_name . "(trail_id, action_user, action, time) " . "VALUES (NULL , '" . $current_user->display_name . "' , 'New Landing Page Has Been Created For Quiz Number ".$mlw_qmn_landing_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); + $results = $wpdb->query( $insert ); } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0013.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0013'), 'error'); } } - + //Check to save landing pages if (isset($_POST["mlw_save_landing_pages"]) && $_POST["mlw_save_landing_pages"] == "confirmation") { //Function Variables $mlw_qmn_landing_id = intval($_POST["mlw_landing_quiz_id"]); $mlw_qmn_landing_total = intval($_POST["mlw_landing_page_total"]); - + //Create new array $i = 1; $mlw_qmn_new_landing_array = array(); @@ -77,8 +77,8 @@ function mlw_options_results_tab_content() $mlw_new_landing_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET message_after='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_new_landing_array, $mlw_qmn_landing_id ) ); if ($mlw_new_landing_results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The results page has been saved successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The results page has been saved successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -86,22 +86,22 @@ function mlw_options_results_tab_content() $insert = "INSERT INTO " . $table_name . "(trail_id, action_user, action, time) " . "VALUES (NULL , '" . $current_user->display_name . "' , 'Landing Pages Have Been Saved For Quiz Number ".$mlw_qmn_landing_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); + $results = $wpdb->query( $insert ); } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0014.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0014'), 'error'); } } - + if (isset($_GET["quiz_id"])) { $table_name = $wpdb->prefix . "mlw_quizzes"; $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); } - + //Load Landing Pages - if (is_serialized($mlw_quiz_options->message_after) && is_array(@unserialize($mlw_quiz_options->message_after))) + if (is_serialized($mlw_quiz_options->message_after) && is_array(@unserialize($mlw_quiz_options->message_after))) { $mlw_message_after_array = @unserialize($mlw_quiz_options->message_after); } @@ -115,59 +115,58 @@ function mlw_options_results_tab_content() function delete_landing(id) { document.getElementById('message_after_'+id).value = "Delete"; - document.mlw_quiz_save_landing_form.submit(); + document.mlw_quiz_save_landing_form.submit(); }

    Template Variables

    - +
    - - + + - + - - + + - + - + - + - - + + - + - - + + - + - - + + - + - - + + - - +
    %POINT_SCORE% - Score for the quiz when using points%AVERAGE_POINT% - The average amount of points user had per question%POINT_SCORE% - %AVERAGE_POINT% -
    %AMOUNT_CORRECT% - The number of correct answers the user had%TOTAL_QUESTIONS% - The total number of questions in the quiz%AMOUNT_CORRECT% - %TOTAL_QUESTIONS% -
    %CORRECT_SCORE% - Score for the quiz when using correct answers%CORRECT_SCORE% -
    %USER_NAME% - The name the user entered before the quiz%USER_BUSINESS% - The business the user entered before the quiz%USER_NAME% - %USER_BUSINESS% -
    %USER_PHONE% - The phone number the user entered before the quiz%USER_EMAIL% - The email the user entered before the quiz%USER_PHONE% - %USER_EMAIL% -
    %QUIZ_NAME% - The name of the quiz%QUESTIONS_ANSWERS% - Shows the question, the answer the user provided, and the correct answer%QUIZ_NAME% - %QUESTIONS_ANSWERS% -
    %COMMENT_SECTION% - The comments the user entered into comment box if enabled%COMMENT_SECTION% - %TIMER% -
    %TIMER% - The amount of time user spent of quiz%CERTIFICATE_LINK% - The link to the certificate after completing the quiz%CERTIFICATE_LINK% -
    - - + +
    - - - + + + @@ -201,7 +200,7 @@ function delete_landing(id) { echo ""; echo ""; echo " - - - + + +
    IDScore Greater Than Or Equal ToScore Less Than Or Equal ToResults Page Shown
    "; - echo $mlw_each_count."
    Are you sure?
    Yes|No
    "; + echo $mlw_each_count."
    ".__('Are you sure?', 'quiz-master-next')."
    ".__('Yes', 'quiz-master-next')."|".__('No', 'quiz-master-next')."
    "; echo "
    "; echo ""; @@ -220,21 +219,21 @@ function delete_landing(id)
    IDScore Greater Than Or Equal ToScore Less Than Or Equal ToResults Page Shown
    - +
    - +
    Date: Sun, 4 Jan 2015 14:48:21 -0500 Subject: [PATCH 104/184] Added Gettext Functions --- includes/qmn_options_style_tab.php | 45 ++++++++++++------------------ 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/includes/qmn_options_style_tab.php b/includes/qmn_options_style_tab.php index d97afe3f2..ae09dd726 100644 --- a/includes/qmn_options_style_tab.php +++ b/includes/qmn_options_style_tab.php @@ -2,7 +2,7 @@ function qmn_settings_style_tab() { global $mlwQuizMasterNext; - $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Style", 'mlw_options_styling_tab_content'); + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__("Style", 'quiz-master-next'), 'mlw_options_styling_tab_content'); } add_action("plugins_loaded", 'qmn_settings_style_tab'); @@ -17,13 +17,13 @@ function mlw_options_styling_tab_content() $mlw_qmn_style_id = intval($_POST["style_quiz_id"]); $mlw_qmn_theme = $_POST["save_quiz_theme"]; $mlw_qmn_style = htmlspecialchars(stripslashes($_POST["quiz_css"]), ENT_QUOTES); - + //Save the new css $mlw_save_stle_results = $wpdb->query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET quiz_stye='%s', theme_selected='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_style, $mlw_qmn_theme, $mlw_qmn_style_id ) ); if ($mlw_save_stle_results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The style has been saved successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The style has been saved successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -31,14 +31,14 @@ function mlw_options_styling_tab_content() $insert = "INSERT INTO " . $table_name . "(trail_id, action_user, action, time) " . "VALUES (NULL , '" . $current_user->display_name . "' , 'Styles Have Been Saved For Quiz Number ".$mlw_qmn_style_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); + $results = $wpdb->query( $insert ); } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0015.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0015'), 'error'); } } - + if (isset($_GET["quiz_id"])) { $table_name = $wpdb->prefix . "mlw_quizzes"; @@ -52,7 +52,7 @@ function mlw_qmn_theme(theme) document.getElementById('save_quiz_theme').value = theme; jQuery("div.mlw_qmn_themeBlockActive").toggleClass("mlw_qmn_themeBlockActive"); jQuery("#mlw_qmn_theme_block_"+theme).toggleClass("mlw_qmn_themeBlockActive"); - + } "; echo ""; ?> -

    Quiz Styles

    -

    Choose your style:

    +

    +

    -
    Custom
    +


    - +
    -

    Custom Theme CSS

    -

    Entire quiz is a div with class 'mlw_qmn_quiz'

    -

    Each page of the quiz is div with class 'quiz_section'

    -

    Message before quiz text is a span with class 'mlw_qmn_message_before'

    -

    The text for each question is wrapped in class 'mlw_qmn_question'

    -

    Each comment field for the questions is wrapped in class 'mlw_qmn_question_comment'

    -

    Label text for comment section is wrapped in class 'mlw_qmn_comment_section_text'

    -

    The message displayed at end of quiz is a span with class 'mlw_qmn_message_end'

    -

    Each button shown for pagination (i.e Next/Previous) is wrapped in class 'mlw_qmn_quiz_link'

    -

    Timer is wrapped in class 'mlw_qmn_timer'

    -

    Each horizontal multiple response is wrapped in a span with class 'mlw_horizontal_multiple'

    +

    +

    +
    - - Default:
    +
    div.mlw_qmn_quiz input[type=radio],
    div.mlw_qmn_quiz input[type=submit],
    div.mlw_qmn_quiz label {
    @@ -155,7 +146,7 @@ function mlw_qmn_theme(theme)
    - +
    Date: Sun, 4 Jan 2015 14:54:43 -0500 Subject: [PATCH 105/184] Added Gettext Functions --- includes/qmn_options_text_tab.php | 146 +++++++++++++++--------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/includes/qmn_options_text_tab.php b/includes/qmn_options_text_tab.php index 075d69089..6b7adaf50 100644 --- a/includes/qmn_options_text_tab.php +++ b/includes/qmn_options_text_tab.php @@ -2,7 +2,7 @@ function qmn_settings_text_tab() { global $mlwQuizMasterNext; - $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Text", 'mlw_options_text_tab_content'); + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__("Text", 'quiz-master-next'), 'mlw_options_text_tab_content'); } add_action("plugins_loaded", 'qmn_settings_text_tab'); @@ -33,13 +33,13 @@ function mlw_options_text_tab_content() $mlw_email_from_text = $_POST["emailFromText"]; $mlw_question_answer_template = htmlspecialchars($_POST["mlw_quiz_question_answer_template"], ENT_QUOTES); $quiz_id = $_POST["quiz_id"]; - + $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; $results = $wpdb->query( $update ); if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The templates has been updated successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The templates has been updated successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -51,30 +51,30 @@ function mlw_options_text_tab_content() } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0007.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0007'), 'error'); } } - + if (isset($_GET["quiz_id"])) { $table_name = $wpdb->prefix . "mlw_quizzes"; $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); } - + //Load Pagination Text $mlw_qmn_pagination_text = ""; - if (is_serialized($mlw_quiz_options->pagination_text) && is_array(@unserialize($mlw_quiz_options->pagination_text))) + if (is_serialized($mlw_quiz_options->pagination_text) && is_array(@unserialize($mlw_quiz_options->pagination_text))) { $mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text); } else { - $mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text); + $mlw_qmn_pagination_text = array(__('Previous', 'quiz-master-next'), $mlw_quiz_options->pagination_text); } - + //Load Social Media Text $qmn_social_media_text = ""; - if (is_serialized($mlw_quiz_options->social_media_text) && is_array(@unserialize($mlw_quiz_options->social_media_text))) + if (is_serialized($mlw_quiz_options->social_media_text) && is_array(@unserialize($mlw_quiz_options->social_media_text))) { $qmn_social_media_text = @unserialize($mlw_quiz_options->social_media_text); } @@ -87,72 +87,72 @@ function mlw_options_text_tab_content() } ?>
    -

    Template Variables

    +

    - - + + - + - - + + - + - + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - +
    %POINT_SCORE% - Total points user earned when taking quiz%AVERAGE_POINT% - The average amount of points user had per question%POINT_SCORE% - %AVERAGE_POINT% -
    %AMOUNT_CORRECT% - The number of correct answers the user had%TOTAL_QUESTIONS% - The total number of questions in the quiz%AMOUNT_CORRECT% - %TOTAL_QUESTIONS% -
    %CORRECT_SCORE% - The percent score for the quiz showing percent of total quetions answered correctly%CORRECT_SCORE% -
    %USER_NAME% - The name the user entered before the quiz%USER_BUSINESS% - The business the user entered before the quiz%USER_NAME% - %USER_BUSINESS% -
    %USER_PHONE% - The phone number the user entered before the quiz%USER_EMAIL% - The email the user entered before the quiz%USER_PHONE% - %USER_EMAIL% -
    %QUIZ_NAME% - The name of the quiz%QUESTIONS_ANSWERS% - Shows the question, the answer the user provided, and the correct answer%QUIZ_NAME% - %QUESTIONS_ANSWERS% -
    %COMMENT_SECTION% - The comments the user entered into comment box if enabled%QUESTION% - The question that the user answered%COMMENT_SECTION% - %QUESTION% -
    %USER_ANSWER% - The answer the user gave for the question%CORRECT_ANSWER% - The correct answer for the question%USER_ANSWER% - %CORRECT_ANSWER% -
    %USER_COMMENTS% - The comments the user provided in the comment field for the question%CORRECT_ANSWER_INFO% - Reason why the correct answer is the correct answer%USER_COMMENTS% - %CORRECT_ANSWER_INFO% -
    %TIMER% - The amount of time user spent of quiz%CERTIFICATE_LINK% - The link to the certificate after completing the quiz%TIMER% - %CERTIFICATE_LINK% -
    %CURRENT_DATE% - The Current Date%CURRENT_DATE% -
    - + "; echo ""; echo ""; ?> -

    Message Templates

    +

    @@ -160,9 +160,9 @@ function mlw_options_text_tab_content() @@ -170,9 +170,9 @@ function mlw_options_text_tab_content() @@ -180,9 +180,9 @@ function mlw_options_text_tab_content() @@ -190,9 +190,9 @@ function mlw_options_text_tab_content() @@ -200,9 +200,9 @@ function mlw_options_text_tab_content() @@ -210,9 +210,9 @@ function mlw_options_text_tab_content() @@ -220,9 +220,9 @@ function mlw_options_text_tab_content()
    - Message Displayed Before Quiz +
    -

    Allowed Variables:

    +

    - %QUIZ_NAME%

    - %CURRENT_DATE%

    - Message Displayed Before Comments Box If Enabled +
    -

    Allowed Variables:

    +

    - %QUIZ_NAME%

    - %CURRENT_DATE%

    - Message Displayed At End Of Quiz (Leave Blank To Omit Text Section) +
    -

    Allowed Variables:

    +

    - %QUIZ_NAME%

    - %CURRENT_DATE%

    - Message Displayed If User Has Tried Quiz Too Many Times +
    -

    Allowed Variables:

    +

    - %QUIZ_NAME%

    - %CURRENT_DATE%

    - Message Displayed If User Is Not Logged In And Quiz Requires Users To Be Logged In +
    -

    Allowed Variables:

    +

    - %QUIZ_NAME%

    - %CURRENT_DATE%

    - Message Displayed If Date Is Outside Scheduled Timeframe +
    -

    Allowed Variables:

    +

    - %QUIZ_NAME%

    - %CURRENT_DATE%

    - Message Displayed If The Limit Of Total Entries Has Been Reached +
    -

    Allowed Variables:

    +

    - %QUIZ_NAME%

    - %CURRENT_DATE%

    - %QUESTIONS_ANSWERS% Text +
    -

    Allowed Variables:

    +

    - %QUESTION%

    - %USER_ANSWER%

    - %CORRECT_ANSWER%

    @@ -233,9 +233,9 @@ function mlw_options_text_tab_content()
    - Twitter Sharing Text +
    -

    Allowed Variables:

    +

    - %POINT_SCORE%

    - %AVERAGE_POINT%

    - %AMOUNT_CORRECT%

    @@ -250,9 +250,9 @@ function mlw_options_text_tab_content()
    - Facebook Sharing Text +
    -

    Allowed Variables:

    +

    - %POINT_SCORE%

    - %AVERAGE_POINT%

    - %AMOUNT_CORRECT%

    @@ -265,46 +265,46 @@ function mlw_options_text_tab_content()
    -

    Other Templates

    +

    - + - + - + - + - + - + - + - + - +
    - + "; ?>
    Date: Sun, 4 Jan 2015 14:57:13 -0500 Subject: [PATCH 106/184] Added Gettext Functions --- includes/qmn_options_tools_tab.php | 34 ++++++++++++++---------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/includes/qmn_options_tools_tab.php b/includes/qmn_options_tools_tab.php index db567a96b..0e9fd58f6 100644 --- a/includes/qmn_options_tools_tab.php +++ b/includes/qmn_options_tools_tab.php @@ -2,7 +2,7 @@ function qmn_settings_tools_tab() { global $mlwQuizMasterNext; - $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Tools", 'mlw_options_tools_tab_content'); + $mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs(__("Tools", 'quiz-master-next'), 'mlw_options_tools_tab_content'); } add_action("plugins_loaded", 'qmn_settings_tools_tab'); function mlw_options_tools_tab_content() @@ -19,8 +19,8 @@ function mlw_options_tools_tab_content() $mlw_reset_sql_results = $wpdb->query( $mlw_reset_update_sql ); if ($mlw_reset_sql_results != false) { - $mlwQuizMasterNext->alertManager->newAlert('The stats has been reset successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('The stats has been reset successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -28,14 +28,14 @@ function mlw_options_tools_tab_content() $insert = "INSERT INTO " . $table_name . "(trail_id, action_user, action, time) " . "VALUES (NULL , '" . $current_user->display_name . "' , 'Quiz Stats Have Been Reset For Quiz Number ".$mlw_leaderboard_quiz_id."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); + $results = $wpdb->query( $insert ); } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0010.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0010'), 'error'); } } - + if (isset($_GET["quiz_id"])) { $table_name = $wpdb->prefix . "mlw_quizzes"; @@ -56,26 +56,24 @@ function mlw_options_tools_tab_content() } } }); - + jQuery('#mlw_reset_stats_button').click(function() { jQuery('#mlw_reset_stats_dialog').dialog('open'); return false; } ); }); -

    Use this button to reset all the stats collected for this quiz (Quiz Views and Times Quiz Has Been Taken).

    - +

    + +

    +
    + + +

    ' />

    +
    +
    Date: Sun, 4 Jan 2015 15:09:17 -0500 Subject: [PATCH 107/184] Added Gettext Functions --- includes/qmn_quiz_admin.php | 353 ++++++++++++++++++------------------ 1 file changed, 172 insertions(+), 181 deletions(-) diff --git a/includes/qmn_quiz_admin.php b/includes/qmn_quiz_admin.php index 545ecd7df..1e1b40b04 100644 --- a/includes/qmn_quiz_admin.php +++ b/includes/qmn_quiz_admin.php @@ -1,11 +1,4 @@ quizCreator->delete_quiz($mlw_quiz_id, $quiz_name); - } + } //Edit Quiz Name if (isset($_POST["quiz_name_editted"]) && $_POST["quiz_name_editted"] == "confirmation") { $mlw_edit_quiz_id = intval($_POST["edit_quiz_id"]); $mlw_edit_quiz_name = htmlspecialchars($_POST["edit_quiz_name"], ENT_QUOTES); - $mlwQuizMasterNext->quizCreator->edit_quiz_name($mlw_edit_quiz_id, $mlw_edit_quiz_name); + $mlwQuizMasterNext->quizCreator->edit_quiz_name($mlw_edit_quiz_id, $mlw_edit_quiz_name); } - + //Duplicate Quiz if (isset($_POST["duplicate_quiz"]) && $_POST["duplicate_quiz"] == "confirmation") { @@ -47,7 +40,7 @@ function mlw_generate_quiz_admin() global $wpdb; $mlw_qmn_table_limit = 25; $mlw_qmn_quiz_count = $wpdb->get_var( "SELECT COUNT(quiz_id) FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted='0'" ); - + if( isset($_GET{'mlw_quiz_page'} ) ) { $mlw_qmn_quiz_page = $_GET{'mlw_quiz_page'} + 1; @@ -59,8 +52,8 @@ function mlw_generate_quiz_admin() $mlw_qmn_quiz_begin = 0; } $mlw_qmn_quiz_left = $mlw_qmn_quiz_count - ($mlw_qmn_quiz_page * $mlw_qmn_table_limit); - $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT quiz_id, quiz_name, quiz_views, quiz_taken, last_activity - FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted='0' + $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT quiz_id, quiz_name, quiz_views, quiz_taken, last_activity + FROM " . $wpdb->prefix . "mlw_quizzes WHERE deleted='0' ORDER BY quiz_id DESC LIMIT %d, %d", $mlw_qmn_quiz_begin, $mlw_qmn_table_limit ) ); ?> @@ -93,7 +86,7 @@ function mlw_generate_quiz_admin() } } }); - + $j('#new_quiz_button').click(function() { $j('#new_quiz_dialog').dialog('open'); return false; @@ -135,7 +128,7 @@ function editQuizName(id, quizName){ }); $j("#edit_dialog").dialog('open'); document.getElementById("edit_quiz_name").value = quizName; - document.getElementById("edit_quiz_id"). value = id; + document.getElementById("edit_quiz_id"). value = id; } function duplicateQuiz(id, quizName){ $j("#duplicate_dialog").dialog({ @@ -150,13 +143,13 @@ function duplicateQuiz(id, quizName){ }); $j("#duplicate_dialog").dialog('open'); document.getElementById("duplicate_quiz_name").innerHTML = quizName; - document.getElementById("duplicate_quiz_id"). value = id; + document.getElementById("duplicate_quiz_id"). value = id; } @@ -176,178 +169,176 @@ function duplicateQuiz(id, quizName){
    -

    QuizzesAdd New

    - alertManager->showAlerts(); ?> -
    -
    -
    - quizzes - - 0 ) - { - $mlw_qmn_previous_page = $mlw_qmn_quiz_page - 2; - echo "<"; - echo "$mlw_current_page of $mlw_total_pages"; - if( $mlw_qmn_quiz_left > $mlw_qmn_table_limit ) - { - echo ">"; - } - else +

    + alertManager->showAlerts(); ?> +
    +
    +
    + + + 0 ) { - echo ">"; - } - } - else if( $mlw_qmn_quiz_page == 0 ) - { - if( $mlw_qmn_quiz_left > $mlw_qmn_table_limit ) - { - echo "<"; + $mlw_qmn_previous_page = $mlw_qmn_quiz_page - 2; + echo "<"; echo "$mlw_current_page of $mlw_total_pages"; - echo ">"; - } - } - else if( $mlw_qmn_quiz_left < $mlw_qmn_table_limit ) - { - $mlw_qmn_previous_page = $mlw_qmn_quiz_page - 2; - echo "<"; - echo "$mlw_current_page of $mlw_total_pages"; - echo ">"; - } - ?> - -
    + if( $mlw_qmn_quiz_left > $mlw_qmn_table_limit ) + { + echo ">"; + } + else + { + echo ">"; + } + } + else if( $mlw_qmn_quiz_page == 0 ) + { + if( $mlw_qmn_quiz_left > $mlw_qmn_table_limit ) + { + echo "<"; + echo "$mlw_current_page of $mlw_total_pages"; + echo ">"; + } + } + else if( $mlw_qmn_quiz_left < $mlw_qmn_table_limit ) + { + $mlw_qmn_previous_page = $mlw_qmn_quiz_page - 2; + echo "<"; + echo "$mlw_current_page of $mlw_total_pages"; + echo ">"; + } + ?> + +
    +
    + + + + + + + + + + + + + + "; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + } + echo $quotes_list; ?> + + + + + + + + + + + + +
    Quiz ID
    " . $mlw_quiz_info->quiz_id . "" . esc_html($mlw_quiz_info->quiz_name) ." quiz_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='javascript:();'>(".__('Edit Name', 'quiz-master-next').""; + $quotes_list .= "[mlw_quizmaster quiz=".$mlw_quiz_info->quiz_id."][mlw_quizmaster_leaderboard mlw_quiz=".$mlw_quiz_info->quiz_id."]" . $mlw_quiz_info->quiz_views . "" . $mlw_quiz_info->quiz_taken ."" . $mlw_quiz_info->last_activity ."
    Quiz ID
    +
    +
    +

    My Local Webstop News

    +
    - - - - - - - - - - +
    + + + + +
    Quiz IDQuiz NameQuiz ShortcodeLeaderboard ShortcodeQuiz ViewsQuiz TakenLast Modified
    + + + + + - - - "; - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - } - echo $quotes_list; ?> - - - - - - - - - - + + + + - -
     
    " . $mlw_quiz_info->quiz_id . "" . esc_html($mlw_quiz_info->quiz_name) ." quiz_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='javascript:();'>(Edit Name)"; - $quotes_list .= "[mlw_quizmaster quiz=".$mlw_quiz_info->quiz_id."][mlw_quizmaster_leaderboard mlw_quiz=".$mlw_quiz_info->quiz_id."]" . $mlw_quiz_info->quiz_views . "" . $mlw_quiz_info->quiz_taken ."" . $mlw_quiz_info->last_activity ."
    Quiz IDQuiz NameQuiz ShortcodeLeaderboard ShortcodeQuiz ViewsQuiz TakenLast Modified

    -
    -
    -

    My Local Webstop News

    - -
    -
    - - - - - - - - - - - + + + + + + + + + - - - - +
    Date: Sun, 4 Jan 2015 15:12:22 -0500 Subject: [PATCH 108/184] Added Gettext Functions --- includes/qmn_quiz_creator.php | 326 +++++++++++++++++----------------- 1 file changed, 163 insertions(+), 163 deletions(-) diff --git a/includes/qmn_quiz_creator.php b/includes/qmn_quiz_creator.php index 10c00467f..0a7bac724 100644 --- a/includes/qmn_quiz_creator.php +++ b/includes/qmn_quiz_creator.php @@ -17,7 +17,7 @@ class QMNQuizCreator * @since 3.7.1 */ private $quiz_id; - + /** * If the quiz ID is set, store it as the class quiz ID * @@ -30,32 +30,32 @@ public function __construct() $this->quiz_id = intval($_GET["quiz_id"]); } } - + /** * Sets quiz ID - * + * * @since 3.8.1 * @access public - * @return void + * @return void */ public function set_id($quiz_id) { $this->quiz_id = intval($quiz_id); } - + /** * Retrieves setting store in quiz_settings - * + * * @since 3.8.1 * @access public - * @return string The value of the setting + * @return string The value of the setting */ public function get_setting($setting_name) { global $wpdb; $qmn_settings_array = ''; $qmn_quiz_settings = $wpdb->get_var( $wpdb->prepare( "SELECT quiz_settings FROM " . $wpdb->prefix . "mlw_quizzes" . " WHERE quiz_id=%d", $this->quiz_id ) ); - if (is_serialized($qmn_quiz_settings) && is_array(@unserialize($qmn_quiz_settings))) + if (is_serialized($qmn_quiz_settings) && is_array(@unserialize($qmn_quiz_settings))) { $qmn_settings_array = @unserialize($qmn_quiz_settings); } @@ -67,12 +67,12 @@ public function get_setting($setting_name) { return ''; } - + } - + /** * Updates setting stored in quiz_settings - * + * * @since 3.8.1 * @access public * @return bool True if update was successful @@ -82,22 +82,22 @@ public function update_setting($setting_name, $setting_value) global $wpdb; $qmn_settings_array = array(); $qmn_quiz_settings = $wpdb->get_var( $wpdb->prepare( "SELECT quiz_settings FROM " . $wpdb->prefix . "mlw_quizzes" . " WHERE quiz_id=%d", $this->quiz_id ) ); - if (is_serialized($qmn_quiz_settings) && is_array(@unserialize($qmn_quiz_settings))) + if (is_serialized($qmn_quiz_settings) && is_array(@unserialize($qmn_quiz_settings))) { $qmn_settings_array = @unserialize($qmn_quiz_settings); } - $qmn_settings_array[$setting_name] = $setting_value; + $qmn_settings_array[$setting_name] = $setting_value; $qmn_serialized_array = serialize($qmn_settings_array); - $results = $wpdb->update( - $wpdb->prefix . "mlw_quizzes", - array( - 'quiz_settings' => $qmn_serialized_array - ), - array( 'quiz_id' => $this->quiz_id ), - array( + $results = $wpdb->update( + $wpdb->prefix . "mlw_quizzes", + array( + 'quiz_settings' => $qmn_serialized_array + ), + array( 'quiz_id' => $this->quiz_id ), + array( '%s' ), - array( '%d' ) + array( '%d' ) ); if ($results != false) { @@ -108,10 +108,10 @@ public function update_setting($setting_name, $setting_value) return false; } } - + /** * Deletes setting stored in quiz_settings - * + * * @since 3.8.1 * @access public * @return void @@ -121,7 +121,7 @@ public function delete_setting($setting_name) global $wpdb; $qmn_settings_array = array(); $qmn_quiz_settings = $wpdb->get_var( $wpdb->prepare( "SELECT quiz_settings FROM " . $wpdb->prefix . "mlw_quizzes" . " WHERE quiz_id=%d", $this->quiz_id ) ); - if (is_serialized($qmn_quiz_settings) && is_array(@unserialize($qmn_quiz_settings))) + if (is_serialized($qmn_quiz_settings) && is_array(@unserialize($qmn_quiz_settings))) { $qmn_settings_array = @unserialize($qmn_quiz_settings); } @@ -130,21 +130,21 @@ public function delete_setting($setting_name) unset($qmn_settings_array[$setting_name]); } $qmn_serialized_array = serialize($qmn_settings_array); - $results = $wpdb->update( - $wpdb->prefix . "mlw_quizzes", - array( - 'quiz_settings' => $qmn_serialized_array - ), - array( 'quiz_id' => $this->quiz_id ), - array( + $results = $wpdb->update( + $wpdb->prefix . "mlw_quizzes", + array( + 'quiz_settings' => $qmn_serialized_array + ), + array( 'quiz_id' => $this->quiz_id ), + array( '%s' ), - array( '%d' ) + array( '%d' ) ); } - - - + + + /** * Creates a new quiz with the default settings * @@ -176,7 +176,7 @@ public function create_quiz($quiz_name) text-align: left; } div.quiz_section { - + } div.mlw_qmn_timer { position:fixed; @@ -212,54 +212,54 @@ public function create_quiz($quiz_name) } .mlw_qmn_comment_section_text { - font-weight: bold; + font-weight: bold; }"; $mlw_question_answer_default = "%QUESTION%
    Answer Provided: %USER_ANSWER%
    Correct Answer: %CORRECT_ANSWER%
    Comments Entered: %USER_COMMENTS%
    "; - $results = $wpdb->insert( - $wpdb->prefix . "mlw_quizzes", - array( - 'quiz_name' => $quiz_name, + $results = $wpdb->insert( + $wpdb->prefix . "mlw_quizzes", + array( + 'quiz_name' => $quiz_name, 'message_before' => 'Enter your text here', - 'message_after' => 'Enter your text here', + 'message_after' => 'Enter your text here', 'message_comment' => 'Enter your text here', - 'message_end_template' => '', + 'message_end_template' => '', 'user_email_template' => 'Enter your text here', - 'admin_email_template' => 'Enter your text here', + 'admin_email_template' => 'Enter your text here', 'submit_button_text' => 'Submit Quiz', - 'name_field_text' => 'Name', + 'name_field_text' => 'Name', 'business_field_text' => 'Business', - 'email_field_text' => 'Email', + 'email_field_text' => 'Email', 'phone_field_text' => 'Phone Number', - 'comment_field_text' => 'Comments', + 'comment_field_text' => 'Comments', 'email_from_text' => 'Wordpress', - 'question_answer_template' => $mlw_question_answer_default, + 'question_answer_template' => $mlw_question_answer_default, 'leaderboard_template' => $mlw_leaderboard_default, - 'system' => 0, + 'system' => 0, 'randomness_order' => 0, - 'loggedin_user_contact' => 0, + 'loggedin_user_contact' => 0, 'show_score' => 0, - 'send_user_email' => 0, + 'send_user_email' => 0, 'send_admin_email' => 0, - 'contact_info_location' => 0, + 'contact_info_location' => 0, 'user_name' => 0, - 'user_comp' => 0, + 'user_comp' => 0, 'user_email' => 0, - 'user_phone' => 0, + 'user_phone' => 0, 'admin_email' => get_option( 'admin_email', 'Enter email' ), - 'comment_section' => 0, + 'comment_section' => 0, 'question_from_total' => 0, - 'total_user_tries' => 0, + 'total_user_tries' => 0, 'total_user_tries_text' => 'Enter Your Text Here', - 'certificate_template' => 'Enter Your Text Here!', + 'certificate_template' => 'Enter Your Text Here!', 'social_media' => 0, - 'social_media_text' => 'I just scored %CORRECT_SCORE%% on %QUIZ_NAME%!', + 'social_media_text' => 'I just scored %CORRECT_SCORE%% on %QUIZ_NAME%!', 'pagination' => 0, 'pagination_text' => 'Next', - 'timer_limit' => 0, + 'timer_limit' => 0, 'quiz_stye' => $mlw_style_default, - 'question_numbering' => 0, + 'question_numbering' => 0, 'quiz_settings' => '', - 'theme_selected' => 'default', + 'theme_selected' => 'default', 'last_activity' => date("Y-m-d H:i:s"), 'require_log_in' => 0, 'require_log_in_text' => 'Enter Your Text Here', @@ -267,53 +267,53 @@ public function create_quiz($quiz_name) 'limit_total_entries_text' => 'Enter Your Text Here', 'scheduled_timeframe' => '', 'scheduled_timeframe_text' => '', - 'quiz_views' => 0, + 'quiz_views' => 0, 'quiz_taken' => 0, 'deleted' => 0 - ), - array( - '%s', + ), + array( + '%s', + '%s', + '%s', '%s', - '%s', '%s', - '%s', '%s', - '%s', '%s', - '%s', '%s', - '%s', '%s', - '%s', '%s', - '%s', '%s', - '%d', + '%s', + '%s', + '%s', + '%s', + '%s', + '%d', + '%d', + '%d', + '%d', + '%d', + '%d', '%d', - '%d', '%d', - '%d', '%d', - '%d', '%d', - '%d', '%d', - '%d', '%s', - '%d', '%d', - '%d', + '%d', + '%d', + '%s', '%s', - '%s', '%d', - '%s', + '%s', + '%d', + '%s', '%d', '%s', - '%d', + '%d', '%s', - '%d', '%s', - '%s', '%s', '%d', '%s', @@ -321,14 +321,14 @@ public function create_quiz($quiz_name) '%s', '%s', '%s', - '%d', + '%d', '%d', '%d' - ) + ) ); if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('Your new quiz has been created successfully. To begin editing your quiz, click the Edit link on the new quiz.', 'success'); + $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'); //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -340,11 +340,11 @@ public function create_quiz($quiz_name) } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0001.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0001'), 'error'); } do_action('qmn_quiz_created', $wpdb->insert_id); } - + /** * Deletes a quiz with the given quiz_id * @@ -356,32 +356,32 @@ public function delete_quiz($quiz_id, $quiz_name) { global $mlwQuizMasterNext; global $wpdb; - $results = $wpdb->update( - $wpdb->prefix . "mlw_quizzes", - array( - 'deleted' => 1 - ), - array( 'quiz_id' => $quiz_id ), - array( + $results = $wpdb->update( + $wpdb->prefix . "mlw_quizzes", + array( + 'deleted' => 1 + ), + array( 'quiz_id' => $quiz_id ), + array( '%d' - ), - array( '%d' ) + ), + array( '%d' ) ); - $delete_question_results = $wpdb->update( - $wpdb->prefix . "mlw_questions", - array( - 'deleted' => 1 - ), - array( 'quiz_id' => $quiz_id ), - array( + $delete_question_results = $wpdb->update( + $wpdb->prefix . "mlw_questions", + array( + 'deleted' => 1 + ), + array( 'quiz_id' => $quiz_id ), + array( '%d' - ), - array( '%d' ) + ), + array( '%d' ) ); if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('Your quiz has been deleted successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('Your quiz has been deleted successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -393,11 +393,11 @@ public function delete_quiz($quiz_id, $quiz_name) } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0002.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0002'), 'error'); } do_action('qmn_quiz_deleted', $quiz_id); } - + /** * Edits the name of the quiz with the given ID * @@ -409,21 +409,21 @@ public function edit_quiz_name($quiz_id, $quiz_name) { global $mlwQuizMasterNext; global $wpdb; - $results = $wpdb->update( - $wpdb->prefix . "mlw_quizzes", - array( - 'quiz_name' => $quiz_name - ), - array( 'quiz_id' => $quiz_id ), - array( + $results = $wpdb->update( + $wpdb->prefix . "mlw_quizzes", + array( + 'quiz_name' => $quiz_name + ), + array( 'quiz_id' => $quiz_id ), + array( '%s' - ), - array( '%d' ) + ), + array( '%d' ) ); if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('Your quiz name has been updated successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('Your quiz name has been updated successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -435,11 +435,11 @@ public function edit_quiz_name($quiz_id, $quiz_name) } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0003.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0003'), 'error'); } do_action('qmn_quiz_name_edited', $quiz_id); } - + /** * Duplicates the quiz with the given ID and gives new quiz the given quiz name * @@ -451,48 +451,48 @@ public function duplicate_quiz($quiz_id, $quiz_name, $is_duplicating_questions) { global $mlwQuizMasterNext; global $wpdb; - + $table_name = $wpdb->prefix . "mlw_quizzes"; $mlw_qmn_duplicate_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table_name WHERE quiz_id=%d", $quiz_id ) ); - $results = $wpdb->insert( - $table_name, - array( + $results = $wpdb->insert( + $table_name, + array( 'quiz_name' => $quiz_name, 'message_before' => $mlw_qmn_duplicate_data->message_before, - 'message_after' => $mlw_qmn_duplicate_data->message_after, + 'message_after' => $mlw_qmn_duplicate_data->message_after, 'message_comment' => $mlw_qmn_duplicate_data->message_comment, 'message_end_template' => $mlw_qmn_duplicate_data->message_end_template, - 'user_email_template' => $mlw_qmn_duplicate_data->user_email_template, + 'user_email_template' => $mlw_qmn_duplicate_data->user_email_template, 'admin_email_template' => $mlw_qmn_duplicate_data->admin_email_template, 'submit_button_text' => $mlw_qmn_duplicate_data->submit_button_text, - 'name_field_text' => $mlw_qmn_duplicate_data->name_field_text, + 'name_field_text' => $mlw_qmn_duplicate_data->name_field_text, 'business_field_text' => $mlw_qmn_duplicate_data->business_field_text, 'email_field_text' => $mlw_qmn_duplicate_data->email_field_text, - 'phone_field_text' => $mlw_qmn_duplicate_data->phone_field_text, + 'phone_field_text' => $mlw_qmn_duplicate_data->phone_field_text, 'comment_field_text' => $mlw_qmn_duplicate_data->comment_field_text, 'email_from_text' => $mlw_qmn_duplicate_data->email_from_text, - 'question_answer_template' => $mlw_qmn_duplicate_data->question_answer_template, + 'question_answer_template' => $mlw_qmn_duplicate_data->question_answer_template, 'leaderboard_template' => $mlw_qmn_duplicate_data->leaderboard_template, 'system' => $mlw_qmn_duplicate_data->system, - 'randomness_order' => $mlw_qmn_duplicate_data->randomness_order, + 'randomness_order' => $mlw_qmn_duplicate_data->randomness_order, 'loggedin_user_contact' => $mlw_qmn_duplicate_data->loggedin_user_contact, 'show_score' => $mlw_qmn_duplicate_data->show_score, - 'send_user_email' => $mlw_qmn_duplicate_data->send_user_email, + 'send_user_email' => $mlw_qmn_duplicate_data->send_user_email, 'send_admin_email' => $mlw_qmn_duplicate_data->send_admin_email, 'contact_info_location' => $mlw_qmn_duplicate_data->contact_info_location, - 'user_name' => $mlw_qmn_duplicate_data->user_name, + 'user_name' => $mlw_qmn_duplicate_data->user_name, 'user_comp' => $mlw_qmn_duplicate_data->user_comp, 'user_email' => $mlw_qmn_duplicate_data->user_email, - 'user_phone' => $mlw_qmn_duplicate_data->user_phone, + 'user_phone' => $mlw_qmn_duplicate_data->user_phone, 'admin_email' => get_option( 'admin_email', 'Enter email' ), 'comment_section' => $mlw_qmn_duplicate_data->comment_section, - 'question_from_total' => $mlw_qmn_duplicate_data->question_from_total, + 'question_from_total' => $mlw_qmn_duplicate_data->question_from_total, 'total_user_tries' => $mlw_qmn_duplicate_data->total_user_tries, 'total_user_tries_text' => $mlw_qmn_duplicate_data->total_user_tries_text, - 'certificate_template' => $mlw_qmn_duplicate_data->certificate_template, + 'certificate_template' => $mlw_qmn_duplicate_data->certificate_template, 'social_media' => $mlw_qmn_duplicate_data->social_media, 'social_media_text' => $mlw_qmn_duplicate_data->social_media_text, - 'pagination' => $mlw_qmn_duplicate_data->pagination, + 'pagination' => $mlw_qmn_duplicate_data->pagination, 'pagination_text' => $mlw_qmn_duplicate_data->pagination_text, 'timer_limit' => $mlw_qmn_duplicate_data->timer_limit, 'quiz_stye' => $mlw_qmn_duplicate_data->quiz_stye, @@ -507,28 +507,28 @@ public function duplicate_quiz($quiz_id, $quiz_name, $is_duplicating_questions) 'scheduled_timeframe' => $mlw_qmn_duplicate_data->scheduled_timeframe, 'scheduled_timeframe_text' => $mlw_qmn_duplicate_data->scheduled_timeframe_text, 'quiz_views' => 0, - 'quiz_taken' => 0, + 'quiz_taken' => 0, 'deleted' => 0 ), - array( + array( + '%s', + '%s', + '%s', + '%s', '%s', '%s', - '%s', '%s', '%s', - '%s', '%s', '%s', - '%s', '%s', '%s', - '%s', '%s', '%s', - '%s', '%s', + '%s', + '%d', '%d', - '%d', '%d', '%d', '%d', @@ -543,7 +543,7 @@ public function duplicate_quiz($quiz_id, $quiz_name, $is_duplicating_questions) '%d', '%d', '%s', - '%s', + '%s', '%d', '%s', '%d', @@ -568,8 +568,8 @@ public function duplicate_quiz($quiz_id, $quiz_name, $is_duplicating_questions) $mlw_new_id = $wpdb->insert_id; if ($results != false) { - $mlwQuizMasterNext->alertManager->newAlert('Your quiz has been duplicated successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('Your quiz has been duplicated successfully.', 'quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -581,7 +581,7 @@ public function duplicate_quiz($quiz_id, $quiz_name, $is_duplicating_questions) } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0011.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0011'), 'error'); } if ($is_duplicating_questions) { @@ -589,14 +589,14 @@ public function duplicate_quiz($quiz_id, $quiz_name, $is_duplicating_questions) $mlw_current_questions = $wpdb->get_results("SELECT * FROM $table_name WHERE deleted=0 AND quiz_id=".$quiz_id); foreach ($mlw_current_questions as $mlw_question) { - $question_results = $wpdb->insert( - $table_name, - array( + $question_results = $wpdb->insert( + $table_name, + array( 'quiz_id' => $mlw_new_id, 'question_name' => $mlw_question->question_name, - 'answer_array' => $mlw_question->answer_array, + 'answer_array' => $mlw_question->answer_array, 'answer_one' => $mlw_question->answer_one, - 'answer_one_points' => $mlw_question->answer_one_points, + 'answer_one_points' => $mlw_question->answer_one_points, 'answer_two' => $mlw_question->answer_two, 'answer_two_points' => $mlw_question->answer_two_points, 'answer_three' => $mlw_question->answer_three, @@ -615,11 +615,11 @@ public function duplicate_quiz($quiz_id, $quiz_name, $is_duplicating_questions) 'question_type' => $mlw_question->question_type, 'question_settings' => $mlw_question->question_settings, 'deleted' => 0 - ), - array( + ), + array( '%d', '%s', - '%s', + '%s', '%s', '%d', '%s', @@ -640,11 +640,11 @@ public function duplicate_quiz($quiz_id, $quiz_name, $is_duplicating_questions) '%d', '%s', '%d' - ) + ) ); if ($question_results == false) { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0020.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0020'), 'error'); } } } From 49a5034cacb30071ae6fb00de2e4e76cf43c5efd Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 15:15:15 -0500 Subject: [PATCH 109/184] Added Gettext Functions --- includes/qmn_quiz_options.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/includes/qmn_quiz_options.php b/includes/qmn_quiz_options.php index e18eccc12..b5f116b19 100644 --- a/includes/qmn_quiz_options.php +++ b/includes/qmn_quiz_options.php @@ -2,7 +2,7 @@ /* This page allows for the editing of quizzes selected from the quiz admin page. */ -/* +/* Copyright 2014, My Local Webstop (email : fpcorso@mylocalwebstop.com) */ @@ -15,9 +15,9 @@ function mlw_generate_quiz_options() { $table_name = $wpdb->prefix . "mlw_quizzes"; $mlw_quiz_options = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $_GET["quiz_id"])); - } + } ?> - + @@ -51,7 +51,10 @@ function mlw_generate_quiz_options()
    -

    Quiz Settings For quiz_name; ?>

    +

    quiz_name); + ?>

    - +

    - Hey! Please go to the quizzes page and click on the Edit link from the quiz you wish to edit.

    Date: Sun, 4 Jan 2015 15:18:41 -0500 Subject: [PATCH 110/184] Added Gettext Functions --- includes/qmn_quiz.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/qmn_quiz.php b/includes/qmn_quiz.php index 3b4d9d683..1ebcbe259 100644 --- a/includes/qmn_quiz.php +++ b/includes/qmn_quiz.php @@ -500,7 +500,7 @@ public function display_questions($qmn_quiz_options, $qmn_quiz_questions, $qmn_q } if ($mlw_question->hints != "") { - $question_display .= "hints, ENT_QUOTES)."\" class='mlw_qmn_hint_link'>Hint"; + $question_display .= "hints, ENT_QUOTES)."\" class='mlw_qmn_hint_link'>".__('Hint', 'quiz-master-next').""; $question_display .= "

    "; } $question_display .= "
    "; @@ -1205,7 +1205,7 @@ function qmn_quiz_name_check($display, $qmn_quiz_options, $qmn_array_for_variabl if ($qmn_quiz_options->quiz_name == "") { $qmn_allowed_visit = false; - $display .= "It appears that this quiz is not set up correctly."; + $display .= __("It appears that this quiz is not set up correctly.", 'quiz-master-next'); } return $display; } @@ -1256,7 +1256,7 @@ function qmn_pagination_check($display, $qmn_quiz_options, $qmn_array_for_variab } else { - $mlw_qmn_pagination_text = array('Previous', $qmn_quiz_options->pagination_text); + $mlw_qmn_pagination_text = array(__('Previous', 'quiz-master-next'), $qmn_quiz_options->pagination_text); } ?> + Date: Sun, 4 Jan 2015 15:23:47 -0500 Subject: [PATCH 112/184] Setting up errors for translations --- includes/js/qmn_quiz.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/includes/js/qmn_quiz.js b/includes/js/qmn_quiz.js index be81c310e..1be56a98e 100644 --- a/includes/js/qmn_quiz.js +++ b/includes/js/qmn_quiz.js @@ -30,7 +30,7 @@ function clear_field(field) function mlw_validateForm() { mlw_validateResult = true; - + jQuery('#quizForm *').filter(':input').each(function(){ jQuery(this).css("outline", ""); if (jQuery(this).attr('class')) @@ -42,48 +42,48 @@ function mlw_validateForm() 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!**'; + document.getElementById('mlw_error_message').innerHTML = '**'+email_error+'**'; + document.getElementById('mlw_error_message_bottom').innerHTML = '**'+email_error+'**'; 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!**'; - document.getElementById('mlw_error_message_bottom').innerHTML = '**This field must be a number!**'; + document.getElementById('mlw_error_message').innerHTML = '**'+number_error+'**'; + document.getElementById('mlw_error_message_bottom').innerHTML = '**'+number_error+'**'; jQuery(this).css("outline", "2px solid red"); mlw_validateResult = false; } if(jQuery(this).attr('class').indexOf('mlwRequiredText') > -1 && this.value == "") { - document.getElementById('mlw_error_message').innerHTML = '**Please complete all required fields!**'; - document.getElementById('mlw_error_message_bottom').innerHTML = '**Please complete all required fields!**'; + document.getElementById('mlw_error_message').innerHTML = '**'+empty_error+'**'; + document.getElementById('mlw_error_message_bottom').innerHTML = '**'+empty_error+'**'; jQuery(this).css("outline", "2px solid red"); mlw_validateResult = false; } if(jQuery(this).attr('class').indexOf('mlwRequiredCaptcha') > -1 && this.value != mlw_code) { - document.getElementById('mlw_error_message').innerHTML = '**The entered text is not correct!**'; - document.getElementById('mlw_error_message_bottom').innerHTML = '**The entered text is not correct!**'; + document.getElementById('mlw_error_message').innerHTML = '**'+incorrect_error+'**'; + document.getElementById('mlw_error_message_bottom').innerHTML = '**'+incorrect_error+'**'; jQuery(this).css("outline", "2px solid red"); mlw_validateResult = false; } if(jQuery(this).attr('class').indexOf('mlwRequiredCheck') > -1 && !this.checked) { - document.getElementById('mlw_error_message').innerHTML = '**Please complete all required fields!**'; - document.getElementById('mlw_error_message_bottom').innerHTML = '**Please complete all required fields!**'; + document.getElementById('mlw_error_message').innerHTML = '**'+empty_error+'**'; + document.getElementById('mlw_error_message_bottom').innerHTML = '**'+empty_error+'**'; jQuery(this).css("outline", "2px solid red"); mlw_validateResult = false; } } }); - + if (!mlw_validateResult) {return mlw_validateResult;} - + jQuery( '.mlw_qmn_quiz input:radio' ).attr('disabled',false); jQuery( '.mlw_qmn_quiz input:checkbox' ).attr('disabled',false); jQuery( '.mlw_qmn_quiz select' ).attr('disabled',false); jQuery( '.mlw_qmn_question_comment' ).attr('disabled',false); jQuery( '.mlw_answer_open_text' ).attr('disabled',false); -} +} From e19fbe9eb4a950b39f35000b43ba1ea65dae2865 Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 15:34:35 -0500 Subject: [PATCH 113/184] Added Gettext Functions --- includes/qmn_results_details.php | 66 ++++++++++++++------------------ 1 file changed, 28 insertions(+), 38 deletions(-) diff --git a/includes/qmn_results_details.php b/includes/qmn_results_details.php index 0214f5c9d..b8678af92 100644 --- a/includes/qmn_results_details.php +++ b/includes/qmn_results_details.php @@ -124,33 +124,33 @@ function mlw_generate_result_details()
    -

    Quiz Results(?)

    +

    -

    Quiz Results From quiz_name; ?>

    +

    : quiz_name; ?>

    - + - + - + - + - + @@ -161,14 +161,14 @@ function mlw_generate_result_details() if ($mlw_results_data->quiz_system == 0) { ?> - + quiz_system == 1) { ?> - +

    -

    Answers Provided

    +

    quiz_results); if (!is_array($mlw_qmn_results_array)) { @@ -189,31 +189,34 @@ function mlw_generate_result_details() $mlw_complete_hours = floor($mlw_qmn_results_array[0] / 3600); if ($mlw_complete_hours > 0) { - $mlw_complete_time .= "$mlw_complete_hours hours "; + $mlw_complete_time .= "$mlw_complete_hours ".__('hours','quiz-master-next')." "; } $mlw_complete_minutes = floor(($mlw_qmn_results_array[0] % 3600) / 60); if ($mlw_complete_minutes > 0) { - $mlw_complete_time .= "$mlw_complete_minutes minutes "; + $mlw_complete_time .= "$mlw_complete_minutes ".__('minutes','quiz-master-next')." "; } $mlw_complete_seconds = $mlw_qmn_results_array[0] % 60; - $mlw_complete_time .= "$mlw_complete_seconds seconds"; + $mlw_complete_time .= "$mlw_complete_seconds ".__('seconds','quiz-master-next'); ?> - This quiz was completed in .
    +



    - The comments entered into the comment box (if enabled):
    + :


    - The answers were as follows:
    +

    :


    "; - echo "Answer Provided: ".htmlspecialchars_decode($mlw_each[1], ENT_QUOTES)."
    "; - echo "Correct Answer: ".htmlspecialchars_decode($mlw_each[2], ENT_QUOTES)."
    "; - echo "Comments Entered:
    ".htmlspecialchars_decode($mlw_each[3], ENT_QUOTES)."
    "; + echo __('Answer Provided: ','quiz-master-next').htmlspecialchars_decode($mlw_each[1], ENT_QUOTES)."
    "; + echo __("Correct Answer: ",'quiz-master-next').htmlspecialchars_decode($mlw_each[2], ENT_QUOTES)."
    "; + echo __("Comments Entered:" ,'quiz-master-next')."
    ".htmlspecialchars_decode($mlw_each[3], ENT_QUOTES)."
    "; echo "

    "; } ?> @@ -224,23 +227,15 @@ function mlw_generate_result_details()
    - + Download Certificate Here
    "; + echo "".__('Download Certificate Here','quiz-master-next')."
    "; } ?>
    - - -
    -

    Help

    -

    This page shows the results from the taken quiz.

    -

    The top section shows the question, the user's answer, and the correct answer.

    -

    The bottom section shows the text from the comment box if enabled.

    -
    @@ -300,15 +295,10 @@ function mlw_generate_result_details()
    -

    Quiz Results(?)

    +

    - Hey! Please go to the Quiz Results page and click on the View link from the result you wish to see.

    -
    -
    From 44f936ad30b82034d3ec9584cc244f2db38dcf4b Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 15:57:01 -0500 Subject: [PATCH 114/184] Added Gettext Functions --- includes/qmn_results.php | 206 +++++++++++++++++---------------------- 1 file changed, 89 insertions(+), 117 deletions(-) diff --git a/includes/qmn_results.php b/includes/qmn_results.php index 5c44f0db8..04e9bd561 100644 --- a/includes/qmn_results.php +++ b/includes/qmn_results.php @@ -1,16 +1,10 @@ query( $mlw_delete_results_update_sql ); if ($mlw_delete_results_results != false) { - $mlwQuizMasterNext->alertManager->newAlert('Your results has been deleted successfully.', 'success'); - + $mlwQuizMasterNext->alertManager->newAlert(__('Your results has been deleted successfully.','quiz-master-next'), 'success'); + //Insert Action Into Audit Trail global $current_user; get_currentuserinfo(); @@ -31,18 +25,18 @@ function mlw_generate_quiz_results() $insert = "INSERT INTO " . $table_name . "(trail_id, action_user, action, time) " . "VALUES (NULL , '" . $current_user->display_name . "' , 'Results Has Been Deleted From: ".$mlw_delete_results_name."' , '" . date("h:i:s A m/d/Y") . "')"; - $results = $wpdb->query( $insert ); + $results = $wpdb->query( $insert ); } else { - $mlwQuizMasterNext->alertManager->newAlert('There has been an error in this action. Please share this with the developer. Error Code: 0021.', 'error'); + $mlwQuizMasterNext->alertManager->newAlert(printf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0021'), 'error'); } } global $wpdb; $mlw_qmn_table_limit = 30; $mlw_qmn_results_count = $wpdb->get_var( "SELECT COUNT(result_id) FROM " . $wpdb->prefix . "mlw_results WHERE deleted='0'" ); - + if( isset($_GET['mlw_result_page'] ) ) { $mlw_qmn_result_page = $_GET['mlw_result_page'] + 1; @@ -83,26 +77,10 @@ function mlw_generate_quiz_results() var $j = jQuery.noConflict(); // increase the default animation speed to exaggerate the effect $j.fx.speeds._default = 1000; - $j(function() { - $j('#dialog').dialog({ - autoOpen: false, - show: 'blind', - hide: 'explode', - buttons: { - Ok: function() { - $j(this).dialog('close'); - } - } - }); - - $j('#opener').click(function() { - $j('#dialog').dialog('open'); - return false; - } ); - }); + $j(function() { $j("button, #prev_page, #next_page").button(); - + }); function deleteResults(id,quizName){ $j("#delete_dialog").dialog({ @@ -131,121 +109,115 @@ function deleteResults(id,quizName){
    -

    Quiz Results(?)

    - + alertManager->showAlerts(); - - $quotes_list = ""; - $display = ""; - $alternate = ""; - foreach($mlw_quiz_data as $mlw_quiz_info) { - if($alternate) $alternate = ""; - else $alternate = " class=\"alternate\""; - $mlw_complete_time = ''; - $mlw_qmn_results_array = @unserialize($mlw_quiz_info->quiz_results); - if (is_array($mlw_qmn_results_array)) - { - $mlw_complete_hours = floor($mlw_qmn_results_array[0] / 3600); - if ($mlw_complete_hours > 0) - { - $mlw_complete_time .= "$mlw_complete_hours hours "; - } - $mlw_complete_minutes = floor(($mlw_qmn_results_array[0] % 3600) / 60); - if ($mlw_complete_minutes > 0) - { - $mlw_complete_time .= "$mlw_complete_minutes minutes "; - } - $mlw_complete_seconds = $mlw_qmn_results_array[0] % 60; - $mlw_complete_time .= "$mlw_complete_seconds seconds"; - } - - $quotes_list .= ""; - $quotes_list .= "
    "; - $quotes_list .= ""; - if ($mlw_quiz_info->quiz_system == 0) - { - $quotes_list .= ""; - } - if ($mlw_quiz_info->quiz_system == 1) - { - $quotes_list .= ""; - } - if ($mlw_quiz_info->quiz_system == 2) - { - $quotes_list .= ""; - } - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - $quotes_list .= ""; - } - + if( $mlw_qmn_result_page > 0 ) { $mlw_qmn_previous_page = $mlw_qmn_result_page - 2; - $display .= "Previous $mlw_qmn_table_limit Quizzes"; + echo "".printf(__('Previous %s Results','quiz-master-next'),$mlw_qmn_table_limit).""; if( $mlw_qmn_result_left > $mlw_qmn_table_limit ) { - $display .= "Next $mlw_qmn_table_limit Quizzes"; + echo "".printf(__('Next %s Results','quiz-master-next'),$mlw_qmn_table_limit).""; } } else if( $mlw_qmn_result_page == 0 ) { if( $mlw_qmn_result_left > $mlw_qmn_table_limit ) { - $display .= "Next $mlw_qmn_table_limit Quizzes"; + echo "".printf(__('Next %s Results','quiz-master-next'),$mlw_qmn_table_limit).""; } } else if( $mlw_qmn_result_left < $mlw_qmn_table_limit ) { $mlw_qmn_previous_page = $mlw_qmn_result_page - 2; - $display .= "Previous $mlw_qmn_table_limit Quizzes"; + echo "".printf(__('Previous %s Results','quiz-master-next'),$mlw_qmn_table_limit).""; } + ?> +
    Time Taken: : time_taken; ?>
    Name Provided: : name; ?>
    Business Provided: : business; ?>
    Email Provided: : email; ?>
    Phone Provided: : phone; ?>
    Score Received:: correct."/".$mlw_results_data->total." or ".$mlw_results_data->correct_score."%"; ?> Score Received:: point_score." Points"; ?> View|result_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='#'>Delete" . $mlw_quiz_info->quiz_name . "" . $mlw_quiz_info->correct ." out of ".$mlw_quiz_info->total." or ".$mlw_quiz_info->correct_score."%" . $mlw_quiz_info->point_score . " PointsNot Graded" . $mlw_complete_time ."" . $mlw_quiz_info->name ."" . $mlw_quiz_info->business ."" . $mlw_quiz_info->email ."" . $mlw_quiz_info->phone ."" . $mlw_quiz_info->time_taken ."
    + + + + + + + + + + + + + + quiz_results); + if (is_array($mlw_qmn_results_array)) + { + $mlw_complete_hours = floor($mlw_qmn_results_array[0] / 3600); + if ($mlw_complete_hours > 0) + { + $mlw_complete_time .= "$mlw_complete_hours hours "; + } + $mlw_complete_minutes = floor(($mlw_qmn_results_array[0] % 3600) / 60); + if ($mlw_complete_minutes > 0) + { + $mlw_complete_time .= "$mlw_complete_minutes minutes "; + } + $mlw_complete_seconds = $mlw_qmn_results_array[0] % 60; + $mlw_complete_time .= "$mlw_complete_seconds seconds"; + } - $display .= "
    "; - $display .= " - - - - - - - - - - "; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + if ($mlw_quiz_info->quiz_system == 0) + { + $quotes_list .= ""; + } + if ($mlw_quiz_info->quiz_system == 1) + { + $quotes_list .= ""; + } + if ($mlw_quiz_info->quiz_system == 2) + { + $quotes_list .= ""; + } + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + } $display .= "{$quotes_list}"; - $display .= "
    ActionsQuiz NameScoreTime To CompleteNameBusinessEmailPhoneTime Taken
    View|result_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='#'>Delete" . $mlw_quiz_info->quiz_name . "" . $mlw_quiz_info->correct ." out of ".$mlw_quiz_info->total." or ".$mlw_quiz_info->correct_score."%" . $mlw_quiz_info->point_score . " Points".__('Not Graded','quiz-master-next')."" . $mlw_complete_time ."" . $mlw_quiz_info->name ."" . $mlw_quiz_info->business ."" . $mlw_quiz_info->email ."" . $mlw_quiz_info->phone ."" . $mlw_quiz_info->time_taken ."
    "; - echo $display; - ?> - + echo $display; + ?> + + -
    From ef3c12f7f3e2312ccdcda0970b37dde2cf9ef39b Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 15:58:31 -0500 Subject: [PATCH 115/184] Added Gettext Functions --- includes/qmn_widgets.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/includes/qmn_widgets.php b/includes/qmn_widgets.php index f73f7f304..79845b997 100644 --- a/includes/qmn_widgets.php +++ b/includes/qmn_widgets.php @@ -4,14 +4,14 @@ */ class Mlw_Qmn_Leaderboard_Widget extends WP_Widget { - + // constructor function Mlw_Qmn_Leaderboard_Widget() { - parent::WP_Widget(false, $name = __('Quiz Master Next Leaderboard Widget', 'mlw_qmn_text_domain')); + parent::WP_Widget(false, $name = __('Quiz Master Next Leaderboard Widget', 'quiz-master-next')); } - + // widget form creation - function form($instance) { + function form($instance) { // Check values if( $instance) { $title = esc_attr($instance['title']); @@ -22,16 +22,16 @@ function form($instance) { } ?>

    - +

    - +

    prefix . "mlw_quizzes" . " WHERE quiz_id=".$mlw_quiz_id." AND deleted='0'"; $mlw_quiz_options = $wpdb->get_results($sql); @@ -76,10 +76,10 @@ function widget($args, $instance) { } $sql .= " LIMIT 10"; $mlw_result_data = $wpdb->get_results($sql); - + $mlw_quiz_leaderboard_display = $mlw_quiz_options->leaderboard_template; $mlw_quiz_leaderboard_display = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_quiz_leaderboard_display); - + $leader_count = 0; foreach($mlw_result_data as $mlw_eaches) { $leader_count++; @@ -116,7 +116,7 @@ function widget($args, $instance) { $mlw_quiz_leaderboard_display = str_replace( "%THIRD_PLACE_SCORE%" , " ", $mlw_quiz_leaderboard_display); $mlw_quiz_leaderboard_display = str_replace( "%FOURTH_PLACE_SCORE%" , " ", $mlw_quiz_leaderboard_display); $mlw_quiz_leaderboard_display = str_replace( "%FIFTH_PLACE_SCORE%" , " ", $mlw_quiz_leaderboard_display); - + echo $mlw_quiz_leaderboard_display; echo '
    '; echo $after_widget; From 4fa40b395e83b965f452f2a6d9fb67ad4d260b0e Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 16:02:51 -0500 Subject: [PATCH 116/184] Added Gettext Functions --- includes/qmn_tools.php | 113 +++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 65 deletions(-) diff --git a/includes/qmn_tools.php b/includes/qmn_tools.php index afe2b49d9..62e43d9ff 100644 --- a/includes/qmn_tools.php +++ b/includes/qmn_tools.php @@ -2,12 +2,12 @@ /* This page creates the main dashboard for the Quiz Master Next plugin */ -/* +/* Copyright 2013, My Local Webstop (email : fpcorso@mylocalwebstop.com) */ function mlw_generate_quiz_tools(){ - add_meta_box("wpss_mrts", 'Audit Trail', "mlw_tools_box", "quiz_wpss"); + add_meta_box("wpss_mrts", 'Audit Trail', "mlw_tools_box", "quiz_wpss"); ?> @@ -29,32 +29,16 @@ function mlw_generate_quiz_tools(){ var $j = jQuery.noConflict(); // increase the default animation speed to exaggerate the effect $j.fx.speeds._default = 1000; - $j(function() { - $j('#dialog').dialog({ - autoOpen: false, - show: 'blind', - hide: 'explode', - buttons: { - Ok: function() { - $j(this).dialog('close'); - } - } - }); - - $j('#opener').click(function() { - $j('#dialog').dialog('open'); - return false; - } ); - }); + $j(function() { $j("button, #prev_page, #next_page").button(); - + });
    -

    Quiz Master Next Tools(?)

    - +

    +
    - +
    - - - +
    get_var( "SELECT COUNT(trail_id) FROM " . $wpdb->prefix . "mlw_qm_audit_trail" ); - + if( isset($_GET{'mlw_audit_page'} ) ) { $mlw_qmn_audit_page = $_GET{'mlw_audit_page'} + 1; @@ -101,53 +79,58 @@ function mlw_tools_box() $mlw_qmn_audit_begin = 0; } $mlw_qmn_audit_left = $mlw_qmn_audit_count - ($mlw_qmn_audit_page * $mlw_qmn_table_limit); - - $audit_trails = $wpdb->get_results( $wpdb->prepare( "SELECT trail_id, action_user, action, time - FROM " . $wpdb->prefix . "mlw_qm_audit_trail + + $audit_trails = $wpdb->get_results( $wpdb->prepare( "SELECT trail_id, action_user, action, time + FROM " . $wpdb->prefix . "mlw_qm_audit_trail ORDER BY trail_id DESC LIMIT %d, %d", $mlw_qmn_audit_begin, $mlw_qmn_table_limit ) ); - $quotes_list = ""; - $display = ""; - $alternate = ""; - foreach($audit_trails as $quote_data) { - if($alternate) $alternate = ""; - else $alternate = " class=\"alternate\""; - $quotes_list .= ""; - $quotes_list .= "" . $quote_data->trail_id . ""; - $quotes_list .= "" . $quote_data->action_user . ""; - $quotes_list .= "" . $quote_data->action .""; - $quotes_list .= "" . $quote_data->time . ""; - $quotes_list .= ""; - } - if( $mlw_qmn_audit_page > 0 ) { - $mlw_qmn_previous_page = $mlw_qmn_audit_page - 2; - $display .= "Previous 25 Audits"; - if( $mlw_qmn_audit_left > $mlw_qmn_table_limit ) - { - $display .= "Next 25 Audits"; - } + $mlw_qmn_previous_page = $mlw_qmn_audit_page - 2; + echo "".printf(__('Previous %s Audits','quiz-master-next'),$mlw_qmn_table_limit).""; + if( $mlw_qmn_audit_left > $mlw_qmn_table_limit ) + { + echo "".printf(__('Next %s Audits','quiz-master-next'),$mlw_qmn_table_limit).""; + } } else if( $mlw_qmn_audit_page == 0 ) { if( $mlw_qmn_audit_left > $mlw_qmn_table_limit ) { - $display .= "Next 25 Audits"; + echo "".printf(__('Next %s Audits','quiz-master-next'),$mlw_qmn_table_limit).""; } } else if( $mlw_qmn_audit_left < $mlw_qmn_table_limit ) { $mlw_qmn_previous_page = $mlw_qmn_audit_page - 2; - $display .= "Previous 25 Audits"; + echo "".printf(__('Previous %s Audits','quiz-master-next'),$mlw_qmn_table_limit).""; + } + ?> + + + + + + + + + + + "; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; + $quotes_list .= ""; } - $display .= "
    ID
    " . $quote_data->trail_id . "" . $quote_data->action_user . "" . $quote_data->action ."" . $quote_data->time . "
    "; - $display .= " - - - - - "; + $display .= "{$quotes_list}"; $display .= "
    IDUserActionTime
    "; ?> From cd7938c3c2f320ef6d5dbf53a863023436c8ef3f Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 16:25:06 -0500 Subject: [PATCH 117/184] Created New POT File For Translations --- languages/quiz-master-next.pot | 1495 ++++++++++++++++++++++++++++++++ 1 file changed, 1495 insertions(+) create mode 100644 languages/quiz-master-next.pot diff --git a/languages/quiz-master-next.pot b/languages/quiz-master-next.pot new file mode 100644 index 000000000..d5e3212e8 --- /dev/null +++ b/languages/quiz-master-next.pot @@ -0,0 +1,1495 @@ +# Quiz Master Next +# Copyright (C) 2015 ... +# This file is distributed under the GNU General Public License v2 or later. +msgid "" +msgstr "" +"Project-Id-Version: Quiz Master Next\n" +"Report-Msgid-Bugs-To: Frank Corso \n" +"POT-Creation-Date: 2015-01-04 16:23-0500\n" +"PO-Revision-Date: \n" +"Last-Translator: Your Name \n" +"Language-Team: My Local Webstop \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html_x:1,2c;esc_html__;" +"esc_attr_e;esc_attr_x:1,2c;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;" +"_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2\n" +"X-Poedit-Basepath: ../\n" +"X-Generator: Poedit 1.7.1\n" +"X-Poedit-SearchPath-0: .\n" + +#: includes/qmn_addons.php:43 +msgid "These addons extend the functionality of Quiz Master Next" +msgstr "" + +#: includes/qmn_addons.php:66 +msgid "Browse All Addons" +msgstr "" + +#: includes/qmn_addons.php:73 +msgid "Available Addons" +msgstr "" + +#: includes/qmn_alerts.php:18 +msgid "Success!" +msgstr "" + +#: includes/qmn_alerts.php:22 includes/qmn_options_questions_tab.php:482 +#: includes/qmn_quiz_options.php:77 includes/qmn_results_details.php:301 +msgid "Error!" +msgstr "" + +#: includes/qmn_credits.php:85 +msgid "Welcome To Quiz Master Next" +msgstr "" + +#: includes/qmn_credits.php:86 +msgid "Thank you for updating!" +msgstr "" + +#: includes/qmn_credits.php:90 +msgid "What's New!" +msgstr "" + +#: includes/qmn_credits.php:92 +msgid "Changelog" +msgstr "" + +#: includes/qmn_credits.php:94 +msgid "Requested Features" +msgstr "" + +#: includes/qmn_dashboard.php:15 +msgid "Quiz Daily Stats - Times Taken" +msgstr "" + +#: includes/qmn_dashboard.php:16 +msgid "Quiz Total Stats" +msgstr "" + +#: includes/qmn_dashboard.php:17 +msgid "Quiz Weekly Stats - Times Taken" +msgstr "" + +#: includes/qmn_dashboard.php:18 +msgid "Quiz Monthly Stats - Times Taken" +msgstr "" + +#: includes/qmn_dashboard.php:23 +msgid "Quizzes Taken Today" +msgstr "" + +#: includes/qmn_dashboard.php:24 +msgid "Quizzes Taken Last 7 Days" +msgstr "" + +#: includes/qmn_dashboard.php:25 +msgid "Quizzes Taken Last 30 Days" +msgstr "" + +#: includes/qmn_dashboard.php:26 +msgid "Quizzes Taken Last 120 Days" +msgstr "" + +#: includes/qmn_dashboard.php:52 +msgid "Quiz Statistics" +msgstr "" + +#: includes/qmn_dashboard.php:222 +msgid "Total Created Quizzes" +msgstr "" + +#: includes/qmn_dashboard.php:226 +msgid "Total Deleted Quizzes" +msgstr "" + +#: includes/qmn_dashboard.php:230 +msgid "Total Active Quizzes" +msgstr "" + +#: includes/qmn_dashboard.php:234 +msgid "Total Created Questions" +msgstr "" + +#: includes/qmn_dashboard.php:238 +msgid "Total Times All Active Quizzes Have Been Viewed" +msgstr "" + +#: includes/qmn_dashboard.php:242 +msgid "Total Times All Active Quizzes Have Been Taken" +msgstr "" + +#: includes/qmn_dashboard.php:246 +msgid "Average Amount Each Active Quiz Has Been Viewed" +msgstr "" + +#: includes/qmn_dashboard.php:250 +msgid "Average Amount Each Active Quiz Has Been Taken" +msgstr "" + +#: includes/qmn_dashboard.php:254 +msgid "Quiz That Has Been Viewed The Most" +msgstr "" + +#: includes/qmn_dashboard.php:258 +msgid "Quiz That Has Been Taken The Most" +msgstr "" + +#: includes/qmn_dashboard_widgets.php:8 +msgid "Quiz Master Next Snapshot" +msgstr "" + +#: includes/qmn_dashboard_widgets.php:127 +msgid "quizzes taken today" +msgstr "" + +#: includes/qmn_dashboard_widgets.php:146 +msgid "quizzes taken last 7 days" +msgstr "" + +#: includes/qmn_dashboard_widgets.php:165 +msgid "total active quizzes" +msgstr "" + +#: includes/qmn_dashboard_widgets.php:171 +msgid "total active questions" +msgstr "" + +#: includes/qmn_dashboard_widgets.php:177 +msgid "most popular quiz" +msgstr "" + +#: includes/qmn_dashboard_widgets.php:183 +msgid "least popular quiz" +msgstr "" + +#: includes/qmn_help.php:12 +msgid "Need Help?" +msgstr "" + +#: includes/qmn_help.php:13 +msgid "Support" +msgstr "" + +#: includes/qmn_help.php:14 +msgid "System Info" +msgstr "" + +#: includes/qmn_help.php:17 +msgid "Help Page" +msgstr "" + +#: includes/qmn_help.php:40 +msgid "Need help with the plugin? Try any of the following:" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:5 +msgid "Certificate (Beta)" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:31 +msgid "The certificate has been updated successfully." +msgstr "" + +#: includes/qmn_options_certificate_tab.php:44 +#: includes/qmn_options_email_tab.php:54 +#: includes/qmn_options_email_tab.php:113 +#: includes/qmn_options_email_tab.php:176 +#: includes/qmn_options_leaderboard_tab.php:37 +#: includes/qmn_options_option_tab.php:55 +#: includes/qmn_options_questions_tab.php:79 +#: includes/qmn_options_questions_tab.php:106 +#: includes/qmn_options_questions_tab.php:188 +#: includes/qmn_options_questions_tab.php:243 +#: includes/qmn_options_results_page_tab.php:53 +#: includes/qmn_options_results_page_tab.php:93 +#: includes/qmn_options_style_tab.php:38 includes/qmn_options_text_tab.php:54 +#: includes/qmn_options_tools_tab.php:35 includes/qmn_quiz_creator.php:343 +#: includes/qmn_quiz_creator.php:396 includes/qmn_quiz_creator.php:438 +#: includes/qmn_quiz_creator.php:584 includes/qmn_quiz_creator.php:647 +#: includes/qmn_results.php:32 +#, php-format +msgid "" +"There has been an error in this action. Please share this with the " +"developer. Error Code: %s" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:60 +msgid "Enter title here" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:60 +#: includes/qmn_options_email_tab.php:72 includes/qmn_options_email_tab.php:90 +msgid "Enter text here" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:69 +msgid "Quiz Certificate (Beta)" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:70 +msgid "" +"Enter in your text here to fill in the certificate for this quiz. Be sure to " +"enter in the link variable into the templates on the Quiz Text tab so the " +"user can access the certificate." +msgstr "" + +#: includes/qmn_options_certificate_tab.php:71 +msgid "These fields cannot contain HTML." +msgstr "" + +#: includes/qmn_options_certificate_tab.php:72 +#: includes/qmn_options_certificate_tab.php:128 +msgid "Save Certificate Options" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:80 +msgid "Enable Certificates For This Quiz?" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:82 +#: includes/qmn_options_email_tab.php:277 +#: includes/qmn_options_email_tab.php:284 +#: includes/qmn_options_option_tab.php:101 +#: includes/qmn_options_option_tab.php:162 +#: includes/qmn_options_option_tab.php:169 +#: includes/qmn_options_option_tab.php:177 +#: includes/qmn_options_option_tab.php:185 +#: includes/qmn_options_option_tab.php:193 +#: includes/qmn_options_option_tab.php:201 +#: includes/qmn_options_option_tab.php:208 +#: includes/qmn_options_option_tab.php:215 +#: includes/qmn_options_questions_tab.php:604 +#: includes/qmn_options_questions_tab.php:733 +#: includes/qmn_options_results_page_tab.php:203 +msgid "Yes" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:83 +#: includes/qmn_options_email_tab.php:278 +#: includes/qmn_options_email_tab.php:285 +#: includes/qmn_options_option_tab.php:102 +#: includes/qmn_options_option_tab.php:149 +#: includes/qmn_options_option_tab.php:163 +#: includes/qmn_options_option_tab.php:171 +#: includes/qmn_options_option_tab.php:179 +#: includes/qmn_options_option_tab.php:187 +#: includes/qmn_options_option_tab.php:195 +#: includes/qmn_options_option_tab.php:202 +#: includes/qmn_options_option_tab.php:209 +#: includes/qmn_options_option_tab.php:216 +#: includes/qmn_options_questions_tab.php:605 +#: includes/qmn_options_questions_tab.php:734 +#: includes/qmn_options_results_page_tab.php:203 +msgid "No" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:88 +msgid "Certificate Title" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:95 +msgid "Message Displayed On Certificate" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:97 +#: includes/qmn_options_leaderboard_tab.php:90 +#: includes/qmn_options_text_tab.php:155 includes/qmn_options_text_tab.php:165 +#: includes/qmn_options_text_tab.php:175 includes/qmn_options_text_tab.php:185 +#: includes/qmn_options_text_tab.php:195 includes/qmn_options_text_tab.php:205 +#: includes/qmn_options_text_tab.php:215 includes/qmn_options_text_tab.php:225 +#: includes/qmn_options_text_tab.php:238 includes/qmn_options_text_tab.php:255 +msgid "Allowed Variables:" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:115 +msgid "URL To Logo (Must be JPG, JPEG, PNG or GIF)" +msgstr "" + +#: includes/qmn_options_certificate_tab.php:122 +msgid "URL To Background Img (Must be JPG, JPEG, PNG or GIF)" +msgstr "" + +#: includes/qmn_options_email_tab.php:5 +msgid "Emails" +msgstr "" + +#: includes/qmn_options_email_tab.php:41 +#: includes/qmn_options_email_tab.php:100 +msgid "The email has been added successfully." +msgstr "" + +#: includes/qmn_options_email_tab.php:163 +msgid "The email has been updated successfully." +msgstr "" + +#: includes/qmn_options_email_tab.php:225 +#: includes/qmn_options_leaderboard_tab.php:48 +#: includes/qmn_options_text_tab.php:90 +msgid "Template Variables" +msgstr "" + +#: includes/qmn_options_email_tab.php:228 +#: includes/qmn_options_results_page_tab.php:124 +msgid "Score for the quiz when using points" +msgstr "" + +#: includes/qmn_options_email_tab.php:229 +#: includes/qmn_options_results_page_tab.php:125 +#: includes/qmn_options_text_tab.php:94 +msgid "The average amount of points user had per question" +msgstr "" + +#: includes/qmn_options_email_tab.php:233 +#: includes/qmn_options_results_page_tab.php:129 +#: includes/qmn_options_text_tab.php:98 +msgid "The number of correct answers the user had" +msgstr "" + +#: includes/qmn_options_email_tab.php:234 +#: includes/qmn_options_results_page_tab.php:130 +#: includes/qmn_options_text_tab.php:99 +msgid "The total number of questions in the quiz" +msgstr "" + +#: includes/qmn_options_email_tab.php:238 +#: includes/qmn_options_results_page_tab.php:134 +msgid "Score for the quiz when using correct answers" +msgstr "" + +#: includes/qmn_options_email_tab.php:242 +#: includes/qmn_options_results_page_tab.php:138 +#: includes/qmn_options_text_tab.php:107 +msgid "The name the user entered before the quiz" +msgstr "" + +#: includes/qmn_options_email_tab.php:243 +#: includes/qmn_options_results_page_tab.php:139 +#: includes/qmn_options_text_tab.php:108 +msgid "The business the user entered before the quiz" +msgstr "" + +#: includes/qmn_options_email_tab.php:247 +#: includes/qmn_options_results_page_tab.php:143 +#: includes/qmn_options_text_tab.php:112 +msgid "The phone number the user entered before the quiz" +msgstr "" + +#: includes/qmn_options_email_tab.php:248 +#: includes/qmn_options_results_page_tab.php:144 +#: includes/qmn_options_text_tab.php:113 +msgid "The email the user entered before the quiz" +msgstr "" + +#: includes/qmn_options_email_tab.php:252 +#: includes/qmn_options_leaderboard_tab.php:76 +#: includes/qmn_options_results_page_tab.php:148 +#: includes/qmn_options_text_tab.php:117 +msgid "The name of the quiz" +msgstr "" + +#: includes/qmn_options_email_tab.php:253 +#: includes/qmn_options_results_page_tab.php:149 +#: includes/qmn_options_text_tab.php:118 +msgid "" +"Shows the question, the answer the user provided, and the correct answer" +msgstr "" + +#: includes/qmn_options_email_tab.php:257 +#: includes/qmn_options_results_page_tab.php:153 +#: includes/qmn_options_text_tab.php:122 +msgid "The comments the user entered into comment box if enabled" +msgstr "" + +#: includes/qmn_options_email_tab.php:258 +#: includes/qmn_options_results_page_tab.php:154 +#: includes/qmn_options_text_tab.php:136 +msgid "The amount of time user spent of quiz" +msgstr "" + +#: includes/qmn_options_email_tab.php:271 +#: includes/qmn_options_email_tab.php:466 +msgid "Save Email Templates And Settings" +msgstr "" + +#: includes/qmn_options_email_tab.php:275 +msgid "Send user email upon completion?" +msgstr "" + +#: includes/qmn_options_email_tab.php:282 +msgid "Send admin email upon completion?" +msgstr "" + +#: includes/qmn_options_email_tab.php:289 +msgid "" +"What emails should we send the admin email to? Separate emails with a comma." +msgstr "" + +#: includes/qmn_options_email_tab.php:295 +msgid "Email Sent To User" +msgstr "" + +#: includes/qmn_options_email_tab.php:296 +#: includes/qmn_options_email_tab.php:374 +msgid "Add New User Email" +msgstr "" + +#: includes/qmn_options_email_tab.php:301 +#: includes/qmn_options_email_tab.php:367 +#: includes/qmn_options_email_tab.php:388 +#: includes/qmn_options_email_tab.php:454 +#: includes/qmn_options_results_page_tab.php:167 +#: includes/qmn_options_results_page_tab.php:222 +msgid "Score Greater Than Or Equal To" +msgstr "" + +#: includes/qmn_options_email_tab.php:302 +#: includes/qmn_options_email_tab.php:368 +#: includes/qmn_options_email_tab.php:389 +#: includes/qmn_options_email_tab.php:455 +#: includes/qmn_options_results_page_tab.php:168 +#: includes/qmn_options_results_page_tab.php:223 +msgid "Score Less Than Or Equal To" +msgstr "" + +#: includes/qmn_options_email_tab.php:303 +#: includes/qmn_options_email_tab.php:369 +#: includes/qmn_options_email_tab.php:390 +#: includes/qmn_options_email_tab.php:456 +msgid "Subject" +msgstr "" + +#: includes/qmn_options_email_tab.php:304 +#: includes/qmn_options_email_tab.php:370 +#: includes/qmn_options_email_tab.php:391 +#: includes/qmn_options_email_tab.php:457 +msgid "Email To Send" +msgstr "" + +#: includes/qmn_options_email_tab.php:382 +msgid "Email Sent To Admin" +msgstr "" + +#: includes/qmn_options_email_tab.php:383 +#: includes/qmn_options_email_tab.php:461 +msgid "Add New Admin Email" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:5 +msgid "Leaderboard" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:24 +msgid "The leaderboards has been updated successfully." +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:51 +msgid "The name of the user who is in first place" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:52 +msgid "The score from the first place's quiz" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:56 +msgid "The name of the user who is in second place" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:57 +msgid "The score from the second place's quiz" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:61 +msgid "The name of the user who is in third place" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:62 +msgid "The score from the third place's quiz" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:66 +msgid "The name of the user who is in fourth place" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:67 +msgid "The score from the fourth place's quiz" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:71 +msgid "The name of the user who is in fifth place" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:72 +msgid "The score from the fifth place's quiz" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:79 +#: includes/qmn_options_leaderboard_tab.php:107 +msgid "Save Leaderboard Options" +msgstr "" + +#: includes/qmn_options_leaderboard_tab.php:88 +msgid "Leaderboard Template" +msgstr "" + +#: includes/qmn_options_option_tab.php:5 +msgid "Options" +msgstr "" + +#: includes/qmn_options_option_tab.php:42 +msgid "The options has been updated successfully." +msgstr "" + +#: includes/qmn_options_option_tab.php:83 +#: includes/qmn_options_option_tab.php:220 +msgid "Save Options" +msgstr "" + +#: includes/qmn_options_option_tab.php:91 +msgid "Which system is this quiz graded on?" +msgstr "" + +#: includes/qmn_options_option_tab.php:93 +msgid "Correct/Incorrect" +msgstr "" + +#: includes/qmn_options_option_tab.php:94 +msgid "Points" +msgstr "" + +#: includes/qmn_options_option_tab.php:95 includes/qmn_results.php:196 +msgid "Not Graded" +msgstr "" + +#: includes/qmn_options_option_tab.php:99 +msgid "Should the user be required to be logged in to take this quiz?" +msgstr "" + +#: includes/qmn_options_option_tab.php:106 +msgid "" +"How many questions per page would you like? (Leave 0 for all questions on " +"one page)" +msgstr "" + +#: includes/qmn_options_option_tab.php:112 +msgid "" +"How many minutes does the user have to finish the quiz? (Leave 0 for no time " +"limit)" +msgstr "" + +#: includes/qmn_options_option_tab.php:118 +msgid "" +"How many times can a user take this quiz? (Leave 0 for as many times as the " +"user wants to. Currently only works for registered users)" +msgstr "" + +#: includes/qmn_options_option_tab.php:124 +msgid "" +"How many total entries can this quiz have? (Leave 0 for unlimited entries" +msgstr "" + +#: includes/qmn_options_option_tab.php:130 +msgid "" +"How many questions should be loaded for quiz? (Leave 0 to load all questions)" +msgstr "" + +#: includes/qmn_options_option_tab.php:136 +msgid "" +"What time-frame should the user be able to access the quiz? (Leave blank if " +"the user can access anytime)" +msgstr "" + +#: includes/qmn_options_option_tab.php:138 +msgid "start date" +msgstr "" + +#: includes/qmn_options_option_tab.php:141 +msgid "end date" +msgstr "" + +#: includes/qmn_options_option_tab.php:145 +msgid "" +"Are the questions random? (Question Order will not apply if this is yes)" +msgstr "" + +#: includes/qmn_options_option_tab.php:147 +msgid "Random Questions" +msgstr "" + +#: includes/qmn_options_option_tab.php:148 +msgid "Random Questions And Answers" +msgstr "" + +#: includes/qmn_options_option_tab.php:153 +msgid "" +"Would you like to ask for the contact information at the beginning or at the " +"end of the quiz?" +msgstr "" + +#: includes/qmn_options_option_tab.php:155 +msgid "Beginning" +msgstr "" + +#: includes/qmn_options_option_tab.php:156 +msgid "End" +msgstr "" + +#: includes/qmn_options_option_tab.php:160 +msgid "" +"If a logged-in user takes the quiz, would you like them to be able to edit " +"contact information? If set to no, the fields will not show up for logged in " +"users; however, the users information will be saved for the fields." +msgstr "" + +#: includes/qmn_options_option_tab.php:167 +msgid "Should we ask for users name?" +msgstr "" + +#: includes/qmn_options_option_tab.php:170 +#: includes/qmn_options_option_tab.php:178 +#: includes/qmn_options_option_tab.php:186 +#: includes/qmn_options_option_tab.php:194 +msgid "Require" +msgstr "" + +#: includes/qmn_options_option_tab.php:175 +msgid "Should we ask for users business?" +msgstr "" + +#: includes/qmn_options_option_tab.php:183 +msgid "Should we ask for users email?" +msgstr "" + +#: includes/qmn_options_option_tab.php:191 +msgid "Should we ask for users phone number?" +msgstr "" + +#: includes/qmn_options_option_tab.php:199 +msgid "Would you like a place for the user to enter comments?" +msgstr "" + +#: includes/qmn_options_option_tab.php:206 +msgid "Show question number on quiz?" +msgstr "" + +#: includes/qmn_options_option_tab.php:213 +msgid "Show social media sharing buttons? (Twitter & Facebook)" +msgstr "" + +#: includes/qmn_options_preview_tab.php:5 +msgid "Preview" +msgstr "" + +#: includes/qmn_options_questions_tab.php:5 +msgid "Questions" +msgstr "" + +#: includes/qmn_options_questions_tab.php:66 +msgid "The question has been updated successfully." +msgstr "" + +#: includes/qmn_options_questions_tab.php:93 +msgid "The question has been deleted successfully." +msgstr "" + +#: includes/qmn_options_questions_tab.php:175 +msgid "The question has been duplicated successfully." +msgstr "" + +#: includes/qmn_options_questions_tab.php:230 +msgid "The question has been created successfully." +msgstr "" + +#: includes/qmn_options_questions_tab.php:370 +#: includes/qmn_options_questions_tab.php:377 +#: includes/qmn_options_questions_tab.php:526 +#: includes/qmn_options_questions_tab.php:658 +msgid "Answer" +msgstr "" + +#: includes/qmn_options_questions_tab.php:397 +#: includes/qmn_options_questions_tab.php:628 +msgid "Add Question" +msgstr "" + +#: includes/qmn_options_questions_tab.php:425 +#: includes/qmn_options_questions_tab.php:593 +#: includes/qmn_options_questions_tab.php:622 +#: includes/qmn_options_questions_tab.php:722 +msgid "Question Order" +msgstr "" + +#: includes/qmn_options_questions_tab.php:426 +#: includes/qmn_options_questions_tab.php:567 +#: includes/qmn_options_questions_tab.php:623 +#: includes/qmn_options_questions_tab.php:696 +msgid "Question Type" +msgstr "" + +#: includes/qmn_options_questions_tab.php:427 +#: includes/qmn_options_questions_tab.php:504 +#: includes/qmn_options_questions_tab.php:624 +#: includes/qmn_options_questions_tab.php:638 +msgid "Question" +msgstr "" + +#: includes/qmn_options_questions_tab.php:449 +msgid "Multiple Choice" +msgstr "" + +#: includes/qmn_options_questions_tab.php:452 +msgid "Horizontal Multiple Choice" +msgstr "" + +#: includes/qmn_options_questions_tab.php:455 +msgid "Drop Down" +msgstr "" + +#: includes/qmn_options_questions_tab.php:458 +msgid "Small Open Answer" +msgstr "" + +#: includes/qmn_options_questions_tab.php:461 +msgid "Multiple Response" +msgstr "" + +#: includes/qmn_options_questions_tab.php:464 +msgid "Large Open Answer" +msgstr "" + +#: includes/qmn_options_questions_tab.php:467 +#: includes/qmn_options_questions_tab.php:577 +#: includes/qmn_options_questions_tab.php:706 +msgid "Text Block" +msgstr "" + +#: includes/qmn_options_questions_tab.php:470 +#: includes/qmn_options_questions_tab.php:578 +#: includes/qmn_options_questions_tab.php:707 +msgid "Number" +msgstr "" + +#: includes/qmn_options_questions_tab.php:473 +#: includes/qmn_options_questions_tab.php:579 +#: includes/qmn_options_questions_tab.php:708 +msgid "Accept" +msgstr "" + +#: includes/qmn_options_questions_tab.php:476 +#: includes/qmn_options_questions_tab.php:580 +#: includes/qmn_options_questions_tab.php:709 +msgid "Captcha" +msgstr "" + +#: includes/qmn_options_questions_tab.php:479 +msgid "Horizontal Multiple Response" +msgstr "" + +#: includes/qmn_options_questions_tab.php:489 includes/qmn_quiz_admin.php:242 +msgid "Edit" +msgstr "" + +#: includes/qmn_options_questions_tab.php:489 includes/qmn_quiz_admin.php:244 +#: includes/qmn_quiz_admin.php:328 +msgid "Duplicate" +msgstr "" + +#: includes/qmn_options_questions_tab.php:489 +#: includes/qmn_options_results_page_tab.php:203 +#: includes/qmn_quiz_admin.php:245 +msgid "Delete" +msgstr "" + +#: includes/qmn_options_questions_tab.php:515 +#: includes/qmn_options_questions_tab.php:649 +msgid "Answers" +msgstr "" + +#: includes/qmn_options_questions_tab.php:516 +#: includes/qmn_options_questions_tab.php:650 +msgid "Points Worth" +msgstr "" + +#: includes/qmn_options_questions_tab.php:517 +#: includes/qmn_options_questions_tab.php:651 +msgid "Correct Answer" +msgstr "" + +#: includes/qmn_options_questions_tab.php:544 +#: includes/qmn_options_questions_tab.php:673 +msgid "Add New Answer!" +msgstr "" + +#: includes/qmn_options_questions_tab.php:549 +#: includes/qmn_options_questions_tab.php:678 +msgid "Correct Answer Info" +msgstr "" + +#: includes/qmn_options_questions_tab.php:556 +#: includes/qmn_options_questions_tab.php:685 includes/qmn_quiz.php:511 +msgid "Hint" +msgstr "" + +#: includes/qmn_options_questions_tab.php:570 +#: includes/qmn_options_questions_tab.php:699 +msgid "Normal Multiple Choice (Vertical Radio)" +msgstr "" + +#: includes/qmn_options_questions_tab.php:571 +#: includes/qmn_options_questions_tab.php:700 +msgid "Horizontal Multiple Choice (Horizontal Radio)" +msgstr "" + +#: includes/qmn_options_questions_tab.php:572 +#: includes/qmn_options_questions_tab.php:701 +msgid "Drop Down (Select)" +msgstr "" + +#: includes/qmn_options_questions_tab.php:573 +#: includes/qmn_options_questions_tab.php:702 +msgid "Open Answer (Text Input)" +msgstr "" + +#: includes/qmn_options_questions_tab.php:574 +#: includes/qmn_options_questions_tab.php:703 +msgid "Open Answer (Large Text Input)" +msgstr "" + +#: includes/qmn_options_questions_tab.php:575 +#: includes/qmn_options_questions_tab.php:704 +msgid "Multiple Response (Checkbox)" +msgstr "" + +#: includes/qmn_options_questions_tab.php:576 +#: includes/qmn_options_questions_tab.php:705 +msgid "Horizontal Multiple Response (Checkbox)" +msgstr "" + +#: includes/qmn_options_questions_tab.php:585 +#: includes/qmn_options_questions_tab.php:714 +msgid "Comment Field" +msgstr "" + +#: includes/qmn_options_questions_tab.php:587 +#: includes/qmn_options_questions_tab.php:716 +msgid "Small Text Field" +msgstr "" + +#: includes/qmn_options_questions_tab.php:588 +#: includes/qmn_options_questions_tab.php:717 +msgid "Large Text Field" +msgstr "" + +#: includes/qmn_options_questions_tab.php:589 +#: includes/qmn_options_questions_tab.php:718 +msgid "None" +msgstr "" + +#: includes/qmn_options_questions_tab.php:601 +#: includes/qmn_options_questions_tab.php:730 +msgid "Required?" +msgstr "" + +#: includes/qmn_options_questions_tab.php:610 +#: includes/qmn_options_questions_tab.php:739 +msgid "" +"Required currently only works on open answer, number, accept, and captcha " +"question types" +msgstr "" + +#: includes/qmn_options_questions_tab.php:612 +msgid "Edit Question" +msgstr "" + +#: includes/qmn_options_questions_tab.php:741 +msgid "Create Question" +msgstr "" + +#: includes/qmn_options_questions_tab.php:746 +msgid "Are you sure you want to delete question?" +msgstr "" + +#: includes/qmn_options_questions_tab.php:751 +msgid "Delete Question" +msgstr "" + +#: includes/qmn_options_questions_tab.php:756 +msgid "Are you sure you want to duplicate this question?" +msgstr "" + +#: includes/qmn_options_questions_tab.php:761 +msgid "Duplicate Question" +msgstr "" + +#: includes/qmn_options_results_page_tab.php:5 +msgid "Results Pages" +msgstr "" + +#: includes/qmn_options_results_page_tab.php:40 +msgid "The results page has been added successfully." +msgstr "" + +#: includes/qmn_options_results_page_tab.php:80 +msgid "The results page has been saved successfully." +msgstr "" + +#: includes/qmn_options_results_page_tab.php:157 +#: includes/qmn_options_text_tab.php:137 +msgid "The link to the certificate after completing the quiz" +msgstr "" + +#: includes/qmn_options_results_page_tab.php:160 +#: includes/qmn_options_results_page_tab.php:231 +msgid "Save Results Pages" +msgstr "" + +#: includes/qmn_options_results_page_tab.php:161 +#: includes/qmn_options_results_page_tab.php:236 +msgid "Add New Results Page" +msgstr "" + +#: includes/qmn_options_results_page_tab.php:169 +#: includes/qmn_options_results_page_tab.php:224 +msgid "Results Page Shown" +msgstr "" + +#: includes/qmn_options_results_page_tab.php:203 +msgid "Are you sure?" +msgstr "" + +#: includes/qmn_options_style_tab.php:5 +msgid "Style" +msgstr "" + +#: includes/qmn_options_style_tab.php:25 +msgid "The style has been saved successfully." +msgstr "" + +#: includes/qmn_options_style_tab.php:64 +msgid "Quiz Styles" +msgstr "" + +#: includes/qmn_options_style_tab.php:65 +msgid "Choose your style:" +msgstr "" + +#: includes/qmn_options_style_tab.php:87 +msgid "Custom" +msgstr "" + +#: includes/qmn_options_style_tab.php:93 +#: includes/qmn_options_style_tab.php:149 +msgid "Save Quiz Style" +msgstr "" + +#: includes/qmn_options_style_tab.php:95 +msgid "Custom Theme CSS" +msgstr "" + +#: includes/qmn_options_style_tab.php:96 +msgid "" +"For detailed help and guidance along with a list of different classes used " +"in this plugin, please visit the following link:" +msgstr "" + +#: includes/qmn_options_style_tab.php:104 +msgid "Default:" +msgstr "" + +#: includes/qmn_options_text_tab.php:5 +msgid "Text" +msgstr "" + +#: includes/qmn_options_text_tab.php:41 +msgid "The templates has been updated successfully." +msgstr "" + +#: includes/qmn_options_text_tab.php:72 includes/qmn_quiz.php:1267 +msgid "Previous" +msgstr "" + +#: includes/qmn_options_text_tab.php:93 +msgid "Total points user earned when taking quiz" +msgstr "" + +#: includes/qmn_options_text_tab.php:103 +msgid "" +"The percent score for the quiz showing percent of total quetions answered " +"correctly" +msgstr "" + +#: includes/qmn_options_text_tab.php:123 +msgid "The question that the user answered" +msgstr "" + +#: includes/qmn_options_text_tab.php:127 +msgid "The answer the user gave for the question" +msgstr "" + +#: includes/qmn_options_text_tab.php:128 +msgid "The correct answer for the question" +msgstr "" + +#: includes/qmn_options_text_tab.php:132 +msgid "The comments the user provided in the comment field for the question" +msgstr "" + +#: includes/qmn_options_text_tab.php:133 +msgid "Reason why the correct answer is the correct answer" +msgstr "" + +#: includes/qmn_options_text_tab.php:140 +msgid "The Current Date" +msgstr "" + +#: includes/qmn_options_text_tab.php:143 includes/qmn_options_text_tab.php:307 +msgid "Save Templates" +msgstr "" + +#: includes/qmn_options_text_tab.php:149 +msgid "Message Templates" +msgstr "" + +#: includes/qmn_options_text_tab.php:153 +msgid "Message Displayed Before Quiz" +msgstr "" + +#: includes/qmn_options_text_tab.php:163 +msgid "Message Displayed Before Comments Box If Enabled" +msgstr "" + +#: includes/qmn_options_text_tab.php:173 +msgid "Message Displayed At End Of Quiz (Leave Blank To Omit Text Section)" +msgstr "" + +#: includes/qmn_options_text_tab.php:183 +msgid "Message Displayed If User Has Tried Quiz Too Many Times" +msgstr "" + +#: includes/qmn_options_text_tab.php:193 +msgid "" +"Message Displayed If User Is Not Logged In And Quiz Requires Users To Be " +"Logged In" +msgstr "" + +#: includes/qmn_options_text_tab.php:203 +msgid "Message Displayed If Date Is Outside Scheduled Timeframe" +msgstr "" + +#: includes/qmn_options_text_tab.php:213 +msgid "Message Displayed If The Limit Of Total Entries Has Been Reached" +msgstr "" + +#: includes/qmn_options_text_tab.php:223 +msgid "%QUESTIONS_ANSWERS% Text" +msgstr "" + +#: includes/qmn_options_text_tab.php:236 +msgid "Twitter Sharing Text" +msgstr "" + +#: includes/qmn_options_text_tab.php:253 +msgid "Facebook Sharing Text" +msgstr "" + +#: includes/qmn_options_text_tab.php:268 +msgid "Other Templates" +msgstr "" + +#: includes/qmn_options_text_tab.php:271 +msgid "Text for submit button" +msgstr "" + +#: includes/qmn_options_text_tab.php:275 +msgid "Text for name field" +msgstr "" + +#: includes/qmn_options_text_tab.php:279 +msgid "Text for business field" +msgstr "" + +#: includes/qmn_options_text_tab.php:283 +msgid "Text for email field" +msgstr "" + +#: includes/qmn_options_text_tab.php:287 +msgid "Text for phone number field" +msgstr "" + +#: includes/qmn_options_text_tab.php:291 +msgid "Text for comments field" +msgstr "" + +#: includes/qmn_options_text_tab.php:295 +msgid "Text for previous button" +msgstr "" + +#: includes/qmn_options_text_tab.php:299 +msgid "Text for next button" +msgstr "" + +#: includes/qmn_options_text_tab.php:303 +msgid "What is the From Name for the email sent to users and admin?" +msgstr "" + +#: includes/qmn_options_tools_tab.php:5 includes/qmn_tools.php:51 +#: mlw_quizmaster2.php:151 +msgid "Tools" +msgstr "" + +#: includes/qmn_options_tools_tab.php:22 +msgid "The stats has been reset successfully." +msgstr "" + +#: includes/qmn_options_tools_tab.php:66 +msgid "" +"Use this button to reset all the stats collected for this quiz (Quiz Views " +"and Times Quiz Has Been Taken)." +msgstr "" + +#: includes/qmn_options_tools_tab.php:67 +msgid "Reset Quiz Views And Taken Stats" +msgstr "" + +#: includes/qmn_options_tools_tab.php:70 +msgid "" +"Are you sure you want to reset the stats to 0? All views and taken stats for " +"this quiz will be reset. This is permanent and cannot be undone." +msgstr "" + +#: includes/qmn_options_tools_tab.php:74 +msgid "Reset All Stats For Quiz" +msgstr "" + +#: includes/qmn_quiz.php:124 +msgid "Not a valid e-mail address!" +msgstr "" + +#: includes/qmn_quiz.php:125 +msgid "This field must be a number!" +msgstr "" + +#: includes/qmn_quiz.php:126 +msgid "The entered text is not correct!" +msgstr "" + +#: includes/qmn_quiz.php:127 +msgid "Please complete all required fields!" +msgstr "" + +#: includes/qmn_quiz.php:1216 +msgid "It appears that this quiz is not set up correctly." +msgstr "" + +#: includes/qmn_quiz_admin.php:172 mlw_quizmaster2.php:146 +msgid "Quizzes" +msgstr "" + +#: includes/qmn_quiz_admin.php:172 +msgid "Add New" +msgstr "" + +#: includes/qmn_quiz_admin.php:177 +#, php-format +msgid "One quiz" +msgid_plural "%s quizzes" +msgstr[0] "" +msgstr[1] "" + +#: includes/qmn_quiz_admin.php:222 includes/qmn_quiz_admin.php:259 +#: includes/qmn_quiz_admin.php:295 includes/qmn_results.php:148 +msgid "Quiz Name" +msgstr "" + +#: includes/qmn_quiz_admin.php:223 includes/qmn_quiz_admin.php:260 +msgid "Quiz Shortcode" +msgstr "" + +#: includes/qmn_quiz_admin.php:224 includes/qmn_quiz_admin.php:261 +msgid "Leaderboard Shortcode" +msgstr "" + +#: includes/qmn_quiz_admin.php:225 includes/qmn_quiz_admin.php:262 +msgid "Quiz Views" +msgstr "" + +#: includes/qmn_quiz_admin.php:226 includes/qmn_quiz_admin.php:263 +msgid "Quiz Taken" +msgstr "" + +#: includes/qmn_quiz_admin.php:227 includes/qmn_quiz_admin.php:264 +msgid "Last Modified" +msgstr "" + +#: includes/qmn_quiz_admin.php:240 +msgid "Edit Name" +msgstr "" + +#: includes/qmn_quiz_admin.php:243 +msgid "Results" +msgstr "" + +#: includes/qmn_quiz_admin.php:290 +msgid "Create New Quiz" +msgstr "" + +#: includes/qmn_quiz_admin.php:304 +msgid "Create Quiz" +msgstr "" + +#: includes/qmn_quiz_admin.php:310 +msgid "Quiz Name:" +msgstr "" + +#: includes/qmn_quiz_admin.php:321 +msgid "Duplicate this quiz?" +msgstr "" + +#: includes/qmn_quiz_admin.php:323 +msgid "Duplicate questions with quiz" +msgstr "" + +#: includes/qmn_quiz_admin.php:325 +msgid "Name Of New Quiz:" +msgstr "" + +#: includes/qmn_quiz_admin.php:334 +msgid "Are you sure you want to delete quiz?" +msgstr "" + +#: includes/qmn_quiz_admin.php:339 +msgid "Delete Quiz" +msgstr "" + +#: includes/qmn_quiz_creator.php:331 +msgid "" +"Your new quiz has been created successfully. To begin editing your quiz, " +"click the Edit link on the new quiz." +msgstr "" + +#: includes/qmn_quiz_creator.php:383 +msgid "Your quiz has been deleted successfully." +msgstr "" + +#: includes/qmn_quiz_creator.php:425 +msgid "Your quiz name has been updated successfully." +msgstr "" + +#: includes/qmn_quiz_creator.php:571 +msgid "Your quiz has been duplicated successfully." +msgstr "" + +#. translators: The %s corresponds to the name of the quiz +#: includes/qmn_quiz_options.php:56 +#, php-format +msgid "Quiz Settings For %s" +msgstr "" + +#: includes/qmn_quiz_options.php:77 +msgid "" +"Please go to the quizzes page and click on the Edit link from the quiz you " +"wish to edit." +msgstr "" + +#: includes/qmn_results.php:19 +msgid "Your results has been deleted successfully." +msgstr "" + +#: includes/qmn_results.php:118 includes/qmn_results_details.php:127 +#: includes/qmn_results_details.php:130 includes/qmn_results_details.php:134 +#: includes/qmn_results_details.php:298 mlw_quizmaster2.php:148 +msgid "Quiz Results" +msgstr "" + +#: includes/qmn_results.php:125 includes/qmn_results.php:141 +#, php-format +msgid "Previous %s Results" +msgstr "" + +#: includes/qmn_results.php:128 includes/qmn_results.php:135 +#, php-format +msgid "Next %s Results" +msgstr "" + +#: includes/qmn_results.php:147 +msgid "Actions" +msgstr "" + +#: includes/qmn_results.php:149 +msgid "Score" +msgstr "" + +#: includes/qmn_results.php:150 +msgid "Time To Complete" +msgstr "" + +#: includes/qmn_results.php:151 +msgid "Name" +msgstr "" + +#: includes/qmn_results.php:152 +msgid "Business" +msgstr "" + +#: includes/qmn_results.php:153 +msgid "Email" +msgstr "" + +#: includes/qmn_results.php:154 +msgid "Phone" +msgstr "" + +#: includes/qmn_results.php:155 includes/qmn_results_details.php:137 +msgid "Time Taken" +msgstr "" + +#: includes/qmn_results.php:214 +msgid "Are you sure you want to delete these results?" +msgstr "" + +#: includes/qmn_results.php:219 +msgid "Delete Results" +msgstr "" + +#: includes/qmn_results_details.php:131 +msgid "Quiz Tools" +msgstr "" + +#: includes/qmn_results_details.php:141 +msgid "Name Provided" +msgstr "" + +#: includes/qmn_results_details.php:145 +msgid "Business Provided" +msgstr "" + +#: includes/qmn_results_details.php:149 +msgid "Email Provided" +msgstr "" + +#: includes/qmn_results_details.php:153 +msgid "Phone Provided" +msgstr "" + +#: includes/qmn_results_details.php:164 includes/qmn_results_details.php:171 +msgid "Score Received" +msgstr "" + +#: includes/qmn_results_details.php:180 +msgid "Answers Provided" +msgstr "" + +#: includes/qmn_results_details.php:192 +msgid "hours" +msgstr "" + +#: includes/qmn_results_details.php:197 +msgid "minutes" +msgstr "" + +#: includes/qmn_results_details.php:200 +msgid "seconds" +msgstr "" + +#. translators: The %s will be replaces with the amount of time the user took on quiz. For example: 5 minutes 34 seconds +#: includes/qmn_results_details.php:204 +#, php-format +msgid "The user took %s to complete this quiz." +msgstr "" + +#: includes/qmn_results_details.php:207 +msgid "The comments entered into the comment box (if enabled)" +msgstr "" + +#: includes/qmn_results_details.php:210 +msgid "The answers were as follows" +msgstr "" + +#: includes/qmn_results_details.php:217 +msgid "Answer Provided: " +msgstr "" + +#: includes/qmn_results_details.php:218 +msgid "Correct Answer: " +msgstr "" + +#: includes/qmn_results_details.php:219 +msgid "Comments Entered:" +msgstr "" + +#: includes/qmn_results_details.php:230 +msgid "Create Certificate" +msgstr "" + +#: includes/qmn_results_details.php:235 +msgid "Download Certificate Here" +msgstr "" + +#: includes/qmn_results_details.php:301 +msgid "" +"Please go to the Quiz Results page and click on the View link from the " +"result you wish to see." +msgstr "" + +#: includes/qmn_tools.php:90 includes/qmn_tools.php:106 +#, php-format +msgid "Previous %s Audits" +msgstr "" + +#: includes/qmn_tools.php:93 includes/qmn_tools.php:100 +#, php-format +msgid "Next %s Audits" +msgstr "" + +#: includes/qmn_tools.php:113 +msgid "User" +msgstr "" + +#: includes/qmn_tools.php:114 +msgid "Action" +msgstr "" + +#: includes/qmn_tools.php:115 +msgid "Time" +msgstr "" + +#: includes/qmn_widgets.php:10 +msgid "Quiz Master Next Leaderboard Widget" +msgstr "" + +#: includes/qmn_widgets.php:25 +msgid "Widget Title" +msgstr "" + +#: includes/qmn_widgets.php:29 +msgid "Quiz ID" +msgstr "" + +#: mlw_quizmaster2.php:147 +msgid "Quiz Settings" +msgstr "" + +#: mlw_quizmaster2.php:149 +msgid "Quiz Result Details" +msgstr "" + +#: mlw_quizmaster2.php:150 +msgid "Stats" +msgstr "" + +#: mlw_quizmaster2.php:152 +msgid "Help" +msgstr "" + +#: mlw_quizmaster2.php:153 +msgid "Addon Settings" +msgstr "" + +#: mlw_quizmaster2.php:154 +msgid "About" +msgstr "" From 4de48e949729d3418bb82801b3ba7ef4c52f196c Mon Sep 17 00:00:00 2001 From: Frank Corso Date: Sun, 4 Jan 2015 16:46:36 -0500 Subject: [PATCH 118/184] Fixed Gettext Bugs --- includes/qmn_quiz_admin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/qmn_quiz_admin.php b/includes/qmn_quiz_admin.php index 1e1b40b04..074408c87 100644 --- a/includes/qmn_quiz_admin.php +++ b/includes/qmn_quiz_admin.php @@ -174,7 +174,7 @@ function duplicateQuiz(id, quizName){
    - + "; $quotes_list .= "" . $mlw_quiz_info->quiz_id . ""; - $quotes_list .= "" . esc_html($mlw_quiz_info->quiz_name) ." quiz_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='javascript:();'>(".__('Edit Name', 'quiz-master-next').""; + $quotes_list .= "" . esc_html($mlw_quiz_info->quiz_name) ." quiz_id."','".esc_js($mlw_quiz_info->quiz_name)."')\" href='javascript:();'>(".__('Edit Name', 'quiz-master-next').")"; $quotes_list .= "
    ".__('Edit', 'quiz-master-next')." | ".__('Results', 'quiz-master-next')." @@ -331,7 +331,7 @@ function duplicateQuiz(id, quizName){