Fix quiz interractivity

This commit is contained in:
Samy Pessé
2014-04-18 19:10:13 +02:00
parent ef4a8ea1b6
commit f7e9abf984
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -20,8 +20,11 @@ define([
$quiz.find(".question").each(function(q) {
var result = true;
var $answers = $quiz.find(".question-answers").slice(q).find("input[type=radio], input[type=checkbox]");
$(this).find("input[type=radio],input[type=checkbox]").each(function(i) {
var $questions = $(this).find(".question-content").find("input[type=radio], input[type=checkbox]");
var $answers = $(this).find(".question-answers").find("input[type=radio], input[type=checkbox]");
$questions.each(function(i) {
var correct = $(this).is(":checked") === $answers.slice(i).first().is(":checked");
result = result && correct;
if (!correct) {