= 0)
{
var argname = pairs[i].substring(0,pos);
var value = pairs[i].substring(pos+1);
QueryString.keys[QueryString.keys.length] = argname;
QueryString.values[QueryString.values.length] = value;
}
}
}
QueryString_Parse();
//
// Answer
//
function Answer_WriteHTML()
{
document.write(' ');
document.write('' + this.text + ' ');
}
function Answer(aID)
{
this.text = "New Answer";
this.id = aID;
this.correct = false;
this.WriteHTML = Answer_WriteHTML;
}
//
// AnswerList
//
function AnswerList_NewAnswer()
{
var a = new Answer(this.sequenceID);
this.sequenceID++;
this.aList[this.aList.length] = a;
// Optional Args: text, correct
if (arguments.length > 0)
a.text = arguments[0];
if (arguments.length > 1)
a.correct = arguments[1];
if (this.editor)
this.editor.AnswerSectionUpdate();
return a;
}
function AnswerList_Remove(id)
{
for (var i=0;iQ: ' + this.text + '');
this.answerList.WriteHTML();
}
function Question_GetCorrectAnswer(text,correct)
{
var result = "";
for (var i=0;i 0)
q.text = arguments[0];
if (this.editor)
this.editor.QuestionItemsAdd(q);
return q;
}
function QuestionList_Remove(id)
{
for (var i=0;i');
if (lastQuestion!=null)
{
lastQuestion = parseInt(lastQuestion);
index = 1 + lastQuestion;
var answerID = parseInt(QueryString("answers"));
if (this.qList[lastQuestion].answerList.aList[answerID].correct)
{
document.write('
Correct!
');
ccount++;
}
else
{
var correctAnswer = this.qList[lastQuestion].GetCorrectAnswer();
document.write('
That answer was not correct.
');
document.write('
The correct answer to:
');
document.write('
' + this.qList[lastQuestion].text + '
');
document.write('
is:
');
document.write('
' + correctAnswer + '
');
}
}
if (index < this.qList.length)
{
document.write('')
this.qList[index].WriteHTML();
document.write('')
}
else
{
var score = Math.round((ccount*100)/this.qList.length);
var scoreResults = this.ScoreResults(Math.min(Math.floor(score/10),9));
document.write('
You answered ' + ccount + ' items out of ' +
this.qList.length + ' correctly.
');
document.write('
Your score is ' + score + '%. ' + scoreResults + '
');
}
document.write('')
document.write('');
}
function QuestionList_ScoreResults(index,text)
{
// Optional Args: text
if (arguments.length > 1)
{
this.scoreResults[index] = text;
}
return this.scoreResults[index];
}
function QuestionList(editor)
{
this.sequenceID = 0;
this.qList = new Array();
this.scoreResults = new Array(10);
this.editor = editor;
this.NewQuestion = QuestionList_NewQuestion;
this.Remove = QuestionList_Remove;
this.Find = QuestionList_Find;
this.WriteHTML = QuestionList_WriteHTML;
this.ScoreResults = QuestionList_ScoreResults;
}
function QuestionListValidate(theForm)
{
var validated = false;
for (var i=0;i
gQuestionList.ScoreResults(0,"Are you sure you are trying?");
gQuestionList.ScoreResults(1,"You may want to practice more.");
gQuestionList.ScoreResults(2,"You may want to practice more.");
gQuestionList.ScoreResults(3,"You may want to practice more.");
gQuestionList.ScoreResults(4,"You may want to practice more.");
gQuestionList.ScoreResults(5,"You may want to practice more.");
gQuestionList.ScoreResults(6,"Not bad.");
gQuestionList.ScoreResults(7,"Good job!");
gQuestionList.ScoreResults(8,"Great job!");
gQuestionList.ScoreResults(9,"Excellent job!");
q = gQuestionList.NewQuestion("One in _____ men will get prostate cancer in their lifetime.");
q.NewAnswer("ten",false);
q.NewAnswer("eight",false);
q.NewAnswer("six",true);
q.NewAnswer("four",false);
q = gQuestionList.NewQuestion("An annual prostate screening consists of:");
q.NewAnswer("A PSA Test and a TRUS",false);
q.NewAnswer("A PSA Test and a DRE.",true);
q.NewAnswer("A DRE and a TRUS.",false);
q.NewAnswer("A prostate biopsy.",false);
q = gQuestionList.NewQuestion("Selenium has been shown to _____ prostate cancer risk.");
q.NewAnswer("increase",false);
q.NewAnswer("decrease",true);
q.NewAnswer("have no effect on",false);
q = gQuestionList.NewQuestion("Lycopene (shown to decrease prostate cancer risk) is found in higher amounts in:");
q.NewAnswer("Cooked tomatoes in sauces",true);
q.NewAnswer("Raw tomatoes",false);
q.NewAnswer("Carrots",false);
q.NewAnswer("Green tea",false);
q = gQuestionList.NewQuestion("Regular sex that includes ejaculation _____ your prostate cancer risk. ");
q.NewAnswer("can increase",false);
q.NewAnswer("can decrease",true);
q.NewAnswer("has no effect on",false);
q = gQuestionList.NewQuestion("Early symptoms of prostate cancer include:");
q.NewAnswer("frequent urination",false);
q.NewAnswer("urinary incontinence",false);
q.NewAnswer("blood in the urine",false);
q.NewAnswer("painful urination",false);
q.NewAnswer("none of the above",true);
q = gQuestionList.NewQuestion("You are at higher risk for prostate cancer if:");
q.NewAnswer("You are asian",false);
q.NewAnswer("You are hispanic",false);
q.NewAnswer("You are black",true);
q.NewAnswer("You are caucasian",false);
q = gQuestionList.NewQuestion("A PSA test result tells you if you have prostate cancer.");
q.NewAnswer("True",false);
q.NewAnswer("False",true);
q = gQuestionList.NewQuestion("If you are a white male whose dad developed prostate cancer at 65, you should begin screening at:");
q.NewAnswer("50",false);
q.NewAnswer("45",true);
q.NewAnswer("40",false);
q.NewAnswer("35",false);
q = gQuestionList.NewQuestion("Women can develop prostate cancer");
q.NewAnswer("True",false);
q.NewAnswer("False",true);
// <-- Quiz Source End