Version Description
Upgrade to have the ability to delete landing pages, allow users to go back when paginating questions, and have HTML in the correct answer info field!
Download this release
Release Info
Developer | fpcorso |
Plugin | Quiz And Survey Master (Formerly Quiz Master Next) |
Version | 1.9.2 |
Comparing to | |
See all releases |
Code changes from version 1.9.1 to 1.9.2
- includes/mlw_dashboard.php +5 -0
- includes/mlw_qmn_credits.php +6 -5
- includes/mlw_quiz.php +52 -9
- includes/mlw_quiz_options.php +41 -10
- includes/mlw_update.php +2 -1
- mlw_quizmaster2.php +2 -2
- readme.txt +12 -1
includes/mlw_dashboard.php
CHANGED
@@ -485,6 +485,11 @@ function mlw_dashboard_box_six()
|
|
485 |
<h2>Plugin Installation Services</h2>
|
486 |
<p>We will install any or all of our WordPress plugins on your existing WordPress site. This includes 1 year access to premium support-only forums.</p>
|
487 |
<p>Up to 2 hours of consultation and training included.</p>
|
|
|
|
|
|
|
|
|
|
|
488 |
<br />
|
489 |
<p>Visit our <a href="http://mylocalwebstop.com/services/" target="_blank" style="color:blue;">services</a> page for details.</p>
|
490 |
</div>
|
485 |
<h2>Plugin Installation Services</h2>
|
486 |
<p>We will install any or all of our WordPress plugins on your existing WordPress site. This includes 1 year access to premium support-only forums.</p>
|
487 |
<p>Up to 2 hours of consultation and training included.</p>
|
488 |
+
<hr />
|
489 |
+
<h2>WordPress Maintenance Services</h2>
|
490 |
+
<p>Our maintenance service includes around the clock security monitoring, off-site backups, plugin updates, theme updates, WordPress updates, and WordPress training videos.</p>
|
491 |
+
<p>Our Premium Plugin Support is included!</p>
|
492 |
+
<p>Up to 30 minutes of support, consultation, and training included each month.</p>
|
493 |
<br />
|
494 |
<p>Visit our <a href="http://mylocalwebstop.com/services/" target="_blank" style="color:blue;">services</a> page for details.</p>
|
495 |
</div>
|
includes/mlw_qmn_credits.php
CHANGED
@@ -57,18 +57,19 @@ function mlw_generate_about_page()
|
|
57 |
<hr />
|
58 |
<h3>What's New In <?php echo $mlw_quiz_version; ?></h3>
|
59 |
<ul>
|
60 |
-
<li>Added Ability To
|
61 |
-
<li>Added Ability To
|
62 |
-
<li>Added
|
|
|
|
|
63 |
<li>Minor Design Changes To Quiz</li>
|
64 |
-
<li>Minor Bug Fixes</li>
|
65 |
</ul>
|
66 |
<h3>What's Coming Soon</h3>
|
67 |
<ul>
|
68 |
<li>Importing Questions</li>
|
69 |
<li>Stats For Each Quiz</li>
|
70 |
<li>Multiple Right Answers</li>
|
71 |
-
<li>Graded Text Answers</li>
|
72 |
<li>Quiz Styling</li>
|
73 |
</ul>
|
74 |
|
57 |
<hr />
|
58 |
<h3>What's New In <?php echo $mlw_quiz_version; ?></h3>
|
59 |
<ul>
|
60 |
+
<li>Added Ability To Delete Landing Pages</li>
|
61 |
+
<li>Added Ability To Have HTML In Correct Answer Info Field</li>
|
62 |
+
<li>Added %CURRENT_DATE% field to show current date</li>
|
63 |
+
<li>Added Previous Question Button To Paginated Quiz</li>
|
64 |
+
<li>Add Timer To Title Bar</li>
|
65 |
<li>Minor Design Changes To Quiz</li>
|
|
|
66 |
</ul>
|
67 |
<h3>What's Coming Soon</h3>
|
68 |
<ul>
|
69 |
<li>Importing Questions</li>
|
70 |
<li>Stats For Each Quiz</li>
|
71 |
<li>Multiple Right Answers</li>
|
72 |
+
<li>Graded Open Text Answers</li>
|
73 |
<li>Quiz Styling</li>
|
74 |
</ul>
|
75 |
|
includes/mlw_quiz.php
CHANGED
@@ -118,6 +118,7 @@ function mlw_quiz_shortcode($atts)
|
|
118 |
//Display Quiz
|
119 |
if (!isset($_POST["complete_quiz"]) && $mlw_quiz_options->quiz_name != "" && $mlw_qmn_isAllowed)
|
120 |
{
|
|
|
121 |
//Calculate number of pages if pagination is turned on
|
122 |
if ($mlw_quiz_options->pagination != 0)
|
123 |
{
|
@@ -126,18 +127,28 @@ function mlw_quiz_shortcode($atts)
|
|
126 |
{
|
127 |
$mlw_qmn_section_limit = $mlw_qmn_section_limit + 1;
|
128 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
?>
|
130 |
<script type="text/javascript">
|
131 |
var $j = jQuery.noConflict();
|
132 |
$j(function() {
|
133 |
$j( ".quiz_section" ).hide();
|
134 |
-
$j( ".quiz_section" ).
|
135 |
-
|
|
|
|
|
136 |
window.mlw_quiz_total_slides = <?php echo $mlw_qmn_section_limit; ?>;
|
137 |
nextSlide();
|
138 |
});
|
139 |
function nextSlide()
|
140 |
{
|
|
|
141 |
if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
|
142 |
{
|
143 |
$j(".quiz_link").html("Submit");
|
@@ -149,8 +160,24 @@ function mlw_quiz_shortcode($atts)
|
|
149 |
}
|
150 |
y = window.mlw_quiz_slide-1;
|
151 |
$j( ".quiz_section.slide"+y ).hide();
|
152 |
-
$j( ".quiz_section.slide"+window.mlw_quiz_slide ).show( "slide", {direction: "right"} );
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
}
|
155 |
</script>
|
156 |
<style type="text/css">
|
@@ -178,12 +205,14 @@ function mlw_quiz_shortcode($atts)
|
|
178 |
<script type="text/javascript">
|
179 |
var minutes = <?php echo $mlw_quiz_options->timer_limit; ?>;
|
180 |
window.amount = (minutes*60);
|
|
|
181 |
document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
|
182 |
window.counter=setInterval(timer, 1000); //1000 will run it every 1 second
|
183 |
function timer()
|
184 |
{
|
185 |
window.amount=window.amount-1;
|
186 |
document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
|
|
|
187 |
if (window.amount <= 0)
|
188 |
{
|
189 |
clearInterval(window.counter);
|
@@ -329,9 +358,10 @@ function mlw_quiz_shortcode($atts)
|
|
329 |
//Begin the quiz
|
330 |
$mlw_display .= "<div class='mlw_qmn_quiz'>";
|
331 |
$mlw_display .= "<form name='quizForm' action='' method='post' class='mlw_quiz_form' onsubmit='return mlw_validateForm()' >";
|
332 |
-
$mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
|
333 |
$mlw_message_before = $mlw_quiz_options->message_before;
|
334 |
$mlw_message_before = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_before);
|
|
|
335 |
$mlw_display .= "<span>".$mlw_message_before."</span><br />";
|
336 |
$mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
|
337 |
|
@@ -344,13 +374,14 @@ function mlw_quiz_shortcode($atts)
|
|
344 |
//Display the questions
|
345 |
foreach($mlw_questions as $mlw_question) {
|
346 |
$mlw_qmn_section_count = $mlw_qmn_section_count + 1;
|
|
|
347 |
$mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
|
348 |
$mlw_display .= "<span style='font-weight:bold;'>".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
|
349 |
if ($mlw_question->question_type == 0)
|
350 |
{
|
351 |
if ($mlw_question->answer_one != "")
|
352 |
{
|
353 |
-
$mlw_display .= "<input type='radio'
|
354 |
$mlw_display .= "<br />";
|
355 |
}
|
356 |
if ($mlw_question->answer_two != "")
|
@@ -383,7 +414,7 @@ function mlw_quiz_shortcode($atts)
|
|
383 |
{
|
384 |
if ($mlw_question->answer_one != "")
|
385 |
{
|
386 |
-
$mlw_display .= "<input type='radio'
|
387 |
}
|
388 |
if ($mlw_question->answer_two != "")
|
389 |
{
|
@@ -463,6 +494,7 @@ function mlw_quiz_shortcode($atts)
|
|
463 |
$mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
|
464 |
$mlw_message_comments = $mlw_quiz_options->message_comment;
|
465 |
$mlw_message_comments = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_comments);
|
|
|
466 |
$mlw_display .= "<label for='mlwQuizComments' style='font-weight:bold;'>".$mlw_message_comments."</label>";
|
467 |
$mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
|
468 |
$mlw_display .= "</div>";
|
@@ -474,6 +506,7 @@ function mlw_quiz_shortcode($atts)
|
|
474 |
{
|
475 |
$mlw_message_end = $mlw_quiz_options->message_end_template;
|
476 |
$mlw_message_end = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_end);
|
|
|
477 |
$mlw_display .= "<span>".$mlw_message_end."</span>";
|
478 |
$mlw_display .= "<br /><br />";
|
479 |
}
|
@@ -483,6 +516,7 @@ function mlw_quiz_shortcode($atts)
|
|
483 |
}
|
484 |
$mlw_display .= "<span style='display: none;'>If you are human, leave this field blank or you will be considered spam:</span>";
|
485 |
$mlw_display .= "<input style='display: none;' type='text' name='email' id='email' />";
|
|
|
486 |
$mlw_display .= "<input type='hidden' name='timer' id='timer' value='0'/>";
|
487 |
$mlw_display .= "<input type='hidden' name='complete_quiz' value='confirmation' />";
|
488 |
$mlw_display .= "<input type='submit' value='".$mlw_quiz_options->submit_button_text."' />";
|
@@ -516,6 +550,7 @@ function mlw_quiz_shortcode($atts)
|
|
516 |
$mlw_total_questions = 0;
|
517 |
$mlw_total_score = 0;
|
518 |
$mlw_question_answers = "";
|
|
|
519 |
|
520 |
//Update the amount of times the quiz has been taken
|
521 |
$mlw_taken = $mlw_quiz_options->quiz_taken;
|
@@ -529,7 +564,7 @@ function mlw_quiz_shortcode($atts)
|
|
529 |
{
|
530 |
$mlw_user_text;
|
531 |
$mlw_correct_text;
|
532 |
-
|
533 |
if (isset($_POST["question".$mlw_question->question_id]))
|
534 |
{
|
535 |
$mlw_user_answer = $_POST["question".$mlw_question->question_id];
|
@@ -589,7 +624,7 @@ function mlw_quiz_shortcode($atts)
|
|
589 |
$mlw_question_answer_display = str_replace( "%USER_ANSWER%" , $mlw_user_text, $mlw_question_answer_display);
|
590 |
$mlw_question_answer_display = str_replace( "%CORRECT_ANSWER%" , $mlw_correct_text, $mlw_question_answer_display);
|
591 |
$mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $mlw_qm_question_comment, $mlw_question_answer_display);
|
592 |
-
$mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , $mlw_question->question_answer_info, $mlw_question_answer_display);
|
593 |
|
594 |
$mlw_question_answers .= $mlw_question_answer_display;
|
595 |
$mlw_question_answers .= "<br />";
|
@@ -642,6 +677,7 @@ function mlw_quiz_shortcode($atts)
|
|
642 |
$mlw_message_certificate = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_certificate);
|
643 |
$mlw_message_certificate = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_certificate);
|
644 |
$mlw_message_certificate = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_certificate);
|
|
|
645 |
$mlw_message_certificate = str_replace( "\n" , "<br>", $mlw_message_certificate);
|
646 |
$mlw_qmn_certifiicate_file = "<?php
|
647 |
include(\"".plugin_dir_path( __FILE__ )."WriteHTML.php\");
|
@@ -694,6 +730,7 @@ function mlw_quiz_shortcode($atts)
|
|
694 |
$mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
|
695 |
$mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
|
696 |
$mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
|
|
|
697 |
$mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
|
698 |
$mlw_display .= $mlw_message_after;
|
699 |
break;
|
@@ -718,6 +755,7 @@ function mlw_quiz_shortcode($atts)
|
|
718 |
$mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
|
719 |
$mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
|
720 |
$mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
|
|
|
721 |
$mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
|
722 |
$mlw_display .= $mlw_message_after;
|
723 |
break;
|
@@ -740,6 +778,7 @@ function mlw_quiz_shortcode($atts)
|
|
740 |
$mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
|
741 |
$mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
|
742 |
$mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
|
|
|
743 |
$mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
|
744 |
$mlw_display .= $mlw_message_after;
|
745 |
break;
|
@@ -765,6 +804,7 @@ function mlw_quiz_shortcode($atts)
|
|
765 |
$mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
|
766 |
$mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
|
767 |
$mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
|
|
|
768 |
$mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
|
769 |
$mlw_display .= $mlw_message_after;
|
770 |
}
|
@@ -778,6 +818,7 @@ function mlw_quiz_shortcode($atts)
|
|
778 |
$mlw_social_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_social_message);
|
779 |
$mlw_social_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_social_message);
|
780 |
$mlw_social_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_social_message);
|
|
|
781 |
$mlw_display .= "<br />
|
782 |
<a href=\"https://twitter.com/share\" data-size=\"large\" data-text=\"".esc_attr($mlw_social_message)."\" class=\"twitter-share-button\" data-lang=\"en\">Tweet</a>
|
783 |
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"https://platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>
|
@@ -805,6 +846,7 @@ function mlw_quiz_shortcode($atts)
|
|
805 |
$mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
|
806 |
$mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
|
807 |
$mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
|
|
|
808 |
$mlw_message = str_replace( "<br />" , "\n", $mlw_message);
|
809 |
$mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
|
810 |
wp_mail($mlw_user_email, "Quiz Results For ".$mlw_quiz_options->quiz_name, $mlw_message, $mlw_headers);
|
@@ -830,6 +872,7 @@ function mlw_quiz_shortcode($atts)
|
|
830 |
$mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
|
831 |
$mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
|
832 |
$mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
|
|
|
833 |
$mlw_message .= " This email was generated by the Quiz Master Next script by Frank Corso";
|
834 |
$mlw_message = str_replace( "<br />" , "\n", $mlw_message);
|
835 |
$mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
|
118 |
//Display Quiz
|
119 |
if (!isset($_POST["complete_quiz"]) && $mlw_quiz_options->quiz_name != "" && $mlw_qmn_isAllowed)
|
120 |
{
|
121 |
+
$mlw_qmn_total_questions = 0;
|
122 |
//Calculate number of pages if pagination is turned on
|
123 |
if ($mlw_quiz_options->pagination != 0)
|
124 |
{
|
127 |
{
|
128 |
$mlw_qmn_section_limit = $mlw_qmn_section_limit + 1;
|
129 |
}
|
130 |
+
|
131 |
+
//Gather text for pagination buttons
|
132 |
+
$mlw_qmn_pagination_text = "";
|
133 |
+
$mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text);
|
134 |
+
if (!is_array($mlw_qmn_pagination_text)) {
|
135 |
+
$mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text);
|
136 |
+
}
|
137 |
?>
|
138 |
<script type="text/javascript">
|
139 |
var $j = jQuery.noConflict();
|
140 |
$j(function() {
|
141 |
$j( ".quiz_section" ).hide();
|
142 |
+
$j( ".quiz_section" ).append( "<br />" );
|
143 |
+
$j( ".quiz_section" ).not( ".quiz_begin" ).append( "<a class=\"mlw_qmn_quiz_link\" href='#' onclick=\"prevSlide();\"><?php echo $mlw_qmn_pagination_text[0]; ?></a>" );
|
144 |
+
$j( ".quiz_section" ).not( ".quiz_end" ).append( "<a class=\"mlw_qmn_quiz_link\" href='#' onclick=\"nextSlide();\"><?php echo $mlw_qmn_pagination_text[1]; ?></a>" );
|
145 |
+
window.mlw_quiz_slide = 0;
|
146 |
window.mlw_quiz_total_slides = <?php echo $mlw_qmn_section_limit; ?>;
|
147 |
nextSlide();
|
148 |
});
|
149 |
function nextSlide()
|
150 |
{
|
151 |
+
window.mlw_quiz_slide++;
|
152 |
if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
|
153 |
{
|
154 |
$j(".quiz_link").html("Submit");
|
160 |
}
|
161 |
y = window.mlw_quiz_slide-1;
|
162 |
$j( ".quiz_section.slide"+y ).hide();
|
163 |
+
$j( ".quiz_section.slide"+window.mlw_quiz_slide ).show( "slide", {direction: "right"}, 300 );
|
164 |
+
|
165 |
+
}
|
166 |
+
function prevSlide()
|
167 |
+
{
|
168 |
+
window.mlw_quiz_slide--;
|
169 |
+
if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
|
170 |
+
{
|
171 |
+
$j(".quiz_link").html("Submit");
|
172 |
+
}
|
173 |
+
if (window.mlw_quiz_slide > window.mlw_quiz_total_slides)
|
174 |
+
{
|
175 |
+
document.quizForm.submit();
|
176 |
+
exit();
|
177 |
+
}
|
178 |
+
y = window.mlw_quiz_slide+1;
|
179 |
+
$j( ".quiz_section.slide"+y ).hide();
|
180 |
+
$j( ".quiz_section.slide"+window.mlw_quiz_slide ).show( "slide", {direction: "left"}, 300 );
|
181 |
}
|
182 |
</script>
|
183 |
<style type="text/css">
|
205 |
<script type="text/javascript">
|
206 |
var minutes = <?php echo $mlw_quiz_options->timer_limit; ?>;
|
207 |
window.amount = (minutes*60);
|
208 |
+
window.titleText = window.document.title;
|
209 |
document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
|
210 |
window.counter=setInterval(timer, 1000); //1000 will run it every 1 second
|
211 |
function timer()
|
212 |
{
|
213 |
window.amount=window.amount-1;
|
214 |
document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
|
215 |
+
window.document.title = minToSec(window.amount) + " " + window.titleText;
|
216 |
if (window.amount <= 0)
|
217 |
{
|
218 |
clearInterval(window.counter);
|
358 |
//Begin the quiz
|
359 |
$mlw_display .= "<div class='mlw_qmn_quiz'>";
|
360 |
$mlw_display .= "<form name='quizForm' action='' method='post' class='mlw_quiz_form' onsubmit='return mlw_validateForm()' >";
|
361 |
+
$mlw_display .= "<div class='quiz_section quiz_begin slide".$mlw_qmn_section_count."'>";
|
362 |
$mlw_message_before = $mlw_quiz_options->message_before;
|
363 |
$mlw_message_before = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_before);
|
364 |
+
$mlw_message_before = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_before);
|
365 |
$mlw_display .= "<span>".$mlw_message_before."</span><br />";
|
366 |
$mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
|
367 |
|
374 |
//Display the questions
|
375 |
foreach($mlw_questions as $mlw_question) {
|
376 |
$mlw_qmn_section_count = $mlw_qmn_section_count + 1;
|
377 |
+
$mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
|
378 |
$mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
|
379 |
$mlw_display .= "<span style='font-weight:bold;'>".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
|
380 |
if ($mlw_question->question_type == 0)
|
381 |
{
|
382 |
if ($mlw_question->answer_one != "")
|
383 |
{
|
384 |
+
$mlw_display .= "<input type='radio' required name='question".$mlw_question->question_id."' id='question".$mlw_question->question_id."_one' value='1' /> <label for='question".$mlw_question->question_id."_one'>".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES)."</label>";
|
385 |
$mlw_display .= "<br />";
|
386 |
}
|
387 |
if ($mlw_question->answer_two != "")
|
414 |
{
|
415 |
if ($mlw_question->answer_one != "")
|
416 |
{
|
417 |
+
$mlw_display .= "<input type='radio' required name='question".$mlw_question->question_id."' value='1' />".htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES);
|
418 |
}
|
419 |
if ($mlw_question->answer_two != "")
|
420 |
{
|
494 |
$mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
|
495 |
$mlw_message_comments = $mlw_quiz_options->message_comment;
|
496 |
$mlw_message_comments = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_comments);
|
497 |
+
$mlw_message_comments = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_comments);
|
498 |
$mlw_display .= "<label for='mlwQuizComments' style='font-weight:bold;'>".$mlw_message_comments."</label>";
|
499 |
$mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
|
500 |
$mlw_display .= "</div>";
|
506 |
{
|
507 |
$mlw_message_end = $mlw_quiz_options->message_end_template;
|
508 |
$mlw_message_end = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_message_end);
|
509 |
+
$mlw_message_end = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_end);
|
510 |
$mlw_display .= "<span>".$mlw_message_end."</span>";
|
511 |
$mlw_display .= "<br /><br />";
|
512 |
}
|
516 |
}
|
517 |
$mlw_display .= "<span style='display: none;'>If you are human, leave this field blank or you will be considered spam:</span>";
|
518 |
$mlw_display .= "<input style='display: none;' type='text' name='email' id='email' />";
|
519 |
+
$mlw_display .= "<input type='hidden' name='total_questions' id='total_questions' value='".$mlw_qmn_total_questions."'/>";
|
520 |
$mlw_display .= "<input type='hidden' name='timer' id='timer' value='0'/>";
|
521 |
$mlw_display .= "<input type='hidden' name='complete_quiz' value='confirmation' />";
|
522 |
$mlw_display .= "<input type='submit' value='".$mlw_quiz_options->submit_button_text."' />";
|
550 |
$mlw_total_questions = 0;
|
551 |
$mlw_total_score = 0;
|
552 |
$mlw_question_answers = "";
|
553 |
+
isset($_POST["total_questions"]) ? $mlw_total_questions = intval($_POST["total_questions"]) : $mlw_total_questions = 0;
|
554 |
|
555 |
//Update the amount of times the quiz has been taken
|
556 |
$mlw_taken = $mlw_quiz_options->quiz_taken;
|
564 |
{
|
565 |
$mlw_user_text;
|
566 |
$mlw_correct_text;
|
567 |
+
//$mlw_total_questions += 1;
|
568 |
if (isset($_POST["question".$mlw_question->question_id]))
|
569 |
{
|
570 |
$mlw_user_answer = $_POST["question".$mlw_question->question_id];
|
624 |
$mlw_question_answer_display = str_replace( "%USER_ANSWER%" , $mlw_user_text, $mlw_question_answer_display);
|
625 |
$mlw_question_answer_display = str_replace( "%CORRECT_ANSWER%" , $mlw_correct_text, $mlw_question_answer_display);
|
626 |
$mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $mlw_qm_question_comment, $mlw_question_answer_display);
|
627 |
+
$mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($mlw_question->question_answer_info), $mlw_question_answer_display);
|
628 |
|
629 |
$mlw_question_answers .= $mlw_question_answer_display;
|
630 |
$mlw_question_answers .= "<br />";
|
677 |
$mlw_message_certificate = str_replace( "%QUESTIONS_ANSWERS%" , $mlw_question_answers, $mlw_message_certificate);
|
678 |
$mlw_message_certificate = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_certificate);
|
679 |
$mlw_message_certificate = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_certificate);
|
680 |
+
$mlw_message_certificate = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_certificate);
|
681 |
$mlw_message_certificate = str_replace( "\n" , "<br>", $mlw_message_certificate);
|
682 |
$mlw_qmn_certifiicate_file = "<?php
|
683 |
include(\"".plugin_dir_path( __FILE__ )."WriteHTML.php\");
|
730 |
$mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
|
731 |
$mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
|
732 |
$mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
|
733 |
+
$mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
|
734 |
$mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
|
735 |
$mlw_display .= $mlw_message_after;
|
736 |
break;
|
755 |
$mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
|
756 |
$mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
|
757 |
$mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
|
758 |
+
$mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
|
759 |
$mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
|
760 |
$mlw_display .= $mlw_message_after;
|
761 |
break;
|
778 |
$mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
|
779 |
$mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
|
780 |
$mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
|
781 |
+
$mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
|
782 |
$mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
|
783 |
$mlw_display .= $mlw_message_after;
|
784 |
break;
|
804 |
$mlw_message_after = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message_after);
|
805 |
$mlw_message_after = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message_after);
|
806 |
$mlw_message_after = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message_after);
|
807 |
+
$mlw_message_after = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message_after);
|
808 |
$mlw_message_after = str_replace( "\n" , "<br>", $mlw_message_after);
|
809 |
$mlw_display .= $mlw_message_after;
|
810 |
}
|
818 |
$mlw_social_message = str_replace( "%CORRECT_SCORE%" , $mlw_total_score, $mlw_social_message);
|
819 |
$mlw_social_message = str_replace( "%QUIZ_NAME%" , $mlw_quiz_options->quiz_name, $mlw_social_message);
|
820 |
$mlw_social_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_social_message);
|
821 |
+
$mlw_social_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_social_message);
|
822 |
$mlw_display .= "<br />
|
823 |
<a href=\"https://twitter.com/share\" data-size=\"large\" data-text=\"".esc_attr($mlw_social_message)."\" class=\"twitter-share-button\" data-lang=\"en\">Tweet</a>
|
824 |
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"https://platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>
|
846 |
$mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
|
847 |
$mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
|
848 |
$mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
|
849 |
+
$mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
|
850 |
$mlw_message = str_replace( "<br />" , "\n", $mlw_message);
|
851 |
$mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
|
852 |
wp_mail($mlw_user_email, "Quiz Results For ".$mlw_quiz_options->quiz_name, $mlw_message, $mlw_headers);
|
872 |
$mlw_message = str_replace( "%COMMENT_SECTION%" , $mlw_qm_quiz_comments, $mlw_message);
|
873 |
$mlw_message = str_replace( "%TIMER%" , $mlw_qmn_timer, $mlw_message);
|
874 |
$mlw_message = str_replace( "%CERTIFICATE_LINK%" , $mlw_certificate_link, $mlw_message);
|
875 |
+
$mlw_message = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $mlw_message);
|
876 |
$mlw_message .= " This email was generated by the Quiz Master Next script by Frank Corso";
|
877 |
$mlw_message = str_replace( "<br />" , "\n", $mlw_message);
|
878 |
$mlw_headers = 'From: '.$mlw_quiz_options->email_from_text.' <'.$mlw_quiz_options->admin_email.'>' . "\r\n";
|
includes/mlw_quiz_options.php
CHANGED
@@ -46,7 +46,7 @@ function mlw_generate_quiz_options()
|
|
46 |
$edit_answer_five_points = intval($_POST["edit_answer_five_points"]);
|
47 |
$edit_answer_six = htmlspecialchars($_POST["edit_answer_six"], ENT_QUOTES);
|
48 |
$edit_answer_six_points = intval($_POST["edit_answer_six_points"]);
|
49 |
-
$edit_correct_answer = $_POST["edit_correct_answer"];
|
50 |
$edit_question_answer_info = $_POST["edit_correct_answer_info"];
|
51 |
$mlw_edit_question_id = intval($_POST["edit_question_id"]);
|
52 |
$mlw_edit_question_type = $_POST["edit_question_type"];
|
@@ -123,7 +123,7 @@ function mlw_generate_quiz_options()
|
|
123 |
$answer_five_points = intval($_POST["answer_five_points"]);
|
124 |
$answer_six = htmlspecialchars($_POST["answer_six"], ENT_QUOTES);
|
125 |
$answer_six_points = intval($_POST["answer_six_points"]);
|
126 |
-
$correct_answer = $_POST["correct_answer"];
|
127 |
$question_answer_info = $_POST["correct_answer_info"];
|
128 |
$question_type = $_POST["question_type"];
|
129 |
$comments = htmlspecialchars($_POST["comments"], ENT_QUOTES);
|
@@ -199,12 +199,12 @@ function mlw_generate_quiz_options()
|
|
199 |
$mlw_phone_field_text = $_POST["mlw_phoneText"];
|
200 |
$mlw_before_comments = $_POST["mlw_quiz_before_comments"];
|
201 |
$mlw_comment_field_text = $_POST["mlw_commentText"];
|
202 |
-
$
|
203 |
$mlw_email_from_text = $_POST["emailFromText"];
|
204 |
$mlw_question_answer_template = $_POST["mlw_quiz_question_answer_template"];
|
205 |
$quiz_id = $_POST["quiz_id"];
|
206 |
|
207 |
-
$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."', user_email_template='".$mlw_user_email_template."', admin_email_template='".$mlw_admin_email_template."', total_user_tries_text='".$mlw_user_tries_text."', social_media_text='".$mlw_qmn_social_medi_text."', pagination_text='".$
|
208 |
$results = $wpdb->query( $update );
|
209 |
if ($results != false)
|
210 |
{
|
@@ -408,8 +408,11 @@ function mlw_generate_quiz_options()
|
|
408 |
$mlw_qmn_new_landing_array = array();
|
409 |
while ($i <= $mlw_qmn_landing_total)
|
410 |
{
|
411 |
-
|
412 |
-
|
|
|
|
|
|
|
413 |
$i++;
|
414 |
}
|
415 |
$mlw_qmn_new_landing_array = serialize($mlw_qmn_new_landing_array);
|
@@ -496,6 +499,13 @@ function mlw_generate_quiz_options()
|
|
496 |
// something went wrong, initialize to empty array
|
497 |
$mlw_message_after_array = array(array(0, 0, $mlw_quiz_options->message_after));
|
498 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
?>
|
500 |
<!-- css -->
|
501 |
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
|
@@ -807,6 +817,11 @@ function mlw_generate_quiz_options()
|
|
807 |
if (comments == 2) document.getElementById("editCommentRadio3").checked = true;
|
808 |
*/
|
809 |
};
|
|
|
|
|
|
|
|
|
|
|
810 |
</script>
|
811 |
<div class="wrap">
|
812 |
<div class='mlw_quiz_options'>
|
@@ -943,7 +958,7 @@ function mlw_generate_quiz_options()
|
|
943 |
else $alternate = " class=\"alternate\"";
|
944 |
$question_list .= "<tr{$alternate}>";
|
945 |
$question_list .= "<td><span style='font-size:16px;'>" . $mlw_question_info->question_order . "</span></td>";
|
946 |
-
$question_list .= "<td class='post-title column-title'><span style='font-size:16px;'>" . $mlw_question_info->question_name ."</span><div><span style='color:green;font-size:12px;'><a onclick=\"editQuestion('".$mlw_question_info->question_id."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->question_name, ENT_QUOTES)))."', '".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_one, ENT_QUOTES)))."','".$mlw_question_info->answer_one_points."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_two, ENT_QUOTES)))."','".$mlw_question_info->answer_two_points."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_three, ENT_QUOTES)))."','".$mlw_question_info->answer_three_points."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_four, ENT_QUOTES)))."','".$mlw_question_info->answer_four_points."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_five, ENT_QUOTES)))."','".$mlw_question_info->answer_five_points."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_six, ENT_QUOTES)))."','".$mlw_question_info->answer_six_points."','".$mlw_question_info->correct_answer."', '"
|
947 |
$question_list .= "</tr>";
|
948 |
}
|
949 |
|
@@ -1361,6 +1376,9 @@ function mlw_generate_quiz_options()
|
|
1361 |
<td><strong>%TIMER%</strong> - The amount of time user spent of quiz</td>
|
1362 |
<td><strong>%CERTIFICATE_LINK%</strong> - The link to the certificate after completing the quiz</td>
|
1363 |
</tr>
|
|
|
|
|
|
|
1364 |
</table>
|
1365 |
<button id="save_template_button" onclick="javascript: document.quiz_template_form.submit();">Save Templates</button><button id="template_tab_help">Help</button>
|
1366 |
<?php
|
@@ -1378,6 +1396,7 @@ function mlw_generate_quiz_options()
|
|
1378 |
<br />
|
1379 |
<p>Allowed Variables: </p>
|
1380 |
<p style="margin: 2px 0">- %QUIZ_NAME%</p>
|
|
|
1381 |
</td>
|
1382 |
<td><textarea cols="80" rows="15" id="mlw_quiz_before_message" name="mlw_quiz_before_message"><?php echo $mlw_quiz_options->message_before; ?></textarea>
|
1383 |
</td>
|
@@ -1388,6 +1407,7 @@ function mlw_generate_quiz_options()
|
|
1388 |
<br />
|
1389 |
<p>Allowed Variables: </p>
|
1390 |
<p style="margin: 2px 0">- %QUIZ_NAME%</p>
|
|
|
1391 |
</td>
|
1392 |
<td><textarea cols="80" rows="15" id="mlw_quiz_before_comments" name="mlw_quiz_before_comments"><?php echo $mlw_quiz_options->message_comment; ?></textarea>
|
1393 |
</td>
|
@@ -1398,6 +1418,7 @@ function mlw_generate_quiz_options()
|
|
1398 |
<br />
|
1399 |
<p>Allowed Variables: </p>
|
1400 |
<p style="margin: 2px 0">- %QUIZ_NAME%</p>
|
|
|
1401 |
</td>
|
1402 |
<td><textarea cols="80" rows="15" id="message_end_template" name="message_end_template"><?php echo $mlw_quiz_options->message_end_template; ?></textarea>
|
1403 |
</td>
|
@@ -1420,6 +1441,7 @@ function mlw_generate_quiz_options()
|
|
1420 |
<p style="margin: 2px 0">- %COMMENT_SECTION%</p>
|
1421 |
<p style="margin: 2px 0">- %QUESTIONS_ANSWERS%</p>
|
1422 |
<p style="margin: 2px 0">- %TIMER%</p>
|
|
|
1423 |
</td>
|
1424 |
<td>Now you can have different landing pages based on the user score! This field is now edited on the Quiz Landing Page tab.
|
1425 |
</td>
|
@@ -1430,6 +1452,7 @@ function mlw_generate_quiz_options()
|
|
1430 |
<br />
|
1431 |
<p>Allowed Variables: </p>
|
1432 |
<p style="margin: 2px 0">- %QUIZ_NAME%</p>
|
|
|
1433 |
</td>
|
1434 |
<td><textarea cols="80" rows="15" id="mlw_quiz_total_user_tries_text" name="mlw_quiz_total_user_tries_text"><?php echo $mlw_quiz_options->total_user_tries_text; ?></textarea>
|
1435 |
</td>
|
@@ -1458,6 +1481,7 @@ function mlw_generate_quiz_options()
|
|
1458 |
<p style="margin: 2px 0">- %COMMENT_SECTION%</p>
|
1459 |
<p style="margin: 2px 0">- %QUESTIONS_ANSWERS%</p>
|
1460 |
<p style="margin: 2px 0">- %TIMER%</p>
|
|
|
1461 |
</td>
|
1462 |
<td><textarea cols="80" rows="15" id="mlw_quiz_user_email_template" name="mlw_quiz_user_email_template"><?php echo $mlw_quiz_options->user_email_template; ?></textarea>
|
1463 |
</td>
|
@@ -1480,6 +1504,7 @@ function mlw_generate_quiz_options()
|
|
1480 |
<p style="margin: 2px 0">- %COMMENT_SECTION%</p>
|
1481 |
<p style="margin: 2px 0">- %QUESTIONS_ANSWERS%</p>
|
1482 |
<p style="margin: 2px 0">- %TIMER%</p>
|
|
|
1483 |
</td>
|
1484 |
<td><textarea cols="80" rows="15" id="mlw_quiz_admin_email_template" name="mlw_quiz_admin_email_template"><?php echo $mlw_quiz_options->admin_email_template; ?></textarea>
|
1485 |
</td>
|
@@ -1515,8 +1540,12 @@ function mlw_generate_quiz_options()
|
|
1515 |
<td><input name="mlw_commentText" type="text" id="mlw_commentText" value="<?php echo $mlw_quiz_options->comment_field_text; ?>" class="regular-text" /></td>
|
1516 |
</tr>
|
1517 |
<tr valign="top">
|
1518 |
-
<th scope="row"><label for="
|
1519 |
-
<td><input name="
|
|
|
|
|
|
|
|
|
1520 |
</tr>
|
1521 |
<tr valign="top">
|
1522 |
<th scope="row"><label for="emailFromText">What is the From Name for the email sent to users and admin?</label></th>
|
@@ -1550,6 +1579,7 @@ function mlw_generate_quiz_options()
|
|
1550 |
<p style="margin: 2px 0">- %CORRECT_SCORE%</p>
|
1551 |
<p style="margin: 2px 0">- %QUIZ_NAME%</p>
|
1552 |
<p style="margin: 2px 0">- %TIMER%</p>
|
|
|
1553 |
</td>
|
1554 |
<td><textarea cols="80" rows="15" id="mlw_quiz_social_media_text_template" name="mlw_quiz_social_media_text_template"><?php echo $mlw_quiz_options->social_media_text; ?></textarea>
|
1555 |
</td>
|
@@ -1794,6 +1824,7 @@ function mlw_generate_quiz_options()
|
|
1794 |
<p style="margin: 2px 0">- %USER_BUSINESS%</p>
|
1795 |
<p style="margin: 2px 0">- %USER_PHONE%</p>
|
1796 |
<p style="margin: 2px 0">- %USER_EMAIL%</p>
|
|
|
1797 |
</td>
|
1798 |
<td><label for="certificate_template">Allowed tags: <b> - bold, <i>-italics, <u>-underline, <br>-New Line or start a new line by pressing enter</label><textarea cols="80" rows="15" id="certificate_template" name="certificate_template"><?php echo $mlw_certificate_options[1]; ?></textarea>
|
1799 |
</td>
|
@@ -1911,7 +1942,7 @@ function mlw_generate_quiz_options()
|
|
1911 |
{
|
1912 |
echo "<tr{$alternate}>";
|
1913 |
echo "<td>";
|
1914 |
-
echo $mlw_each_count;
|
1915 |
echo "</td>";
|
1916 |
echo "<td>";
|
1917 |
echo "<input type='text' id='message_after_begin_".$mlw_each_count."' name='message_after_begin_".$mlw_each_count."' title='What score must the user score better than to see this page' value='".$mlw_each[0]."'/>";
|
46 |
$edit_answer_five_points = intval($_POST["edit_answer_five_points"]);
|
47 |
$edit_answer_six = htmlspecialchars($_POST["edit_answer_six"], ENT_QUOTES);
|
48 |
$edit_answer_six_points = intval($_POST["edit_answer_six_points"]);
|
49 |
+
$edit_correct_answer = htmlspecialchars($_POST["edit_correct_answer"], ENT_QUOTES);
|
50 |
$edit_question_answer_info = $_POST["edit_correct_answer_info"];
|
51 |
$mlw_edit_question_id = intval($_POST["edit_question_id"]);
|
52 |
$mlw_edit_question_type = $_POST["edit_question_type"];
|
123 |
$answer_five_points = intval($_POST["answer_five_points"]);
|
124 |
$answer_six = htmlspecialchars($_POST["answer_six"], ENT_QUOTES);
|
125 |
$answer_six_points = intval($_POST["answer_six_points"]);
|
126 |
+
$correct_answer = htmlspecialchars($_POST["correct_answer"], ENT_QUOTES);
|
127 |
$question_answer_info = $_POST["correct_answer_info"];
|
128 |
$question_type = $_POST["question_type"];
|
129 |
$comments = htmlspecialchars($_POST["comments"], ENT_QUOTES);
|
199 |
$mlw_phone_field_text = $_POST["mlw_phoneText"];
|
200 |
$mlw_before_comments = $_POST["mlw_quiz_before_comments"];
|
201 |
$mlw_comment_field_text = $_POST["mlw_commentText"];
|
202 |
+
$mlw_qmn_pagination_field = serialize(array( $_POST["pagination_prev_text"], $_POST["pagination_next_text"] ));
|
203 |
$mlw_email_from_text = $_POST["emailFromText"];
|
204 |
$mlw_question_answer_template = $_POST["mlw_quiz_question_answer_template"];
|
205 |
$quiz_id = $_POST["quiz_id"];
|
206 |
|
207 |
+
$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."', user_email_template='".$mlw_user_email_template."', admin_email_template='".$mlw_admin_email_template."', total_user_tries_text='".$mlw_user_tries_text."', social_media_text='".$mlw_qmn_social_medi_text."', pagination_text='".$mlw_qmn_pagination_field."' WHERE quiz_id=".$quiz_id;
|
208 |
$results = $wpdb->query( $update );
|
209 |
if ($results != false)
|
210 |
{
|
408 |
$mlw_qmn_new_landing_array = array();
|
409 |
while ($i <= $mlw_qmn_landing_total)
|
410 |
{
|
411 |
+
if ($_POST["message_after_".$i] != "Delete")
|
412 |
+
{
|
413 |
+
$mlw_qmn_landing_each = array(intval($_POST["message_after_begin_".$i]), intval($_POST["message_after_end_".$i]), $_POST["message_after_".$i]);
|
414 |
+
$mlw_qmn_new_landing_array[] = $mlw_qmn_landing_each;
|
415 |
+
}
|
416 |
$i++;
|
417 |
}
|
418 |
$mlw_qmn_new_landing_array = serialize($mlw_qmn_new_landing_array);
|
499 |
// something went wrong, initialize to empty array
|
500 |
$mlw_message_after_array = array(array(0, 0, $mlw_quiz_options->message_after));
|
501 |
}
|
502 |
+
|
503 |
+
//Load Pagination Text
|
504 |
+
$mlw_qmn_pagination_text = "";
|
505 |
+
$mlw_qmn_pagination_text = @unserialize($mlw_quiz_options->pagination_text);
|
506 |
+
if (!is_array($mlw_qmn_pagination_text)) {
|
507 |
+
$mlw_qmn_pagination_text = array('Previous', $mlw_quiz_options->pagination_text);
|
508 |
+
}
|
509 |
?>
|
510 |
<!-- css -->
|
511 |
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
|
817 |
if (comments == 2) document.getElementById("editCommentRadio3").checked = true;
|
818 |
*/
|
819 |
};
|
820 |
+
function delete_landing(id)
|
821 |
+
{
|
822 |
+
document.getElementById('message_after_'+id).value = "Delete";
|
823 |
+
document.mlw_quiz_save_landing_form.submit();
|
824 |
+
}
|
825 |
</script>
|
826 |
<div class="wrap">
|
827 |
<div class='mlw_quiz_options'>
|
958 |
else $alternate = " class=\"alternate\"";
|
959 |
$question_list .= "<tr{$alternate}>";
|
960 |
$question_list .= "<td><span style='font-size:16px;'>" . $mlw_question_info->question_order . "</span></td>";
|
961 |
+
$question_list .= "<td class='post-title column-title'><span style='font-size:16px;'>" . $mlw_question_info->question_name ."</span><div><span style='color:green;font-size:12px;'><a onclick=\"editQuestion('".$mlw_question_info->question_id."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->question_name, ENT_QUOTES)))."', '".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_one, ENT_QUOTES)))."','".$mlw_question_info->answer_one_points."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_two, ENT_QUOTES)))."','".$mlw_question_info->answer_two_points."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_three, ENT_QUOTES)))."','".$mlw_question_info->answer_three_points."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_four, ENT_QUOTES)))."','".$mlw_question_info->answer_four_points."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_five, ENT_QUOTES)))."','".$mlw_question_info->answer_five_points."','".str_replace('"', '"', str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->answer_six, ENT_QUOTES)))."','".$mlw_question_info->answer_six_points."','".$mlw_question_info->correct_answer."', '".esc_attr(htmlspecialchars_decode($mlw_question_info->question_answer_info, ENT_QUOTES))."', '".$mlw_question_info->comments."','".str_replace("'", "\'", htmlspecialchars_decode($mlw_question_info->hints, ENT_QUOTES))."', '".$mlw_question_info->question_order."', '".$mlw_question_info->question_type."')\" href='#'>Edit</a> | <a onclick=\"deleteQuestion('".$mlw_question_info->question_id."')\" href='#'>Delete</a></span></div></td>";
|
962 |
$question_list .= "</tr>";
|
963 |
}
|
964 |
|
1376 |
<td><strong>%TIMER%</strong> - The amount of time user spent of quiz</td>
|
1377 |
<td><strong>%CERTIFICATE_LINK%</strong> - The link to the certificate after completing the quiz</td>
|
1378 |
</tr>
|
1379 |
+
<tr>
|
1380 |
+
<td><strong>%CURRENT_DATE%</strong> - The Current Date</td>
|
1381 |
+
</tr>
|
1382 |
</table>
|
1383 |
<button id="save_template_button" onclick="javascript: document.quiz_template_form.submit();">Save Templates</button><button id="template_tab_help">Help</button>
|
1384 |
<?php
|
1396 |
<br />
|
1397 |
<p>Allowed Variables: </p>
|
1398 |
<p style="margin: 2px 0">- %QUIZ_NAME%</p>
|
1399 |
+
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1400 |
</td>
|
1401 |
<td><textarea cols="80" rows="15" id="mlw_quiz_before_message" name="mlw_quiz_before_message"><?php echo $mlw_quiz_options->message_before; ?></textarea>
|
1402 |
</td>
|
1407 |
<br />
|
1408 |
<p>Allowed Variables: </p>
|
1409 |
<p style="margin: 2px 0">- %QUIZ_NAME%</p>
|
1410 |
+
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1411 |
</td>
|
1412 |
<td><textarea cols="80" rows="15" id="mlw_quiz_before_comments" name="mlw_quiz_before_comments"><?php echo $mlw_quiz_options->message_comment; ?></textarea>
|
1413 |
</td>
|
1418 |
<br />
|
1419 |
<p>Allowed Variables: </p>
|
1420 |
<p style="margin: 2px 0">- %QUIZ_NAME%</p>
|
1421 |
+
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1422 |
</td>
|
1423 |
<td><textarea cols="80" rows="15" id="message_end_template" name="message_end_template"><?php echo $mlw_quiz_options->message_end_template; ?></textarea>
|
1424 |
</td>
|
1441 |
<p style="margin: 2px 0">- %COMMENT_SECTION%</p>
|
1442 |
<p style="margin: 2px 0">- %QUESTIONS_ANSWERS%</p>
|
1443 |
<p style="margin: 2px 0">- %TIMER%</p>
|
1444 |
+
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1445 |
</td>
|
1446 |
<td>Now you can have different landing pages based on the user score! This field is now edited on the Quiz Landing Page tab.
|
1447 |
</td>
|
1452 |
<br />
|
1453 |
<p>Allowed Variables: </p>
|
1454 |
<p style="margin: 2px 0">- %QUIZ_NAME%</p>
|
1455 |
+
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1456 |
</td>
|
1457 |
<td><textarea cols="80" rows="15" id="mlw_quiz_total_user_tries_text" name="mlw_quiz_total_user_tries_text"><?php echo $mlw_quiz_options->total_user_tries_text; ?></textarea>
|
1458 |
</td>
|
1481 |
<p style="margin: 2px 0">- %COMMENT_SECTION%</p>
|
1482 |
<p style="margin: 2px 0">- %QUESTIONS_ANSWERS%</p>
|
1483 |
<p style="margin: 2px 0">- %TIMER%</p>
|
1484 |
+
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1485 |
</td>
|
1486 |
<td><textarea cols="80" rows="15" id="mlw_quiz_user_email_template" name="mlw_quiz_user_email_template"><?php echo $mlw_quiz_options->user_email_template; ?></textarea>
|
1487 |
</td>
|
1504 |
<p style="margin: 2px 0">- %COMMENT_SECTION%</p>
|
1505 |
<p style="margin: 2px 0">- %QUESTIONS_ANSWERS%</p>
|
1506 |
<p style="margin: 2px 0">- %TIMER%</p>
|
1507 |
+
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1508 |
</td>
|
1509 |
<td><textarea cols="80" rows="15" id="mlw_quiz_admin_email_template" name="mlw_quiz_admin_email_template"><?php echo $mlw_quiz_options->admin_email_template; ?></textarea>
|
1510 |
</td>
|
1540 |
<td><input name="mlw_commentText" type="text" id="mlw_commentText" value="<?php echo $mlw_quiz_options->comment_field_text; ?>" class="regular-text" /></td>
|
1541 |
</tr>
|
1542 |
<tr valign="top">
|
1543 |
+
<th scope="row"><label for="pagination_prev_text">Text for previous button</label></th>
|
1544 |
+
<td><input name="pagination_prev_text" type="text" id="pagination_prev_text" value="<?php echo $mlw_qmn_pagination_text[0]; ?>" class="regular-text" /></td>
|
1545 |
+
</tr>
|
1546 |
+
<tr valign="top">
|
1547 |
+
<th scope="row"><label for="pagination_next_text">Text for next button</label></th>
|
1548 |
+
<td><input name="pagination_next_text" type="text" id="pagination_next_text" value="<?php echo $mlw_qmn_pagination_text[1]; ?>" class="regular-text" /></td>
|
1549 |
</tr>
|
1550 |
<tr valign="top">
|
1551 |
<th scope="row"><label for="emailFromText">What is the From Name for the email sent to users and admin?</label></th>
|
1579 |
<p style="margin: 2px 0">- %CORRECT_SCORE%</p>
|
1580 |
<p style="margin: 2px 0">- %QUIZ_NAME%</p>
|
1581 |
<p style="margin: 2px 0">- %TIMER%</p>
|
1582 |
+
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1583 |
</td>
|
1584 |
<td><textarea cols="80" rows="15" id="mlw_quiz_social_media_text_template" name="mlw_quiz_social_media_text_template"><?php echo $mlw_quiz_options->social_media_text; ?></textarea>
|
1585 |
</td>
|
1824 |
<p style="margin: 2px 0">- %USER_BUSINESS%</p>
|
1825 |
<p style="margin: 2px 0">- %USER_PHONE%</p>
|
1826 |
<p style="margin: 2px 0">- %USER_EMAIL%</p>
|
1827 |
+
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1828 |
</td>
|
1829 |
<td><label for="certificate_template">Allowed tags: <b> - bold, <i>-italics, <u>-underline, <br>-New Line or start a new line by pressing enter</label><textarea cols="80" rows="15" id="certificate_template" name="certificate_template"><?php echo $mlw_certificate_options[1]; ?></textarea>
|
1830 |
</td>
|
1942 |
{
|
1943 |
echo "<tr{$alternate}>";
|
1944 |
echo "<td>";
|
1945 |
+
echo $mlw_each_count."<div><span style='color:green;font-size:12px;'><a onclick=\"\$j('#trying_delete_".$mlw_each_count."').show();\">Delete</a></span></div><div style=\"display: none;\" id='trying_delete_".$mlw_each_count."'>Are you sure?<br /><a onclick=\"delete_landing(".$mlw_each_count.")\">Yes</a>|<a onclick=\"\$j('#trying_delete_".$mlw_each_count."').hide();\">No</a></div>";
|
1946 |
echo "</td>";
|
1947 |
echo "<td>";
|
1948 |
echo "<input type='text' id='message_after_begin_".$mlw_each_count."' name='message_after_begin_".$mlw_each_count."' title='What score must the user score better than to see this page' value='".$mlw_each[0]."'/>";
|
includes/mlw_update.php
CHANGED
@@ -6,7 +6,7 @@ function mlw_quiz_update()
|
|
6 |
{
|
7 |
|
8 |
//Update this variable each update. This is what is checked when the plugin is deciding to run the upgrade script or not.
|
9 |
-
$data = "1.9.
|
10 |
if ( ! get_option('mlw_quiz_master_version'))
|
11 |
{
|
12 |
add_option('mlw_quiz_master_version' , $data);
|
@@ -167,6 +167,7 @@ function mlw_quiz_update()
|
|
167 |
$results = $wpdb->query( $update_sql );
|
168 |
}
|
169 |
|
|
|
170 |
global $wpdb;
|
171 |
$table_name = $wpdb->prefix . "mlw_questions";
|
172 |
//Update 0.5
|
6 |
{
|
7 |
|
8 |
//Update this variable each update. This is what is checked when the plugin is deciding to run the upgrade script or not.
|
9 |
+
$data = "1.9.2";
|
10 |
if ( ! get_option('mlw_quiz_master_version'))
|
11 |
{
|
12 |
add_option('mlw_quiz_master_version' , $data);
|
167 |
$results = $wpdb->query( $update_sql );
|
168 |
}
|
169 |
|
170 |
+
|
171 |
global $wpdb;
|
172 |
$table_name = $wpdb->prefix . "mlw_questions";
|
173 |
//Update 0.5
|
mlw_quizmaster2.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
Plugin Name: Quiz Master Next
|
5 |
Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
|
6 |
-
Version: 1.9.
|
7 |
Author: Frank Corso
|
8 |
Author URI: http://www.mylocalwebstop.com/
|
9 |
Plugin URI: http://www.mylocalwebstop.com/
|
@@ -39,7 +39,7 @@ include("includes/mlw_qmn_credits.php");
|
|
39 |
|
40 |
///Activation Actions
|
41 |
add_action('admin_menu', 'mlw_add_menu');
|
42 |
-
add_action('
|
43 |
add_action('widgets_init', create_function('', 'return register_widget("Mlw_Qmn_Leaderboard_Widget");'));
|
44 |
add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode');
|
45 |
add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
|
3 |
/*
|
4 |
Plugin Name: Quiz Master Next
|
5 |
Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
|
6 |
+
Version: 1.9.2
|
7 |
Author: Frank Corso
|
8 |
Author URI: http://www.mylocalwebstop.com/
|
9 |
Plugin URI: http://www.mylocalwebstop.com/
|
39 |
|
40 |
///Activation Actions
|
41 |
add_action('admin_menu', 'mlw_add_menu');
|
42 |
+
add_action('admin_init', 'mlw_quiz_update');
|
43 |
add_action('widgets_init', create_function('', 'return register_widget("Mlw_Qmn_Leaderboard_Widget");'));
|
44 |
add_shortcode('mlw_quizmaster', 'mlw_quiz_shortcode');
|
45 |
add_shortcode('mlw_quizmaster_leaderboard', 'mlw_quiz_leaderboard_shortcode');
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: quiz, test, score, survey, contact, form, email, answer, question
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 3.8.1
|
7 |
-
Stable tag: 1.9.
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
|
@@ -99,6 +99,14 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
|
|
99 |
|
100 |
== Changelog ==
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
= 1.9.1 (March 13, 2014) =
|
103 |
* Added Ability To Show One Question At A Time Instead Of All At Once
|
104 |
* Added Ability To Allow Users To Share Results On Twitter
|
@@ -360,6 +368,9 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
|
|
360 |
|
361 |
== Upgrade Notice ==
|
362 |
|
|
|
|
|
|
|
363 |
= 1.9.1 =
|
364 |
Upgrade to 1.9.1 to get the ability for pagination on the quiz and to allow your users to share their results on Twitter.
|
365 |
|
4 |
Tags: quiz, test, score, survey, contact, form, email, answer, question
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 3.8.1
|
7 |
+
Stable tag: 1.9.2
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
|
99 |
|
100 |
== Changelog ==
|
101 |
|
102 |
+
= 1.9.2 (March 17, 2014) =
|
103 |
+
* Added Ability To Delete Landing Pages
|
104 |
+
* Added Ability To Have HTML In Correct Answer Info Field
|
105 |
+
* Added Previous Question Button To Paginated Quiz
|
106 |
+
* Minor Design Changes To Quiz
|
107 |
+
* Add Timer To Title Bar
|
108 |
+
* Added %CURRENT_DATE% field
|
109 |
+
|
110 |
= 1.9.1 (March 13, 2014) =
|
111 |
* Added Ability To Show One Question At A Time Instead Of All At Once
|
112 |
* Added Ability To Allow Users To Share Results On Twitter
|
368 |
|
369 |
== Upgrade Notice ==
|
370 |
|
371 |
+
= 1.9.2 =
|
372 |
+
Upgrade to have the ability to delete landing pages, allow users to go back when paginating questions, and have HTML in the correct answer info field!
|
373 |
+
|
374 |
= 1.9.1 =
|
375 |
Upgrade to 1.9.1 to get the ability for pagination on the quiz and to allow your users to share their results on Twitter.
|
376 |
|