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

Cu 86cvw5jr9 na n issue with timer #2646

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
16 changes: 2 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
4 changes: 2 additions & 2 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var qsmTimerInterval = [];
// Calculates starting time.
var timerTotal = parseFloat(qmn_quiz_data[quizID].timer_limit) * 60;
var timerStarted = localStorage.getItem('mlw_started_quiz' + quizID);
var timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID));
var timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID)) || 1;
var timerRemaning = timerTotal - timerConsumed;
if ('yes' == timerStarted && 0 < timerRemaning) {
seconds = parseInt(timerRemaning);
Expand Down Expand Up @@ -357,7 +357,7 @@ var qsmTimerInterval = [];

// Calculates starting time.
let timerStarted = localStorage.getItem('mlw_started_quiz' + quizID);
let timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID));
var timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID)) || 1;
let seconds = parseFloat(qmn_quiz_data[quizID].timer_limit) * 60;
let timerRemaning = seconds - timerConsumed;
if ('yes' == timerStarted && 0 < timerRemaning) {
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' );
}
2 changes: 1 addition & 1 deletion php/admin/options-page-questions-tab.php
Original file line number Diff line number Diff line change
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
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
16 changes: 8 additions & 8 deletions php/admin/quiz-options-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ function qsm_generate_quiz_options() {
apply_filters('qsm_user_role_permission_page',true);
// Check user capability
if ( ! class_exists('QSM_Ultimate') ) {
$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles, true ) ) {
$user_id = sanitize_text_field( $user->ID );
$quiz_id = isset( $_GET['quiz_id'] ) ? intval( $_GET['quiz_id'] ) : 0;
$quiz_author_id = $wpdb->get_var( $wpdb->prepare( "SELECT quiz_author_id FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id=%d AND quiz_author_id=%d LIMIT 1", $quiz_id, $user_id ) );
if ( ! $quiz_author_id ) {
wp_die( 'You are not allow to edit this quiz, You need higher permission!' );
$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles, true ) ) {
$user_id = sanitize_text_field( $user->ID );
$quiz_id = isset( $_GET['quiz_id'] ) ? intval( $_GET['quiz_id'] ) : 0;
$quiz_author_id = $wpdb->get_var( $wpdb->prepare( "SELECT quiz_author_id FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id=%d AND quiz_author_id=%d LIMIT 1", $quiz_id, $user_id ) );
if ( ! $quiz_author_id ) {
wp_die( 'You are not allow to edit this quiz, You need higher permission!' );
}
}
}
}

$quiz_name = '';

Expand Down
4 changes: 2 additions & 2 deletions php/classes/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2404,8 +2404,8 @@ public static function check_answers( $options, $quiz_data ) {
$results_array = apply_filters( 'qmn_results_array', $results_array, $question );
// If question was graded correctly.
if ( ! isset( $results_array['null_review'] ) ) {
$points_earned += (float)$results_array['points'];
$answer_points += (float)$results_array['points'];
$points_earned += isset($results_array['points']) ? (float)$results_array['points'] : 0;
$answer_points += isset($results_array['points']) ? (float)$results_array['points'] : 0;
// If the user's answer was correct.
if ( isset( $results_array['correct'] ) && ( 'correct' == $results_array['correct'] ) ) {
$total_correct += 1;
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.
10 changes: 5 additions & 5 deletions php/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ 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
$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
2 changes: 1 addition & 1 deletion 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
8 changes: 7 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,12 @@ 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
* Bug: Enter key issue resolved in paragraph question type

= 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
Loading