Changed answer option object semantics to indices
Evaluating answer should no longer require string matching Answers evaluated based on matching index value integers
This commit is contained in:
@ -364,13 +364,13 @@ function render_question() {
|
||||
for (let i = 0; i < options.length; i ++) {
|
||||
var add_checked = ''
|
||||
if (q_no in answers) {
|
||||
if (answers[q_no] == options[i]) {
|
||||
if (answers[q_no] == options[i][0]) {
|
||||
add_checked = 'checked';
|
||||
}
|
||||
}
|
||||
options_output += `<div class="form-check">
|
||||
<input type="radio" class="form-check-input quiz-option" id="q${current_question}-${i}" name="${q_no}" value="${options[i]}" ${add_checked}>
|
||||
<label for="q${current_question}-${i}" class="form-check-label">${options[i]}</label>
|
||||
<input type="radio" class="form-check-input quiz-option" id="q${current_question}-${i}" name="${q_no}" value="${options[i][0]}" ${add_checked}>
|
||||
<label for="q${current_question}-${i}" class="form-check-label">${options[i][1]}</label>
|
||||
</div>`;
|
||||
}
|
||||
$question_options.html(options_output);
|
||||
|
Reference in New Issue
Block a user