// JavaScript Document
/*This loads the buttons' functions*/
$(document).ready(function(){
$('#check1').click(check1);
$('#check2').click(check2);
$('#check3').click(check3);
$('#check4').click(check4);
$('#check5').click(check5);
$('#printit').click(printit);
//$('#printit').click(printIt);
});
//print the answers
function printit() {
var name=prompt("Please enter your name");
var exercisename=$('#exercisename').val();
var answer1 = "";
var answer2 = "";
var answer3 = "";
var answer4 = "";
var answer5 = "";
var answer6 = "";
var answer7 = "";
var answer8 = "";
var answer9 = "";
var answer10 = "";
var answer11 = "";
var answer12 = "";
var answer13 = "";
var answer14 = "";
var answer15 = "";
var answer16 = "";
var answer17 = "";
var answer18 = "";
var answer19 = "";
var answer20 = "";
var answer21 = "";
var answer22 = "";
var answer23 = "";
var answer24 = "";
var answer25 = "";
var answer26 = "";
var answer27 = "";
var answer28 = "";
var answer29 = "";
var answer30 = "";
var bonus = "";
switch(exercisename)
{
case "Grammar Exercise III":
answer1 = "1. " + $('#select1').val();
answer2 = "2. " + $('#text1').val();
break;
case "Grammar Exercise II":
answer1 = "Since, however, " + $('#text1').val() + " is the privation " + $('#text2').val() + ", it cannot enter the intellect except through " + $('#text3').val() + "; " + $('#text4').val() + ", however cannot enter through anything other than itself. For everything which is thought of is either thought of as " + $('#text5').val() + ", or as " + $('#text6').val() + "-in-potency or as " + $('#text7').val() + "-in-actuality.";
break;
case "Etymology Exercise I":
answer1 = "1. " + $('#text1').val();
answer2 = "2. " + $('#text2').val();
answer3 = "3. " + $('#text3').val();
answer4 = "4. " + $('#text4').val();
answer5 = "5. " + $('#text5').val();
break;
case "Etymology Exercise II":
answer1 = "1. " + $('#text1').val() + " / " + $('#text2').val();
answer2 = "2. " + $('#text3').val() + " / " + $('#text4').val();
answer3 = "3. " + $('#text5').val() + " / " + $('#text6').val();
answer4 = "4. " + $('#text7').val() + " / " + $('#text8').val();
break;
case "Paleography Exercise":
if (document.exercise.checkbox1.checked)
{
answer1 = answer1 + "1. a. Yes";
}
else
{
answer1 = answer1 + "a. No";
}
if (document.exercise.checkbox2.checked)
{
answer1 = answer1 + "
b. Yes";
}
else
{
answer1 = answer1 + "
b. No";
}
if (document.exercise.checkbox3.checked)
{
answer1 = answer1 + "
c. Yes";
}
else
{
answer1 = answer1 + "
c. No";
}
if (document.exercise.checkbox4.checked)
{
answer1 = answer1 + "
d. Yes";
}
else
{
answer1 = answer1 + "
d. No";
}
if (document.exercise.checkbox5.checked)
{
answer1 = answer1 + "
e. Yes";
}
else
{
answer1 = answer1 + "
e. No";
}
if (document.exercise.checkbox6.checked)
{
answer1 = answer1 + "
f. Yes";
}
else
{
answer1 = answer1 + "
f. No";
}
if (document.exercise.checkbox7.checked)
{
answer1 = answer1 + "
g. Yes";
}
else
{
answer1 = answer1 + "
g. No";
}
if (document.exercise.checkbox8.checked)
{
answer1 = answer1 + "
h. Yes";
}
else
{
answer1 = answer1 + "
h. No";
}
if (document.exercise.checkbox9.checked)
{
answer1 = answer1 + "
i. Yes";
}
else
{
answer1 = answer1 + "
i. No";
}
answer2 = "2. Number of straight s's: " + $('#text1').val();
if (document.exercise.radio1[0].checked)
{
answer3 = answer3 + "3. a. tall s";
}
else if (document.exercise.radio1[1].checked)
{
answer3 = answer3 + "3. a. f";
}
if (document.exercise.radio2[0].checked)
{
answer3 = answer3 + "
b. tall s";
}
else if (document.exercise.radio2[1].checked)
{
answer3 = answer3 + "
b. f";
}
if (document.exercise.radio3[0].checked)
{
answer3 = answer3 + "
c. tall s";
}
else if (document.exercise.radio3[1].checked)
{
answer3 = answer3 + "
c. f";
}
if (document.exercise.radio4[0].checked)
{
answer3 = answer3 + "
d. tall s";
}
else if (document.exercise.radio4[1].checked)
{
answer3 = answer3 + "
d. f";
}
if (document.exercise.radio5[0].checked)
{
answer3 = answer3 + "
e. tall s";
}
else if (document.exercise.radio5[1].checked)
{
answer3 = answer3 + "
e. f";
}
if (document.exercise.radio6[0].checked)
{
answer3 = answer3 + "
f. tall s";
}
else if (document.exercise.radio6[1].checked)
{
answer3 = answer3 + "
f. f";
}
answer4 = "4. " + $('#text2').val();
answer5 = "5. " + $('#text3').val();
answer6 = "6. " + $('#text4').val();
answer7 = "7. " + $('#text5').val();
bonus = "Bonus question: " + $('#text6').val();
break;
case "Grammar Exercise I":
answer1 = "Wherefore it seems very true, that 'just as the bat's eye " + $('#text1').val() + " in the light, so the eye of the mind " + $('#text2').val() + " before the most obvious things of nature'; because accustomed to the shadows of beings and the phantasms of the sensible world, when it looks upon the light of the highest Being, " + $('#text3').val() + " " + $('#text4').val() + " nothing, not understanding that darkness itself is the fullest illumination of the mind, just as when the eye " + $('#text5').val() + " pure light " + $('#text6').val() + " to itself " + $('#text7').val() + " nothing.";
break;
default:
}
contents= "
'; contents+=name; contents+='
'; contents+=exercisename; contents+=''; contents+=''; contents+=answer1; contents+='
'; contents+=''; contents+=answer2; contents+='
'; contents+=''; contents+=answer3; contents+='
'; contents+=''; contents+=answer4; contents+='
' contents+=''; contents+=answer5; contents+='
' contents+=''; contents+=answer6; contents+='
' contents+=''; contents+=answer7; contents+='
' contents+=''; contents+=answer8; contents+='
' contents+=''; contents+=answer9; contents+='
' contents+=''; contents+=answer10; contents+='
' contents+=''; contents+=answer11; contents+='
' contents+=''; contents+=answer12; contents+='
' contents+=''; contents+=answer13; contents+='
' contents+=''; contents+=answer14; contents+='
' contents+=''; contents+=answer15; contents+='
' contents+=''; contents+=answer16; contents+='
' contents+=''; contents+=answer17; contents+='
' contents+=''; contents+=answer18; contents+='
' contents+=''; contents+=answer19; contents+='
' contents+=''; contents+=answer20; contents+='
' contents+=''; contents+=answer21; contents+='
' contents+=''; contents+=answer22; contents+='
' contents+=''; contents+=answer23; contents+='
' contents+=''; contents+=answer24; contents+='
' contents+=''; contents+=answer25; contents+='
' contents+=''; contents+=answer26; contents+='
' contents+=''; contents+=answer27; contents+='
' contents+=''; contents+=answer28; contents+='
' contents+=''; contents+=answer29; contents+='
' contents+=''; contents+=answer30; contents+='
' contents+=''; planner=window.open("","","menubar,height=500,width=600,scrollbars,resizable","false"); planner.document.write(contents); planner.document.close(); planner.focus(); } //check the paleography lesson function checkpale1() { var total = 0; if (document.exercise.checkbox2.checked) { total = total + 1; } if (document.exercise.checkbox5.checked) { total = total + 1; } if (document.exercise.checkbox7.checked) { total = total + 1; } if (total == 3) { alert("Congratulations! All of your answers are correct."); } else if (total == 1) { alert("You have " + total + " answer correct.\n\nCare to try again?"); } else { alert("You have " + total + " answers correct.\n\nCare to try again?"); } } function checkpale2() { var total = 0; var txt1 = $('#text1').val(); if (txt1=="5") { total = total + 1; } else if (txt1.toLowerCase()=="five") { total = total + 1; } if (document.exercise.radio1[1].checked) { total = total + 1; } if (document.exercise.radio2[0].checked) { total = total + 1; } if (document.exercise.radio3[0].checked) { total = total + 1; } if (document.exercise.radio4[0].checked) { total = total + 1; } if (document.exercise.radio5[1].checked) { total = total + 1; } if (document.exercise.radio6[1].checked) { total = total + 1; } if (total == 7) { alert("Congratulations! All of your answers are correct."); } else if (total == 1) { alert("You have " + total + " answer correct.\n\nCare to try again?"); } else { alert("You have " + total + " answers correct.\n\nCare to try again?"); } } function checkpale3() { var total = 0; var txt2 = $('#text2').val(); var txt3 = $('#text3').val(); var txt4 = $('#text4').val(); var txt5 = $('#text5').val(); if (txt2.toLowerCase()=="post") { total = total + 1; } if (txt3.toLowerCase()=="crastino") { total = total + 1; } if (txt4.toLowerCase()=="destructa") { total = total + 1; } if (txt5.toLowerCase()=="constat") { total = total + 1; } if (total == 4) { alert("Congratulations! All of your answers are correct."); } else if (total == 1) { alert("You have " + total + " answer correct.\n\nCare to try again?"); } else { alert("You have " + total + " answers correct.\n\nCare to try again?"); } } function checkpale() { var total = 0; var bonus = ""; var txt1 = $('#text1').val(); var txt2 = $('#text2').val(); var txt3 = $('#text3').val(); var txt4 = $('#text4').val(); var txt5 = $('#text5').val(); var txt6 = $('#text6').val(); if (document.exercise.checkbox2.checked) { total = total + 1; } if (document.exercise.checkbox5.checked) { total = total + 1; } if (document.exercise.checkbox7.checked) { total = total + 1; } if (txt1=="5") { total = total + 1; } else if (txt1.toLowerCase()=="five") { total = total + 1; } if (document.exercise.radio1[1].checked) { total = total + 1; } if (document.exercise.radio2[0].checked) { total = total + 1; } if (document.exercise.radio3[0].checked) { total = total + 1; } if (document.exercise.radio4[0].checked) { total = total + 1; } if (document.exercise.radio5[1].checked) { total = total + 1; } if (document.exercise.radio6[1].checked) { total = total + 1; } if (txt2.toLowerCase()=="post") { total = total + 1; } if (txt3.toLowerCase()=="crastino") { total = total + 1; } if (txt4.toLowerCase()=="destructa") { total = total + 1; } if (txt5.toLowerCase()=="constat") { total = total + 1; } if (txt6.toLowerCase()=="sint") { bonus = "The challenge question is correct."; } if (total == 14) { alert("Congratulations! All of your answers are correct.\n" + bonus); } else if (total == 1) { alert("You have " + total + " answer correct.\n\n" + bonus + "\n\nCare to try again?"); } else { alert("You have " + total + " answers correct.\n\n" + bonus + "\n\nCare to try again?"); } } //checks exercise 3 function check4() { var txt1 = $('#text1').val(); var txt2 = $('#text2').val(); var txt3 = $('#text3').val(); var txt4 = $('#text4').val(); var txt5 = $('#text5').val(); var txt6 = $('#text6').val(); var txt7 = $('#text7').val(); var total = 0; if (txt1.toLowerCase()=="non-being") { total = total + 1; } if (txt2.toLowerCase()=="of being") { total = total + 1; } if (txt3.toLowerCase()=="being") { total = total + 1; } if (txt4.toLowerCase()=="being") { total = total + 1; } if (txt5.toLowerCase()=="non-being") { total = total + 1; } if (txt6.toLowerCase()=="being") { total = total + 1; } if (txt7.toLowerCase()=="being") { total = total + 1; } if (total == 7) { alert("Congratulations! All of your answers are correct."); } else if (total == 1) { alert("You have " + total + " answer correct.\n\nCare to try again?"); } else { alert("You have " + total + " answers correct.\n\nCare to try again?"); } } //checks exercise 3 function check2() { var txt1 = $('#text1').val(); var txt2 = $('#text2').val(); var txt3 = $('#text3').val(); var txt4 = $('#text4').val(); var txt5 = $('#text5').val(); var txt6 = $('#text6').val(); var txt7 = $('#text7').val(); var txt8 = $('#text8').val(); var total = 0; if (txt1.toLowerCase()=="potent") { total = total + 1; } if (txt2.toLowerCase()=="activate") { total = total + 1; } if (txt3.toLowerCase()=="potentate") { total = total + 1; } if (txt4.toLowerCase()=="actions") { total = total + 1; } if (txt5.toLowerCase()=="potable") { total = total + 1; } if (txt6.toLowerCase()=="actually") { total = total + 1; } if (txt7.toLowerCase()=="act") { total = total + 1; } if (txt8.toLowerCase()=="potential") { total = total + 1; } if (total == 8) { alert("Congratulations! All of your answers are correct."); } else if (total == 1) { alert("You have " + total + " answer correct.\n\nCare to try again?"); } else { alert("You have " + total + " answers correct.\n\nCare to try again?"); } } function check3() { var txt1 = $('#text1').val(); var txt2 = $('#text2').val(); var txt3 = $('#text3').val(); var txt4 = $('#text4').val(); var txt5 = $('#text5').val(); var txt6 = $('#text6').val(); var txt7 = $('#text7').val(); var total = 0; if (txt1=="behaves") { total = total + 1; } if (txt2=="behaves") { total = total + 1; } if (txt3=="it seems") { total = total + 1; } if (txt4=="to see") { total = total + 1; } if (txt5=="sees") { total = total + 1; } if (txt6=="seems") { total = total + 1; } if (txt7=="to see") { total = total + 1; } if (total == 7) { alert("Congratulations! All of your answers are correct."); } else if (total == 1) { alert("You have " + total + " answer correct.\n\nCare to try again?"); } else { alert("You have " + total + " answers correct.\n\nCare to try again?"); } } function check1() { var txt1 = $('#text1').val(); var txt2 = $('#text2').val(); var txt3 = $('#text3').val(); var txt4 = $('#text4').val(); var txt5 = $('#text5').val(); var total = 0; if (txt1=="cogent") { total = total + 1; } if (txt2=="aspect") { total = total + 1; } if (txt3=="occurred") { total = total + 1; } if (txt4=="fugacious") { total = total + 1; } if (txt5=="contemplated") { total = total + 1; } if (total == 5) { alert("Congratulations! All of your answers are correct."); } else if (total == 1) { alert("You have " + total + " answer correct.\n\nCare to try again?"); } else { alert("You have " + total + " answers correct.\n\nCare to try again?"); } } //checks exercise 5 function check5() { //set the scores to 0 var total = 0; //set the translation variable by splitting it into an array var sel1 = $('#select1').val(); var txt1 = $('#text1').val(); txt1 = txt1.toLowerCase(); if (sel1=="anaphora") { total = total + 1; } if (txt1.search(/nec/)!=-1) { total = total + 1; } if (total == 2) { alert("Congratulations! All of your answers are correct."); } else if (total == 1) { alert("You have " + total + " answer correct.\n\nCare to try again?"); } else { alert("You have " + total + " answers correct.\n\nCare to try again?"); } }