Widget:FormSandbox: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
No edit summary |
||
Line 57: | Line 57: | ||
$('#USMLE3').css("visibility","visible"); | $('#USMLE3').css("visibility","visible"); | ||
} | } | ||
if($('#input_3').val()==="ABNS"){ | |||
$('#ABNS').css("height","auto"); | |||
$('#ABNS').css("visibility","visible"); | |||
} | |||
if($('#input_3').val()==="MCAT"){ | if($('#input_3').val()==="MCAT"){ | ||
$('#MCAT').css("height","auto"); | $('#MCAT').css("height","auto"); | ||
Line 94: | Line 99: | ||
$('#USMLE3').css("height","0px"); | $('#USMLE3').css("height","0px"); | ||
$('#USMLE3').css("visibility","hidden"); | $('#USMLE3').css("visibility","hidden"); | ||
$('#ABNS').css("height","0px"); | |||
$('#ABNS').css("visibility","hidden"); | |||
$('#MCAT').css("height","0px"); | $('#MCAT').css("height","0px"); | ||
$('#MCAT').css("visibility","hidden"); | $('#MCAT').css("visibility","hidden"); | ||
Line 109: | Line 116: | ||
$('#BoardReviewFC').css("visibility","hidden"); | $('#BoardReviewFC').css("visibility","hidden"); | ||
} | } | ||
function addSavetoServerButton(){ | |||
$('.formtable').append('<div id="sendToServer">Click here to upload to server</div>'); | |||
} | |||
function sendToServer(){ | |||
var api = new mw.Api(); | |||
api.get({ | |||
action : 'sendQuestionstoServer', | |||
question_id : "WBR1502", | |||
examType: "USMLE Step 1", | |||
questionPrompt: "Here is an example prompt", | |||
overallExplanation: "Here is an example overallExplanation", | |||
AnswerA: "Blah Blah Answer A", | |||
AnswerAexplanation: "This is why Answer A is wrong", | |||
AnswerB: "Blah Blah Answer B", | |||
AnswerBexplanation: "This is why Answer B is wrong", | |||
AnswerC: "Blah Blah Answer C", | |||
AnswerCexplanation: "This is why Answer C is right", | |||
AnswerD: "Blah Blah Answer D", | |||
AnswerDexplanation: "This is why Answer D is wrong", | |||
AnswerE: "Blah Blah Answer E", | |||
AnswerEexplanation: "This is why Answer E is wrong", | |||
EducationalObjectives: "A one sentence summary of the full explanation.", | |||
References: "Book A page 123, Book B page 432", | |||
RightAnswer: "C", | |||
Keywords: ["Cancer", "Chronic lymphocytic leukemia", "CLL", "Chemotherapy"], | |||
Reviewed: true, | |||
format : 'json' | |||
}, { | |||
ok : function (res) { | |||
alert("Data successfully uploaded.") | |||
} | |||
}); | |||
} | |||
} | |||
</script> | </script> | ||
</includeonly> | </includeonly> |