diff --git a/includes/mlw_qmn_credits.php b/includes/mlw_qmn_credits.php
index 2fc7db770..77d13de93 100644
--- a/includes/mlw_qmn_credits.php
+++ b/includes/mlw_qmn_credits.php
@@ -87,24 +87,15 @@ function mlw_qmn_setTab(tab) {
Version
-
Ability To Send Different Admin Emails Based On Score
-
You can now set up different admin emails based on score similarly to the user emails. You can also now customize the admin email's seubject.
-
-
New Dashboard Widget
-
We added a new dashboard widget that shows a snapshot of how your quizzes are doing. Includes daily total, most popular quiz, and more.
-
-
New Help Page
-
There is now a new page in the menu titled "Help". This page now has the support widget on it and a link to the documentation. We also added a system info widget on this page to better assist when trying to solve errors.
-
-
For Developers:
-
We added 4 new hooks in the Quiz Creator class. You can now hook into when a quiz is created, duplicated, deleted, or its name is changed. We also begun work on a few quiz settings helper functions in the class as well.
+
New Text Editors On Text Tab
+
When editing text on the text tab, you will now being using the WordPress editor. You will be able to easily style your text as well as add media.
Please Take Our Survey To Better Improve This Plugin
When you have a moment, please take our survey for this plugin. By filling out the survey, you are helping us improve this plugin. Users who take the survey between now and December 31st, 2014 will be emailed a 25% off coupon for our WordPress Store. When you are ready, please take our survey .
@@ -112,13 +103,15 @@ function mlw_qmn_setTab(tab) {
We Are On GitHub Now
We have had several users ask for this so we thought we would try it out. We now love github! Be sure to make suggestions or contribute .
-
Popular Add-on Pack
-
Our Popular Add-On Pack is now only $45 for 6 add-ons! Now is the time to save almost 50%! Visit our WordPress Store for details.
-
(December 21, 2014)
+
(December 30, 2014)
- * Minor Design Changes
+ * Added Wp Editor To Text Tab
+ * Added Weekly Stats To Snapshot Widget
+ * Moved Email Settings To Emails Tab
+ * Default Question Order Auto-increments For New Questions
+ * In Code: Separated CSS/JS From Core Quiz PHP File
diff --git a/includes/mlw_quiz.php b/includes/mlw_quiz.php
index 8a41a81c2..7d6c6842c 100644
--- a/includes/mlw_quiz.php
+++ b/includes/mlw_quiz.php
@@ -140,56 +140,21 @@ function mlw_quiz_shortcode($atts)
wp_enqueue_script( 'jquery-effects-slide' );
wp_enqueue_script( 'jquery-ui-dialog' );
wp_enqueue_script( 'jquery-ui-button' );
- wp_enqueue_script( 'jquery-ui-accordion' );
wp_enqueue_script( 'jquery-ui-tooltip' );
- wp_enqueue_script( 'jquery-ui-tabs' );
- ?>
-
-
-
-
-
+ 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( 'math_jax', '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' );
- theme_selected == "default")
- {
- echo "";
- }
- else
- {
- echo "
theme_selected)."' rel='stylesheet' />";
- }
+ 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
@@ -242,285 +207,32 @@ function mlw_quiz_shortcode($atts)
}
?>
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 );
- //Form validation script
- ?>
-
- pagination != 0) { $mlw_display .= ""; }
//Begin the quiz
@@ -531,7 +243,7 @@ function mlw_validateForm()
$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 .= "
";
+ $mlw_display .= "
";
if ($mlw_quiz_options->contact_info_location == 0)
{
@@ -558,7 +270,7 @@ function mlw_validateForm()
$mlw_display .= "
";
if ($mlw_question->question_type == 0)
{
- $mlw_display .= "
";
+ $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)." ";
@@ -617,7 +329,7 @@ function mlw_validateForm()
}
elseif ($mlw_question->question_type == 4)
{
- $mlw_display .= "";
+ $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)." ";
@@ -643,7 +355,7 @@ function mlw_validateForm()
}
elseif ($mlw_question->question_type == 10)
{
- $mlw_display .= "";
+ $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)." ";
@@ -668,7 +380,7 @@ function mlw_validateForm()
}
elseif ($mlw_question->question_type == 1)
{
- $mlw_display .= "";
+ $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)." ";
@@ -721,7 +433,7 @@ function mlw_validateForm()
}
elseif ($mlw_question->question_type == 2)
{
- $mlw_display .= "";
+ $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)." ";
@@ -775,7 +487,7 @@ function mlw_validateForm()
}
elseif ($mlw_question->question_type == 5)
{
- $mlw_display .= "";
+ $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)." ";
@@ -790,7 +502,7 @@ function mlw_validateForm()
}
elseif ($mlw_question->question_type == 7)
{
- $mlw_display .= "";
+ $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)." ";
@@ -802,7 +514,7 @@ function mlw_validateForm()
{
if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredCheck";} else {$mlw_requireClass = "";}
$mlw_display .= " ";
- $mlw_display .= "".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)." ";
+ $mlw_display .= "".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)." ";
$mlw_display .= " ";
}
elseif ($mlw_question->question_type == 9)
@@ -811,7 +523,7 @@ function mlw_validateForm()
$mlw_display .= "";
$mlw_display .= " ";
$mlw_display .= "
";
- $mlw_display .= "";
+ $mlw_display .= "";
$mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)." ";
$mlw_display .= " ";
$mlw_display .= " ";
@@ -836,7 +548,7 @@ function mlw_validateForm()
}
else
{
- $mlw_display .= "";
+ $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)." ";
@@ -856,7 +568,7 @@ function mlw_validateForm()
}
if ($mlw_question->hints != "")
{
- $mlw_display .= "hints, ENT_QUOTES)."\" style=\"text-decoration:underline;color:rgb(0,0,255);\" class='mlw_qmn_hint_link'>Hint ";
+ $mlw_display .= "hints, ENT_QUOTES)."\" class='mlw_qmn_hint_link'>Hint ";
$mlw_display .= " ";
}
$mlw_display .= " ";
@@ -870,7 +582,7 @@ function mlw_validateForm()
$mlw_display .= "
";
$mlw_message_comments = htmlspecialchars_decode($mlw_quiz_options->message_comment, ENT_QUOTES);
$mlw_message_comments = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message_comments, $mlw_qmn_quiz_options_array);
- $mlw_display .= " ";
+ $mlw_display .= " ";
$mlw_display .= "";
$mlw_display .= "
";
if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "
"; }
@@ -899,7 +611,7 @@ function mlw_validateForm()
$mlw_display .= "
";
$mlw_display .= "
";
$mlw_display .= "
";
- $mlw_display .= "
";
+ $mlw_display .= "
";
$mlw_display .= "";
$mlw_display .= "
";
$mlw_display .= "";
@@ -972,10 +684,12 @@ function mlw_validateForm()
//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) {
$mlw_user_text = "";
$mlw_correct_text = "";
+ $qmn_correct = "incorrect";
if ( isset($_POST["question".$mlw_question->question_id]) || isset($_POST["mlwComment".$mlw_question->question_id]) )
{
if ( $mlw_question->question_type == 0 || $mlw_question->question_type == 1 || $mlw_question->question_type == 2)
@@ -998,6 +712,7 @@ function mlw_validateForm()
if ($mlw_qmn_question_answers_each[2] == 1)
{
$mlw_correct += 1;
+ $qmn_correct = "correct";
}
}
if ($mlw_qmn_question_answers_each[2] == 1)
@@ -1024,6 +739,7 @@ function mlw_validateForm()
if (strtoupper($mlw_user_text) == strtoupper($mlw_correct_text))
{
$mlw_correct += 1;
+ $qmn_correct = "correct";
$mlw_points += $mlw_qmn_question_answers_each[1];
break;
}
@@ -1061,6 +777,7 @@ function mlw_validateForm()
if ($mlw_qmn_user_correct_answers == $mlw_qmn_total_correct_answers)
{
$mlw_correct += 1;
+ $qmn_correct = "correct";
}
}
if (isset($_POST["mlwComment".$mlw_question->question_id]))
@@ -1079,7 +796,7 @@ function mlw_validateForm()
$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));
+ $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_question_answers .= $mlw_question_answer_display;
$mlw_question_answers .= " ";
@@ -1168,7 +885,7 @@ function mlw_validateForm()
$mlw_qmn_certificate_filename = str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_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_result_array["certificate_link"] = "Download Certificate ";
}
/*
@@ -1226,34 +943,8 @@ function mlw_validateForm()
if ($mlw_quiz_options->social_media == 1)
{
- ?>
-
- social_media_text) && is_array(@unserialize($mlw_quiz_options->social_media_text)))
@@ -1270,8 +961,8 @@ function mlw_qmn_share(network, mlw_qmn_social_text, mlw_qmn_title)
$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
+ quiz_name)."');\">Facebook
+ quiz_name)."');\">Twitter
";
}
@@ -1497,7 +1188,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
- $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)." ";
+ $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)." ";
$mlw_contact_display .= " ";
$mlw_contact_display .= " ";
@@ -1509,7 +1200,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
- $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)." ";
+ $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)." ";
$mlw_contact_display .= " ";
$mlw_contact_display .= " ";
}
@@ -1520,7 +1211,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwEmail mlwRequiredText\"";
}
- $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)." ";
+ $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)." ";
$mlw_contact_display .= " ";
$mlw_contact_display .= " ";
}
@@ -1531,7 +1222,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
- $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)." ";
+ $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)." ";
$mlw_contact_display .= " ";
$mlw_contact_display .= " ";
}
@@ -1552,7 +1243,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
- $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)." ";
+ $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)." ";
$mlw_contact_display .= " ";
$mlw_contact_display .= " ";
}
@@ -1563,7 +1254,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
- $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)." ";
+ $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)." ";
$mlw_contact_display .= " ";
$mlw_contact_display .= " ";
}
@@ -1574,7 +1265,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwEmail mlwRequiredText\"";
}
- $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)." ";
+ $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)." ";
$mlw_contact_display .= " ";
$mlw_contact_display .= " ";
}
@@ -1585,7 +1276,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
- $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)." ";
+ $mlw_contact_display .= "".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)." ";
$mlw_contact_display .= " ";
$mlw_contact_display .= " ";
}
diff --git a/includes/mlw_quiz_creator.php b/includes/mlw_quiz_creator.php
index 5dee7b414..10c00467f 100644
--- a/includes/mlw_quiz_creator.php
+++ b/includes/mlw_quiz_creator.php
@@ -192,17 +192,27 @@ public function create_quiz($quiz_name)
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;
+ 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;
+ font-weight: bold;
+ cursor: pointer;
+ }
+ .mlw_qmn_question
+ {
+ font-weight: bold;
+ }
+ .mlw_qmn_comment_section_text
+ {
+ font-weight: bold;
}";
$mlw_question_answer_default = "%QUESTION% Answer Provided: %USER_ANSWER% Correct Answer: %CORRECT_ANSWER% Comments Entered: %USER_COMMENTS% ";
$results = $wpdb->insert(
diff --git a/includes/mlw_quiz_options.php b/includes/mlw_quiz_options.php
index 057ba7d8c..0c5425801 100644
--- a/includes/mlw_quiz_options.php
+++ b/includes/mlw_quiz_options.php
@@ -30,8 +30,6 @@ function mlw_generate_quiz_options()
wp_enqueue_script( 'jquery-ui-dialog' );
wp_enqueue_script( 'jquery-ui-button' );
wp_enqueue_script( 'jquery-ui-datepicker' );
- wp_enqueue_script( 'jquery-ui-accordion' );
- wp_enqueue_script( 'jquery-ui-tooltip' );
wp_enqueue_script( 'jquery-ui-tabs' );
wp_enqueue_script( 'jquery-effects-blind' );
wp_enqueue_script( 'jquery-effects-explode' );
@@ -41,7 +39,6 @@ function mlw_generate_quiz_options()
// increase the default animation speed to exaggerate the effect
$j.fx.speeds._default = 1000;
$j(function() {
- $j("button").button();
$j( "#tabs" ).tabs();
});
@@ -441,10 +438,6 @@ function mlw_options_questions_tab_content()
?>
- Save Options
+ Save Options
";
echo " ";
@@ -1431,24 +1412,6 @@ function mlw_options_option_tab_content()
comment_section == 1) {echo 'checked="checked"';} ?> value='1' />No
-
- Send user email upon completion?
-
- send_user_email == 0) {echo 'checked="checked"';} ?> value='0' />Yes
- send_user_email == 1) {echo 'checked="checked"';} ?> value='1' />No
-
-
-
- Send admin email upon completion?
-
- send_admin_email == 0) {echo 'checked="checked"';} ?> value='0' />Yes
- send_admin_email == 1) {echo 'checked="checked"';} ?> value='1' />No
-
-
-
- What emails should we send the admin email to? Separate emails with a comma.
-
-
Show question number on quiz?
@@ -1464,7 +1427,7 @@ function mlw_options_option_tab_content()
- Save Options
+ Save Options
"; ?>
%QUIZ_NAME% - The name of the quiz
- Save Leaderboard Options
+ Save Leaderboard Options
";
echo " ";
@@ -1568,7 +1531,7 @@ function mlw_options_leaderboard_tab_content()
- Save Leaderboard Options
+ Save Leaderboard Options
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.
- Save Certificate Options
+ Save Certificate Options
";
echo " ";
@@ -1693,7 +1656,7 @@ function mlw_options_certificate_tab_content()
- Save Certificate Options
+ Save Certificate Options
query( $wpdb->prepare( "UPDATE ".$wpdb->prefix."mlw_quizzes SET user_email_template='%s', admin_email_template='%s', last_activity='".date("Y-m-d H:i:s")."' WHERE quiz_id=%d", $mlw_qmn_new_email_array, $mlw_qmn_new_admin_array, $mlw_qmn_email_id ) );
+ $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');
@@ -1901,14 +1867,6 @@ function mlw_options_emails_tab_content()
-
Save Quiz Style
+
Save Quiz Style
Custom Theme CSS
Entire quiz is a div with class 'mlw_qmn_quiz'
@@ -2474,7 +2456,7 @@ function mlw_qmn_theme(theme)
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'
-
Save Quiz Style
+
Save Quiz Style
-
Save Quiz Style
+
Save Quiz Style
Use this button to reset all the stats collected for this quiz (Quiz Views and Times Quiz Has Been Taken).
- Reset Quiz Views And Taken Stats
+ Reset Quiz Views And Taken Stats
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.
diff --git a/includes/mlw_update.php b/includes/mlw_update.php
index 77f401fcf..4845c7ed6 100644
--- a/includes/mlw_update.php
+++ b/includes/mlw_update.php
@@ -6,7 +6,7 @@ function mlw_quiz_update()
{
//Update this variable each update. This is what is checked when the plugin is deciding to run the upgrade script or not.
- $data = "3.8.2";
+ $data = "3.9.0";
if ( ! get_option('mlw_quiz_master_version'))
{
add_option('mlw_quiz_master_version' , $data);
diff --git a/includes/qmn_dashboard_widgets.php b/includes/qmn_dashboard_widgets.php
index 9d9817074..a95567985 100644
--- a/includes/qmn_dashboard_widgets.php
+++ b/includes/qmn_dashboard_widgets.php
@@ -27,6 +27,25 @@ 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);
+ }
+ else
+ {
+ $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" );
@@ -42,11 +61,17 @@ function qmn_snapshot_dashboard_widget()
.qmn_dashboard_list li:first-child
{
border-top: 0;
+ }
+ .qmn_full_width
+ {
width: 100%;
}
- .qmn_dashboard_element
+ .qmn_half_width
{
width: 50%;
+ }
+ .qmn_dashboard_element
+ {
float: left;
padding: 0;
-webkit-box-sizing: border-box;
@@ -93,7 +118,7 @@ function qmn_snapshot_dashboard_widget()
}
-
+
quizzes taken today
@@ -112,25 +137,44 @@ function qmn_snapshot_dashboard_widget()
-
+
+
+
+ quizzes taken last 7 days
+
+ = 0)
+ {
+ echo " ";
+ }
+ else
+ {
+ echo " ";
+ }
+ ?>
+
+
+
+
total active quizzes
-
+
total active questions
-
+
quiz_name; ?>
most popular quiz
-
+
quiz_name; ?>
least popular quiz
diff --git a/includes/qmn_pagination.js b/includes/qmn_pagination.js
new file mode 100644
index 000000000..a8acdb540
--- /dev/null
+++ b/includes/qmn_pagination.js
@@ -0,0 +1,95 @@
+setTimeout(function(){
+ var $j = jQuery.noConflict();
+ $j( ".quiz_section" ).hide();
+ $j( ".quiz_section" ).append( "
" );
+ $j( ".mlw_qmn_quiz" ).append( "
"+qmn_pagination_previous_text+" " );
+ $j( ".mlw_qmn_quiz" ).append( "
"+qmn_pagination_next_text+" " );
+ window.mlw_quiz_slide = 0;
+ window.mlw_previous = 0;
+ window.mlw_quiz_total_slides = qmn_section_limit;
+ nextSlide(1, 0);
+}, 100);
+function nextSlide(mlw_pagination, mlw_goto_top)
+{
+ jQuery( ".quiz_section" ).hide();
+ for (var i = 0; i < mlw_pagination; i++)
+ {
+ if (i == 0 && window.mlw_previous == 1 && window.mlw_quiz_slide > 1)
+ {
+ window.mlw_quiz_slide = window.mlw_quiz_slide + mlw_pagination;
+ }
+ else
+ {
+ window.mlw_quiz_slide++;
+ }
+ if (window.mlw_quiz_slide < 1)
+ {
+ window.mlw_quiz_slide = 1;
+ }
+ if (window.mlw_quiz_slide == 1)
+ {
+ jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
+ }
+ if (window.mlw_quiz_slide > 1)
+ {
+ jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).show();
+ }
+ if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
+ {
+ jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
+ }
+ if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
+ {
+ jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
+ }
+ jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
+ }
+ window.mlw_previous = 0;
+ if (mlw_goto_top == 1)
+ {
+ window.location.hash = "mlw_does_not_exist";
+ window.location.hash = "mlw_top_of_quiz";
+ }
+}
+function prevSlide(mlw_pagination, mlw_goto_top)
+{
+ jQuery( ".quiz_section" ).hide();
+ for (var i = 0; i < mlw_pagination; i++)
+ {
+ if (i == 0 && window.mlw_previous == 0)
+ {
+ window.mlw_quiz_slide = window.mlw_quiz_slide - mlw_pagination;
+ }
+ else
+ {
+ window.mlw_quiz_slide--;
+ }
+ if (window.mlw_quiz_slide < 1)
+ {
+ window.mlw_quiz_slide = 1;
+ }
+ if (window.mlw_quiz_slide == 1)
+ {
+ jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
+ }
+ if (window.mlw_quiz_slide > 1)
+ {
+ jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).show();
+ }
+ if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
+ {
+ jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
+ }
+ if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
+ {
+ jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
+ }
+ jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
+ }
+ window.mlw_previous = 1;
+ if (mlw_goto_top == 1)
+ {
+ window.location.hash = "mlw_does_not_exist";
+ window.location.hash = "mlw_top_of_quiz";
+ }
+}
diff --git a/includes/qmn_quiz.css b/includes/qmn_quiz.css
new file mode 100644
index 000000000..aa67b5c1d
--- /dev/null
+++ b/includes/qmn_quiz.css
@@ -0,0 +1,23 @@
+.ui-tooltip
+{
+ max-width: 500px !important;
+}
+.ui-tooltip-content
+{
+ max-width: 500px !important;
+}
+.qmn_error
+{
+ color: red;
+}
+.mlw_qmn_hint_link
+{
+ text-decoration:underline;
+ color:rgb(0,0,255);
+}
+.mlw_qmn_quiz_link
+{
+ display: inline;
+ vertical-align:top !important;
+ text-decoration: none;
+}
diff --git a/includes/qmn_quiz.js b/includes/qmn_quiz.js
new file mode 100644
index 000000000..be81c310e
--- /dev/null
+++ b/includes/qmn_quiz.js
@@ -0,0 +1,89 @@
+setTimeout(function(){
+ var $j = jQuery.noConflict();
+ // increase the default animation speed to exaggerate the effect
+ $j.fx.speeds._default = 1000;
+ $j(function() {
+ $j( ".mlw_qmn_quiz" ).tooltip();
+ });
+}, 100);
+setTimeout(function()
+{
+ var $j = jQuery.noConflict();
+ $j('.mlw_qmn_quiz input').on('keypress', function (e) {
+ if (e.which === 13) {
+ e.preventDefault();
+ }
+ });
+}, 100);
+var myVar=setInterval("mlwQmnTimer();",1000);
+function mlwQmnTimer()
+{
+ var x = +document.getElementById("timer").value;
+ x = x + 1;
+ document.getElementById("timer").value = x;
+}
+function clear_field(field)
+{
+ if (field.defaultValue == field.value) field.value = '';
+}
+
+function mlw_validateForm()
+{
+ mlw_validateResult = true;
+
+ jQuery('#quizForm *').filter(':input').each(function(){
+ jQuery(this).css("outline", "");
+ if (jQuery(this).attr('class'))
+ {
+ if(jQuery(this).attr('class').indexOf('mlwEmail') > -1 && this.value != "")
+ {
+ var x=this.value;
+ var atpos=x.indexOf('@');
+ var dotpos=x.lastIndexOf('.');
+ if (atpos<1 || dotpos
=x.length)
+ {
+ document.getElementById('mlw_error_message').innerHTML = '**Not a valid e-mail address!**';
+ document.getElementById('mlw_error_message_bottom').innerHTML = '**Not a valid e-mail address!**';
+ mlw_validateResult = false;
+ jQuery(this).css("outline", "2px solid red");
+ }
+ }
+ if(jQuery(this).attr('class').indexOf('mlwRequiredNumber') > -1 && this.value == "" && +this.value != NaN)
+ {
+ document.getElementById('mlw_error_message').innerHTML = '**This field must be a number!**';
+ document.getElementById('mlw_error_message_bottom').innerHTML = '**This field must be a number!**';
+ 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!**';
+ 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!**';
+ 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!**';
+ 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);
+}
diff --git a/includes/qmn_social_share.js b/includes/qmn_social_share.js
new file mode 100644
index 000000000..c94891f0a
--- /dev/null
+++ b/includes/qmn_social_share.js
@@ -0,0 +1,24 @@
+function mlw_qmn_share(network, mlw_qmn_social_text, mlw_qmn_title)
+{
+ var sTop = window.screen.height/2-(218);
+ var sLeft = window.screen.width/2-(313);
+ var sqShareOptions = "height=400,width=580,toolbar=0,status=0,location=0,menubar=0,directories=0,scrollbars=0,top=" + sTop + ",left=" + sLeft;
+ var pageUrl = window.location.href;
+ var pageUrlEncoded = encodeURIComponent(pageUrl);
+ if (network == 'facebook')
+ {
+ var Url = "https://www.facebook.com/dialog/feed?"
+ + "display=popup&"
+ + "app_id=483815031724529&"
+ + "link=" + pageUrlEncoded + "&"
+ + "name=" + encodeURIComponent(mlw_qmn_social_text) + "&"
+ + "description= &"
+ + "redirect_uri=http://www.mylocalwebstop.com/mlw_qmn_close.html";
+ }
+ if (network == 'twitter')
+ {
+ var Url = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(mlw_qmn_social_text);
+ }
+ window.open(Url, "Share", sqShareOptions);
+ return false;
+}
diff --git a/includes/qmn_timer.js b/includes/qmn_timer.js
new file mode 100644
index 000000000..4f2617057
--- /dev/null
+++ b/includes/qmn_timer.js
@@ -0,0 +1,82 @@
+setTimeout(function(){
+ var minutes = 0;
+ if (window.sessionStorage.getItem('mlw_started_quiz'+qmn_quiz_id) == "yes" && window.sessionStorage.getItem('mlw_time_quiz'+qmn_quiz_id) >= 0)
+ {
+ minutes = window.sessionStorage.getItem('mlw_time_quiz'+qmn_quiz_id);
+ }
+ else
+ {
+ minutes = qmn_timer_limit;
+ }
+ window.amount = (minutes*60);
+ window.titleText = window.document.title;
+ document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
+ window.counter=setInterval(timer, 1000);
+}, 100);
+function timer()
+{
+ window.amount=window.amount-1;
+ if (window.amount < 0)
+ {
+ window.amount = 0;
+ }
+ window.sessionStorage.setItem('mlw_time_quiz'+qmn_quiz_id, window.amount/60);
+ window.sessionStorage.setItem('mlw_started_quiz'+qmn_quiz_id, "yes");
+ document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
+ window.document.title = minToSec(window.amount) + " " + window.titleText;
+ if (window.amount <= 0)
+ {
+ clearInterval(window.counter);
+ jQuery( ".mlw_qmn_quiz input:radio" ).attr('disabled',true);
+ jQuery( ".mlw_qmn_quiz input:checkbox" ).attr('disabled',true);
+ jQuery( ".mlw_qmn_quiz select" ).attr('disabled',true);
+ jQuery( ".mlw_qmn_question_comment" ).attr('disabled',true);
+ jQuery( ".mlw_answer_open_text" ).attr('disabled',true);
+ //document.quizForm.submit();
+ return;
+ }
+}
+function minToSec(amount)
+{
+ var timer_display = '';
+ var hours = Math.floor(amount/3600);
+ if (hours == '0')
+ {
+ timer_display = timer_display +"00:";
+ }
+ else if (hours < 10)
+ {
+ timer_display = timer_display + '0' + hours + ":";
+ }
+ else
+ {
+ timer_display = timer_display + hours + ":";
+ }
+ var minutes = Math.floor((amount % 3600)/60);
+ if (minutes == '0')
+ {
+ timer_display = timer_display +"00:";
+ }
+ else if (minutes < 10)
+ {
+ timer_display = timer_display + '0' + minutes + ":";
+ }
+ else
+ {
+ timer_display = timer_display + minutes + ":";
+ }
+ var seconds = Math.floor(amount % 60);
+ if (seconds == '0')
+ {
+ timer_display = timer_display +"00";
+ }
+ else if (seconds < 10)
+ {
+ timer_display = timer_display +'0' + seconds;
+ }
+ else
+ {
+ timer_display = timer_display + seconds;
+ }
+ return timer_display;
+}
diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php
index 217d33469..1b46aa593 100644
--- a/mlw_quizmaster2.php
+++ b/mlw_quizmaster2.php
@@ -3,7 +3,7 @@
/*
Plugin Name: Quiz Master Next
Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
-Version: 3.8.2
+Version: 3.9.0
Author: Frank Corso
Author URI: http://www.mylocalwebstop.com/
Plugin URI: http://www.mylocalwebstop.com/
diff --git a/readme.txt b/readme.txt
index bf71838fc..94db80f3b 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: quiz, test, score, exam, survey, contact, form, email, answer, question
Requires at least: 3.8.1
Tested up to: 4.1
-Stable tag: 3.8.2
+Stable tag: 3.9.0
License URI: http://www.gnu.org/licenses/gpl-2.0.html
The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
@@ -116,6 +116,13 @@ Feel free to use the widget on the help page within the plugin or from the conta
== Changelog ==
+= 3.9.0 (December 30, 2014) =
+ * Added Wp Editor To Text Tab
+ * Added Weekly Stats To Snapshot Widget
+ * Moved Email Settings To Emails Tab
+ * Default Question Order Auto-increments For New Questions
+ * In Code: Separated CSS/JS From Core Quiz PHP File
+
= 3.8.2 (December 21, 2014) =
* Minor Design Changes
@@ -581,6 +588,9 @@ Feel free to use the widget on the help page within the plugin or from the conta
== Upgrade Notice ==
+= 3.9.0 =
+Upgrade for new editors on text tab and many more changes.
+
= 3.8.1 =
Upgrade for ability for different admin emails based on score. Also, new help page is included. Added new dashboard widget as well.