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 4: Line 4:
<style type="text/css">
<style type="text/css">
.boxed{
.boxed{
border:2px solid black !important;
border:0px solid black !important;
}
}
.redBoxed{
.redBoxed{
border:2px solid #F00 !important;
border:0px solid #F00 !important;
}
}


Line 490: Line 490:
}
}
if (obj.AnswerAExp && obj.AnswerAExp.length > 0 && exam.examType === "Tutor") {
if (obj.AnswerAExp && obj.AnswerAExp.length > 0 && exam.examType === "Tutor") {
htmlStuff += "<div class='answerExp explanationHide' id='Ae'><i>&nbsp;&nbsp;&nbsp;&nbsp;" + obj.AnswerAExp + "</i></div>";
htmlStuff += "<div class='answerExp explanationHide' id='Ae'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + obj.AnswerAExp + "</div>";
}
}
if (obj.AnswerB && obj.AnswerB.length > 0) {
if (obj.AnswerB && obj.AnswerB.length > 0) {
Line 496: Line 496:
}
}
if (obj.AnswerBExp && obj.AnswerBExp.length > 0 && exam.examType === "Tutor") {
if (obj.AnswerBExp && obj.AnswerBExp.length > 0 && exam.examType === "Tutor") {
htmlStuff += "<div class='answerExp explanationHide' id='Be'><i>&nbsp;&nbsp;&nbsp;&nbsp;" + obj.AnswerBExp + "</i></div>";
htmlStuff += "<div class='answerExp explanationHide' id='Be'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + obj.AnswerBExp + "</div>";
}
}
if (obj.AnswerC && obj.AnswerC.length > 0) {
if (obj.AnswerC && obj.AnswerC.length > 0) {
Line 502: Line 502:
}
}
if (obj.AnswerCExp && obj.AnswerCExp.length > 0 && exam.examType === "Tutor") {
if (obj.AnswerCExp && obj.AnswerCExp.length > 0 && exam.examType === "Tutor") {
htmlStuff += "<div class='answerExp explanationHide' id='Ce'><i>&nbsp;&nbsp;&nbsp;&nbsp;" + obj.AnswerCExp + "</i></div>";
htmlStuff += "<div class='answerExp explanationHide' id='Ce'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + obj.AnswerCExp + "</div>";
}
}
if (obj.AnswerD && obj.AnswerD.length > 0) {
if (obj.AnswerD && obj.AnswerD.length > 0) {
Line 508: Line 508:
}
}
if (obj.AnswerDExp && obj.AnswerDExp.length > 0 && exam.examType === "Tutor") {
if (obj.AnswerDExp && obj.AnswerDExp.length > 0 && exam.examType === "Tutor") {
htmlStuff += "<div class='answerExp explanationHide' id='De'><i>&nbsp;&nbsp;&nbsp;&nbsp;" + obj.AnswerDExp + "</i></div>";
htmlStuff += "<div class='answerExp explanationHide' id='De'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + obj.AnswerDExp + "</div>";
}
}
if (obj.AnswerEExp && obj.AnswerE.length > 0) {
if (obj.AnswerEExp && obj.AnswerE.length > 0) {
Line 514: Line 514:
}
}
if (obj.AnswerEExp && obj.AnswerEExp.length > 0 && exam.examType === "Tutor") {
if (obj.AnswerEExp && obj.AnswerEExp.length > 0 && exam.examType === "Tutor") {
htmlStuff += "<div class='answerExp explanationHide' id='Ee'><i>&nbsp;&nbsp;&nbsp;&nbsp;" + obj.AnswerEExp + "</i></div>";
htmlStuff += "<div class='answerExp explanationHide' id='Ee'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + obj.AnswerEExp + "</div>";
}
}
$("#examSpace").html(htmlStuff);
$("#examSpace").html(htmlStuff);
Line 605: Line 605:
$(this).addClass("boxed");
$(this).addClass("boxed");
$(this).find("#Ar").prop("checked",true);
$(this).find("#Ar").prop("checked",true);
console.log($(this).children());         
if($("#exam").find('#submit').length == 0){  
if($("#exam").find('#submit').length == 0){  
$("#examSpace").append("<div class='noSelect WBRButton' id='submit'><br />Submit</div>");
$("#examSpace").append("<div class='noSelect WBRButton' id='submit'><br />Submit</div>");
Line 654: Line 653:
$(".answerExp").css("height", "auto");
$(".answerExp").css("height", "auto");
$(".answerExp").css("visibility", "visible");
$(".answerExp").css("visibility", "visible");
                $(".answerExp").each(function(){
                              if($(this).attr('id') === event.data.examQuestions[event.data.currentQuestion].RightAnswer+"e"){
                                      $(this).prepend("Correct: ");
                              } else {
                                      $(this).prepend("Incorrect: ");
                              }
                        });
                });
}
}
$("div.answer").unbind('click');
$("div.answer").unbind('click');

Revision as of 18:52, 27 February 2014