From 5cb043ba097966fa5c038e9a054879635e3578ae Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Mon, 27 Nov 2023 11:59:32 +0530 Subject: [PATCH 01/12] Added Feature to duplicate quiz with active paid theme --- php/admin/settings-page.php | 20 ++++++++++++++++++ php/classes/class-qmn-quiz-creator.php | 28 ++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/php/admin/settings-page.php b/php/admin/settings-page.php index 884b32cb0..3cd1e4058 100644 --- a/php/admin/settings-page.php +++ b/php/admin/settings-page.php @@ -76,6 +76,7 @@ public function init() { add_settings_field( 'ip-collection', __( 'Disable collecting and storing IP addresses?', 'quiz-master-next' ), array( $this, 'ip_collection_field' ), 'qmn_global_settings', 'qmn-global-section' ); add_settings_field( 'cpt-search', __( 'Disable Quiz Posts From Being Searched?', 'quiz-master-next' ), array( $this, 'cpt_search_field' ), 'qmn_global_settings', 'qmn-global-section' ); add_settings_field( 'cpt-archive', __( 'Quiz Archive Settings', 'quiz-master-next' ), array( $this, 'cpt_archive_field' ), 'qmn_global_settings', 'qmn-global-section' ); + add_settings_field( 'duplicate-quiz-with-theme', __( 'Duplicate Quiz Controls', 'quiz-master-next' ), array( $this, 'qsm_duplicate_quiz_with_theme' ), 'qmn_global_settings', 'qmn-global-section' ); add_settings_field( 'detele-qsm-data', __( 'Delete all the data related to QSM on deletion?', 'quiz-master-next' ), array( $this, 'qsm_delete_data' ), 'qmn_global_settings', 'qmn-global-section' ); add_settings_field( 'background-quiz-email-process', __( 'Process emails in background?', 'quiz-master-next' ), array( $this, 'qsm_background_quiz_email_process' ), 'qmn_global_settings', 'qmn-global-section' ); add_settings_field( 'cpt-slug', __( 'Quiz Url Slug', 'quiz-master-next' ), array( $this, 'cpt_slug_field' ), 'qmn_global_settings', 'qmn-global-section' ); @@ -368,6 +369,25 @@ public function cpt_search_field() { echo ''; } + /** + * Generates Setting Field To Duplicate Quiz with Theme Settings + * + * @since 8.1.19 + * @return void + */ + public function qsm_duplicate_quiz_with_theme() { + $settings = (array) get_option( 'qmn-settings' ); + $duplicate_quiz_with_theme = ! empty( $settings['duplicate_quiz_with_theme'] ) ? esc_attr( $settings['duplicate_quiz_with_theme'] ) : 0; + ?> +
+ +
+ insert_id; + $settings = (array) get_option('qmn-settings'); + $duplicate_quiz_with_theme = !empty($settings['duplicate_quiz_with_theme']) ? esc_attr($settings['duplicate_quiz_with_theme']) : 0; + + if ('1' === $duplicate_quiz_with_theme) { + $theme_table = $wpdb->prefix . 'mlw_quiz_theme_settings'; + $old_quiz_theme_data = $wpdb->get_row($wpdb->prepare("SELECT * FROM $theme_table WHERE quiz_id = %d AND active_theme = 1", $quiz_id)); + + if ($old_quiz_theme_data) { + $new_quiz_theme_data = array( + 'theme_id' => $old_quiz_theme_data->theme_id, + 'quiz_id' => $mlw_new_id, + 'quiz_theme_settings' => $old_quiz_theme_data->quiz_theme_settings, + 'active_theme' => 1, + ); + + $format = array( + '%d', + '%d', + '%s', + '%d', + ); + + $wpdb->insert($theme_table, $new_quiz_theme_data, $format); + $mlwQuizMasterNext->alertManager->newAlert(__('There has been an error in this action. Please share this with the developer. Error Code: 0051', 'quiz-master-next'), 'error'); + $mlwQuizMasterNext->log_manager->add('Error 0051', $wpdb->last_error . ' from ' . $wpdb->last_query, 0, 'error'); + } + } + // Update quiz settings $update_quiz_settings = maybe_unserialize( $mlw_qmn_duplicate_data->quiz_settings ); $update_pages = maybe_unserialize( $update_quiz_settings['pages'] ); From 5c31d44b96cba723ddac7e7ad2b737c46e2d4227 Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Mon, 27 Nov 2023 17:47:01 +0530 Subject: [PATCH 02/12] issue to show video and image using shortcode in correct answer info --- js/qsm-quiz.js | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 9e05e3970..2702cd6e5 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1484,6 +1484,33 @@ jQuery(function () { }); }); + function qsm_check_shortcode(message = null) { + + // Check if message contains a video shortcode + var videoRegex = /\[video(?:(?:\ssrc="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,3}\s*\]/g; + var videoMatch = message.match(videoRegex); + + if (videoMatch) { + var videoHTML = message.replace(videoRegex, function(match, src, width, height) { + return ''; + }); + return '
' + videoHTML + '
'; + } + + // Check if message contains an image shortcode + var imageRegex = /\[img(?:(?:\ssrc="([^"]+)")|(?:\salt="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,4}\s*\]/g; + var imageMatch = message.match(imageRegex); + + if (imageMatch) { + var imageHTML = message.replace(imageRegex, function(match, src, alt, width, height) { + return '' + (alt || '') + ''; + }); + return '
' + imageHTML + '
'; + } + + return message; + } + //inline result status function function qsm_show_inline_result(quizID, question_id, value, $this, answer_type, $i_this, index = null) { jQuery('.qsm-spinner-loader').remove(); @@ -1494,11 +1521,11 @@ jQuery(function () { $this.find('.qmn_radio_answers').children().removeClass('data-correct-answer'); if ( 0 < value.length && data.success == 'correct') { $this.append('
' + qmn_quiz_data[quizID].quick_result_correct_answer_text + '
') - $this.append('
' + data.message + '
'); + $this.append('
' + qsm_check_shortcode(data.message) + '
'); } else if ( 0 < value.length && data.success == 'incorrect') { $this.find('.qmn_radio_answers').children().eq(parseInt(data.correct_index)).addClass('data-correct-answer'); $this.append('
' + qmn_quiz_data[quizID].quick_result_wrong_answer_text + '
') - $this.append('
' + data.message + '
'); + $this.append('
' + qsm_check_shortcode(data.message) + '
'); } if (1 != qmn_quiz_data[quizID].disable_mathjax) { MathJax.typesetPromise(); From f847b22b3668480f75ab1ad589126f057fa65614 Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Mon, 27 Nov 2023 17:51:55 +0530 Subject: [PATCH 03/12] issue to show video and image using shortcode in correct answer info --- js/qsm-quiz.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 2702cd6e5..080ed0a5f 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1487,22 +1487,22 @@ jQuery(function () { function qsm_check_shortcode(message = null) { // Check if message contains a video shortcode - var videoRegex = /\[video(?:(?:\ssrc="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,3}\s*\]/g; - var videoMatch = message.match(videoRegex); + let videoRegex = /\[video(?:(?:\ssrc="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,3}\s*\]/g; + let videoMatch = message.match(videoRegex); if (videoMatch) { - var videoHTML = message.replace(videoRegex, function(match, src, width, height) { + let videoHTML = message.replace(videoRegex, function(match, src, width, height) { return ''; }); return '
' + videoHTML + '
'; } // Check if message contains an image shortcode - var imageRegex = /\[img(?:(?:\ssrc="([^"]+)")|(?:\salt="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,4}\s*\]/g; - var imageMatch = message.match(imageRegex); + let imageRegex = /\[img(?:(?:\ssrc="([^"]+)")|(?:\salt="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,4}\s*\]/g; + let imageMatch = message.match(imageRegex); if (imageMatch) { - var imageHTML = message.replace(imageRegex, function(match, src, alt, width, height) { + let imageHTML = message.replace(imageRegex, function(match, src, alt, width, height) { return '' + (alt || '') + ''; }); return '
' + imageHTML + '
'; From f8d8584cf8c48b0b58424db4b6842334f30b9c0f Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Tue, 28 Nov 2023 12:18:51 +0530 Subject: [PATCH 04/12] fixed issue with video shortcode on front end --- js/qsm-quiz.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 080ed0a5f..81a14cb1e 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1485,29 +1485,30 @@ jQuery(function () { }); function qsm_check_shortcode(message = null) { - // Check if message contains a video shortcode - let videoRegex = /\[video(?:(?:\ssrc="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,3}\s*\]/g; + let videoRegex = /\[video(?:(?:\ssrc="([^"]+)")|(?:\smp4="([^"]+)")|(?:\sm4v="([^"]+)")|(?:\swebm="([^"]+)")|(?:\sogv="([^"]+)")|(?:\swmv="([^"]+)")|(?:\sflv="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,3}\s*\](.*?)\[\/video\]/g; let videoMatch = message.match(videoRegex); - + if (videoMatch) { - let videoHTML = message.replace(videoRegex, function(match, src, width, height) { - return ''; + let videoHTML = message.replace(videoRegex, function(match, src, mp4, m4v, webm, ogv, wmv, flv, width, height, content) { + const videoSource = src || mp4 || m4v || webm || ogv || wmv || flv || ''; + const videoTag = ''; + return '
' + videoTag + '
'; }); - return '
' + videoHTML + '
'; + return videoHTML; } // Check if message contains an image shortcode let imageRegex = /\[img(?:(?:\ssrc="([^"]+)")|(?:\salt="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,4}\s*\]/g; let imageMatch = message.match(imageRegex); - + if (imageMatch) { let imageHTML = message.replace(imageRegex, function(match, src, alt, width, height) { return '' + (alt || '') + ''; }); return '
' + imageHTML + '
'; } - + return message; } From ebf0f073a2dc0181476264fc4b04896f83982ee3 Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Tue, 28 Nov 2023 12:28:20 +0530 Subject: [PATCH 05/12] fixed issue with video shortcode on front end --- js/qsm-quiz.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 81a14cb1e..e140da5db 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1485,19 +1485,30 @@ jQuery(function () { }); function qsm_check_shortcode(message = null) { - // Check if message contains a video shortcode - let videoRegex = /\[video(?:(?:\ssrc="([^"]+)")|(?:\smp4="([^"]+)")|(?:\sm4v="([^"]+)")|(?:\swebm="([^"]+)")|(?:\sogv="([^"]+)")|(?:\swmv="([^"]+)")|(?:\sflv="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,3}\s*\](.*?)\[\/video\]/g; - let videoMatch = message.match(videoRegex); - + const videoAttributesRegex = /(?:\ssrc="([^"]+)")|(?:\smp4="([^"]+)")|(?:\sm4v="([^"]+)")|(?:\swebm="([^"]+)")|(?:\sogv="([^"]+)")|(?:\swmv="([^"]+)")|(?:\sflv="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")/g; + const videoContentRegex = /\[video(?:(?:\s(?:src|mp4|m4v|webm|ogv|wmv|flv|width|height)="[^"]*")*)\](.*?)\[\/video\]/g; + + let videoMatch = message.match(videoContentRegex); + if (videoMatch) { - let videoHTML = message.replace(videoRegex, function(match, src, mp4, m4v, webm, ogv, wmv, flv, width, height, content) { - const videoSource = src || mp4 || m4v || webm || ogv || wmv || flv || ''; - const videoTag = ''; - return '
' + videoTag + '
'; + let videoHTML = message.replace(videoContentRegex, function(match, content) { + let attributesMatch; + let src = ''; + let width = ''; + let height = ''; + + while ((attributesMatch = videoAttributesRegex.exec(match)) !== null) { + src = src || attributesMatch[1] || attributesMatch[2] || attributesMatch[3] || attributesMatch[4] || attributesMatch[5] || attributesMatch[6] || attributesMatch[7] || ''; + width = width || attributesMatch[8] || ''; + height = height || attributesMatch[9] || ''; + } + + const videoTag = ``; + return `
${videoTag}
`; }); return videoHTML; } - + // Check if message contains an image shortcode let imageRegex = /\[img(?:(?:\ssrc="([^"]+)")|(?:\salt="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")){0,4}\s*\]/g; let imageMatch = message.match(imageRegex); From 5b084a4d3464c43b407a5619f00f02784d4d990a Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Tue, 28 Nov 2023 12:34:58 +0530 Subject: [PATCH 06/12] fixed issue with video shortcode on front end --- js/qsm-quiz.js | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index e140da5db..28becd64c 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1485,23 +1485,37 @@ jQuery(function () { }); function qsm_check_shortcode(message = null) { - const videoAttributesRegex = /(?:\ssrc="([^"]+)")|(?:\smp4="([^"]+)")|(?:\sm4v="([^"]+)")|(?:\swebm="([^"]+)")|(?:\sogv="([^"]+)")|(?:\swmv="([^"]+)")|(?:\sflv="([^"]+)")|(?:\swidth="(\d+)")|(?:\sheight="(\d+)")/g; - const videoContentRegex = /\[video(?:(?:\s(?:src|mp4|m4v|webm|ogv|wmv|flv|width|height)="[^"]*")*)\](.*?)\[\/video\]/g; - + const videoAttributePatterns = [ + /\ssrc="([^"]+)"/, + /\smp4="([^"]+)"/, + /\sm4v="([^"]+)"/, + /\swebm="([^"]+)"/, + /\sogv="([^"]+)"/, + /\swmv="([^"]+)"/, + /\sflv="([^"]+)"/, + /\swidth="(\d+)"/, + /\sheight="(\d+)"/ + ]; + + const videoContentRegex = /\[video(?:\s(?:src|mp4|m4v|webm|ogv|wmv|flv|width|height)="[^"]*")*\](.*?)\[\/video\]/g; let videoMatch = message.match(videoContentRegex); if (videoMatch) { let videoHTML = message.replace(videoContentRegex, function(match, content) { - let attributesMatch; let src = ''; let width = ''; let height = ''; - while ((attributesMatch = videoAttributesRegex.exec(match)) !== null) { - src = src || attributesMatch[1] || attributesMatch[2] || attributesMatch[3] || attributesMatch[4] || attributesMatch[5] || attributesMatch[6] || attributesMatch[7] || ''; - width = width || attributesMatch[8] || ''; - height = height || attributesMatch[9] || ''; - } + videoAttributePatterns.forEach(pattern => { + if (!src) { + const attrMatch = match.match(pattern); + if (attrMatch) { + src = attrMatch[1] || ''; + if (pattern.toString().includes('width')) width = attrMatch[1] || ''; + if (pattern.toString().includes('height')) height = attrMatch[1] || ''; + } + } + }); const videoTag = ``; return `
${videoTag}
`; From fdff12e48a7330b12a5f33b6c4421f41a40d745e Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Tue, 28 Nov 2023 15:33:20 +0530 Subject: [PATCH 07/12] fixed attribute issue in shortcode --- js/qsm-quiz.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 28becd64c..fecfcce84 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1507,16 +1507,17 @@ jQuery(function () { let height = ''; videoAttributePatterns.forEach(pattern => { - if (!src) { - const attrMatch = match.match(pattern); - if (attrMatch) { + const attrMatch = match.match(pattern); + if (attrMatch) { + if (pattern.toString().includes('width')) { + width = attrMatch[1] || ''; + } else if (pattern.toString().includes('height')) { + height = attrMatch[1] || ''; + } else { src = attrMatch[1] || ''; - if (pattern.toString().includes('width')) width = attrMatch[1] || ''; - if (pattern.toString().includes('height')) height = attrMatch[1] || ''; } } }); - const videoTag = ``; return `
${videoTag}
`; }); From 0d02fffe5f1f7d187e3144b990a2308d210861d4 Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Tue, 28 Nov 2023 15:49:21 +0530 Subject: [PATCH 08/12] fixed attribute issue in shortcode --- js/qsm-quiz.js | 69 ++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index fecfcce84..8251fd880 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1484,41 +1484,50 @@ jQuery(function () { }); }); - function qsm_check_shortcode(message = null) { - const videoAttributePatterns = [ - /\ssrc="([^"]+)"/, - /\smp4="([^"]+)"/, - /\sm4v="([^"]+)"/, - /\swebm="([^"]+)"/, - /\sogv="([^"]+)"/, - /\swmv="([^"]+)"/, - /\sflv="([^"]+)"/, - /\swidth="(\d+)"/, - /\sheight="(\d+)"/ - ]; - + const videoAttributePatterns = [ + /\ssrc="([^"]+)"/, + /\smp4="([^"]+)"/, + /\sm4v="([^"]+)"/, + /\swebm="([^"]+)"/, + /\sogv="([^"]+)"/, + /\swmv="([^"]+)"/, + /\sflv="([^"]+)"/, + /\swidth="(\d+)"/, + /\sheight="(\d+)"/ + ]; + + function parseAttributes(match, src, width, height) { + let videoAttrs = { src: '', width: '', height: '' }; + + videoAttributePatterns.forEach(pattern => { + const attrMatch = match.match(pattern); + if (attrMatch) { + const value = attrMatch[1] || ''; + if (pattern.toString().includes('width')) { + videoAttrs.width = value; + } else if (pattern.toString().includes('height')) { + videoAttrs.height = value; + } else { + videoAttrs.src = value; + } + } + }); + + return videoAttrs; + } + + function generateVideoTag(src, width, height, content) { + return ``; + } + + function qsm_check_shortcode(message = null) { const videoContentRegex = /\[video(?:\s(?:src|mp4|m4v|webm|ogv|wmv|flv|width|height)="[^"]*")*\](.*?)\[\/video\]/g; let videoMatch = message.match(videoContentRegex); if (videoMatch) { let videoHTML = message.replace(videoContentRegex, function(match, content) { - let src = ''; - let width = ''; - let height = ''; - - videoAttributePatterns.forEach(pattern => { - const attrMatch = match.match(pattern); - if (attrMatch) { - if (pattern.toString().includes('width')) { - width = attrMatch[1] || ''; - } else if (pattern.toString().includes('height')) { - height = attrMatch[1] || ''; - } else { - src = attrMatch[1] || ''; - } - } - }); - const videoTag = ``; + const { src, width, height } = parseAttributes(match); + const videoTag = generateVideoTag(src, width, height, content); return `
${videoTag}
`; }); return videoHTML; From b4991aaa409ba82c580800b83b673562848ec211 Mon Sep 17 00:00:00 2001 From: etchirag Date: Tue, 28 Nov 2023 17:29:09 +0530 Subject: [PATCH 09/12] Fixed single page quiz timer --- js/qsm-quiz.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 8251fd880..a6f07f106 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -166,6 +166,12 @@ var qsmTimerInterval = []; } var secondsRemaining = qmn_quiz_data[quizID].timerRemaning; var secondsConsumed = qmn_quiz_data[quizID].timerConsumed; + if (localStorage.getItem('mlw_time_quiz' + quizID) != null ) { + secondsRemaining = (parseFloat(qmn_quiz_data[quizID].timer_limit) * 60) - secondsConsumed + 1; + if(secondsRemaining < 0) { + secondsRemaining = 0; + } + } var display = QSM.secondsToTimer(secondsRemaining); var systemTime = new Date().getTime() / 1000; systemTime = Math.round(systemTime); From 1ed21a8efc19c1d0a24420bd95a368efdb54ec68 Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Thu, 30 Nov 2023 12:51:50 +0530 Subject: [PATCH 10/12] Added hook to show select tag for fill in the blank --- php/question-types/qsm-question-title.php | 4 ++++ php/question-types/qsm-question-type-fill-in-the-blanks.php | 1 + 2 files changed, 5 insertions(+) diff --git a/php/question-types/qsm-question-title.php b/php/question-types/qsm-question-title.php index 81e449002..86376de55 100644 --- a/php/question-types/qsm-question-title.php +++ b/php/question-types/qsm-question-title.php @@ -48,6 +48,10 @@ function qsm_question_title_func( $question, $question_type = '', $new_question_ $allow_html['input']['class'] = 1; $allow_html['input']['id'] = 1; $allow_html['input']['maxlength'] = 1; + $allow_html['select']['name'] = 1; + $allow_html['select']['class'] = 1; + $allow_html['select']['id'] = 1; + $allow_html['option']['value'] = 1; ?>

diff --git a/php/question-types/qsm-question-type-fill-in-the-blanks.php b/php/question-types/qsm-question-type-fill-in-the-blanks.php index 0bb6b0dd8..b246a3e24 100644 --- a/php/question-types/qsm-question-type-fill-in-the-blanks.php +++ b/php/question-types/qsm-question-type-fill-in-the-blanks.php @@ -44,6 +44,7 @@ function qmn_fill_blank_display( $id, $question, $answers ) { $mlw_require_class = ''; } $input_text = '"; + $input_text = apply_filters( 'qsm_fill_in_blanks_input_after', $input_text, $id, $question, $answers, $mlw_require_class ); if ( strpos( $question, '%BLANK%' ) !== false ) { $question = str_replace( '%BLANK%', $input_text, do_shortcode( htmlspecialchars_decode( $question, ENT_QUOTES ) ) ); } From 28b95bfe052bf15f2297f753abde05292bdceed2 Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Thu, 30 Nov 2023 13:13:53 +0530 Subject: [PATCH 11/12] Added hook to show select tag for fill in the blank --- php/question-types/qsm-question-title.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/php/question-types/qsm-question-title.php b/php/question-types/qsm-question-title.php index 86376de55..1210b7af6 100644 --- a/php/question-types/qsm-question-title.php +++ b/php/question-types/qsm-question-title.php @@ -48,10 +48,7 @@ function qsm_question_title_func( $question, $question_type = '', $new_question_ $allow_html['input']['class'] = 1; $allow_html['input']['id'] = 1; $allow_html['input']['maxlength'] = 1; - $allow_html['select']['name'] = 1; - $allow_html['select']['class'] = 1; - $allow_html['select']['id'] = 1; - $allow_html['option']['value'] = 1; + $allow_html = apply_filters( 'qsm_allow_html_question_title_after', $question_id, $allow_html ); ?>

From 00c61c01d262b825ae70765b924536b47145bef4 Mon Sep 17 00:00:00 2001 From: etchirag Date: Fri, 1 Dec 2023 19:09:58 +0530 Subject: [PATCH 12/12] added version compare condition for advance timer --- php/admin/options-page-questions-tab.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/php/admin/options-page-questions-tab.php b/php/admin/options-page-questions-tab.php index f93cb8a47..deaaa4dbd 100644 --- a/php/admin/options-page-questions-tab.php +++ b/php/admin/options-page-questions-tab.php @@ -158,6 +158,7 @@ function qsm_options_questions_tab_content() { $read_only = ""; $disable_class = ""; $background = "#FFFFFF"; + $display_advance = "yes"; if ( ! class_exists ( 'QSM_AdvancedTimer' ) ) { $read_only = 'readonly'; $disable_class = 'qsm-disabled-td'; @@ -180,6 +181,12 @@ function qsm_options_questions_tab_content() { $target_link = sprintf( '
'.__('Error! ', 'quiz-master-next').''.$target_text.'
' ); echo wp_kses_post($target_link); } + $advancetimer = 'qsm-advanced-timer/qsm-advanced-timer.php'; + $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/'. $advancetimer); + $version_number = $plugin_data['Version']; + if ( version_compare($version_number, '2.0.0', '<') ) { + $display_advance = "no"; + } } ?>
@@ -699,6 +706,7 @@ class="save-page-button button button-primary">
+
@@ -725,6 +733,7 @@ class="save-page-button button button-primary">
+