Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 9.2.1 #2680

Merged
merged 10 commits into from
Oct 16, 2024
1 change: 1 addition & 0 deletions css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@ tr .qsm-opt-desc {
#quiz_settings_wrapper .qsm-opt-desc {
display: none !important;
}
.qsm_page_qmn_global_settings .form-table td fieldset label,
.qsm_tab_content .form-table td fieldset label {
margin-right: 20px !important;
width: 100%;
Expand Down
12 changes: 8 additions & 4 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: 9.2.0
* Version: 9.2.1
* 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 = '9.2.0';
public $version = '9.2.1';

/**
* QSM Alert Manager Object
Expand Down Expand Up @@ -756,11 +756,15 @@ public function qsm_add_user_capabilities() {
);

$user = wp_get_current_user();
if ( empty( $user->roles ) || ! is_array( $user->roles ) ) {
return;
}
$roles = (array) $user->roles;
$rolename = $roles[0];

$role = get_role( $rolename );

if ( ! $role ) {
return;
}
// Remove all capabilities first.
foreach ( $administrator_capabilities as $cap ) {
if ( $role->has_cap( $cap ) ) {
Expand Down
3 changes: 3 additions & 0 deletions php/classes/class-qsm-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public static function generate_section( $fields, $section ) {
case 'number':
$sanitized_value = isset( $_POST[ $key ] ) ? intval( $_POST[ $key ] ) : "";
break;
case 'image':
$sanitized_value = isset( $_POST[ $key ] ) ? esc_url_raw( wp_unslash( $_POST[ $key ] ) ) : "";
break;
default:
$sanitized_value = isset( $_POST[ $key ] ) ? sanitize_text_field( wp_unslash( $_POST[ $key ] ) ) : "";
break;
Expand Down
11 changes: 5 additions & 6 deletions php/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,11 @@ function qsm_generate_fb_header_metadata() {
$sharing = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'facebook_sharing_text', '' );
$sharing = apply_filters( 'mlw_qmn_template_variable_results_page', $sharing, $results_array );
$default_fb_image = QSM_PLUGIN_URL . 'assets/icon-200x200.png';
$get_fb_sharing_image = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_options', 'result_page_fb_image', '' );
if ( empty( $get_fb_sharing_image ) ) {
$get_fb_sharing_image = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'result_page_fb_image', '' );
}
if ( '' !== $get_fb_sharing_image && filter_var( $get_fb_sharing_image, FILTER_VALIDATE_URL ) ) {
$default_fb_image = $get_fb_sharing_image;
$fb_sharing_image_quiz_options = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_options', 'result_page_fb_image', '' );
$fb_sharing_image_quiz_text = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'result_page_fb_image', '' );
$get_fb_sharing_image = ! empty($fb_sharing_image_quiz_options) ? $fb_sharing_image_quiz_options : $fb_sharing_image_quiz_text;
if ( ! empty($get_fb_sharing_image) && filter_var($get_fb_sharing_image, FILTER_VALIDATE_URL) ) {
$default_fb_image = esc_url($get_fb_sharing_image);
}
$post = $wp_query->get_queried_object();
$pagename = $post->post_title;
Expand Down
8 changes: 6 additions & 2 deletions php/template-variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -1194,14 +1194,16 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question
}
} else {
$options = array();
$question_correct_fill_answer_text = '';
foreach ( $total_answers as $key => $single_answer ) {
if ( isset($answer['case_sensitive']) && 1 === intval( $answer['case_sensitive'] ) ) {
$options[] = htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ), ENT_QUOTES );
} else {
$options[] = mb_strtoupper( htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ), ENT_QUOTES ) );
}
$question_correct_fill_answer_text .= '<span class="qsm-text-correct-option">(' . $key + 1 . ') ' . strval( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ) ) . '</span>';
}

$is_any_incorrect = false;
if ( sizeof( $new_array_user_answer ) < sizeof( $total_answers ) ) {
foreach ( $new_array_user_answer as $show_user_answer ) {
if ( isset($answer['case_sensitive']) && 1 === intval( $answer['case_sensitive'] ) ) {
Expand All @@ -1212,6 +1214,7 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question
if ( false !== $key ) {
$question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">' . htmlspecialchars_decode( $show_user_answer, ENT_QUOTES ) . '</span>';
} else {
$is_any_incorrect = true;
if ( '' === $show_user_answer ) {
$show_user_answer = $quiz_options->no_answer_text;
}
Expand All @@ -1229,14 +1232,15 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question
if ( false !== $key ) {
$question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">' . $show_user_answer . '</span>';
} else {

$is_any_incorrect = true;
if ( '' === $show_user_answer ) {
$show_user_answer = $quiz_options->no_answer_text;
}
$question_with_answer_text .= '<span class="qsm-text-wrong-option">' . $show_user_answer . '</span>';
}
}
}
$question_with_answer_text = $is_any_incorrect ? $question_with_answer_text . $question_correct_fill_answer_text : $question_with_answer_text;
}
} else {
if ( 0 == $form_type && ( 0 == $quiz_system || 3 == $quiz_system ) ) {
Expand Down
25 changes: 7 additions & 18 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: quiz, survey, test, exam, online assessment
Requires at least: 4.9
Tested up to: 6.6
Requires PHP: 5.4
Stable tag: 9.2.0
Stable tag: 9.2.1
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -35,22 +35,6 @@ This [WordPress quiz maker](https://quizandsurveymaster.com/free-quiz-maker-word

### DIVERSE RANGE OF QUESTIONS

Create quizzes, forms, or surveys with a variety of question types tailored to your specific goals:

- **Multiple Choice**: Choose one correct answer option.
- **Multiple Response**: Select multiple correct answer options.
- **Dropdown**: Pick one correct answer from the dropdown menu options.
- **Short Answer**: Provide concise written responses.
- **Paragraph**: Write longer, detailed answers.
- **Fill in the Blank**: Complete sentences with the correct missing words.
- **Date**: Select a specific calendar date.
- **File Upload**: Attach images, PDFs, and documents.
- **Number**: Enter answers in numerical format.
- **Captcha**: Verify identity with anti-bot check.
- **Polar**: Answer by choosing a spot on the slider scale.
- **Opt-in**: Use the checkbox selection to give permission/agree to a text.


Engage your audience effortlessly with our **interactive quiz builder**! Easily create tailored quizzes, forms, or surveys using diverse question types that align with your goals and make interaction fun.

- **Multiple Choice**: Choose one correct answer option.
Expand All @@ -66,7 +50,7 @@ Engage your audience effortlessly with our **interactive quiz builder**! Easily
- **Polar**: Answer by choosing a spot on the slider scale.
- **Opt-in**: Use the checkbox selection to give permission/agree to a text.

ADVANCED QUESTION TYPES
**ADVANCED QUESTION TYPES**
QSM comes with some advanced question types in their pro plan;

- **Matching Pairs** - Drag and drop answers vertically to match with the correct option.
Expand Down Expand Up @@ -238,6 +222,11 @@ As a WordPress quiz maker, QSM is designed to be compatible with most other plug
18. Database

== Changelog ==
= 9.2.1 ( October 16, 2024 ) =
* Bug: Resolved vulnerability issue with question settings
* Bug: Fixed issue with fill in the blanks question type while using random answers
* Bug: Fixed php warning with user permission function

= 9.2.0 ( October 07, 2024 ) =
* Bug: Resolved HTML tag issue with the %USER_ANSWER% variable
* Bug: Fixed the issue with contact form position settings
Expand Down
Loading