Le discours indirect
Le discours indirect - Exercices
discours_ind.htm
— 29 KB
Dateiinhalt
<html>
<head><meta name="author" content="Created with Hot Potatoes by Half-Baked Software, registered to Richard Nisius."></meta><meta name="keywords" content="Hot Potatoes, Half-Baked Software, Windows, University of Victoria"></meta>
<title>
Le match
</title>
<!-- Modification Copyright (c) Michael Rottmeier, February 2003 -->
<!-- Translate-it - Version 1.4 -->
<!-- http://www.teaching-tools.de.vu -->
<!-- THIS HEADER MUST STAY UN-TOUCHED -->
<script language="javascript" type="text/javascript">
//<![CDATA[
<!--
// BrowserCheck Object
function BrowserCheck() {
var b = navigator.appName
//HBS extension
this.mac = (navigator.appVersion.indexOf('Mac') != -1)
if (b=="Netscape") this.b = "ns"
else if (b=="Microsoft Internet Explorer") this.b = "ie"
else this.b = b
this.version = navigator.appVersion
this.v = parseInt(this.version)
this.ns = (this.b=="ns" && this.v>=4)
this.ns4 = (this.b=="ns" && this.v==4)
this.ns5 = (this.b=="ns" && this.v==5)
this.ie = (this.b=="ie" && this.v>=4)
this.ie4 = (this.version.indexOf('MSIE 4')>0)
this.ie5 = (this.version.indexOf('MSIE 5')>0)
this.min = (this.ns||this.ie)
this.CRAPBrowser = (this.ie4 && this.mac); //Cannot Resolve Addresses Properly
}
is = new BrowserCheck();
var LocFolder = GetFolder(window.location.href);
function GetFolder(LocPath){
LocPath = ReplaceStuff('\'','%27',LocPath);
var i = LocPath.lastIndexOf('/');
if (i<0){i=LocPath.lastIndexOf('\\')};
return LocPath.substring(0,i);
}
function CombineURLs(InURL){
var i = InURL.indexOf('../');
var s = LocFolder;
while (i >- 1){
s = GetFolder(s);
InURL = InURL.substring(3,InURL.length);
i = InURL.indexOf('../');
}
return s + '/' + InURL;
}
x = new Array();
function ResolveURLs(InText,Attribute){
x.length=0;
var Temp = InText.toLowerCase();
var z;
var AttLen = Attribute.length + 2;
var y=Temp.lastIndexOf(Attribute + '="');
while (y>-1){
var sLoc = y+AttLen;
if (Temp.substring(sLoc,sLoc+5) != 'http:'){
x[x.length]=new Array();
x[x.length-1][0] = sLoc;
z = Temp.indexOf('"',sLoc);
x[x.length-1][1] = z;
x[x.length-1][2] = InText.substring(sLoc,z);
}
Temp = Temp.substring(0,y);
y=Temp.lastIndexOf(Attribute + '="');
}
for (var j=0; j<x.length; j++){
InText = InText.substring(0,x[j][0]) + CombineURLs(x[j][2]) + InText.substring(x[j][1], InText.length);
}
return InText;
}
function ResolveAllURLs(Stuff){
Stuff = ResolveURLs(Stuff,'href');
Stuff = ResolveURLs(Stuff,'src');
Stuff = ResolveURLs(Stuff,'parent.location');
return Stuff;
}
var ExBGColor = '#bbbbee';
var PageBGColor = '#8080c0';
var NavBarColor = '#bbbbee';
var TextColor = '#ff0000';
var CurrQNum = 0;
var YourScoreIs = 'Ton pointage est :'; //'Your score is: ';
var Tries = 0;
var CorrectChoices = 0;
var ContinuousScoring = true; //true;
var CorrectFirstTime = 'Réponses correctes dès la première fois : '; //'Questions answered correctly at first try: ';
var ExerciseTitle = 'Le match'; //
var ExerciseSubtitle = 'Le discours indirect'; //
var Instructions = 'Cliquez sur le "?", lisez le texte et écrivez lez les phrases au discours indirect.'; //'';
var ShuffleQs = false; //true;
var CorrectResponse = 'Correct!';
var TheseAnswersToo = 'Ces réponses sont également correctes :';
var ThisMuchIsCorrect = 'Cette partie de ta réponse est correcte :';
var TheseWordsAppear = 'Ces mots font aussi partie de la réponse :';
var IncorrectResponse = 'Erreur, essaie à nouveau';
var EnterGuess = 'Fais un essai :';
var GiveHint = 'Indice :';
var TheseCorrect = 'Bonnes réponses :';
var CaseSensitive = false;
var QsToShow = 17; //number of questions from the set to be used each time
var ReadingURL = '';
var FocusBoxes = true;
var Score = '';
var FinalScore = '';
var PreviousPage = history.length;
var NavBar='';
NavBar+='<tr><form name="NavButtons1" action=""><td bgcolor="#bbbbee" align="center">';
NavBar+='<font face="Geneva,Arial" size="-1">';
NavBar+='</font></td></form></tr>';
var TitleCode = '<tr><td align="center" valign="middle" bgcolor="#8080c0">';
TitleCode += '<font size="+1" face="Geneva,Arial" color="#993366">' + ExerciseTitle + '</font><br />';
TitleCode += '<font size="-1" face="Geneva,Arial" color="#993366">' + ExerciseSubtitle + '<br />';
TitleCode += '</font></td></tr>';
var TableOpener = '<table border="0" align="center" width="85%">';
/*
var TableOpener = '<table border="0" align="center" width="65%">';
*/
var QRow = '<form name="QForm[QNum]" action="" onSubmit="parent.TrapReturn(false,[QNum]); return false;">';
QRow += '<tr><td valign="top" bgcolor="#bbbbee" align="right">';
QRow += '<font size="+2" face="Geneva,Arial" color="#ff0000">[QNumber] </font></td>';
QRow += '<td width="10" valign="middle" align="center" bgcolor="#bbbbee">';
QRow += '<input type="button" name="translate" onclick="parent.ShowPhrase([QNum])" value=" ? "></input></td>';
QRow += '<td><font face="Geneva,Arial" color="#ff0000">[AnswerBox]</font></td>';
QRow += '<td><input type="button" name="Check" onclick="parent.CheckAnswer(false,[QNum])" value="Vérifier"></input></td>';
QRow += '<td><input type="button" name="Show" onclick="parent.ShowAnswers([QNum])" value="Solution"></input></td>';
QRow += '</tr></form>';
TableCloser = '</table>';
var LongAnswer = '<textarea name="Guess" cols="62" rows="2" onFocus="parent.DeletePhrase([QNum])"></textarea>';
if (is.ns4==true){var ShortAnswer = '<input type="text" name="Guess" size="50" onFocus="parent.DeletePhrase([QNum])"></input>';}
else{var ShortAnswer = '<input type="text" name="Guess" size="80" onFocus="parent.DeletePhrase([QNum])"></input>';}
function GoBack(){
var BackSkip = history.length - PreviousPage;
if (BackSkip > 0){
history.go((BackSkip+1)*-1);
}
else{
parent.history.back();
}
}
function TrapReturn(ShowHint,QNum){
//if not yet answered correctly, call CheckAnswer
if (Status[QNum][0] < 1){
CheckAnswer(ShowHint,QNum);
}
}
function ShowPhrase(QNum){
var Output = I[QNum][0];
WriteFeedback(Output);
}
function DeletePhrase(QNum){
if (Status[QNum][0] != 1){
var Output = ' ';
// WriteFeedback(Output);
}
}
function ReduceItems(){
var ItemToDump=0;
var j=0;
while (I.length > QsToShow){
ItemToDump = Math.floor(I.length*Math.random());
for (j=ItemToDump; j<(I.length-1); j++){
I[j] = I[j+1];
}
I.length = I.length-1;
}
}
function Shuffle(InArray){
Temp = new Array();
var Len = InArray.length;
var j = Len;
for (var i=0; i<Len; i++){
Temp[i] = InArray[i];
}
for (i=0; i<Len; i++){
Num = Math.floor(j * Math.random());
InArray[i] = Temp[Num];
for (var k=Num; k < j; k++) {
Temp[k] = Temp[k+1];
}
j--;
}
return InArray;
}
function WriteFeedback(Feedback) {
//Build the output string
var OutString = '';
OutString += '<html>';
OutString += '<body background="" bgcolor="#8080c0" text="#ff0000" link="#0000ff" vlink="#0000cc">';
OutString += '<center><table border="0" cellpadding="5" cellspacing="1" width="85%">';
OutString += NavBar;
if (Feedback.length>0){
OutString += '<tr><td bgcolor="#bbbbee" align="center">';
OutString += '<font face="Geneva,Arial" size="-1" color="#ff0000">';
OutString += Feedback;
OutString += '</font></td></tr>'
}
OutString += '</table></center></body></html>';
if (is.CRAPBrowser){OutString=ResolveAllURLs(OutString);}
//Write it to the frame
TopFrame.document.clear();
TopFrame.document.open();
TopFrame.document.write(OutString);
TopFrame.document.close();
}
function StartUp(){
//Write the top frame
WriteFeedback(Instructions);
if ((is.mac)&&(is.ns)) {
FocusBoxes = false;
}
//Reduce array if required
if (QsToShow < I.length){
ReduceItems();
}
//Shuffle stuff if required
if (ShuffleQs == true){
I = Shuffle(I);
}
//Create arrays
CreateStatusArrays();
ShowAllQs();
}
I = new Array();
I[0] = new Array();
I[0][0]='<i>Bernard:</i> Sylvie, tu veux entrer dans notre \u00E9quipe?<br />Bernard demande \u00E0 Sylvie';
I[0][1] = new Array();
I[0][1][0] = new Array();
I[0][1][0][0]='si elle veut entrer dans leur \u00E9quipe.';
I[0][1][1] = new Array();
I[0][1][1][0]='si elle veut entrer dans l\'\u00E9quipe de Bernard.';
I[1] = new Array();
I[1][0]='<i>Sylvie:</i> Mais oui. Je suis une fille, mais j\'aime jouer au foot.<br />Sylvie r\u00E9pond';
I[1][1] = new Array();
I[1][1][0] = new Array();
I[1][1][0][0]='qu\'elle est une fille, mais qu\'elle aime jouer au foot.';
I[1][1][1] = new Array();
I[1][1][1][0]='qu\'elle est une fille et qu\'elle aime jouer au foot.';
I[2] = new Array();
I[2][0]='<i>Philippe:</i> Avec une fille, nous allons perdre contre le coll\u00E8ge Voltaire.<br />Philippe dit';
I[2][1] = new Array();
I[2][1][0] = new Array();
I[2][1][0][0]='qu\'avec une fille, ils vont perdre contre le coll\u00E8ge Voltaire.';
I[2][1][1] = new Array();
I[2][1][1][0]='que, avec une fille, ils vont perdre contre le coll\u00E8ge Voltaire.';
I[2][1][2] = new Array();
I[2][1][2][0]='qu\'ils vont perdre contre le coll\u00E8ge Voltaire, avec une fille.';
I[3] = new Array();
I[3][0]='<i>Sylvie:</i> Tu es b\u00EAte!<br />Sylvie lui dit';
I[3][1] = new Array();
I[3][1][0] = new Array();
I[3][1][0][0]='qu\'il est b\u00EAte.';
I[3][1][1] = new Array();
I[3][1][1][0]='que Philippe est b\u00EAte.';
I[4] = new Array();
I[4][0]='<i>Sylvie:</i> Je suis une bonne joueuse!<br />Elle dit aussi';
I[4][1] = new Array();
I[4][1][0] = new Array();
I[4][1][0][0]='qu\'elle est une bonne joueuse.';
I[5] = new Array();
I[5][0]='Pendant le match, Philippe envoie toujours le ballon aux gar\u00E7ons de l\'\u00E9quipe.<br /><i>Bernard:</i> Tu peux envoyer le ballon aux filles aussi?<br />Bernard demande';
I[5][1] = new Array();
I[5][1][0] = new Array();
I[5][1][0][0]='s\'il peut envoyer le ballon aux filles aussi.';
I[5][1][1] = new Array();
I[5][1][1][0]='si Bernard peut envoyer le ballon aux filles aussi.';
I[6] = new Array();
I[6][0]='<i>Philippe:<i> Cette Sylvie ne m\'impressionne pas!<br />Philippe dit';
I[6][1] = new Array();
I[6][1][0] = new Array();
I[6][1][0][0]='que cette Sylvie ne l\'impressionne pas';
I[6][1][1] = new Array();
I[6][1][1][0]='que Sylvie ne l\'impressionne pas';
I[7] = new Array();
I[7][0]='Philippe frappe le ballon - et le ballon sort du terrain! La salle hurle.<br /><i>Sylvie:</i> O\u00F9 est-ce que tu envoies tes passes?<br />Sylvie demande avce ironie';
I[7][1] = new Array();
I[7][1][0] = new Array();
I[7][1][0][0]='o\u00F9 il envoie ses passes.';
I[7][1][1] = new Array();
I[7][1][1][0]='o\u00F9 Philippe envoie ses passes.';
I[8] = new Array();
I[8][0]='Bernard passe le ballon \u00E0 Sylvie; Sylvie attaque, et elle marque un but (<i>Tor</i>).<br /><i>Sylvie:</i> Comme \u00E7a, on gagne le match!<br />Sylvie dit \u00E0 Philippe';
I[8][1] = new Array();
I[8][1][0] = new Array();
I[8][1][0][0]='que comme \u00E7a, on gagne le match.';
I[8][1][1] = new Array();
I[8][1][1][0]='qu\'on gagne le match comme \u00E7a.';
I[8][1][2] = new Array();
I[8][1][2][0]='que comme \u00E7a, ils gagnent le match.';
I[8][1][3] = new Array();
I[8][1][3][0]='qu\'ils gagnent le match comme \u00E7a.';
I[9] = new Array();
I[9][0]='Philippe commence \u00E0 admirer Sylvie.<br />Tout \u00E0 coup, un ballon frappe Philippe \u00E0 la t\u00EAte. Il tombe. Sylvie arrive.<br /><i>Sylvie:</i> Je peux t\'aider?<br />Sylvie lui demande';
I[9][1] = new Array();
I[9][1][0] = new Array();
I[9][1][0][0]='si elle peut l\'aider.';
I[10] = new Array();
I[10][0]='<i>Philippe:</i> Non, je veux continuer.<br />Philippe dit';
I[10][1] = new Array();
I[10][1][0] = new Array();
I[10][1][0][0]='qu\'il veut continuer.';
I[11] = new Array();
I[11][0]='Apr\u00E8s le match.<br /><i>Philippe:</i> Sylvie, je te demande pardon.<br />Philippe dit \u00E0 Sylvie';
I[11][1] = new Array();
I[11][1][0] = new Array();
I[11][1][0][0]='qu\'il lui demande pardon.';
I[12] = new Array();
I[12][0]='<i>Philippe:</i> Tu es gentille et tu es une bonne joueuse.<br />Philippe dit aussi \u00E0 Sylvie';
I[12][1] = new Array();
I[12][1][0] = new Array();
I[12][1][0][0]='qu\'elle est gentille et qu\'elle est une bonne joueuse.';
I[13] = new Array();
I[13][0]='<i>Bernard:</i> Sylvie, maintenant, tu peux donner une bise \u00E0 Philippe.<br />Bernard dit \u00E0 Sylvie';
I[13][1] = new Array();
I[13][1][0] = new Array();
I[13][1][0][0]='qu\'elle peut donner une bise \u00E0 Philippe maintenant.';
I[13][1][1] = new Array();
I[13][1][1][0]='qu\'elle peut lui donner une bise maintenant.';
I[13][1][2] = new Array();
I[13][1][2][0]='que maintenant, elle peut donner une bise \u00E0 Philippe.';
I[13][1][3] = new Array();
I[13][1][3][0]='que maintenant, elle peut lui donner une bise.';
I[14] = new Array();
I[14][0]='<Sylvie:</i> Peut-\u00EAtre... Philippe, tu vas \u00EAtre gentil avec moi?<br />Elle demande \u00E0 Philippe';
I[14][1] = new Array();
I[14][1][0] = new Array();
I[14][1][0][0]='s\'il va \u00EAtre gentil avec elle.';
I[15] = new Array();
I[15][0]='<i>Bernard:</i> Ah, les amoureux! Et moi, qui me donne une bise?<br />Bernard demande';
I[15][1] = new Array();
I[15][1][0] = new Array();
I[15][1][0][0]='qui lui donne une bise.';
I[16] = new Array();
I[16][0]='<i>Sylvie et Bernard:</i> Moi!<br />Et qu\'est-ce qu\'ils font?';
I[16][1] = new Array();
I[16][1][0] = new Array();
I[16][1][0][0]='Ils donnent une bise \u00E0 Bernard.';
I[16][1][1] = new Array();
I[16][1][1][0]='Ils donnent une grosse bise \u00E0 Bernard.';
I[16][1][2] = new Array();
I[16][1][2][0]='Ils lui donnent une bise.';
I[16][1][3] = new Array();
I[16][1][3][0]='Ils lui donnent une grosse bise.';
Status = new Array();
function CreateStatusArrays(){
Status.length = 0;
for (i=0; i<I.length; i++){
Status[i] = new Array();
Status[i][0] = 0; // question done or not
Status[i][1] = 0; // wrong checks
Status[i][2] = 0; // hints asked for
Status[i][3] = ''; // student's answer
Status[i][4] = 0; // score for this question
}
}
function ReplaceStuff(Token, Replacement, InString){
var i = InString.indexOf(Token);
var FirstBit = '';
var LastBit = '';
while (i>-1){
FirstBit = InString.substring(0, i);
LastBit = InString.substring(i + Token.length, InString.length);
InString = FirstBit + Replacement + LastBit;
i = InString.indexOf(Token);
}
return InString;
}
function BuildQuestion(QNum){
var Temp = '';
//Measure the answers and find out what kind of box to show
var Longest = 5;
for (var i=0; i<I[QNum][1].length; i++){
if (I[QNum][1][i][0].length > Longest){
Longest = I[QNum][1][i][0].length;
}
}
var AnsBox = '';
if (Longest > 60){
AnsBox += LongAnswer;
AnsRow = ReplaceStuff('[QNum]', QNum, QRow);
}
else{
AnsBox += ShortAnswer;
AnsRow = ReplaceStuff('[QNum]', QNum, QRow);
}
var AnsRow = ReplaceStuff('[AnswerBox]', AnsBox, QRow);
Temp += AnsRow;
Temp = ReplaceStuff('[QNumber]', QNum+1, Temp);
Temp = ReplaceStuff('[QNum]', QNum, Temp);
return Temp;
}
function DisplayExercise(StuffToDisplay){
//Build the output string
var OutString = '';
OutString += '<html>';
OutString += '<body background="" bgcolor="#8080c0" text="#ff0000" link="#0000ff" vlink="#0000cc">';
OutString += '<center><table border="0" cellpadding="5" cellspacing="1" width="85%">';
OutString += TitleCode;
OutString += '<tr><td bgcolor="#bbbbee" align="center">';
OutString += '<font face="Geneva,Arial" size="-1">';
OutString += StuffToDisplay;
OutString += '</font></td></tr>';
OutString += NavBar;
OutString += '</table></center></body></html>';
if (is.CRAPBrowser){OutString=ResolveAllURLs(OutString);}
//Write it to the frame
BottomFrame.document.clear();
BottomFrame.document.open();
BottomFrame.document.write(OutString);
BottomFrame.document.close();
}
function ShowAllQs(){
var Output = '';
for (var i=0; i<I.length-1; i++){
Output = Output + BuildQuestion(i);
}
Output = Output + BuildQuestion(I.length-1);
Output = TableOpener + Output + TableCloser;
DisplayExercise(Output);
}
function TrimString(InString){
var x = 0
if (InString.length != 0) {
while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){
InString = InString.substring(0, InString.length - 1)
}
while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){
InString = InString.substring(1, InString.length)
}
while (InString.indexOf(' ') != -1) {
x = InString.indexOf(' ')
InString = InString.substring(0, x) + InString.substring(x+1, InString.length)
}
return InString;
}
else {
return '';
}
}
function RemovePunctuation(InString){
var OutString = '';
for (i=0; i<InString.length; i++){
if ((InString.charAt(i) == '.') || (InString.charAt(i) == ',') ||(InString.charAt(i) == ';') || (InString.charAt(i) == ':') || (InString.charAt(i) == '!') || (InString.charAt(i) == '?') || (InString.charAt(i) == '"')){}
else {
OutString += InString.charAt(i);
}
}
return OutString;
}
function CheckBeginning(Guess, Answer){
var OutString = '';
var i = 0;
while (Guess.charAt(i) == Answer.charAt(i)) {
OutString += Guess.charAt(i);
i++;
}
return OutString;
}
function CheckEnd(Guess, Answer){
var i=0;
var j=0;
var OutString='';
i = Guess.length;
j = Answer.length;
while (Guess.charAt(i) == Answer.charAt(j)){
OutString = Guess.charAt(i) + OutString;
i--;
j--;
}
return OutString;
}
function FindLongest(InArray){
if (InArray.length < 1){return -1;}
var Longest = 0;
for (var i=1; i<InArray.length; i++){
if (InArray[i].length > InArray[Longest].length){
Longest = i;
}
}
return Longest;
}
function CheckWords(Guess, Answer){
var Start = 0;
var End = 0;
var LoopCounter = 0;
var ReturnList = '';
var i = 0;
var j = 0;
GuessWords = new Array();
AnswerWords = new Array();
Guess = RemovePunctuation(Guess);
Answer = RemovePunctuation(Answer);
while (Guess.indexOf(' ', Start) > -1) {
End = Guess.indexOf(' ', Start);
GuessWords[LoopCounter] = Guess.substring(Start, End).toLowerCase();
LoopCounter++;
Start = End + 1;
}
GuessWords[LoopCounter] = Guess.substring(Start, Guess.length).toLowerCase();
Start = 0;
LoopCounter = 0;
while (Answer.indexOf(' ', Start) > -1) {
End = Answer.indexOf(' ', Start);
AnswerWords[LoopCounter] = Answer.substring(Start, End);
LoopCounter++;
Start = End + 1;
}
AnswerWords[LoopCounter] = Answer.substring(Start, Answer.length);
ReturnList = '';
for (i = 0; i < GuessWords.length; i++){
for (j = 0; j < AnswerWords.length; j++){
if (GuessWords[i] == AnswerWords[j].toLowerCase()){
ReturnList = ReturnList + AnswerWords[j] + ', ' ;
AnswerWords[j] = '';
break;
}
}
}
if (ReturnList.length > 0){
ReturnList = ReturnList.substring(0, ReturnList.length - 2);
}
return ReturnList;
}
function CalculateScore(){
Score = 0;
var DoneQs = 0;
for (i=0; i<Status.length; i++){
if (Status[i][0] == 1){
Score += Status[i][4];
DoneQs++;
}
}
Score = Math.floor((Score*100)/(DoneQs*10));
return Score;
}
function CheckAnswer(ShowHint, QNum){
//if the question's already correct, exit gracefully
if (Status[QNum][0] == 1){
ShowAnswers(QNum);
return;
}
var Output = '';
//Get the guess, trim it, and translate it if necessary
var Guess = TrimString(eval('BottomFrame.document.QForm' + QNum + '.Guess').value);
//Save the guess
Status[QNum][3] = Guess;
var RealGuess = Guess;
if (CaseSensitive == false){
Guess = Guess.toUpperCase();
}
if (Guess.length < 1){
WriteFeedback(EnterGuess);
return;
}
//Get the correct answers and put them into an array
CorrectAs = new Array();
RealAs = new Array();
for (var i=0; i<I[QNum][1].length; i++){
CorrectAs[i] = I[QNum][1][i][0];
RealAs[i] = CorrectAs[i];
if (CaseSensitive == false){
CorrectAs[i] = CorrectAs[i].toUpperCase();
}
}
//Check each answer to see whether it's correct -- if so, set Status variables and exit
var Right = -1;
var OtherAnswers = '';
for (i=0; i<CorrectAs.length; i++){
if (Guess==CorrectAs[i]){Right = i;}else{OtherAnswers+=RealAs[i] + '<br />';};
}
if (Right > -1){
Status[QNum][0] = 1;
Output = CorrectResponse + ' ';
if (OtherAnswers.length > 0){
Output += TheseAnswersToo + '<br />' + OtherAnswers;
}
//Get the score for this question
var HintPenalty = (Status[QNum][2]*10)/CorrectAs[Right].length;
Status[QNum][4] = Math.floor((10 - Status[QNum][1]) - HintPenalty);
//Check whether the quiz is finished
var Finished = true;
for (var i=0; i<Status.length; i++){
if (Status[i][0] == 0){Finished = false;}
}
//Calculate scores
if ((Finished==true)||(ContinuousScoring==true)){
var Score = CalculateScore();
Output = Output + YourScoreIs + ' ' + Score + '%. ';
}
if (Finished == true){
var CFT = 0;
for (i=0; i<Status.length; i++){
if ((Status[i][1] == 0)&&(Status[i][2] == 0)){
CFT++;
}
}
Output += CorrectFirstTime + CFT + '/' + I.length;
WriteFeedback(Output);
}
else{
WriteFeedback(Output);
}
}
//else the answer wasn't right
else {
//increment the tries or hint variable for that question
if (ShowHint == false){Status[QNum][1]++;}else{Status[QNum][2]++;}
//Find which answer is closest
CorrectBits = new Array();
CorrectBits[0] = new Array(); //Beginning bits
CorrectBits[1] = new Array(); //End bits
CorrectBits[2] = new Array(); //Combined bits
CorrectBits[3] = new Array(); //Hint (in case needed)
for (i=0; i<CorrectAs.length; i++){
CorrectBits[0][i] = CheckBeginning(Guess, CorrectAs[i]);
if (CorrectBits[0][i].length > 0){
CorrectBits[0][i] = RealAs[i].substring(0,CorrectBits[0][i].length);
}
CorrectBits[1][i] = CheckEnd(Guess, CorrectAs[i]);
if (CorrectBits[1][i].length > 0){
CorrectBits[1][i] = RealAs[i].substring(RealAs[i].length-CorrectBits[1][i].length,RealAs[i].length);
}
CorrectBits[2][i] = CorrectBits[0][i] + ' ... ' + CorrectBits[1][i];
CorrectBits[3][i] = CorrectBits[0][i] + RealAs[i].charAt(CorrectBits[0][i].length);
if (CorrectBits[3][i].charAt(CorrectBits[3][i].length-1) == ' '){
CorrectBits[3][i] += RealAs[i].charAt(CorrectBits[3][i].length);
}
CorrectBits[3][i] += '...'
}
var LongestCorrect = FindLongest(CorrectBits[2]);
if (CorrectBits[2][LongestCorrect].length > 5){
Output = ThisMuchIsCorrect + '<br />' + CorrectBits[2][LongestCorrect];
}
else{
if (ShowHint == false){
Output = IncorrectResponse;
}
}
//Include words found in the answer
var FoundWords = CheckWords(Guess, CorrectAs[LongestCorrect]);
if (FoundWords.length > 0){
Output += '<br />' + TheseWordsAppear + FoundWords;
}
if (ShowHint == true){
Output += '<br />' + GiveHint + CorrectBits[3][LongestCorrect];
}
WriteFeedback(Output);
}
}
function ShowAnswers(QNum){
//If the question isn't done, mark it as done. Score will be 0;
if (Status[QNum][0] != 1){
//Question is not already done
Status[QNum][0] = 1;
Status[QNum][1] = -1;
Status[QNum][2] = -1;
}
//Get the correct answers and put them into a string
eval('BottomFrame.document.QForm' + QNum + '.Guess').value = I[QNum][1][0][0];
var Output = TheseCorrect + '<br />';
Output += I[QNum][1][0][0] + '<br />';
for (var i=1; i<I[QNum][1].length; i++){
Output += I[QNum][1][i][0] + '<br />';
}
//Check whether the quiz is finished
var Finished = true;
for (var i=0; i<Status.length; i++){
if (Status[i][0] == 0){Finished = false;}
}
//Add the current score if necessary
if ((ContinuousScoring == true)||(Finished == true)){
Output += YourScoreIs + ' ' + CalculateScore() + '%. ';
}
WriteFeedback(Output);
return true;
}
function Blank(){
return '<html><body>© Half-Baked Software.<br />© Michael Rottmeier. Loading...</body></html>';
}
//-->
//]]>
</script>
</head>
<!--<body>Fool those dumb ad-inserting ISPs</body>-->
<!--For full XHTML 1.0 compatibility, remove the border and framespacing attributes.
These are required for proper display in current browsers, but render the document incompatible. Then, you'll need to add the appropriate Document Type Declaration; use
the W3C XHTML 1 frameset DTD.-->
<frameset rows="25%,*" framespacing="0" border="0" onload="StartUp()">
<frame src="javascript:parent.Blank()" frameborder="0" name="TopFrame"></frame>
<frame src="javascript:parent.Blank()" frameborder="0" name="BottomFrame"></frame>
</frameset>
</html>

