Skip to content

Commit

Permalink
Merge pull request #199 from fpcorso/release/4.3.1
Browse files Browse the repository at this point in the history
Release 4.3.1
  • Loading branch information
fpcorso committed Apr 22, 2015
2 parents 03c8d13 + 52099fa commit e7bce6d
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 37 deletions.
116 changes: 98 additions & 18 deletions js/qmn_pagination.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,75 @@
setTimeout(function(){
var $j = jQuery.noConflict();
$j( ".quiz_section" ).hide();
$j( ".quiz_section" ).append( "<br />" );
$j( ".mlw_qmn_quiz" ).append( "<a class=\"mlw_qmn_quiz_link mlw_previous\" href=\"javascript:prevSlide("+qmn_pagination+", 1);\">"+qmn_pagination_previous_text+"</a>" );
$j( ".mlw_qmn_quiz" ).append( "<a class=\"mlw_qmn_quiz_link mlw_next\" href=\"javascript:nextSlide("+qmn_pagination+", 1);\">"+qmn_pagination_next_text+"</a>" );
window.mlw_quiz_slide = 0;
window.mlw_previous = 0;
window.mlw_quiz_total_slides = qmn_section_limit;
nextSlide(1, 0);
}, 100);
function qmnValidatePage() {
var validated = true;
jQuery(".quiz_section.slide"+window.mlw_quiz_slide+' *').each(function(){
jQuery(this).css("outline", "");
if (jQuery(this).attr('class'))
{
if(jQuery(this).attr('class').indexOf('mlwEmail') > -1 && this.value != "")
{
var x=this.value;
var atpos=x.indexOf('@');
var dotpos=x.lastIndexOf('.');
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
jQuery('.qmn_page_error_message').text('**'+email_error+'**');
validated = false;
jQuery(this).css("outline", "2px solid red");
}
}
if(jQuery(this).attr('class').indexOf('mlwRequiredNumber') > -1 && this.value == "" && +this.value != NaN)
{
jQuery('.qmn_page_error_message').text('**'+number_error+'**');
jQuery(this).css("outline", "2px solid red");
validated = false;
}
if(jQuery(this).attr('class').indexOf('mlwRequiredText') > -1 && this.value == "")
{
jQuery('.qmn_page_error_message').text('**'+empty_error+'**');
jQuery(this).css("outline", "2px solid red");
validated = false;
}
if(jQuery(this).attr('class').indexOf('mlwRequiredCaptcha') > -1 && this.value != mlw_code)
{
jQuery('.qmn_page_error_message').text('**'+incorrect_error+'**');
jQuery(this).css("outline", "2px solid red");
validated = false;
}
if(jQuery(this).attr('class').indexOf('mlwRequiredAccept') > -1 && !this.checked)
{
jQuery('.qmn_page_error_message').text('**'+empty_error+'**');
jQuery(this).css("outline", "2px solid red");
validated = false;
}
if(jQuery(this).attr('class').indexOf('mlwRequiredRadio') > -1)
{
check_val = jQuery(this).find('input:checked').val();
if (check_val == "No Answer Provided")
{
jQuery('.qmn_page_error_message').text('**'+empty_error+'**');
jQuery(this).css("outline", "2px solid red");
validated = false;
}
}
if(jQuery(this).attr('class').indexOf('mlwRequiredCheck') > -1)
{
if (!jQuery(this).find('input:checked').length)
{
jQuery('.qmn_page_error_message').text('**'+empty_error+'**');
jQuery(this).css("outline", "2px solid red");
validated = false;
}
}
}
});
if (validated) {
jQuery('.qmn_page_error_message').text(' ');
}
return validated;
}
function nextSlide(mlw_pagination, mlw_goto_top)
{
jQuery( ".quiz_section" ).hide();
for (var i = 0; i < mlw_pagination; i++)
for (var i = 0; i < mlw_pagination; i++)
{
if (i == 0 && window.mlw_previous == 1 && window.mlw_quiz_slide > 1)
{
Expand All @@ -37,11 +94,11 @@ function nextSlide(mlw_pagination, mlw_goto_top)
if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
{
jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
}
}
if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
{
jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
}
}
jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
}
window.mlw_previous = 0;
Expand All @@ -54,8 +111,8 @@ function nextSlide(mlw_pagination, mlw_goto_top)
function prevSlide(mlw_pagination, mlw_goto_top)
{
jQuery( ".quiz_section" ).hide();
for (var i = 0; i < mlw_pagination; i++)
{
for (var i = 0; i < mlw_pagination; i++)
{
if (i == 0 && window.mlw_previous == 0)
{
window.mlw_quiz_slide = window.mlw_quiz_slide - mlw_pagination;
Expand All @@ -79,12 +136,12 @@ function prevSlide(mlw_pagination, mlw_goto_top)
if (window.mlw_quiz_slide == window.mlw_quiz_total_slides)
{
jQuery( ".mlw_qmn_quiz_link.mlw_next" ).hide();
}
}
if (window.mlw_quiz_slide < window.mlw_quiz_total_slides)
{
jQuery( ".mlw_qmn_quiz_link.mlw_next" ).show();
}
jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
jQuery( ".quiz_section.slide"+window.mlw_quiz_slide ).show();
}
window.mlw_previous = 1;
if (mlw_goto_top == 1)
Expand All @@ -93,3 +150,26 @@ function prevSlide(mlw_pagination, mlw_goto_top)
window.location.hash = "mlw_top_of_quiz";
}
}

