Skip to content

Commit

Permalink
fixed hightlight correct answer issue while using random answer
Browse files Browse the repository at this point in the history
  • Loading branch information
zubairraeen committed Apr 23, 2024
1 parent 9fb5dab commit c0be312
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -1781,8 +1781,9 @@ function qsm_show_inline_result(quizID, question_id, value, $this, answer_type,
if ( 0 < value.length && data.success == 'correct') {
$this.append('<div style="color: green" class="quick-question-res-p qsm-correct-answer-info">' + qmn_quiz_data[quizID].quick_result_correct_answer_text + '</div>')
$this.append('<div class="qsm-inline-correct-info">' + qsm_check_shortcode(data.message) + '</div>');
} 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') {
console.log(data);
$this.find('.qmn_radio_answers input[value="' + data.correct_index + '"]').parent().addClass('data-correct-answer');
$this.append('<div style="color: red" class="quick-question-res-p qsm-incorrect-answer-info">' + qmn_quiz_data[quizID].quick_result_wrong_answer_text + '</div>')
$this.append('<div class="qsm-inline-correct-info">' + qsm_check_shortcode(data.message) + '</div>');
}
Expand Down

0 comments on commit c0be312

Please sign in to comment.