home *** CD-ROM | disk | FTP | other *** search
/ DOKAN 22 / DOKAN22.iso / Webs / www.crosswinds.net / ~hendra / quiz.js < prev    next >
Encoding:
Text File  |  2000-02-07  |  16.5 KB  |  402 lines

  1. <!-- hide this script tag's contents from old browsers
  2.  
  3. //Daniel C. Peterson, 1997  All Rights Reserved
  4. //User fee required for commercial pages
  5. //email webmaster@webwinder.com for a quote
  6.  
  7. function init() 
  8.               {
  9.               questions = new Array()
  10.               questions[1] = "Vol.11 File 08: ........"
  11.               questions[2] = "Real Name of Ai Haibara's Sister is ....."
  12.               questions[3] = "In Manga series Vol. 4, what \"ORO\" means ?"
  13.               questions[4] = "In which volume Conan make Sonoko Suzuki as the detective for the first time ? "
  14.               questions[5] = "Vol.05 background : "
  15.               questions[6] = "Beside her karate, what the scary techniques from Ran ?"
  16.               questions[7] = "One thing that Shinichi dislike....."
  17.               questions[8] = "Shinichi's favorite cake...."
  18.               questions[9] = "When Eri Sasaki appears for the first time ?"
  19.               questions[10] = "And what the cover image is (when Eri Sasaki appears for the first time) ?"
  20.               questions[11] = "When was Heiji appears for the first time ?"
  21.               questions[12] = "What is the name of clasiccal song that appears in vol. 7 ? "
  22.               questions[13] = "Who is the author of the song (which appears in vol. 7) ?"
  23.               questions[14] = "Who is Kogoro's most wanted idol ?"
  24.               questions[15] = "When was \"Meitantei Conan\" published for the first time?"
  25.               questions[16] = "What is the name of computer virus that appears in this story ?"
  26.               questions[17] = "When was heiji realized conan = shinichi ?"
  27.               questions[18] = "Who was the name of the Tetsuharu Tomizawa killer ?"
  28.               questions[19] = "In which file you can find Giant Monster: \"Gomera\" or \"Gamellon\" theater movie ? (It titles \"Gomera Last Duel\")"
  29.               questions[20] = "the first name of Sonoko Suzuki's sister is ....."
  30.               questions[21] = "The name of shinichi \"girl-friend\" at vol.7 is ....."
  31.               questions[22] = "Vol.16, File 06: ......."
  32.               questions[23] = "Vol.14, File 04: ......."
  33.               questions[24] = "A thing Conan use to speak as another person's sound is ...."
  34.               questions[25] = "In Book 16, who was Kaito Kid disguising to when Conan caught him"
  35.               questions[26] = "When was Kaito Kid appears for the second time"
  36.               questions[27] = "Ai Haibara real name is ......"
  37.               questions[28] = "Where does Heizi live ?"
  38.               questions[29] = "In Vol.17, what is \"L\" in \"L.N.R\" means"
  39.               questions[30] = "What is the cover of Vol.19"
  40.  
  41.               answerA = new Array()
  42.               answerA[1] = "Shinichi Lover"
  43.               answerA[2] = "Sherry Miyano"
  44.               answerA[3] = "Rich"
  45.               answerA[4] = "4"
  46.               answerA[5] = "An castle"
  47.               answerA[6] = "Her Judo"
  48.               answerA[7] = "Soccer"
  49.               answerA[8] = "Lemon Pie"
  50.               answerA[9] = "At volume 11"
  51.               answerA[10] = "Conan Walking on the forest"
  52.               answerA[11] = "Vol. 5"
  53.               answerA[12] = "Moonlight Sonata"
  54.               answerA[13] = "Mozart"
  55.               answerA[14] = "TWO-MIX"
  56.               answerA[15] = "1994"
  57.               answerA[16] = "Die Hard"
  58.               answerA[17] = "Vol. 10"
  59.               answerA[18] = "Yuzo Tomizawa"
  60.               answerA[19] = "8"
  61.               answerA[20] = "Chikako"
  62.               answerA[21] = "Ayumi Yoshida"
  63.               answerA[22] = "Black Star"
  64.               answerA[23] = "Question among the fallen leaves"
  65.               answerA[24] = "A pen"
  66.               answerA[25] = "Sonoko Suzuki"
  67.               answerA[26] = "Vol. 16"
  68.               answerA[27] = "Shiro Miyano"
  69.               answerA[28] = "Kyoto"
  70.               answerA[29] = "Light"
  71.               answerA[30] = "Tokyo Tower"
  72.  
  73.               answerB = new Array()
  74.               answerB[1] = "Murder between the live broadcasting"
  75.               answerB[2] = "Masami Hirota"
  76.               answerB[3] = "Big"
  77.               answerB[4] = "5"
  78.               answerB[5] = "Bridge"
  79.               answerB[6] = "Her screaming"
  80.               answerB[7] = "Solving a Mystery"
  81.               answerB[8] = "Black Forest "
  82.               answerB[9] = "At Volume 12"
  83.               answerB[10] = "Conan wearing a tengu mask"
  84.               answerB[11] = "Vol. 10"
  85.               answerB[12] = "Symphony No.16"
  86.               answerB[13] = "Beethoven"
  87.               answerB[14] = "Minami Takayama"
  88.               answerB[15] = "1995"
  89.               answerB[16] = "Night Illusion"
  90.               answerB[17] = "Vol. 11"
  91.               answerB[18] = "Tatsuji Tomizawa"
  92.               answerB[19] = "9"
  93.               answerB[20] = "Atsuko"
  94.               answerB[21] = "Ai Haibara"
  95.               answerB[22] = "Last Situation"
  96.               answerB[23] = "Conan Grins"
  97.               answerB[24] = "A bowtie"
  98.               answerB[25] = "Ran"
  99.               answerB[26] = "Vol. 18"
  100.               answerB[27] = "Shiho Miyano"
  101.               answerB[28] = "Hokaido"
  102.               answerB[29] = "Left"
  103.               answerB[30] = "Eifel Tower"
  104.  
  105.               answerC = new Array()
  106.               answerC[1] = "Kidnapping of Ayumi"
  107.               answerC[2] = "Shiho Miyano"
  108.               answerC[3] = "Gold"
  109.               answerC[4] = "6"
  110.               answerC[5] = "Forest"
  111.               answerC[6] = "Her Mahjong plays"
  112.               answerC[7] = "Attending an Sherlock Holmes club"
  113.               answerC[8] = "Pancake "
  114.               answerC[9] = "At Volume 14"
  115.               answerC[10] = "Conan dressed as Kaito KID"
  116.               answerC[11] = "Vol. 15"
  117.               answerC[12] = "Moonlight Densetsu"
  118.               answerC[13] = "Keiji Asoh"
  119.               answerC[14] = "Yooko Okino"
  120.               answerC[15] = "1996"
  121.               answerC[16] = "Hackers"
  122.               answerC[17] = "Vol. 12"
  123.               answerC[18] = "Taichi Tomizawa"
  124.               answerC[19] = "10"
  125.               answerC[20] = "Ayako"
  126.               answerC[21] = "Ryoko Akagi"
  127.               answerC[22] = "Vanish"
  128.               answerC[23] = "Yukiko Grins"
  129.               answerC[24] = "a microphone"
  130.               answerC[25] = "Sonoko's father (Leader of Suzuki Clan)"
  131.               answerC[26] = "Vol. 20"
  132.               answerC[27] = "Taro Miyano"
  133.               answerC[28] = "Tokyo"
  134.               answerC[29] = "Lock"
  135.               answerC[30] = "A Plane"
  136.  
  137.               answerD = new Array()
  138.               answerD[1] = "Meditation Room"
  139.               answerD[2] = "Akemi Miyano"
  140.               answerD[3] = "It doesn't means anythings (cann't be translated)"
  141.               answerD[4] = "7"
  142.               answerD[5] = "Mountain"
  143.               answerD[6] = "All of above"
  144.               answerD[7] = "Music"
  145.               answerD[8] = "Birdthday cake"
  146.               answerD[9] = "At volume 16"
  147.               answerD[10] = "Conan is singing"
  148.               answerD[11] = "Vol. 20"
  149.               answerD[12] = "Bloody Venus"
  150.               answerD[13] = "Leonardo Da Vinci"
  151.               answerD[14] = "REX"
  152.               answerD[15] = "1997"
  153.               answerD[16] = "Baron Night"
  154.               answerD[17] = "Vol. 13"
  155.               answerD[18] = "Unknown"
  156.               answerD[19] = "13"
  157.               answerD[20] = "Masaru"
  158.               answerD[21] = "Ran Mouri"
  159.               answerD[22] = "Unexcepting Meeting"
  160.               answerD[23] = "The Case Begins"
  161.               answerD[24] = "Conan's glasses"
  162.               answerD[25] = "Kogoro Mouri"
  163.               answerD[26] = "Vol. 21"
  164.               answerD[27] = "Akemi Miyano"
  165.               answerD[28] = "Osaka"
  166.               answerD[29] = "Line"
  167.               answerD[30] = "Osaka Tower"
  168.  
  169.               rightAns = new Array
  170.               rightAns[1] = "d"
  171.               rightAns[2] = "d"
  172.               rightAns[3] = "c"
  173.               rightAns[4] = "b"
  174.               rightAns[5] = "b"
  175.               rightAns[6] = "c"
  176.               rightAns[7] = "d"
  177.               rightAns[8] = "a"
  178.               rightAns[9] = "a"
  179.               rightAns[10] = "b"
  180.               rightAns[11] = "b"
  181.               rightAns[12] = "a"
  182.               rightAns[13] = "b"
  183.               rightAns[14] = "c"
  184.               rightAns[15] = "a"
  185.               rightAns[16] = "d"
  186.               rightAns[17] = "d"
  187.               rightAns[18] = "c"
  188.               rightAns[19] = "c"
  189.               rightAns[20] = "c"
  190.               rightAns[21] = "c"
  191.               rightAns[22] = "c"
  192.               rightAns[23] = "a"
  193.               rightAns[24] = "b"
  194.               rightAns[25] = "b"
  195.               rightAns[26] = "c"
  196.               rightAns[27] = "b"
  197.               rightAns[28] = "d"
  198.               rightAns[29] = "a"
  199.               rightAns[30] = "d"
  200.  
  201.               reference = new Array()
  202.               reference[1] = "none"
  203.               reference[2] = "Real Name !"
  204.               reference[3] = "It's word in Italian language !"
  205.               reference[4] = "none"
  206.               reference[5] = "none"
  207.               reference[6] = "Read Vol. 15"
  208.               reference[7] = "Ah... you wrong, this is Shinichi fav. things "
  209.               reference[8] = "none"
  210.               reference[9] = "none"
  211.               reference[10] = "none"
  212.               reference[11] = "none"
  213.               reference[12] = "none"
  214.               reference[13] = "none"
  215.               reference[14] = "You saw him/her at Kogoro first case"
  216.               reference[15] = "none"
  217.               reference[16] = "It's The character name in the novel \nthat authorized by Yusaku Kudo"
  218.               reference[17] = "none"
  219.               reference[18] = "Read Vol. 13"
  220.               reference[19] = "FILE ! not VOLUME !"
  221.               reference[20] = "Read Vol. 05"
  222.               reference[21] = "none"
  223.               reference[22] = "none"
  224.               reference[23] = "none"
  225.               reference[24] = "none"
  226.               reference[25] = "none"
  227.               reference[26] = "SECOND TIME !"
  228.               reference[27] = "Read Vol.19"
  229.               reference[28] = "none"
  230.               reference[29] = "none"
  231.               reference[30] = "none"
  232.               } 
  233.  
  234. function nextQuestion(form)
  235. //set the total number of questions equal to quizend
  236.  
  237. {   var quizEnd = eval(20 * 1);
  238.     if(form.questNo.value == quizEnd) {
  239.        form.question.value = "";
  240.        form.choiceA.value = "";
  241.        form.choiceB.value = "";
  242.        form.choiceC.value = "";
  243.        form.choiceD.value = "";
  244.        form.yourChoice.value = "";
  245.        form.question.value = "End of Quiz. You can now procced to \"Conan Award\" aplication page"; } else {
  246.     if((form.questNo.value == "")||(form.questNo.value != "")) {
  247. nummidi = 20
  248. day = new Date()
  249. seed = day.getTime()
  250. ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*nummidi
  251. + 1,10)
  252. form.questNo.value = ran    }
  253.     form.question.value = questions[form.questNo.value];
  254.     form.choiceA.value = answerA[form.questNo.value];
  255.     form.choiceB.value = answerB[form.questNo.value];
  256.     form.choiceC.value = answerC[form.questNo.value];
  257.     form.choiceD.value = answerD[form.questNo.value];
  258.     form.yourChoice.value = "";
  259.     if(form.myScore.value == "") {form.myScore.value = 0; } else 
  260.     { form.myScore.value = form.myScore.value - 1; }
  261.    }
  262. }
  263.  
  264.    function checkAnswer(form) {
  265.       
  266.       var myScore = 0;
  267.  
  268.  if(form.yourChoice.value == rightAns[form.questNo.value]) {
  269.       form.myScore.value = eval(form.myScore.value) + eval(1)} else {alert("Ups, you take wrong answer!\n\nHint: " + reference[form.questNo.value]);
  270.       form.myScore.value = form.myScore.value - 1 }
  271.  
  272.    var quizEnd = ran - 1 ;
  273.     if(form.questNo.value == quizEnd) {
  274.        form.question.value = "";
  275.        form.choiceA.value = "";
  276.        form.choiceB.value = "";
  277.        form.choiceC.value = "";
  278.        form.choiceD.value = "";
  279.        form.yourChoice.value = "";
  280.        form.question.value = "End of Quiz. Now please procced to \"Conan Award\" aplication page ";} else {
  281.     if(form.questNo.value == "30"){form.questNo.value=1
  282. } else {    
  283.        form.questNo.value = eval(form.questNo.value) + 1;
  284.     }
  285.     form.question.value = questions[form.questNo.value];
  286.     form.choiceA.value = answerA[form.questNo.value];
  287.     form.choiceB.value = answerB[form.questNo.value];
  288.     form.choiceC.value = answerC[form.questNo.value];
  289.     form.choiceD.value = answerD[form.questNo.value];
  290.     form.yourChoice.value = "";
  291.     if(form.myScore.value == "") {form.myScore.value = 0; } else {
  292.                                                   form.myScore.value = form.myScore.value; }
  293.  
  294.    }
  295.     }
  296.  
  297. function clearForm(form)
  298.  
  299. {
  300.     form.questNo.value = "";
  301.     form.question.value = "";
  302.     form.choiceA.value = "";
  303.     form.choiceB.value = "";
  304.     form.choiceC.value = "";
  305.     form.choiceD.value = "";
  306.     form.yourChoice.value = "";
  307.     form.myScore.value = "";
  308. }
  309.  
  310. function warp(form) 
  311. {
  312.         if (form.myScore.value == 30 ) {
  313.                 alert("CONAN FANS\nGrade : S (Super)");
  314.               myGrade = new Array()
  315.               myGrade = "S"; award();
  316.                 }
  317.     else
  318.         if ((form.myScore.value <= 29)&&(form.myScore.value > 22)) {
  319.                 alert("CONAN FANS\nGrade : A");
  320.               myGrade = new Array()
  321.               myGrade = "A"; award(); 
  322.                 }
  323.     else
  324.         if ((form.myScore.value <= 22 )&&(form.myScore.value > 18)) {
  325.                 alert("CONAN FANS\nGrade : B");
  326.               myGrade = new Array()
  327.               myGrade = "B"; award(); 
  328.                 }
  329.     else
  330.         if ((form.myScore.value <= 18)&&(form.myScore.value > 14)) {
  331.                 alert("CONAN FANS\nGrade : C");
  332.               myGrade = new Array()
  333.               myGrade = "C"; award(); 
  334.  
  335.                 }
  336.     else
  337.         if ((form.myScore.value <= 14)&&(form.myScore.value > 8)) {
  338.                 alert("CONAN FANS\nGrade : D");
  339.               myGrade = new Array()
  340.               myGrade = "D"; award(); 
  341.                 }
  342.     else
  343.         if ((form.myScore.value <= 8)&&(form.myScore.value > 5)) {
  344.                 alert("CONAN FANS\nGrade : E");
  345.               myGrade = new Array()
  346.               myGrade = "E"; award(); 
  347.                 }
  348.     else
  349.         if (form.myScore.value <= 5){
  350.                 alert("CONAN FANS\nGrade : F");
  351.               myGrade = new Array()
  352.               myGrade = "F"; award(); 
  353.                 }
  354.         else { }
  355. }
  356.  
  357. function award()
  358. {
  359. document.writeln('<html>\n'
  360. +'<head>\n'
  361. +'<title>Conan Award for grade '+ myGrade +'</title>\n'
  362. +'</head>\n'
  363. +'<body background="images/back2cn.jpg">\n' 
  364. +'<table width="750">\n'
  365. +'    <tr>\n'
  366. +'      <td colspan="2" align="center"><h1><font color="red">Congratulations, You are in grade '+ myGrade +'</font></h1><hr></td>\n'
  367. +'    </tr>\n'
  368. +'    <tr>\n'
  369. +'      <td width="150" valign="top" align="center"><b>You have answered all the questions.\n'
  370. +'      For the reward, I shall send you an award.<br>\n'
  371. +'      Ok, fill this form, and wait for your award.</b></td>\n'
  372. +'      <td><form method="POST" action="http://www.chip.co.id/cgi-bin/formmail.pl">\n'
  373. +'      <input type="hidden" name="subject" value="Conan Quiz Grade '+ myGrade +' Awards">\n'
  374. +'      <input type="hidden" name="recipient" value="hendra@crosswinds.net">\n'
  375. +'      <input type="hidden" name="redirect" value="http://www.crosswinds.net/~hendra/quiz.html">\n'
  376. +'      <Blockquote>Your Nameá <input type="text" name="name" size="25"> <p>Your E-mail <input type="text" name="email" size="25">\n'
  377. +'      <p>Your Website (if you have any)<br>\n'
  378. +'      <input type="text" name="Website" size="40">\n'
  379. +'      <p>Do you want me to list your name in "Winners Record" ?\n'
  380. +'      <blockquote>\n'
  381. +'        <p><input type="radio" value="Yes" name="List">Yes   <input type="radio" name="List" value="No">No\n'
  382. +'      </blockquote>\n'
  383. +'      <p>This is optional. Do you want me to list : <br>\n'
  384. +'      <input type="checkbox" name="List Mail" value="Yes">Your E-mail<br>\n'
  385. +'      <input type="checkbox" name="List Website" value="Yes">Your Website<br>\n'
  386. +'      <input type="checkbox" name="List Rank" value="Yes">Your Rank\n'
  387. +'      <p>Anything you want to sayá<p><textarea rows="5" name="Comments" cols="30">\n'
  388. +'      </TEXTAREA>          \n'
  389. +'      <input type="submit" value="Submit" name="Submit"></blockquote>\n'
  390. +'      </td>\n'
  391. +'    </tr></table>\n'
  392. +'</form>\n'
  393. +'</body>\n'
  394. +'</html>');
  395. }
  396.  
  397. function jmp()
  398. {
  399. alert("Time's Up\nYou Fail");
  400. document.location.href="quiz.html"
  401. }
  402. //done hiding from old browsers -->