Skip to content

Commit

Permalink
Merge pull request #2422 from QuizandSurveyMaster/CU-86cu57j76-per-pa…
Browse files Browse the repository at this point in the history
…ge-timer-saved-without-license

Cu 86cu57j76 per page timer saved without license
  • Loading branch information
zubairraeen authored Dec 15, 2023
2 parents 15b6c7a + 4b22f21 commit 9844373
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 29 deletions.
2 changes: 0 additions & 2 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3132,8 +3132,6 @@ var import_button;
jQuery(document).trigger('qsm_question_type_change_after', [question_val]);
});



//Add new category
$(document).on('click', '#qsm-category-add-toggle', function () {
if ($('#qsm-category-add').is(":visible")) {
Expand Down
4 changes: 1 addition & 3 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -867,9 +867,7 @@ function qmnFormSubmit(quiz_form_id) {
fd.append("currentuserTimeZone", Intl.DateTimeFormat().resolvedOptions().timeZone);

qsmEndTimeTakenTimer(quiz_id);
if (qmn_quiz_data[quiz_id].hasOwnProperty('advanced_timer') && qmn_quiz_data[quiz_id].advanced_timer.hasOwnProperty('show_stop_timer') ) {
QSMPageTimer.endPageTimer(quiz_id);
}

if (qmn_quiz_data[quiz_id].hasOwnProperty('timer_limit')) {
QSM.endTimer(quiz_id);
}
Expand Down
2 changes: 1 addition & 1 deletion php/admin/admin-results-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ function qsm_results_overview_tab_content() {
</label>
<label>
<input type="checkbox" value="1" name="view_result_page" <?php checked( $results_screen_option['view_result_page'], "1", true ) ?>/>
<?php esc_html_e( 'Page Result', 'quiz-master-next' ); ?>
<?php esc_html_e( 'Result Page', 'quiz-master-next' ); ?>
</label>
<label>
<input type="checkbox" name="page_name" value="1" <?php checked( $results_screen_option['page_name'], "1", true ) ?>/>
Expand Down
17 changes: 13 additions & 4 deletions php/admin/options-page-questions-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,22 @@ function qsm_options_questions_tab_content() {
$target_link = sprintf( '<div class="notice notice-error notice-advance-timer"><strong>'.__('Error! ', 'quiz-master-next').'</strong>'.$target_text.'<a style="font-weight: bolder;" href="%s" target="_blank">%s</a></div>', esc_url( $item_url ), __( 'Click here to renew', 'quiz-master-next' ) );
echo wp_kses_post($target_link);
}
if ( isset($settings_data['last_validate']) && "invalid" == $settings_data['last_validate'] ) {
if ( ( isset($settings_data['last_validate']) && "invalid" == $settings_data['last_validate'] ) || empty($settings_data) ) {
$read_only = 'readonly';
$disable_class = 'qsm-disabled-td';
$background = "#F0F0F0";
$target_text = __(' Your Advanced Timer Settings are not saved successfully. Validate license to save the settings. ', 'quiz-master-next');
$target_link = sprintf( '<div class="notice notice-error notice-advance-timer"><strong>'.__('Error! ', 'quiz-master-next').'</strong>'.$target_text.'</div>' );
echo wp_kses_post($target_link);
$admin_page_url = esc_url(admin_url('admin.php?page=qmn_addons&tab=advanced-timer'));
$error_message = sprintf(
'<div class="notice notice-error notice-advance-timer">
<strong>%s</strong> %s <a href="%s" target="_blank">%s</a> %s
</div>',
__('Error! ', 'quiz-master-next'),
__('Your Advanced Timer Settings are not saved successfully. ', 'quiz-master-next'),
$admin_page_url,
__('Validate license', 'quiz-master-next'),
__('to save the settings. ', 'quiz-master-next')
);
echo wp_kses_post($error_message);
}
$advancetimer = 'qsm-advanced-timer/qsm-advanced-timer.php';
$plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/'. $advancetimer);
Expand Down
34 changes: 17 additions & 17 deletions php/question-types/qsm-question-type-dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ function qmn_drop_down_display( $id, $question, $answers ) {
$show = apply_filters( 'qsm_check_show_answer_drop_down', $show, $id, $question, $answers );
if ( $show ) {
?>
<select class="qsm_select qsm_dropdown <?php echo esc_attr( $require_class ); ?>" name="question<?php echo esc_attr( $id ); ?>">
<option disabled selected value><?php echo esc_html__( 'Please select your answer', 'quiz-master-next' ); ?></option>
<?php
if ( is_array( $answers ) ) {
$mlw_answer_total = 0;
foreach ( $answers as $answer_index => $answer ) {
$mlw_answer_total++;
if ( '' !== $answer[0] ) {
$answer_text = trim( htmlspecialchars_decode( $answer[0], ENT_QUOTES ) );
$answer_text = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer_text, "answer-" . $id . "-" . $answer_index, "QSM Answers" );
?>
<option value="<?php echo esc_attr( $answer_index ); ?>"><?php echo esc_html( $answer_text ); ?></option>
<?php
<select class="qsm_select qsm_dropdown <?php echo esc_attr( $require_class ); ?>" name="question<?php echo esc_attr( $id ); ?>">
<option disabled selected value><?php echo esc_html__( 'Please select your answer', 'quiz-master-next' ); ?></option>
<?php
if ( is_array( $answers ) ) {
$mlw_answer_total = 0;
foreach ( $answers as $answer_index => $answer ) {
$mlw_answer_total++;
if ( '' !== $answer[0] ) {
$answer_text = trim( htmlspecialchars_decode( $answer[0], ENT_QUOTES ) );
$answer_text = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer_text, "answer-" . $id . "-" . $answer_index, "QSM Answers" );
?>
<option value="<?php echo esc_attr( $answer_index ); ?>"><?php echo esc_html( $answer_text ); ?></option>
<?php
}
}
}
}
?>
</select>
?>
</select>
<?php
}
echo apply_filters( 'qmn_drop_down_display_front', '', $id, $question, $answers );
Expand All @@ -61,7 +61,7 @@ function qmn_drop_down_display( $id, $question, $answers ) {
*/
function qmn_drop_down_review( $id, $question, $answers ) {
$current_question = new QSM_Question_Review_Choice( $id, $question, $answers );
$current_question = apply_filters( 'qmn_drop_down_review_before', $current_question, $id, $question, $answers );
$current_question = apply_filters( 'qmn_drop_down_review_before', $current_question, $id, $question, $answers );
$user_text_array = $current_question->get_user_answer();
$correct_text_array = $current_question->get_correct_answer();
$return_array['user_text'] = ! empty( $user_text_array ) ? implode( ', ', $user_text_array ) : '' ;
Expand Down
5 changes: 3 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,13 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
18. Database

== Changelog ==
= 8.2.0 (December 04, 2023) =
= 8.2.0 (December 14, 2023) =
* Feature: Added option to change deselect answer text
* Feature: Added option to duplicate quiz theme settings
* Bug: Fixed issue related to limiting random questions by category
* Bug: Fixed issue with images and video tags in the correct answer info
* Enhacements: Improved login form validations
* Enhacements: Reduce number of cookies
* Enhacements: Improved performance by optimizing cookies

= 8.1.19 (November 08, 2023) =
* Feature: Added an option to display result URLs on the admin result page
Expand Down

0 comments on commit 9844373

Please sign in to comment.