Skip to content

Commit

Permalink
Merge pull request #2447 from QuizandSurveyMaster/dev2
Browse files Browse the repository at this point in the history
Release 8.2.2
  • Loading branch information
etvarun authored Jan 18, 2024
2 parents fa0252f + 9bd1bf9 commit d5d6fa7
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 30 deletions.
13 changes: 9 additions & 4 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ function qmnValidation(element, quiz_form_id) {
by_pass = false;
}

if (localStorage.getItem('mlw_time_quiz' + quiz_id) === null || 0 == localStorage.getItem('mlw_time_quiz' + quiz_id) || localStorage.getItem('mlw_time_quiz' + quiz_id) > 0.08 || by_pass === false) {
if (localStorage.getItem('mlw_time_quiz' + quiz_id) === null || (0 == localStorage.getItem('mlw_time_quiz' + quiz_id) && by_pass == false) || localStorage.getItem('mlw_time_quiz' + quiz_id) > 0.08 || by_pass === false) {
if (jQuery(this).attr('class').indexOf('mlwRequiredNumber') > -1 && this.value === "" && +this.value != NaN) {
qmnDisplayError(error_messages.number_error_text, jQuery(this), quiz_form_id);
show_result_validation = false;
Expand Down Expand Up @@ -1331,9 +1331,9 @@ function qmnInitPagination(quiz_id) {
jQuery(document).trigger('qsm_init_pagination_after', [quiz_id, qmn_quiz_data]);
}
jQuery(document).on('qsm_next_button_click_after qsm_previous_button_click_after', function(event, quiz_id) {
let video_sections = jQuery(`.qsm-quiz-container-${quiz_id}.qmn_quiz_container`).find('video');
let iframeVideos = jQuery(`.qsm-quiz-container-${quiz_id}.qmn_quiz_container`).find('iframe');

let video_sections = jQuery('.qsm-quiz-container-' + quiz_id + '.qmn_quiz_container').find('video');
let iframeVideos = jQuery('.qsm-quiz-container-' + quiz_id + '.qmn_quiz_container .qsm-page, .qsm-quiz-container-' + quiz_id + '.qmn_quiz_container .qsm-auto-page-row').find('iframe');
let audio_sections = jQuery('.qsm-quiz-container-' + quiz_id + '.qmn_quiz_container').find('audio');
iframeVideos.each(function() {
let src = this.src;
jQuery(this).attr('src', src);
Expand All @@ -1343,6 +1343,11 @@ jQuery(document).on('qsm_next_button_click_after qsm_previous_button_click_after
this.pause();
}
});
audio_sections.each(function() {
if (!this.paused) {
this.pause();
}
});
});
function qmnSocialShare(network, mlw_qmn_social_text, mlw_qmn_title, facebook_id, share_url) {
var sTop = window.screen.height / 2 - (218);
Expand Down
4 changes: 2 additions & 2 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Quiz And Survey Master
* Description: Easily and quickly add quizzes and surveys to your website.
* Version: 8.2.1
* Version: 8.2.2
* Author: ExpressTech
* Author URI: https://quizandsurveymaster.com/
* Plugin URI: https://expresstech.io/
Expand Down Expand Up @@ -43,7 +43,7 @@ class MLWQuizMasterNext {
* @var string
* @since 4.0.0
*/
public $version = '8.2.1';
public $version = '8.2.2';

/**
* QSM Alert Manager Object
Expand Down
10 changes: 2 additions & 8 deletions php/admin/options-page-text-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ function mlw_options_text_tab_content() {
wp_editor( htmlspecialchars_decode( $value_answer, ENT_QUOTES ), 'qsm_question_text_message', array(
'editor_height' => 250,
'textarea_rows' => 10,
'tinymce' => array(
'toolbar1' => 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,alignjustify,link,wp_more,fullscreen,wp_adv',
'toolbar2' => 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help',
),
'tinymce' => true,
) );
?>
</div>
Expand Down Expand Up @@ -152,10 +149,7 @@ function mlw_options_text_tab_content() {
wp_editor( htmlspecialchars_decode( $value_answer, ENT_QUOTES ), 'qsm_question_text_message_variable', array(
'editor_height' => 250,
'textarea_rows' => 10,
'tinymce' => array(
'toolbar1' => 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,alignjustify,link,wp_more,fullscreen,wp_adv',
'toolbar2' => 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help',
),
'tinymce' => true,
) );
?>
</div>
Expand Down
5 changes: 1 addition & 4 deletions php/admin/settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,7 @@ public function results_details_template() {
}
wp_editor( $template, 'results_template', array(
'textarea_name' => 'qmn-settings[results_details_template]',
'tinymce' => array(
'toolbar1' => 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,alignjustify,link,wp_more,fullscreen,wp_adv',
'toolbar2' => 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help',
),
'tinymce' => true,
)
);
}
Expand Down
10 changes: 4 additions & 6 deletions php/classes/class-qsm-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,10 @@ public static function generate_editor_field( $field, $value ) {
</label>
</th>
<td>
<?php wp_editor( htmlspecialchars_decode( $value, ENT_QUOTES ), $field["id"], array(
'tinymce' => array(
'toolbar1' => 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,alignjustify,link,wp_more,fullscreen,wp_adv',
'toolbar2' => 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help',
),
) ); ?>
<?php
wp_editor( htmlspecialchars_decode( $value, ENT_QUOTES ), $field["id"], array(
'tinymce' => true,
) ); ?>
</td>
</tr>
<?php
Expand Down
1 change: 1 addition & 0 deletions php/classes/question-types/class-question-review.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ abstract class QSM_Question_Review {
public $answer_status = 'incorrect';
public $points = 0;
public $question_description = '';
public $question_type = 0;
public $input_field = '';
public $form_type = 0;
public $grading_system = 0;
Expand Down
11 changes: 9 additions & 2 deletions php/question-types/qsm-question-title.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ function qsm_question_title_func( $question, $question_type = '', $new_question_
$deselect_answer_text = ! empty( $qmn_quiz_options->deselect_answer_text ) ? $qmn_quiz_options->deselect_answer_text : $default_texts['deselect_answer_text'];
$deselect_answer = '<a href="javascript:void(0)" class="qsm-deselect-answer">'. $mlwQuizMasterNext->pluginHelper->qsm_language_support( $deselect_answer_text, "deselect_answer_text-{$qmn_quiz_options->quiz_id}" ) .'</a>';
}
do_action('qsm_question_title_func_before',$question, $question_type, $new_question_title, $question_id );
do_action('qsm_question_title_function_before',$question, $question_type, $new_question_title, $question_id );
if ( '' !== $new_question_title ) {
$new_question_title = $mlwQuizMasterNext->pluginHelper->qsm_language_support( htmlspecialchars_decode( $new_question_title, ENT_QUOTES ), "Question-{$question_id}", "QSM Questions");
$new_question_title = apply_filters( 'qsm_question_title_before', $new_question_title, $question_type, $question_id );
?>
<div class='mlw_qmn_new_question'><?php echo esc_html( $new_question_title ); ?> </div>
<?php
Expand All @@ -51,8 +52,14 @@ function qsm_question_title_func( $question, $question_type = '', $new_question_
$allow_html['input']['id'] = 1;
$allow_html['input']['maxlength'] = 1;
$allow_html = apply_filters( 'qsm_allow_html_question_title_after', $allow_html, $question_id );
$pattern = '/<code>(.*?)<\/code>/s';
$question_description = preg_replace_callback($pattern, function ( $matches ) {
return preg_replace([ '/<(?!(\/?code|br)[ >])/', '/>(?!(\/?code|br)[ \/>])/' ], [ '&lt;', '&gt;' ], $matches[0]);
}, $question_title);
$question_description = str_replace([ 'code&gt;', 'br /&gt;' ],[ 'code/>', 'br />' ], $question_description );
$question_description = apply_filters( 'qsm_question_description_before', $question_description, $question_type, $question_id );
?>
<p><?php echo do_shortcode( wp_kses( $question_title . $deselect_answer, $allow_html ) ); ?></p>
<p><?php echo do_shortcode( wp_kses( $question_description . $deselect_answer, $allow_html ) ); ?></p>
</div>
<?php
do_action('qsm_question_title_func_after',$question, $question_type, $new_question_title, $question_id );
Expand Down
5 changes: 2 additions & 3 deletions php/template-variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,6 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question
12,
5,
7,
// 14,
);
$form_type = isset( $mlw_quiz_array['form_type'] ) ? $mlw_quiz_array['form_type'] : 0;
$quiz_system = isset( $mlw_quiz_array['quiz_system'] ) ? $mlw_quiz_array['quiz_system'] : 0;
Expand Down Expand Up @@ -1130,10 +1129,10 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question
$is_answer_correct = 0;
if ( isset($answer['case_sensitive']) && 1 === intval( $answer['case_sensitive'] ) ) {
$decode_show_user_answer = htmlspecialchars_decode( $show_user_answer, ENT_QUOTES );
$decode_single_user_answer = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' );
$decode_single_user_answer = htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ), ENT_QUOTES );
} else {
$decode_show_user_answer = htmlspecialchars_decode( mb_strtoupper( $show_user_answer ), ENT_QUOTES );
$decode_single_user_answer = mb_strtoupper( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ) );
$decode_single_user_answer = mb_strtoupper( htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ), ENT_QUOTES ) );
}

if ( $decode_show_user_answer == $decode_single_user_answer ) {
Expand Down
9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: quiz, survey, lead, test, score, exam, questionnaire, question,wordpress q
Requires at least: 4.9
Tested up to: 6.4
Requires PHP: 5.4
Stable tag: 8.2.1
Stable tag: 8.2.2
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -163,6 +163,13 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
18. Database

== Changelog ==
= 8.2.2 (January 18, 2024) =
* Feature: Added an option to mark texts as code snippets in the question description
* Bug: Fixed the issue of skipping question validation after the quiz timer ends
* Bug: Fixed issue when using apostrophe in fill-in-the-blanks questions
* Bug: Fixed the quiz navigation problem with reCAPTCHA
* Enhancement: Improved auto-pause logic for embedded audio when shifting pages.

= 8.2.1 (January 05, 2024) =
* Feature: Added option to delete bulk questions
* Bug: Resolved JavaScript conflicts
Expand Down

0 comments on commit d5d6fa7

Please sign in to comment.