jQuery( ".quiz_section" ).hide();
jQuery( ".quiz_section" ).append( "<br />" );
jQuery( ".mlw_qmn_quiz" ).append( '<a class="mlw_qmn_quiz_link mlw_previous" href="#">'+qmn_pagination_previous_text+'</a>' );
jQuery( ".mlw_qmn_quiz" ).append( '<span class="qmn_page_message"></span>' );
jQuery( ".mlw_qmn_quiz" ).append( '<span class="qmn_page_error_message"></span>' );
jQuery( ".mlw_qmn_quiz" ).append( '<a class="mlw_qmn_quiz_link mlw_next" href="#">'+qmn_pagination_next_text+'</a>' );
window.mlw_quiz_slide = 0;
window.mlw_previous = 0;
window.mlw_quiz_total_slides = qmn_section_limit;
nextSlide(1, 0);

jQuery(".mlw_next").click(function(event) {
event.preventDefault();
if ( qmnValidatePage() ) {
nextSlide(qmn_pagination, 0);
}
});

jQuery(".mlw_previous").click(function(event) {
event.preventDefault();
prevSlide(qmn_pagination, 0);
});
6 changes: 3 additions & 3 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Quiz Master Next
* Description: Use this plugin to add multiple quizzes, tests, or surveys to your website.
* Version: 4.3.0
* Version: 4.3.1
* Author: Frank Corso
* Author URI: http://www.mylocalwebstop.com/
* Plugin URI: http://www.quizmasternext.com/
Expand All @@ -16,7 +16,7 @@
* You understand that you install, operate, and unistall the plugin at your own discretion and risk.
*
* @author Frank Corso
* @version 4.3.0
* @version 4.3.1
*/
if ( ! defined( 'ABSPATH' ) ) exit;
/**
Expand All @@ -34,7 +34,7 @@ class MLWQuizMasterNext
* @var string
* @since 4.0.0
*/
public $version = '4.3.0';
public $version = '4.3.1';

