Skip to content

Commit

Permalink
Merge pull request #2364 from QuizandSurveyMaster/CU-85zt92u5r-store-…
Browse files Browse the repository at this point in the history
…failed-results-in-audits

Cu 85zt92u5r store failed results in audits
  • Loading branch information
zubairraeen authored Oct 23, 2023
2 parents 86e505f + a1bf4ea commit fedd5c4
Show file tree
Hide file tree
Showing 8 changed files with 707 additions and 784 deletions.
Binary file added assets/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 39 additions & 11 deletions css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ ul.changelog li.update div.two:before {
flex-direction: row;
flex-wrap: wrap;
align-items: stretch;
border-bottom: 1px solid #cecece;
}
.qsm-sub-text-tab-menu {
display: inline-block;
Expand Down Expand Up @@ -891,25 +892,24 @@ ul.changelog li.update div.two:before {
display: inline-block;
box-sizing: border-box;
}
.qsm_tab_content .subsubsub li {
border-left: 2px solid #aaa;
padding: 0 5px;
}
.qsm_tab_content .subsubsub li:first-child {
border-left: 0;
padding-left: 0;
}
.qsm_tab_content .subsubsub li a {
font-size: 14px;
line-height: 1.2;
padding: 0;
padding: 10px;
}
.qsm_tab_content a:hover,
.qsm_tab_content a:focus {
outline: none;
text-decoration: none;
box-shadow: none;
}
.qsm_tab_content .subsubsub li a.current{
border-bottom: 3px solid #00BEE9;
}
/* Popup */
.qsm-popup {
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif;
Expand Down Expand Up @@ -1183,11 +1183,11 @@ h3.addon_category_name {
.qsm_tab_content input[name="question_limit_key[]"] {
max-width: 150px;
min-width: 150px;
}
}
.qsm_tab_content .question_limit_category {
max-width: 200px;
min-width: 200px;
}
}
.qsm_tab_content textarea {
background: #ffffff none repeat scroll 0 0;
border: 1px solid #dddddd;
Expand Down Expand Up @@ -1335,8 +1335,15 @@ tr .qsm-opt-desc {
#quiz_settings_wrapper .qsm-opt-desc {
display: none !important;
}
.form-table td fieldset label {
body:not(.qsm_page_qmn_global_settings) .form-table td fieldset label {
margin-right: 20px !important;
width: 100%;
}
#correct_answer_logic {
padding-bottom: 10px;
}
.qsm-font-light {
font-weight: 300;
}
.form-table .qsm-opt-tr {
position: relative;
Expand Down Expand Up @@ -2994,7 +3001,7 @@ input#duplicate_questions {
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
flex-wrap: wrap;
align-items: center;
background: #ffffff;
border-top: 1px solid #DADADA;
Expand All @@ -3004,7 +3011,7 @@ input#duplicate_questions {
}
.option-page-result-page-tab-footer .result-tab-footer-buttons {
display: flex;
flex-direction: row;
flex-direction: row;
}
.option-page-result-page-tab-footer .footer-bar-notice {
display: flex;
Expand Down Expand Up @@ -3179,7 +3186,8 @@ input#duplicate_questions {
top: 10px;
}
}
.mlw_quiz_options .qsm_tab_content input[name="end_quiz_if_wrong"]#end_quiz_if_wrong, #end_quiz_if_wrong {
body .qsm_tab_content .qsm-small-input-field input[type="number"],
body .qsm_tab_content .qsm-small-input-field input[type="text"] {
min-width: 65px;
width: 65px;
box-shadow: 0 0 0 transparent;
Expand All @@ -3188,3 +3196,23 @@ input#duplicate_questions {
background-color: #fff;
color: #2c3338;
}
.qsm_tab_content input[type=text].qsm-date-picker {
background: url(../assets/calendar.png) no-repeat right 10px center;
background-size: 14px;
padding: 3px 10px;
min-width: 100px;
background-color: #fff;
}
.qsm-quiz-dates fieldset#scheduled_time_start, .qsm-quiz-dates fieldset#scheduled_time_end {
display: inline-block;
}
.qsm-image-field {
display: flex;
}
.qsm-image-field span {
padding-top: 4px;
}
fieldset#enable_quick_correct_answer_info {
margin-left: 25px;
margin-top: 4px;
}
104 changes: 81 additions & 23 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ var QSMAdmin;
jQuery(".add-more-link").hide();
}
if (jQuery('#limit_category_checkbox-1:checked').length > 0) {
jQuery('.qsm_tab_content input[name="question_per_category"],.qsm_tab_content .category_selection_random').parents("tr").hide();
jQuery('#question_per_category').hide();
jQuery('.category_selection_random').parents("tr").hide();
jQuery('div.select-category-question-limit-maindiv').parents("tr").show();
} else {
jQuery('div.select-category-question-limit-maindiv').parents("tr").hide();
jQuery('.qsm_tab_content input[name="question_per_category"],.qsm_tab_content .category_selection_random .qsm_tab_content .category_selection_random').parents("tr").show();
jQuery('.category_selection_random').parents("tr").show();
jQuery('#question_per_category').show();
}
$('.qsm-tab').on('click', function (event) {
event.preventDefault();
Expand Down Expand Up @@ -150,13 +152,31 @@ var QSMAdmin;
$(document).on('change', '#limit_category_checkbox-1', function (event) {
event.preventDefault();
if (jQuery('#limit_category_checkbox-1:checked').length > 0) {
jQuery('.qsm_tab_content input[name="question_per_category"],.qsm_tab_content .category_selection_random').parents("tr").hide();
jQuery('#question_per_category').hide();
jQuery('div.select-category-question-limit-maindiv').parents("tr").show();
jQuery('.category_selection_random').parents("tr").hide();
} else {
jQuery('div.select-category-question-limit-maindiv').parents("tr").hide();
jQuery('.qsm_tab_content input[name="question_per_category"],.qsm_tab_content .category_selection_random').parents("tr").show();
jQuery('#question_per_category').show();
jQuery('.category_selection_random').parents("tr").show();
}
});
show_hide_show_correct_answer();
$(document).on('change', '#enable_quick_result_mc-1', function (event) {
show_hide_show_correct_answer();
});
function show_hide_show_correct_answer() {
if (jQuery('#enable_quick_result_mc-1:checked').length > 0) {
jQuery('#enable_quick_correct_answer_info').css('opacity', '1');
} else {
jQuery('#enable_quick_correct_answer_info').css('opacity', '0.5');
}
}
jQuery(document).on('change', '#preferred-date-format-custom', function() {
let customValue = jQuery(this).val();
jQuery('#preferred_date_format label.qsm-option-label:last input[type="radio"]').val(customValue);
});

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 @@ -359,22 +379,42 @@ var QSMAdmin;
e.preventDefault();
MicroModal.show('show-all-variable');
});
if ( "" != jQuery('#scheduled_time_end').val() ) {
jQuery('.not_allow_after_expired_time label').css('opacity', '1');
if ( "" != jQuery('#scheduled_time_end-input').val() ) {
jQuery('#not_allow_after_expired_time label').css('opacity', '1');
jQuery('#not_allow_after_expired_time-1').attr('disabled', false);
} else {
jQuery('.not_allow_after_expired_time label').css('opacity', '0.7');
jQuery('#not_allow_after_expired_time label').css('opacity', '0.7');
jQuery('#not_allow_after_expired_time-1').attr('disabled', true);
}
jQuery(document).on('change', '#scheduled_time_end', function () {
jQuery(document).on('change', '#scheduled_time_end-input', function () {
if ( "" != jQuery(this).val() ) {
jQuery('.not_allow_after_expired_time label').css('opacity', '1');
jQuery('#not_allow_after_expired_time label').css('opacity', '1');
jQuery('#not_allow_after_expired_time-1').attr('disabled', false);
} else {
jQuery('.not_allow_after_expired_time label').css('opacity', '0.7');
jQuery('#not_allow_after_expired_time label').css('opacity', '0.7');
jQuery('#not_allow_after_expired_time-1').attr('disabled', true);
}
});
if ( 0 != jQuery('#question_from_total-input').val() ) {
jQuery('#limit_category_checkbox label').css('opacity', '1');
jQuery('#limit_category_checkbox-1').attr('disabled', false);
jQuery('#question_per_category').show();
} else {
jQuery('#limit_category_checkbox label').css('opacity', '0.7');
jQuery('#limit_category_checkbox-1').attr('disabled', true);
jQuery('#question_per_category').hide();
}
jQuery(document).on('change', '#question_from_total-input', function () {
if ( 0 != jQuery(this).val() ) {
jQuery('#limit_category_checkbox label').css('opacity', '1');
jQuery('#limit_category_checkbox-1').attr('disabled', false);
jQuery('#question_per_category').show();
} else {
jQuery('#limit_category_checkbox label').css('opacity', '0.7');
jQuery('#limit_category_checkbox-1').attr('disabled', true);
jQuery('#question_per_category').hide();
}
});
//Hide/show tr based on selection
$('.qsm_tab_content .qsm-opt-tr select').each(function () {
var name = $(this).attr('name');
Expand All @@ -384,38 +424,38 @@ var QSMAdmin;
}
});
$(document).on('change', '.qsm_tab_content select:not(.question_limit_category,.qsm-woo-result-related-products, .qsm-woo-email-related-products), #quiz_settings_wrapper select:not(.question_limit_category)', function () {
var name = $(this).attr('name');
var value = $(this).val();
$('.qsm_hidden_tr').hide();
if ($('.' + name + '_' + value).length > 0) {
hide_show_quiz_options(value);
}
hide_show_quiz_options(value);
});

// form_type (0, 1, 2).
function hide_show_quiz_options(form_type) {
if (0 == form_type) {
$('.qsm_tab_content input[name="system"], .qsm_tab_content input[name="score_roundoff"], .qsm_tab_content input[name="correct_answer_logic"]').parents('tr').show();
$('#score_roundoff').parents('tr').show();
$('#correct_answer_logic').show();
} else {
$('.qsm_tab_content input[name="score_roundoff"], .qsm_tab_content input[name="correct_answer_logic"]').parents('tr').hide();
$('#score_roundoff').parents('tr').hide();
$('#correct_answer_logic').hide();
}
}

$(document).on('click', '.qsm_tab_content input[name="system"]', function () {
var name = $(this).attr('name');
var value = $(this).val();
$('.qsm_hidden_tr_gradingsystem').hide();
$('#correct_answer_logic, #score_roundoff').hide();
if (value == 0 || value == 3) {
$('.qsm_hidden_tr_gradingsystem').show();
$('#correct_answer_logic, #score_roundoff').show();
}
});
$(document).ready(function () {
var system_option = $("input[type=radio][name='system']:checked").val();
$('.qsm_hidden_tr_gradingsystem').hide();
$('#correct_answer_logic, #score_roundoff').hide();
if (system_option == 0 || system_option == 3) {
$('.qsm_hidden_tr_gradingsystem').show();
$('#correct_answer_logic, #score_roundoff').show();
}
hide_show_quiz_options($("input[name='form_type']:checked").val());
if (jQuery('.qsm-date-picker').length) {
jQuery('.qsm-date-picker').datetimepicker({ format: 'm/d/Y H:i', step: 1});
}
hide_show_quiz_options($("select[name='form_type']").find(":selected").val());
});
if ($('.qsm-text-label-wrapper').length > 0) {
var element_position = $('.qsm-text-label-wrapper').offset().top;
Expand Down Expand Up @@ -509,6 +549,24 @@ var QSMAdmin;
}).open();
});

