Version Description
Upgrade to have the ability to set number of questions per page and more bug fixes.
Download this release
Release Info
Developer | fpcorso |
Plugin | Quiz And Survey Master (Formerly Quiz Master Next) |
Version | 2.7.1 |
Comparing to | |
See all releases |
Code changes from version 2.6.4 to 2.7.1
- includes/mlw_help.php +2 -39
- includes/mlw_qmn_credits.php +8 -5
- includes/mlw_quiz.php +112 -42
- includes/mlw_quiz_options.php +20 -21
- includes/mlw_update.php +1 -1
- mlw_quizmaster2.php +1 -1
- readme.txt +12 -3
includes/mlw_help.php
CHANGED
@@ -47,12 +47,6 @@ function mlw_generate_help_page()
|
|
47 |
$j(function() {
|
48 |
$j("button").button();
|
49 |
});
|
50 |
-
$j(function() {
|
51 |
-
$j("#accordion").accordion({
|
52 |
-
heightStyle: "content"
|
53 |
-
});
|
54 |
-
|
55 |
-
});
|
56 |
</script>
|
57 |
<style>
|
58 |
label {
|
@@ -70,39 +64,8 @@ function mlw_generate_help_page()
|
|
70 |
<div class="wrap">
|
71 |
<div class='mlw_quiz_options'>
|
72 |
<h2>How-To<a id="opener" href="">(?)</a></h2>
|
73 |
-
<
|
74 |
-
|
75 |
-
<div>
|
76 |
-
In order to create a quiz, test, or survey you must first click on the Quizzes link from the side menu. Once you are on the page, you will see a Create New Quiz button. Click on this button.
|
77 |
-
Doing so will open a pop-up that will ask for the name of the quiz you would like to create. Once you entered the name in, click on the button that says Create Quiz. You should your
|
78 |
-
new quiz added to the table.
|
79 |
-
</div>
|
80 |
-
<h3><a href="#">How To Add A Question To Your Quiz</a></h3>
|
81 |
-
<div>
|
82 |
-
In order to add a question, you must first click on the Quizzes link from the side menu. Once you are on the page, click the edit link on the quiz you wish to add a question to. Once you are on the
|
83 |
-
Quiz Options page, navigate to the Quiz Questions tab. On the Quiz Questions tab, click on the button that says Add Question. Doing so will open a pop-up that will ask for the question, answers, hint,
|
84 |
-
correct answer, points, and whether you want a comment box. Once you fill in all the necessary information, click the button that says Create Question. Your question will be added to the list of questions
|
85 |
-
on the Quiz Questions tab.
|
86 |
-
</div>
|
87 |
-
<h3><a href="#">How To Edit The Text Shown Before A Quiz Or After Quiz Has Been Taken</a></h3>
|
88 |
-
<div>
|
89 |
-
First, go to the Quizzes page. From there, click edit on the quiz you would like to edit. Once the Quiz Options page loads, click on the Quiz Text tab. This tab is used to edit all the text that can be customized
|
90 |
-
on the quiz. At the top of the page, you will see a list of variables. If you put a variable in a section of text, it will be replaced by its corresponding values when the quiz is taken by the user. Go to
|
91 |
-
the section labeled Message Templates. In this section you will see a text box for the Message Displayed Before Quiz and the text box for the Message Displayed After Quiz. By customizing these boxes, you will
|
92 |
-
edit the text shown to the user before the quiz and after the quiz has been taken. Once finished, click the Save Templates button.
|
93 |
-
</div>
|
94 |
-
<h3><a href="#">How To Set-Up Your Quiz For A Correct/Incorrect System</a></h3>
|
95 |
-
<div>
|
96 |
-
First, go to the Quizzes page. From there, click edit on the quiz you would like to edit. Once the Quiz Options page loads, click on the Quiz Options tab. Ensure that the "Which system is this quiz graded on?"
|
97 |
-
option is set to Correct. Now, go back to the Quiz Question tab. When you add or edit a question, fill in the question and the answers. Leave the points fields at 0, and then select the correct answer using
|
98 |
-
the radio buttons to the right of the answers. Fill out the rest of the question options any way you need to. Your quiz will now be graded on a correct or incorrect system.
|
99 |
-
</div>
|
100 |
-
<h3><a href="#">How To Add Your Quiz To A Post Or Page</a></h3>
|
101 |
-
<div>
|
102 |
-
First go to the Quizzes page. Once there, copy the shortcode for your quiz from the Quiz Shortcode column. It should look similar to [mlw_quizmaster quiz=1]. Once you have copied your shortcode, go edit the post or
|
103 |
-
page you would like to add the quiz to. Once on the edit page, paste the shortcode into the textbox. Then click Update. Now when you visit that post or page, your quiz will appear in place of the shortcode.
|
104 |
-
</div>
|
105 |
-
</div>
|
106 |
<div id="dialog" title="Help">
|
107 |
<h3><b>Help</b></h3>
|
108 |
<p>This page contains numerous how-to's for using the plugin.</p>
|
47 |
$j(function() {
|
48 |
$j("button").button();
|
49 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
</script>
|
51 |
<style>
|
52 |
label {
|
64 |
<div class="wrap">
|
65 |
<div class='mlw_quiz_options'>
|
66 |
<h2>How-To<a id="opener" href="">(?)</a></h2>
|
67 |
+
Please visit our new <a href="http://mylocalwebstop.com/plugin-documentation/" style="color: blue;">Documentation</a> for using this plugin. It is a work in progress, but we will be deleting this page once it is finished.
|
68 |
+
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
<div id="dialog" title="Help">
|
70 |
<h3><b>Help</b></h3>
|
71 |
<p>This page contains numerous how-to's for using the plugin.</p>
|
includes/mlw_qmn_credits.php
CHANGED
@@ -87,23 +87,26 @@ function mlw_generate_about_page()
|
|
87 |
<a href="#" class="nav-tab nav-tab-active">
|
88 |
What’s New In <?php echo $mlw_quiz_version; ?> </a>
|
89 |
</h2>
|
90 |
-
<h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">
|
91 |
-
<p>
|
92 |
<br />
|
93 |
<h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Our Premium Add-Ons!</h2>
|
94 |
<p>We have 4 new premium add-ons in our WordPress Store: Export Results (exports your quiz results), Extra Shortcodes (gives you extra shortcodes to use), User Dashboard (allow users to see the results from all the quizzes they have taken), and Advertisement Be Gone (gets rid of blue-border ads). Visit our <a href="http://mylocalwebstop.com/shop/">WordPress Store</a> for details! </p>
|
95 |
<br />
|
96 |
<h3>Changelog For <?php echo $mlw_quiz_version; ?></h3>
|
97 |
<ul>
|
98 |
-
<li>Added
|
99 |
-
<li>Fixed
|
|
|
|
|
100 |
</ul>
|
101 |
<h3>What's Coming Soon</h3>
|
102 |
<ul>
|
103 |
<li>Importing Questions</li>
|
104 |
-
<li>Ability To Choose How Many Questions Shown Per Page</li>
|
105 |
<li>Stats For Each Quiz</li>
|
106 |
<li>Force Login/Register Option</li>
|
|
|
|
|
107 |
</ul>
|
108 |
|
109 |
<div id="dialog" title="Help">
|
87 |
<a href="#" class="nav-tab nav-tab-active">
|
88 |
What’s New In <?php echo $mlw_quiz_version; ?> </a>
|
89 |
</h2>
|
90 |
+
<h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Set Number Of Questions Per Page</h2>
|
91 |
+
<p>This update allows you to set the number of questions per page! Simply navigate to the Quiz Options tab and change the new "How many questions per page would you like?" option to the amount you would like. Set it to 0 to have all the quesitons on one page.</p>
|
92 |
<br />
|
93 |
<h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Our Premium Add-Ons!</h2>
|
94 |
<p>We have 4 new premium add-ons in our WordPress Store: Export Results (exports your quiz results), Extra Shortcodes (gives you extra shortcodes to use), User Dashboard (allow users to see the results from all the quizzes they have taken), and Advertisement Be Gone (gets rid of blue-border ads). Visit our <a href="http://mylocalwebstop.com/shop/">WordPress Store</a> for details! </p>
|
95 |
<br />
|
96 |
<h3>Changelog For <?php echo $mlw_quiz_version; ?></h3>
|
97 |
<ul>
|
98 |
+
<li>Added Ability To Set Number Of Question Per Page</li>
|
99 |
+
<li>Fixed HTML Not Showing On Results Page Bug</li>
|
100 |
+
<li>Fixed Timer Not Disabling New Fields Bug</li>
|
101 |
+
<li>Fixed Timer Submitting Disabled Fields Bug</li>
|
102 |
</ul>
|
103 |
<h3>What's Coming Soon</h3>
|
104 |
<ul>
|
105 |
<li>Importing Questions</li>
|
|
|
106 |
<li>Stats For Each Quiz</li>
|
107 |
<li>Force Login/Register Option</li>
|
108 |
+
<li>Categories</li>
|
109 |
+
<li>More Social Media Integration</li>
|
110 |
</ul>
|
111 |
|
112 |
<div id="dialog" title="Help">
|
includes/mlw_quiz.php
CHANGED
@@ -148,7 +148,7 @@ function mlw_quiz_shortcode($atts)
|
|
148 |
//Calculate number of pages if pagination is turned on
|
149 |
if ($mlw_quiz_options->pagination != 0)
|
150 |
{
|
151 |
-
$mlw_qmn_section_limit = 2 +
|
152 |
if ($mlw_quiz_options->comment_section == 0)
|
153 |
{
|
154 |
$mlw_qmn_section_limit = $mlw_qmn_section_limit + 1;
|
@@ -166,44 +166,87 @@ function mlw_quiz_shortcode($atts)
|
|
166 |
var $j = jQuery.noConflict();
|
167 |
$j( ".quiz_section" ).hide();
|
168 |
$j( ".quiz_section" ).append( "<br />" );
|
169 |
-
$j( ".
|
170 |
-
$j( ".
|
171 |
window.mlw_quiz_slide = 0;
|
|
|
172 |
window.mlw_quiz_total_slides = <?php echo $mlw_qmn_section_limit; ?>;
|
173 |
-
nextSlide();
|
174 |
}, 100);
|
175 |
-
function nextSlide()
|
176 |
{
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
}
|
192 |
-
function prevSlide()
|
193 |
{
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
}
|
208 |
</script>
|
209 |
<?php
|
@@ -214,7 +257,15 @@ function mlw_quiz_shortcode($atts)
|
|
214 |
<div id="mlw_qmn_timer" class="mlw_qmn_timer"></div>
|
215 |
<script type="text/javascript">
|
216 |
setTimeout(function(){
|
217 |
-
var minutes =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
window.amount = (minutes*60);
|
219 |
window.titleText = window.document.title;
|
220 |
document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
|
@@ -223,13 +274,21 @@ function mlw_quiz_shortcode($atts)
|
|
223 |
function timer()
|
224 |
{
|
225 |
window.amount=window.amount-1;
|
|
|
|
|
|
|
|
|
|
|
226 |
document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
|
227 |
window.document.title = minToSec(window.amount) + " " + window.titleText;
|
228 |
if (window.amount <= 0)
|
229 |
{
|
230 |
clearInterval(window.counter);
|
231 |
-
jQuery( "input:radio" ).attr('disabled',true);
|
|
|
|
|
232 |
jQuery( ".mlw_qmn_question_comment" ).attr('disabled',true);
|
|
|
233 |
//document.quizForm.submit();
|
234 |
return;
|
235 |
}
|
@@ -341,10 +400,15 @@ function mlw_quiz_shortcode($atts)
|
|
341 |
return false;
|
342 |
}
|
343 |
}
|
|
|
|
|
|
|
|
|
|
|
344 |
}
|
345 |
</script>";
|
346 |
|
347 |
-
if ( $mlw_quiz_options->pagination
|
348 |
|
349 |
//Begin the quiz
|
350 |
$mlw_display .= "<div class='mlw_qmn_quiz'>";
|
@@ -546,7 +610,7 @@ function mlw_quiz_shortcode($atts)
|
|
546 |
}
|
547 |
else
|
548 |
{
|
549 |
-
$mlw_display .= "<input type='text' name='question".$mlw_question->question_id."' />";
|
550 |
$mlw_display .= "<br />";
|
551 |
}
|
552 |
if ($mlw_question->comments == 0)
|
@@ -581,6 +645,7 @@ function mlw_quiz_shortcode($atts)
|
|
581 |
$mlw_display .= "</div>";
|
582 |
if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br /><br />"; }
|
583 |
}
|
|
|
584 |
$mlw_qmn_section_count = $mlw_qmn_section_count + 1;
|
585 |
$mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count." quiz_end'>";
|
586 |
if ($mlw_quiz_options->message_end_template != '')
|
@@ -610,6 +675,11 @@ function mlw_quiz_shortcode($atts)
|
|
610 |
//Display Completion Screen
|
611 |
else
|
612 |
{
|
|
|
|
|
|
|
|
|
|
|
613 |
if (empty($mlw_spam_email) && $mlw_qmn_isAllowed)
|
614 |
{
|
615 |
|
@@ -686,7 +756,7 @@ function mlw_quiz_shortcode($atts)
|
|
686 |
if (htmlspecialchars(stripslashes($mlw_user_answer), ENT_QUOTES) == esc_attr($mlw_qmn_question_answers_each[0]))
|
687 |
{
|
688 |
$mlw_points += $mlw_qmn_question_answers_each[1];
|
689 |
-
$mlw_user_text .= strval($mlw_qmn_question_answers_each[0]);
|
690 |
if ($mlw_qmn_question_answers_each[2] == 1)
|
691 |
{
|
692 |
$mlw_correct += 1;
|
@@ -694,13 +764,13 @@ function mlw_quiz_shortcode($atts)
|
|
694 |
}
|
695 |
if ($mlw_qmn_question_answers_each[2] == 1)
|
696 |
{
|
697 |
-
$mlw_correct_text .= $mlw_qmn_question_answers_each[0];
|
698 |
}
|
699 |
}
|
700 |
}
|
701 |
elseif ( $mlw_question->question_type == 3 )
|
702 |
{
|
703 |
-
$mlw_correct_text .= strval($mlw_question->answer_one);
|
704 |
if (isset($_POST["question".$mlw_question->question_id]))
|
705 |
{
|
706 |
$mlw_user_answer = $_POST["question".$mlw_question->question_id];
|
@@ -709,7 +779,7 @@ function mlw_quiz_shortcode($atts)
|
|
709 |
{
|
710 |
$mlw_user_answer = " ";
|
711 |
}
|
712 |
-
$mlw_user_text .= strval($mlw_user_answer);
|
713 |
$mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id];
|
714 |
foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each)
|
715 |
{
|
@@ -733,7 +803,7 @@ function mlw_quiz_shortcode($atts)
|
|
733 |
if (isset($_POST["question".$mlw_question->question_id."_".$i]) && htmlspecialchars(stripslashes($_POST["question".$mlw_question->question_id."_".$i]), ENT_QUOTES) == esc_attr($mlw_qmn_question_answers_each[0]))
|
734 |
{
|
735 |
$mlw_points += $mlw_qmn_question_answers_each[1];
|
736 |
-
$mlw_user_text .= strval($mlw_qmn_question_answers_each[0]).".";
|
737 |
if ($mlw_qmn_question_answers_each[2] == 1)
|
738 |
{
|
739 |
$mlw_qmn_user_correct_answers += 1;
|
@@ -746,7 +816,7 @@ function mlw_quiz_shortcode($atts)
|
|
746 |
}
|
747 |
if ($mlw_qmn_question_answers_each[2] == 1)
|
748 |
{
|
749 |
-
$mlw_correct_text .= $mlw_qmn_question_answers_each[0].".";
|
750 |
$mlw_qmn_total_correct_answers++;
|
751 |
}
|
752 |
}
|
148 |
//Calculate number of pages if pagination is turned on
|
149 |
if ($mlw_quiz_options->pagination != 0)
|
150 |
{
|
151 |
+
$mlw_qmn_section_limit = 2 + count($mlw_questions);
|
152 |
if ($mlw_quiz_options->comment_section == 0)
|
153 |
{
|
154 |
$mlw_qmn_section_limit = $mlw_qmn_section_limit + 1;
|
166 |
var $j = jQuery.noConflict();
|
167 |
$j( ".quiz_section" ).hide();
|
168 |
$j( ".quiz_section" ).append( "<br />" );
|
169 |
+
$j( ".mlw_qmn_quiz" ).append( "<a class=\"mlw_qmn_quiz_link mlw_previous\" href=\"javascript:prevSlide(<?php echo $mlw_quiz_options->pagination; ?>);\"><?php echo $mlw_qmn_pagination_text[0]; ?></a>" );
|
170 |
+
$j( ".mlw_qmn_quiz" ).append( "<a class=\"mlw_qmn_quiz_link mlw_next\" href=\"javascript:nextSlide(<?php echo $mlw_quiz_options->pagination; ?>);\"><?php echo $mlw_qmn_pagination_text[1]; ?></a>" );
|
171 |
window.mlw_quiz_slide = 0;
|
172 |
+
window.mlw_previous = 0;
|
173 |
window.mlw_quiz_total_slides = <?php echo $mlw_qmn_section_limit; ?>;
|
174 |
+
nextSlide(1);
|
175 |
}, 100);
|
176 |
+
function nextSlide(mlw_pagination)
|
177 |
{
|
178 |
+
jQuery( ".quiz_section" ).hide();
|
179 |
+
for (var i = 0; i < mlw_pagination; i++)
|
180 |
+
{
|
181 |
+
if (i == 0 && window.mlw_previous == 1 && window.mlw_quiz_slide > 1)
|
182 |
+
{
|
183 |
+
window.mlw_quiz_slide = window.mlw_quiz_slide + mlw_pagination;
|
184 |
+
}
|
185 |
+
else
|
186 |
+
{
|
187 |
+
window.mlw_quiz_slide++;
|
188 |
+
}
|
189 |
+
if (window.mlw_quiz_slide < 1)
|
190 |
+
{
|
191 |
+
window.mlw_quiz_slide = 1;
|
192 |
+
}
|
193 |
+
if (window.mlw_quiz_slide == 1)
|
194 |
+
{
|
195 |
+
jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
|
196 |
+
}
|
197 |
+
if (window.mlw_quiz_slide > 1)
|
198 |
+
{
|
199 |
+
jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).show();
|
200 |
+
}
|
201 |
+
if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
|
202 |
+
{
|
203 |
+
jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
|
204 |
+
}
|
205 |
+
if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
|
206 |
+
{
|
207 |
+
jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
|
208 |
+
}
|
209 |
+
jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
|
210 |
+
}
|
211 |
+
window.mlw_previous = 0;
|
212 |
|
213 |
}
|
214 |
+
function prevSlide(mlw_pagination)
|
215 |
{
|
216 |
+
jQuery( ".quiz_section" ).hide();
|
217 |
+
for (var i = 0; i < mlw_pagination; i++)
|
218 |
+
{
|
219 |
+
if (i == 0 && window.mlw_previous == 0)
|
220 |
+
{
|
221 |
+
window.mlw_quiz_slide = window.mlw_quiz_slide - mlw_pagination;
|
222 |
+
}
|
223 |
+
else
|
224 |
+
{
|
225 |
+
window.mlw_quiz_slide--;
|
226 |
+
}
|
227 |
+
if (window.mlw_quiz_slide < 1)
|
228 |
+
{
|
229 |
+
window.mlw_quiz_slide = 1;
|
230 |
+
}
|
231 |
+
if (window.mlw_quiz_slide == 1)
|
232 |
+
{
|
233 |
+
jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
|
234 |
+
}
|
235 |
+
if (window.mlw_quiz_slide > 1)
|
236 |
+
{
|
237 |
+
jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).show();
|
238 |
+
}
|
239 |
+
if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
|
240 |
+
{
|
241 |
+
jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
|
242 |
+
}
|
243 |
+
if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
|
244 |
+
{
|
245 |
+
jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
|
246 |
+
}
|
247 |
+
jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
|
248 |
+
}
|
249 |
+
window.mlw_previous = 1;
|
250 |
}
|
251 |
</script>
|
252 |
<?php
|
257 |
<div id="mlw_qmn_timer" class="mlw_qmn_timer"></div>
|
258 |
<script type="text/javascript">
|
259 |
setTimeout(function(){
|
260 |
+
var minutes = 0;
|
261 |
+
if (window.sessionStorage.getItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>') >= 0)
|
262 |
+
{
|
263 |
+
minutes = window.sessionStorage.getItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>');
|
264 |
+
}
|
265 |
+
else
|
266 |
+
{
|
267 |
+
minutes = <?php echo $mlw_quiz_options->timer_limit; ?>;
|
268 |
+
}
|
269 |
window.amount = (minutes*60);
|
270 |
window.titleText = window.document.title;
|
271 |
document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
|
274 |
function timer()
|
275 |
{
|
276 |
window.amount=window.amount-1;
|
277 |
+
if (window.amount < 0)
|
278 |
+
{
|
279 |
+
window.amount = 0;
|
280 |
+
}
|
281 |
+
window.sessionStorage.setItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>', window.amount/60);
|
282 |
document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
|
283 |
window.document.title = minToSec(window.amount) + " " + window.titleText;
|
284 |
if (window.amount <= 0)
|
285 |
{
|
286 |
clearInterval(window.counter);
|
287 |
+
jQuery( ".mlw_qmn_quiz input:radio" ).attr('disabled',true);
|
288 |
+
jQuery( ".mlw_qmn_quiz input:checkbox" ).attr('disabled',true);
|
289 |
+
jQuery( ".mlw_qmn_quiz select" ).attr('disabled',true);
|
290 |
jQuery( ".mlw_qmn_question_comment" ).attr('disabled',true);
|
291 |
+
jQuery( ".mlw_answer_open_text" ).attr('disabled',true);
|
292 |
//document.quizForm.submit();
|
293 |
return;
|
294 |
}
|
400 |
return false;
|
401 |
}
|
402 |
}
|
403 |
+
jQuery( '.mlw_qmn_quiz input:radio' ).attr('disabled',false);
|
404 |
+
jQuery( '.mlw_qmn_quiz input:checkbox' ).attr('disabled',false);
|
405 |
+
jQuery( '.mlw_qmn_quiz select' ).attr('disabled',false);
|
406 |
+
jQuery( '.mlw_qmn_question_comment' ).attr('disabled',false);
|
407 |
+
jQuery( '.mlw_answer_open_text' ).attr('disabled',false);
|
408 |
}
|
409 |
</script>";
|
410 |
|
411 |
+
if ( $mlw_quiz_options->pagination != 0) { $mlw_display .= "<style>.quiz_section { display: none; }</style>"; }
|
412 |
|
413 |
//Begin the quiz
|
414 |
$mlw_display .= "<div class='mlw_qmn_quiz'>";
|
610 |
}
|
611 |
else
|
612 |
{
|
613 |
+
$mlw_display .= "<input type='text' class='mlw_answer_open_text' name='question".$mlw_question->question_id."' />";
|
614 |
$mlw_display .= "<br />";
|
615 |
}
|
616 |
if ($mlw_question->comments == 0)
|
645 |
$mlw_display .= "</div>";
|
646 |
if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br /><br />"; }
|
647 |
}
|
648 |
+
$mlw_display .= "<br />";
|
649 |
$mlw_qmn_section_count = $mlw_qmn_section_count + 1;
|
650 |
$mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count." quiz_end'>";
|
651 |
if ($mlw_quiz_options->message_end_template != '')
|
675 |
//Display Completion Screen
|
676 |
else
|
677 |
{
|
678 |
+
?>
|
679 |
+
<script>
|
680 |
+
window.sessionStorage.setItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>', 'completed');
|
681 |
+
</script>
|
682 |
+
<?php
|
683 |
if (empty($mlw_spam_email) && $mlw_qmn_isAllowed)
|
684 |
{
|
685 |
|
756 |
if (htmlspecialchars(stripslashes($mlw_user_answer), ENT_QUOTES) == esc_attr($mlw_qmn_question_answers_each[0]))
|
757 |
{
|
758 |
$mlw_points += $mlw_qmn_question_answers_each[1];
|
759 |
+
$mlw_user_text .= strval(htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES));
|
760 |
if ($mlw_qmn_question_answers_each[2] == 1)
|
761 |
{
|
762 |
$mlw_correct += 1;
|
764 |
}
|
765 |
if ($mlw_qmn_question_answers_each[2] == 1)
|
766 |
{
|
767 |
+
$mlw_correct_text .= htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES);
|
768 |
}
|
769 |
}
|
770 |
}
|
771 |
elseif ( $mlw_question->question_type == 3 )
|
772 |
{
|
773 |
+
$mlw_correct_text .= strval(htmlspecialchars_decode($mlw_question->answer_one, ENT_QUOTES));
|
774 |
if (isset($_POST["question".$mlw_question->question_id]))
|
775 |
{
|
776 |
$mlw_user_answer = $_POST["question".$mlw_question->question_id];
|
779 |
{
|
780 |
$mlw_user_answer = " ";
|
781 |
}
|
782 |
+
$mlw_user_text .= strval(htmlspecialchars_decode($mlw_user_answer, ENT_QUOTES));
|
783 |
$mlw_qmn_question_answers_array = $mlw_qmn_loaded_answer_arrays[$mlw_question->question_id];
|
784 |
foreach($mlw_qmn_question_answers_array as $mlw_qmn_question_answers_each)
|
785 |
{
|
803 |
if (isset($_POST["question".$mlw_question->question_id."_".$i]) && htmlspecialchars(stripslashes($_POST["question".$mlw_question->question_id."_".$i]), ENT_QUOTES) == esc_attr($mlw_qmn_question_answers_each[0]))
|
804 |
{
|
805 |
$mlw_points += $mlw_qmn_question_answers_each[1];
|
806 |
+
$mlw_user_text .= strval(htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES)).".";
|
807 |
if ($mlw_qmn_question_answers_each[2] == 1)
|
808 |
{
|
809 |
$mlw_qmn_user_correct_answers += 1;
|
816 |
}
|
817 |
if ($mlw_qmn_question_answers_each[2] == 1)
|
818 |
{
|
819 |
+
$mlw_correct_text .= htmlspecialchars_decode($mlw_qmn_question_answers_each[0], ENT_QUOTES).".";
|
820 |
$mlw_qmn_total_correct_answers++;
|
821 |
}
|
822 |
}
|
includes/mlw_quiz_options.php
CHANGED
@@ -453,10 +453,10 @@ function mlw_generate_quiz_options()
|
|
453 |
}
|
454 |
|
455 |
/*
|
456 |
-
Code For Quiz
|
457 |
*/
|
458 |
|
459 |
-
//Check to add new
|
460 |
if (isset($_POST["mlw_add_landing_page"]) && $_POST["mlw_add_landing_page"] == "confirmation")
|
461 |
{
|
462 |
//Function variables
|
@@ -1069,7 +1069,7 @@ function mlw_generate_quiz_options()
|
|
1069 |
?>
|
1070 |
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
|
1071 |
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
|
1072 |
-
<strong>Success!</strong> A new
|
1073 |
</div>
|
1074 |
<?php
|
1075 |
}
|
@@ -1078,7 +1078,7 @@ function mlw_generate_quiz_options()
|
|
1078 |
?>
|
1079 |
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
|
1080 |
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
|
1081 |
-
<strong>Success!</strong> The
|
1082 |
</div>
|
1083 |
<?php
|
1084 |
}
|
@@ -1516,7 +1516,7 @@ function mlw_generate_quiz_options()
|
|
1516 |
<p style="margin: 2px 0">- %TIMER%</p>
|
1517 |
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1518 |
</td>
|
1519 |
-
<td>Now you can have different
|
1520 |
</td>
|
1521 |
</tr>
|
1522 |
<tr>
|
@@ -1633,11 +1633,10 @@ function mlw_generate_quiz_options()
|
|
1633 |
</div></td>
|
1634 |
</tr>
|
1635 |
<tr valign="top">
|
1636 |
-
<th scope="row"><label for="pagination">
|
1637 |
-
<td
|
1638 |
-
|
1639 |
-
|
1640 |
-
</div></td>
|
1641 |
</tr>
|
1642 |
<tr valign="top">
|
1643 |
<th scope="row"><label for="timer_limit">How many minutes does the user have to finish the quiz? (Leave 0 for no time limit)</label></th>
|
@@ -2071,8 +2070,8 @@ function mlw_generate_quiz_options()
|
|
2071 |
<td><strong>%CERTIFICATE_LINK%</strong> - The link to the certificate after completing the quiz</td>
|
2072 |
</tr>
|
2073 |
</table>
|
2074 |
-
<button id="save_landing_button" onclick="javascript: document.mlw_quiz_save_landing_form.submit();">Save
|
2075 |
-
<button id="new_landing_button" onclick="javascript: document.mlw_quiz_add_landing_form.submit();">Add New
|
2076 |
<button id="landing_page_help">Help</button>
|
2077 |
<form method="post" action="" name="mlw_quiz_save_landing_form" style=" display:inline!important;">
|
2078 |
<table class="widefat">
|
@@ -2081,7 +2080,7 @@ function mlw_generate_quiz_options()
|
|
2081 |
<th>ID</th>
|
2082 |
<th>Score Greater Than</th>
|
2083 |
<th>Score Less Than</th>
|
2084 |
-
<th>
|
2085 |
</tr>
|
2086 |
</thead>
|
2087 |
<tbody>
|
@@ -2136,19 +2135,19 @@ function mlw_generate_quiz_options()
|
|
2136 |
<th>ID</th>
|
2137 |
<th>Score Greater Than</th>
|
2138 |
<th>Score Less Than</th>
|
2139 |
-
<th>
|
2140 |
</tr>
|
2141 |
</tfoot>
|
2142 |
</table>
|
2143 |
<input type='hidden' name='mlw_save_landing_pages' value='confirmation' />
|
2144 |
<input type='hidden' name='mlw_landing_quiz_id' value='<?php echo $quiz_id; ?>' />
|
2145 |
<input type='hidden' name='mlw_landing_page_total' value='<?php echo $mlw_each_count; ?>' />
|
2146 |
-
<button id="save_landing_button" onclick="javascript: document.mlw_quiz_save_landing_form.submit();">Save
|
2147 |
</form>
|
2148 |
<form method="post" action="" name="mlw_quiz_add_landing_form" style=" display:inline!important;">
|
2149 |
<input type='hidden' name='mlw_add_landing_page' value='confirmation' />
|
2150 |
<input type='hidden' name='mlw_add_landing_quiz_id' value='<?php echo $quiz_id; ?>' />
|
2151 |
-
<button id="new_landing_button" onclick="javascript: document.mlw_quiz_add_landing_form.submit();">Add New
|
2152 |
</form>
|
2153 |
</div>
|
2154 |
<div id="tabs-7">
|
@@ -2302,11 +2301,11 @@ function mlw_generate_quiz_options()
|
|
2302 |
|
2303 |
<div id="landing_page_help_dialog" title="Help" style="display: none;">
|
2304 |
<h3><b>Help</b></h3>
|
2305 |
-
<p>This page allows you to add, edit, and delete
|
2306 |
-
<p>You can have unlimited different
|
2307 |
-
<p>If you only need the one
|
2308 |
-
<p>To add a new
|
2309 |
-
<p>For your extra pages, you must designate what score the user must be above and what score the user must be below to see the page. If the user does not fall into any, the default page will be
|
2310 |
<p>Be sure to save after any changes are made!</p>
|
2311 |
</div>
|
2312 |
|
453 |
}
|
454 |
|
455 |
/*
|
456 |
+
Code For Quiz Results Page Tab
|
457 |
*/
|
458 |
|
459 |
+
//Check to add new results page
|
460 |
if (isset($_POST["mlw_add_landing_page"]) && $_POST["mlw_add_landing_page"] == "confirmation")
|
461 |
{
|
462 |
//Function variables
|
1069 |
?>
|
1070 |
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
|
1071 |
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
|
1072 |
+
<strong>Success!</strong> A new results page has been added successfully!</p>
|
1073 |
</div>
|
1074 |
<?php
|
1075 |
}
|
1078 |
?>
|
1079 |
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
|
1080 |
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
|
1081 |
+
<strong>Success!</strong> The results pages have been saved successfully!</p>
|
1082 |
</div>
|
1083 |
<?php
|
1084 |
}
|
1516 |
<p style="margin: 2px 0">- %TIMER%</p>
|
1517 |
<p style="margin: 2px 0">- %CURRENT_DATE%</p>
|
1518 |
</td>
|
1519 |
+
<td>Now you can have different results pages based on the user score! This field is now edited on the Quiz Results Page tab.
|
1520 |
</td>
|
1521 |
</tr>
|
1522 |
<tr>
|
1633 |
</div></td>
|
1634 |
</tr>
|
1635 |
<tr valign="top">
|
1636 |
+
<th scope="row"><label for="pagination">How many questions per page would you like? (Leave 0 for all questions on one page)</label></th>
|
1637 |
+
<td>
|
1638 |
+
<input type="number" step="1" min="0" max="1000" name="pagination" value="<?php echo $mlw_quiz_options->pagination; ?>" class="regular-text" />
|
1639 |
+
</td>
|
|
|
1640 |
</tr>
|
1641 |
<tr valign="top">
|
1642 |
<th scope="row"><label for="timer_limit">How many minutes does the user have to finish the quiz? (Leave 0 for no time limit)</label></th>
|
2070 |
<td><strong>%CERTIFICATE_LINK%</strong> - The link to the certificate after completing the quiz</td>
|
2071 |
</tr>
|
2072 |
</table>
|
2073 |
+
<button id="save_landing_button" onclick="javascript: document.mlw_quiz_save_landing_form.submit();">Save Results Pages</button>
|
2074 |
+
<button id="new_landing_button" onclick="javascript: document.mlw_quiz_add_landing_form.submit();">Add New Results Page</button>
|
2075 |
<button id="landing_page_help">Help</button>
|
2076 |
<form method="post" action="" name="mlw_quiz_save_landing_form" style=" display:inline!important;">
|
2077 |
<table class="widefat">
|
2080 |
<th>ID</th>
|
2081 |
<th>Score Greater Than</th>
|
2082 |
<th>Score Less Than</th>
|
2083 |
+
<th>Results Page Shown</th>
|
2084 |
</tr>
|
2085 |
</thead>
|
2086 |
<tbody>
|
2135 |
<th>ID</th>
|
2136 |
<th>Score Greater Than</th>
|
2137 |
<th>Score Less Than</th>
|
2138 |
+
<th>Results Page Shown</th>
|
2139 |
</tr>
|
2140 |
</tfoot>
|
2141 |
</table>
|
2142 |
<input type='hidden' name='mlw_save_landing_pages' value='confirmation' />
|
2143 |
<input type='hidden' name='mlw_landing_quiz_id' value='<?php echo $quiz_id; ?>' />
|
2144 |
<input type='hidden' name='mlw_landing_page_total' value='<?php echo $mlw_each_count; ?>' />
|
2145 |
+
<button id="save_landing_button" onclick="javascript: document.mlw_quiz_save_landing_form.submit();">Save Results Pages</button>
|
2146 |
</form>
|
2147 |
<form method="post" action="" name="mlw_quiz_add_landing_form" style=" display:inline!important;">
|
2148 |
<input type='hidden' name='mlw_add_landing_page' value='confirmation' />
|
2149 |
<input type='hidden' name='mlw_add_landing_quiz_id' value='<?php echo $quiz_id; ?>' />
|
2150 |
+
<button id="new_landing_button" onclick="javascript: document.mlw_quiz_add_landing_form.submit();">Add New Results Page</button>
|
2151 |
</form>
|
2152 |
</div>
|
2153 |
<div id="tabs-7">
|
2301 |
|
2302 |
<div id="landing_page_help_dialog" title="Help" style="display: none;">
|
2303 |
<h3><b>Help</b></h3>
|
2304 |
+
<p>This page allows you to add, edit, and delete results pages for your quiz!</p>
|
2305 |
+
<p>You can have unlimited different results pages to show the user after he or she takes the quiz. For example, you can have a page shown if they pass, and then show the default if they fail.</p>
|
2306 |
+
<p>If you only need the one results page, leave just the default and edit it and then click the Save button.</p>
|
2307 |
+
<p>To add a new results page, click Add New Results Page. A new section will appear with the new page.</p>
|
2308 |
+
<p>For your extra pages, you must designate what score the user must be above and what score the user must be below to see the page. If the user does not fall into any, the default page will be shown.</p>
|
2309 |
<p>Be sure to save after any changes are made!</p>
|
2310 |
</div>
|
2311 |
|
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 = "2.
|
10 |
if ( ! get_option('mlw_quiz_master_version'))
|
11 |
{
|
12 |
add_option('mlw_quiz_master_version' , $data);
|
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 = "2.7.1";
|
10 |
if ( ! get_option('mlw_quiz_master_version'))
|
11 |
{
|
12 |
add_option('mlw_quiz_master_version' , $data);
|
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: 2.
|
7 |
Author: Frank Corso
|
8 |
Author URI: http://www.mylocalwebstop.com/
|
9 |
Plugin URI: http://www.mylocalwebstop.com/
|
3 |
/*
|
4 |
Plugin Name: Quiz Master Next
|
5 |
Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
|
6 |
+
Version: 2.7.1
|
7 |
Author: Frank Corso
|
8 |
Author URI: http://www.mylocalwebstop.com/
|
9 |
Plugin URI: http://www.mylocalwebstop.com/
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: fpcorso
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RTGYAETX36ZQJ
|
4 |
Tags: quiz, test, score, survey, contact, form, email, answer, question
|
5 |
-
Requires at least: 3.
|
6 |
Tested up to: 3.9.1
|
7 |
-
Stable tag: 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.
|
@@ -29,7 +29,7 @@ Each quiz can have **unlimited** results pages that can be customized with your
|
|
29 |
After the user takes a quiz, you can have the plugin email you and the user with results. This too can be customized with your own text.
|
30 |
|
31 |
= Very Flexible =
|
32 |
-
Your quiz can be graded with an incorrect/correct system or a points-based system. Or not at all. You ask for contact information at the beginning or the end and you decide which fields are required. You can decide to use all the questions or only a select few chosen at random.
|
33 |
|
34 |
= Useful For Businesses =
|
35 |
The plugin features useful **statistics** that show how many times each quiz has been viewed and taken and plots the data on several different **graphs** so you can see how the quizzes are doing at a glance. Also, the plugin includes an **audit trail** that logs every action done on the admin side so you can keep up with who is doing what!
|
@@ -103,6 +103,12 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
|
|
103 |
|
104 |
== Changelog ==
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
= 2.6.4 (May 12, 2014) =
|
107 |
* Bug Fixes
|
108 |
|
@@ -441,6 +447,9 @@ Feel free to use the widget on the quiz dashboard within the plugin or from the
|
|
441 |
|
442 |
== Upgrade Notice ==
|
443 |
|
|
|
|
|
|
|
444 |
= 2.6.4 =
|
445 |
Upgrade for bug fixes.
|
446 |
|
2 |
Contributors: fpcorso
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RTGYAETX36ZQJ
|
4 |
Tags: quiz, test, score, survey, contact, form, email, answer, question
|
5 |
+
Requires at least: 3.5.1
|
6 |
Tested up to: 3.9.1
|
7 |
+
Stable tag: 2.7.1
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
The easiest and most flexible way to add multiple quizzes, tests, and surveys to your website.
|
29 |
After the user takes a quiz, you can have the plugin email you and the user with results. This too can be customized with your own text.
|
30 |
|
31 |
= Very Flexible =
|
32 |
+
Your quiz can be graded with an incorrect/correct system or a points-based system. Or not at all. You ask for contact information at the beginning or the end and you decide which contact fields are required. You can decide to use all the questions or only a select few chosen at random. You can also set the number of questions per page or have all the questions on one page.
|
33 |
|
34 |
= Useful For Businesses =
|
35 |
The plugin features useful **statistics** that show how many times each quiz has been viewed and taken and plots the data on several different **graphs** so you can see how the quizzes are doing at a glance. Also, the plugin includes an **audit trail** that logs every action done on the admin side so you can keep up with who is doing what!
|
103 |
|
104 |
== Changelog ==
|
105 |
|
106 |
+
= 2.7.1 (May 16, 2014) =
|
107 |
+
* Added Ability To Set Number Of Question Per Page
|
108 |
+
* Fixed HTML Not Showing On Results Page Bug
|
109 |
+
* Fixed Timer Not Disabling New Fields Bug
|
110 |
+
* Fixed Timer Submitting Disabled Fields Bug
|
111 |
+
|
112 |
= 2.6.4 (May 12, 2014) =
|
113 |
* Bug Fixes
|
114 |
|
447 |
|
448 |
== Upgrade Notice ==
|
449 |
|
450 |
+
= 2.7.1 =
|
451 |
+
Upgrade to have the ability to set number of questions per page and more bug fixes.
|
452 |
+
|
453 |
= 2.6.4 =
|
454 |
Upgrade for bug fixes.
|
455 |
|