Widget:Sandbox: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
Line 530: | Line 530: | ||
}); | }); | ||
$("div.answer").click(exam, answerClicked); | $("div.answer").click(exam, answerClicked); | ||
$("examSpace").append("<div class='noSelect WBRButton' id='submit'><br />Submit</div>"); | |||
$("#submit').click(event, answerSubmitted); | |||
} | } | ||
} | } | ||
Line 625: | Line 627: | ||
} | } | ||
function answerClicked(event) { | function answerClicked(event){ | ||
$(this).addClass("boxed"); | |||
console.log($(this).children()); | |||
} | |||
function answerSubmitted(event) { | |||
$(".answer").removeClass("boxed"); | $(".answer").removeClass("boxed"); | ||
event.data.examQuestions[event.data.currentQuestion].selectedAnswer = $(this).attr("id"); | event.data.examQuestions[event.data.currentQuestion].selectedAnswer = $(this).attr("id"); |