.
This commit is contained in:
@@ -104,7 +104,13 @@
|
||||
$(`ol.physics-answer-list input`).each((n, el) => { el.disabled = true; });
|
||||
{{question.get_answers_js}}.forEach((el, n) => {
|
||||
console.log(el)
|
||||
$(`ol.physics-answer-list li:eq(${n})`).addClass(`answer-${el}`)
|
||||
li_el = $(`ol.physics-answer-list li:eq(${n})`)//.addClass(`answer-${el}`)
|
||||
if (el == li_el.find("input").checked) {
|
||||
li_el.addClass("answer-correct");
|
||||
} else {
|
||||
li_el.addClass("answer-incorrect");
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
//$("ul.physics-answer-list li[data-ans='{{question.best_answer}}']").addClass("correct");
|
||||
@@ -140,11 +146,21 @@
|
||||
.answer-true {
|
||||
border: 1px solid purple;
|
||||
}
|
||||
.answer-correct {
|
||||
border: 1px solid purple;
|
||||
background-color: green;
|
||||
}
|
||||
.answer-false {
|
||||
border: 1px solid purple;
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.physics-answer-list input:checked::after {
|
||||
margin-left: 20px;
|
||||
content: "True"
|
||||
}
|
||||
.physics-answer-list input:not(:checked)::after {
|
||||
margin-left: 20px;
|
||||
content: "False"
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user