Widget:Sandbox: Difference between revisions

Jump to navigation Jump to search
Matt Pijoan (talk | contribs)
No edit summary
Matt Pijoan (talk | contribs)
No edit summary
Line 281: Line 281:
}
}
function removeDuplicates(obj) {
function removeDuplicates(obj) {
var output = "<div id='removeNum'><b>Choose the number of questions you would like to answer. The maximum number of questions you can select is <span id='countShow'>" + obj.questionListAll.length + "</span>.</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></div>";
                event.data.maxQ = 0;
                if(obj.questionListAll.length > 45){
                        event.data.maxQ = 45;
                } else {
                        event.data.maxQ = obj.questionListAll.length;
                }
var output = "<div id='removeNum'><b>Choose the number of questions you would like to answer. The maximum number of questions you can select is <span id='countShow'>" + event.data.maxQ + "</span>.</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></div>";
if ($("#exam").find('#numQues').length == 0) {
if ($("#exam").find('#numQues').length == 0) {
$("#exam").append(output);
$("#exam").append(output);
Line 403: Line 409:
}, {
}, {
ok : function (res) {
ok : function (res) {
event.data.maxQ = res.Count;
                if(obj.questionListAll.length > 45){
                        event.data.maxQ = 45;
                } else {
                        event.data.maxQ = obj.questionListAll.length;
                }
var output = "<b>Choose the number of questions you would like to answer. The maximum number of questions you can select is <span id='countShow'>" + event.data.maxQ + "</span>.</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>";
var output = "<b>Choose the number of questions you would like to answer. The maximum number of questions you can select is <span id='countShow'>" + event.data.maxQ + "</span>.</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>";
if ($("#exam").find('#numQues').length == 0) {
if ($("#exam").find('#numQues').length == 0) {

Revision as of 15:17, 18 March 2014