Skip to content

Commit

Permalink
merge with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-pranav committed Sep 25, 2024
2 parents 9a4ab5d + dfbbea1 commit 0df4fb5
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 107 deletions.
34 changes: 13 additions & 21 deletions css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -841,10 +841,6 @@ ul.changelog li.update div.two:before {
align-items: stretch;
border-bottom: 1px solid #cecece;
}
/* .qsm-sub-text-tab-menu {
display: inline-block;
width: 100%;
} */
.save-text-changes {
display: flex;
flex-direction: row-reverse;
Expand Down Expand Up @@ -926,8 +922,8 @@ ul.changelog li.update div.two:before {
padding: 10px 6px;
width: 100%;
}
.qsm-sub-text-tab-menu a,
.qsm-sub-tab-menu a,
.qsm-sub-text-tab-menu a,
.qsm_tab_content a {
cursor: pointer;
text-decoration: none;
Expand Down Expand Up @@ -3125,7 +3121,8 @@ input#duplicate_questions {
.auto-fold .option-page-result-page-tab-footer {
left: 36px;
}
.option-page-option-tab-footer, .option-page-result-page-tab-footer, .contact-page-tab-footer {
.option-page-option-tab-footer, .option-page-result-page-tab-footer,
.contact-page-tab-footer {
position: fixed;
bottom: 0;
right: 0;
Expand All @@ -3152,7 +3149,9 @@ input#duplicate_questions {
width: 60%;
}
@media screen and (min-width: 1900px) {
.option-page-option-tab-footer,.option-page-result-page-tab-footer,.contact-page-tab-footer {
.option-page-option-tab-footer,
.option-page-result-page-tab-footer,
.contact-page-tab-footer {
flex-direction: row-reverse;
}
}
Expand Down Expand Up @@ -3189,25 +3188,19 @@ input#duplicate_questions {
margin: 0 10px 0 0;
}
@media screen and (min-width: 961px) {
.folded .option-page-result-page-tab-footer {
left: 36px !important;
}
.option-page-result-page-tab-footer {
left: 160px !important;
}
.folded .option-page-option-tab-footer,
.folded .contact-page-tab-footer {
.folded .option-page-result-page-tab-footer,
.folded .contact-page-tab-footer,
.folded .option-page-option-tab-footer {
left: 36px !important;
}
.option-page-option-tab-footer,
.contact-page-tab-footer {
.option-page-result-page-tab-footer,
.contact-page-tab-footer,
.option-page-option-tab-footer {
left: 160px !important;
}
}
@media screen and (max-width: 782px) {
.option-page-result-page-tab-footer {
left: 0 !important;
}
.option-page-result-page-tab-footer,
.option-page-option-tab-footer,
.contact-page-tab-footer {
left: 0 !important;
Expand Down Expand Up @@ -3470,7 +3463,6 @@ input#preferred-date-format-custom {
content: "";
width: calc(100% + 26px);
}

/* Extra shortcodes popup */
button.button.qsm-extra-shortcode-popup {
display: flex;
Expand Down
17 changes: 3 additions & 14 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,11 +612,6 @@ var QSMAdmin;
MicroModal.show('modal-proctor-quiz');
});

$(document).on('click', '.quiz_style_tab_content #qsm_ultimate_progress_bar', function (e) {
e.preventDefault();
MicroModal.show('qsm-ultimate-upgrade');
});

jQuery(document).on('click', '#btn_export', function (e) {
e.preventDefault();
jQuery.ajax({
Expand Down Expand Up @@ -790,13 +785,6 @@ jQuery('.quiz_text_tab').click(function (e) {
if(current_id == 'qsm_general_text'){ jQuery(".current_general")[0].click();}
if(current_id == 'qsm_variable_text'){ jQuery(".current_variable")[0].click();}
if(current_id == 'qsm_custom_label'){ jQuery("#postbox-container-1").css("display", "none");}
if(current_id == 'qsm_button_custom_class') {
jQuery("#postbox-container-1").css("display", "none");
if ( jQuery("#qsm_button_custom_class").find('.left-bar').length == 0 ) {
jQuery(".qsm-text-main-wrap #post-body-content").css("background", "transparent");
jQuery(".quiz_text_tab_content").css("border", "none");
}
}
jQuery('#' + current_id).show();
jQuery(document).trigger('qsm_quiz_text_tab_after', [current_id]);
});
Expand Down Expand Up @@ -1400,12 +1388,12 @@ function qsm_is_substring_in_array( text, array ) {
}
}
addTinyMceAutoSuggestion();

$( document ).on( 'click', '.qsm-extra-shortcode-popup', function( e ) {
e.preventDefault();
MicroModal.show('modal-extra-shortcodes');
} );

jQuery(document).on('qsm_after_add_result_block', function(event, conditions, page, redirect, total) {
let $matchingElement = $(`#results-page-${total}`);
let $button = $matchingElement.parents('.results-page-show').find('.qsm-result-editor-custom-button');
Expand Down Expand Up @@ -3785,6 +3773,7 @@ var import_button;
})
.done(function (results) {
if (results.status) {
jQuery(document).trigger('qsm_after_save_results');
QSMAdmin.displayAlert(qsm_admin_messages.results_page_saved, 'success');
} else {
QSMAdmin.displayAlert( qsm_admin_messages.results_page_save_error + ' ' + qsm_admin_messages.results_page_saved, 'error');
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: 9.1.2
* Version: 9.1.3
* 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.1.2';
public $version = '9.1.3';

/**
* QSM Alert Manager Object
Expand Down
15 changes: 0 additions & 15 deletions php/admin/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1656,19 +1656,4 @@ function qsm_advanced_assessment_quiz_page_content() {
"addon_link" => qsm_get_plugin_link( 'downloads/advanced-assessment', 'quiz-documentation', 'plugin', 'advanced-assessment', 'qsm_plugin_upsell' ),
);
qsm_admin_upgrade_content( $args, 'page' );
}
function qsm_ultimate_addon_upgrade_content() {
$args = array(
"id" => 'qsm-ultimate-upgrade',
"title" => __( 'QSM Ultimate Addon', 'quiz-master-next' ),
"description" => __( 'Enjoy features like adding "other" options, bulk answer input, question-based progress bars, automatic page navigation, and showing detailed results after collecting contact details. Customize buttons, progress bar placement, and colors schemes and more with QSM Ultimate addon', 'quiz-master-next' ),
"chart_image" => plugins_url( '', dirname( __FILE__ ) ) . '/images/ultimate_upgrade.png',
"warning" => __( 'Missing Feature - QSM Ultimate Add-on required', 'quiz-master-next' ),
"information" => __( 'QSM Addon Bundle is the best way to get all our add-ons at a discount. Upgrade to save 95% today. OR you can buy QSM Ultimate Addon separately.', 'quiz-master-next' ),
"buy_btn_text" => __( 'Buy QSM Ultimate Addon', 'quiz-master-next' ),
"doc_link" => qsm_get_plugin_link( 'docs/add-ons/ultimate', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
"upgrade_link" => qsm_get_plugin_link( 'pricing', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
"addon_link" => qsm_get_plugin_link( 'downloads/ultimate', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
);
qsm_admin_upgrade_content( $args, 'page' );
}
4 changes: 2 additions & 2 deletions php/admin/options-page-questions-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ class="save-page-button button button-primary"><?php esc_html_e( 'Save Questions
'type' => 'text',
'default' => '',
'priority' => '1',
'show' => '3, 5, 7',
'show' => '3, 5, 7' . $placeholder_text,
),
);
$advanced_question_option = apply_filters( 'qsm_question_advanced_option', $advanced_question_option );
Expand Down Expand Up @@ -1144,7 +1144,7 @@ function qsm_bulk_delete_question_from_database() {
"DELETE FROM {$wpdb->prefix}mlw_questions WHERE question_id IN (%s)",
implode( ', ', $placeholders )
);

// Prepare the query
$query = $wpdb->prepare( $query, $question_id );

Expand Down
2 changes: 1 addition & 1 deletion php/admin/options-page-results-page-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function qsm_options_results_tab_template(){
<p><?php esc_html_e( 'Type', 'quiz-master-next' );?> <span class="qsm-hightlight-text"> / </span> <?php esc_html_e( ' to insert template variables', 'quiz-master-next' ); ?></p>
<?php do_action( 'qsm_result_page_before_redirect_input', $quiz_id, $categories ); ?>
<p><?php esc_html_e( 'Or, redirect the user by entering the URL below:', 'quiz-master-next' ); ?></p>
<input type="text" class="results-page-redirect" value="<# if ( data.redirect && 'undefined' !== data.redirect && 'false' !== data.redirect) { #>{{ data.redirect }}<# } #>">
<input type="text" class="results-page-redirect" value="<# if ( data.redirect && 'undefined' !== data.redirect && 'false' !== data.redirect ) { #>{{ data.redirect }}<# } #>">
<?php do_action( 'qsm_result_page_after', $quiz_id, $categories ); ?>
</div>
</main>
Expand Down
8 changes: 0 additions & 8 deletions php/admin/options-page-style-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ function qsm_options_styling_tab_content() {
<li>
<a href="javascript:void(0)" data-id="qsm_themes" class="current quiz_style_tab"><?php esc_html_e( 'Themes', 'quiz-master-next' ); ?></a>
</li>
<li>
<a href="javascript:void(0)" data-id="qsm-ultimate-default-menu" class="quiz_style_tab"><?php esc_html_e( 'Appearance', 'quiz-master-next' ); ?></a>
</li>
<li>
<a href="javascript:void(0)" data-id="custom_css" class="quiz_style_tab"><?php esc_html_e( 'Custom CSS', 'quiz-master-next' ); ?></a>
</li>
Expand Down Expand Up @@ -242,11 +239,6 @@ function qsm_options_styling_tab_content() {
<button id="save_styles_button"
class="button-primary"><?php esc_html_e( 'Save Quiz Style', 'quiz-master-next' ); ?></button>
</div>
<?php if ( ! class_exists( 'QSM_Ultimate' ) ) : ?>
<div id="qsm-ultimate-default-menu" class="quiz_style_tab_content" style="display: none">
<?php qsm_ultimate_addon_upgrade_content(); ?>
</div>
<?php endif; ?>
<?php do_action( 'qsm_add_style_section_content' ); ?>
</form>
<div class="qsm-popup qsm-popup-slide qsm-theme-color-settings" id="qsm-theme-color-settings" aria-hidden="true">
Expand Down
8 changes: 0 additions & 8 deletions php/admin/options-page-text-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ function mlw_options_text_tab_content() {
<li>
<a href="javascript:void(0)" data-id="qsm_custom_label" class="quiz_text_tab"><?php esc_html_e( 'Labels', 'quiz-master-next' ); ?></a>
</li>
<li>
<a href="javascript:void(0)" data-id="qsm_button_custom_class" class="quiz_text_tab"><?php esc_html_e( 'Custom Classes', 'quiz-master-next' ); ?></a>
</li>
</ul>
</div>
<div class="qsm-text-main-wrap">
Expand Down Expand Up @@ -118,11 +115,6 @@ function mlw_options_text_tab_content() {
?>
</div>
</div>
<?php if ( ! class_exists( 'QSM_Ultimate' ) ) : ?>
<div class="quiz_text_tab_content" style="display:none;" id="qsm_button_custom_class" >
<?php qsm_ultimate_addon_upgrade_content(); ?>
</div>
<?php endif; ?>
<?php do_action( 'qsm_add_list_menu_content_text_tab_after', $text_text_arr ); ?>
<!-- Variable text -->
<div class="quiz_text_tab_content qsm_variable_text" style="display:none;" id="qsm_variable_text" >
Expand Down
29 changes: 21 additions & 8 deletions php/classes/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -929,14 +929,6 @@ public function load_questions( $quiz_id, $quiz_options, $is_quiz_page, $questio
$question_ids = apply_filters( 'qsm_load_questions_ids', $question_ids, $quiz_id, $quiz_options );
$question_ids = QMNPluginHelper::qsm_shuffle_assoc( $question_ids );
$question_sql = implode( ',', $question_ids );
?>
<script>
const d = new Date();
d.setTime(d.getTime() + (365*24*60*60*1000));
let expires = "expires="+ d.toUTCString();
document.cookie = "question_ids_<?php echo esc_attr( $quiz_id ); ?> = <?php echo esc_attr( $question_sql ) ?>; "+expires+"; path=/";
</script>
<?php
}
$order_by_sql = 'ORDER BY FIELD(question_id,'. esc_sql( $question_sql ) .')';
}
Expand Down Expand Up @@ -980,6 +972,27 @@ public function load_questions( $quiz_id, $quiz_options, $is_quiz_page, $questio
$questions = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_questions WHERE quiz_id=%d AND deleted=0 %1s %2s %3s", $quiz_id, $question_sql, $order_by_sql, $limit_sql ) );

}
if (
in_array( intval( $quiz_options->randomness_order ), [ 1, 2 ], true) &&
! empty($questions) &&
is_array($questions) &&
! isset($_COOKIE[ 'question_ids_' . $quiz_id ])
) {
$question_ids = array();
foreach ( $questions as $question ) {
$question_ids[] = $question->question_id;
}

$question_sql = implode(',', array_unique($question_ids)); // Prevent duplicates
?>
<script>
const d = new Date();
d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); // Set cookie for 1 year
let expires = "expires=" + d.toUTCString();
document.cookie = "question_ids_<?php echo esc_js($quiz_id); ?>=" + "<?php echo esc_js($question_sql); ?>" + "; " + expires + "; path=/";
</script>
<?php
}
return apply_filters( 'qsm_load_questions_filter', $questions, $quiz_id, $quiz_options );
}

Expand Down
15 changes: 0 additions & 15 deletions php/classes/class-qsm-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,6 @@ public static function generate_section( $fields, $section ) {
<?php wp_nonce_field( 'save_settings','save_settings_nonce' );
$current_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
if ( 'options' === $current_tab ) :
if ( ! class_exists( 'QSM_Ultimate' ) ) {
$args = array(
"id" => 'qsm-ultimate-upgrade',
"title" => __( 'QSM Ultimate Addon', 'quiz-master-next' ),
"description" => __( 'Enjoy features like adding "other" options, bulk answer input, question-based progress bars, automatic page navigation, and showing detailed results after collecting contact details. Customize buttons, progress bar placement, and colors schemes and more with QSM Ultimate addon', 'quiz-master-next' ),
"chart_image" => plugins_url( '', dirname( __FILE__ ) ) . '/images/ultimate_upgrade.png',
"warning" => __( 'Missing Feature - QSM Ultimate Add-on required', 'quiz-master-next' ),
"information" => __( 'QSM Addon Bundle is the best way to get all our add-ons at a discount. Upgrade to save 95% today. OR you can buy QSM Ultimate Addon separately.', 'quiz-master-next' ),
"buy_btn_text" => __( 'Buy QSM Ultimate Addon', 'quiz-master-next' ),
"doc_link" => qsm_get_plugin_link( 'docs/add-ons/ultimate', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
"upgrade_link" => qsm_get_plugin_link( 'pricing', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
"addon_link" => qsm_get_plugin_link( 'downloads/ultimate', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
);
qsm_admin_upgrade_popup( $args );
}
?>
<div class="qsm-sub-tab-menu" style="display: inline-block;width: 100%;">
<ul class="subsubsub">
Expand Down
5 changes: 0 additions & 5 deletions php/classes/class-qsm-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,6 @@ public function register_default_settings() {
'label' => __( "Progress bar based on number of pages", 'quiz-master-next' ),
'value' => 1,
),
array(
'label' => __( "Progress bar based on number of question responded <a id='qsm_ultimate_progress_bar'><b>(PRO)</b></a>", 'quiz-master-next' ),
'value' => 2,
'disable' => 1,
),
),
'default' => 0,
),
Expand Down
Binary file removed php/images/ultimate_upgrade.png
Binary file not shown.
5 changes: 0 additions & 5 deletions php/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,6 @@ function qsm_generate_fb_header_metadata() {
<?php
}
}
$quiz_id = $mlwQuizMasterNext->quizCreator->get_id();
$featured_image = get_option("quiz_featured_image_$quiz_id");
?>
<link rel="preload" href="<?php echo esc_url($featured_image); ?>" as="image">
<?php
}

add_action( 'wp_head', 'qsm_generate_fb_header_metadata' );
Expand Down
4 changes: 2 additions & 2 deletions php/template-variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ function qsm_get_options_of_contact_fields( $data, $label, $type ) {
if ( is_array( $data ) ) {
foreach ( $data as $item ) {
if ( $item['label'] === $label && $item['type'] === $type ) {
return $item['options'];
return $item['options'];
}
}
}
Expand Down Expand Up @@ -1111,7 +1111,7 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question
if ( isset( $answer['question_type'] ) && in_array( intval( $answer['question_type'] ), $question_with_text_input, true ) ) {
$do_show_wrong = true;
$user_given_answer = '' === $answer[1] ? $quiz_options->no_answer_text : htmlentities( $answer[1] );
$user_given_answer = str_replace( "\n" , "<br>", $user_given_answer );
$user_given_answer = str_replace( "\n" , "<br>", $user_given_answer );
if ( 12 == $answer['question_type'] && ! empty( $answer[1] ) && strtotime( $user_given_answer ) ) {
$preferred_date_format = isset($quiz_options->preferred_date_format) ? $quiz_options->preferred_date_format : get_option('date_format');
$user_given_answer = date_i18n($preferred_date_format, strtotime($user_given_answer));
Expand Down
7 changes: 6 additions & 1 deletion 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.1.2
Stable tag: 9.1.3
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -189,6 +189,11 @@ QSM is designed to be compatible with most WordPress plugins and themes. However
18. Database

== Changelog ==
= 9.1.3 ( September 12, 2024 ) =
* Feature: Added placeholder customization for short answer and paragraph questions
* Bug: Resolved vulnerability issue with question settings
* Bug: Fixed issue with undefined page redirection

= 9.1.2 ( August 22, 2024 ) =
* Bug: Resolved issue preventing global settings from being saved
* Bug: Resolved progress bar issue in quiz popups
Expand Down

0 comments on commit 0df4fb5

Please sign in to comment.