Ceci est une ancienne révision du document !
HAN Geng <HTML>
<HEAD>
<TITLE>
Quiz </TITLE> <SCRIPT languag=“JavaScript”> <!–
// Copyright Cyril Roiron // All rights reserved
var ttok=“”;
// les tablos necessaires var question = new Array();
var a=0; var b=0; var x=0; var m=0;
question[m] = “Quel est le genre du film?” m++; question[m] = “Quel est le sujet trait�? ” // les tablos necessaires var f_b = new Array(); var correct = new Array(); var rep = new Array();
// cr�e la fen�tre principale avec son contenu function creefenetre(contenu, width, height) { var cc = contenu; contenu = “<html><head><title>Correction</title></head><body bgcolor='#ffffff'><h2 align=center>Résultats</h2>” + cc; contenu += “<p><form><input type='button' onclick='window.close()' value=' Fermer '></form>”;contenu += “</body></html>”;var win_opt= “toolbar=0,location=0,directories=0,status=0,menubar=0,”;win_opt += “scrollbars=1,resizable=1,copyhistory=0,”;win_opt += “width=” + width + “,height=” + height;nouvo=window.open(“”, “lcode”,win_opt);nouvo.document.open(); nouvo.document.writeln(contenu);nouvo.document.close(); }
function verifier(yo) { var resultat=“”; var erreur=0;
for (var n=0; n < (question.length); n++) { if (!rep[n]) { ttok=ttok+“Vous n'avez pas repondu � la question ”+(n+1)+“: \n”; ttok=ttok+“'”+question[n]+“'\n”; }
else { if(correct[n] == 1) { rep[n]=“<font color='#00be00'>”+rep[n]+“</font>”; //0B6912 20B200 } else { rep[n]=“<font color='#ff0000'>”+rep[n]+“</font>”; erreur++; } resultat+=“<hr><dl><dt>A la question: <b>”+question[n]+“</b><dd>Vous avez répondu: ”+rep[n]+“</dl>”+f_b[n]; } }
if (ttok != “”) { alert(ttok); } else {
if (erreur==0) { resultat+=“<p><hr><h3 align=center>Vous avez répondu correctement à toutes les questions, félicitation :)</h3>”; } else { if (erreur==1) { resultat+=“<p><hr><h3 align=center>Vous avez fait une erreur</h3>”; } else { resultat+=“<p><hr><h3 align=center>Vous avez fait ”+erreur+“ erreurs</h3>”; } }
for (var i=0; i<yo.elements.length; i++) { yo.elements[i].checked = 0; }
creefenetre(resultat, 600, 600);
} }
// –> </SCRIPT>
</HEAD>
<BODY bgcolor=“white”>
<H2 align=center> Quiz </H2>
<form name=“questionnaire”> <hr>
<script language=“JavaScript”> <!– document.write(question[0].bold()); //–> </script> <br> <input type=“radio” name=“r0” value=“un film d'animation” OnClick=“f_b[0]='d�sol�, ce n\'est pas la bonne r�ponse'; correct[0]=0; rep[0]=this.value”> <script language=“JavaScript”> <!– x=0; document.write(document.questionnaire.r0.value); //–> </script>
<br> <input type=“radio” name=“r0” value=“un film d'horreur” OnClick=“f_b[0]='d�sol�, ce n\'est pas la bonne r�ponse'; correct[0]=0; rep[0]=this.value”>
<script language=“JavaScript”> <!– x++; document.write(document.questionnaire.r0[x].value); //–> </script>
<br> <input type=“radio” name=“r0” value=“un film policier” OnClick=“f_b[0]='Bravo!'; correct[0]=1; rep[0]=this.value”> <script language=“JavaScript”> <!– x++; document.write(document.questionnaire.r0[x].value); //–> </script>
<hr>
<script language=“JavaScript”> <!– document.write(question[1].bold()); //–> </script> <br> <input type=“radio” name=“r1” value=“C'est l'histoire d'une femme qui est kidnapp�e par la mafia ” OnClick=“f_b[1]='D�sol�, ce n\'est pas la bonne r�ponse'; correct[1]=0; rep[1]=this.value”> <script language=“JavaScript”> <!– x=0; document.write(document.questionnaire.r1.value); //–> </script>
<br>
<input type=“radio” name=“r1” value=“Ce film raconte le quotidien de policiers qui travaillent pour la protection des mineurs” OnClick=“f_b[1]='Bravo !'; correct[1]=1; rep[1]=this.value”> <script language=“JavaScript”> <!– x++; document.write(document.questionnaire.r1[x].value); //–> </script>
<br> <input type=“radio” name=“r1” value=“Ce film traite des difficult�s financi�res des �trangers � Marseille” OnClick=“f_b[1]='D�sol�, ce n\'est pas la bonne r�ponse'; correct[1]=0; rep[1]=this.value”> <script language=“JavaScript”> <!– x++; document.write(document.questionnaire.r1[x].value); //–> </script>
<hr>
<p align=center> <input type=button value=“Afficher les r�sultats” OnClick=“ttok=''; verifier(this.form);”>
</form>
</BODY> </HTML>
<!DOCTYPE HTML PUBLIC “-W3CDTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”> <html><head> <title>Les mots croisés de Versailles</title> <meta name=“generator” content=“EclipseCrossword” /> <style type=“text/css”><!–
body, h1, h2, h3, h4, h5, h6 {
font-family: Segoe UI, Franklin Gothic Medium, Arial, sans-serif;
}
h1, h2, h3, h4, h5, h6 {
color: #5d6a86;
}
body {
cursor: default; font-size: small;
}
.ecw-answerbox {
color: black; background-color: #FFFAF0; border-color: #808080; border-style: solid; border-width: 1px; display: block; padding: .75em; width: 240pt;
}
.ecw-box {
border-style: solid; border-width: 1pt; cursor: pointer; font-size: .12in; font-weight: bold; height: .18in; overflow: hidden; text-align: center; width: .18in;
}
.ecw-boxcheated_sel {
background-color: #FFF1D7; border-color: #C00000; color: #2080D0;
}
.ecw-boxcheated_unsel {
background-color: #ffffff; border-color: #606060; color: #2080D0;
}
.ecw-boxerror_sel {
background-color: #FFF1D7; border-color: #C00000; color: #BF0000;
}
.ecw-boxerror_unsel {
background-color: #FFF0F0; border-color: #606060; color: #BF0000;
}
.ecw-boxnormal_sel {
background-color: #FFF1D7; border-color: #C00000; color: #000000;
}
.ecw-boxnormal_unsel {
background-color: #ffffff; border-color: #606060; color: #000000;
}
.ecw-button {
width: 64pt;
}
.ecw-cluebox {
border-bottom-width: 1px; border-color: #c0c0c0; border-left-width: 0px; border-right-width: 0px; border-style: solid; border-top-width: 1px; margin-top: 1em; padding-bottom: .5em; padding-left: 0pt; padding-right: 0pt; padding-top: .5em;
}
.ecw-crosswordarea {
background-color: #D0D8E0; border-color: #808080; border-style: solid; border-width: 2px; padding: .5em; font-family: Segoe UI, Verdana, Arial, sans-serif; font-size: small;
}
.ecw-copyright {
margin-bottom: 1em; font-size: x-small; font-family: Segoe UI, Franklin Gothic Medium, Arial, sans-serif;
}
.ecw-input {
font-family: Segoe UI, Franklin Gothic Medium, Arial, sans-serif;
}
.ecw-wordlabel {
text-transform: uppercase; margin: 0;
}
.ecw-wordinfo {
font-size: 8pt; color: #808080;
}
.ecw-worderror {
color: #c00000; font-weight: bold; display: none; margin-top: 1em;
}
–></style>
</head><body>
<h1>Les mots croisés de Versailles</h1> <h3 style=“margin-top: -1em;”>Vanessa-o</h3>
This interactive crossword puzzle requires JavaScript and a reasonably recent web browser, such as Internet Explorer 5.5 or later, Netscape 7, Mozilla, Firefox, or Safari. If you have disabled web page scripting, please re-enable it and refresh the page. If this web page is saved to your computer, you may need to click the yellow Information Bar at the top of the page to allow the puzzle to load.
<table cellpadding=“0” cellspacing=“0” border=“0”><tr>
<td class=“ecw-crosswordarea”><table id=“crossword” cellpadding=“0” cellspacing=“0” style=“display: none; border-collapse: collapse;”>
<script type=“text/javascript”><!–
CrosswordWidth = 20;
CrosswordHeight = 20;
Words = 15;
WordLength = new Array(9, 7, 15, 7, 10, 6, 10, 6, 7, 15, 15, 9, 13, 7, 7);
Word = new Array("POMPADOUR", "CHATEAU", "MADAMEDELAMOTTE", "DUBARRY", "COURTISANS", "LETTRE", "VERSAILLES", "SOLEIL", "COLLIER", "CARDINALDEROHAN", "MARIEANTOINETTE", "ETIQUETTE", "LAUTRICHIENNE", "MIROIRS", "LOUISXV");
Clue = new Array("Maîtresse de Louis XV détestée du peuple",
“Il a été construit par Le Vau et Mansart”, “La voleuse du château”, “Comtesse qui a été la maîtresse de Louis XV”, “Ils vivent à la cour de Versailles”, “Vous en avez reçu une du Roi”, “Lieu de tous les mystères”, “Le surnom du roi Louis XIV”, “Il était composé de 540 diamants”, “On l'a soupçonné lors de l'affaire du collier”, “Une célèbre reine, connue pour ses dépenses”, “Le code à respecter à la Cour de Versailles”, “Un des surnoms de Marie Antoinette”, “La galerie des Glaces en compte 357”, “L'arrière petit fils de Louis XIV”);
AnswerHash = new Array(53347, 48552, 38945, 50811, 98117, 91861, 96940, 63728, 66922, 28738, 81047, 21209, 30213, 94572, 38039); WordX = new Array(10, 2, 2, 6, 10, 0, 9, 7, 16, 4, 2, 7, 10, 19, 0); WordY = new Array(1, 3, 5, 9, 11, 12, 14, 17, 0, 2, 5, 5, 5, 5, 12); LastHorizontalWord = 7; OnlyCheckOnce = false;
//–> </script>
<script type=“text/javascript”><!–
// EclipseCrossword (C) Copyright 2000-2007 Green Eclipse. // www.eclipsecrossword.com
var BadChars = “`~!@^*()_={[}]\|:;\”',<.>/?“;
var TableAcrossWord, TableDownWord; var CurrentWord, PrevWordHorizontal, x, y, i, j; var CrosswordFinished, Initialized;
// Check the user's browser and then initialize the puzzle. if (document.getElementById(“waitmessage”) != null) {
document.getElementById("waitmessage").innerHTML = "Please wait while the crossword is loaded...";
// Current game variables
CurrentWord = -1;
PrevWordHorizontal = false;
// Create the cell-to-word arrays.
TableAcrossWord = new Array(CrosswordWidth);
for (var x = 0; x < CrosswordWidth; x++) TableAcrossWord[x] = new Array(CrosswordHeight);
TableDownWord = new Array(CrosswordWidth);
for (var x = 0; x < CrosswordWidth; x++) TableDownWord[x] = new Array(CrosswordHeight);
for (var y = 0; y < CrosswordHeight; y++)
for (var x = 0; x < CrosswordWidth; x++)
{
TableAcrossWord[x][y] = -1;
TableDownWord[x][y] = -1;
}
// First, add the horizontal words to the puzzle.
for (var i = 0; i <= LastHorizontalWord; i++)
{
x = WordX[i];
y = WordY[i];
for (var j = 0; j < WordLength[i]; j++)
{
TableAcrossWord[x + j][y] = i;
}
}
// Second, add the vertical words to the puzzle.
for (var i = LastHorizontalWord + 1; i < Words; i++)
{
x = WordX[i];
y = WordY[i];
for (var j = 0; j < WordLength[i]; j++)
{
TableDownWord[x][y + j] = i;
}
}
// Now, insert the row HTML into the table.
for (var y = 0; y < CrosswordHeight; y++)
{
document.writeln("<tr>");
for (var x = 0; x < CrosswordWidth; x++)
{
if (TableAcrossWord[x][y] >= 0 || TableDownWord[x][y] >= 0)
document.write("<td id=\"c" + PadNumber(x) + PadNumber(y) + "\" class=\"ecw-box ecw-boxnormal_unsel\" onclick=\"SelectThisWord(event);\"> </td>");
else
document.write("<td></td>");
}
document.writeln("</tr>");
}
// Finally, show the crossword and hide the wait message.
Initialized = true;
document.getElementById("waitmessage").style.display = "none";
document.getElementById("crossword").style.display = "block";
}
// ———- // Event handlers
// Raised when a key is pressed in the word entry box. function WordEntryKeyPress(event) {
if (CrosswordFinished) return; // Treat an Enter keypress as an OK click. if (CurrentWord >= 0 && event.keyCode == 13) OKClick();
}
// ———- // Helper functions
// Called when we're ready to start the crossword. function BeginCrossword() {
if (Initialized)
{
document.getElementById("welcomemessage").style.display = "";
document.getElementById("checkbutton").style.display = "";
}
}
// Returns true if the string passed in contains any characters prone to evil. function ContainsBadChars(theirWord) {
for (var i = 0; i < theirWord.length; i++) if (BadChars.indexOf(theirWord.charAt(i)) >= 0) return true; return false;
}
// Pads a number out to three characters. function PadNumber(number) {
if (number < 10) return "00" + number; else if (number < 100) return "0" + number; else return "" + number;
}
// Returns the table cell at a particular pair of coordinates. function CellAt(x, y) {
return document.getElementById("c" + PadNumber(x) + PadNumber(y));
}
// Deselects the current word, if there's a word selected. DOES not change the value of CurrentWord. function DeselectCurrentWord() {
if (CurrentWord < 0) return;
var x, y, i;
document.getElementById("answerbox").style.display = "none";
ChangeCurrentWordSelectedStyle(false);
CurrentWord = -1;
}
// Changes the style of the cells in the current word. function ChangeWordStyle(WordNumber, NewStyle) {
if (WordNumber< 0) return; var x = WordX[WordNumber]; var y = WordY[WordNumber]; if (WordNumber<= LastHorizontalWord) for (i = 0; i < WordLength[WordNumber]; i++) CellAt(x + i, y).className = NewStyle; else for (i = 0; i < WordLength[WordNumber]; i++) CellAt(x, y + i).className = NewStyle;
}
// Changes the style of the cells in the current word between the selected/unselected form. function ChangeCurrentWordSelectedStyle(IsSelected) {
if (CurrentWord < 0) return; var x = WordX[CurrentWord]; var y = WordY[CurrentWord]; if (CurrentWord <= LastHorizontalWord) for (i = 0; i < WordLength[CurrentWord]; i++) CellAt(x + i, y).className = CellAt(x + i, y).className.replace(IsSelected ? "_unsel" : "_sel", IsSelected ? "_sel" : "_unsel"); else for (i = 0; i < WordLength[CurrentWord]; i++) CellAt(x, y + i).className = CellAt(x, y + i).className.replace(IsSelected ? "_unsel" : "_sel", IsSelected ? "_sel" : "_unsel");
}
// Selects the new word by parsing the name of the TD element referenced by the // event object, and then applying styles as necessary. function SelectThisWord(event) {
if (CrosswordFinished) return;
var x, y, i, TheirWord, TableCell;
// Deselect the previous word if one was selected.
document.getElementById("welcomemessage").style.display = "none";
if (CurrentWord >= 0) OKClick();
DeselectCurrentWord();
// Determine the coordinates of the cell they clicked, and then the word that
// they clicked.
var target = (event.srcElement ? event.srcElement: event.target);
x = parseInt(target.id.substring(1, 4), 10);
y = parseInt(target.id.substring(4, 7), 10);
// If they clicked an intersection, choose the type of word that was NOT selected last time.
if (TableAcrossWord[x][y] >= 0 && TableDownWord[x][y] >= 0)
CurrentWord = PrevWordHorizontal ? TableDownWord[x][y] : TableAcrossWord[x][y];
else if (TableAcrossWord[x][y] >= 0)
CurrentWord = TableAcrossWord[x][y];
else if (TableDownWord[x][y] >= 0)
CurrentWord = TableDownWord[x][y];
PrevWordHorizontal = (CurrentWord <= LastHorizontalWord);
// Now, change the style of the cells in this word.
ChangeCurrentWordSelectedStyle(true);
// Then, prepare the answer box.
x = WordX[CurrentWord];
y = WordY[CurrentWord];
TheirWord = "";
var TheirWordLength = 0;
for (i = 0; i < WordLength[CurrentWord]; i++)
{
// Find the appropriate table cell.
if (CurrentWord <= LastHorizontalWord)
TableCell = CellAt(x + i, y);
else
TableCell = CellAt(x, y + i);
// Add its contents to the word we're building.
if (TableCell.innerHTML != null && TableCell.innerHTML.length > 0 && TableCell.innerHTML != " " && TableCell.innerHTML.toLowerCase() != " ")
{
TheirWord += TableCell.innerHTML.toUpperCase();
TheirWordLength++;
}
else
{
TheirWord += "•";
}
}
document.getElementById("wordlabel").innerHTML = TheirWord;
document.getElementById("wordinfo").innerHTML = ((CurrentWord <= LastHorizontalWord) ? "Across, " : "Down, ") + WordLength[CurrentWord] + " letters.";
document.getElementById("wordclue").innerHTML = Clue[CurrentWord];
document.getElementById("worderror").style.display = "none";
document.getElementById("cheatbutton").style.display = (Word.length == 0) ? "none" : "";
if (TheirWordLength == WordLength[CurrentWord])
document.getElementById("wordentry").value = TheirWord;
else
document.getElementById("wordentry").value = "";
// Finally, show the answer box.
document.getElementById("answerbox").style.display = "block";
try
{
document.getElementById("wordentry").focus();
document.getElementById("wordentry").select();
}
catch (e)
{
}
}
// Called when the user clicks the OK link. function OKClick() {
var TheirWord, x, y, i, TableCell;
if (CrosswordFinished) return;
if (document.getElementById("okbutton").disabled) return;
// First, validate the entry.
TheirWord = document.getElementById("wordentry").value.toUpperCase();
if (TheirWord.length == 0)
{
DeselectCurrentWord();
return;
}
if (ContainsBadChars(TheirWord))
{
document.getElementById("worderror").innerHTML = "The word that you typed contains invalid characters. Please type only letters in the box above.";
document.getElementById("worderror").style.display = "block";
return;
}
if (TheirWord.length < WordLength[CurrentWord])
{
document.getElementById("worderror").innerHTML = "You did not type enough letters. This word has " + WordLength[CurrentWord] + " letters.";
document.getElementById("worderror").style.display = "block";
return;
}
if (TheirWord.length > WordLength[CurrentWord])
{
document.getElementById("worderror").innerHTML = "You typed too many letters. This word has " + WordLength[CurrentWord] + " letters.";
document.getElementById("worderror").style.display = "block";
return;
}
// If we made it this far, they typed an acceptable word, so add these letters to the puzzle and hide the entry box.
x = WordX[CurrentWord];
y = WordY[CurrentWord];
for (i = 0; i < TheirWord.length; i++)
{
TableCell = CellAt(x + (CurrentWord <= LastHorizontalWord ? i : 0), y + (CurrentWord > LastHorizontalWord ? i : 0));
TableCell.innerHTML = TheirWord.substring(i, i + 1);
}
DeselectCurrentWord();
}
// Called when the “check puzzle” link is clicked. function CheckClick() {
var i, j, x, y, UserEntry, ErrorsFound = 0, EmptyFound = 0, TableCell;
if (CrosswordFinished) return;
DeselectCurrentWord();
for (y = 0; y < CrosswordHeight; y++)
for (x = 0; x < CrosswordWidth; x++)
if (TableAcrossWord[x][y] >= 0 || TableDownWord[x][y] >= 0)
{
TableCell = CellAt(x, y);
if (TableCell.className == "ecw-box ecw-boxerror_unsel") TableCell.className = "ecw-box ecw-boxnormal_unsel";
}
for (i = 0; i < Words; i++)
{
// Get the user's entry for this word.
UserEntry = "";
for (j = 0; j < WordLength[i]; j++)
{
if (i <= LastHorizontalWord)
TableCell = CellAt(WordX[i] + j, WordY[i]);
else
TableCell = CellAt(WordX[i], WordY[i] + j);
if (TableCell.innerHTML.length > 0 && TableCell.innerHTML.toLowerCase() != " ")
{
UserEntry += TableCell.innerHTML.toUpperCase();
}
else
{
UserEntry = "";
EmptyFound++;
break;
}
}
// If this word doesn't match, it's an error.
if (HashWord(UserEntry) != AnswerHash[i] && UserEntry.length > 0)
{
ErrorsFound++;
ChangeWordStyle(i, "ecw-box ecw-boxerror_unsel");
}
}
// If they can only check once, disable things prematurely.
if ( OnlyCheckOnce )
{
CrosswordFinished = true;
document.getElementById("checkbutton").style.display = "none";
}
// If errors were found, just exit now.
if (ErrorsFound > 0 && EmptyFound > 0)
document.getElementById("welcomemessage").innerHTML = ErrorsFound + (ErrorsFound > 1 ? " errors" : " error") + " and " + EmptyFound + (EmptyFound > 1 ? " incomplete words were" : " incomplete word was") + " found.";
else if (ErrorsFound > 0)
document.getElementById("welcomemessage").innerHTML = ErrorsFound + (ErrorsFound > 1 ? " errors were" : " error was") + " found.";
else if (EmptyFound > 0)
document.getElementById("welcomemessage").innerHTML = "No errors were found, but " + EmptyFound + (EmptyFound > 1 ? " incomplete words were" : " incomplete word was") + " found.";
if (ErrorsFound + EmptyFound > 0)
{
document.getElementById("welcomemessage").style.display = "";
return;
}
// They finished the puzzle!
CrosswordFinished = true;
document.getElementById("checkbutton").style.display = "none";
document.getElementById("congratulations").style.display = "block";
document.getElementById("welcomemessage").style.display = "none";
}
// Called when the “cheat” link is clicked. function CheatClick() {
if (CrosswordFinished) return;
var OldWord = CurrentWord;
document.getElementById("wordentry").value = Word[CurrentWord];
OKClick();
ChangeWordStyle(OldWord, "ecw-box ecw-boxcheated_unsel");
}
// Returns a one-way hash for a word. function HashWord(Word) {
var x = (Word.charCodeAt(0) * 719) % 1138; var Hash = 837; var i; for (i = 1; i <= Word.length; i++) Hash = (Hash * i + 5 + (Word.charCodeAt(i - 1) - 64) * x) % 98503; return Hash;
}
//–> </script>
</table></td>
<td valign=“top” style=“padding-left: 1em;”>
<a href="http://www.eclipsecrossword.com/" target="_blank" style="font-weight: bold;">EclipseCrossword</a> © 2000-2007
<h3>Welcome!</h3> <p>Click a word in the puzzle to get started.</p>
<h3 id=“wordlabel” class=“ecw-wordlabel”> </h3>
<input class="ecw-input" id="wordentry" type="text" size="24" style="font-weight: bold; text-transform:uppercase;" onkeypress="WordEntryKeyPress(event)" onchange="WordEntryKeyPress(event)" autocomplete="off" />
<table border=“0” cellspacing=“0” cellpadding=“0” width=“100%” style=“margin-top:1em;”><tbody><tr><td> </td><td align=“right”> </td></tr></tbody></table>
<h3>Congratulations!</h3> <p>You have completed this <a href=“http://www.eclipsecrossword.com” style=“color: black; text-decoration:none;”>crossword puzzle</a>. </p> <p>If you would like to be able to create interactive <a href=“http://www.eclipsecrossword.com” style=“color: black; text-decoration:none;”>crosswords</a> like this yourself, get <a href=“http://www.eclipsecrossword.com” target=”_blank“>EclipseCrossword</a> from Green Eclipse—it's free! </p>
</td></tr></table>
<button id="checkbutton" type="button" onclick="CheckClick();" style="display: none;">Check puzzle</button>
<script language=“JavaScript” type=“text/javascript”><!– BeginCrossword(); //–> </script>
<!– Created with EclipseCrossword, (C) Copyright 2000-2007 Green Eclipse. eclipsecrossword.com –>
</body></html>