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 265: | Line 265: | ||
} | } | ||
Q.innerHTML += "<div id='SelectAll' class='noSelect WBRButton'> | Q.innerHTML += "<div id='SelectAll' class='noSelect WBRButton'>Select All Main Categories</div><div id='UnselectAll' class='noSelect WBRButton'>Select All Sub Categories</div><br /><br /><br /><br /><b>Second: choose the number of questions you would like to answer. The maximum number of questions you can select is 45.</b><br /><br /><br />Number of questions:<input type='text' id='numQues' /><br /><br /><div id='Go' class='noSelect WBRButton'>Click here to begin the exam</div>"; | ||
$("#Go").click(function() { | $("#Go").click(function() { | ||
if(countdownCurrent){ | if(countdownCurrent){ | ||
Line 309: | Line 309: | ||
$("#SelectAll").click(function() { | $("#SelectAll").click(function() { | ||
if($("#SelectAll").html() === "Select All Main Categories"){ | |||
$("[name=MainCat]").each( function() { | $("[name=MainCat]").each( function() { | ||
$(this).attr('checked', true); | $(this).attr('checked', true); | ||
$("#SelectAll").html("Clear All Main Categories"); | |||
}); | }); | ||
$("[name= | } else { | ||
$("[name=MainCat]").each( function() { | |||
$(this).attr('checked', true); | $(this).attr('checked', true); | ||
$("#SelectAll").html("Select All Main Categories"); | |||
}); | }); | ||
} | |||
}); | }); | ||
$("#UnselectAll").click(function() { | $("#UnselectAll").click(function() { | ||
$("[name= | if($("#UnselectAll").html() === "Select All Sub Categories"){ | ||
$(this).attr('checked', | $("[name=SubCat]").each( function() { | ||
$(this).attr('checked', true); | |||
$("#UnselectAll").html("Clear All Sub Categories"); | |||
}); | }); | ||
} else { | |||
$("[name=SubCat]").each( function() { | $("[name=SubCat]").each( function() { | ||
$(this).attr('checked', | $(this).attr('checked', true); | ||
$("#SelectAll").html("Select All Sub Categories"); | |||
}); | }); | ||
} | } | ||