var response = new Array(26); for (var i=0;i<=26;i++) { response[i]=new Array(20); }

//The values below are for good, poor, and auto-fail
var autofail=3;
var good="<span class='feed_good'>Good</span>";
var poor="<span class='feed_poor'>Needs work</span>";

//Computer Use Responses
//Good response:
response[0][0]="<div class='feedback_pos'><h4>Results</h4><p><strong>You have many of the basic computer skills necessary for working with Blackboard.<br /><br />Please continue.</strong></p></div>";
//Bad response:
response[0][1]="<div class='feedback_neg'><h4>Results</h4><p><strong>You may want to to brush up on some additional computer skills before using Blackboard. Once you have finished the Warm-Up we'll direct you to just the right resources so you can get what you need.<br /><br />Please continue.</strong></p></div>";
response[0][2]=6; // 6 Threshold, if under use bad response, if equal or over use good
response[0][3]="<b>Computer Use</b>"; //Name of category to use at end for summary

//Software Responses
response[1][0]="<div class='feedback_pos'><h4>Results</h4><p><strong>You have many of the basic software skills necessary for working with Blackboard.<br /><br />Please continue.</strong></p></div>";
response[1][1]="<div class='feedback_neg'><h4>Results</h4><p><strong>You may want to to brush up on some additional software skills before using Blackboard. Once you have finished the Warm-Up we'll direct you to just the right resources so you can get what you need.<br /><br />Please continue.</strong></p></div>";
response[1][2]=7; // 7
response[1][3]="<b>Software</b>";

//Internet Responses
response[2][0]="<div class='feedback_pos'><h4>Results</h4><p><strong>You have many of the basic Internet skills necessary for working with Blackboard.<br /><br />Please continue.</strong></p></div>";
response[2][1]="<div class='feedback_neg'><h4>Results</h4><p><strong>You may want to to brush up on some additional internet skills before using Blackboard. Once you have finished the Warm-Up we'll direct you to just the right resources so you can get what you need.<br /><br />Please continue.</strong></p></div>";
response[2][2]=14; // 14
response[2][3]="<b>Internet / E-mail</b>";

//Course Prep Responses
response[3][0]="<div class='feedback_pos'><h4>Results</h4><p><strong>You have many of the basic course preparation  necessary for working with Blackboard.<br /><br />Please continue.</strong></p></div>";
response[3][1]="<div class='feedback_neg'><h4>Results</h4><p><strong>You may want to to brush up on some additional course preparation before using Blackboard. Once you have finished the Warm-Up we'll direct you to just the right resources so you can get what you need.<br /><br />Please continue.</strong></p></div>";
response[3][2]=3; // 3
response[3][3]="<b>Course Preparation</b>";

//Final response
//response[25][0] - Formerly the good response, you now input this directly into the page.
response[25][1]="<div class='feedback_neg'><h4>Recommendation:</h4><p><strong>It appears you are missing many of the skills that will help you when working within Blackboard.  We would like to suggest some options for brushing up on these skills before you sign up for Blackboard training.</strong></p><p align='center'><a href='../forms/options.html'><strong>View recommended options...</strong></a></p></div>";
response[25][2]=26; // 26 Sum of all previous third response values
response[25][3]=" ";


//Other variables
var saver = new Array();
var did = new Array();
var pscore = new Array();
var minus = 0;
var stage = 0;
var extra = "<p>";
var cot = 0;
for (i=0; i<20; i++) pscore[i]=-1;


//Code

function getScore() {
 var score = 0;
 for(i=0; i<document.question.elements.length; i++) {
  if (document.question.elements[i].type=="checkbox") {
   if (valid(Number(document.question.elements[i].checked),"check boxes")==true) 
   score=score + Number(document.question.elements[i].checked);
  } else if (document.question.elements[i].type=="select-one") {
   if (valid(Number(document.question.elements[i].options[document.question.elements[i].selectedIndex].value),"drop down menus")==true) 
   score=score + Number(document.question.elements[i].options[document.question.elements[i].selectedIndex].value);
  } else if (document.question.elements[i].type=="radio") {
   valid(Number(document.question.elements[i].value),"radio buttons");
   if (document.question.elements[i].checked==true) score=score + Number(document.question.elements[i].value);
  }
 }
 return(score);
}
function getStatus() {
 pscore[stage]=getScore() - minus;
 minus += pscore[stage];
 scroll(0,0);
 if (pscore[stage]<response[stage][2]) { cot+=1; saver[stage]=response[stage][1]; did[stage]=poor; }
 else { saver[stage]=response[stage][0]; did[stage]=good; }
 output("result" + stage,"<p>" + saver[stage]);
 stage += 1;
}
function getResult() {
 getStatus();
 score=minus;
 for (i=0; pscore[i]!=-1; i++) extra= extra + response[i][3] + ": " + did[i] + "<br />";
 extra = extra + "<br />" + response[25][3];
 output("finalresult",extra);
 if (score>=response[25][2] && cot<autofail) var fty=0;
 else output("finalquote",response[25][1]);
}
function output(id,content) {
 if (document.getElementById || document.all) {
  var el = document.getElementById? document.getElementById(id): document.all[id];
  if (el && typeof el.innerHTML != "undefined") el.innerHTML = content;
 }
}
function initForm() {
 question.reset();
}
function checkNoa(who) {
 eval("var lol=document.question."+who+"");
 for (i = 0; i < lol.length; i++) {
  lol[i].checked = false ;
 }
 lol[lol.length-1].checked = true;
}
function checkReg(who) {
 eval("var lol=document.question."+who+"");
 lol[lol.length-1].checked = false;
}
function valid(value,desc) {
if (isNaN(value)==true) {
  alert("One of your " + desc + " in this entire test has an invalid value.");
  return false;
}
return true;
}