Quiz And Survey Master (Formerly Quiz Master Next) - Version 3.9.0

Version Description

Upgrade for new editors on text tab and many more changes.

Download this release

Release Info

Developer fpcorso
Plugin Icon 128x128 Quiz And Survey Master (Formerly Quiz Master Next)
Version 3.9.0
Comparing to
See all releases

Code changes from version 3.8.2 to 3.9.0

includes/mlw_qmn_credits.php CHANGED
@@ -87,24 +87,15 @@ function mlw_generate_about_page()
87
  <div class="mlw_qmn_icon_wrap">Version <?php echo $mlw_quiz_version; ?></div>
88
  <h2 class="nav-tab-wrapper">
89
  <a href="javascript:mlw_qmn_setTab(1);" id="mlw_qmn_tab_1" class="nav-tab nav-tab-active">
90
- What&#8217;s New In 3.8</a>
91
  <a href="javascript:mlw_qmn_setTab(2);" id="mlw_qmn_tab_2" class="nav-tab">
92
  Changelog For <?php echo $mlw_quiz_version; ?> </a>
93
  <a href="javascript:mlw_qmn_setTab(3);" id="mlw_qmn_tab_3" class="nav-tab">
94
  Requested Features</a>
95
  </h2>
96
  <div id="mlw_quiz_what_new">
97
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Ability To Send Different Admin Emails Based On Score</h2>
98
- <p style="text-align: center;">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.</p>
99
- <br />
100
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Dashboard Widget</h2>
101
- <p style="text-align: center;">We added a new dashboard widget that shows a snapshot of how your quizzes are doing. Includes daily total, most popular quiz, and more.</p>
102
- <br />
103
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Help Page</h2>
104
- <p style="text-align: center;">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.</p>
105
- <br />
106
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">For Developers:</h2>
107
- <p style="text-align: center;">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.</p>
108
  <br />
109
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Please Take Our Survey To Better Improve This Plugin</h2>
110
  <p style="text-align: center;">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 <a href='http://mylocalwebstop.com/quiz-master-next-survey/'>take our survey</a>.</p>
@@ -112,13 +103,15 @@ function mlw_generate_about_page()
112
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">We Are On GitHub Now</h2>
113
  <p style="text-align: center;">We have had several users ask for this so we thought we would try it out. We now love github! Be sure to <a href="https://github.com/fpcorso/quiz_master_next/">make suggestions or contribute</a>.</p>
114
  <br />
115
- <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Popular Add-on Pack</h2>
116
- <p style="text-align: center;">Our Popular Add-On Pack is now only $45 for 6 add-ons! Now is the time to save almost 50%! Visit our <a href="http://mylocalwebstop.com/store/">WordPress Store</a> for details.</p>
117
  </div>
118
  <div id="mlw_quiz_changelog" style="display: none;">
119
- <h3><?php echo $mlw_quiz_version; ?> (December 21, 2014)</h3>
120
  <ul>
121
- <li>* Minor Design Changes</li>
 
 
 
 
122
  </ul>
123
  </div>
124
  <div id="mlw_quiz_requested" style="display: none;">
87
  <div class="mlw_qmn_icon_wrap">Version <?php echo $mlw_quiz_version; ?></div>
88
  <h2 class="nav-tab-wrapper">
89
  <a href="javascript:mlw_qmn_setTab(1);" id="mlw_qmn_tab_1" class="nav-tab nav-tab-active">
90
+ What&#8217;s New In 3.9</a>
91
  <a href="javascript:mlw_qmn_setTab(2);" id="mlw_qmn_tab_2" class="nav-tab">
92
  Changelog For <?php echo $mlw_quiz_version; ?> </a>
93
  <a href="javascript:mlw_qmn_setTab(3);" id="mlw_qmn_tab_3" class="nav-tab">
94
  Requested Features</a>
95
  </h2>
96
  <div id="mlw_quiz_what_new">
97
+ <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">New Text Editors On Text Tab</h2>
98
+ <p style="text-align: center;">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.</p>
 
 
 
 
 
 
 
 
 
99
  <br />
100
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">Please Take Our Survey To Better Improve This Plugin</h2>
101
  <p style="text-align: center;">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 <a href='http://mylocalwebstop.com/quiz-master-next-survey/'>take our survey</a>.</p>
103
  <h2 style="margin: 1.1em 0 .2em;font-size: 2.4em;font-weight: 300;line-height: 1.3;text-align: center;">We Are On GitHub Now</h2>
104
  <p style="text-align: center;">We have had several users ask for this so we thought we would try it out. We now love github! Be sure to <a href="https://github.com/fpcorso/quiz_master_next/">make suggestions or contribute</a>.</p>
105
  <br />
 
 
106
  </div>
107
  <div id="mlw_quiz_changelog" style="display: none;">
108
+ <h3><?php echo $mlw_quiz_version; ?> (December 30, 2014)</h3>
109
  <ul>
110
+ <li>* Added Wp Editor To Text Tab</li>
111
+ <li>* Added Weekly Stats To Snapshot Widget</li>
112
+ <li>* Moved Email Settings To Emails Tab</li>
113
+ <li>* Default Question Order Auto-increments For New Questions</li>
114
+ <li>* In Code: Separated CSS/JS From Core Quiz PHP File</li>
115
  </ul>
116
  </div>
117
  <div id="mlw_quiz_requested" style="display: none;">
includes/mlw_quiz.php CHANGED
@@ -140,56 +140,21 @@ function mlw_quiz_shortcode($atts)
140
  wp_enqueue_script( 'jquery-effects-slide' );
141
  wp_enqueue_script( 'jquery-ui-dialog' );
142
  wp_enqueue_script( 'jquery-ui-button' );
143
- wp_enqueue_script( 'jquery-ui-accordion' );
144
  wp_enqueue_script( 'jquery-ui-tooltip' );
145
- wp_enqueue_script( 'jquery-ui-tabs' );
146
- ?>
147
- <script type="text/javascript"
148
- src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
149
- </script>
150
- <!-- css -->
151
- <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" />
152
- <script type="text/javascript">
153
- setTimeout(function(){
154
- var $j = jQuery.noConflict();
155
- // increase the default animation speed to exaggerate the effect
156
- $j.fx.speeds._default = 1000;
157
- $j(function() {
158
- $j( ".mlw_qmn_quiz" ).tooltip();
159
- });
160
- }, 100);
161
- setTimeout(function()
162
- {
163
- var $j = jQuery.noConflict();
164
- $j('.mlw_qmn_quiz input').on('keypress', function (e) {
165
- if (e.which === 13) {
166
- e.preventDefault();
167
- }
168
- });
169
- }, 100);
170
- </script>
171
- <style type="text/css">
172
- .ui-tooltip
173
- {
174
- /* tooltip container box */
175
- max-width: 500px !important;
176
- }
177
- .ui-tooltip-content
178
- {
179
- /* tooltip content */
180
- max-width: 500px !important;
181
- }
182
- </style>
183
 
184
- <?php
185
- if ($mlw_quiz_options->theme_selected == "default")
186
- {
187
- echo "<style type='text/css'>".$mlw_quiz_options->quiz_stye."</style>";
188
- }
189
- else
190
- {
191
- echo "<link type='text/css' href='".get_option('mlw_qmn_theme_'.$mlw_quiz_options->theme_selected)."' rel='stylesheet' />";
192
- }
193
 
