';
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 -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 ChangeQ(ChangeBy){
// if (Status[CurrQNum][0] = 0)&&(NewNum';
OutString += TitleCode;
OutString += '
';
OutString += NavBar;
OutString += '';
OutString += '';
OutString += StuffToDisplay;
OutString += ' ';
}
Output = Output + BuildQuestion(I.length-1);
Output = TableOpener + Output + TableCloser;
DisplayExercise(Output);
}
function ShowQuestion(QNum){
//First, create the Q number readout at the top
var Readout = (QNum+1) + '/' + I.length;
while (Readout.length 0){
Box.value = Status[QNum][3];
}
Box.focus();
}
}
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
' + 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
' + 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 += '
' + TheseWordsAppear + FoundWords;
}
if (ShowHint == true){
Output += '
' + GiveHint + CorrectBits[3][LongestCorrect];
}
WriteFeedback(Output);
//Put the focus back in the box
if (FocusBoxes==true){
eval('BottomFrame.document.QForm' + (QNum) + '.Guess').focus();
}
}
}
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
var Output = TheseCorrect + '
';
Output += I[QNum][1][0][0] + '
';
for (var i=1; i';
}
//Check whether the quiz is finished
var Finished = true;
for (var i=0; i