// JavaScript Document /*This loads the buttons' functions*/ $(document).ready(function(){ $('#check1').click(check1); $('#check1one').click(check1one); $('#check1two').click(check1two); $('#check2').click(check2); $('#check2one').click(check2one); $('#check2two').click(check2two); $('#check3').click(check3); $('#check3one').click(check3one); $('#check3two').click(check3two); $('#check4').click(check4); $('#check5').click(check5); $('#checkpale').click(checkpale); $('#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 bonus = ""; var challenge = ""; switch(exercisename) { case "Etymology Exercise I": answer1 = "1. " + $('#text1').val(); answer2 = "2. " + $('#text2').val(); answer3 = "3. " + $('#text3').val(); answer4 = "4. " + $('#text4').val(); answer5 = "5. " + $('#text5').val(); answer6 = "6. " + $('#text6').val() + " / " + $('#text10').val() + " / " + $('#text7').val(); answer7 = "7. " + $('#text8').val() + " / " + $('#text11').val() + " / " + $('#text9').val(); break; case "Etymology Exercise II": answer1 = "1. " + $('#text1').val(); answer2 = "2. " + $('#text2').val(); answer3 = "3. " + $('#text3').val(); answer4 = "4. " + $('#text4').val(); answer5 = "5. " + $('#text5').val() + " / " + $('#text9').val() + " / " + $('#text6').val(); answer6 = "6. " + $('#text7').val()+ " / " + $('#text10').val() + " / " + $('#text8').val(); break; case "Etymology Exercise III": answer1 = "1. " + $('#text1').val(); answer2 = "2. " + $('#text2').val(); answer3 = "3. " + $('#text3').val(); answer4 = "4. " + $('#text4').val() + " / " + $('#text10').val() + " / " + $('#text5').val(); answer5 = "5. " + $('#text6').val() + " / " + $('#text11').val() + " / " + $('#text7').val(); answer6 = "6. " + $('#text8').val() + " / " + $('#text12').val() + " / " + $('#text9').val(); break; case "Grammar Exercise I": answer1 = "1. " + $('#text1').val(); answer2 = "2. " + $('#text2').val(); answer3 = "3. " + $('#text3').val(); answer4 = "4. " + $('#text4').val(); break; case "Grammar Exercise II": if (document.exercise.radio1[0].checked) { answer1 = "1. the curious ministers"; } else if (document.exercise.radio1[1].checked) { answer1 = "1. the heavenly ancient ones"; } else if (document.exercise.radio1[2].checked) { answer1 = "1. that ancient enemy"; } if (document.exercise.radio2[0].checked) { answer1 = "2. blindfolded"; } else if (document.exercise.radio2[1].checked) { answer2 = "2. as a captive"; } else if (document.exercise.radio2[2].checked) { answer2 = "2. as a brave conqueror"; } if (document.exercise.radio3[0].checked) { answer3 = "3. a Beast"; } else if (document.exercise.radio3[1].checked) { answer3 = "3. a whale"; } else if (document.exercise.radio3[2].checked) { answer3 = "3. a warlike creature"; } if (document.exercise.radio4[0].checked) { answer4 = "4. He will be shown mercy"; } else if (document.exercise.radio4[1].checked) { answer4 = "4. He will tremble with his whole body"; } else if (document.exercise.radio4[2].checked) { answer4 = "4. He will be consigned to the eternal flames of Hell"; } if (document.exercise.radio5[0].checked) { answer5 = "5. the chosen ones"; } else if (document.exercise.radio5[1].checked) { answer5 = "5. a huge monster"; } else if (document.exercise.radio5[2].checked) { answer5 = "5. the voters"; } break; case "Paleography Exercise": answer1 = "1. "; if (document.exercise.checkbox1.checked) { answer1 = answer1 + "b,"; } if (document.exercise.checkbox2.checked) { answer1 = answer1 + " f,"; } if (document.exercise.checkbox3.checked) { answer1 = answer1 + " i,"; } if (document.exercise.checkbox4.checked) { answer1 = answer1 + " q,"; } if (document.exercise.checkbox5.checked) { answer1 = answer1 + " c,"; } if (document.exercise.checkbox6.checked) { answer1 = answer1 + " g,"; } if (document.exercise.checkbox7.checked) { answer1 = answer1 + " m,"; } if (document.exercise.checkbox8.checked) { answer1 = answer1 + " y,"; } if (document.exercise.checkbox9.checked) { answer1 = answer1 + " d,"; } if (document.exercise.checkbox10.checked) { answer1 = answer1 + " h,"; } if (document.exercise.checkbox11.checked) { answer1 = answer1 + " p"; } answer2 = "2. " + $('#text1').val(); answer3 = "3. " + $('#text2').val(); answer4 = "4. " + $('#text3').val(); answer5 = "5. " + $('#text4').val(); answer6 = "6. " + $('#text5').val(); answer7 = "7. " + $('#text6').val(); challenge = "Challenge phrase: " + $('#textarea1').val(); 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+=bonus; contents+='
'; contents+=''; contents+=challenge; contents+='
'; contents+=''; planner=window.open("","","menubar,height=500,width=600,scrollbars,resizable","false"); planner.document.write(contents); planner.document.close(); planner.focus(); } //checks the paleography lesson function checkpale() { var challenge = ""; var total = 0; 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 txt9 = $('#text9').val(); var txt10 = $('#text10').val(); var txt11 = $('#text11').val(); var txt12 = $('#text12').val(); var txt13 = $('#text13').val(); var txt14 = $('#text14').val(); var txt15 = $('#text15').val(); var txt16 = $('#text16').val(); var txt17 = $('#text17').val(); var textarea1 = $('#textarea1').val(); if (document.exercise.checkbox1.checked) { total = total + 1; } if (document.exercise.checkbox4.checked) { total = total + 1; } if (document.exercise.checkbox6.checked) { total = total + 1; } if (document.exercise.checkbox9.checked) { total = total + 1; } if (document.exercise.checkbox11.checked) { total = total + 1; } if (txt1.toLowerCase()=="aqua") { total = total + 1; } if (txt2.toLowerCase()=="colorem") { total = total + 1; } if (txt3.toLowerCase()=="duo") { total = total + 1; } if (txt4.toLowerCase()=="bibat") { total = total + 1; } if (txt5.toLowerCase()=="quo") { total = total + 1; } if (txt6.toLowerCase()=="cadavera") { total = total + 1; } if (textarea1.toLowerCase()=="item est fons in syloe a radyce montis syon") { challenge = "The challenge transcription is correct."; } else if (textarea1.toLowerCase()=="item, est fons in syloe a radyce montis syon") { challenge = "The challenge transcription is correct."; } if (total == 11) { alert("Congratulations! All of your answers are correct.\n\n" + challenge); } else if (total == 1) { alert("You have " + total + " answer correct.\n\n" + challenge + "\n\nCare to try again?"); } else { alert("You have " + total + " answers correct.\n\n" + challenge + "\n\nCare to try again?"); } } //checks exercise 5 function check5() { var total=0; if (document.exercise.radio1[2].checked) { total = total + 1; } if (document.exercise.radio2[1].checked) { total = total + 1; } if (document.exercise.radio3[0].checked) { total = total + 1; } if (document.exercise.radio4[2].checked) { total = total + 1; } if (document.exercise.radio5[0].checked) { 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 4 function check4() { var total = 0; var txt1 = $('#text1').val(); var txt2 = $('#text2').val(); var txt3 = $('#text3').val(); var txt4 = $('#text4').val(); if (txt1.toLowerCase()=="luxuriam") { total = total + 1; } if (txt2.toLowerCase()=="discordiam") { total = total + 1; } if (txt3.toLowerCase()=="desperationem") { total = total + 1; } if (txt4.toLowerCase()=="praesumptionem") { 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?"); } } //checks exercise 3 function check3() { var total = 0; 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 txt9 = $('#text9').val(); var txt10 = $('#text10').val(); var txt11 = $('#text11').val(); var txt12 = $('#text12').val(); if (txt1.toLowerCase()=="bon") { total = total + 1; } if (txt2.toLowerCase()=="terr") { total = total + 1; } if (txt3.toLowerCase()=="poen") { total = total + 1; } if (txt4.toLowerCase()=="face") { total = total + 1; } if (txt5.toLowerCase()=="fact") { total = total + 1; } if (txt6.toLowerCase()=="perturba") { total = total + 1; } if (txt7.toLowerCase()=="perturbat") { total = total + 1; } if (txt8.toLowerCase()=="porta") { total = total + 1; } if (txt9.toLowerCase()=="portat") { total = total + 1; } if (txt10.toLowerCase()=="fec") { total = total + 1; } if (txt11.toLowerCase()=="perturbav") { total = total + 1; } if (txt12.toLowerCase()=="portav") { total = total + 1; } if (total == 12) { 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 check3one() { var total = 0; var txt1 = $('#text1').val(); var txt2 = $('#text2').val(); var txt3 = $('#text3').val(); if (txt1.toLowerCase()=="bon") { total = total + 1; } if (txt2.toLowerCase()=="terr") { total = total + 1; } if (txt3.toLowerCase()=="poen") { 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?"); } } //checks exercise 3 function check3two() { var total = 0; var txt4 = $('#text4').val(); var txt5 = $('#text5').val(); var txt6 = $('#text6').val(); var txt7 = $('#text7').val(); var txt8 = $('#text8').val(); var txt9 = $('#text9').val(); var txt10 =$('#text10').val(); var txt11 =$('#text11').val(); var txt12 =$('#text12').val(); if (txt4.toLowerCase()=="face") { total = total + 1; } if (txt10.toLowerCase()=="fec") { total = total + 1; } if (txt5.toLowerCase()=="fact") { total = total + 1; } if (txt6.toLowerCase()=="perturba") { total = total + 1; } if (txt11.toLowerCase()=="perturbav") { total = total + 1; } if (txt7.toLowerCase()=="perturbat") { total = total + 1; } if (txt8.toLowerCase()=="porta") { total = total + 1; } if (txt12.toLowerCase()=="portav") { total = total + 1; } if (txt9.toLowerCase()=="portat") { total = total + 1; } if (total == 9) { 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 2 function check2() { var total = 0; 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 txt9 = $('#text9').val(); var txt10 = $('#text10').val(); if (txt1.toLowerCase()=="virtut") { total = total + 1; } if (txt2.toLowerCase()=="element") { total = total + 1; } if (txt3.toLowerCase()=="oper") { total = total + 1; } if (txt4.toLowerCase()=="serpent") { total = total + 1; } if (txt5.toLowerCase()=="cognosce") { total = total + 1; } if (txt6.toLowerCase()=="cognit") { total = total + 1; } if (txt7.toLowerCase()=="sparge") { total = total + 1; } if (txt8.toLowerCase()=="spars") { total = total + 1; } if (txt9.toLowerCase()=="cognov") { total = total + 1; } if (txt10.toLowerCase()=="spars") { total = total + 1; } if (total == 10) { 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 2 function check2one() { var total = 0; var txt1 = $('#text1').val(); var txt2 = $('#text2').val(); var txt3 = $('#text3').val(); var txt4 = $('#text4').val(); if (txt1.toLowerCase()=="virtut") { total = total + 1; } if (txt2.toLowerCase()=="element") { total = total + 1; } if (txt3.toLowerCase()=="oper") { total = total + 1; } if (txt4.toLowerCase()=="serpent") { 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?"); } } //checks exercise 2 function check2two() { var total = 0; var txt5 = $('#text5').val(); var txt6 = $('#text6').val(); var txt7 = $('#text7').val(); var txt8 = $('#text8').val(); var txt9 = $('#text9').val(); var txt10 = $('#text10').val(); if (txt5.toLowerCase()=="cognosce") { total = total + 1; } if (txt9.toLowerCase()=="cognov") { total = total + 1; } if (txt6.toLowerCase()=="cognit") { total = total + 1; } if (txt7.toLowerCase()=="sparge") { total = total + 1; } if (txt10.toLowerCase()=="spars") { total = total + 1; } if (txt8.toLowerCase()=="spars") { total = total + 1; } if (total == 6) { 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 1 function check1() { var total = 0; 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 txt9 = $('#text9').val(); var txt10 = $('#text10').val(); var txt11 = $('#text11').val(); if (txt1.toLowerCase()=="daemon") { total = total + 1; } if (txt2.toLowerCase()=="natur") { total = total + 1; } if (txt3.toLowerCase()=="angel") { total = total + 1; } if (txt4.toLowerCase()=="mal") { total = total + 1; } if (txt5.toLowerCase()=="sanct") { total = total + 1; } if (txt6.toLowerCase()=="sci") { total = total + 1; } if (txt7.toLowerCase()=="scit") { total = total + 1; } if (txt8.toLowerCase()=="dice") { total = total + 1; } if (txt9.toLowerCase()=="dict") { total = total + 1; } if (txt10.toLowerCase()=="sciv") { total = total + 1; } if (txt11.toLowerCase()=="dix") { total = total + 1; } if (total == 11) { 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 1 function check1two() { var total = 0; var txt6 = $('#text6').val(); var txt7 = $('#text7').val(); var txt8 = $('#text8').val(); var txt9 = $('#text9').val(); var txt10 = $('#text10').val(); var txt11 = $('#text11').val(); if (txt6.toLowerCase()=="sci") { total = total + 1; } if (txt10.toLowerCase()=="sciv") { total = total + 1; } if (txt7.toLowerCase()=="scit") { total = total + 1; } if (txt8.toLowerCase()=="dice") { total = total + 1; } if (txt11.toLowerCase()=="dix") { total = total + 1; } if (txt9.toLowerCase()=="dict") { total = total + 1; } if (total == 6) { 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 1 function check1one() { var total = 0; var txt1 = $('#text1').val(); var txt2 = $('#text2').val(); var txt3 = $('#text3').val(); var txt4 = $('#text4').val(); var txt5 = $('#text5').val(); if (txt1.toLowerCase()=="daemon") { total = total + 1; } if (txt2.toLowerCase()=="natur") { total = total + 1; } if (txt3.toLowerCase()=="angel") { total = total + 1; } if (txt4.toLowerCase()=="mal") { total = total + 1; } if (txt5.toLowerCase()=="sanct") { 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?"); } }