$(document).on('click', '.qsm-image-btn', function (e) {
let button = $(this);
e.preventDefault();
custom_uploader = wp.media({
title: qsm_admin_messages.set_feature_img,
library: {
type: 'image'
},
button: {
text: qsm_admin_messages.use_img // button label text
},
multiple: false
}).on('select', function () { // it also has "open" and "close" events
let attachment = custom_uploader.state().get('selection').first().toJSON();
button.prev('.qsm-image-input').val(attachment.url);
}).open();
});

// opens media library o set background image for quiz
$(document).on('click', '.set_background_image', function (e) {
let button = $(this);
Expand Down
1 change: 1 addition & 0 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ public function qsm_admin_scripts_style( $hook ) {
wp_enqueue_script( 'jquery-ui-tabs' );
wp_enqueue_script( 'jquery-effects-blind' );
wp_enqueue_script( 'jquery-effects-explode' );
wp_enqueue_media();
break;
default:
wp_enqueue_editor();
Expand Down
2 changes: 1 addition & 1 deletion php/admin/quiz-options-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ function qsm_generate_quiz_options() {
function qsm_quiz_options_notice_template() {
?>
<!-- View for Notices -->
<script type="text/template" id="tmpl-notice">
<script type="text/template" id="tmpl-notice">
<div class="notice notice-large notice-{{data.type}}">
<p>{{data.message}}</p>
</div>
Expand Down
Loading

0 comments on commit fedd5c4

Please sign in to comment.