diff --git a/js/qsm-admin.js b/js/qsm-admin.js index bba3c0518..e6096da14 100644 --- a/js/qsm-admin.js +++ b/js/qsm-admin.js @@ -2537,9 +2537,9 @@ var import_button; } if (qsmQuestionSettings.form_type == 0) { if (questionType == 14) { - $('.correct-answer').hide(); + $('.answer-correct-div').hide(); } else { - $('.correct-answer').show(); + $('.answer-correct-div').show(); } } @@ -3409,9 +3409,9 @@ var import_button; } } if (14 == question_val) { - $('.correct-answer').hide(); + $('.answer-correct-div').hide(); } else { - $('.correct-answer').show(); + $('.answer-correct-div').show(); } if (15 == question_val || 16 == question_val || 17 == question_val) { MicroModal.show('modal-advanced-question-type'); diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index e368d298d..b7ef323d7 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -1781,8 +1781,8 @@ function qsm_show_inline_result(quizID, question_id, value, $this, answer_type, if ( 0 < value.length && data.success == 'correct') { $this.append('
' + qmn_quiz_data[quizID].quick_result_correct_answer_text + '
') $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'); + } else if (0 < value.length && data.success == 'incorrect') { + $this.find('.qmn_radio_answers input[value="' + data.correct_index + '"]').parent().addClass('data-correct-answer'); $this.append('
' + qmn_quiz_data[quizID].quick_result_wrong_answer_text + '
') $this.append('
' + qsm_check_shortcode(data.message) + '
'); } diff --git a/php/admin/functions.php b/php/admin/functions.php index 3dac754a8..4e640b5fb 100644 --- a/php/admin/functions.php +++ b/php/admin/functions.php @@ -1576,7 +1576,7 @@ function qsm_get_input_label_selected( $param ) { '', esc_attr( $key ), esc_attr( $is_selected ), - esc_attr( $val ), + esc_attr( $val ) ); } $allowed_tags = array(