eKiwi

Füge das folgende Script in den body-Bereich deiner HTML-Seite ein:

<script>
<!-- Javascript Quiz Machine by Gordon Lee 27 Apr 97
function makeArray() {

this.length = makeArray.arguments.length;

for (var i = 0 ; i < this.length ; i++)

this[i+1] = makeArray.arguments[i];

}



function dispscore(f) {

f.display.value += f.right.value + " right answer";

if ( f.right.value != 1 )

f.display.value += "s";

f.display.value += " and " + f.wrong.value + " wrong answer";

if ( f.wrong.value != 1 )

f.display.value += "s";

f.display.value += "."

}





function quiz(f) {



var ans = f.answer.value.toLowerCase();

if ( ans.length == 1 )

{

// OBJECTIVE MARKING

var optno = 0;

while ( f.option[optno].checked == 0 && optno < 4 )

optno++;

if ( f.option[optno].value == 0 )

alert("You didn't answer the question! (Click the little button on the left of your choice of answer.)");

else

{

if ( f.queno.value == 0 )

{

// SET MODE

f.mode.value = f.option[optno].value;

f.queno.value++;

// f.OKbutt.value = "OK, I accept this answer";

f.display.value = "OK, here we go... Good luck!"

}

else if ( f.option[optno].value == ans )

{

f.right.value++;

f.display.value = "Yup!!! " + f.expl.value + "\r\nYou now have ";

dispscore(f);

f.queno.value++;

f.tryno.value = 1

}

else if ( f.mode.value == 1 || f.tryno.value == 2 )

{

f.wrong.value++;

f.display.value = "Errr... The correct answer is '"

if ( ans == 1 )

f.display.value += f.option1.value;

if ( ans == 2 )

f.display.value += f.option2.value;

if ( ans == 3 )

f.display.value += f.option3.value;

f.display.value += "'.\r\n(" + f.expl.value + ")\r\nYou have ";

dispscore(f);

f.queno.value++;

f.tryno.value = 1

}

else if ( f.mode.value == 2 )

{

f.display.value = "Nope! Try again.";

f.tryno.value++

}

else

{

f.display.value = "Not quite. Here's a clue:\r\n" + f.clue.value;

f.tryno.value++

}

}

}

else

{

// SUBJECTIVE MARKING

var input = "|"+f.option2.value.toLowerCase()+"|";

if ( input.length < 3 )

alert("You haven't answered! (Type your answer in the middle (empty) box, then click [OK].)");

else

{

if ( ans.indexOf(input) != -1 )

{

f.right.value++;

f.display.value = "Good!!! " + f.expl.value + "\r\nYour score is now ";

dispscore(f);

f.queno.value++;

f.tryno.value = 1

}

else if ( f.mode.value == 1 || f.tryno.value == 2 )

{

f.wrong.value++;

f.display.value = "Sorry... My suggested answer is (or answers are) \r\n"

+ ans.substring(1,ans.length-1)

+ ".\r\n(" + f.expl.value + ")\r\nYour score is ";

dispscore(f);

f.queno.value++;

f.tryno.value = 1

}

else if ( f.mode.value == 2 )

{

f.display.value = "Oh no! Give it another try...";

f.tryno.value++

}

else

{

f.display.value = "Not close enough... Here's a clue:\r\n" + f.clue.value;

f.tryno.value++

}

}

}



// FORMAT FOR SUBJ QUESTIONS: "|question|clue|explanation|(list of

// acceptable answers separated with |)",

// FORMAT FOR OBJ QUESTIONS: "question|clue|explanation|answer|option1|option2|option3",



var R = new makeArray(



"What is the gunslingers full name?|His first name is Roland!|No help, sorry!|2|Roland the Gunslinger|Roland Deschain|Roland Light",

"Who is Charlie McGee?|She plays with Fire|No help, sorry!|3|The killer in IT|The woman in ROSE MADDER|The FIRESTARTER",

"Name two books that discuss The Crimsion King?|They both are newer books|No help, Sorry!|3|The STAND and INSOMNIA|The STAND and DARK TOWER IV|DT4 and INSOMNIA",

"Name three books that have the name Flagg.|Evil FLAGG!|No help, Sorry!|1|STAND, DT4 and EYES OF THE DRAGON.|DT4, ROSE MADDER, and CUJO.|INSOMNIA, NIGHTMARES AND DREAMSCAPES, and FIRESTARTER",

"What was name of the FIRESTARTER's mother?|Can't help here|No help, Sorry!|2|Charlie|Vickey|Cindy",

"What creature ate up our past?|Can't help here|No help, Sorry!|1|The Langoliers|The good man|Stephen King",

"In Gerald's Game, what was Gerald's wife's name?|Can't help here|No help, Sorry!|3|Lois|Rachel|Jessie",

"What was Gerald's Game?|Can't help here|No help, Sorry!|3|Riddles|Chess|Sex",

"Who did Ralph Robert's wed?|Can't help here|No help, Sorry!|2|Jessie|Lois Chase|Petra Jesserling",

"In DT4, what was the color of the Wizards Rainbow?|Can't help here|No help, Sorry!|3|Green|Red|Pink",

"What Bettle's song was in the DT series that was played on the piano?|Can't help here|No help, Sorry!|2|We all live in a yellow submarine|Hey Jude|Lucy in the Sky w/Diamonds (LSD)",

"What band is mentioned in The Raft, in the Skeleton Crew? Hint: They did music for one of his movies.|Can't help here|No help, Sorry!|1|AC/DC|TOOL|GREAT WHITE",

"Who was the lead singer of that band?|Can't help here|No help, Sorry!|3|Jack Russel|Danny Carrey|Bon Scott",

"What was the name of the X-Files episode that SK wrote?|Can't help here|No help, Sorry!|1|Chinga|Gazpahco|Taco",

"Name 2 books had the man named Collie Entragain.|Can't help here|No help, Sorry!|1|Desperation & The Regulators|The Stand & Cujo|The Green Mile & Carrie",

"What were the vans in the Regulators called?|Can't help here|No help, Sorry!|2|Chevy's|Dream Floaters|Mobile DEATH",

"Including DT4, how many books has SK published that are in the front of the books?|Can't help here|No help, Sorry!|2|30|34|38",

"Screen plays?|Can't help here|No help, Sorry!|1|10|15|20",

"As Bachman?|Can't help here|No help, Sorry!|3|25|15|6",

"Total?|Can't help here|No help, Sorry!|3|100|54|50",

"Who was the bad death? Hint: Greenmile:|Can't help here|No help, Sorry!|2|Jhon Coffey|Eduard Delocroix|Paul Edgecomb",

"How many Green mile books were there?|Can't help here|No help, Sorry!|2|5|6|4",

"What was the dogs name in CUJO?|Can't help here|No help, Sorry!|1|Cujo|Ruffles|Kojak",

"Jhonny Smith in the Dead Zone could see what?|Can't help here|No help, Sorry!|1|The Future|Death|Nothing",

"What was the witches name in DT4? Note there is only on specific answer.|Can't help here|No help, Sorry!|3|Rhea|Ursala|Rhea of Coos",

"In DT4 who killed Jonas?|Can't help here|No help, Sorry!|2|Roland the Gunslinger|Roland the Gunslinger as a boy|Roland before he was a Gunslinger",

"What happened to Susan in DT4?|Can't help here|No help, Sorry!|3|Burned at the stake|Burned in the oil tank explosions|Burned on reaping day bonfire",

"Who did the music for Maximum Overdrive?|Can't help here|No help, Sorry!|1|AC/DC|Metallica|Alice In Chains",

"What color were the Tommyknockers joined with?|Can't help here|No help, Sorry!|2|Red|Green|Blue",

"What was the name of the killer cop in Rose Madder?|Can't help here|No help, Sorry!|2|Stephen King|Norman Daniels|Cuthbert Allgood",

"What two books had the name Gage Kreed?|Can't help here|No help, Sorry!|1|PET Cemetary & INSOMNIA|The STAND & Four Past Midnight|The SHINNING & MISERY",

"Who played the Running man in the movie?|Can't help here|No help, Sorry!|1|Arnold S.|Tom Hanks.|Daffy Duck",

"How many children does King have?|Can't help here|No help, Sorry!|2|2|3|4",

"What was King's first published book?|Can't help here|No help, Sorry!|2|'Salems lot|Carrie|IT",

"What color paper did king write the Dark Tower on?|Can't help here|No help, Sorry!|1|Green|Red|Purple",

"Who is the star of Needful Things? Hint: He appered in Creepshow.|Can't help here|No help, Sorry!|3|Arnold S.|Jim Carrey|Ed Harris",

"What book had Pennywise?|Can't help here|No help, Sorry!|3|EYES of the DRAGON|MISERY|IT",

"Which book was 'the last castle rock' story?|Can't help here|No help, Sorry!|1|Needful Things|The LONG WALK|IT",

"How many of King's books contain a womans names for a title?|Can't help here|No help, Sorry!|3|1|2|5",

"How many with a mans?|Can't help here|No help, Sorry!|1|1|2|5",

"Who was the crazy person in The Shinning?|Can't help here|No help, Sorry!|1|Jack|Ed|Jake",

"What was the evil in 'Salem's Lot?|Can't help here|No help, Sorry!|2|Cujo|Vampires|Aliens",

"In Rose Madder who does Rosie wed in the end?|Can't help here|No help, Sorry!|2|Jake Chambers|Bill|Brian Rusk",

"In Misery, It discusses another on of King's books w/o saying the name, what was the book it talked about?|Can't help here|No help, Sorry!|3|The Stand|Insomnia|The Shining",

"What was the name of the writer in Misery?|Can't help here|No help, Sorry!|3|Stu Redman|Annie Wilkes|Paul Sheldon",

"In the Dark half?|Can't help here|No help, Sorry!|1|Thad Beaumont|Paul Sheldon|Paul Edgecomb",

"In the Greenmile?|Can't help here|No help, Sorry!|1|Paul Edgecomb|Paul Sheldon|Thad Beaumont",

"Who directed creepshow?|Can't help here|No help, Sorry!|1|George Romero|James Cameron|Ian Fleming",

"In the DT series, What was Roland's Mother's name?|Can't help here|No help, Sorry!|3|Deena|Samantha|Gabrielle",

"What was the 'evil' in Christine?|Can't help here|No help, Sorry!|3|A boy|A man|A car",

"What kind?|Can't help here|No help, Sorry!|1|1958 Plymoth Fury|1994 LT4 Vette|1992 Dodge Caravan",

"What book delt with the plauge?|Can't help here|No help, Sorry!|1|The Stand|DT4|Carrie",

"Who directed Maximum Overdrive?|Can't help here|No help, Sorry!|2|George Romero|Stephen King|James Cammeron",

"How many books are in Night Shift?|Can't help here|No help, Sorry!|1|20|25|30",

"What book did Peter Straub help on?|Can't help here|No help, Sorry!|3|Cycle of the Werewolf|Misery|The Tailsman",

"What book was about a werewolf?|Can't help here|No help, Sorry!|1|Cycle of the Werewolf|Misery|The Tailsman",

"In Night Shift, Quitters inc. was turned into part of what movie? Hint: It's one of my fav. King movies|Can't help here|No help, Sorry!|2|Silver Bullet|Cat's eye|Needful Things",

"How many stories were in Different Seasons?|Can't help here|No help, Sorry!|3|2|3|4",

"To this date, what is SK's only non-fiction book?|Can't help here|No help, Sorry!|2|The Stand|Danse Macrabe|Carrie",

"In Which book did king say, 'In the Stand I had the chance to scrub the whole human race, and it was fun'?|Can't help here|No help, Sorry!|2|The Stand|Danse Macrabe|Carrie",

"How many fingers did the Gunslinger loose?|Can't help here|No help, Sorry!|1|2|3|4",

"On which hand?|Can't help here|No help, Sorry!|1|Right|Left|Not sure",

"What was Rolands second most agonizing choice?|Can't help here|No help, Sorry!|3|Killing his mother|Taking Eddie in to his world|Letting Jake die",

"Who was Roland's symbolic son?|Can't help here|No help, Sorry!|2|Eddie|Jake|Oy",

"How many doors were there in DT2?|Can't help here|No help, Sorry!|3|1|2|3",

"Who was the Prisoner?|Can't help here|No help, Sorry!|1|Eddie Dean|Jack Mort|Oddeta Holmes",

"Who was the Prisoner?|Can't help here|No help, Sorry!|1|Eddie Dean|Jack Mort|Oddeta Holmes",

"What was the prisoner transporting on the plane?|Can't help here|No help, Sorry!|2|Kidneys|Cocaine|The Pokerizer",

"Who was the Lady of the Shadows?|Can't help here|No help, Sorry!|2|Susan|Oddeta|Gabriele",

"Who was the Death?|Can't help here|No help, Sorry!|1|Jack Mort|Eddie Dean|Jake Chambers",

"Who had a brick dropped on their head?|Can't help here|No help, Sorry!|3|Jack Mort|Eddie Dean|Oddeta Holmes",

"What poem was the DT seris taken from?|Can't help here|No help, Sorry!|2|The Storm|Childe Roland to the Dark Tower came|The Dark Tower",

"What DT book had a wooden key made in it?|Can't help here|No help, Sorry!|3|Dark Tower 1|Dark Tower 2|Dark Tower 3",

"What book took place on Little Tall Island?|Can't help here|No help, Sorry!|3|Rose Madder|Insomnia|Dolaris Claiborne",

"What book asks how do you kill something that was never born?|Can't help here|No help, Sorry!|2|Rose Madder|The Dark Half|The Stand",

"What book is a different kind of bed time story?|Can't help here|No help, Sorry!|2|Insomnia|Geralds game|Four past Midnight",

"Four times fear equals total terror, Which book is this?|Can't help here|No help, Sorry!|1|Four Past Midnight|Insomnia|Different Seasons",

"This was taken from what movie? This is the way the world ends. This is the way the world ends. This is the way the world ends. Not with a bang but a whimper.|Can't help here|No help, Sorry!|2|The Langoliers|The Stand|Maximum Overdrive",

"The hard back version of Insomnia, It was in two colors, what ones?|Can't help here|No help, Sorry!|2|White & Black|Red & White|Purple and Gold",

"What was the name of the mouse in the Greenmile|Can't help here|No help, Sorry!|1|Mr. Jingles|Speedy Gonzales|Spot",

"In what book was a young boy ran over by a truck?|Can't help here|No help, Sorry!|3|Insomnia|Thinner|Pet Cemetary",

"What was the name of the city in the Running man|Can't help here|No help, Sorry!|3|Little Tall Island|San Diego|Co-Op City",

"What was the name of the man that got thinner|Can't help here|No help, Sorry!|1|Billy Halleck|Dan Scott|Trevor Dawson",

"Who was telling the story in the Shawshank redempion?|Can't help here|No help, Sorry!|1|Red|Blue|Black",

"Was Andy guilty or innocent?|Can't help here|No help, Sorry!|2|Guilty|Innocent|This is a wrong answer if you click",

"Was Red guilty or innocent?|Can't help here|No help, Sorry!|1|No, he was guilty|Yes, he didn't do it|This is a wrong answer if you click",

"True or false. People who were 'Pushed' could ricochet?|Can't help here|No help, Sorry!|1|No, he was guilty|Yes, he didn't do it|This is a wrong answer if you click",

"What was Stu Redman's middle name?|Can't help here|No help, Sorry!|3|Dick|Edwin|Richard",

"Where was the Plague center where Stu was held?|Can't help here|No help, Sorry!|2|San Diego, Ca|Stovington, Vr|Derry, Maine",

"What happened to William Halleck?|Can't help here|No help, Sorry!|2|Got cancer|Got thinner|Exploded",

"END");



if ( f.queno.value >= R.length )


{

f.display.value += "\r\nThat's it; you've reached the end of this fun quiz!";

f.display.value += "\r\nThanks for trying out this program."

f.display.value += "\r\nDo e-mail me with your comments!"

f.question.value = "Click the [OK] button to do the quiz again, with...";

f.option1.value = "1 try";

f.option2.value = "2 tries (no clues)";

// f.OKbutt.value = "Let's play again!"

f.right.value = 0;

f.wrong.value = 0;

f.queno.value = 0;

f.answer.value = 0;

}

else

{

var rec = R[f.queno.value];

var n = rec.indexOf("|");

if ( n == 0 )

{

// DISP SUBJ Q

rec = rec.substring(n+1,rec.length);

n = rec.indexOf("|");

f.question.value = "Question " + f.queno.value + ", Try "

+ f.tryno.value + ":\r\n" + rec.substring(0,n);

rec = rec.substring(n+1,rec.length);

n = rec.indexOf("|");

f.clue.value = rec.substring(0,n);

rec = rec.substring(n+1,rec.length);

n = rec.indexOf("|");

f.expl.value = rec.substring(0,n);

f.answer.value = rec.substring(n,rec.length) + "|";




}

else

{

// DISP OBJ Q

f.question.value = "Question " + f.queno.value + ", Try "

+ f.tryno.value + ":\r\n" + rec.substring(0,n);

rec = rec.substring(n+1,rec.length);

n = rec.indexOf("|");

f.clue.value = rec.substring(0,n);

rec = rec.substring(n+1,rec.length);

n = rec.indexOf("|");

f.expl.value = rec.substring(0,n);

rec = rec.substring(n+1,rec.length);

n = rec.indexOf("|");

f.answer.value = rec.substring(0,n);

rec = rec.substring(n+1,rec.length);

n = rec.indexOf("|");

f.option1.value = rec.substring(0,n);

rec = rec.substring(n+1,rec.length);

n = rec.indexOf("|");

f.option2.value = rec.substring(0,n);

f.option3.value = rec.substring(n+1,rec.length);



f.option[0].checked = true;

}

}



}

