Widget:WJG Sandbox Merge: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 779: | Line 779: | ||
$.each(window.exam.examQuestions, function (index, value) { | $.each(window.exam.examQuestions, function (index, value) { | ||
$("#navPane").append("<div id='" + index + "' class='navPaneButton'> " + (index - -1) + "</div>"); | $("#navPane").append("<div id='" + index + "' class='navPaneButton'> " + (index - -1) + "</div>"); | ||
console.log(index) | |||
window.exam.examQuestions[index].creditReceived=false | |||
}); | }); | ||
$(".navPaneButton").click(questionNavigation); | $(".navPaneButton").click(questionNavigation); | ||
Line 995: | Line 997: | ||
$("#submit").remove(); | $("#submit").remove(); | ||
if (!window.exam.examQuestions[window.exam.currentQuestion].creditReceived && window.exam.examQuestions[window.exam.currentQuestion].selectedAnswer === window.exam.examQuestions[window.exam.currentQuestion].RightAnswer) { | if (!window.exam.examQuestions[window.exam.currentQuestion].creditReceived && window.exam.examQuestions[window.exam.currentQuestion].selectedAnswer === window.exam.examQuestions[window.exam.currentQuestion].RightAnswer) { | ||
console.log("You answered a question correctly") | |||
window.exam.answeredRight += 1; | window.exam.answeredRight += 1; | ||
window.exam.examQuestions[window.exam.currentQuestion].creditReceived = true; | window.exam.examQuestions[window.exam.currentQuestion].creditReceived = true; |