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

update code for qsm gamify #2745

Merged
merged 1 commit into from
Dec 30, 2024
Merged
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
7 changes: 4 additions & 3 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,7 @@ function qmnUpdatePageNumber(amount, quiz_form_id) {
}

function qmnInitPagination(quiz_id) {
jQuery(document).trigger('qsm_init_pagination_before', [quiz_id, qmn_quiz_data]);
var qmn_section_total = +qmn_quiz_data[quiz_id].pagination.total_questions;
var qmn_total_questions = jQuery('#quizForm' + quiz_id).find('#qmn_all_questions_count').val();
var qmn_total_pages = Math.ceil(qmn_total_questions / +qmn_quiz_data[quiz_id].pagination.amount);
Expand Down Expand Up @@ -1883,16 +1884,16 @@ jQuery(document).ready(function () {
}
var captchaCanvas = document.getElementById('mlw_captcha');
var mlw_captchaCTX = captchaCanvas.getContext('2d');
var containerDirection = window.getComputedStyle(captchaCanvas).direction || 'ltr';
var containerDirection = window.getComputedStyle(captchaCanvas).direction || 'ltr';
mlw_captchaCTX.font = 'normal 24px Verdana';
mlw_captchaCTX.strokeStyle = '#000000';
mlw_captchaCTX.clearRect(0, 0, captchaCanvas.width, captchaCanvas.height);
if (containerDirection === 'rtl') {
mlw_captchaCTX.textAlign = 'right';
mlw_captchaCTX.strokeText(mlw_code, captchaCanvas.width - 10, captchaCanvas.height / 2);
mlw_captchaCTX.strokeText(mlw_code, captchaCanvas.width - 10, captchaCanvas.height / 2);
} else {
mlw_captchaCTX.textAlign = 'left';
mlw_captchaCTX.strokeText(mlw_code, 10, captchaCanvas.height / 2);
mlw_captchaCTX.strokeText(mlw_code, 10, captchaCanvas.height / 2);
}
document.getElementById('mlw_code_captcha').value = mlw_code;
}
Expand Down
10 changes: 9 additions & 1 deletion php/classes/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,15 @@ public function display_begin_section( $qmn_quiz_options, $qmn_array_for_variabl
?>
<div class='mlw_qmn_message_before'>
<?php
echo wp_kses_post( do_shortcode( $editor_text ) );
$allowed_html = wp_kses_allowed_html('post');
$allowed_html['input'] = array(
'type' => array(),
'name' => array(),
'value' => array(),
'class' => array(), // Optional: Allow the class attribute
'id' => array(), // Optional: Allow the id attribute
);
echo wp_kses( do_shortcode( $editor_text ), $allowed_html );
?>
</div>
<?php
Expand Down
Loading