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
 
(18 intermediate revisions by the same user not shown)
Line 87: Line 87:
}
}


function loginCheck(arg, exam) {
function loginCheck(exam) {
var Q = document.getElementById('question');
var form = "<div id='Pat' class='noSelect WBRButton'><br />USMLE Format</div><div id='Flash' class='noSelect WBRButton'><br />Flash Cards</div>";
var form = "Man Mode: <input type='radio' name='type' id='type' value='ph' /> Korean Mode: <input type='radio' name='type' id='type' value='fc' />";
$("#question").html(form);
Q.innerHTML = form;
$(".WBRButton").click(function () {
$("input[name='type']").click(function () {
                alert($(this).attr('id'));
$("input[name='FC']").val($("input[name='type']:checked").val());
var form = "<div id='y' class='noSelect WBRButton'><br />Enable Timer</div><div id='n' class='noSelect WBRButton'><br />Disable Timer</div>";
var form = "Timer?<br />Yes <input type='radio' name='timer' value=1 /> No: <input type='radio' name='timer' value=0 />";
$("#question").html(form);
Q.innerHTML = form;
$(".WBRButton").click(function () {
$("input[name='timer']").click(function () {
                        alert($(this).attr('id'));
if ($("input[name='timer']:checked").val() === '1') {
if ($(this).attr('id') === 'y') {
var sel = "<select name='amt' id='amt'><option disabled selected>Choose</option><option value='1'>1</option><option value='30'>30</option><option value='40'>40</option></select>";
var form = "<div id='1' class='noSelect WBRButton'><br />1 Minute</div><div id='10' class='noSelect WBRButton'><br />10 Minute</div><div id='20' class='noSelect WBRButton'><br />20 Minutes</div><div id='40' class='noSelect WBRButton'><br />40 Minutes</div>"
Q.innerHTML = sel;
$("#question").html(form);
$("#amt").change(function () {
$(".WBRButton").click(function () {
countdownCurrent = parseInt($("#amt").val()) * 6000;
                                        alert($(this).parent.attr('id'));
countdownCurrent = parseInt($(this).attr('id')) * 6000;


examHandler(arg, exam);
examHandler(exam);
});
});
} else {
} else {
examHandler(arg, exam);
examHandler(exam);
}
}
});
});
Line 117: Line 118:
return str;
return str;
}
}
function examHandler(arg, exam) {
function examHandler(exam) {
if (arg === 'Random') {
        if (exam === 'Queue') {
            queueExam();
} else {
selectExam(exam);
selectExam(exam);
} else if (arg === 'Queue') {
queueExam();
} else {
alert("Wat.");
}
}


Line 195: Line 194:
}
}
queryString += "]]&eq=yes&p[format]=json";
queryString += "]]&eq=yes&p[format]=json";
        alert(queryString);
         $.get(queryString, function (data) {
         $.get(queryString, function (data) {
var obj =  jQuery.parseJSON(data);
var obj =  jQuery.parseJSON(data);
$("#countShow").html(obj.rows.toString());
$("#countShow").html(obj.rows.toString());
$.each(obj.results, function(index, value){
      alert(value.fulltext);
});
$("#numQues").removeAttr('disabled');
$("#numQues").removeAttr('disabled');
});
});
Line 222: Line 223:
$xml = $(xmlDoc),
$xml = $(xmlDoc),
$title = $xml.find("text");
$title = $xml.find("text");
if ($title.text().indexOf('Placeholder,') == -1) {
if ($title.text().indexOf('Placeholder,') ==r-1) {
addNewSection("User:" + mw.user.name() + "/WBRQueue", 'Placeholder,', mw.user.tokens.get('editToken'));
addNewSection("User:" + mw.user.name() + "/WBRQueue", 'Placeholder,', mw.user.tokens.get('editToken'));
alert('First Timah!');
alert('First Timah!');
Line 701: Line 702:
<div id="question" style="visibility:hidden;">
<div id="question" style="visibility:hidden;">
<b>Click here to start the exam:</b><br />
<b>Click here to start the exam:</b><br />
<a href="#" onclick="loginCheck('Random','USMLE Step 1')"><img src="http://static.wikidoc.org/8/87/Step1.png" /></a>
<a href="#" onclick="loginCheck('USMLE Step 1')"><img src="http://static.wikidoc.org/8/87/Step1.png" /></a>
<a href="#" onclick="loginCheck('Random','USMLE Step 2 CK')"><img src="http://static.wikidoc.org/0/07/Step2CK.png" /></a>
<a href="#" onclick="loginCheck('USMLE Step 2 CK')"><img src="http://static.wikidoc.org/0/07/Step2CK.png" /></a>
<a href="#" onclick="loginCheck('Random','USMLE Step 3')"><img src="http://static.wikidoc.org/0/08/Step3.png" /></a>
<a href="#" onclick="loginCheck('USMLE Step 3')"><img src="http://static.wikidoc.org/0/08/Step3.png" /></a>
<a href="#" onclick="loginCheck('Random','Board Review')"><img src="http://static.wikidoc.org/7/75/Boardcertification.png" /></a>
<a href="#" onclick="loginCheck('Board Review')"><img src="http://static.wikidoc.org/7/75/Boardcertification.png" /></a>
<a href="#" onclick="loginCheck('Random','MCAT')"><img src="http://static.wikidoc.org/4/4b/MCAT.png" /></a><br />
<a href="#" onclick="loginCheck('MCAT')"><img src="http://static.wikidoc.org/4/4b/MCAT.png" /></a><br />
<!-- bold + larger font size-->
<!-- bold + larger font size-->
<b>Click here to repeat questions you've gotten wrong previously</b>
<b>Click here to repeat questions you've gotten wrong previously</b>
<input type="button" onclick="loginCheck('Queue','Nuffin')" value="Review Exam" /><br />
<input type="button" onclick="loginCheck('Queue')" value="Review Exam" /><br />


</div>
</div>

Latest revision as of 14:18, 1 July 2013