// Cut-N-Paste JavaScript from ISN Toolbox 

  //   Copyright 1998, Infohiway, Inc.  Restricted use is hereby

  //   granted (commercial and personal OK) so long as this code

  //   is not *directly* sold and the copyright notice is buried

  //   somewhere deep in your HTML document.  A link to our site

  //   http://www.infohiway.com is always appreciated of course,

  //   but is absolutely and positively not necessary. ;-)   -->

     



<!--

function Question(text,answer) {

 this.text = text;

 this.answer = answer;

}

answers = new Object();

answers["a"] = "Yes";

answers["b"] = "No";

answers["c"] = "Maybe";

answers["d"] = "Mantoux";

answers["e"] = "Canadian Lung Association";

answers["f"] = "January 26";

answers["g"] = "March 24";

answers["h"] = "Palm Readings";

answers["i"] = "Antibiotics";

answers["j"] = "The 'Ouch' Test";

answers["k"] = "The 'It Hurts' Test";

answers["l"] = "DOT";

answers["m"] = "Drug Resistance";

answers["n"] = "Drug Existence";

answers["o"] = "Behavioral Therapy";

answers["p"] = "Pneumothorax";

answers["q"] = "Chest X-ray";

answers.length = 17;



questions = new Object();

questions[0] = null; // skip index [0]

questions[1] = new Question("______ are useless if not used as prescribed.","i");

questions[2] = new Question("Is tuberculosis still killing people in Canada?","a");

questions[3] = new Question("Is tuberculosis still killing people in other parts of the world?","a");

questions[4] = new Question("What is the major cause of the resurgence of tuberculosis?","m");

questions[5] = new Question("A non profit organization that takes an active role in the fight against tuberculosis.","e");

questions[6] = new Question("______ is world tuberculosis day.","g");

questions[7] = new Question("Another name for 'Skin Test'.","d");

questions[8] = new Question("A test done to verify the existence of tuberculosis.","q");

questions[9] = new Question("______ is given to people with Tuberculosis.","i");

questions[10] = new Question("The rate of drug resistance was lowered to 7% because of this type of therapy.","l");

questions.length = 10;



quiz_title = "";



maximum_score = 100;

penalty_for_wrong_answer = -10;



// If you want to reveal the correct answer if they miss it the first time

// then set this to true. Otherwise, set to false.

reveal_correct_answer = false;



// **** NO NEED TO MODIFY ANYTHING BELOW THIS POINT *******

function choice() {

 for(n=0;n<answers.length;n++)

  eval("document.matching.answer"+n+".checked = false");

 for(n=1;n<=questions.length;n++) {

  sel = eval("document.matching.choice"+n+".selectedIndex");

  eval("document.matching.answer"+sel+".checked = true");

 }

}

function gradeQuiz() {

 wrong = "";

 correct = questions.length;

 score = maximum_score;

 for(n=1;n<=questions.length;n++) {

  sel = eval("document.matching.choice"+n+".selectedIndex");

  if (alpha.charAt(sel) != questions[n].answer) {

   correct -= 1;

   score += penalty_for_wrong_answer;

   wrong += "#"+n+" wrong! "

    +(reveal_correct_answer?"Correct answer is "+questions[n].answer:"")

    +"\r\n";

  }

 }

 document.matching.evaluation.value = "You answered "+correct+" of "+questions.length

 +" correctly for a score of "+score+".\r\n"+wrong;

}

alpha = "abcdefghijklmnopqrstuvwxyz";



answers_menu = "";

answers_text = "<td nowrap rowspan="+questions.length+" valign=top><br>";

for(n=0;n<answers.length;n++) {

 answers_menu += "<option>"+alpha.charAt(n);

 answers_text += '<input type=checkbox name="answer'+n+'">&nbsp;'

  +alpha.charAt(n)+".&nbsp;"+answers[alpha.charAt(n)]+'<br>';

}

answers_text += "</td>";



document.write('<form name="matching"><table cellpadding=0 cellspacing=0>'

+'<tr><td colspan=3><h4>'+quiz_title

+'</h4><i>Directions: Match each statement with the proper term. '

+'Make your selection for each match to the left of the statement. The terms '

+'will be checked automatically to indicate they are already '

+'used.<br><br></i></td></tr>');

for(n=1;n<=questions.length;n++)

 document.write('<tr><td align=right><select name="choice'+n

 +'" size=1 onChange="choice()">'+answers_menu+'</select>&nbsp;&nbsp;</td><td><br>'+n+'. '

 +questions[n].text+'</td>'+(n==1?answers_text:"")+'</tr>');

document.write('<tr><td colspan=3><center><input type=button value="Grade the Quiz" '

+'onClick="gradeQuiz()"><br><textarea rows=3 cols=55 name="evaluation"></textarea>'

+'</td></tr></table></form>');

// -->


