Widget:SandboxNew: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
Line 6: | Line 6: | ||
var Q = document.getElementById('question'); | var Q = document.getElementById('question'); | ||
Q.innerHTML = ""; | Q.innerHTML = ""; | ||
var | var Questions = $("input[name='stash']").val().split(","); | ||
$("input[name='pos']").val( | var Pos = parseInt($("input[name='pos']").val()); | ||
if(Pos <= Questions.length){ | |||
$("input[name='pos']").val(Pos + 1); | |||
loadQuestion(); | loadQuestion(); | ||
} | |||
else { | |||
alert("End of Exam! :D"); | |||
} | |||
}); | }); | ||
$('#back').on('click', function(event){ | $('#back').on('click', function(event){ | ||
$("input[name='pos']").val($("input[name='pos']").val( | var Q = document.getElementById('question'); | ||
Q.innerHTML = ""; | |||
var newPos = parseInt($("input[name='pos']").val()) - 1; | |||
$("input[name='pos']").val(newPos); | |||
loadQuestion(); | loadQuestion(); | ||
}); | }); | ||
} | } |