// -->

</script>

 

Füge den folgenden Quelltext ein um das Formular zu erzeugen:


<form METHOD="post" ACTION="Javascript:'Go back and click on the Button'">
<input type="hidden" name="queno" value="0"><input type="hidden" name="tryno" value="1"><input
type="hidden" name="answer" value="0"><input type="hidden" name="clue" value><input
type="hidden" name="expl" value><input type="hidden" name="right" value="0"><input
type="hidden" name="wrong" value="0"><input type="hidden" name="mode" value="3"><div
align="center">
</center></div><p><textarea NAME="display" ROWS="2.5" COLS="50">
W e l c o m e t o SK T r i v i a Q u i z !
This quiz is about the King, Stephen King...
</textarea> <textarea NAME="question" ROWS="2.5" COLS="50">
How many tries would you like to have for each question?
</textarea> <br>
</p>
<table>
<tr>
<td><input TYPE="radio" NAME="option" VALUE="1"></td>
<td><input TYPE="text" NAME="option1" SIZE="60" VALUE="1 try"></td>
</tr>
<tr>
<td><input TYPE="radio" NAME="option" VALUE="2"></td>
<td><input TYPE="text" NAME="option2" SIZE="60" VALUE="2 tries (no clues)"></td>
</tr>
<tr>
<td><input TYPE="radio" NAME="option" VALUE="3" CHECKED></td>
<td><input TYPE="text" NAME="option3" SIZE="60"
VALUE="Don't click, Click one of the above!"></td>
</tr>
</table>
<p><br>
<input TYPE="button" NAME="OKbutt" VALUE="Click me when done!" onClick="quiz(this.form)"> </p>
<p><!--

<P>A calculator, just in case:

<INPUT TYPE="text" NAME="calc" SIZE=20 onChange="this.form.calc.value = eval(this.form.calc.value)">

<INPUT TYPE="button" VALUE="CALCULATE" onClick="this.form.calc.value = eval(this.form.calc.value)">

--> </p>
<hr size="4" width="75%" align="center">
<div align="center"><center><h1>Grading</h1>
</center></div><b><p>0-18correct---------------F---You don't know King! You wannabe
imposter!!!</p>
<p>19-36 correct------------------D---Start reading more!</p>
<p>37-54 correct------------------C---You need to read a little more!</p>
<p>55-72 correct------------------B---Your good!</p>
<p>73-90correct-------------------A---You sure your not King???</p>
</form>
<FORM><INPUT TYPE='button' VALUE='Schließe Fenster' onClick='window.close()'></FORM>

 

Hinweis: Wenn du dir hier die Quelltexte kopierst, dann füge sie am besten mit einen Texteditor in dein HTML-Dokument ein, da die meisten Webeditoren es als normalen Text interpretieren.
 



Copyright Dunkel & Iwer GbR - Alle Rechte vorbehalten