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 686: | Line 686: | ||
$(event.currentTarget).addClass("boxed"); | $(event.currentTarget).addClass("boxed"); | ||
$(event.currentTarget.firstChild).prop("checked", true); | $(event.currentTarget.firstChild).prop("checked", true); | ||
window.exam.examQuestions[window.exam.currentQuestion].selectedAnswer = $("div .boxed").attr("id"); | |||
if ($("#exam").find('#submit').length == 0) { | if ($("#exam").find('#submit').length == 0) { | ||
$("#examSpace").append("<div class='noSelect WBRButton' id='submit'><br />Submit</div>"); | $("#examSpace").append("<div class='noSelect WBRButton' id='submit'><br />Submit</div>"); | ||
Line 731: | Line 732: | ||
function answerSubmitted(event) { | function answerSubmitted(event) { | ||
$("#submit").remove(); | $("#submit").remove(); | ||
if (!window.exam.examQuestions[window.exam.currentQuestion].creditRecieved && window.exam.examQuestions[window.exam.currentQuestion].selectedAnswer === window.exam.examQuestions[window.exam.currentQuestion].RightAnswer) { | if (!window.exam.examQuestions[window.exam.currentQuestion].creditRecieved && window.exam.examQuestions[window.exam.currentQuestion].selectedAnswer === window.exam.examQuestions[window.exam.currentQuestion].RightAnswer) { | ||
window.exam.answeredRight += 1; | window.exam.answeredRight += 1; |