// 1);
if (this.gecko){
this.geckoVer = parseInt(this.ua.substring(this.ua.indexOf('Gecko')+6, this.ua.length));
if (this.geckoVer < 20020000){this.min = false;}
}
//Look for Firebird
this.firebird = (this.ua.indexOf('Firebird') > 1);
//Look for Safari
this.safari = (this.ua.indexOf('Safari') > 1);
if (this.safari){
this.gecko = false;
}
//Look for IE
this.ie = (this.ua.indexOf('MSIE') > 0);
if (this.ie){
this.ieVer = parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, this.ua.length));
if (this.ieVer < 5.5){this.min = false;}
}
//Look for Opera
this.opera = (this.ua.indexOf('Opera') > 0);
if (this.opera){
this.operaVer = parseFloat(this.ua.substring(this.ua.indexOf('Opera')+6, this.ua.length));
if (this.operaVer < 7.04){this.min = false;}
}
if (this.min == false){
alert('Your browser may not be able to handle this page.');
}
//Special case for the horrible ie5mac
this.ie5mac = (this.ie&&this.mac&&(this.ieVer<6));
}
var C = new Client();
//for (prop in C){
// alert(prop + ': ' + C[prop]);
//}
//CODE FOR HANDLING NAV BUTTONS AND FUNCTION BUTTONS
//[strNavBarJS]
function NavBtnOver(Btn){
if (Btn.className != 'NavButtonDown'){Btn.className = 'NavButtonUp';}
}
function NavBtnOut(Btn){
Btn.className = 'NavButton';
}
function NavBtnDown(Btn){
Btn.className = 'NavButtonDown';
}
//[/strNavBarJS]
function FuncBtnOver(Btn){
if (Btn.className != 'FuncButtonDown'){Btn.className = 'FuncButtonUp';}
}
function FuncBtnOut(Btn){
Btn.className = 'FuncButton';
}
function FuncBtnDown(Btn){
Btn.className = 'FuncButtonDown';
}
function FocusAButton(){
if (document.getElementById('CheckButton1') != null){
document.getElementById('CheckButton1').focus();
}
else{
if (document.getElementById('CheckButton2') != null){
document.getElementById('CheckButton2').focus();
}
else{
document.getElementsByTagName('button')[0].focus();
}
}
}
//CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX
var topZ = 1000;
function ShowMessage(Feedback){
var Output = Feedback + '
';
document.getElementById('FeedbackContent').innerHTML = Output;
var FDiv = document.getElementById('FeedbackDiv');
topZ++;
FDiv.style.zIndex = topZ;
FDiv.style.top = TopSettingWithScrollOffset(30) + 'px';
FDiv.style.display = 'block';
ShowElements(false, 'input');
ShowElements(false, 'select');
ShowElements(false, 'object');
//Focus the OK button
setTimeout("document.getElementById('FeedbackOKButton').focus()", 50);
//
}
//Added code to work around Quicktime bug for 6.0.4.24.
function ShowElements(Show, TagName){
//Special for IE bug -- hide all the form elements that will show through the popup
if ((C.ie)||(TagName == 'object')){
var Els = document.getElementsByTagName(TagName);
for (var i=0; i ReduceToSize){
ItemToDump = Math.floor(InArray.length*Math.random());
InArray.splice(ItemToDump, 1);
}
}
function Shuffle(InArray){
var Num;
var Temp = new Array();
var Len = InArray.length;
var j = Len;
for (var i=0; i InArray[Longest].length){
Longest = i;
}
}
return Longest;
}
//UNICODE CHARACTER FUNCTIONS
function IsCombiningDiacritic(CharNum){
var Result = (((CharNum >= 0x0300)&&(CharNum <= 0x370))||((CharNum >= 0x20d0)&&(CharNum <= 0x20ff)));
Result = Result || (((CharNum >= 0x3099)&&(CharNum <= 0x309a))||((CharNum >= 0xfe20)&&(CharNum <= 0xfe23)));
return Result;
}
function IsCJK(CharNum){
return ((CharNum >= 0x3000)&&(CharNum < 0xd800));
}
//SETUP FUNCTIONS
//BROWSER WILL REFILL TEXT BOXES FROM CACHE IF NOT PREVENTED
function ClearTextBoxes(){
var NList = document.getElementsByTagName('input');
for (var i=0; i -1)||(NList[i].id.indexOf('Gap') > -1)){
NList[i].value = '';
}
if (NList[i].id.indexOf('Chk') > -1){
NList[i].checked = '';
}
}
}
//EXTENSION TO ARRAY OBJECT
function Array_IndexOf(Input){
var Result = -1;
for (var i=0; i 0){
var Select = Container.getElementsByTagName('select')[0];
if (Select != null){
Result = parseInt(Select.id.substring(1, Select.id.length));
}
}
return Result;
}
function GetKeyFromSelect(Select){
var Result = -1;
if (Select != null){
Result = parseInt(Select.id.substring(1, Select.id.length));
}
return Result;
}
var OriginalKeys = new Array();
var ReducedKeys = new Array();
function GetUniqueKeys(Container, TargetArray){
TargetArray.length = 0;
var x = -1;
var SList = Container.getElementsByTagName('select');
if (SList.length > 0){
for (var i=0; i 0){
QList.push(Qs.removeChild(Qs.getElementsByTagName('tr')[0]));
}
var Reducing = (QList.length > ReduceTo);
//If required, select random rows to delete
if (Reducing == true){
var DumpItem = 0;
while (ReduceTo < QList.length){
//Get a number to delete from the array
DumpItem = Math.floor(QList.length*Math.random());
for (i=DumpItem; i<(QList.length-1); i++){
QList[i] = QList[i+1];
}
QList.length = QList.length-1;
}
}
//Shuffle the rows if necessary
if (ShuffleQs == true){
QList = Shuffle(QList);
}
TotalUnfixedLeftItems = QList.length;
//Write the rows back to the table body
for (i=0; i=0; j--){
if (OptionRequired(Options[j].value) == false){
Selects[i].removeChild(Options[j]);
}
}
}
}
}
function OptionRequired(Key){
if (ReducedKeys.indexOf(Key) > -1){
return true;
}
else{
if (OriginalKeys.indexOf(Key) > -1){
return false;
}
else{
return true;
}
}
}
function CheckAnswers(){
if (Locked == true){return;}
var Select = null;
var Key = -1;
var Parent = null;
var Answer = null;
var AnsText = '';
var AllDone = true;
TotCorrectChoices = 0;
//for each item not fixed or a distractor
for (var i=0; i' + YourScoreIs + Score + '%.';
}
else{
Feedback = IncorrectResponse + '
' + YourScoreIs + Score + '%.';
//Penalty for incorrect check
Penalties++;
}
//If the exercise is over, deal with that
if ((AllDone == true)||(TimeOver == true)){
TimeOver = true;
Locked = true;
Finished = true;
setTimeout('Finish()', SubmissionTimeout);
WriteToInstructions(Feedback);
}
//Show the feedback
ShowMessage(Feedback);
}
//-->
//]]>