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 86cu2thhj global settings #2457

Merged
merged 3 commits into from
Feb 5, 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
16 changes: 9 additions & 7 deletions css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,8 @@ ul.changelog li.update div.two:before {
.admin_page_mlw_quiz_options .update-nag {
display: none;
}
.admin_page_mlw_quiz_options #wpwrap {
.admin_page_mlw_quiz_options #wpwrap,
#qsm-export-settings-options button {
overflow: hidden;
}
.admin_page_mlw_quiz_options .qsm-info-widget {
Expand Down Expand Up @@ -907,18 +908,19 @@ ul.changelog li.update div.two:before {
padding: 10px 6px;
width: 100%;
}
.qsm-sub-tab-menu a,
.qsm_tab_content a {
cursor: pointer;
text-decoration: none;
outline: none;
display: inline-block;
box-sizing: border-box;
}
.qsm_tab_content .subsubsub li:first-child {
.qsm-sub-tab-menu .subsubsub li:first-child {
border-left: 0;
padding-left: 0;
}
.qsm_tab_content .subsubsub li a {
.qsm-sub-tab-menu .subsubsub li a {
font-size: 14px;
line-height: 1.2;
padding: 10px;
Expand All @@ -929,7 +931,7 @@ ul.changelog li.update div.two:before {
text-decoration: none;
box-shadow: none;
}
.qsm_tab_content .subsubsub li a.current{
.qsm-sub-tab-menu .subsubsub li a.current{
border-bottom: 3px solid #00BEE9;
}
/* Popup */
Expand Down Expand Up @@ -1177,7 +1179,6 @@ h3.addon_category_name {
.qsm_tab_content input[type="number"],
.qsm_tab_content input[type="url"],
.qsm_global_settings input[type="text"],
.qsm_global_settings input[type="number"],
.qsm_global_settings input[type="email"],
.qsm_global_settings input[type="url"],
.qsm-addon-setting-wrap input[type="email"],
Expand Down Expand Up @@ -1354,11 +1355,12 @@ tr .qsm-opt-desc {
#quiz_settings_wrapper .qsm-opt-desc {
display: none !important;
}
body:not(.qsm_page_qmn_global_settings) .form-table td fieldset label {
.form-table td fieldset label {
margin-right: 20px !important;
width: 100%;
}
#correct_answer_logic {
#correct_answer_logic,
.qsm-p-b-10 {
padding-bottom: 10px;
}
.qsm-font-light {
Expand Down
46 changes: 21 additions & 25 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,14 @@ var QSMAdmin;
let customValue = jQuery(this).val();
jQuery('#preferred_date_format label.qsm-option-label:last input[type="radio"]').val(customValue);
});

if( jQuery('#qsm-select-quiz-apply').length ) {
jQuery('#qsm-select-quiz-apply').multiselect( {
columns: 1,
search: true,
selectAll: true,
dropdownAutoWidth: false
} );
}
jQuery(document).on('click','.add-more-category', function () {
let original = jQuery('div.select-category-question-limit-maindiv');
let lastChild = original.children().last();
Expand Down Expand Up @@ -598,41 +605,30 @@ var QSMAdmin;
});
//theme option setting image end

$(document).on('change', '.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]', function () {
var value = $(this).val();
if (value == '0') {
$(document).on('change', '.qsm_page_qmn_global_settings input[name="qsm-quiz-settings[form_type]"]', function () {
if ( 0 == $(this).val() ) {
$('.global_setting_system').parents('tr').show();
$('.global_setting_score_roundoff').parents('tr').show();
$('#qsm-score-roundoff').parents('label').show();
$("#qsm-correct-answer-logic").show();
} else {
$('.global_setting_system').parents('tr').hide();
$('.global_setting_score_roundoff').parents('tr').hide();

$('#qsm-score-roundoff').parents('label').hide();
$("#qsm-correct-answer-logic").hide();
}
});
$(document).on('change', '.global_setting_system input[name="qsm-quiz-settings[system]"]', function () {
var value = $('input[name="qsm-quiz-settings[system]"]:checked').val();
var value1 = $('.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]').val();
if (value != '1' && value1 == '0') {
$('.global_setting_score_roundoff').parents('tr').show();
if ( 1 != $(this).val() && 0 == $('.qsm_page_qmn_global_settings input[name="qsm-quiz-settings[form_type]"]:checked').val() ) {
$('#qsm-score-roundoff').parents('label').show();
$("#qsm-correct-answer-logic").show();
} else {
$('.global_setting_score_roundoff').parents('tr').hide();
$('#qsm-score-roundoff').parents('label').hide();
$("#qsm-correct-answer-logic").hide();
}
});
$('.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]').trigger('change');
$('.global_setting_system input[name="qsm-quiz-settings[system]"]').trigger('change');
$('.qsm_page_qmn_global_settings input[name="qsm-quiz-settings[form_type]"]:checked').trigger('change');
$('.global_setting_system input[name="qsm-quiz-settings[system]"]:checked').trigger('change');

});
$(document).on('change', '.global_setting_system input[name="qsm-quiz-settings[system]"]', function () {
var value = $('input[name="qsm-quiz-settings[system]"]:checked').val();
var value1 = $('.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]').val();
if (value != '1' && value1 == '0') {
$('.global_setting_score_roundoff').parents('tr').show();
} else {
$('.global_setting_score_roundoff').parents('tr').hide();
}
});
$('.global_form_type_settiong select[name="qsm-quiz-settings[form_type]"]').trigger('change');
$('.global_setting_system input[name="qsm-quiz-settings[system]"]').trigger('change');

$(document).on('click', '#the-list .delete_table_quiz_results_item', function (e) {
e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function qsm_admin_scripts_style( $hook ) {
}
}
// load admin JS after all dependencies are loaded
wp_enqueue_script( 'qsm_admin_js', plugins_url( 'js/qsm-admin.js', __FILE__ ), array( 'jquery', 'backbone', 'underscore', 'wp-util', 'jquery-ui-sortable', 'jquery-touch-punch' ), $this->version, true );
wp_enqueue_script( 'qsm_admin_js', plugins_url( 'js/qsm-admin.js', __FILE__ ), array( 'jquery', 'backbone', 'underscore', 'wp-util', 'jquery-ui-sortable', 'jquery-touch-punch', 'qsm-jquery-multiselect-js' ), $this->version, true );
wp_enqueue_style( 'jquer-multiselect-css', QSM_PLUGIN_CSS_URL . '/jquery.multiselect.min.css', array(), $this->version );
wp_enqueue_script( 'qsm-jquery-multiselect-js', QSM_PLUGIN_JS_URL . '/jquery.multiselect.min.js', array( 'jquery' ), $this->version, true );
wp_enqueue_script( 'micromodal_script', plugins_url( 'js/micromodal.min.js', __FILE__ ), array( 'jquery', 'qsm_admin_js' ), $this->version, true );
Expand Down
Loading