MOBILE-2567 quiz: Fix render offline answers in multichoice questions
parent
2484605238
commit
081c1555a6
|
@ -465,10 +465,19 @@ export class CoreQuestionHelperProvider {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
selected.setAttribute('selected', 'selected');
|
selected.setAttribute('selected', 'selected');
|
||||||
}
|
}
|
||||||
} else if (element.type == 'radio' || element.type == 'checkbox') {
|
} else if (element.type == 'radio') {
|
||||||
// Check if this radio or checkbox is selected.
|
// Check if this radio is selected.
|
||||||
if (element.value == question.localAnswers[name]) {
|
if (element.value == question.localAnswers[name]) {
|
||||||
element.setAttribute('checked', 'checked');
|
element.setAttribute('checked', 'checked');
|
||||||
|
} else {
|
||||||
|
element.removeAttribute('checked');
|
||||||
|
}
|
||||||
|
} else if (element.type == 'checkbox') {
|
||||||
|
// Check if this checkbox is checked.
|
||||||
|
if (this.utils.isTrueOrOne(question.localAnswers[name])) {
|
||||||
|
element.setAttribute('checked', 'checked');
|
||||||
|
} else {
|
||||||
|
element.removeAttribute('checked');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Put the answer in the value.
|
// Put the answer in the value.
|
||||||
|
|
Loading…
Reference in New Issue