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 120: | Line 120: | ||
$( "input[name='answer']" ).click(function(){ | $( "input[name='answer']" ).click(function(){ | ||
var Results = $("input[name='results']").val().split(","); | |||
var Pos = parseInt($("input[name='pos']").val()); | |||
if(short.RightAnswer.valueOf() == $( this ).val().valueOf()){ | if(short.RightAnswer.valueOf() == $( this ).val().valueOf()){ | ||
Results[Pos] = true; | |||
} | } | ||
else | else | ||
{ | { | ||
Results[Pos] = false; | |||
} | } | ||
Q.innerHTML += "<br /><br /><i>" + short.Explanation + "</i>"; | Q.innerHTML += "<br /><br /><i>" + short.Explanation + "</i>"; | ||
$("input[name='results']").val(Results.toString()); | |||
alert($("input[name='results']").val()); | |||
showButtons(); | showButtons(); | ||
$("input[name='stash']").val(Questions.toString()); | $("input[name='stash']").val(Questions.toString()); |