Skip to content

Commit

Permalink
Merge pull request #351 from fpcorso/release/4.6.5
Browse files Browse the repository at this point in the history
Release 4.6.5
  • Loading branch information
Frank Corso committed Jan 8, 2016
2 parents 697b0bc + 00bccf1 commit 6dc7bd2
Show file tree
Hide file tree
Showing 13 changed files with 226 additions and 183 deletions.
38 changes: 31 additions & 7 deletions css/qmn_admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ Quizzes/Surveys Page
font-size: 16px !important;
}

.qsm-quizzes-page-content {
display: flex;
flex-direction: column;
justify-content: space-between;
}

.qsm-quiz-page-wrapper {
width: 100%;
float: left;
flex-grow: 1;
}

.qsm-quiz-page-wrapper-with-ads {
width: 85%;
float: left;
flex-grow: 1;
}

.qsm-news-ads {
width: 13%;
float: right;
padding: 1%;
background-color: white;
}

Expand All @@ -28,6 +29,15 @@ Quizzes/Surveys Page
border-bottom: 1px solid black;
}

.qsm-news-ads-widget {
text-align: center;
border-top: 2px solid black;
border-bottom: 5px solid black;
margin: 10px 0;
background: #ddd;
padding: 10px 5px;
}

.qsm-edit-name {
font-size: 12px !important;
}
Expand Down Expand Up @@ -55,6 +65,20 @@ Quizzes/Surveys Page
padding-right: 30px;
}

@media screen and (min-width: 1200px) {
.qsm-quizzes-page-content {
flex-direction: row;
}

.qsm-quiz-page-wrapper-with-ads {
margin-right: 10px;
}

.qsm-news-ads {
flex-basis: 15%;
}
}



/********************
Expand Down
10 changes: 7 additions & 3 deletions js/qmn_quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function qmnValidation( element, quiz_form_id ) {
}

function qmnFormSubmit( quiz_form_id ) {
var quiz_id = +jQuery( '#' + quiz_form_id ).find( '.qmn_quiz_id' ).val();
var container = jQuery( '#' + quiz_form_id ).closest( '.qmn_quiz_container' );
var result = qmnValidation( '#' + quiz_form_id + ' *', quiz_form_id );

Expand All @@ -97,6 +98,7 @@ function qmnFormSubmit( quiz_form_id ) {
jQuery( '.mlw_answer_open_text' ).attr( 'disabled', false );

clearInterval( qsmTimerInterval );
qmnEndTimer( quiz_id );

var data = {
action: 'qmn_process_quiz',
Expand Down Expand Up @@ -175,7 +177,7 @@ function qmnActivateTimer( quiz_id ) {
window.amount = minutes * 60;
window.titleText = window.document.title;
jQuery( '#quizForm' + quiz_id + ' .mlw_qmn_timer').html( window.amount );
window.counter = setInterval( qmnTimer, 1000, quiz_id );
window.qsmCounter = setInterval( qmnTimer, 1000, quiz_id );
}

function qmnTimer( quiz_id ) {
Expand All @@ -202,8 +204,10 @@ function qmnTimer( quiz_id ) {
}

function qmnEndTimer( quiz_id ) {
window.sessionStorage.setItem('mlw_time_quiz' + qmn_quiz_id, 'completed');
window.sessionStorage.setItem('mlw_started_quiz' + qmn_quiz_id, 'no');
window.sessionStorage.setItem('mlw_time_quiz' + quiz_id, 'completed');
window.sessionStorage.setItem('mlw_started_quiz' + quiz_id, 'no');
window.document.title = window.titleText;
clearInterval( qsmCounter );
}

function qmnInitTimer( quiz_id ) {
Expand Down
9 changes: 5 additions & 4 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
/**
* Plugin Name: Quiz And Survey Master
* Description: Easily and quickly add quizzes and surveys to your website.
* Version: 4.6.4
* Version: 4.6.5
* Author: Frank Corso
* Author URI: http://www.quizandsurveymaster.com/
* Plugin URI: http://www.quizandsurveymaster.com/
* Text Domain: quiz-master-next
* Domain Path: /languages
*
* @author Frank Corso
* @version 4.6.4
* @version 4.6.5
*/
if ( ! defined( 'ABSPATH' ) ) exit;
/**
Expand All @@ -28,7 +28,7 @@ class MLWQuizMasterNext
* @var string
* @since 4.0.0
*/
public $version = '4.6.4';
public $version = '4.6.5';

