Skip to content

Commit

Permalink
Merge pull request #2001 from QuizandSurveyMaster/dev
Browse files Browse the repository at this point in the history
Release 8.0.5
  • Loading branch information
etvarun authored Oct 20, 2022
2 parents 9aa7b49 + 1e408b5 commit 39ce35b
Show file tree
Hide file tree
Showing 33 changed files with 739 additions and 441 deletions.
2 changes: 1 addition & 1 deletion css/admin-dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ h2.hndle.ui-sortable-handle {
display: flex;
background: #fff;
position: absolute;
z-index: 1;
z-index: 10;
border-bottom: 1px solid #dfd4d4;
justify-content: center;
}
Expand Down
2 changes: 2 additions & 0 deletions css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
*/

.mlw_qmn_question .qmn_user_incorrect_answer{
display: block;
color: #dc3232;
margin-bottom: 5px;
padding-left: 10px;
Expand All @@ -220,6 +221,7 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
}

.mlw_qmn_question .qmn_user_correct_answer{
display: block;
color: green;
margin-bottom: 5px;
padding-left: 10px;
Expand Down
132 changes: 107 additions & 25 deletions css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,9 @@ ul.changelog li.update div.two:before {
color: #2271b1;
box-sizing: border-box;
}
.qsm-theme-color-settings .qsm-popup__content label{
font-weight: 400;
}
.qsm-popup__close {
background: transparent;
border: 0;
Expand Down Expand Up @@ -915,7 +918,8 @@ body .qsm-popup__btn-primary {
transform: translateY(-10%);
}
}
.qsm-popup-slide {
.qsm-popup-slide,
.qsm-d-none{
display: none;
}
.qsm-popup-slide.is-open {
Expand Down Expand Up @@ -1330,7 +1334,7 @@ td.scheduled_time_start {
}
.qsm-text-label-wrapper>h2 {
font-size: 24px;
border-bottom: 1px solid #ccc;
/*border-bottom: 1px solid #ccc;*/
padding-bottom: 10px;
line-height: normal;
}
Expand Down Expand Up @@ -1665,37 +1669,39 @@ td.scheduled_time_start {
.popup-template-span-wrap .popup-copied-des span.dashicons {
line-height: 28px;
}
.comment-inner-wrap {
/* display: none;
*/
}
.qsm-theme-color-settings .qsm-popup__container,
.qsm-standard-popup .qsm-popup__container{
padding: 0;
margin: 0;
position: relative;
min-width: 450px;
min-width: 525px;
max-width: 100%;
max-height: 90vh;
}
.qsm-theme-color-settings .qsm-popup__header .qsm-popup__title,
.qsm-standard-popup .qsm-popup__header .qsm-popup__title{
padding: 10px 20px;
}
.qsm-standard-popup .qsm-popup__header .qsm-popup__close{
.qsm-standard-popup .qsm-popup__header .qsm-popup__close,
.qsm-theme-color-settings .qsm-popup__header .qsm-popup__close{
position: relative;
font-size: 22px;
border: 1px solid #ddd;
padding: 15px;
cursor: pointer;
}
.qsm-standard-popup .qsm-popup__content{
padding: 20px 20px;
.qsm-standard-popup .qsm-popup__content,
.qsm-theme-color-settings .qsm-popup__content{
padding: 20px;
margin: 0;
box-shadow: inset 0 0 10px 1px #ddd;
}
.qsm-standard-popup .qsm-popup__content a{outline: none;box-shadow: none;text-decoration: underline;}
.qsm-standard-popup .qsm-popup__content a{outline: none;box-shadow: none;text-decoration: none;}
.qsm-standard-popup .qsm-popup__content table{
width: 100%;
border-spacing: 0 5px;
}
.qsm-theme-color-settings .qsm-popup__footer,
.qsm-standard-popup .qsm-popup__footer{
padding: 12px 20px;
}
Expand Down Expand Up @@ -1736,13 +1742,24 @@ td.scheduled_time_start {
display: inline-block;
margin-right: 5px;
}
.qsm-standard-popup .qsm-popup__header .qsm-popup__title .title-tag{
background: #D0DAFF;
border-radius:5px;
padding: 4px 10px;
display: inline-block;
font-size: 11px;
letter-spacing: 1px;
vertical-align: middle;
margin: 0 5px;
}
.qsm-upgrade-box{
display: inline-block;
width: 100%;
box-sizing: border-box;
padding: 10px;
max-width: 800px;
}
.qsm-popup-upgrade .qsm-upgrade-box{padding: 0;}
.qsm-popup-upgrade-close{
border:none;
padding:0px;
Expand All @@ -1753,16 +1770,7 @@ td.scheduled_time_start {
margin: 15px 0 10px;
letter-spacing: 1px;
}
.qsm-upgrade-box h5{
background: #D0DAFF;
border-radius:5px;
padding: 4px 10px;
display: inline-block;
font-size: 11px;
letter-spacing: 1px;
vertical-align: middle;
margin: 0 5px;
}

.qsm-upgrade-box .qsm-upgrade-text{
font-size: 16px;
line-height: 22px;
Expand Down Expand Up @@ -1839,14 +1847,16 @@ td.scheduled_time_start {
.qsm-upgrade-box .qsm-upgrade-buttons a.qsm_bundle{
padding: 10px 20px;
}
.qsm-upgrade-box .qsm-upgrade-buttons.qsm-upgrade-buttons-report-analysis{
.qsm-upgrade-box .qsm-upgrade-buttons.qsm-page-upgrade-buttons{
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-content: center;
align-items: center;
}
.qsm-upgrade-box .qsm-upgrade-buttons.qsm-upgrade-buttons-report-analysis a{width: auto;margin-right: 10px;font-weight: 500;font-size: 14px;padding: 10px 20px;}
.qsm-upgrade-box .qsm-upgrade-buttons.qsm-page-upgrade-buttons a{
width: auto;margin-right: 10px;font-weight: 500;font-size: 14px;padding: 10px 20px;
}
/** * Style tab design */
.wp-upload-form {
background: #fafafa;
Expand Down Expand Up @@ -1889,7 +1899,7 @@ td.scheduled_time_start {
}
}
@media screen and (max-width: 767px) {
.qsm-upgrade-box .qsm-upgrade-buttons.qsm-upgrade-buttons-report-analysis a{width: 100%;margin-right: 0;}
.qsm-upgrade-box .qsm-upgrade-buttons.qsm-page-upgrade-buttons a{width: 100%;margin-right: 0;}
.qsm-quiz-row td:nth-of-type(2n) {
display: none;
}
Expand Down Expand Up @@ -2272,7 +2282,7 @@ input#duplicate_questions {
}
.qsm-badge {
background: linear-gradient(225deg, #344ad6, #42d96b);
z-index: 9999;
z-index: 9;
position: absolute;
color: #fff;
right: 5px;
Expand Down Expand Up @@ -2492,4 +2502,76 @@ input#duplicate_questions {
width: 100%;
max-width: 100%;
min-width: auto;
}
/*QSM quiz theme setting tabs start*/
.qsm-quiz-theme-option-subheading {
margin-bottom: 0;
color: #2f87cc;
font-size: 15px;
}
.qsm-theme-color-settings .quiz-theme-option-image-button {
padding: 3px 9px;
font-size: 11px;
}
.qsm-theme-color-settings .quiz-theme-option-image-button .dashicons{
line-height: 24px;
}
.qsm-theme-color-settings .wp-picker-container .wp-color-result.button,
.qsm-theme-color-settings footer.qsm-popup__footer .button{
margin: 0 0 0 10px;
}
.qsm-theme-option-image,
.qsm-theme-color-settings .wp-picker-container {
position: relative;
}
.qsm-theme-color-settings .wp-picker-holder {
position: absolute;
z-index: 9999;
top: 61px;
left: -136px;
}
.qsm-theme-color-settings .wp-picker-container label{
width: 195px;
}
.qsm-theme-color-settings .wp-picker-input-wrap {
position: absolute;
width: 258px;
top: 37px;
left: -136px;
z-index: 9999;
}
.qsm-theme-color-settings .qsm-popup__content{
max-height: 70vh;
overflow-x: auto;
}
.qsm-theme-color-settings span.wp-color-result-text {
min-width: 64px;
}
.qsm-theme-option-image{
width: 112px;
}
.qsm-theme-color-settings .quiz-theme-option-image-thumbnail {
max-width: 100%;
margin-top: 10px;
border: 1px solid #868686bd;
border-radius: 2px;
}
.qsm-theme-option-image-remove {
position: absolute;
right: 25px;
top: calc(50% - 10px);
opacity: 0;
}
.qsm-theme-color-settings .qsm-theme-option-image:hover .qsm-theme-option-image-remove{
opacity: 1;
}
.qsm-theme-color-settings hr {
margin: 25px 0;
}
.qsm-theme-color-settings footer.qsm-popup__footer {
text-align: right;
}
/*QSM quiz theme setting tabs end*/
.qsm-row input[type=text]{
border-radius: 4px;
}
44 changes: 40 additions & 4 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,35 @@ var QSMAdmin;
}).open();
});

//theme option setting image start
$(document).on('click', '.quiz-theme-option-image-button', function (e) {
let button = $(this);
e.preventDefault();
custom_uploader = wp.media({
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('.quiz-theme-option-image-input').val(attachment.url);
button.next('.qsm-theme-option-image').fadeIn();
button.hide();
button.next('.qsm-theme-option-image').find('.quiz-theme-option-image-thumbnail').attr('src', attachment.url);
}).open();
});
jQuery(document).on('click', '.qsm-theme-option-image-remove', function () {
let button = $(this);
button.parents('.qsm-theme-option-image').hide();
button.parents('.qsm-theme-option-image').prevAll('.quiz-theme-option-image-input').val("");
button.parents('.qsm-theme-option-image').prevAll('.quiz-theme-option-image-button').fadeIn();

});
//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') {
Expand Down Expand Up @@ -604,8 +633,14 @@ if (jQuery('body').hasClass('admin_page_mlw_quiz_options')) {
jQuery(document).on('click', '.qsm-customize-color-settings', function (e) {
e.preventDefault();
MicroModal.show('qsm-theme-color-settings');
if (jQuery('.my-color-field').length > 0) {
jQuery('.my-color-field').wpColorPicker();
if (jQuery('.qsm-color-field').length > 0) {
jQuery('.qsm-color-field').wpColorPicker();
jQuery('.qsm-color-field').each(function () {
if (jQuery(this).attr('data-label')) {
jQuery(this).parents('.wp-picker-container').find('.wp-color-result-text').html( jQuery(this).attr('data-label') );
}
});

}
});
});
Expand Down Expand Up @@ -2628,6 +2663,7 @@ var import_button;
if (13 == question_val) {
QSMQuestion.prepareEditPolarQuestion(question_val);
}
jQuery(document).trigger('qsm-change-answer-editor-after');
});

// Adds event handlers for searching questions
Expand Down Expand Up @@ -2698,7 +2734,7 @@ var import_button;
MicroModal.show('modal-advanced-question-type');
$('#question_type').val(previous_question_val);
return false;
}
}
// show points field only for polar in survey and simple form
if (qsmQuestionSettings.form_type != 0) {
if (13 == question_val) {
Expand All @@ -2718,7 +2754,7 @@ var import_button;
}
});



//Add new category
$(document).on('click', '#qsm-category-add-toggle', function () {
Expand Down
14 changes: 8 additions & 6 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ var qsmTimerInterval = [];
quizID = parseInt(quiz.quiz_id);
QSM.initPagination(quizID);
qsmTimerInterval[quizID] = setInterval(function () { qmnTimeTakenTimer(quizID) }, 1000);

if ( ( quiz.hasOwnProperty('pagination') || ( quiz.qpages.hasOwnProperty(2) && !jQuery('.qsm-quiz-container-'+quizID+' .qsm-auto-page-row').length ) ) ) {
if ( ( quiz.hasOwnProperty('pagination') || ( _.keys(quiz.qpages).length > 1 && !jQuery('.qsm-quiz-container-'+quizID+' .qsm-auto-page-row').length ) ) ) {
qsmEndTimeTakenTimer(quizID);
jQuery('.qsm-quiz-container-' + quizID + ' #timer').val(0);
jQuery(".qsm-quiz-container-" + quizID + " input[name='timer_ms']").val(0);
Expand Down Expand Up @@ -763,12 +762,17 @@ function qsmScrollTo($element) {
function qmnDisplayError(message, field, quiz_form_id) {
jQuery('#' + quiz_form_id + ' .qmn_error_message_section').addClass('qmn_error_message');
jQuery('#' + quiz_form_id + ' .qmn_error_message').text(message);
field.closest('.quiz_section').addClass('qmn_error');
if (field.parents('.qsm_contact_div').length) {
field.parents('.qsm_contact_div').addClass('qmn_error');
} else {
field.closest('.quiz_section').addClass('qmn_error');
}
}

function qmnResetError(quiz_form_id) {
jQuery('#' + quiz_form_id + ' .qmn_error_message').text('');
jQuery('#' + quiz_form_id + ' .qmn_error_message_section').removeClass('qmn_error_message');
jQuery('#' + quiz_form_id + ' .qsm_contact_div').removeClass('qmn_error');
jQuery('#' + quiz_form_id + ' .quiz_section').removeClass('qmn_error');
}

Expand Down Expand Up @@ -1522,7 +1526,7 @@ jQuery(function () {
var form_data = new FormData();
form_data.append('file', file_data);
form_data.append('action', 'qsm_upload_image_fd_question');
var question_id = $this.parent('.quiz_section').find('.mlw_file_upload_hidden_value').attr("name").replace('question', '');
var question_id = $this.parent('.quiz_section').find('.mlw_file_upload_media_id').attr("name").replace('question', '');
form_data.append('question_id', question_id);
$this.next('.loading-uploaded-file').show();
jQuery.ajax({
Expand All @@ -1537,7 +1541,6 @@ jQuery(function () {
$this.next('.loading-uploaded-file').hide();
if (obj.type == 'success') {
$this.next().next('.remove-uploaded-file').show();
$this.next().next().next('.mlw_file_upload_hidden_value').val(obj.file_url);
$this.parent('.quiz_section').find('.mlw_file_upload_hidden_path').val(obj.file_path);
$this.parent('.quiz_section').find('.mlw_file_upload_media_id').val(obj.media_id);
$this.parent('.quiz_section').find('.mlw-file-upload-error-msg').hide();
Expand Down Expand Up @@ -1571,7 +1574,6 @@ jQuery(function () {
var obj = jQuery.parseJSON(response);
if (obj.type == 'success') {
$this.hide();
$this.parent('.quiz_section').find('.mlw_file_upload_hidden_value').val('');
$this.parent('.quiz_section').find('.mlw_file_upload_hidden_path').val('');
$this.parent('.quiz_section').find('.mlw_file_upload_media_id').val('');
$this.parent('.quiz_section').find('.mlw_answer_file_upload').val('');
Expand Down
Loading

0 comments on commit 39ce35b

Please sign in to comment.