/**
* QMN Alert Manager Object
Expand Down
9 changes: 1 addition & 8 deletions php/qmn_credits.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,8 @@ function mlw_generate_about_page()
<br />
</div>
<div id="mlw_quiz_changelog" style="display: none;">
<h3><?php echo $mlw_quiz_version; ?> (April 20, 2015)</h3>
<h3><?php echo $mlw_quiz_version; ?> (April 22, 2015)</h3>
<ul>
<li>* Redesigned Stats Page <a target="_blank" href='https://github.com/fpcorso/quiz_master_next/issues/177'>GitHub Issue #177</a></li>
<li>* Added Ability To Have Shortcodes In Questions <a target="_blank" href='https://github.com/fpcorso/quiz_master_next/issues/175'>GitHub Issue #175</a></li>
<li>* Added Editor To Questions <a target="_blank" href='https://github.com/fpcorso/quiz_master_next/issues/36'>GitHub Issue #36</a></li>
<li>* Added Ability To Edit Quiz Post <a target="_blank" href='https://github.com/fpcorso/quiz_master_next/issues/176'>GitHub Issue #176</a></li>
<li>* Added Ability To Search Questions <a target="_blank" href='https://github.com/fpcorso/quiz_master_next/issues/151'>GitHub Issue #151</a></li>
<li>* Design Changes To Questions Tab</li>
<li>* Minor Design Changes</li>
<li>* Minor Bug Fixes</li>
</ul>
</div>
Expand Down
3 changes: 1 addition & 2 deletions php/qmn_quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -836,9 +836,8 @@ public function generate_certificate($qmn_quiz_options, $qmn_array_for_variables
$mlw_qmn_certificate_file.=$mlw_certificate_options[2] != '' ? '$pdf->Image("'.$mlw_certificate_options[2].'",110,130);' : '';
$mlw_qmn_certificate_file.=<<<EOC
\$pdf->Output('mlw_qmn_certificate.pdf','D');
unlink(__FILE__);
EOC;
$mlw_qmn_certificate_filename = str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$qmn_array_for_variables['timer'].".php";
$mlw_qmn_certificate_filename = str_replace(site_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis").$qmn_array_for_variables['timer'].".php";
file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file);
$mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis").$qmn_array_for_variables['timer'].".php";
$mlw_certificate_link = "<a href='".$mlw_qmn_certificate_filename."' class='qmn_certificate_link'>Download Certificate</a>";
Expand Down
3 changes: 3 additions & 0 deletions php/qmn_quiz_creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ public function create_quiz($quiz_name)
-webkit-box-shadow: inset 0 3px 3px rgba(0,0,0,.075);
box-shadow: inset 0 3px 3px rgba(0,0,0,.075);
border: 1px solid #ccc;
}
.qmn_page_error_message {
color: red;
}";
$mlw_question_answer_default = "%QUESTION%<br /> Answer Provided: %USER_ANSWER%<br /> Correct Answer: %CORRECT_ANSWER%<br /> Comments Entered: %USER_COMMENTS%<br />";
$results = $wpdb->insert(
Expand Down
3 changes: 1 addition & 2 deletions php/qmn_results_details.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,8 @@ function qmn_generate_results_certificate_tab()
$mlw_qmn_certificate_file.=$mlw_certificate_options[2] != '' ? '$pdf->Image("'.$mlw_certificate_options[2].'",110,130);' : '';
$mlw_qmn_certificate_file.=<<<EOC
\$pdf->Output('mlw_qmn_certificate.pdf','D');
unlink(__FILE__);
EOC;
$mlw_qmn_certificate_filename = "../".str_replace(home_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis")."admin.php";
$mlw_qmn_certificate_filename = "../".str_replace(site_url()."/", '', plugin_dir_url( __FILE__ ))."certificates/mlw_qmn_quiz".date("YmdHis")."admin.php";
file_put_contents($mlw_qmn_certificate_filename, $mlw_qmn_certificate_file);
$mlw_qmn_certificate_filename = plugin_dir_url( __FILE__ )."certificates/mlw_qmn_quiz".date("YmdHis")."admin.php";
}
Expand Down
4 changes: 2 additions & 2 deletions php/qmn_usage_tracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ public function admin_notice()
}
else
{
$optin_url = add_query_arg( 'qmn_track_check', 'opt_into_tracking' );
$optout_url = add_query_arg( 'qmn_track_check', 'opt_out_of_tracking' );
$optin_url = esc_url( add_query_arg( 'qmn_track_check', 'opt_into_tracking' ) );
$optout_url = esc_url( add_query_arg( 'qmn_track_check', 'opt_out_of_tracking' ) );
echo '<div class="updated"><p>';
echo __( "Allow Quiz Master Next to anonymously track this plugin's usage and help us make this plugin better? No sensitive data is tracked.", 'quiz-master-next' );
echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'quiz-master-next' ) . '</a>';
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: fpcorso
Donate link: http://mylocalwebstop.com/downloads/donation-service-payment/
Tags: quiz, test, score, exam, survey, contact, form, email, answer, question, certificate, points, results, math
Requires at least: 3.8.1
Tested up to: 4.1.1
Stable tag: 4.3.0
Tested up to: 4.2
Stable tag: 4.3.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -122,6 +122,9 @@ Feel free to use the widget on the help page within the plugin or from our [cont

== Changelog ==

= 4.3.1 (April 22, 2015) =
* Minor Bug Fixes

= 4.3.0 (April 20, 2015) =
* Redesigned Stats Page ([GitHub Issue #177](https://github.com/fpcorso/quiz_master_next/issues/177))
* Added Ability To Have Shortcodes In Questions ([GitHub Issue #175](https://github.com/fpcorso/quiz_master_next/issues/175))
Expand Down

0 comments on commit e7bce6d

Please sign in to comment.