/**
* QMN Alert Manager Object
Expand Down Expand Up @@ -195,7 +195,8 @@ public function register_quiz_post_types()
$cpt_slug = trim(strtolower(str_replace(" ", "-", $settings['cpt_slug'])));
}
$quiz_args = array(
'show_ui' => false,
'show_ui' => true,
'show_in_menu' => false,
'show_in_nav_menus' => true,
'labels' => $quiz_labels,
'publicly_queryable' => true,
Expand Down
8 changes: 5 additions & 3 deletions php/about-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,17 @@ function mlw_generate_about_page()
</div>
<div id="mlw_quiz_changelog" class="qmn_tab" style="display: none;">
<h2>Changelog</h2>
<h3><?php echo $mlw_quiz_version; ?> (December 15, 2015)</h3>
<h3><?php echo $mlw_quiz_version; ?> (January 9, 2015)</h3>
<ul class="changelog">
<!--
Examples:
<li class="add"><div class="two">Add</div>Some feature was added</li>
<li class="fixed"><div class="two">Fixed</div>Fixed some bug</li>
-->
<li class="fixed"><div class="two">Fixed</div>* Fixes undefined results notice displayed on admin results for some users</li>
<li class="fixed"><div class="two">Fixed</div>* Fixes bug that was causing the disable radio buttons option to not work in all browsers</li>
<li class="fixed"><div class="two">Fixed</div>* Fixes timer bug that caused the timer to continue counting down after quiz has been submitted</li>
<li class="fixed"><div class="two">Fixed</div>* Fixes theme conflict between QSM and some Bootstrap based themes</li>
<li class="fixed"><div class="two">Fixed</div>* Fixes Quizzes/Surveys page table width issue</li>
<li class="fixed"><div class="two">Fixed</div>* Fixes but preventing editing of quiz post settings</li>
<li class="fixed"><div class="two">Fixed</div>* Minor design changes</li>
</ul>
</div>
Expand Down
16 changes: 8 additions & 8 deletions php/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span><br />";
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span>";
$mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserName' value='".$current_user->display_name."' />";
$mlw_contact_display .= "<br /><br />";

Expand All @@ -1360,7 +1360,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span><br />";
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span>";
$mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserComp' value='' />";
$mlw_contact_display .= "<br /><br />";
}
Expand All @@ -1371,7 +1371,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwEmail mlwRequiredText\"";
}
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span><br />";
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span>";
$mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserEmail' value='".$current_user->user_email."' />";
$mlw_contact_display .= "<br /><br />";
}
Expand All @@ -1382,7 +1382,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span><br />";
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span>";
$mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserPhone' value='' />";
$mlw_contact_display .= "<br /><br />";
}
Expand All @@ -1403,7 +1403,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span><br />";
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->name_field_text, ENT_QUOTES)."</span>";
$mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserName' value='' />";
$mlw_contact_display .= "<br /><br />";
}
Expand All @@ -1414,7 +1414,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span><br />";
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->business_field_text, ENT_QUOTES)."</span>";
$mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserComp' value='' />";
$mlw_contact_display .= "<br /><br />";
}
Expand All @@ -1425,7 +1425,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwEmail mlwRequiredText\"";
}
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span><br />";
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->email_field_text, ENT_QUOTES)."</span>";
$mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserEmail' value='' />";
$mlw_contact_display .= "<br /><br />";
}
Expand All @@ -1436,7 +1436,7 @@ function mlwDisplayContactInfo($mlw_quiz_options)
{
$mlw_contact_class = "class=\"mlwRequiredText\"";
}
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span><br />";
$mlw_contact_display .= "<span class='mlw_qmn_question'>".htmlspecialchars_decode($mlw_quiz_options->phone_field_text, ENT_QUOTES)."</span>";
$mlw_contact_display .= "<input type='text' $mlw_contact_class x-webkit-speech name='mlwUserPhone' value='' />";
$mlw_contact_display .= "<br /><br />";
}
Expand Down
29 changes: 10 additions & 19 deletions php/question-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function qmn_multiple_choice_display($id, $question, $answers)
global $mlwQuizMasterNext;
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
if ($required == 0) {$mlw_requireClass = "mlwRequiredRadio";} else {$mlw_requireClass = "";}
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span><br />";
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span>";
$question_display .= "<div class='qmn_radio_answers $mlw_requireClass'>";
if (is_array($answers))
{
Expand Down Expand Up @@ -120,7 +120,7 @@ function qmn_horizontal_multiple_choice_display($id, $question, $answers)
global $mlwQuizMasterNext;
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
if ($required == 0) {$mlw_requireClass = "mlwRequiredRadio";} else {$mlw_requireClass = "";}
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span><br />";
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span>";
$question_display .= "<div class='qmn_radio_answers $mlw_requireClass'>";
if (is_array($answers))
{
Expand All @@ -136,7 +136,6 @@ function qmn_horizontal_multiple_choice_display($id, $question, $answers)
$question_display .= "<input type='radio' style='display: none;' name='question".$id."' id='question".$id."_none' checked='checked' value='No Answer Provided' />";
}
$question_display .= "</div>";
$question_display .= "<br />";
return $question_display;
}

Expand Down Expand Up @@ -208,7 +207,7 @@ function qmn_drop_down_display($id, $question, $answers)
{
$question_display = '';
global $mlwQuizMasterNext;
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span><br />";
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span>";
$question_display .= "<select name='question".$id."'>";
if (is_array($answers))
{
Expand All @@ -223,7 +222,6 @@ function qmn_drop_down_display($id, $question, $answers)
}
}
$question_display .= "</select>";
$question_display .= "<br />";
return $question_display;
}

Expand Down Expand Up @@ -297,9 +295,8 @@ function qmn_small_open_display($id, $question, $answers)
global $mlwQuizMasterNext;
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
if ($required == 0) {$mlw_requireClass = "mlwRequiredText";} else {$mlw_requireClass = "";}
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span><br />";
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span>";
$question_display .= "<input type='text' class='mlw_answer_open_text $mlw_requireClass' name='question".$id."' />";
$question_display .= "<br />";
return $question_display;
}

Expand Down Expand Up @@ -368,7 +365,7 @@ function qmn_multiple_response_display($id, $question, $answers)
global $mlwQuizMasterNext;
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
if ($required == 0) {$mlw_requireClass = "mlwRequiredCheck";} else {$mlw_requireClass = "";}
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span><br />";
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span>";
$question_display .= "<div class='qmn_check_answers $mlw_requireClass'>";
if (is_array($answers))
{
Expand All @@ -380,7 +377,6 @@ function qmn_multiple_response_display($id, $question, $answers)
{
$question_display .= "<input type='hidden' name='question".$id."' value='This value does not matter' />";
$question_display .= "<input type='checkbox' name='question".$id."_".$mlw_answer_total."' id='question".$id."_".$mlw_answer_total."' value='".esc_attr($answer[0])."' /> <label for='question".$id."_".$mlw_answer_total."'>".htmlspecialchars_decode($answer[0], ENT_QUOTES)."</label>";
$question_display .= "<br />";
}
}
}
Expand Down Expand Up @@ -467,9 +463,8 @@ function qmn_large_open_display($id, $question, $answers)
global $mlwQuizMasterNext;
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
if ($required == 0) {$mlw_requireClass = "mlwRequiredText";} else {$mlw_requireClass = "";}
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span><br />";
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span>";
$question_display .= "<textarea class='mlw_answer_open_text $mlw_requireClass' cols='70' rows='5' name='question".$id."' /></textarea>";
$question_display .= "<br />";
return $question_display;
}

Expand Down Expand Up @@ -545,7 +540,6 @@ function qmn_text_block_display($id, $question, $answers)
{
$question_display = '';
$question_display .= do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES));
$question_display .= "<br />";
return $question_display;
}

Expand Down Expand Up @@ -582,9 +576,8 @@ function qmn_number_display($id, $question, $answers)
global $mlwQuizMasterNext;
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
if ($required == 0) {$mlw_requireClass = "mlwRequiredNumber";} else {$mlw_requireClass = "";}
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span><br />";
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span>";
$question_display .= "<input type='number' class='mlw_answer_number $mlw_requireClass' name='question".$id."' />";
$question_display .= "<br />";
return $question_display;
}

Expand Down Expand Up @@ -713,10 +706,9 @@ function qmn_captcha_display($id, $question, $answers)
$question_display .= "<canvas alt='' id='mlw_captcha' class='mlw_captcha' width='100' height='50'></canvas>";
$question_display .= "</div>";
$question_display .= "<span class='mlw_qmn_question'>";
$question_display .= do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span><br />";
$question_display .= do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span>";
$question_display .= "<input type='text' class='mlw_answer_open_text $mlw_requireClass' id='mlw_captcha_text' name='mlw_user_captcha'/>";
$question_display .= "<input type='hidden' name='mlw_code_captcha' id='mlw_code_captcha' value='none' />";
$question_display .= "<br />";
$question_display .= "<script>
var mlw_code = '';
var mlw_chars = '0123456789ABCDEFGHIJKL!@#$%^&*()MNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
Expand Down Expand Up @@ -767,7 +759,7 @@ function qmn_horizontal_multiple_response_display($id, $question, $answers)
global $mlwQuizMasterNext;
$required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
if ($required == 0) {$mlw_requireClass = "mlwRequiredCheck";} else {$mlw_requireClass = "";}
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span><br />";
$question_display .= "<span class='mlw_qmn_question'>".do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES))."</span>";
$question_display .= "<div class='qmn_check_answers $mlw_requireClass'>";
if (is_array($answers))
{
Expand Down Expand Up @@ -887,9 +879,8 @@ function qmn_fill_blank_display($id, $question, $answers)
{
$question = str_replace( "%BLANK%", $input_text, do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES)));
}
$question_display = "<span class='mlw_qmn_question'>$question</span><br />";
$question_display = "<span class='mlw_qmn_question'>$question</span>";

$question_display .= "<br />";
return $question_display;
}

Expand Down
Loading

0 comments on commit 6dc7bd2

Please sign in to comment.