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'>Click here to select all</div><div id='UnselectAll' class='noSelect WBRButton'>Click here to clear all</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>";
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=SubCat]").each( function() {
} 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=MainCat]").each( function() {
  if($("#UnselectAll").html() === "Select All Sub Categories"){
$(this).attr('checked', false);
$("[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', false);
$(this).attr('checked', true);
});
$("#SelectAll").html("Select All Sub Categories");
});
});
}
}



Revision as of 18:48, 4 June 2013