Skip to content

Commit

Permalink
Merge pull request #2152 from QuizandSurveyMaster/dev
Browse files Browse the repository at this point in the history
Release 8.1.5
  • Loading branch information
etvarun authored Apr 13, 2023
2 parents 6ea3b5c + 20de92a commit c21169e
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 27 deletions.
1 change: 1 addition & 0 deletions css/jquery.multiselect.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/jquery.multiselect.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 16 additions & 5 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ var QSMAdmin;
var checked_data = jQuery(this).val().toString();
jQuery('.catergory_comma_values').val(checked_data);
});
jQuery('.category_selection_random').multiselect( {
columns: 1,
placeholder: qsm_admin_messages.select_category,
search: true,
selectAll: true
} );
jQuery('.row-actions-c > .rtq-delete-result').click(function (e) {
e.preventDefault();
var $this = jQuery(this);
Expand Down Expand Up @@ -1604,15 +1610,14 @@ var import_button;
},
loadQuestionBank: function (action = '') {
if (action == 'change') {
$('.qb-load-more-wrapper').remove();
$('#question-bank').find('.question-bank-question').remove();
$('#question-bank').empty();
$('#question-bank').append('<div style="top: 70px;position: relative;left: calc(50% - 20px);" class="qsm-spinner-loader"></div>');
} else if ($('.qb-load-more-wrapper').length > 0) {
$('.qb-load-more-question').hide();
$('.qb-load-more-wrapper').append('<div style="top: 70px;position: relative;left: calc(50% - 20px); class="qsm-spinner-loader"></div>');
$('.qb-load-more-wrapper').append('<div class="qsm-spinner-loader"></div>');
} else {
$('#question-bank').empty();
$('#question-bank').append('<div style="top: 70px;position: relative;left: calc(50% - 20px); class="qsm-spinner-loader"></div>');
$('#question-bank').append('<div style="top: 70px;position: relative;left: calc(50% - 20px);" class="qsm-spinner-loader"></div>');
}
$.ajax({
url: wpApiSettings.root + 'quiz-survey-master/v1/bank_questions/0/',
Expand Down Expand Up @@ -1663,6 +1668,9 @@ var import_button;
$('#question-bank-cat').val(pagination.category);
}
}
if ( 1 > questions.length ) {
$('#question-bank').append('<div style="margin-top: 70px;text-align: center;" >' + qsm_admin_messages.questions_not_found + '</div>');
}
},
addQuestionToQuestionBank: function (question) {
var questionText = QSMQuestion.prepareQuestionText(question.name);
Expand Down Expand Up @@ -1694,6 +1702,7 @@ var import_button;
},
questionBankSuccess: function (model) {
var newModel = _.clone(model.attributes);
newModel.question_id = newModel.id;
newModel.id = null;
QSMQuestion.questions.create(
newModel, {
Expand Down Expand Up @@ -1864,12 +1873,14 @@ var import_button;
model.set('page', page);
QSMQuestion.questions.add(model);
QSMQuestion.addQuestionToPage(model);
QSMQuestion.savePages();

$('.import-button').removeClass('disable_import');
QSMQuestion.countTotal();
import_button.html('').html(qsm_admin_messages.add_question);
import_button.attr("onclick", "return confirm(" + qsm_admin_messages.confirm_message + "' '" + qsm_admin_messages.import_question_again + ")");
QSMQuestion.openEditPopup(model.id, $('.question[data-question-id=' + model.id + ']').find('.edit-question-button'));
$('#save-popup-button').trigger('click');
// $('#save-popup-button').trigger('click');
},
addNewQuestion: function (model) {
var default_answers = parseInt(qsmQuestionSettings.default_answers);
Expand Down
11 changes: 6 additions & 5 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ function qmnValidatePage(quiz_form_id) {

// Show start quiz button if first page is visible
function check_if_show_start_quiz_button(container, total_pages, page_number) {
if(jQuery('.quiz_begin').css('display') == 'block'){
if(container.find('.quiz_begin').css('display') == 'block'){
container.find(".mlw_custom_start").show();
container.find(".mlw_custom_next").hide();
}else{
Expand Down Expand Up @@ -1498,7 +1498,7 @@ jQuery(function () {
});
});

jQuery(document).on('change', '.qmn_radio_answers input' , function (e) {
jQuery(document).on('change', '.qmn_radio_answers input, .qsm_dropdown' , function (e) {
var quizID = jQuery(this).parents('.qsm-quiz-container').find('.qmn_quiz_id').val();
if (qmn_quiz_data[quizID].enable_quick_result_mc == 1) {
let question_id = jQuery(this).attr('name').split('question')[1],
Expand All @@ -1508,7 +1508,7 @@ jQuery(function () {
}
});
let qsm_inline_result_timer;
jQuery(document).on('keyup', '.mlw_answer_open_text, .mlw_answer_number', function (e) {
jQuery(document).on('keyup', '.mlw_answer_open_text, .mlw_answer_number, .qmn_fill_blank ', function (e) {
let $i_this = jQuery(this);
let quizID = jQuery(this).parents('.qsm-quiz-container').find('.qmn_quiz_id').val();
if (qmn_quiz_data[quizID].enable_quick_result_mc == 1) {
Expand All @@ -1517,20 +1517,21 @@ jQuery(function () {
let question_id = $i_this.attr('name').split('question')[1],
value = $i_this.val(),
$this = $i_this.parents('.quiz_section');
qsm_show_inline_result(quizID, question_id, value, $this, 'input');
qsm_show_inline_result(quizID, question_id, value, $this, 'input',$this.find('.qmn_fill_blank').index($i_this));
}, 2000);
}
});

//inline result status function
function qsm_show_inline_result(quizID, question_id, value, $this, answer_type) {
function qsm_show_inline_result(quizID, question_id, value, $this, answer_type, index = null ) {
jQuery.ajax({
type: 'POST',
url: qmn_ajax_object.ajaxurl,
data: {
action: "qsm_get_question_quick_result",
question_id: question_id,
answer: value,
index: index,
answer_type: answer_type,
show_correct_info: qmn_quiz_data[quizID].enable_quick_correct_answer_info
},
Expand Down
8 changes: 6 additions & 2 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Quiz And Survey Master
* Description: Easily and quickly add quizzes and surveys to your website.
* Version: 8.1.4
* Version: 8.1.5
* Author: ExpressTech
* Author URI: https://quizandsurveymaster.com/
* Plugin URI: https://expresstech.io/
Expand Down Expand Up @@ -43,7 +43,7 @@ class MLWQuizMasterNext {
* @var string
* @since 4.0.0
*/
public $version = '8.1.4';
public $version = '8.1.5';

/**
* QSM Alert Manager Object
Expand Down Expand Up @@ -356,6 +356,8 @@ 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_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 );
$qsm_admin_messages = array(
'error' => __('Error', 'quiz-master-next'),
Expand Down Expand Up @@ -428,6 +430,8 @@ public function qsm_admin_scripts_style( $hook ) {
'success_message' => __("Thanks, you are now subscribed to our mailing list!", 'quiz-master-next'),
'error_message' => __("Sorry, unable to subscribe. Please try again later!", 'quiz-master-next'),
),
'select_category' => __("Select Category", 'quiz-master-next'),
'questions_not_found' => __("Question not found!", 'quiz-master-next'),
);
wp_localize_script( 'qsm_admin_js', 'qsm_admin_messages', $qsm_admin_messages );

Expand Down
Loading

0 comments on commit c21169e

Please sign in to comment.