'; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += ''; ResultForm += '
'; var NavBar=''; NavBar+='
'; NavBar+=''; NavBar+=''; NavBar+=''; NavBar+='
'; if (is.CRAPBrowser){NavBar = ResolveAllURLs(NavBar);} var TitleCode = ''; TitleCode += '' + ExerciseTitle + '
'; TitleCode += '' + ExerciseSubtitle + '
'; TitleCode += '
'; var TableOpener = '
'; TableOpener += ''; var IRow = ''; IRow += ''; IRow += ''; var CheckButton = ''; TableCloser = '
'; IRow += '[strLeftItem]    '; IRow += '[strRightItem]'; IRow += '   [Mark]'; IRow += '

'; var DropDownList = ''; var Exercise = ''; function GoBack(){ var BackSkip = history.length - PreviousPage; if (BackSkip > 0){ history.go((BackSkip+1)*-1); } else{ parent.history.back(); } } function Shuffle(InArray){ Temp = new Array(); var Len = InArray.length; var j = Len; for (var i=0; i
'; OutString += '
'; OutString += NavBar; if (Feedback.length>0){ OutString += '' } OutString += '
'; OutString += ''; OutString += Feedback; OutString += '
'; //Write it to the frame TopFrame.document.clear(); TopFrame.document.open(); TopFrame.document.write(OutString); TopFrame.document.close(); } function BuildSelector(){ DropDownList = ''; } function StartUp(){ //Try to get user name UserName = prompt('Please enter your name and ID number',''); UserName += ''; if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){ UserName = prompt('Please enter your name and ID number',''); UserName += ''; if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){ window.location = PreviousPage; } } CorrectIndicator = '' + CorrectIndicator + ''; IncorrectIndicator = '' + IncorrectIndicator + ''; //Write the top frame WriteFeedback(Instructions); //Create the right-item/distractor array, and shuffle it var DuplicateItem = false; for (var i=0; i 0){ TotalUnfixedLeftItems++; } DuplicateItem = false; //and it's not already in the array for (var j=0; j 0){ TempRow = IRow; TempRow = ReplaceStuff('[strLeftItem]', I[i][0], TempRow); //if not fixed and not yet answered correctly if ((I[i][2] < 1)&&(Status[i][0] < 1)){ TempRow = ReplaceStuff('[strRightItem]', DropDownList, TempRow); } else{ TempRow = ReplaceStuff('[strRightItem]', I[i][1], TempRow); } //if it's not fixed, and it's been attempted, mark it appropriately if ((I[i][2] < 1)&&(Status[i][1] > 0)){ if (Status[i][0] < 1){ TempRow = ReplaceStuff('[Mark]', IncorrectIndicator, TempRow); } else{ TempRow = ReplaceStuff('[Mark]', CorrectIndicator, TempRow); } } else{ TempRow = ReplaceStuff('[Mark]', '', TempRow); } TempRow = ReplaceStuff('[INum]', i, TempRow); Exercise += TempRow; } } //Add the check button Exercise += CheckButton; //Make it into a table Exercise = TableOpener + Exercise + TableCloser; } I = new Array(); I[0] = new Array(); I[0][0] = 'It was an early morning yesterday, I was up before the dawn'; I[0][1] = 'And I really have enjoyed my stay, But I must be moving on'; I[0][2] = 0; I[1] = new Array(); I[1][0] = 'Like a king without a castle, Like a queen without a throne'; I[1][1] = 'I\'m an early morning lover, And I must be moving on'; I[1][2] = 0; I[2] = new Array(); I[2][0] = 'Now I believe in what you say, Is the undisputed truth'; I[2][1] = 'But I have to have things my own way, To keep me in my youth'; I[2][2] = 0; I[3] = new Array(); I[3][0] = 'Like a ship without an achor, Like a slave without a chain'; I[3][1] = 'Just the thought of those sweet ladies, Sends a shiver through my veins'; I[3][2] = 0; I[4] = new Array(); I[4][0] = 'And I will go on shining, Shining like brand new'; I[4][1] = 'I\'ll never look behind me, My troubles will be few'; I[4][2] = 0; I[5] = new Array(); I[5][0] = 'Goodbye stranger it\'s been nice, Hope you find your paradise'; I[5][1] = 'Tried to see your point of view'; I[5][2] = 0; I[6] = new Array(); I[6][0] = 'Hope your dreams will all come true, '; I[6][1] = 'Goodbye Mary, Goodbye Jane'; I[6][2] = 0; I[7] = new Array(); I[7][0] = 'Will we ever meet again, Feel no sorrow,'; I[7][1] = 'feel no shame'; I[7][2] = 0; I[8] = new Array(); I[8][0] = 'Come tomorrow, '; I[8][1] = 'feel no pain'; I[8][2] = 0; I[9] = new Array(); I[9][0] = 'Now some they do and some they don\'t, And some you just can\'t tell'; I[9][1] = 'And some they will and some they won\'t, With some it\'s just as well'; I[9][2] = 0; I[10] = new Array(); I[10][0] = 'You can laugh at my behavior, That\'ll never bother me'; I[10][1] = 'Say the devil is my savior, But I don\'t pay no heed'; I[10][2] = 0; Status = new Array(); RItems = new Array(); function CreateStatusArrays(){ for (var x=0; x-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 EscapeDoubleQuotes(InString){ var Result = ''; for (var i=0; i
'; OutString += '
'; OutString += TitleCode; OutString += ''; OutString += NavBar; OutString += '
'; OutString += ''; OutString += StuffToDisplay; OutString += '
'; 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 GetAnswer(INum){ var Result = -1; var s = eval('BottomFrame.document.QForm.sel' + INum); if (s != null){ Result = s.selectedIndex - 1; } return Result; } function CheckAnswers(){ var AllDone = true; TotCorrectChoices = 0; //for each item not fixed or a distractor for (var i=0; i 0)){ //if it hasn't been answered correctly yet if (Status[i][0] < 1){ //Add one to the number of tries for this item Status[i][1]++; //Get the answer if (GetAnswer(i) == I[i][3]){ //The answer is correct, so set the status flag Status[i][0] = 1; } //else the answer is wrong, so remember that else{ AllDone = false; } } //If it's correct, count it if (Status[i][0] == 1){ TotCorrectChoices++; } } } //Calculate the score var Score = Math.floor(((TotCorrectChoices-Penalties)/TotalUnfixedLeftItems)*100); var Feedback = ''; //Build the feedback if (AllDone == true){ Feedback = CorrectResponse + '
' + YourScoreIs + Score + '%.'; } else{ Feedback = IncorrectResponse + '
' + YourScoreIs + Score + '%.'; //Penalty for incorrect check Penalties++; } //Show the feedback and rebuild the exercise WriteFeedback(Feedback); if (AllDone == true){ setTimeout('SendResults(' + Score + ')', 50); } BuildExercise(); DisplayExercise(Exercise); } function SendResults(Score){ var today = new Date; var NewName = '' + today.getTime(); var NewWin = window.open('', NewName, 'toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,,width=400,height=300'); NewWin.document.clear(); NewWin.document.open(); NewWin.document.write(ResultForm); NewWin.document.close(); NewWin.document.Results.Score.value = Score + '%'; NewWin.document.Results.realname.value = UserName; NewWin.document.Results.End_Time.value = (new Date()).toLocaleString(); NewWin.document.Results.Start_Time.value = StartTime; NewWin.document.Results.submit(); } function Blank(){ return '
©Half-Baked Software. Loading...
'; } //--> //]]>
-->