194
  /*
195
  The following code is for displaying the quiz and completion screen
@@ -242,285 +207,32 @@ function mlw_quiz_shortcode($atts)
242
  }
243
  ?>
244
  <script type="text/javascript">
245
- setTimeout(function(){
246
- var $j = jQuery.noConflict();
247
- $j( ".quiz_section" ).hide();
248
- $j( ".quiz_section" ).append( "<br />" );
249
- $j( ".mlw_qmn_quiz" ).append( "<a class=\"mlw_qmn_quiz_link mlw_previous\" href=\"javascript:prevSlide(<?php echo $mlw_quiz_options->pagination; ?>, 1);\"><?php echo $mlw_qmn_pagination_text[0]; ?></a>" );
250
- $j( ".mlw_qmn_quiz" ).append( "<a class=\"mlw_qmn_quiz_link mlw_next\" href=\"javascript:nextSlide(<?php echo $mlw_quiz_options->pagination; ?>, 1);\"><?php echo $mlw_qmn_pagination_text[1]; ?></a>" );
251
- window.mlw_quiz_slide = 0;
252
- window.mlw_previous = 0;
253
- window.mlw_quiz_total_slides = <?php echo $mlw_qmn_section_limit; ?>;
254
- nextSlide(1, 0);
255
- }, 100);
256
- function nextSlide(mlw_pagination, mlw_goto_top)
257
- {
258
- jQuery( ".quiz_section" ).hide();
259
- for (var i = 0; i < mlw_pagination; i++)
260
- {
261
- if (i == 0 && window.mlw_previous == 1 && window.mlw_quiz_slide > 1)
262
- {
263
- window.mlw_quiz_slide = window.mlw_quiz_slide + mlw_pagination;
264
- }
265
- else
266
- {
267
- window.mlw_quiz_slide++;
268
- }
269
- if (window.mlw_quiz_slide < 1)
270
- {
271
- window.mlw_quiz_slide = 1;
272
- }
273
- if (window.mlw_quiz_slide == 1)
274
- {
275
- jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
276
- }
277
- if (window.mlw_quiz_slide > 1)
278
- {
279
- jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).show();
280
- }
281
- if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
282
- {
283
- jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
284
- }
285
- if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
286
- {
287
- jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
288
- }
289
- jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
290
- }
291
- window.mlw_previous = 0;
292
- if (mlw_goto_top == 1)
293
- {
294
- window.location.hash = "mlw_does_not_exist";
295
- window.location.hash = "mlw_top_of_quiz";
296
- }
297
-
298
- }
299
- function prevSlide(mlw_pagination, mlw_goto_top)
300
- {
301
- jQuery( ".quiz_section" ).hide();
302
- for (var i = 0; i < mlw_pagination; i++)
303
- {
304
- if (i == 0 && window.mlw_previous == 0)
305
- {
306
- window.mlw_quiz_slide = window.mlw_quiz_slide - mlw_pagination;
307
- }
308
- else
309
- {
310
- window.mlw_quiz_slide--;
311
- }
312
- if (window.mlw_quiz_slide < 1)
313
- {
314
- window.mlw_quiz_slide = 1;
315
- }
316
- if (window.mlw_quiz_slide == 1)
317
- {
318
- jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).hide();
319
- }
320
- if (window.mlw_quiz_slide > 1)
321
- {
322
- jQuery( ".mlw_qmn_quiz_link.mlw_previous" ).show();
323
- }
324
- if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
325
- {
326
- jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
327
- }
328
- if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
329
- {
330
- jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
331
- }
332
- jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
333
- }
334
- window.mlw_previous = 1;
335
- if (mlw_goto_top == 1)
336
- {
337
- window.location.hash = "mlw_does_not_exist";
338
- window.location.hash = "mlw_top_of_quiz";
339
- }
340
- }
341
  </script>
342
  <?php
 
343
  }
344
  if ($mlw_quiz_options->timer_limit != 0)
345
  {
346
  ?>
347
  <div id="mlw_qmn_timer" class="mlw_qmn_timer"></div>
348
  <script type="text/javascript">
349
- setTimeout(function(){
350
- var minutes = 0;
351
- if (window.sessionStorage.getItem('mlw_started_quiz<?php echo $mlw_quiz_id; ?>') == "yes" && window.sessionStorage.getItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>') >= 0)
352
- {
353
- minutes = window.sessionStorage.getItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>');
354
- }
355
- else
356
- {
357
- minutes = <?php echo $mlw_quiz_options->timer_limit; ?>;
358
- }
359
- window.amount = (minutes*60);
360
- window.titleText = window.document.title;
361
- document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
362
- window.counter=setInterval(timer, 1000);
363
- }, 100);
364
- function timer()
365
- {
366
- window.amount=window.amount-1;
367
- if (window.amount < 0)
368
- {
369
- window.amount = 0;
370
- }
371
- window.sessionStorage.setItem('mlw_time_quiz<?php echo $mlw_quiz_id; ?>', window.amount/60);
372
- window.sessionStorage.setItem('mlw_started_quiz<?php echo $mlw_quiz_id; ?>', "yes");
373
- document.getElementById("mlw_qmn_timer").innerHTML = minToSec(window.amount);
374
- window.document.title = minToSec(window.amount) + " " + window.titleText;
375
- if (window.amount <= 0)
376
- {
377
- clearInterval(window.counter);
378
- jQuery( ".mlw_qmn_quiz input:radio" ).attr('disabled',true);
379
- jQuery( ".mlw_qmn_quiz input:checkbox" ).attr('disabled',true);
380
- jQuery( ".mlw_qmn_quiz select" ).attr('disabled',true);
381
- jQuery( ".mlw_qmn_question_comment" ).attr('disabled',true);
382
- jQuery( ".mlw_answer_open_text" ).attr('disabled',true);
383
- //document.quizForm.submit();
384
- return;
385
- }
386
- }
387
- function minToSec(amount)
388
- {
389
- var timer_display = '';
390
- var hours = Math.floor(amount/3600);
391
- if (hours == '0')
392
- {
393
- timer_display = timer_display +"00:";
394
- }
395
- else if (hours < 10)
396
- {
397
- timer_display = timer_display + '0' + hours + ":";
398
- }
399
- else
400
- {
401
- timer_display = timer_display + hours + ":";
402
- }
403
- var minutes = Math.floor((amount % 3600)/60);
404
- if (minutes == '0')
405
- {
406
- timer_display = timer_display +"00:";
407
- }
408
- else if (minutes < 10)
409
- {
410
- timer_display = timer_display + '0' + minutes + ":";
411
- }
412
- else
413
- {
414
- timer_display = timer_display + minutes + ":";
415
- }
416
- var seconds = Math.floor(amount % 60);
417
- if (seconds == '0')
418
- {
419
- timer_display = timer_display +"00";
420
- }
421
- else if (seconds < 10)
422
- {
423
- timer_display = timer_display +'0' + seconds;
424
- }
425
- else
426
- {
427
- timer_display = timer_display + seconds;
428
- }
429
- return timer_display;
430
- }
431
  </script>
432
  <?php
 
433
  }
434
 
435
- ?>
436
- <script type="text/javascript">
437
- var myVar=setInterval("mlwQmnTimer();",1000);
438
- function mlwQmnTimer()
439
- {
440
- var x = +document.getElementById("timer").value;
441
- x = x + 1;
442
- document.getElementById("timer").value = x;
443
- }
444
-
445
- </script>
446
- <?php
447
  //Update the quiz views
448
  $mlw_views = $mlw_quiz_options->quiz_views;
449
  $mlw_views += 1;
450
  $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views='".$mlw_views."' WHERE quiz_id=".$mlw_quiz_id;
451
  $results = $wpdb->query( $update );
452
 
453
- //Form validation script
454
- ?>
455
- <script>
456
- function clear_field(field)
457
- {
458
- if (field.defaultValue == field.value) field.value = '';
459
- }
460
-
461
- function mlw_validateForm()
462
- {
463
- mlw_validateResult = true;
464
-
465
- jQuery('#quizForm *').filter(':input').each(function(){
466
- jQuery(this).css("outline", "");
467
- if (jQuery(this).attr('class'))
468
- {
469
- if(jQuery(this).attr('class').indexOf('mlwEmail') > -1 && this.value != "")
470
- {
471
- var x=this.value;
472
- var atpos=x.indexOf('@');
473
- var dotpos=x.lastIndexOf('.');
474
- if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
475
- {
476
- document.getElementById('mlw_error_message').innerHTML = '**Not a valid e-mail address!**';
477
- document.getElementById('mlw_error_message_bottom').innerHTML = '**Not a valid e-mail address!**';
478
- mlw_validateResult = false;
479
- jQuery(this).css("outline", "2px solid red");
480
- }
481
- }
482
- if(jQuery(this).attr('class').indexOf('mlwRequiredNumber') > -1 && this.value == "" && +this.value != NaN)
483
- {
484
- document.getElementById('mlw_error_message').innerHTML = '**This field must be a number!**';
485
- document.getElementById('mlw_error_message_bottom').innerHTML = '**This field must be a number!**';
486
- jQuery(this).css("outline", "2px solid red");
487
- mlw_validateResult = false;
488
- }
489
- if(jQuery(this).attr('class').indexOf('mlwRequiredText') > -1 && this.value == "")
490
- {
491
- document.getElementById('mlw_error_message').innerHTML = '**Please complete all required fields!**';
492
- document.getElementById('mlw_error_message_bottom').innerHTML = '**Please complete all required fields!**';
493
- jQuery(this).css("outline", "2px solid red");
494
- mlw_validateResult = false;
495
- }
496
- if(jQuery(this).attr('class').indexOf('mlwRequiredCaptcha') > -1 && this.value != mlw_code)
497
- {
498
- document.getElementById('mlw_error_message').innerHTML = '**The entered text is not correct!**';
499
- document.getElementById('mlw_error_message_bottom').innerHTML = '**The entered text is not correct!**';
500
- jQuery(this).css("outline", "2px solid red");
501
- mlw_validateResult = false;
502
- }
503
- if(jQuery(this).attr('class').indexOf('mlwRequiredCheck') > -1 && !this.checked)
504
- {
505
- document.getElementById('mlw_error_message').innerHTML = '**Please complete all required fields!**';
506
- document.getElementById('mlw_error_message_bottom').innerHTML = '**Please complete all required fields!**';
507
- jQuery(this).css("outline", "2px solid red");
508
- mlw_validateResult = false;
509
- }
510
- }
511
- });
512
-
513
- if (!mlw_validateResult) {return mlw_validateResult;}
514
-
515
- jQuery( '.mlw_qmn_quiz input:radio' ).attr('disabled',false);
516
- jQuery( '.mlw_qmn_quiz input:checkbox' ).attr('disabled',false);
517
- jQuery( '.mlw_qmn_quiz select' ).attr('disabled',false);
518
- jQuery( '.mlw_qmn_question_comment' ).attr('disabled',false);
519
- jQuery( '.mlw_answer_open_text' ).attr('disabled',false);
520
- }
521
- </script>
522
- <?php
523
-
524
  if ( $mlw_quiz_options->pagination != 0) { $mlw_display .= "<style>.quiz_section { display: none; }</style>"; }
525
 
526
  //Begin the quiz
@@ -531,7 +243,7 @@ function mlw_quiz_shortcode($atts)
531
  $mlw_message_before = htmlspecialchars_decode($mlw_quiz_options->message_before, ENT_QUOTES);
532
  $mlw_message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message_before, $mlw_qmn_quiz_options_array);
533
  $mlw_display .= "<span class='mlw_qmn_message_before'>".$mlw_message_before."</span><br />";
534
- $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' style='color: red;'></span><br />";
535
 
536
  if ($mlw_quiz_options->contact_info_location == 0)
537
  {
@@ -558,7 +270,7 @@ function mlw_quiz_shortcode($atts)
558
  $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
559
  if ($mlw_question->question_type == 0)
560
  {
561
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
562
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
563
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
564
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
@@ -617,7 +329,7 @@ function mlw_quiz_shortcode($atts)
617
  }
618
  elseif ($mlw_question->question_type == 4)
619
  {
620
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
621
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
622
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
623
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
@@ -643,7 +355,7 @@ function mlw_quiz_shortcode($atts)
643
  }
644
  elseif ($mlw_question->question_type == 10)
645
  {
646
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
647
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
648
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
649
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
@@ -668,7 +380,7 @@ function mlw_quiz_shortcode($atts)
668
  }
669
  elseif ($mlw_question->question_type == 1)
670
  {
671
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
672
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
673
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
674
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
@@ -721,7 +433,7 @@ function mlw_quiz_shortcode($atts)
721
  }
722
  elseif ($mlw_question->question_type == 2)
723
  {
724
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
725
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
726
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
727
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
@@ -775,7 +487,7 @@ function mlw_quiz_shortcode($atts)
775
  }
776
  elseif ($mlw_question->question_type == 5)
777
  {
778
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
779
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
780
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
781
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
@@ -790,7 +502,7 @@ function mlw_quiz_shortcode($atts)
790
  }
791
  elseif ($mlw_question->question_type == 7)
792
  {
793
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
794
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
795
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
796
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
@@ -802,7 +514,7 @@ function mlw_quiz_shortcode($atts)
802
  {
803
  if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredCheck";} else {$mlw_requireClass = "";}
804
  $mlw_display .= "<input type='checkbox' id='mlwAcceptance' class='$mlw_requireClass ' />";
805
- $mlw_display .= "<label for='mlwAcceptance'><span class='mlw_qmn_question' style='font-weight:bold;'>".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span></label>";
806
  $mlw_display .= "<br />";
807
  }
808
  elseif ($mlw_question->question_type == 9)
@@ -811,7 +523,7 @@ function mlw_quiz_shortcode($atts)
811
  $mlw_display .= "<div class='mlw_captchaWrap'>";
812
  $mlw_display .= "<canvas alt='' id='mlw_captcha' class='mlw_captcha' width='100' height='50'></canvas>";
813
  $mlw_display .= "</div>";
814
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
815
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
816
  $mlw_display .= "<input type='text' class='mlw_answer_open_text $mlw_requireClass' id='mlw_captcha_text' name='mlw_user_captcha'/>";
817
  $mlw_display .= "<input type='hidden' name='mlw_code_captcha' id='mlw_code_captcha' value='none' />";
@@ -836,7 +548,7 @@ function mlw_quiz_shortcode($atts)
836
  }
837
  else
838
  {
839
- $mlw_display .= "<span class='mlw_qmn_question' style='font-weight:bold;'>";
840
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
841
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
842
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
@@ -856,7 +568,7 @@ function mlw_quiz_shortcode($atts)
856
  }
857
  if ($mlw_question->hints != "")
858
  {
859
- $mlw_display .= "<span title=\"".htmlspecialchars_decode($mlw_question->hints, ENT_QUOTES)."\" style=\"text-decoration:underline;color:rgb(0,0,255);\" class='mlw_qmn_hint_link'>Hint</span>";
860
  $mlw_display .= "<br /><br />";
861
  }
862
  $mlw_display .= "</div>";
@@ -870,7 +582,7 @@ function mlw_quiz_shortcode($atts)
870
  $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
871
  $mlw_message_comments = htmlspecialchars_decode($mlw_quiz_options->message_comment, ENT_QUOTES);
872
  $mlw_message_comments = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message_comments, $mlw_qmn_quiz_options_array);
873
- $mlw_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text' style='font-weight:bold;'>".$mlw_message_comments."</label><br />";
874
  $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
875
  $mlw_display .= "</div>";
876
  if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br /><br />"; }
@@ -899,7 +611,7 @@ function mlw_quiz_shortcode($atts)
899
  $mlw_display .= "<input type='hidden' name='timer' id='timer' value='0'/>";
900
  $mlw_display .= "<input type='hidden' name='complete_quiz' value='confirmation' />";
901
  $mlw_display .= "<input type='submit' value='".esc_attr(htmlspecialchars_decode($mlw_quiz_options->submit_button_text, ENT_QUOTES))."' />";
902
- $mlw_display .= "<span name='mlw_error_message_bottom' id='mlw_error_message_bottom' style='color: red;'></span><br />";
903
  $mlw_display .= "</form>";
904
  $mlw_display .= "</div>";
905
  $mlw_display .= "</div>";
@@ -972,10 +684,12 @@ function mlw_quiz_shortcode($atts)
972
  //See which answers were correct and award points if necessary
973
  $mlw_user_text = "";
974
  $mlw_correct_text = "";
 
975
  $mlw_qmn_answer_array = array();
976
  foreach($mlw_questions as $mlw_question) {
977
  $mlw_user_text = "";
978
  $mlw_correct_text = "";
 
979
  if ( isset($_POST["question".$mlw_question->question_id]) || isset($_POST["mlwComment".$mlw_question->question_id]) )
980
  {
981
  if ( $mlw_question->question_type == 0 || $mlw_question->question_type == 1 || $mlw_question->question_type == 2)
@@ -998,6 +712,7 @@ function mlw_quiz_shortcode($atts)
998
  if ($mlw_qmn_question_answers_each[2] == 1)
999
  {
1000
  $mlw_correct += 1;
 
1001
  }
1002
  }
1003
  if ($mlw_qmn_question_answers_each[2] == 1)
@@ -1024,6 +739,7 @@ function mlw_quiz_shortcode($atts)
1024
  if (strtoupper($mlw_user_text) == strtoupper($mlw_correct_text))
1025
  {
1026
  $mlw_correct += 1;
 
1027
  $mlw_points += $mlw_qmn_question_answers_each[1];
1028
  break;
1029
  }
@@ -1061,6 +777,7 @@ function mlw_quiz_shortcode($atts)
1061
  if ($mlw_qmn_user_correct_answers == $mlw_qmn_total_correct_answers)
1062
  {
1063
  $mlw_correct += 1;
 
1064
  }
1065
  }
1066
  if (isset($_POST["mlwComment".$mlw_question->question_id]))
@@ -1079,7 +796,7 @@ function mlw_quiz_shortcode($atts)
1079
  $mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $mlw_qm_question_comment, $mlw_question_answer_display);
1080
  $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($mlw_question->question_answer_info, ENT_QUOTES), $mlw_question_answer_display);
1081
 
1082
- $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));
1083
 
1084
  $mlw_question_answers .= $mlw_question_answer_display;
1085
  $mlw_question_answers .= "<br />";
@@ -1168,7 +885,7 @@ EOC;
1168
  $mlw_qmn_certificate_filename = str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
1169
  file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file);
1170
  $mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
1171
- $mlw_qmn_result_array["certificate_link"] = "<a href='".$mlw_qmn_certificate_filename."' style='color: blue;'>Download Certificate</a>";
1172
  }
1173
 
1174
  /*
@@ -1226,34 +943,8 @@ EOC;
1226
 
1227
  if ($mlw_quiz_options->social_media == 1)
1228
  {
1229
- ?>
1230
- <script>
1231
- function mlw_qmn_share(network, mlw_qmn_social_text, mlw_qmn_title)
1232
- {
1233
- var sTop = window.screen.height/2-(218);
1234
- var sLeft = window.screen.width/2-(313);
1235
- var sqShareOptions = "height=400,width=580,toolbar=0,status=0,location=0,menubar=0,directories=0,scrollbars=0,top=" + sTop + ",left=" + sLeft;
1236
- var pageUrl = window.location.href;
1237
- var pageUrlEncoded = encodeURIComponent(pageUrl);
1238
- if (network == 'facebook')
1239
- {
1240
- var Url = "https://www.facebook.com/dialog/feed?"
1241
- + "display=popup&"
1242
- + "app_id=483815031724529&"
1243
- + "link=" + pageUrlEncoded + "&"
1244
- + "name=" + encodeURIComponent(mlw_qmn_social_text) + "&"
1245
- + "description= &"
1246
- + "redirect_uri=http://www.mylocalwebstop.com/mlw_qmn_close.html";
1247
- }
1248
- if (network == 'twitter')
1249
- {
1250
- var Url = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(mlw_qmn_social_text);
1251
- }
1252
- window.open(Url, "Share", sqShareOptions);
1253
- return false;
1254
- }
1255
- </script>
1256
- <?php
1257
  //Load Social Media Text
1258
  $qmn_social_media_text = "";
1259
  if (is_serialized($mlw_quiz_options->social_media_text) && is_array(@unserialize($mlw_quiz_options->social_media_text)))
@@ -1270,8 +961,8 @@ EOC;
1270
  $qmn_social_media_text["twitter"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["twitter"], $mlw_qmn_result_array);
1271
  $qmn_social_media_text["facebook"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["facebook"], $mlw_qmn_result_array);
1272
  $mlw_display .= "<br />
1273
- <a class=\"mlw_qmn_quiz_link\" style=\"display: inline; vertical-align:top !important;font-weight: bold; cursor: pointer;text-decoration: none;\" onclick=\"mlw_qmn_share('facebook', '".esc_js($qmn_social_media_text["facebook"])."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Facebook</a>
1274
- <a class=\"mlw_qmn_quiz_link\" style=\"display: inline; vertical-align:top !important;font-weight: bold; cursor: pointer;text-decoration: none;\" onclick=\"mlw_qmn_share('twitter', '".esc_js($qmn_social_media_text["twitter"])."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Twitter</a>
1275
  <br />";
1276
  }
1277
 
@@ -1497,7 +1188,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1497
  {
1498
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1499
  }
1500
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span><br />";
1501
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserName' value='".$current_user->display_name."' />";
1502
  $mlw_contact_display .= "<br /><br />";
1503
 
@@ -1509,7 +1200,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1509
  {
1510
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1511
  }
1512
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span><br />";
1513
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserComp' value='' />";
1514
  $mlw_contact_display .= "<br /><br />";
1515
  }
@@ -1520,7 +1211,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1520
  {
1521
  $mlw_contact_class = "class=\"mlwEmail mlwRequiredText\"";
1522
  }
1523
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span><br />";
1524
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserEmail' value='".$current_user->user_email."' />";
1525
  $mlw_contact_display .= "<br /><br />";
1526
  }
@@ -1531,7 +1222,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1531
  {
1532
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1533
  }
1534
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span><br />";
1535
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserPhone' value='' />";
1536
  $mlw_contact_display .= "<br /><br />";
1537
  }
@@ -1552,7 +1243,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1552
  {
1553
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1554
  }
1555
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span><br />";
1556
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserName' value='' />";
1557
  $mlw_contact_display .= "<br /><br />";
1558
  }
@@ -1563,7 +1254,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1563
  {
1564
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1565
  }
1566
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span><br />";
1567
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserComp' value='' />";
1568
  $mlw_contact_display .= "<br /><br />";
1569
  }
@@ -1574,7 +1265,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1574
  {
1575
  $mlw_contact_class = "class=\"mlwEmail mlwRequiredText\"";
1576
  }
1577
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span><br />";
1578
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserEmail' value='' />";
1579
  $mlw_contact_display .= "<br /><br />";
1580
  }
@@ -1585,7 +1276,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
1585
  {
1586
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1587
  }
1588
- $mlw_contact_display .= "<span style='font-weight:bold;';>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span><br />";
1589
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserPhone' value='' />";
1590
  $mlw_contact_display .= "<br /><br />";
1591
  }
140
  wp_enqueue_script( 'jquery-effects-slide' );
141
  wp_enqueue_script( 'jquery-ui-dialog' );
142
  wp_enqueue_script( 'jquery-ui-button' );
 
143
  wp_enqueue_script( 'jquery-ui-tooltip' );
144
+ wp_enqueue_style( 'qmn_jquery_redmond_theme', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css' );
145
+
146
+ wp_enqueue_script( 'qmn_quiz', plugins_url( 'qmn_quiz.js' , __FILE__ ) );
147
+ wp_enqueue_style( 'qmn_quiz_style', plugins_url( 'qmn_quiz.css' , __FILE__ ) );
148
+ wp_enqueue_script( 'math_jax', '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
 
150
+ if ($mlw_quiz_options->theme_selected == "default")
151
+ {
152
+ echo "<style type='text/css'>".$mlw_quiz_options->quiz_stye."</style>";
153
+ }
154
+ else
155
+ {
156
+ echo "<link type='text/css' href='".get_option('mlw_qmn_theme_'.$mlw_quiz_options->theme_selected)."' rel='stylesheet' />";
157
+ }
 
158
 
159
  /*
160
  The following code is for displaying the quiz and completion screen
207
  }
208
  ?>
209
  <script type="text/javascript">
210
+ var qmn_pagination = <?php echo $mlw_quiz_options->pagination; ?>;
211
+ var qmn_section_limit = <?php echo $mlw_qmn_section_limit; ?>;
212
+ var qmn_pagination_previous_text = '<?php echo $mlw_qmn_pagination_text[0]; ?>';
213
+ var qmn_pagination_next_text = '<?php echo $mlw_qmn_pagination_text[1]; ?>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  </script>
215
  <?php
216
+ wp_enqueue_script( 'qmn_quiz_pagination', plugins_url( 'qmn_pagination.js' , __FILE__ ) );
217
  }
218
  if ($mlw_quiz_options->timer_limit != 0)
219
  {
220
  ?>
221
  <div id="mlw_qmn_timer" class="mlw_qmn_timer"></div>
222
  <script type="text/javascript">
223
+ var qmn_quiz_id = <?php echo $mlw_quiz_id; ?>;
224
+ var qmn_timer_limit = <?php echo $mlw_quiz_options->timer_limit; ?>;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  </script>
226
  <?php
227
+ wp_enqueue_script( 'qmn_quiz_timer', plugins_url( 'qmn_timer.js' , __FILE__ ) );
228
  }
229
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  //Update the quiz views
231
  $mlw_views = $mlw_quiz_options->quiz_views;
232
  $mlw_views += 1;
233
  $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET quiz_views='".$mlw_views."' WHERE quiz_id=".$mlw_quiz_id;
234
  $results = $wpdb->query( $update );
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  if ( $mlw_quiz_options->pagination != 0) { $mlw_display .= "<style>.quiz_section { display: none; }</style>"; }
237
 
238
  //Begin the quiz
243
  $mlw_message_before = htmlspecialchars_decode($mlw_quiz_options->message_before, ENT_QUOTES);
244
  $mlw_message_before = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message_before, $mlw_qmn_quiz_options_array);
245
  $mlw_display .= "<span class='mlw_qmn_message_before'>".$mlw_message_before."</span><br />";
246
+ $mlw_display .= "<span name='mlw_error_message' id='mlw_error_message' class='qmn_error'></span><br />";
247
 
248
  if ($mlw_quiz_options->contact_info_location == 0)
249
  {
270
  $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
271
  if ($mlw_question->question_type == 0)
272
  {
273
+ $mlw_display .= "<span class='mlw_qmn_question'>";
274
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
275
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
276
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
329
  }
330
  elseif ($mlw_question->question_type == 4)
331
  {
332
+ $mlw_display .= "<span class='mlw_qmn_question'>";
333
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
334
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
335
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
355
  }
356
  elseif ($mlw_question->question_type == 10)
357
  {
358
+ $mlw_display .= "<span class='mlw_qmn_question'>";
359
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
360
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
361
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
380
  }
381
  elseif ($mlw_question->question_type == 1)
382
  {
383
+ $mlw_display .= "<span class='mlw_qmn_question'>";
384
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
385
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
386
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
433
  }
434
  elseif ($mlw_question->question_type == 2)
435
  {
436
+ $mlw_display .= "<span class='mlw_qmn_question'>";
437
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
438
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
439
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
487
  }
488
  elseif ($mlw_question->question_type == 5)
489
  {
490
+ $mlw_display .= "<span class='mlw_qmn_question'>";
491
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
492
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
493
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
502
  }
503
  elseif ($mlw_question->question_type == 7)
504
  {
505
+ $mlw_display .= "<span class='mlw_qmn_question'>";
506
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
507
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
508
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
514
  {
515
  if ($mlw_question_settings['required'] == 0) {$mlw_requireClass = "mlwRequiredCheck";} else {$mlw_requireClass = "";}
516
  $mlw_display .= "<input type='checkbox' id='mlwAcceptance' class='$mlw_requireClass ' />";
517
+ $mlw_display .= "<label for='mlwAcceptance'><span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span></label>";
518
  $mlw_display .= "<br />";
519
  }
520
  elseif ($mlw_question->question_type == 9)
523
  $mlw_display .= "<div class='mlw_captchaWrap'>";
524
  $mlw_display .= "<canvas alt='' id='mlw_captcha' class='mlw_captcha' width='100' height='50'></canvas>";
525
  $mlw_display .= "</div>";
526
+ $mlw_display .= "<span class='mlw_qmn_question'>";
527
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
528
  $mlw_display .= "<input type='text' class='mlw_answer_open_text $mlw_requireClass' id='mlw_captcha_text' name='mlw_user_captcha'/>";
529
  $mlw_display .= "<input type='hidden' name='mlw_code_captcha' id='mlw_code_captcha' value='none' />";
548
  }
549
  else
550
  {
551
+ $mlw_display .= "<span class='mlw_qmn_question'>";
552
  $mlw_qmn_total_questions = $mlw_qmn_total_questions + 1;
553
  if ($mlw_quiz_options->question_numbering == 1) { $mlw_display .= $mlw_qmn_total_questions.") "; }
554
  $mlw_display .= htmlspecialchars_decode($mlw_question->question_name, ENT_QUOTES)."</span><br />";
568
  }
569
  if ($mlw_question->hints != "")
570
  {
571
+ $mlw_display .= "<span title=\"".htmlspecialchars_decode($mlw_question->hints, ENT_QUOTES)."\" class='mlw_qmn_hint_link'>Hint</span>";
572
  $mlw_display .= "<br /><br />";
573
  }
574
  $mlw_display .= "</div>";
582
  $mlw_display .= "<div class='quiz_section slide".$mlw_qmn_section_count."'>";
583
  $mlw_message_comments = htmlspecialchars_decode($mlw_quiz_options->message_comment, ENT_QUOTES);
584
  $mlw_message_comments = apply_filters( 'mlw_qmn_template_variable_quiz_page', $mlw_message_comments, $mlw_qmn_quiz_options_array);
585
+ $mlw_display .= "<label for='mlwQuizComments' class='mlw_qmn_comment_section_text'>".$mlw_message_comments."</label><br />";
586
  $mlw_display .= "<textarea cols='70' rows='15' id='mlwQuizComments' name='mlwQuizComments' ></textarea>";
587
  $mlw_display .= "</div>";
588
  if ( $mlw_quiz_options->pagination == 0) { $mlw_display .= "<br /><br />"; }
611
  $mlw_display .= "<input type='hidden' name='timer' id='timer' value='0'/>";
612
  $mlw_display .= "<input type='hidden' name='complete_quiz' value='confirmation' />";
613
  $mlw_display .= "<input type='submit' value='".esc_attr(htmlspecialchars_decode($mlw_quiz_options->submit_button_text, ENT_QUOTES))."' />";
614
+ $mlw_display .= "<span name='mlw_error_message_bottom' id='mlw_error_message_bottom' class='qmn_error'></span><br />";
615
  $mlw_display .= "</form>";
616
  $mlw_display .= "</div>";
617
  $mlw_display .= "</div>";
684
  //See which answers were correct and award points if necessary
685
  $mlw_user_text = "";
686
  $mlw_correct_text = "";
687
+ $qmn_correct = "incorrect";
688
  $mlw_qmn_answer_array = array();
689
  foreach($mlw_questions as $mlw_question) {
690
  $mlw_user_text = "";
691
  $mlw_correct_text = "";
692
+ $qmn_correct = "incorrect";
693
  if ( isset($_POST["question".$mlw_question->question_id]) || isset($_POST["mlwComment".$mlw_question->question_id]) )
694
  {
695
  if ( $mlw_question->question_type == 0 || $mlw_question->question_type == 1 || $mlw_question->question_type == 2)
712
  if ($mlw_qmn_question_answers_each[2] == 1)
713
  {
714
  $mlw_correct += 1;
715
+ $qmn_correct = "correct";
716
  }
717
  }
718
  if ($mlw_qmn_question_answers_each[2] == 1)
739
  if (strtoupper($mlw_user_text) == strtoupper($mlw_correct_text))
740
  {
741
  $mlw_correct += 1;
742
+ $qmn_correct = "correct";
743
  $mlw_points += $mlw_qmn_question_answers_each[1];
744
  break;
745
  }
777
  if ($mlw_qmn_user_correct_answers == $mlw_qmn_total_correct_answers)
778
  {
779
  $mlw_correct += 1;
780
+ $qmn_correct = "correct";
781
  }
782
  }
783
  if (isset($_POST["mlwComment".$mlw_question->question_id]))
796
  $mlw_question_answer_display = str_replace( "%USER_COMMENTS%" , $mlw_qm_question_comment, $mlw_question_answer_display);
797
  $mlw_question_answer_display = str_replace( "%CORRECT_ANSWER_INFO%" , htmlspecialchars_decode($mlw_question->question_answer_info, ENT_QUOTES), $mlw_question_answer_display);
798
 
799
+ $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);
800
 
801
  $mlw_question_answers .= $mlw_question_answer_display;
802
  $mlw_question_answers .= "<br />";
885
  $mlw_qmn_certificate_filename = str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
886
  file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file);
887
  $mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis").$mlw_qmn_timer.".php";
888
+ $mlw_qmn_result_array["certificate_link"] = "<a href='".$mlw_qmn_certificate_filename."' class='qmn_certificate_link'>Download Certificate</a>";
889
  }
890
 
891
  /*
943
 
944
  if ($mlw_quiz_options->social_media == 1)
945
  {
946
+ wp_enqueue_script( 'qmn_quiz_social_share', plugins_url( 'qmn_social_share.js' , __FILE__ ) );
947
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
948
  //Load Social Media Text
949
  $qmn_social_media_text = "";
950
  if (is_serialized($mlw_quiz_options->social_media_text) && is_array(@unserialize($mlw_quiz_options->social_media_text)))
961
  $qmn_social_media_text["twitter"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["twitter"], $mlw_qmn_result_array);
962
  $qmn_social_media_text["facebook"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["facebook"], $mlw_qmn_result_array);
963
  $mlw_display .= "<br />
964
+ <a class=\"mlw_qmn_quiz_link\" onclick=\"mlw_qmn_share('facebook', '".esc_js($qmn_social_media_text["facebook"])."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Facebook</a>
965
+ <a class=\"mlw_qmn_quiz_link\" onclick=\"mlw_qmn_share('twitter', '".esc_js($qmn_social_media_text["twitter"])."', '".esc_js($mlw_quiz_options->quiz_name)."');\">Twitter</a>
966
  <br />";
967
  }
968
 
1188
  {
1189
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1190
  }
1191
+ $mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span><br />";
1192
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserName' value='".$current_user->display_name."' />";
1193
  $mlw_contact_display .= "<br /><br />";
1194
 
1200
  {
1201
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1202
  }
1203
+ $mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span><br />";
1204
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserComp' value='' />";
1205
  $mlw_contact_display .= "<br /><br />";
1206
  }
1211
  {
1212
  $mlw_contact_class = "class=\"mlwEmail mlwRequiredText\"";
1213
  }
1214
+ $mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span><br />";
1215
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserEmail' value='".$current_user->user_email."' />";
1216
  $mlw_contact_display .= "<br /><br />";
1217
  }
1222
  {
1223
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1224
  }
1225
+ $mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span><br />";
1226
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserPhone' value='' />";
1227
  $mlw_contact_display .= "<br /><br />";
1228
  }
1243
  {
1244
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1245
  }
1246
+ $mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span><br />";
1247
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserName' value='' />";
1248
  $mlw_contact_display .= "<br /><br />";
1249
  }
1254
  {
1255
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1256
  }
1257
+ $mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span><br />";
1258
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserComp' value='' />";
1259
  $mlw_contact_display .= "<br /><br />";
1260
  }
1265
  {
1266
  $mlw_contact_class = "class=\"mlwEmail mlwRequiredText\"";
1267
  }
1268
+ $mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span><br />";
1269
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserEmail' value='' />";
1270
  $mlw_contact_display .= "<br /><br />";
1271
  }
1276
  {
1277
  $mlw_contact_class = "class=\"mlwRequiredText\"";
1278
  }
1279
+ $mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span><br />";
1280
  $mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserPhone' value='' />";
1281
  $mlw_contact_display .= "<br /><br />";
1282
  }
includes/mlw_quiz_creator.php CHANGED
@@ -192,17 +192,27 @@ class QMNQuizCreator
192
  div.mlw_qmn_quiz input[type=submit],
193
  a.mlw_qmn_quiz_link
194
  {
195
- border-radius: 4px;
196
- position: relative;
197
- background-image: linear-gradient(#fff,#dedede);
198
- background-color: #eee;
199
- border: #ccc solid 1px;
200
- color: #333;
201
- text-shadow: 0 1px 0 rgba(255,255,255,.5);
202
- box-sizing: border-box;
203
- display: inline-block;
204
- padding: 5px 5px 5px 5px;
205
- margin: auto;
 
 
 
 
 
 
 
 
 
 
206
  }";
207
  $mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
208
  $results = $wpdb->insert(
192
  div.mlw_qmn_quiz input[type=submit],
193
  a.mlw_qmn_quiz_link
194
  {
195
+ border-radius: 4px;
196
+ position: relative;
197
+ background-image: linear-gradient(#fff,#dedede);
198
+ background-color: #eee;
199
+ border: #ccc solid 1px;
200
+ color: #333;
201
+ text-shadow: 0 1px 0 rgba(255,255,255,.5);
202
+ box-sizing: border-box;
203
+ display: inline-block;
204
+ padding: 5px 5px 5px 5px;
205
+ margin: auto;
206
+ font-weight: bold;
207
+ cursor: pointer;
208
+ }
209
+ .mlw_qmn_question
210
+ {
211
+ font-weight: bold;
212
+ }
213
+ .mlw_qmn_comment_section_text
214
+ {
215
+ font-weight: bold;
216
  }";
217
  $mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
218
  $results = $wpdb->insert(
includes/mlw_quiz_options.php CHANGED
@@ -30,8 +30,6 @@ function mlw_generate_quiz_options()
30
  wp_enqueue_script( 'jquery-ui-dialog' );
31
  wp_enqueue_script( 'jquery-ui-button' );
32
  wp_enqueue_script( 'jquery-ui-datepicker' );
33
- wp_enqueue_script( 'jquery-ui-accordion' );
34
- wp_enqueue_script( 'jquery-ui-tooltip' );
35
  wp_enqueue_script( 'jquery-ui-tabs' );
36
  wp_enqueue_script( 'jquery-effects-blind' );
37
  wp_enqueue_script( 'jquery-effects-explode' );
@@ -41,7 +39,6 @@ function mlw_generate_quiz_options()
41
  // increase the default animation speed to exaggerate the effect
42
  $j.fx.speeds._default = 1000;
43
  $j(function() {
44
- $j("button").button();
45
  $j( "#tabs" ).tabs();
46
  });
47
  </script>
@@ -441,10 +438,6 @@ function mlw_options_questions_tab_content()
441
  ?>
442
  <div id="tabs-1" class="mlw_tab_content">
443
  <script>
444
- $j(function() {
445
- $j("#prev_page, #next_page, #new_answer_button").button();
446
- });
447
-
448
  jQuery(function() {
449
  jQuery('#new_question_dialog').dialog({
450
  autoOpen: false,
@@ -547,7 +540,7 @@ function mlw_options_questions_tab_content()
547
  background-color: black;
548
  }
549
  </style>
550
- <button id="new_question_button_two">Add Question</button>
551
  <br />
552
  <?php
553
  $question_list = "";
@@ -661,7 +654,7 @@ function mlw_options_questions_tab_content()
661
  }
662
  ?>
663
  </table>
664
- <a href="#" id="new_answer_button" onclick="mlw_add_new_question(<?php echo $mlw_question_info->question_id; ?>);">Add New Answer!</a>
665
  <br />
666
  <br />
667
  <table class="wide" style="text-align: left; white-space: nowrap;">
@@ -727,7 +720,7 @@ function mlw_options_questions_tab_content()
727
  </div></td>
728
  </tr>
729
  </table>
730
- <p> *Required currently only works on open answer, number, and captcha question types</p>
731
  <input type="hidden" name="question_<?php echo $mlw_question_info->question_id; ?>_answer_total" id="question_<?php echo $mlw_question_info->question_id; ?>_answer_total" value="<?php echo $mlw_answer_total; ?>" />
732
  <p class='submit'><input type='submit' class='button-primary' value='Edit Question' /></p>
733
  </form>
@@ -773,7 +766,7 @@ function mlw_options_questions_tab_content()
773
  $display .= "</table>";
774
  echo $display;
775
  ?>
776
- <button id="new_question_button">Add Question</button>
777
  <div id="new_question_dialog" title="Create New Question" style="display:none;">
778
 
779
  <?php
@@ -818,7 +811,7 @@ function mlw_options_questions_tab_content()
818
  <td><input type="checkbox" id="answer_<?php echo $mlw_answer_total; ?>_correct" name="answer_<?php echo $mlw_answer_total; ?>_correct" checked="checked" value=1 /></td>
819
  </tr>
820
  </table>
821
- <a href="#" id="new_answer_button" onclick="mlw_add_answer_to_new_question();">Add New Answer!</a>
822
  <br />
823
  <br />
824
  <table class="wide" style="text-align: left; white-space: nowrap;">
@@ -869,7 +862,7 @@ function mlw_options_questions_tab_content()
869
  <tr valign="top">
870
  <td><span style='font-weight:bold;'>Question Order</span></td>
871
  <td>
872
- <input type="number" step="1" min="1" name="new_question_order" value="1" id="new_question_order" style="border-color:#000000;
873
  color:#3300CC;
874
  cursor:hand;"/>
875
  </td>
@@ -884,7 +877,7 @@ function mlw_options_questions_tab_content()
884
  </div></td>
885
  </tr>
886
  </table>
887
- <p> *Required currently only works on open answer, number, and captcha question types</p>
888
  <input type="hidden" name="new_question_answer_total" id="new_question_answer_total" value="<?php echo $mlw_answer_total; ?>" />
889
  <?php
890
  echo "<p class='submit'><input type='submit' class='button-primary' value='Create Question' /></p>";
@@ -1053,7 +1046,7 @@ function mlw_options_text_tab_content()
1053
  <td><strong>%CURRENT_DATE%</strong> - The Current Date</td>
1054
  </tr>
1055
  </table>
1056
- <button id="save_template_button" onclick="javascript: document.quiz_template_form.submit();">Save Templates</button>
1057
  <?php
1058
  echo "<form action='' method='post' name='quiz_template_form'>";
1059
  echo "<input type='hidden' name='save_templates' value='confirmation' />";
@@ -1069,8 +1062,7 @@ function mlw_options_text_tab_content()
1069
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1070
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1071
  </td>
1072
- <td><textarea cols="80" rows="15" id="mlw_quiz_before_message" name="mlw_quiz_before_message"><?php echo $mlw_quiz_options->message_before; ?></textarea>
1073
- </td>
1074
  </tr>
1075
  <tr>
1076
  <td width="30%">
@@ -1080,8 +1072,7 @@ function mlw_options_text_tab_content()
1080
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1081
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1082
  </td>
1083
- <td><textarea cols="80" rows="15" id="mlw_quiz_before_comments" name="mlw_quiz_before_comments"><?php echo $mlw_quiz_options->message_comment; ?></textarea>
1084
- </td>
1085
  </tr>
1086
  <tr>
1087
  <td width="30%">
@@ -1091,8 +1082,7 @@ function mlw_options_text_tab_content()
1091
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1092
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1093
  </td>
1094
- <td><textarea cols="80" rows="15" id="message_end_template" name="message_end_template"><?php echo $mlw_quiz_options->message_end_template; ?></textarea>
1095
- </td>
1096
  </tr>
1097
  <tr>
1098
  <td width="30%">
@@ -1102,8 +1092,7 @@ function mlw_options_text_tab_content()
1102
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1103
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1104
  </td>
1105
- <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>
1106
- </td>
1107
  </tr>
1108
  <tr>
1109
  <td width="30%">
@@ -1113,8 +1102,7 @@ function mlw_options_text_tab_content()
1113
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1114
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1115
  </td>
1116
- <td><textarea cols="80" rows="15" id="mlw_require_log_in_text" name="mlw_require_log_in_text"><?php echo $mlw_quiz_options->require_log_in_text; ?></textarea>
1117
- </td>
1118
  </tr>
1119
  <tr>
1120
  <td width="30%">
@@ -1124,8 +1112,7 @@ function mlw_options_text_tab_content()
1124
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1125
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1126
  </td>
1127
- <td><textarea cols="80" rows="15" id="mlw_scheduled_timeframe_text" name="mlw_scheduled_timeframe_text"><?php echo $mlw_quiz_options->scheduled_timeframe_text; ?></textarea>
1128
- </td>
1129
  </tr>
1130
  <tr>
1131
  <td width="30%">
@@ -1135,8 +1122,7 @@ function mlw_options_text_tab_content()
1135
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1136
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1137
  </td>
1138
- <td><textarea cols="80" rows="15" id="mlw_limit_total_entries_text" name="mlw_limit_total_entries_text"><?php echo $mlw_quiz_options->limit_total_entries_text; ?></textarea>
1139
- </td>
1140
  </tr>
1141
  <tr>
1142
  <td width="30%">
@@ -1149,8 +1135,7 @@ function mlw_options_text_tab_content()
1149
  <p style="margin: 2px 0">- %USER_COMMENTS%</p>
1150
  <p style="margin: 2px 0">- %CORRECT_ANSWER_INFO%</p>
1151
  </td>
1152
- <td><textarea cols="80" rows="15" id="mlw_quiz_question_answer_template" name="mlw_quiz_question_answer_template"><?php echo $mlw_quiz_options->question_answer_template; ?></textarea>
1153
- </td>
1154
  </tr>
1155
  <tr>
1156
  <td width="30%">
@@ -1166,7 +1151,7 @@ function mlw_options_text_tab_content()
1166
  <p style="margin: 2px 0">- %TIMER%</p>
1167
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1168
  </td>
1169
- <td><textarea cols="80" rows="15" id="mlw_quiz_twitter_text_template" name="mlw_quiz_twitter_text_template"><?php echo $qmn_social_media_text["twitter"]; ?></textarea>
1170
  </td>
1171
  </tr>
1172
  <tr>
@@ -1183,8 +1168,7 @@ function mlw_options_text_tab_content()
1183
  <p style="margin: 2px 0">- %TIMER%</p>
1184
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1185
  </td>
1186
- <td><textarea cols="80" rows="15" id="mlw_quiz_facebook_text_template" name="mlw_quiz_facebook_text_template"><?php echo $qmn_social_media_text["facebook"] ?></textarea>
1187
- </td>
1188
  </tr>
1189
  </table>
1190
  <h3 style="text-align: center;">Other Templates</h3>
@@ -1226,7 +1210,7 @@ function mlw_options_text_tab_content()
1226
  <td><input name="emailFromText" type="text" id="emailFromText" value="<?php echo $mlw_quiz_options->email_from_text; ?>" class="regular-text" /></td>
1227
  </tr>
1228
  </table>
1229
- <button id="save_template_button" onclick="javascript: document.quiz_template_form.submit();">Save Templates</button>
1230
  <?php echo "</form>"; ?>
1231
  </div>
1232
  <?php
@@ -1251,20 +1235,17 @@ function mlw_options_option_tab_content()
1251
  $mlw_total_user_tries = intval($_POST["total_user_tries"]);
1252
  $mlw_require_log_in = $_POST["require_log_in"];
1253
  $mlw_limit_total_entries = $_POST["limit_total_entries"];
1254
- $mlw_send_user_email = $_POST["sendUserEmail"];
1255
- $mlw_send_admin_email = $_POST["sendAdminEmail"];
1256
  $mlw_contact_location = $_POST["contact_info_location"];
1257
  $mlw_user_name = $_POST["userName"];
1258
  $mlw_user_comp = $_POST["userComp"];
1259
  $mlw_user_email = $_POST["userEmail"];
1260
  $mlw_user_phone = $_POST["userPhone"];
1261
- $mlw_admin_email = $_POST["adminEmail"];
1262
  $mlw_comment_section = $_POST["commentSection"];
1263
  $mlw_qmn_loggedin_contact = $_POST["loggedin_user_contact"];
1264
  $qmn_scheduled_timeframe = serialize(array("start" => $_POST["scheduled_time_start"], "end" => $_POST["scheduled_time_end"]));
1265
  $quiz_id = $_POST["quiz_id"];
1266
 
1267
- $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET system='".$mlw_system."', send_user_email='".$mlw_send_user_email."', send_admin_email='".$mlw_send_admin_email."', loggedin_user_contact='".$mlw_qmn_loggedin_contact."', contact_info_location=".$mlw_contact_location.", user_name='".$mlw_user_name."', user_comp='".$mlw_user_comp."', user_email='".$mlw_user_email."', user_phone='".$mlw_user_phone."', admin_email='".$mlw_admin_email."', comment_section='".$mlw_comment_section."', randomness_order='".$mlw_randomness_order."', question_from_total=".$mlw_qmn_questions_from_total.", total_user_tries=".$mlw_total_user_tries.", social_media=".$mlw_qmn_social_media.", pagination=".$mlw_qmn_pagination.", timer_limit=".$mlw_qmn_timer.", question_numbering=".$mlw_qmn_question_numbering.", require_log_in=".$mlw_require_log_in.", limit_total_entries=".$mlw_limit_total_entries.", last_activity='".date("Y-m-d H:i:s")."', scheduled_timeframe='".$qmn_scheduled_timeframe."' WHERE quiz_id=".$quiz_id;
1268
  $results = $wpdb->query( $update );
1269
  if ($results != false)
1270
  {
@@ -1309,7 +1290,7 @@ function mlw_options_option_tab_content()
1309
  jQuery( "#scheduled_time_start, #scheduled_time_end" ).datepicker();
1310
  });
1311
  </script>
1312
- <button id="save_options_button" onclick="javascript: document.quiz_options_form.submit();">Save Options</button>
1313
  <?php
1314
  echo "<form action='' method='post' name='quiz_options_form'>";
1315
  echo "<input type='hidden' name='save_options' value='confirmation' />";
@@ -1431,24 +1412,6 @@ function mlw_options_option_tab_content()
1431
  <input type="radio" id="radio22" name="commentSection" <?php if ($mlw_quiz_options->comment_section == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio22">No</label>
1432
  </div></td>
1433
  </tr>
1434
- <tr valign="top">
1435
- <th scope="row"><label for="sendUserEmail">Send user email upon completion?</label></th>
1436
- <td><div id="sendUserEmail">
1437
- <input type="radio" id="radio5" name="sendUserEmail" <?php if ($mlw_quiz_options->send_user_email == 0) {echo 'checked="checked"';} ?> value='0' /><label for="radio5">Yes</label>
1438
- <input type="radio" id="radio6" name="sendUserEmail" <?php if ($mlw_quiz_options->send_user_email == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio6">No</label>
1439
- </div></td>
1440
- </tr>
1441
- <tr valign="top">
1442
- <th scope="row"><label for="sendAdminEmail">Send admin email upon completion?</label></th>
1443
- <td><div id="sendAdminEmail">
1444
- <input type="radio" id="radio19" name="sendAdminEmail" <?php if ($mlw_quiz_options->send_admin_email == 0) {echo 'checked="checked"';} ?> value='0' /><label for="radio19">Yes</label>
1445
- <input type="radio" id="radio20" name="sendAdminEmail" <?php if ($mlw_quiz_options->send_admin_email == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio20">No</label>
1446
- </div></td>
1447
- </tr>
1448
- <tr valign="top">
1449
- <th scope="row"><label for="adminEmail">What emails should we send the admin email to? Separate emails with a comma.</label></th>
1450
- <td><input name="adminEmail" type="text" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
1451
- </tr>
1452
  <tr valign="top">
1453
  <th scope="row"><label for="question_numbering">Show question number on quiz?</label></th>
1454
  <td><div id="question_numbering">
@@ -1464,7 +1427,7 @@ function mlw_options_option_tab_content()
1464
  </div></td>
1465
  </tr>
1466
  </table>
1467
- <button id="save_options_button" onclick="javascript: document.quiz_options_form.submit();">Save Options</button>
1468
  <?php echo "</form>"; ?>
1469
  </div>
1470
  <?php
@@ -1540,7 +1503,7 @@ function mlw_options_leaderboard_tab_content()
1540
  <td><strong>%QUIZ_NAME%</strong> - The name of the quiz</td>
1541
  </tr>
1542
  </table>
1543
- <button id="save_template_button" onclick="javascript: document.quiz_leaderboard_options_form.submit();">Save Leaderboard Options</button>
1544
  <?php
1545
  echo "<form action='' method='post' name='quiz_leaderboard_options_form'>";
1546
  echo "<input type='hidden' name='save_leaderboard_options' value='confirmation' />";
@@ -1568,7 +1531,7 @@ function mlw_options_leaderboard_tab_content()
1568
  </td>
1569
  </tr>
1570
  </table>
1571
- <button id="save_template_button" onclick="javascript: document.quiz_leaderboard_options_form.submit();">Save Leaderboard Options</button>
1572
  </form>
1573
  </div>
1574
  <?php
@@ -1637,7 +1600,7 @@ function mlw_options_certificate_tab_content()
1637
  <h3>Quiz Certificate (Beta)</h3>
1638
  <p>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.</p>
1639
  <p>These fields cannot contain HTML.</p>
1640
- <button id="save_certificate_button" onclick="javascript: document.quiz_certificate_options_form.submit();">Save Certificate Options</button>
1641
  <?php
1642
  echo "<form action='' method='post' name='quiz_certificate_options_form'>";
1643
  echo "<input type='hidden' name='save_certificate_options' value='confirmation' />";
@@ -1693,7 +1656,7 @@ function mlw_options_certificate_tab_content()
1693
  </td>
1694
  </tr>
1695
  </table>
1696
- <button id="save_certificate_button" onclick="javascript: document.quiz_certificate_options_form.submit();">Save Certificate Options</button>
1697
  </form>
1698
  </div>
1699
  <?php
@@ -1814,6 +1777,9 @@ function mlw_options_emails_tab_content()
1814
  $mlw_qmn_email_id = intval($_POST["mlw_email_quiz_id"]);
1815
  $mlw_qmn_email_template_total = intval($_POST["mlw_email_template_total"]);
1816
  $mlw_qmn_email_admin_total = intval($_POST["mlw_email_admin_total"]);
 
 
 
1817
 
1818
  //Create new array
1819
  $i = 1;
@@ -1847,7 +1813,7 @@ function mlw_options_emails_tab_content()
1847
  }
1848
  $mlw_qmn_new_email_array = serialize($mlw_qmn_new_email_array);
1849
  $mlw_qmn_new_admin_array = serialize($mlw_qmn_new_admin_array);
1850
- $mlw_new_email_results = $wpdb->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 ) );
1851
  if ($mlw_new_email_results != false)
1852
  {
1853
  $mlwQuizMasterNext->alertManager->newAlert('The email has been updated successfully.', 'success');
@@ -1901,14 +1867,6 @@ function mlw_options_emails_tab_content()
1901
 
1902
  <div id="tabs-9" class="mlw_tab_content">
1903
  <script>
1904
- $j(function() {
1905
- $j("#new_email_button_top, #new_email_button_bottom, #new_admin_email_button_top, #new_admin_email_button_bottom").button();
1906
- });
1907
- jQuery(function() {
1908
- jQuery("#email_accordion").accordion({
1909
- heightStyle: "content"
1910
- });
1911
- });
1912
  function delete_email(id)
1913
  {
1914
  document.getElementById('user_email_'+id).value = "Delete";
@@ -1956,6 +1914,8 @@ function mlw_options_emails_tab_content()
1956
  <td><strong>%TIMER%</strong> - The amount of time user spent of quiz</td>
1957
  </tr>
1958
  </table>
 
 
1959
  <form method="post" action="" name="mlw_quiz_add_email_form">
1960
  <input type='hidden' name='mlw_add_email_page' value='confirmation' />
1961
  <input type='hidden' name='mlw_add_email_quiz_id' value='<?php echo $quiz_id; ?>' />
@@ -1964,180 +1924,202 @@ function mlw_options_emails_tab_content()
1964
  <input type='hidden' name='mlw_add_admin_email_page' value='confirmation' />
1965
  <input type='hidden' name='mlw_add_admin_email_quiz_id' value='<?php echo $quiz_id; ?>' />
1966
  </form>
1967
- <button id="save_email_button" onclick="javascript: document.mlw_quiz_save_email_form.submit();">Save Email Templates</button>
1968
  <form method="post" action="" name="mlw_quiz_save_email_form">
1969
- <div id="email_accordion">
1970
- <h3><a href="#">Email Sent To User</a></h3>
1971
- <div>
1972
- <a id="new_email_button_top" href="#" onclick="javascript: document.mlw_quiz_add_email_form.submit();">Add New Email</a>
1973
- <table class="widefat">
1974
- <thead>
1975
- <tr>
1976
- <th>ID</th>
1977
- <th>Score Greater Than Or Equal To</th>
1978
- <th>Score Less Than Or Equal To</th>
1979
- <th>Subject</th>
1980
- <th>Email To Send</th>
1981
- </tr>
1982
- </thead>
1983
- <tbody>
1984
- <?php
1985
- $mlw_each_count = 0;
1986
- $alternate = "";
1987
- foreach($mlw_qmn_user_email_array as $mlw_each)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1988
  {
1989
- if($alternate) $alternate = "";
1990
- else $alternate = " class=\"alternate\"";
1991
- $mlw_each_count += 1;
1992
- if (!isset($mlw_each[3]))
1993
- {
1994
- $mlw_each[3] = "Quiz Results For %QUIZ_NAME%";
1995
- }
1996
- if ($mlw_each[0] == 0 && $mlw_each[1] == 0)
1997
- {
1998
- echo "<tr{$alternate}>";
1999
- echo "<td>";
2000
- echo "Default";
2001
- echo "</td>";
2002
- echo "<td>";
2003
- echo "<input type='hidden' id='user_email_begin_".$mlw_each_count."' name='user_email_begin_".$mlw_each_count."' value='0'/>-";
2004
- echo "</td>";
2005
- echo "<td>";
2006
- echo "<input type='hidden' id='user_email_end_".$mlw_each_count."' name='user_email_end_".$mlw_each_count."' value='0'/>-";
2007
- echo "</td>";
2008
- echo "<td>";
2009
- echo "<input type='text' id='user_email_subject_".$mlw_each_count."' name='user_email_subject_".$mlw_each_count."' value='".$mlw_each[3]."' />";
2010
- echo "</td>";
2011
- echo "<td>";
2012
- echo "<textarea cols='80' rows='15' id='user_email_".$mlw_each_count."' name='user_email_".$mlw_each_count."'>".$mlw_each[2]."</textarea>";
2013
- echo "</td>";
2014
- echo "</tr>";
2015
- break;
2016
- }
2017
- else
2018
- {
2019
- echo "<tr{$alternate}>";
2020
- echo "<td>";
2021
- echo $mlw_each_count."<div><span style='color:green;font-size:12px;'><a onclick=\"\$j('#trying_delete_email_".$mlw_each_count."').show();\">Delete</a></span></div><div style=\"display: none;\" id='trying_delete_email_".$mlw_each_count."'>Are you sure?<br /><a onclick=\"delete_email(".$mlw_each_count.")\">Yes</a>|<a onclick=\"\$j('#trying_delete_email_".$mlw_each_count."').hide();\">No</a></div>";
2022
- echo "</td>";
2023
- echo "<td>";
2024
- echo "<input type='text' id='user_email_begin_".$mlw_each_count."' name='user_email_begin_".$mlw_each_count."' title='What score must the user score better than to see this page' value='".$mlw_each[0]."'/>";
2025
- echo "</td>";
2026
- echo "<td>";
2027
- echo "<input type='text' id='user_email_end_".$mlw_each_count."' name='user_email_end_".$mlw_each_count."' title='What score must the user score worse than to see this page' value='".$mlw_each[1]."' />";
2028
- echo "</td>";
2029
- echo "<td>";
2030
- echo "<input type='text' id='user_email_subject_".$mlw_each_count."' name='user_email_subject_".$mlw_each_count."' value='".$mlw_each[3]."' />";
2031
- echo "</td>";
2032
- echo "<td>";
2033
- echo "<textarea cols='80' rows='15' id='user_email_".$mlw_each_count."' title='What email will the user be sent' name='user_email_".$mlw_each_count."'>".$mlw_each[2]."</textarea>";
2034
- echo "</td>";
2035
- echo "</tr>";
2036
- }
2037
  }
2038
- ?>
2039
- </tbody>
2040
- <tfoot>
2041
- <tr>
2042
- <th>ID</th>
2043
- <th>Score Greater Than Or Equal To</th>
2044
- <th>Score Less Than Or Equal To</th>
2045
- <th>Subject</th>
2046
- <th>Email To Send</th>
2047
- </tr>
2048
- </tfoot>
2049
- </table>
2050
- <a id="new_email_button_bottom" href="#" onclick="javascript: document.mlw_quiz_add_email_form.submit();">Add New Email</a>
2051
- <input type='hidden' name='mlw_save_email_template' value='confirmation' />
2052
- <input type='hidden' name='mlw_email_quiz_id' value='<?php echo $quiz_id; ?>' />
2053
- <input type='hidden' name='mlw_email_template_total' value='<?php echo $mlw_each_count; ?>' />
2054
- </div>
2055
- <h3><a href="#">Email Sent To Admin</a></h3>
2056
- <div>
2057
- <a id="new_admin_email_button_top" href="#" onclick="javascript: document.mlw_quiz_add_admin_email_form.submit();">Add New Email</a>
2058
- <table class="widefat">
2059
- <thead>
2060
- <tr>
2061
- <th>ID</th>
2062
- <th>Score Greater Than Or Equal To</th>
2063
- <th>Score Less Than Or Equal To</th>
2064
- <th>Subject</th>
2065
- <th>Email To Send</th>
2066
- </tr>
2067
- </thead>
2068
- <tbody>
2069
- <?php
2070
- $mlw_admin_count = 0;
2071
- $alternate = "";
2072
- foreach($mlw_qmn_admin_email_array as $mlw_each)
2073
  {
2074
- if($alternate) $alternate = "";
2075
- else $alternate = " class=\"alternate\"";
2076
- $mlw_admin_count += 1;
2077
- if (!isset($mlw_each["subject"]))
2078
- {
2079
- $mlw_each[3] = "Quiz Results For %QUIZ_NAME%";
2080
- }
2081
- if ($mlw_each["begin_score"] == 0 && $mlw_each["end_score"] == 0)
2082
- {
2083
- echo "<tr{$alternate}>";
2084
- echo "<td>";
2085
- echo "Default";
2086
- echo "</td>";
2087
- echo "<td>";
2088
- echo "<input type='hidden' id='admin_email_begin_".$mlw_admin_count."' name='admin_email_begin_".$mlw_admin_count."' value='0'/>-";
2089
- echo "</td>";
2090
- echo "<td>";
2091
- echo "<input type='hidden' id='admin_email_end_".$mlw_admin_count."' name='admin_email_end_".$mlw_admin_count."' value='0'/>-";
2092
- echo "</td>";
2093
- echo "<td>";
2094
- echo "<input type='text' id='admin_email_subject_".$mlw_admin_count."' name='admin_email_subject_".$mlw_admin_count."' value='".$mlw_each["subject"]."' />";
2095
- echo "</td>";
2096
- echo "<td>";
2097
- echo "<textarea cols='80' rows='15' id='admin_email_".$mlw_admin_count."' name='admin_email_".$mlw_admin_count."'>".$mlw_each["message"]."</textarea>";
2098
- echo "</td>";
2099
- echo "</tr>";
2100
- break;
2101
- }
2102
- else
2103
- {
2104
- echo "<tr{$alternate}>";
2105
- echo "<td>";
2106
- echo $mlw_admin_count."<div><span style='color:green;font-size:12px;'><a onclick=\"\$j('#trying_delete_admin_email_".$mlw_admin_count."').show();\">Delete</a></span></div><div style=\"display: none;\" id='trying_delete_admin_email_".$mlw_admin_count."'>Are you sure?<br /><a onclick=\"delete_admin_email(".$mlw_admin_count.")\">Yes</a>|<a onclick=\"\$j('#trying_delete_admin_email_".$mlw_admin_count."').hide();\">No</a></div>";
2107
- echo "</td>";
2108
- echo "<td>";
2109
- echo "<input type='text' id='admin_email_begin_".$mlw_admin_count."' name='admin_email_begin_".$mlw_admin_count."' title='What score must the user score better than to see this page' value='".$mlw_each["begin_score"]."'/>";
2110
- echo "</td>";
2111
- echo "<td>";
2112
- echo "<input type='text' id='admin_email_end_".$mlw_admin_count."' name='admin_email_end_".$mlw_admin_count."' title='What score must the user score worse than to see this page' value='".$mlw_each["end_score"]."' />";
2113
- echo "</td>";
2114
- echo "<td>";
2115
- echo "<input type='text' id='admin_email_subject_".$mlw_admin_count."' name='admin_email_subject_".$mlw_admin_count."' value='".$mlw_each["subject"]."' />";
2116
- echo "</td>";
2117
- echo "<td>";
2118
- echo "<textarea cols='80' rows='15' id='admin_email_".$mlw_admin_count."' title='What email will the user be sent' name='admin_email_".$mlw_admin_count."'>".$mlw_each["message"]."</textarea>";
2119
- echo "</td>";
2120
- echo "</tr>";
2121
- }
2122
  }
2123
- ?>
2124
- </tbody>
2125
- <tfoot>
2126
- <tr>
2127
- <th>ID</th>
2128
- <th>Score Greater Than Or Equal To</th>
2129
- <th>Score Less Than Or Equal To</th>
2130
- <th>Subject</th>
2131
- <th>Email To Send</th>
2132
- </tr>
2133
- </tfoot>
2134
- </table>
2135
- <a id="new_admin_email_button_bottom" href="#" onclick="javascript: document.mlw_quiz_add_admin_email_form.submit();">Add New Email</a>
2136
- <input type='hidden' name='mlw_email_admin_total' value='<?php echo $mlw_admin_count; ?>' />
2137
- </div>
2138
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2139
  </form>
2140
- <button id="save_email_button" onclick="javascript: document.mlw_quiz_save_email_form.submit();">Save Email Templates</button>
 
 
2141
  </div>
2142
  <?php
2143
  }
@@ -2295,8 +2277,8 @@ function mlw_options_results_tab_content()
2295
  <td><strong>%CERTIFICATE_LINK%</strong> - The link to the certificate after completing the quiz</td>
2296
  </tr>
2297
  </table>
2298
- <button id="save_landing_button" onclick="javascript: document.mlw_quiz_save_landing_form.submit();">Save Results Pages</button>
2299
- <button id="new_landing_button" onclick="javascript: document.mlw_quiz_add_landing_form.submit();">Add New Results Page</button>
2300
  <form method="post" action="" name="mlw_quiz_save_landing_form" style=" display:inline!important;">
2301
  <table class="widefat">
2302
  <thead>
@@ -2366,12 +2348,12 @@ function mlw_options_results_tab_content()
2366
  <input type='hidden' name='mlw_save_landing_pages' value='confirmation' />
2367
  <input type='hidden' name='mlw_landing_quiz_id' value='<?php echo $quiz_id; ?>' />
2368
  <input type='hidden' name='mlw_landing_page_total' value='<?php echo $mlw_each_count; ?>' />
2369
- <button id="save_landing_button" onclick="javascript: document.mlw_quiz_save_landing_form.submit();">Save Results Pages</button>
2370
  </form>
2371
  <form method="post" action="" name="mlw_quiz_add_landing_form" style=" display:inline!important;">
2372
  <input type='hidden' name='mlw_add_landing_page' value='confirmation' />
2373
  <input type='hidden' name='mlw_add_landing_quiz_id' value='<?php echo $quiz_id; ?>' />
2374
- <button id="new_landing_button" onclick="javascript: document.mlw_quiz_add_landing_form.submit();">Add New Results Page</button>
2375
  </form>
2376
  </div>
2377
  <?php
@@ -2461,7 +2443,7 @@ function mlw_options_styling_tab_content()
2461
  mlw_qmn_theme('<?php echo $mlw_quiz_options->theme_selected; ?>');
2462
  </script>
2463
  <br /><br />
2464
- <button id="save_styles_button" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
2465
  <hr />
2466
  <h3>Custom Theme CSS</h3>
2467
  <p>Entire quiz is a div with class 'mlw_qmn_quiz'</p>
@@ -2474,7 +2456,7 @@ function mlw_options_styling_tab_content()
2474
  <p>Each button shown for pagination (i.e Next/Previous) is wrapped in class 'mlw_qmn_quiz_link'</p>
2475
  <p>Timer is wrapped in class 'mlw_qmn_timer'</p>
2476
  <p>Each horizontal multiple response is wrapped in a span with class 'mlw_horizontal_multiple'</p>
2477
- <button id="save_styles_button" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
2478
 
2479
  <table class="form-table">
2480
  <tr>
@@ -2526,7 +2508,7 @@ function mlw_options_styling_tab_content()
2526
  </td>
2527
  </tr>
2528
  </table>
2529
- <button id="save_styles_button" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
2530
  </form>
2531
  </div>
2532
  <?php
@@ -2591,7 +2573,7 @@ function mlw_options_tools_tab_content()
2591
  });
2592
  </script>
2593
  <p>Use this button to reset all the stats collected for this quiz (Quiz Views and Times Quiz Has Been Taken). </p>
2594
- <button id="mlw_reset_stats_button">Reset Quiz Views And Taken Stats</button>
2595
  <?php do_action('mlw_qmn_quiz_tools'); ?>
2596
  <div id="mlw_reset_stats_dialog" title="Reset Stats For This Quiz" style="display:none;">
2597
  <p>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.</p>
30
  wp_enqueue_script( 'jquery-ui-dialog' );
31
  wp_enqueue_script( 'jquery-ui-button' );
32
  wp_enqueue_script( 'jquery-ui-datepicker' );
 
 
33
  wp_enqueue_script( 'jquery-ui-tabs' );
34
  wp_enqueue_script( 'jquery-effects-blind' );
35
  wp_enqueue_script( 'jquery-effects-explode' );
39
  // increase the default animation speed to exaggerate the effect
40
  $j.fx.speeds._default = 1000;
41
  $j(function() {
 
42
  $j( "#tabs" ).tabs();
43
  });
44
  </script>
438
  ?>
439
  <div id="tabs-1" class="mlw_tab_content">
440
  <script>
 
 
 
 
441
  jQuery(function() {
442
  jQuery('#new_question_dialog').dialog({
443
  autoOpen: false,
540
  background-color: black;
541
  }
542
  </style>
543
+ <button class="button" id="new_question_button_two">Add Question</button>
544
  <br />
545
  <?php
546
  $question_list = "";
654
  }
655
  ?>
656
  </table>
657
+ <a href="#" class="button" id="new_answer_button" onclick="mlw_add_new_question(<?php echo $mlw_question_info->question_id; ?>);">Add New Answer!</a>
658
  <br />
659
  <br />
660
  <table class="wide" style="text-align: left; white-space: nowrap;">
720
  </div></td>
721
  </tr>
722
  </table>
723
+ <p> *Required currently only works on open answer, number, accept, and captcha question types</p>
724
  <input type="hidden" name="question_<?php echo $mlw_question_info->question_id; ?>_answer_total" id="question_<?php echo $mlw_question_info->question_id; ?>_answer_total" value="<?php echo $mlw_answer_total; ?>" />
725
  <p class='submit'><input type='submit' class='button-primary' value='Edit Question' /></p>
726
  </form>
766
  $display .= "</table>";
767
  echo $display;
768
  ?>
769
+ <button class="button" id="new_question_button">Add Question</button>
770
  <div id="new_question_dialog" title="Create New Question" style="display:none;">
771
 
772
  <?php
811
  <td><input type="checkbox" id="answer_<?php echo $mlw_answer_total; ?>_correct" name="answer_<?php echo $mlw_answer_total; ?>_correct" checked="checked" value=1 /></td>
812
  </tr>
813
  </table>
814
+ <a href="#" class="button" id="new_answer_button" onclick="mlw_add_answer_to_new_question();">Add New Answer!</a>
815
  <br />
816
  <br />
817
  <table class="wide" style="text-align: left; white-space: nowrap;">
862
  <tr valign="top">
863
  <td><span style='font-weight:bold;'>Question Order</span></td>
864
  <td>
865
+ <input type="number" step="1" min="1" name="new_question_order" value="<?php echo $mlw_qmn_question_count+1; ?>" id="new_question_order" style="border-color:#000000;
866
  color:#3300CC;
867
  cursor:hand;"/>
868
  </td>
877
  </div></td>
878
  </tr>
879
  </table>
880
+ <p> *Required currently only works on open answer, number, accept, and captcha question types</p>
881
  <input type="hidden" name="new_question_answer_total" id="new_question_answer_total" value="<?php echo $mlw_answer_total; ?>" />
882
  <?php
883
  echo "<p class='submit'><input type='submit' class='button-primary' value='Create Question' /></p>";
1046
  <td><strong>%CURRENT_DATE%</strong> - The Current Date</td>
1047
  </tr>
1048
  </table>
1049
+ <button id="save_template_button" class="button" onclick="javascript: document.quiz_template_form.submit();">Save Templates</button>
1050
  <?php
1051
  echo "<form action='' method='post' name='quiz_template_form'>";
1052
  echo "<input type='hidden' name='save_templates' value='confirmation' />";
1062
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1063
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1064
  </td>
1065
+ <td><?php wp_editor( htmlspecialchars_decode($mlw_quiz_options->message_before, ENT_QUOTES), 'mlw_quiz_before_message' ); ?></td>
 
1066
  </tr>
1067
  <tr>
1068
  <td width="30%">
1072
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1073
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1074
  </td>
1075
+ <td><?php wp_editor( htmlspecialchars_decode($mlw_quiz_options->message_comment, ENT_QUOTES), 'mlw_quiz_before_comments' ); ?></td>
 
1076
  </tr>
1077
  <tr>
1078
  <td width="30%">
1082
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1083
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1084
  </td>
1085
+ <td><?php wp_editor( htmlspecialchars_decode($mlw_quiz_options->message_end_template, ENT_QUOTES), 'message_end_template' ); ?></td>
 
1086
  </tr>
1087
  <tr>
1088
  <td width="30%">
1092
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1093
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1094
  </td>
1095
+ <td><?php wp_editor( htmlspecialchars_decode($mlw_quiz_options->total_user_tries_text, ENT_QUOTES), 'mlw_quiz_total_user_tries_text' ); ?></td>
 
1096
  </tr>
1097
  <tr>
1098
  <td width="30%">
1102
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1103
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1104
  </td>
1105
+ <td><?php wp_editor( htmlspecialchars_decode($mlw_quiz_options->require_log_in_text, ENT_QUOTES), 'mlw_require_log_in_text' ); ?></td>
 
1106
  </tr>
1107
  <tr>
1108
  <td width="30%">
1112
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1113
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1114
  </td>
1115
+ <td><?php wp_editor( htmlspecialchars_decode($mlw_quiz_options->scheduled_timeframe_text, ENT_QUOTES), 'mlw_scheduled_timeframe_text' ); ?></td>
 
1116
  </tr>
1117
  <tr>
1118
  <td width="30%">
1122
  <p style="margin: 2px 0">- %QUIZ_NAME%</p>
1123
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1124
  </td>
1125
+ <td><?php wp_editor( htmlspecialchars_decode($mlw_quiz_options->limit_total_entries_text, ENT_QUOTES), 'mlw_limit_total_entries_text' ); ?></td>
 
1126
  </tr>
1127
  <tr>
1128
  <td width="30%">
1135
  <p style="margin: 2px 0">- %USER_COMMENTS%</p>
1136
  <p style="margin: 2px 0">- %CORRECT_ANSWER_INFO%</p>
1137
  </td>
1138
+ <td><?php wp_editor( htmlspecialchars_decode($mlw_quiz_options->question_answer_template, ENT_QUOTES), 'mlw_quiz_question_answer_template' ); ?></td>
 
1139
  </tr>
1140
  <tr>
1141
  <td width="30%">
1151
  <p style="margin: 2px 0">- %TIMER%</p>
1152
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1153
  </td>
1154
+ <td><?php wp_editor( htmlspecialchars_decode($qmn_social_media_text["twitter"], ENT_QUOTES), 'mlw_quiz_twitter_text_template' ); ?></td>
1155
  </td>
1156
  </tr>
1157
  <tr>
1168
  <p style="margin: 2px 0">- %TIMER%</p>
1169
  <p style="margin: 2px 0">- %CURRENT_DATE%</p>
1170
  </td>
1171
+ <td><?php wp_editor( htmlspecialchars_decode($qmn_social_media_text["facebook"], ENT_QUOTES), 'mlw_quiz_facebook_text_template' ); ?></td>
 
1172
  </tr>
1173
  </table>
1174
  <h3 style="text-align: center;">Other Templates</h3>
1210
  <td><input name="emailFromText" type="text" id="emailFromText" value="<?php echo $mlw_quiz_options->email_from_text; ?>" class="regular-text" /></td>
1211
  </tr>
1212
  </table>
1213
+ <button id="save_template_button" class="button" onclick="javascript: document.quiz_template_form.submit();">Save Templates</button>
1214
  <?php echo "</form>"; ?>
1215
  </div>
1216
  <?php
1235
  $mlw_total_user_tries = intval($_POST["total_user_tries"]);
1236
  $mlw_require_log_in = $_POST["require_log_in"];
1237
  $mlw_limit_total_entries = $_POST["limit_total_entries"];
 
 
1238
  $mlw_contact_location = $_POST["contact_info_location"];
1239
  $mlw_user_name = $_POST["userName"];
1240
  $mlw_user_comp = $_POST["userComp"];
1241
  $mlw_user_email = $_POST["userEmail"];
1242
  $mlw_user_phone = $_POST["userPhone"];
 
1243
  $mlw_comment_section = $_POST["commentSection"];
1244
  $mlw_qmn_loggedin_contact = $_POST["loggedin_user_contact"];
1245
  $qmn_scheduled_timeframe = serialize(array("start" => $_POST["scheduled_time_start"], "end" => $_POST["scheduled_time_end"]));
1246
  $quiz_id = $_POST["quiz_id"];
1247
 
1248
+ $update = "UPDATE " . $wpdb->prefix . "mlw_quizzes" . " SET system='".$mlw_system."', loggedin_user_contact='".$mlw_qmn_loggedin_contact."', contact_info_location=".$mlw_contact_location.", user_name='".$mlw_user_name."', user_comp='".$mlw_user_comp."', user_email='".$mlw_user_email."', user_phone='".$mlw_user_phone."', comment_section='".$mlw_comment_section."', randomness_order='".$mlw_randomness_order."', question_from_total=".$mlw_qmn_questions_from_total.", total_user_tries=".$mlw_total_user_tries.", social_media=".$mlw_qmn_social_media.", pagination=".$mlw_qmn_pagination.", timer_limit=".$mlw_qmn_timer.", question_numbering=".$mlw_qmn_question_numbering.", require_log_in=".$mlw_require_log_in.", limit_total_entries=".$mlw_limit_total_entries.", last_activity='".date("Y-m-d H:i:s")."', scheduled_timeframe='".$qmn_scheduled_timeframe."' WHERE quiz_id=".$quiz_id;
1249
  $results = $wpdb->query( $update );
1250
  if ($results != false)
1251
  {
1290
  jQuery( "#scheduled_time_start, #scheduled_time_end" ).datepicker();
1291
  });
1292
  </script>
1293
+ <button id="save_options_button" class="button" onclick="javascript: document.quiz_options_form.submit();">Save Options</button>
1294
  <?php
1295
  echo "<form action='' method='post' name='quiz_options_form'>";
1296
  echo "<input type='hidden' name='save_options' value='confirmation' />";
1412
  <input type="radio" id="radio22" name="commentSection" <?php if ($mlw_quiz_options->comment_section == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio22">No</label>
1413
  </div></td>
1414
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1415
  <tr valign="top">
1416
  <th scope="row"><label for="question_numbering">Show question number on quiz?</label></th>
1417
  <td><div id="question_numbering">
1427
  </div></td>
1428
  </tr>
1429
  </table>
1430
+ <button id="save_options_button" class="button" onclick="javascript: document.quiz_options_form.submit();">Save Options</button>
1431
  <?php echo "</form>"; ?>
1432
  </div>
1433
  <?php
1503
  <td><strong>%QUIZ_NAME%</strong> - The name of the quiz</td>
1504
  </tr>
1505
  </table>
1506
+ <button id="save_template_button" class="button" onclick="javascript: document.quiz_leaderboard_options_form.submit();">Save Leaderboard Options</button>
1507
  <?php
1508
  echo "<form action='' method='post' name='quiz_leaderboard_options_form'>";
1509
  echo "<input type='hidden' name='save_leaderboard_options' value='confirmation' />";
1531
  </td>
1532
  </tr>
1533
  </table>
1534
+ <button id="save_template_button" class="button" onclick="javascript: document.quiz_leaderboard_options_form.submit();">Save Leaderboard Options</button>
1535
  </form>
1536
  </div>
1537
  <?php
1600
  <h3>Quiz Certificate (Beta)</h3>
1601
  <p>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.</p>
1602
  <p>These fields cannot contain HTML.</p>
1603
+ <button id="save_certificate_button" class="button" onclick="javascript: document.quiz_certificate_options_form.submit();">Save Certificate Options</button>
1604
  <?php
1605
  echo "<form action='' method='post' name='quiz_certificate_options_form'>";
1606
  echo "<input type='hidden' name='save_certificate_options' value='confirmation' />";
1656
  </td>
1657
  </tr>
1658
  </table>
1659
+ <button id="save_certificate_button" class="button" onclick="javascript: document.quiz_certificate_options_form.submit();">Save Certificate Options</button>
1660
  </form>
1661
  </div>
1662
  <?php
1777
  $mlw_qmn_email_id = intval($_POST["mlw_email_quiz_id"]);
1778
  $mlw_qmn_email_template_total = intval($_POST["mlw_email_template_total"]);
1779
  $mlw_qmn_email_admin_total = intval($_POST["mlw_email_admin_total"]);
1780
+ $mlw_send_user_email = $_POST["sendUserEmail"];
1781
+ $mlw_send_admin_email = $_POST["sendAdminEmail"];
1782
+ $mlw_admin_email = $_POST["adminEmail"];
1783
 
1784
  //Create new array
1785
  $i = 1;
1813
  }
1814
  $mlw_qmn_new_email_array = serialize($mlw_qmn_new_email_array);
1815
  $mlw_qmn_new_admin_array = serialize($mlw_qmn_new_admin_array);
1816
+ $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 ) );
1817
  if ($mlw_new_email_results != false)
1818
  {
1819
  $mlwQuizMasterNext->alertManager->newAlert('The email has been updated successfully.', 'success');
1867
 
1868
  <div id="tabs-9" class="mlw_tab_content">
1869
  <script>
 
 
 
 
 
 
 
 
1870
  function delete_email(id)
1871
  {
1872
  document.getElementById('user_email_'+id).value = "Delete";
1914
  <td><strong>%TIMER%</strong> - The amount of time user spent of quiz</td>
1915
  </tr>
1916
  </table>
1917
+ <br />
1918
+ <br />
1919
  <form method="post" action="" name="mlw_quiz_add_email_form">
1920
  <input type='hidden' name='mlw_add_email_page' value='confirmation' />
1921
  <input type='hidden' name='mlw_add_email_quiz_id' value='<?php echo $quiz_id; ?>' />
1924
  <input type='hidden' name='mlw_add_admin_email_page' value='confirmation' />
1925
  <input type='hidden' name='mlw_add_admin_email_quiz_id' value='<?php echo $quiz_id; ?>' />
1926
  </form>
1927
+ <button id="save_email_button" class="button" onclick="javascript: document.mlw_quiz_save_email_form.submit();">Save Email Templates And Settings</button>
1928
  <form method="post" action="" name="mlw_quiz_save_email_form">
1929
+ <table class="form-table">
1930
+ <tr valign="top">
1931
+ <th scope="row"><label for="sendUserEmail">Send user email upon completion?</label></th>
1932
+ <td><div id="sendUserEmail">
1933
+ <input type="radio" id="radio5" name="sendUserEmail" <?php if ($mlw_quiz_options->send_user_email == 0) {echo 'checked="checked"';} ?> value='0' /><label for="radio5">Yes</label>
1934
+ <input type="radio" id="radio6" name="sendUserEmail" <?php if ($mlw_quiz_options->send_user_email == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio6">No</label>
1935
+ </div></td>
1936
+ </tr>
1937
+ <tr valign="top">
1938
+ <th scope="row"><label for="sendAdminEmail">Send admin email upon completion?</label></th>
1939
+ <td><div id="sendAdminEmail">
1940
+ <input type="radio" id="radio19" name="sendAdminEmail" <?php if ($mlw_quiz_options->send_admin_email == 0) {echo 'checked="checked"';} ?> value='0' /><label for="radio19">Yes</label>
1941
+ <input type="radio" id="radio20" name="sendAdminEmail" <?php if ($mlw_quiz_options->send_admin_email == 1) {echo 'checked="checked"';} ?> value='1' /><label for="radio20">No</label>
1942
+ </div></td>
1943
+ </tr>
1944
+ <tr valign="top">
1945
+ <th scope="row"><label for="adminEmail">What emails should we send the admin email to? Separate emails with a comma.</label></th>
1946
+ <td><input name="adminEmail" type="text" id="adminEmail" value="<?php echo $mlw_quiz_options->admin_email; ?>" class="regular-text" /></td>
1947
+ </tr>
1948
+ </table>
1949
+ <br />
1950
+ <br />
1951
+ <h3>Email Sent To User</h3>
1952
+ <a id="new_email_button_top" class="button" href="#" onclick="javascript: document.mlw_quiz_add_email_form.submit();">Add New User Email</a>
1953
+ <table class="widefat">
1954
+ <thead>
1955
+ <tr>
1956
+ <th>ID</th>
1957
+ <th>Score Greater Than Or Equal To</th>
1958
+ <th>Score Less Than Or Equal To</th>
1959
+ <th>Subject</th>
1960
+ <th>Email To Send</th>
1961
+ </tr>
1962
+ </thead>
1963
+ <tbody>
1964
+ <?php
1965
+ $mlw_each_count = 0;
1966
+ $alternate = "";
1967
+ foreach($mlw_qmn_user_email_array as $mlw_each)
1968
+ {
1969
+ if($alternate) $alternate = "";
1970
+ else $alternate = " class=\"alternate\"";
1971
+ $mlw_each_count += 1;
1972
+ if (!isset($mlw_each[3]))
1973
  {
1974
+ $mlw_each[3] = "Quiz Results For %QUIZ_NAME%";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1975
  }
1976
+ if ($mlw_each[0] == 0 && $mlw_each[1] == 0)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1977
  {
1978
+ echo "<tr{$alternate}>";
1979
+ echo "<td>";
1980
+ echo "Default";
1981
+ echo "</td>";
1982
+ echo "<td>";
1983
+ echo "<input type='hidden' id='user_email_begin_".$mlw_each_count."' name='user_email_begin_".$mlw_each_count."' value='0'/>-";
1984
+ echo "</td>";
1985
+ echo "<td>";
1986
+ echo "<input type='hidden' id='user_email_end_".$mlw_each_count."' name='user_email_end_".$mlw_each_count."' value='0'/>-";
1987
+ echo "</td>";
1988
+ echo "<td>";
1989
+ echo "<input type='text' id='user_email_subject_".$mlw_each_count."' name='user_email_subject_".$mlw_each_count."' value='".$mlw_each[3]."' />";
1990
+ echo "</td>";
1991
+ echo "<td>";
1992
+ echo "<textarea cols='80' rows='15' id='user_email_".$mlw_each_count."' name='user_email_".$mlw_each_count."'>".$mlw_each[2]."</textarea>";
1993
+ echo "</td>";
1994
+ echo "</tr>";
1995
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1996
  }
1997
+ else
1998
+ {
1999
+ echo "<tr{$alternate}>";
2000
+ echo "<td>";
2001
+ echo $mlw_each_count."<div><span style='color:green;font-size:12px;'><a onclick=\"\$j('#trying_delete_email_".$mlw_each_count."').show();\">Delete</a></span></div><div style=\"display: none;\" id='trying_delete_email_".$mlw_each_count."'>Are you sure?<br /><a onclick=\"delete_email(".$mlw_each_count.")\">Yes</a>|<a onclick=\"\$j('#trying_delete_email_".$mlw_each_count."').hide();\">No</a></div>";
2002
+ echo "</td>";
2003
+ echo "<td>";
2004
+ echo "<input type='text' id='user_email_begin_".$mlw_each_count."' name='user_email_begin_".$mlw_each_count."' title='What score must the user score better than to see this page' value='".$mlw_each[0]."'/>";
2005
+ echo "</td>";
2006
+ echo "<td>";
2007
+ echo "<input type='text' id='user_email_end_".$mlw_each_count."' name='user_email_end_".$mlw_each_count."' title='What score must the user score worse than to see this page' value='".$mlw_each[1]."' />";
2008
+ echo "</td>";
2009
+ echo "<td>";
2010
+ echo "<input type='text' id='user_email_subject_".$mlw_each_count."' name='user_email_subject_".$mlw_each_count."' value='".$mlw_each[3]."' />";
2011
+ echo "</td>";
2012
+ echo "<td>";
2013
+ echo "<textarea cols='80' rows='15' id='user_email_".$mlw_each_count."' title='What email will the user be sent' name='user_email_".$mlw_each_count."'>".$mlw_each[2]."</textarea>";
2014
+ echo "</td>";
2015
+ echo "</tr>";
2016
+ }
2017
+ }
2018
+ ?>
2019
+ </tbody>
2020
+ <tfoot>
2021
+ <tr>
2022
+ <th>ID</th>
2023
+ <th>Score Greater Than Or Equal To</th>
2024
+ <th>Score Less Than Or Equal To</th>
2025
+ <th>Subject</th>
2026
+ <th>Email To Send</th>
2027
+ </tr>
2028
+ </tfoot>
2029
+ </table>
2030
+ <a id="new_email_button_bottom" class="button" href="#" onclick="javascript: document.mlw_quiz_add_email_form.submit();">Add New User Email</a>
2031
+ <input type='hidden' name='mlw_save_email_template' value='confirmation' />
2032
+ <input type='hidden' name='mlw_email_quiz_id' value='<?php echo $quiz_id; ?>' />
2033
+ <input type='hidden' name='mlw_email_template_total' value='<?php echo $mlw_each_count; ?>' />
2034
+ <br />
2035
+ <br />
2036
+ <br />
2037
+ <br />
2038
+ <h3>Email Sent To Admin</h3>
2039
+ <a id="new_admin_email_button_top" class="button" href="#" onclick="javascript: document.mlw_quiz_add_admin_email_form.submit();">Add New Admin Email</a>
2040
+ <table class="widefat">
2041
+ <thead>
2042
+ <tr>
2043
+ <th>ID</th>
2044
+ <th>Score Greater Than Or Equal To</th>
2045
+ <th>Score Less Than Or Equal To</th>
2046
+ <th>Subject</th>
2047
+ <th>Email To Send</th>
2048
+ </tr>
2049
+ </thead>
2050
+ <tbody>
2051
+ <?php
2052
+ $mlw_admin_count = 0;
2053
+ $alternate = "";
2054
+ foreach($mlw_qmn_admin_email_array as $mlw_each)
2055
+ {
2056
+ if($alternate) $alternate = "";
2057
+ else $alternate = " class=\"alternate\"";
2058
+ $mlw_admin_count += 1;
2059
+ if (!isset($mlw_each["subject"]))
2060
+ {
2061
+ $mlw_each[3] = "Quiz Results For %QUIZ_NAME%";
2062
+ }
2063
+ if ($mlw_each["begin_score"] == 0 && $mlw_each["end_score"] == 0)
2064
+ {
2065
+ echo "<tr{$alternate}>";
2066
+ echo "<td>";
2067
+ echo "Default";
2068
+ echo "</td>";
2069
+ echo "<td>";
2070
+ echo "<input type='hidden' id='admin_email_begin_".$mlw_admin_count."' name='admin_email_begin_".$mlw_admin_count."' value='0'/>-";
2071
+ echo "</td>";
2072
+ echo "<td>";
2073
+ echo "<input type='hidden' id='admin_email_end_".$mlw_admin_count."' name='admin_email_end_".$mlw_admin_count."' value='0'/>-";
2074
+ echo "</td>";
2075
+ echo "<td>";
2076
+ echo "<input type='text' id='admin_email_subject_".$mlw_admin_count."' name='admin_email_subject_".$mlw_admin_count."' value='".$mlw_each["subject"]."' />";
2077
+ echo "</td>";
2078
+ echo "<td>";
2079
+ echo "<textarea cols='80' rows='15' id='admin_email_".$mlw_admin_count."' name='admin_email_".$mlw_admin_count."'>".$mlw_each["message"]."</textarea>";
2080
+ echo "</td>";
2081
+ echo "</tr>";
2082
+ break;
2083
+ }
2084
+ else
2085
+ {
2086
+ echo "<tr{$alternate}>";
2087
+ echo "<td>";
2088
+ echo $mlw_admin_count."<div><span style='color:green;font-size:12px;'><a onclick=\"\$j('#trying_delete_admin_email_".$mlw_admin_count."').show();\">Delete</a></span></div><div style=\"display: none;\" id='trying_delete_admin_email_".$mlw_admin_count."'>Are you sure?<br /><a onclick=\"delete_admin_email(".$mlw_admin_count.")\">Yes</a>|<a onclick=\"\$j('#trying_delete_admin_email_".$mlw_admin_count."').hide();\">No</a></div>";
2089
+ echo "</td>";
2090
+ echo "<td>";
2091
+ echo "<input type='text' id='admin_email_begin_".$mlw_admin_count."' name='admin_email_begin_".$mlw_admin_count."' title='What score must the user score better than to see this page' value='".$mlw_each["begin_score"]."'/>";
2092
+ echo "</td>";
2093
+ echo "<td>";
2094
+ echo "<input type='text' id='admin_email_end_".$mlw_admin_count."' name='admin_email_end_".$mlw_admin_count."' title='What score must the user score worse than to see this page' value='".$mlw_each["end_score"]."' />";
2095
+ echo "</td>";
2096
+ echo "<td>";
2097
+ echo "<input type='text' id='admin_email_subject_".$mlw_admin_count."' name='admin_email_subject_".$mlw_admin_count."' value='".$mlw_each["subject"]."' />";
2098
+ echo "</td>";
2099
+ echo "<td>";
2100
+ echo "<textarea cols='80' rows='15' id='admin_email_".$mlw_admin_count."' title='What email will the user be sent' name='admin_email_".$mlw_admin_count."'>".$mlw_each["message"]."</textarea>";
2101
+ echo "</td>";
2102
+ echo "</tr>";
2103
+ }
2104
+ }
2105
+ ?>
2106
+ </tbody>
2107
+ <tfoot>
2108
+ <tr>
2109
+ <th>ID</th>
2110
+ <th>Score Greater Than Or Equal To</th>
2111
+ <th>Score Less Than Or Equal To</th>
2112
+ <th>Subject</th>
2113
+ <th>Email To Send</th>
2114
+ </tr>
2115
+ </tfoot>
2116
+ </table>
2117
+ <a id="new_admin_email_button_bottom" class="button" href="#" onclick="javascript: document.mlw_quiz_add_admin_email_form.submit();">Add New Admin Email</a>
2118
+ <input type='hidden' name='mlw_email_admin_total' value='<?php echo $mlw_admin_count; ?>' />
2119
  </form>
2120
+ <br />
2121
+ <br />
2122
+ <button id="save_email_button" class="button" onclick="javascript: document.mlw_quiz_save_email_form.submit();">Save Email Templates And Settings</button>
2123
  </div>
2124
  <?php
2125
  }
2277
  <td><strong>%CERTIFICATE_LINK%</strong> - The link to the certificate after completing the quiz</td>
2278
  </tr>
2279
  </table>
2280
+ <button id="save_landing_button" class="button" onclick="javascript: document.mlw_quiz_save_landing_form.submit();">Save Results Pages</button>
2281
+ <button id="new_landing_button" class="button" onclick="javascript: document.mlw_quiz_add_landing_form.submit();">Add New Results Page</button>
2282
  <form method="post" action="" name="mlw_quiz_save_landing_form" style=" display:inline!important;">
2283
  <table class="widefat">
2284
  <thead>
2348
  <input type='hidden' name='mlw_save_landing_pages' value='confirmation' />
2349
  <input type='hidden' name='mlw_landing_quiz_id' value='<?php echo $quiz_id; ?>' />
2350
  <input type='hidden' name='mlw_landing_page_total' value='<?php echo $mlw_each_count; ?>' />
2351
+ <button id="save_landing_button" class="button" onclick="javascript: document.mlw_quiz_save_landing_form.submit();">Save Results Pages</button>
2352
  </form>
2353
  <form method="post" action="" name="mlw_quiz_add_landing_form" style=" display:inline!important;">
2354
  <input type='hidden' name='mlw_add_landing_page' value='confirmation' />
2355
  <input type='hidden' name='mlw_add_landing_quiz_id' value='<?php echo $quiz_id; ?>' />
2356
+ <button id="new_landing_button" class="button" onclick="javascript: document.mlw_quiz_add_landing_form.submit();">Add New Results Page</button>
2357
  </form>
2358
  </div>
2359
  <?php
2443
  mlw_qmn_theme('<?php echo $mlw_quiz_options->theme_selected; ?>');
2444
  </script>
2445
  <br /><br />
2446
+ <button id="save_styles_button" class="button" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
2447
  <hr />
2448
  <h3>Custom Theme CSS</h3>
2449
  <p>Entire quiz is a div with class 'mlw_qmn_quiz'</p>
2456
  <p>Each button shown for pagination (i.e Next/Previous) is wrapped in class 'mlw_qmn_quiz_link'</p>
2457
  <p>Timer is wrapped in class 'mlw_qmn_timer'</p>
2458
  <p>Each horizontal multiple response is wrapped in a span with class 'mlw_horizontal_multiple'</p>
2459
+ <button id="save_styles_button" class="button" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
2460
 
2461
  <table class="form-table">
2462
  <tr>
2508
  </td>
2509
  </tr>
2510
  </table>
2511
+ <button id="save_styles_button" class="button" onclick="javascript: document.quiz_style_form.submit();">Save Quiz Style</button>
2512
  </form>
2513
  </div>
2514
  <?php
2573
  });
2574
  </script>
2575
  <p>Use this button to reset all the stats collected for this quiz (Quiz Views and Times Quiz Has Been Taken). </p>
2576
+ <button class="button" id="mlw_reset_stats_button">Reset Quiz Views And Taken Stats</button>
2577
  <?php do_action('mlw_qmn_quiz_tools'); ?>
2578
  <div id="mlw_reset_stats_dialog" title="Reset Stats For This Quiz" style="display:none;">
2579
  <p>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.</p>
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 = "3.8.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 = "3.9.0";
10
  if ( ! get_option('mlw_quiz_master_version'))
11
  {
12