...

View Full Version : Once clicked: The score will appear



askman
07-06-2005, 02:39 AM
I have a simple problem that I can't solve. I know that you guys might know how to solve it. I'm using an extension of dreamweaver called Coursebuilder. I'm making an online-examination to improve education especially in a far region of Asia where there's poor quality of education in there. Now, I'm making a multiplication choice type of exam with radio buttons in it and when the "check answer" was clicked, the answer will be explained. It is already done, but the problem is the feedback score. I can't make a feedback score... example the examination is 40/100 score it must appear on the screen at once after a click of a certain button. That's my only problem for now. It will be used in CD format and online. what should i do? All I need is to know how will I put a button that once it was clicked the score in the examination will appear. I'm an amateur web designer, I need your help.

Thanks please help me.

sage45
07-06-2005, 02:53 AM
A link to your site to look at your code would be helpful. :)

-sage-

askman
07-06-2005, 04:37 AM
how ??? what i mean is this..

example

1. what is .... blah blah

radio button a.) answer 1
radio button b.) answer 2
radio button c.) answer 3

(button "check answer")

2. what is blah blah ? ?(question number 2)

radio button a.) answer 1
radio button b.) answer 2
radio button c.) answer 3

(button "check answer")

3.

4.

5.

..... 50.
-----------------------

( CHECK SCORE )


then all questions will be 1-50 so to know the score in the entire examination, there should be a button "SCORE" to click and something will appear in the scren telling you of your score. What should I do? Please instruct me. This is important.

Thanks again.

sage45
07-06-2005, 06:29 PM
I'm sorry, I assumed you had something in place and it was giving you hiccups... Well your problem is easily solved using a bit of javascript, however, since javascript is a client-side construct, the people taking the quiz would be able to cheat or change their answers. If this is not a big concern for you, then javascript would be the easiest to implement...

I will move your post to the javascript forum so that they can help you over there...

-sage-

askman
07-07-2005, 02:30 AM
hey sage,
thanks for answering my posts. my problem is i don't use javascript that much. there is no concern in cheating.. that is just a self-examination. they read a book and they should know how much they have learned. All they have to do is not to count all their correct answer, there must be a way to show the score. What is the script to that ?

jscheuer1
07-07-2005, 04:16 AM
Although it was for a Quiz with a completely different type of content (a lighthearted survey), I just made a script for that in response to another question. The format should be extremely adaptable to your purposes, the script and the markup are fairly well commented for ease of use. Let me know if you need other features/modifications you cannot figure out for yourself: Quiz


- J

Or better yet, try this one


<html>
<head>
<title>State Capitols Quiz</title>
<style type="text/css">
.chkans {
margin:10px 10px -5px 0;
}

span.chkans {
position:relative;
top:5px
}

* html span.chkans {
top:2px
}
</style>
<script type="text/javascript">
/*/////////////////////////////
* Quiz Evaluation Script jscheuer1
* permission to use granted
* this credit must stay intact
/////////////////////////////*/

//Set number of questions
var numQuest=3

////////////////Stop Editing///////////////
var ie=document.all
function showAnswer(el,ans){
ie? ie[el].innerHTML='The answer is: '+ ans : document.getElementById(el).innerHTML='The answer is: '+ ans
}

function addup() {
var q, right, statement, total=0
questions=new Array();
for (i = 0; i < numQuest; i++)
questions[i]=0
if (document.forms.quiz.q1['right1']){
for (i = 0; i < numQuest; i++){
q="q"+(i+1)
right="right"+(i+1)
if (document.forms.quiz[q][right].checked)
questions[i]=1
}
}
else if (document.getElementById){
for (i = 0; i < numQuest; i++){
right="right"+(i+1)
if (document.getElementById(right).checked)
questions[i]=1
}
}
else
return;
for (i = 0; i < numQuest; i++)
total += questions[i]
/*/////////////////////////////////////////////////
Set score response below.
///////////////////Edit Below to Suit/////////////*/
statement='You scored '+ total +' out of '+ numQuest +' correct, '+ Math.round(total/numQuest*100) +'%'
/////////////////Stop Editing///////////////////
ie? ie.results.innerHTML=statement : document.getElementById('results').innerHTML=statement
}
function clearR(){
ie? ie.results.innerHTML='' : document.getElementById('results').innerHTML=''
for (i = 0; i < numQuest; i++)
ie? ie["ans"+(i+1)].innerHTML='' : document.getElementById("ans"+(i+1)).innerHTML=''
}
</script>
</head>
<body>
<h1>State Capitols Quiz</h1>
This page will tell what you know about state capitols.<br><br>
<h2>Directions:</h2>
Click on the correct answer.<br><br>
<hr>
<form name="quiz">
<!--Edit and/or add questions below-->
<!--Be sure to follow the format shown-->
Question 1:<br>
What is the capitol of Pennsylvania?<br>
<input id="right1" type="radio" unchecked name="q1"><label for="right1">Harrisburg</label><br>
<input id="w1a" type="radio" unchecked name="q1"><label for="w1a">Oswego</label><br>
<input id="w1b" type="radio" unchecked name="q1"><label for="w1b">Philadelphia</label><br>
<input id="w1c" type="radio" unchecked name="q1"><label for="w1c">Denver</label><br>
<input class="chkans" type="button" value="Check Answer" onclick="showAnswer('ans1','Harrisburg')">&nbsp;<span id="ans1" class="chkans"></span>
<br>&nbsp;<br>
Question 2:<br>
What is the capitol of New Jersey?<br>
<input id="w2a" type="radio" unchecked name="q2"><label for="w2a">Princeton</label><br>
<input id="w2b" type="radio" unchecked name="q2"><label for="w2b">North Orange</label><br>
<input id="right2" type="radio" unchecked name="q2"><label for="right2">Trenton</label><br>
<input id="w2c" type="radio" unchecked name="q2"><label for="w2c">Labrador</label><br>
<input class="chkans" type="button" value="Check Answer" onclick="showAnswer('ans2','Trenton')">&nbsp;<span id="ans2" class="chkans"></span>
<br>&nbsp;<br>
Question 3:<br>
What is the capitol of Montana?<br>
<input id="w3a" type="radio" unchecked name="q3"><label for="w3a">Billings</label><br>
<input id="right3" type="radio" unchecked name="q3"><label for="right3">Helena</label><br>
<input id="w3b" type="radio" unchecked name="q3"><label for="w3b">Shelby</label><br>
<input id="w3c" type="radio" unchecked name="q3"><label for="w3c">Tabasco</label><br>
<input class="chkans" type="button" value="Check Answer" onclick="showAnswer('ans3','Helena')">&nbsp;<span id="ans3" class="chkans"></span>
<br>&nbsp;<br>
<!--End of Questions-->
<hr><br>
<input type="button" value="See Score" onclick="addup()">&nbsp;&nbsp;<span id="results"></span><br>&nbsp;<br>
<input type="button" value="Start Again" onclick="reset();clearR()">
</form></body></html>

jscheuer1
07-07-2005, 12:48 PM
I'm just about finished modding up this script so that it will write its own answers and questions from an array, saving whoever uses it a lot of time. If interested, stay tuned to this space.

jscheuer1
07-07-2005, 03:15 PM
Here it is:


<html>
<head>
<title>State Capitols Quiz</title>

<style type="text/css">
.chkans {
margin:10px 10px -5px 0;
}

span.chkans {
position:relative;
top:5px
}

* html span.chkans {
top:2px
}
</style>

</head>
<body>
<h1>State Capitols Quiz</h1>
This page will tell what you know about state capitols.<br>
<h2>Directions:</h2>
Click on the correct answer.<br><br>

<script type="text/javascript">
/*/////////////////////////////
* Quiz Writing & Scoring Script
* 2005 John Davenport Scheuer
* jscheuer1TAKEOUTCAPSFOREMAIL@comcast.net
* permission to use granted
* this credit must stay intact
/////////////////////////////*/

//Set to 0 for no answers given away
//Set to 1 to allow peeking
var allowPeeking=1

//Set to 0 for no Starting Over without refresh
//Set to 1 to allow Easy Do Overs
var allowDoOvers=1

questions=new Array();
//Set Questions and Answers Arrays Below.
//Questions come first. Then come the answer pairs:
//Follow the right answer with "right", all wrong ones with ""
questions[0]=["What is the capitol of Pennsylvania?", "Harrisburg", "right", "Oswego", "", "Philadelphia", "", "Denver", ""]
questions[1]=["What is the capitol of New Jersey?", "Princeton", "", "North Orange", "", "Trenton", "right", "Labrador", ""]
questions[2]=["What is the capitol of Montana?", "Billings", "", "Helena", "right", "Shelby", "", "Tabasco", ""]
questions[3]=["What is the capitol of New York?", "Syracuse", "", "New York City", "", "Buffalo", "", "Albany", "right"]
questions[4]=["What is the capitol of Kansas?", "Atchison", "", "Topeka", "right", "Dodge City", "", "Manhattan", ""]
questions[5]=["Are we having fun yet?", "Yes", "right", "No", ""]

////////////////Stop Editing///////////////

for (i = 0; i < questions.length; i++){
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="")
questions[i][j]=("w"+i)+j
if (questions[i][j]=="right")
questions[i][j]="right"+i
}
}
var ie=document.all
function showAnswer(el,ans){
ie? ie[el].innerHTML='The answer is: '+ ans : document.getElementById(el).innerHTML='The answer is: '+ ans
}

function addup() {
var q, right, statement, total=0
quizQuests=new Array();
for (i = 0; i < questions.length; i++)
quizQuests[i]=0
if (document.forms.quiz.q0['right0']){
for (i = 0; i < questions.length; i++){
q="q"+i
right="right"+i
if (document.forms.quiz[q][right].checked)
quizQuests[i]=1
}
}
else if (document.getElementById){
for (i = 0; i < questions.length; i++){
right="right"+i
if (document.getElementById(right).checked)
quizQuests[i]=1
}
}
else
return;
for (i = 0; i < questions.length; i++)
total += quizQuests[i]
/*/////////////////////////////////////////////////
Set score response below.
///////////////////Edit Below to Suit/////////////*/
statement='You scored '+ total +' out of '+ questions.length +' correct, '+ Math.round(total/questions.length*100) +'%'
/////////////////Stop Editing///////////////////
ie? ie.results.innerHTML=statement : document.getElementById('results').innerHTML=statement
}
function clearR(){
ie? ie.results.innerHTML='' : document.getElementById('results').innerHTML=''
for (i = 0; i < questions.length; i++)
if (allowPeeking)
ie? ie["ans"+i].innerHTML='' : document.getElementById("ans"+i).innerHTML=''
window.scrollTo(0,0);
}
document.write('<hr><form name="quiz">')
var correct, answersString
for (i = 0; i < questions.length; i++){
answersString=''
for (k = 1; k < questions[i].length; k+=2)
answersString+='<input id="'+questions[i][(k+1)]+'" type="radio" unchecked name="q'+i+'"><label for="'+questions[i][(k+1)]+'">'+questions[i][k]+'</label><br>'
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="right"+i)
correct=questions[i][j-1]
}
with (document){
write('Question '+(i+1)+':<br>')
write(questions[i][0]+'<br>')
write(answersString)
if (allowPeeking)
write('<input class="chkans" type="button" value="Check Answer" onclick="showAnswer(\'ans'+i+'\',\''+correct+'\')">&nbsp;<span id="ans'+i+'" class="chkans"></span><br>&nbsp;')
write('<br>')
}
}
with (document){
write('<hr><br>')
write('<input type="button" value="See Score" onclick="addup()">&nbsp;&nbsp;<span id="results"></span><br>&nbsp;<br>')
if (allowDoOvers)
write('<input type="button" value="Start Again" onclick="reset();clearR()">')
write('</form>')
}
</script>

</body></html>

askman
07-08-2005, 05:27 AM
This code below is the closest one that can solve my problem:

======================


<head>
<SCRIPT LANGUAGE="JavaScript">


<!-- Begin
var ans = new Array;
var done = new Array;
var yourAns = new Array;
var explainAnswer = new Array;

var score = 0;
ans[1] = "c";
ans[2] = "b";
ans[3] = "a";
ans[4] = "c";
ans[5] = "b";

explainAnswer[1]="Answer 1 is";
explainAnswer[2]="Answer 2 is";
explainAnswer[3]="Answer 3 is";
explainAnswer[4]="Answer 4 is";
explainAnswer[5]="Answer 5 is";

function Engine(question, answer) {
yourAns[question]=answer;
}

function Score(){
var answerText = "How did you do?\n------------------------------------\n";
for(i=1;i<=5;i++){
answerText=answerText+"\nQuestion :"+i+"\n";
if(ans[i]!=yourAns[i]){
answerText=answerText+"\nThe correct answer was "+ans[i]+"\n"+explainAnswer[i]+"\n";
}
else{
answerText=answerText+" \nCorrect! \n";
score++;
}
}

answerText=answerText+"\n\nYour total score is : "+score+"\n";

//now score the user
answerText=answerText+"\nComment : ";
if(score<=40){
answerText=answerText+"You need to study";
}
if(score>=41 && score <=65){
answerText=answerText+"You did ok, but you could have scored better";
}
if(score>=66 && score <=90){
answerText=answerText+"Your study skills are good, almost perfect";
}
if(score>91){
answerText=answerText+"Your Momma would be proud";
}

alert(answerText);

}
// End -->
</script>

</HEAD>


<BODY>

<DIV ALIGN="LEFT">
<h1>Computer Test</h1>
<b>"How much do you know about computers"</b>
<hr>
<FORM>
<b>1. What is the difference between RAM and ROM?</b><br>
<input type=radio name="q1" value="a" onClick="Engine(1, this.value)">a) There is no difference<br>
<input type=radio name="q1" value="b" onClick="Engine(1, this.value)">b) RAM is volatile and ROM is non-volatile<br>
<input type=radio name="q1" value="c" onClick="Engine(1, this.value)">c) RAM is non-permanent and ROM is permanent<br>
<input type=radio name="q1" value="d" onClick="Engine(1, this.value)">d) RAM loses data when there is no electricity and ROM retains data when there is no electriciy.<p>

<b>2. Question 2 here</b><br>
<input type=radio name="q2" value="a" onClick="Engine(2, this.value)">a) Answer 2a here<br>
<input type=radio name="q2" value="b" onClick="Engine(2, this.value)">b) Answer 2b here<br>
<input type=radio name="q2" value="c" onClick="Engine(2, this.value)">c) Answer 2c here<br>
<input type=radio name="q2" value="d" onClick="Engine(2, this.value)">d) Answer 2d here<p>

<b>3. Question 3 here</b><br>
<input type=radio name="q3" value="a" onClick="Engine(3, this.value)">a) Answer 3a here<br>
<input type=radio name="q3" value="b" onClick="Engine(3, this.value)">b) Answer 3b here<br>
<input type=radio name="q3" value="c" onClick="Engine(3, this.value)">c) Answer 3c here<br>
<input type=radio name="q3" value="d" onClick="Engine(3, this.value)">d) Answer 3d here<p>

<b>4. Question 4 here</b><br>
<input type=radio name="q4" value="a" onClick="Engine(4, this.value)">a) Answer 4a here<br>
<input type=radio name="q4" value="b" onClick="Engine(4, this.value)">b) Answer 4b here<br>
<input type=radio name="q4" value="c" onClick="Engine(4, this.value)">c) Answer 4c here<br>
<input type=radio name="q4" value="d" onClick="Engine(4, this.value)">d) Answer 4d here<p>

<b>5. Question 5 here </b><br>
<input type=radio name="q5" value="a" onClick="Engine(5, this.value)">a) Answer 5a here<br>
<input type=radio name="q5" value="b" onClick="Engine(5, this.value)">b) Answer 5b here<br>
<input type=radio name="q5" value="c" onClick="Engine(5, this.value)">c) Answer 5c here<br>
<input type=radio name="q5" value="d" onClick="Engine(5, this.value)">d) Answer 5d here<p>

<CENTER>
<input type=button onClick="Score()" value="See how you scored!">
</CENTER>
</FORM>
</DIV>





but in my case, i need to explain all incorrect answers why they are incorrect, else they are right. Is there's any possibilty to make each questions to have 2 tries... then they will out of tries? This code is good almost fit and perfect to my 'project', what i need is a code where i can insert an explanation to "each" incorrect answers, comparing each of them to the right answer.. but the right answer always remain the same (for each questions. example in question 1. the correct answer remain the same).

Thanks For this! Everything is perfect except or the explanation to each incorrect answers. Because of this i'm learning a little java scripts.

Thanks a lot, again guys.

askman
07-08-2005, 10:47 AM
Please i really need this, i'm running out of time. Don't need to make 2 tries per answer if necessary. All i need is for each radio button selected, once the "check score" was selected if incorrect there i can indicate in the popup massage why he is incorrect. For each questions. Because in my sample here, They only indicate if you are correct and the right answer. Please undrestand... i need it.

Thanks

jscheuer1
07-08-2005, 12:30 PM
Well, I am working on it. I was wondering exactly how this is supposed to work though. I can make it congratulate the user if they are correct. If they are incorrect, what exactly is supposed to happen? Like for:

Question:
What part of the USA is New York State in?
1) Mid-Atlantic Region
2) South
3) Western Coastal Area

If they are right, we say Great, you are right. If they are wrong, does it have to say one thing if they picked South and another thing if they picked #3? Will there be more than one wrong answer? If so, do multiple advisories have to be available, one for each wrong choice or can it just be, for example for the above can it be:

"No, New York State is not in that part of the USA it is in the Mid-Atlantic Region"

?

Now, I just ran the code that you posted, it will never work for 50 questions as you mentioned before, the pop up box will be off the screen, being to large too read. Pop ups of this nature are not scrollable.

Here is a link to the latest:
New Quiz (http://home.comcast.net/~jscheuer1/side/quiz5a.htm)

jscheuer1
07-08-2005, 11:53 PM
You seem like you are in such a hurry, odd you haven't gotten back to me. Anyways, this one will probably suit you, I hope. Normally I wouldn't put this out there without taking the time to clean it up a bit more, however you seem rushed, it works bug free (as far as I can tell) in FF1.0.4 and IE6 (my previous efforts were a bit more backwards compatible), so here you go:


<html>
<head>
<title>State Capitols Quiz</title>

<style type="text/css">
.chkans {
margin:10px 10px -5px 0;
}

span.chkans {
position:relative;
top:5px
}

* html span.chkans {
top:2px
}
</style>

</head>
<body>
<h1>State Capitols Quiz</h1>
This page will tell what you know about state capitols.<br>
<h2>Directions:</h2>
Click on the correct answer.
<span id="peek"></span><br><br>

<script type="text/javascript">
/*/////////////////////////////
* Quiz Writing & Scoring Script
* 2005 John Davenport Scheuer
* jscheuer1TAKEOUTCAPSFOREMAIL@comcast.net
* permission to use granted
* this credit must stay intact
/////////////////////////////*/

/*Set to 0 for no answers given away
Set to 1 to allow peeking */
var allowPeeking=1

/*Set to 0 for no Starting Over without refresh
Set to 1 to allow Easy Do Overs */
var allowDoOvers=1

/*Configure the text portions of the "You scored" statement. Format is -
scoreStr1 "number right" scoreStr2 "total number of questions" scoreStr3 "percentage score" scoreStr4
Leave unchanged for default (You scored 6 out of 6 correct, 100%) */
var scoreStr1='You scored<span style="color:blue;">'
var scoreStr2='</span>out of<span style="color:blue;padding-left:.25ex;">'
var scoreStr3='</span>correct,<span style="color:blue;">'
var scoreStr4='</span>'

questions=new Array(); // <<<< do not edit or remove this line!
/*
Set Question and Answers Arrays Below.
Questions come first. Then come the answer pairs:
Follow the right answer with "right", all wrong ones with ""
The final entry is the wrong answer string, to be shown when peeking if the answer is wrong.
Example:
questions[x]=["Do fish swim in the sea?", "Yes", "right", "No", "", "No, Fish really do swim in the sea"]
single quotes (') must be double escaped (\\) ex: "That\\'s right!"
double quotes (") must be named (&quot;) ex: "He referred to himself as &quot;King Louie&quot;"
*/
questions[0]=["What is the capitol of Pennsylvania?", "Harrisburg", "right", "Oswego", "", "Philadelphia", "", "Denver", "", "That is not the capitol of Pennsylvania, Harrisburg is."]
questions[1]=["What is the capitol of New Jersey?", "Princeton", "", "North Orange", "", "Trenton", "right", "Labrador", "", "That is not the capitol of New Jersey, Trenton is."]
questions[2]=["What is the capitol of Montana?", "Billings", "", "Helena", "right", "Shelby", "", "Tabasco", "", "That is not the capitol of Montana, Helena is."]
questions[3]=["What is the capitol of New York?", "Syracuse", "", "New York City", "", "Buffalo", "", "Albany", "right", "That is not the capitol of New York, Albany is."]
questions[4]=["What is the capitol of Kansas?", "Atchison", "", "Topeka", "right", "Dodge City", "", "Manhattan", "", "That is not the capitol of Kansas, Topeka is."]
questions[5]=["Are we having fun yet?", "Yes", "right", "No", "", "Aw c\\'mon, aren\\'t you having fun?"]
questions[6]=["Do fish &quot;swim&quot; in the sea?", "Yes", "right", "No", "", "Fish really do &quot;swim&quot; in the sea."]

////////////////Stop Editing///////////////

for (i = 0; i < questions.length; i++){
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="")
questions[i][j]=("w"+i)+j
if (questions[i][j]=="right")
questions[i][j]="right"+i
}
}
var ie=document.all
var moz=(document.getElementById&&!document.all)? 1 : 0
var selq, report
if (allowPeeking)
ie? ie.peek.innerHTML='<br>Use the "Check Answer" buttons to see how you are doing.' : document.getElementById('peek').innerHTML='<br>Use the "Check Answer" buttons to see how you are doing.'
function showAnswer(el,ans){
ie? ie[el].innerHTML=selq+' is: '+ ans : document.getElementById(el).innerHTML=selq+' is: '+ ans
}

function getSelect(quest){
selq='NO ANSWER,'
selTest=document.getElementsByTagName('input')
for (i = 0; i < selTest.length; i++)
if (selTest[i].name==quest&&selTest[i].checked)
selq=selTest[i].value+','
}

function addup() {
report='<input type="button" value="Return to Quiz" style="margin:0 0 10px 20px;" onclick="history.go(-1)"><br>'
var q, right, statement, total=0
quizQuests=new Array();
for (i = 0; i < questions.length; i++)
quizQuests[i]=0
if (document.forms.quiz.q0['right0']){
for (i = 0; i < questions.length; i++){
q="q"+i
right="right"+i
if (document.forms.quiz[q][right].checked)
quizQuests[i]=1
//alert(report)
}
}
else if (document.getElementById){
for (i = 0; i < questions.length; i++){
right="right"+i
if (document.getElementById(right).checked)
quizQuests[i]=1
}
}
else
return;
var sq
for (i = 0; i < questions.length; i++){
total += quizQuests[i]
//alert(quizQuests[i])
q="q"+i
selq='No Answer'
selTest=document.getElementsByTagName('input')
for (j = 0; j < selTest.length; j++)
if (selTest[j].name==q&&selTest[j].checked)
selq=selTest[j].value
right="right"+i
report+="Question"+(i+1)+":<br>"+questions[i][0]+"<br>Your Answer: "+selq+"<br>Correct Answer: "+document.getElementById(right).value+"<br>Points: "+quizQuests[i]+"<br><br>"
}
var prcnt=Math.round(total/questions.length*100)
report+='Total Points: '+total+' out of &nbsp;'+ questions.length +', for a score of: ' +prcnt+'% &nbsp;'
if (prcnt<=50)
report+='Very Poor, Your study skills need improving.'
else if (prcnt<=60)
report+='Poor, spend more time studying.'
else if (prcnt<=70)
report+='Not too Bad, you need to study more often.'
else if (prcnt<=80)
report+='Good, with a little more work you could be really proud.'
else if (prcnt<=90)
report+='Very Good, you are still missing a few.'
else if (prcnt<=100)
report+='Excellent, which question(s) did you miss?'
else if (prcnt==100)
report+='Perfect, you should be really proud!'
report+='<br><input type="button" value="Return to Quiz" style="margin:10px 0 0 20px;" onclick="history.go(-1)">'
statement=scoreStr1 +' '+ total +' '+ scoreStr2 +' '+ questions.length +' '+ scoreStr3 +' '+ prcnt +'% '+ scoreStr4 +' &nbsp; &nbsp;<input type="button" value="See Details" onclick="document.write(report);document.close()">'
ie? ie.results.innerHTML=statement : document.getElementById('results').innerHTML=statement
}
function clearR(){
ie? ie.results.innerHTML='' : document.getElementById('results').innerHTML=''
for (i = 0; i < questions.length; i++)
if (allowPeeking)
ie? ie["ans"+i].innerHTML='' : document.getElementById("ans"+i).innerHTML=''
window.scrollTo(0,0);
}
document.write('<hr><form name="quiz">')
var correct, incorrect, answersString
for (i = 0; i < questions.length; i++){
answersString=''
for (k = 1; k < questions[i].length-1; k+=2)
answersString+='<input id="'+questions[i][(k+1)]+'" type="radio" unchecked value="'+questions[i][k]+'" name="q'+i+'"><label for="'+questions[i][(k+1)]+'">'+questions[i][k]+'</label><br>'
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="right"+i)
correct=questions[i][j-1]
incorrect=questions[i][questions[i].length-1]
}
with (document){
write('Question '+(i+1)+':<br>')
write(questions[i][0]+'<br>')
write(answersString)
if (allowPeeking)
write('<input class="chkans" type="button" value="Check Answer" name="q'+i+'" onclick="getSelect(\'q'+i+'\');if (moz? document.getElementById(\'right'+i+'\').checked : ie? ie.right'+i+'.checked: 0==1) {showAnswer(\'ans'+i+'\',\' Correct!\')}else if (moz||ie) {showAnswer(\'ans'+i+'\',\'Incorrect! '+ incorrect +'\')}">&nbsp;<span id="ans'+i+'" class="chkans"></span><br>&nbsp;')
write('<br>')
}
}
with (document){
write('<hr><br>')
write('<input type="button" value="See Score" onclick="addup()">&nbsp;&nbsp;<span id="results"></span><br>&nbsp;<br>')
if (allowDoOvers)
write('<input type="button" value="Start Again" onclick="reset();clearR()">')
write('</form>')
}
</script>

</body></html>

wallacer
07-09-2005, 12:55 AM
do you have a function that detects correct and incorrect answers already? From what I understand of your problem you do, and all you need is a way to add a button that shows how many are correct?

Well if that's it, make sure you have a count to keep a tally of correct answers. Then somewhere in the html (where you want score to appear) insert something like this:


<form name="displayscore" onsubmit = "0">
<input type="text" name="score" style="border:0 width: 350"/>
</form>
<form = action "">
<input type = "button" name="b1" value="CheckScore" onClick="showScore()"/>
</form>


You can add changes to the syle of the input box to suit your needs widthwise/background color etc.

Then you need a scoreDisplay() javascript function that would contain the value for the number of correct answers. Insert something like this into the HEAD of your html file.


<script language="javascript">
var scorecount, totalquestions, display;
showScore()
{
display = "Your Score is"+scorecount+"/"+totalquestions;
document.displayscore.score.value = display;
}
</script>

I hope that helps you :) , Good luck,

Wallacer

askman
07-09-2005, 04:09 PM
this is too much guys! but i want to say THANK YOU very much! you are a great help. This one can actually do it..... i can use it already for my project... i can say 99% perfect. (The last code, the one with "see details") If possible can it be a 2 trial test for each question? example if they choose 1st incorrect... it will show why it is incorrect. now if they choose 2nd,then after the "check button" was clicked it will show why it is incorrect and he can never try again (for that question) a popup message will appear "Sorry you are out of tries"... if they refresh the page they can try again...that doesn't matter... but each question should be limited to 2 tries... BUT THANKS SO MUCH FOR THIS. that will do. :)

because of this i'm now interested in learning java scripts.. i hope i can learn more so i can contribute to your forum in the future hehe :rolleyes:

jscheuer1
07-10-2005, 09:13 AM
OK, I've got the two tries thing down. Actually, it and a lot of the features of this quiz are configurable as documented in the beginning part of the script. I've also upgraded the report so it looks nicer and takes up less screen real estate. I had to institute an onload event for Mozilla based browsers but, since this is or should generally be a stand alone page (not featured as a part of some other complex page except through a frame) that should be no problem. Here is the latest, v.5a2:


<html>
<head>
<title>State Capitols Quiz</title>

<style type="text/css">
.chkans {
margin:10px 10px -5px 0;
}

span.chkans {
position:relative;
top:5px
}

* html span.chkans {
top:2px
}
</style>

</head>
<body>
<h1>State Capitols Quiz</h1>
This page will tell what you know about state capitols.<br>
<h2>Directions:</h2>
Click on the correct answer.
<span id="peek"></span><br><br>

<script type="text/javascript">
/*/////////////////////////////
* Quiz Writing & Scoring Script v.5a2
* 2005 John Davenport Scheuer
* jscheuer1TAKEOUTCAPSFOREMAIL@comcast.net
* permission to use granted
* this credit must stay intact
/////////////////////////////*/

/*Set to number of peeks allowed per
question. Set to (0) for no peeking */
var tryLimit=2

/*Set disable peeking style, (0) for
disable 'Check Answer' button only,
(1) for disable entire question. */
var disablePeekStyle=1

/*Set to 0 for no Starting Over without refresh
Set to 1 to allow Easy Do Overs */
var allowDoOvers=1

/*Set Report Style */
var reportStyle="background:lightblue;font-family:arial;font-weight:bold;font-size:.85em;color:navy;"

/*Set Report Columns */
var reportColumns=4

/*Set number of Return from Report buttons, (0) for one return
button at the bottom, (1) for added return button at top,
good for long quizzes. */
var dualReturn=1

questions=new Array(); // <<<< do not edit or remove this line!
/*
Set Question and Answers Arrays Below.
Questions come first. Then come the answer pairs:
Follow the right answer with "right", all wrong ones with ""
The final entry is the wrong answer string*, to be shown when peeking if the answer is wrong.
Example:
questions[x]=["Do fish swim in the sea?", "Yes", "right", "No", "", "Fish really do swim in the sea"]
single quotes (') must be double escaped (\\) ex: "That\\'s right!" *in the wrong answer string only*.
double quotes (") must be named (&quot;) ex: "He referred to himself as &quot;King Louie&quot;"
*/
questions[0]=["What is the capitol of Pennsylvania?", "Harrisburg", "right", "Oswego", "", "Philadelphia", "", "Denver", "", "That is not the capitol of Pennsylvania, Harrisburg is."]
questions[1]=["What is the capitol of New Jersey?", "Princeton", "", "North Orange", "", "Trenton", "right", "Labrador", "", "That is not the capitol of New Jersey, Trenton is."]
questions[2]=["What is the capitol of Montana?", "Billings", "", "Helena", "right", "Shelby", "", "Tabasco", "", "That is not the capitol of Montana, Helena is."]
questions[3]=["What is the capitol of New York?", "Syracuse", "", "New York City", "", "Buffalo", "", "Albany", "right", "That is not the capitol of New York, Albany is."]
questions[4]=["What is the capitol of Kansas?", "Atchison", "", "Topeka", "right", "Dodge City", "", "Manhattan", "", "That is not the capitol of Kansas, Topeka is."]
questions[5]=["Are we having fun yet?", "Yes", "right", "No", "", "Aw c\\'mon, aren\\'t you having fun?"]
questions[6]=["Do fish &quot;swim&quot; in the sea?", "Yes", "right", "No", "", "Fish really do &quot;swim&quot; in the sea."]

/*Configure the text portions of the "You scored" statement. Format is -
scoreStr1 "number right" scoreStr2 "total number of questions" scoreStr3 "percentage score" scoreStr4
Leave unchanged for default (You scored 6 out of 6 correct, 100%) */
var scoreStr1='You scored<span style="color:blue;">'
var scoreStr2='</span>out of<span style="color:blue;padding-left:.25ex;">'
var scoreStr3='</span>correct,<span style="color:blue;">'
var scoreStr4='</span>'

////////////////Stop Editing///////////////

for (i = 0; i < questions.length; i++){
eval('var tries'+i+'=0')
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="")
questions[i][j]=("w"+i)+j
if (questions[i][j]=="right")
questions[i][j]="right"+i
}
}
var ie=document.all
var moz=(document.getElementById&&!document.all)? 1 : 0
var selq, report, allowPeeking
tryLimit>0? allowPeeking=1 : allowPeeking=0
document.getElementsByTagName? allowPeeking=allowPeeking : allowPeeking=0
if (allowPeeking){
var tryLimitV=['', '<u>one</u>', '<u>two</u>', '<u>three</u>', '<u>four</u>', '<u>five</u>', '<u>six</u>']
tryLimitV[tryLimit]==undefined? tryLimitV[tryLimit]='<b>'+tryLimit+'</b>' : tryLimitV[tryLimit]=tryLimitV[tryLimit];
ie? ie.peek.innerHTML='<br>Use the "Check Answer" buttons to see how you are doing.<br>Only '+tryLimitV[tryLimit]+' Check Answer\'s per question allowed.' : document.getElementById('peek').innerHTML='<br>Use the "Check Answer" buttons to see how you are doing.<br>Only '+tryLimitV[tryLimit]+' Check Answer\'s per question allowed.'
}

function showAnswer(el,ans,tryVar){
if (tryVar!==undefined){
if (eval('tries'+tryVar)>=tryLimit){
alert ('Sorry, only '+tryLimit+' Check Answer\'s per question.')
rbuts=document.getElementsByTagName('input')
for (j = 0; j < rbuts.length; j++)
if ((!disablePeekStyle)&&rbuts[j].name=='q'+tryVar&&rbuts[j].type!=='radio')
rbuts[j].disabled=1
else if (disablePeekStyle&&rbuts[j].name=='q'+tryVar)
rbuts[j].disabled=1
ie? ie[el].innerHTML='' : document.getElementById(el).innerHTML=''
return;
}
eval ('tries'+tryVar+'++')
}
ie? ie[el].innerHTML=selq+' is: '+ ans : document.getElementById(el).innerHTML=selq+' is: '+ ans
}

function getSelect(quest){
selq='NO ANSWER,'
selTest=document.getElementsByTagName('input')
for (i = 0; i < selTest.length; i++)
if (selTest[i].name==quest&&selTest[i].checked)
selq=selTest[i].value+','
}

function addup() {
var topReturn=''
if (dualReturn)
topReturn='<input type="button" value="Return to Quiz" style="margin:0 0 10px 20px;" onclick="history.go(-1)"><br>'
report='<html><head><title>'+document.title+' - Your Results</title></head><body style="'+reportStyle+'"><h3>'+document.title+' - Your Results:</h3>'+topReturn+'<table align="center" cellpadding="10" style="'+reportStyle+'"><tr>'
var q, right, statement, total=0
quizQuests=new Array();
for (i = 0; i < questions.length; i++)
quizQuests[i]=0
if (document.forms.quiz.q0['right0']){
for (i = 0; i < questions.length; i++){
q="q"+i
right="right"+i
if (document.forms.quiz[q][right].checked)
quizQuests[i]=1
}
}
else if (document.getElementById){
for (i = 0; i < questions.length; i++){
right="right"+i
if (document.getElementById(right).checked)
quizQuests[i]=1
}
}
else
return;
for (i = 0; i < questions.length; i++)
total += quizQuests[i]
var seeDetails=''
if (document.getElementsByTagName){
for (i = 0; i < questions.length; i++){
q="q"+i
selq='No Answer'
selTest=document.getElementsByTagName('input')
for (j = 0; j < selTest.length; j++)
if (selTest[j].name==q&&selTest[j].checked)
selq=selTest[j].value
right="right"+i
if (i%reportColumns==0)
report+='</tr><tr>'
report+="<td>Question "+(i+1)+":<br>"+questions[i][0]+"<br>Your Answer: "+selq+"<br>Correct Answer: "+document.getElementById(right).value+"<br>Points: "+quizQuests[i]+"</td>"
}
var prcnt=Math.round(total/questions.length*100)
report+='</tr></table><br>Total Points: '+total+' out of &nbsp;'+ questions.length +', for a score of: ' +prcnt+'% &nbsp; '
if (prcnt<=50)
report+='Very&nbsp;Poor.&nbsp; <nobr>Your study skills need improving.</nobr>'
else if (prcnt<=60)
report+='Poor.&nbsp; <nobr>Spend more time studying.</nobr>'
else if (prcnt<=70)
report+='Not&nbsp;Too&nbsp;Bad.&nbsp; <nobr>You need to study more often.</nobr>'
else if (prcnt<=80)
report+='Good.&nbsp; <nobr>With a little more work you could be really proud.</nobr>'
else if (prcnt<=90)
report+='Very&nbsp;Good!&nbsp; <nobr>You still missed one or more questions, study a little more.</nobr>'
else if (prcnt<=99)
report+='Excellent!&nbsp; <nobr>Which question(s) did you miss?</nobr>'
else if (prcnt==100)
report+='Perfect!&nbsp; <nobr>You should be really proud!</nobr>'
report+='<br><br><input type="button" value="Return to Quiz" style="margin:10px 0 0 20px;" onclick="history.go(-1)"></body></html>'
seeDetails='<input type="button" value="See Details" onclick="document.write(report);document.close()">'
}
statement=scoreStr1 +' '+ total +' '+ scoreStr2 +' '+ questions.length +' '+ scoreStr3 +' '+ prcnt +'% '+ scoreStr4 +' &nbsp; &nbsp;'+seeDetails
ie? ie.results.innerHTML=statement : document.getElementById('results').innerHTML=statement
}
function clearR(){
ie? ie.results.innerHTML='' : document.getElementById('results').innerHTML=''
for (i = 0; i < questions.length; i++)
if (allowPeeking){
eval('tries'+i+'=0')
ie? ie["ans"+i].innerHTML='' : document.getElementById("ans"+i).innerHTML=''
inputs=document.getElementsByTagName('input')
for (i = 0; i < inputs.length; i++)
inputs[i].disabled=0
}
window.scrollTo(0,0);
}
document.write('<hr><form name="quiz">')
var correct, incorrect, answersString
for (i = 0; i < questions.length; i++){
answersString=''
for (k = 1; k < questions[i].length-1; k+=2){
var peekRemove=(allowPeeking)? ' onmousedown="document.getElementById(\'ans'+i+'\').innerHTML=\'\'"' : ''
answersString+='<input id="'+questions[i][(k+1)]+'" type="radio" value="'+questions[i][k]+'" name="q'+i+'"'+peekRemove+'><label for="'+questions[i][(k+1)]+'"'+peekRemove+'>'+questions[i][k]+'</label><br>'
}
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="right"+i)
correct=questions[i][j-1]
incorrect=questions[i][questions[i].length-1]
}
with (document){
write('Question '+(i+1)+':<br>')
write(questions[i][0]+'<br>')
write(answersString)
if (allowPeeking)
write('<input class="chkans" type="button" value="Check Answer" name="q'+i+'" onclick="getSelect(\'q'+i+'\');if (moz? document.getElementById(\'right'+i+'\').checked : ie? ie.right'+i+'.checked: 0==1) {showAnswer(\'ans'+i+'\',\' Correct!\','+i+')}else if (moz||ie) {showAnswer(\'ans'+i+'\',\'Incorrect! '+ incorrect +'\','+i+')}">&nbsp;<span id="ans'+i+'" class="chkans"></span><br>&nbsp;')
write('<br>')
}
}
with (document){
write('<hr><br>')
write('<input type="button" value="See Score" onclick="addup()">&nbsp;&nbsp;<span id="results"></span><br>&nbsp;<br>')
if (allowDoOvers)
write('<input type="button" value="Start Again" onclick="reset();clearR()">')
write('</form>')
}
if (moz&&document.getElementsByTagName&&allowPeeking){
window.onload=function(){
inputs=document.getElementsByTagName('input')
for (i = 0; i < inputs.length; i++)
inputs[i].disabled=0
}
}
</script></body></html>

askman
07-10-2005, 09:31 AM
what it is that i need to change so i can make the questions longer than 10? I'm making the quiz already but my questions are up to 14. i stopped here: questions[10] i don't know how to make it more than 10. When u click question number 11 (since the count started in "0"), when u clicked "Check Answer" there's nothing in there. why?

Ok Help me please. you know the code... :)

Willy Duitt
07-10-2005, 10:38 AM
what it is that i need to change so i can make the questions longer than 10? I'm making the quiz already but my questions are up to 14. i stopped here: questions[10] i don't know how to make it more than 10. When u click question number 11 (since the count started in "0"), when u clicked "Check Answer" there's nothing in there. why?

Ok Help me please. you know the code... :)

Gheesh... Can I work for you for nothing also??
Please i really need this, i'm running out of time.

LOL

jscheuer1
07-10-2005, 11:17 AM
Pretty Funny, Willy. Anyways, generally that is a problem in not following the rules/template in setting up the array. As an example, I just now copied over my original 7 questions so I now have 14, still working fine. If you cannot see where you left out a quote, comma a bracket, or forgot to use a named entity or escape as instructed, post your code and I'll find it for you. Easiest way is to remove questions one at a time from the bottom of the array, once it starts working again, the one you just removed contains the error.

Willy Duitt
07-10-2005, 11:27 AM
Pretty Funny, Willy.

I'm glad you can appreciate my humor... Not many do...
But, I've been following this and it's beginning to seem that there is no end in sight... I for one would like to see the O/P extend himself a little bit rather than continue to return and making further demands without providing any code to indicate that he/she has learned anything... Unless of course I missed something...

.....Willy

askman
07-10-2005, 11:42 AM
i think the problem is in here: in question number [1] once you clicked the "check answer" there's no display but in question [0] and [2] there is...

questions[0]=["What is an instructional supervisory conference?", "a. it\'s a face to face meeting with the teacher after a teaching-learning episode.", "right", "b. it\'s a chance to give teachers feedback on what to improve on.", "", " c. it\'s a supervisory to affirm the work of the teacher.", "", "d. it\'s an instrument for evaluating teacher performance. ", "", "<br><br>If Your Answer is: <br>b. This is partially correct. Aside from knowing of what will be improved, the teacher also reacieve a congratulatory remark from his/her school head for a job well done.<br><br>c. This is partially correct. Aside from affirming good behavior and practices, the teacher and the school head discuss those behavior and practices that need modification.<br><br>d. This is partially correct. The main purpose of an instructional supervisory conference is to improve instruction. You need several classroom visits before you can objectively rate him/her on the aspect of teaching competence.<br><br>The Correct Answer is<br>a. This is the best answer. The teacher and the school head have to meet to discuss what happened during the classroom visit. They will focus on the strengths and weaknesses of the teacher for possible reinforcement and redirection as the case may be.<br>"]

questions[1]=["What is the primary purpose of an instructional supervisory conference?", "a. to improve instruction", "right", "b. to evaluate a teacher\'s performance.", "", " c. to demonstrate effective learning strategies", "", "d. to give the teacher advice ", "", "<br><br>If Your Answer is: <br>b. Partially correct. This is only secondary consideration, when you do classroom visitation. <br><br>c. Partially correct. Showing effective teaching strategies is good especially if it\'s a demonstration lesson. This can be done for the benefit of new teachers. Again this is not the primary purpose of an instructional supervisory conference. <br><br>d. Partially correct. Advice may no recieve favorably by the teacher. Practices/behavior to be improved should be supported by evidences gathered during the observation. We guide the teacher to analyze the data and the situation. <br><br>The Correct Answer is<br>a. This is the best answer. The primary purpose of an instructional supervisory conference is to improve instruction<br>" ]

questions[2]=["As instructional leaders, how would you motivate teachers to welcome you to their classrooms? ", "a. tell them that it is your duty to observe tham any time.", "", "b. show them the memorandum that observing classes is one of your functions.", "", "c. inform them that you are only interested in the result of instruction.", "right", "d. explain to them that your primary purpose is to help them improve instruction and nothing personal.", "", "<br><br>If Your Answer is: <br>a. Incorrect. The teacher is only one of the actors. He/she has to work with the school head.<br><br>b. Incorrect. The school head assists the teacher to see himself/herself in the post conference.<br><br>d. Incorrect. In the post conference, the pupils are the subject of deliberations, whether they learned the lesson or not. However, they are not the principal actors in the conference. <br><br>The Correct Answer is<br>c. The teacher and the school head should work collaboratively during the post conference. <br>"]







Directions:</h4>
<p>Click on the correct answer. <span id="peek"></span><br>
<br>
<script type="text/javascript">
/*/////////////////////////////
* Quiz Writing & Scoring Script
* 2005 John Davenport Scheuer
* jscheuer1TAKEOUTCAPSFOREMAIL@comcast.net
* permission to use granted
* this credit must stay intact
/////////////////////////////*/

/*Set to 0 for no answers given away
Set to 1 to allow peeking */
var allowPeeking=1

/*Set to 0 for no Starting Over without refresh
Set to 1 to allow Easy Do Overs */
var allowDoOvers=1

/*Configure the text portions of the "You scored" statement. Format is -
scoreStr1 "number right" scoreStr2 "total number of questions" scoreStr3 "percentage score" scoreStr4
Leave unchanged for default (You scored 6 out of 6 correct, 100%) */
var scoreStr1='You scored<span style="color:blue;">'
var scoreStr2='</span>out of<span style="color:blue;padding-left:.25ex;">'
var scoreStr3='</span>correct,<span style="color:blue;">'
var scoreStr4='</span>'

questions=new Array(); // <<<< do not edit or remove this line!
/*
Set Question and Answers Arrays Below.
Questions come first. Then come the answer pairs:
Follow the right answer with "right", all wrong ones with ""
The final entry is the wrong answer string, to be shown when peeking if the answer is wrong.
Example:
questions[x]=["Do fish swim in the sea?", "Yes", "right", "No", "", "No, Fish really do swim in the sea"]
single quotes (') must be double escaped (\\) ex: "That\\'s right!"
double quotes (") must be named (&quot;) ex: "He referred to himself as &quot;King Louie&quot;"
*/
questions[0]=["What is an instructional supervisory conference?", "a. it\'s a face to face meeting with the teacher after a teaching-learning episode.", "right", "b. it\'s a chance to give teachers feedback on what to improve on.", "", " c. it\'s a supervisory to affirm the work of the teacher.", "", "d. it\'s an instrument for evaluating teacher performance. ", "", "<br><br>If Your Answer is: <br>b. This is partially correct. Aside from knowing of what will be improved, the teacher also reacieve a congratulatory remark from his/her school head for a job well done.<br><br>c. This is partially correct. Aside from affirming good behavior and practices, the teacher and the school head discuss those behavior and practices that need modification.<br><br>d. This is partially correct. The main purpose of an instructional supervisory conference is to improve instruction. You need several classroom visits before you can objectively rate him/her on the aspect of teaching competence.<br><br>The Correct Answer is<br>a. This is the best answer. The teacher and the school head have to meet to discuss what happened during the classroom visit. They will focus on the strengths and weaknesses of the teacher for possible reinforcement and redirection as the case may be.<br>"]
questions[1]=["What is the primary purpose of an instructional supervisory conference?", "a. to improve instruction", "right", "b. to evaluate a teacher\'s performance.", "", " c. to demonstrate effective learning strategies", "", "d. to give the teacher advice ", "", "<br><br>If Your Answer is: <br>b. Partially correct. This is only secondary consideration, when you do classroom visitation. <br><br>c. Partially correct. Showing effective teaching strategies is good especially if it\'s a demonstration lesson. This can be done for the benefit of new teachers. Again this is not the primary purpose of an instructional supervisory conference. <br><br>d. Partially correct. Advice may no recieve favorably by the teacher. Practices/behavior to be improved should be supported by evidences gathered during the observation. We guide the teacher to analyze the data and the situation. <br><br>The Correct Answer is<br>a. This is the best answer. The primary purpose of an instructional supervisory conference is to improve instruction<br>" ]
questions[2]=["As instructional leaders, how would you motivate teachers to welcome you to their classrooms? ", "a. tell them that it is your duty to observe tham any time.", "", "b. show them the memorandum that observing classes is one of your functions.", "", "c. inform them that you are only interested in the result of instruction.", "right", "d. explain to them that your primary purpose is to help them improve instruction and nothing personal.", "", "<br><br>If Your Answer is: <br>a. Incorrect. The teacher is only one of the actors. He/she has to work with the school head.<br><br>b. Incorrect. The school head assists the teacher to see himself/herself in the post conference.<br><br>d. Incorrect. In the post conference, the pupils are the subject of deliberations, whether they learned the lesson or not. However, they are not the principal actors in the conference. <br><br>The Correct Answer is<br>c. The teacher and the school head should work collaboratively during the post conference. <br>"]


////////////////Stop Editing///////////////

for (i = 0; i < questions.length; i++){
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="")
questions[i][j]=("w"+i)+j
if (questions[i][j]=="right")
questions[i][j]="right"+i
}
}
var ie=document.all
var moz=(document.getElementById&&!document.all)? 1 : 0
var selq, report
if (allowPeeking)
ie? ie.peek.innerHTML='<br>Use the "Check Answer" buttons to see how you are doing.' : document.getElementById('peek').innerHTML='<br>Use the "Check Answer" buttons to see how you are doing.'
function showAnswer(el,ans){
ie? ie[el].innerHTML=selq+' is: '+ ans : document.getElementById(el).innerHTML=selq+' is: '+ ans
}

function getSelect(quest){
selq='NO ANSWER,'
selTest=document.getElementsByTagName('input')
for (i = 0; i < selTest.length; i++)
if (selTest[i].name==quest&&selTest[i].checked)
selq=selTest[i].value+','
}

function addup() {
report='<center><input type="button" value="Return to examination" style="margin:0 0 10px 20px;" onclick="history.go(-1)"></center><body bgcolor="#FFFFCC"><br>'
var q, right, statement, total=0
quizQuests=new Array();
for (i = 0; i < questions.length; i++)
quizQuests[i]=0
if (document.forms.quiz.q0['right0']){
for (i = 0; i < questions.length; i++){
q="q"+i
right="right"+i
if (document.forms.quiz[q][right].checked)
quizQuests[i]=1
//alert(report)
}
}
else if (document.getElementById){
for (i = 0; i < questions.length; i++){
right="right"+i
if (document.getElementById(right).checked)
quizQuests[i]=1
}
}
else
return;
var sq
for (i = 0; i < questions.length; i++){
total += quizQuests[i]
//alert(quizQuests[i])
q="q"+i
selq='No Answer'
selTest=document.getElementsByTagName('input')
for (j = 0; j < selTest.length; j++)
if (selTest[j].name==q&&selTest[j].checked)
selq=selTest[j].value
right="right"+i
report+="Question"+(i+1)+":<br>"+questions[i][0]+"<br>Your Answer: "+selq+"<br>Correct Answer: "+document.getElementById(right).value+"<br>Points: "+quizQuests[i]+"<br><br>"
}
var prcnt=Math.round(total/questions.length*100)
report+='Total Points: '+total+' out of &nbsp;'+ questions.length +', for a score of: ' +prcnt+'% &nbsp;'
if (prcnt<=50)
report+='Score D: Very Poor, Your study skills need improving.'
else if (prcnt<=60)
report+='Score D: Poor, spend more time studying.'
else if (prcnt<=70)
report+='Score C: Not too Bad, you need to study more often.'
else if (prcnt<=80)
report+='Score B: Good, with a little more work you could be really proud.'
else if (prcnt<=90)
report+='Score A: Very Good, you are still missing a few.'
else if (prcnt<=100)
report+='Score A: Excellent, which question(s) did you miss?'
else if (prcnt==100)
report+='Score A: Perfect, you should be really proud!'
report+='<br><center><input type="button" value="Return to the examination" style="margin:10px 0 0 20px;" onclick="history.go(-1)"></center> <br><i>Conduct A Post Supervisory Conference</i>'
statement=scoreStr1 +' '+ total +' '+ scoreStr2 +' '+ questions.length +' '+ scoreStr3 +' '+ prcnt +'% '+ scoreStr4 +' &nbsp; &nbsp;<input type="button" value="See Details" onclick="document.write(report);document.close()">'
ie? ie.results.innerHTML=statement : document.getElementById('results').innerHTML=statement
}
function clearR(){
ie? ie.results.innerHTML='' : document.getElementById('results').innerHTML=''
for (i = 0; i < questions.length; i++)
if (allowPeeking)
ie? ie["ans"+i].innerHTML='' : document.getElementById("ans"+i).innerHTML=''
window.scrollTo(0,0);
}
document.write('<hr><form name="quiz">')
var correct, incorrect, answersString
for (i = 0; i < questions.length; i++){
answersString=''
for (k = 1; k < questions[i].length-1; k+=2)
answersString+='<input id="'+questions[i][(k+1)]+'" type="radio" unchecked value="'+questions[i][k]+'" name="q'+i+'"><label for="'+questions[i][(k+1)]+'">'+questions[i][k]+'</label><br>'
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="right"+i)
correct=questions[i][j-1]
incorrect=questions[i][questions[i].length-1]
}
with (document){
write('Question '+(i+1)+':<br>')
write(questions[i][0]+'<br>')
write(answersString)
if (allowPeeking)
write('<input class="chkans" type="button" value="Check Answer" name="q'+i+'" onclick="getSelect(\'q'+i+'\');if (moz? document.getElementById(\'right'+i+'\').checked : ie? ie.right'+i+'.checked: 0==1) {showAnswer(\'ans'+i+'\',\' 1 point! Correct.\')}else if (moz||ie) {showAnswer(\'ans'+i+'\',\'0 point! either incorrect or partly correct '+ incorrect +'\')}">&nbsp;<br><br><span id="ans'+i+'" class="chkans"></span><br>&nbsp;')
write('<br>')
}
}
with (document){
write('<hr><br>')
write('<input type="button" value="See Score" onclick="addup()">&nbsp;&nbsp;<span id="results"></span><br>&nbsp;<br>')
if (allowDoOvers)
write('<input type="button" value="Start Again" onclick="reset();clearR()">')
write('</form>')
}
</script>
</p>
<p> <em>Check Your Answers:</em><br>
<br>
<input name="ans_1" type="submit" onClick="MM_popupMsg('If Your Answer is: \r\rb. This is partially correct. Aside from knowing of what will be improved, the teacher also reacieve a congratulatory remark from his/her school head for a job well done.\r\rc. This is partially correct. Aside from affirming good behavior and practices, the teacher and the school head discuss those behavior and practices that need modification.\r\rd. This is partially correct. The main purpose of an instructional supervisory conference is to improve instruction. You need several classroom visits before you can objectively rate him/her on the aspect of teaching competence\r\r---------------------------------------------------------\r\rThe Correct Answer is\r\ra. This is the best answer. The teacher and the school head have to meet to discuss what happened during the classroom visit. They will focus on the strengths and weaknesses of the teacher for possible reinforcement and redirection as the case may be.')" value="Answers #1">
<input name="ans_12" type="submit" onClick="MM_popupMsg('\rIf Your Answer is: \r\rb. Partially correct. This is only secondary consideration, when you do classroom visitation. \r\rc. Partially correct. Showing effective teaching strategies is good especially if it\'s a demonstration lesson. This can be done for the benefit of new teachers. Again this is not the primary purpose of an instructional supervisory conference.\r\rd. Partially correct. Advice may no recieve favorably by the teacher. Practices/behavior to be improved should be supported by evidences gathered during the observation. We guide the teacher to analyze the data and the situation.\r\r---------------------------------------------------------\r\rThe Correct Answer is\r\ra. This is the best answer. The primary purpose of an instructional supervisory conference is to improve instruction.\r')" value="Answers #2">
<input name="ans_12" type="submit" onClick="MM_popupMsg('If Your Answer is: \r\ra. Incorrect. The teacher is only one of the actors. He/she has to work with the school head.\r\rb. Incorrect. The school head assists the teacher to see himself/herself in the post conference. \r\rd. Incorrect. In the post conference, the pupils are the subject of deliberations, whether they learned the lesson or not. However, they are not the principal actors in the conference. \r\r---------------------------------------------------------\r\rThe Correct Answer is\r\rc. The teacher and the school head should work collaboratively during the post conference.')" value="Answers #3">

jscheuer1
07-10-2005, 11:48 AM
You need to have faith sometimes. Often it is always darkest right before the dawn. I remember going on for about a week once with this Turkish fellow who just couldn't grasp what a frameset was and that loading one inside the other was a bit like standing in a hallway between two mirrors. Not at all like replacing one page with another. He had a well designed site otherwise though, and he did finally get it. Anyroad, the real work, for me, on this one is about done - writing the script, something I wanted to do anyway. I still think what you said was amusing. The hours are tough, and the pay, well . . . :rolleyes:

askman
07-11-2005, 01:17 AM
the script as i saw it was clean but still there is an error. once you clicked the "Check Answer" in the number 2 question (which is question[1]), there's no display??? how's that??? I really can't do it... i'm trying to find the error but i just can't understand the code.... it might be somewhere in this code that i attached . i'm not a web programmer but this is an important task that i must solve.

if there's nothing wrong in this part:

questions[1]=["What is the primary purpose of an instructional supervisory conference?", "a. to improve instruction", "right", "b. to evaluate a teacher\'s performance.", "", " c. to demonstrate effective learning strategies", "", "d. to give the teacher advice ", "", "<br><br>If Your Answer is: <br>b. Partially correct. This is only secondary consideration, when you do classroom visitation. <br><br>c. Partially correct. Showing effective teaching strategies is good especially if it\'s a demonstration lesson. This can be done for the benefit of new teachers. Again this is not the primary purpose of an instructional supervisory conference. <br><br>d. Partially correct. Advice may no recieve favorably by the teacher. Practices/behavior to be improved should be supported by evidences gathered during the observation. We guide the teacher to analyze the data and the situation. <br><br>The Correct Answer is<br>a. This is the best answer. The primary purpose of an instructional supervisory conference is to improve instruction<br>" ]

then i really can't solve it. That's the last part of my problem.... That's all I need......

askman
07-11-2005, 02:07 AM
:D

I FOUND THE CULPRIT!
man it gives me a headache... it's simple... it's the double \\ thing... sometimes the program is accepting \\ sometimes \ in "don't" sometimes you should type "don\'t" sometimes "don\\'t"

damn! hehe THANKS FOR THE ADVICE!!!

GOTTA HAVE FAITH!!!!

thanks guys for the CODE!!! :thumbsup:

jscheuer1
07-11-2005, 11:04 AM
Yeah, the latest instructions for the 'questions' array are:


/*
Set Question and Answers Arrays Below.
Questions come first. Then come the answer pairs:
Follow the right answer with "right", all wrong ones with ""
The final entry is the wrong answer string*, to be shown when peeking, if the answer is wrong.
Example:
questions[x]=["Do fish swim in the sea?", "Yes", "right", "No", "", "Fish really do swim in the sea"]
single quotes (') must be double escaped (\\) ex: "That\\'s right!" *in the wrong answer string only*.
double quotes (") must be named (&quot;) ex: "He referred to himself as &quot;King Louie&quot;"
*/

askman
07-12-2005, 09:29 AM
I can't use the script that you gave me because once you clicked the "Check answer" button, there is no other choice but to see ALL the answers.

OK let me clear it.

---------------------------------
1. Which of the following does not belong to the group?
a.) strawberry cream
b.) orange juice
c.) tomato sauce
d.) adam's apple





This is the situation,
1st you answer the number 1 question and you pick the answer radio button a.)
below the answers in number 1 question, in your screen will write:

------------------------------------------------------------------------
"This answer is not quite right... You are wrong for picking strawberry cream because strawberry cream contains a fruit as well as the other two."
------------------------------------------------------------------------

then you pick the 2nd answer which is radio button b.)
below the answers in number 1 question, in your screen will write:

-------------------------------------------------------------------------
"You almost got it but orange juice can be much more different than the other two since it is pure liquid, but you are wrong"

"The correct answer is adam's apple. Adam's apple is not made out of fruit, it is a body part of a human being, men have adam's apple on their neck below their chins." (You are out of tries)
-------------------------------------------------------------------------

Then after two tries the examiner will proceed to the second question... when he finished the second question, he will proceed to the NEXT PAGE, another webpage for number 3 question... repeat the process, he will have wrong and correct answers.... until he reached the last page (example page 7) then on the bottom of the page, there is a button to check his score

this will be the sample score:

--------------------------------------------------------------------------
Your Score is 5 out of 10, you've got 50%, Your grade is "C", You need to study more but you performed well.
--------------------------------------------------------------------------

then it ends there.
I still can't do it.... I can't use the code.

jscheuer1
07-12-2005, 09:52 AM
Put all the questions for a given quiz on one page.

askman
07-13-2005, 11:21 AM
i can't put them on one page, the questions are 1-20
too long .... bad design.

jscheuer1
07-13-2005, 12:28 PM
There is no practical limit on page length. Are you saying you have 20 answers for each question or that 20 questions seems like enough for one page? In either case, they will all fit on one page. That is what scroll bars, the PgUp, PgDn and arrow buttons are for. You can use a smaller font. You could make separate quizzes as well if this bothers you. I believe you mentioned that this wasn't for academic evaluation, for that you would probably need a server side script anyway. Each quiz could be of only say, 10 questions per page. I have my demo up to about 16 right now (I want to eventually do all the state capitols) and it is a long page but, so what? Finally, I believe that, just using javascript alone I may be able to find a way to forward scores from previous pages, detailed reports would be out of the question though. That would require something like PHP and/or MySQL. I don't do those, but there are other forums here where they do.

askman
07-14-2005, 05:48 AM
ok suppose i will only use the anchor tag so when he clicked the next button he will go to where the question is (in the same page).

suppose we do that, i can't still use the code that you gave me.

it's simple... what i need is simple. just whenever the "check answer" was clicked, the wrong answer in a certain LETTER, example number 1 you pick the incorrect answer letter "a" the wrong answer will appear with its unique description... every wrong answer have their own unique description... and every correct answer (or correct letter) have their own unique description. the code that you gave me tells what's wrong with an answer, in number 1, 2, 3, and all the questions... that's the result... so if we follow my example, if the wrong question in number 2 was clicked, what will appear in the screen is the same as the one given in number 1, that can't be...... because they are different. I can only use that if they have similar "description" of answers. what i mean is there are description after the click of 'check answer" for each answers in each numbers. It's not a simple incorrect and correct but it only view the description of each of your answers...


----------------------------------------------
example
---------------
1.
a.)blah blah a
b.)blah blah b
c.) blah blah c
d.) blah blah d

(check answer): well letter a is this and that try again
then click (check answer): well letter b is correct because this and that blahblah

if correct each questions should have a unique description of the correct answer once the (check answer) button was clicked.

AFTER 2 tries for each questions a pop up will appear (you are out of tries)

-------------------------------------------------
1.
a.) was selected (an incorrect answer): click the "check answer" below the answers in number 1: unique description why letter A is correct or incorrect
b.)was selected (an incorrect answer): click the "check answer" below the answers in number 1: unique description why letter b was correct or incorrect





i can't show all the answers unless his 2 tries expired, for each questions. (this is the priority, 2 tries per question, it is a must... that's why i can't use your code)

now, after all the questions and all the answers were explained, there should be a score, number of correct answer in % and in letter example "A" for the highest score. It should only appear right next to the "Score" button, not in a separate page.

They don't want to accept the previous codes.

:)

jscheuer1
07-14-2005, 06:30 AM
You will have to be a little clearer. Use real questions and answers, explain what should happen as literal responses by the page to each action taken.

askman
07-14-2005, 09:12 AM
1. What do you call the face-to-face encounter between the teacher and the supervisor after instruction?
a. instruction
b. giving of feedback
c. interview
d. post conference



-----------------------------------------
radio button: if you click the answer a, and you click "check answer" this will appear:

a. Partly correct. The data gathered from formal observation can be used in rating the teachers.

-------------------------------------------
radiobutton: if you click the answer b, and you click "check answer" this will appear:

b. Yes. The primary purpose of conducting an instructional supervisory conference is to improve instruction for the benefit of the students.

----------------------------------------------
if you click the radio button, the answer c, and you click "check answer" this will appear:
c. Partly correct. It is always good to inform the teachers of their strengths and to encourage them to overcome their weaknesses.


------------------------------------------------
if you click the radio button, the answer d, and you click "check answer" this will appear:

d. Partly correct. The teacher should know both her strengths and weaknesses for possible interventions.

------------------------------------------------

if you want you can just make it appear as a "pop up message"

just as long as in the very end of the examination there will be a score,
just make it sure that i can also insert a navigational bar to jump through pages (using anchor, 2 questions per page, this entire exam is only 1 webpage, like an illusion.... you can jump to the last part of that page by writing a page number on a text box or jump menu.... so that the examiner will feel that it is not in SINGLE page but many pages.)

askman
07-14-2005, 09:13 AM
there should be only 1 "check answer" button for every question,
thanks :p

askman
07-14-2005, 09:19 AM
it will be better if we have a next and back button instead to navigate thru the entire exam, so it will make him feel like it is written in pages... not in a single page. once they click next they will go below ... u know... an anchor ...

jscheuer1
07-14-2005, 07:15 PM
I think I've got all that now. Sounds like a major rewrite but, doable. I like the new features, makes it a more powerful, dare I say at this point, program. Watch this space.

Willy Duitt
07-14-2005, 09:30 PM
I can easily do this for you...
Is this a paid job offer??

I assume that the CD will be sold...
All else being equal... What about credits (which do NOT pay the bills)...

.....Willy

askman
07-14-2005, 11:42 PM
this is for the poor far-reaches of education in south east asia, the third world. it can also be shared to the other third world countries in the future. i'm being paid fair, it will be destributed all over the region... (i'm not being paid though as a programmer) if i didn't do my job, someone else's will... someone who will do this job for money not for the benefit of others. I'm not doing this for my own. Try to imagine this... it will spread throughout the south east asia and i won't remove any URL or Email that you attached so someone will recognize your participation. :rolleyes:

askman
07-14-2005, 11:45 PM
I think I've got all that now. Sounds like a major rewrite but, doable. I like the new features, makes it a more powerful, dare I say at this point, program. Watch this space.

i'm sorry for everything, i just want to say that please help me if you really want to do it. you will do it only if you want it to, right? :)

jscheuer1
07-16-2005, 11:54 AM
I think I've got it. I just finished with the first eureka moment with this thing, so let me test it out a bit more before publishing it. The only thing I didn't work out quite the way you asked is the pagination. Anchor tags didn't seem the way to go and more than one question per 'page' seemed too much. I settled on using the questions' display property to allow the 'quizzee' to page through them one at a time. The configuration is almost identical as before except there is now an optional hints array that can be added after any or all question(s). If this hints array is present for a given question and contains an entry for the answer being checked, it will give that response, otherwise it will default to the simple response of the original response enabled version. To get the layout uniform and to avoid 'jumpiness' as questions of varying answer length substitute for oneanother, I resorted to using a small transparent .gif The response 'page' is now rendered using innerHTML and the display property. This preserves the state of the questions while looking at the detailed report. The document.write method I used before did not.

jscheuer1
07-16-2005, 03:19 PM
OK, here is the newest version. It requires spacer.gif, a small transparent image. If you do not have easy access to one, I am attaching one to the end of this message - here's the code:

<html>
<!-- saved from url=(0014)about:internet -->
<head>
<title>State Capitols Quiz</title>

<style type="text/css">
body {
background:lightyellow;
color:navy;
font:.85em arial;
white-space:nowrap;
margin:0;
padding:0;
}
#front { /* style for main quiz page overall */
margin:20px;
}
#report { /* style for report page overall */
padding:10px 20px 30px 20px;
background:lightblue;
font-size:1.1em;
font-weight:bold;
border:3px outset white;
display:none; /* display:none must remain for proper functioning */
}
#report table { /* style for report page table of details */
border-collapse:separate;
}
#report td {
font-size:.75em;
font-weight:bold;
padding:10px;
}
form { /* style for main quiz page form containing questions*/
margin-top:0
}
table { /* style for main quiz page table containing form */
border-collapse:collapse;
display:inline;
}
td {
padding:0;
margin:0;
}

.chkans { /* style for main quiz page "Check Answer" button */
margin:10px 10px -5px 0;
}

span.chkans { /* style for main quiz page "Check Answer" data */
position:relative;
top:5px
}

* html span.chkans {
top:2px
}

.page { /* hides additional questions - do not change */
display:none;
}
</style>

</head>
<body>
<div id="front">
<h1>State Capitols Quiz</h1>
This page will tell what you know about state capitols.<br>
<h2>Directions:</h2>
Click on the correct answer.
<span id="peek"></span><br><br>

<script type="text/javascript">
/*/////////////////////////////
* Quiz Writing & Scoring Script v.6
* 2005 John Davenport Scheuer
* jscheuer1TAKEOUTCAPSFOREMAIL@comcast.net
* permission to use granted
* this credit must stay intact
/////////////////////////////*/

/*Set Question Block Height. */
var blockHeight=170

/*Set to number of peeks allowed per
question. Set to (0) for no peeking */
var tryLimit=2

/*Set No Answer Behavior when giving
hints. (0) for no hint (1) for
the default wrong answer string
for the given question */
var noAnserGiveClue=0

/*Set disable peeking style, (0) for
disable 'Check Answer' button only,
(1) for disable entire question. */
var disablePeekStyle=1

/*Set Last Chance Behavior - if on their
last chance to hit the Check Answer Button and
they have the right answer, let them know (1)
or keep them in the dark (0) */
var lastChanceTrue=1

/*Set to 0 for no Starting Over without refresh
Set to 1 to allow Easy Do Overs */
var allowDoOvers=1

/*Set Report Columns */
var reportColumns=4

/*Set number of Return from Report buttons, (0) for one return
button at the bottom, (1) for added return button at top,
good for long quizzes. */
var dualReturn=1

questions=new Array(); // <<<< do not edit or remove this line!
hints=new Array(); // <<<< do not edit or remove this line!
/*
Set Question and Answers Arrays Below.
Questions come first. Then come the answer pairs:
Follow the right answer with "right", all wrong ones with ""
The final entry is the wrong answer string*, to be shown when peeking, if the answer is wrong.
Example:
questions[x]=["Do fish swim in the sea?", "Yes", "right", "No", "", "Fish really do swim in the sea"]
single quotes (') must be double escaped (\\) ex: "That\\'s right!" *in the wrong answer string only*.
double quotes (") must be named (&quot;) ex: "He referred to himself as &quot;King Louie&quot;"

Optional Hints arrays may be added for any or all Questions as shown. Single quotes (') may be used.
Double quotes must be escaped (\").
*/
questions[0]=["What is the capitol of Pennsylvania?", "Harrisburg", "right", "Oswego", "", "Philadelphia", "", "Denver", "", "That is not the capitol of Pennsylvania, Harrisburg is."]
hints[0]=["Correct! - Harrisburg is the capitol of Pennsylvania.", "Incorrect, Oswego is in the state of New York.", "Incorrect, Philadelphia is Pennsylvania's largest city but, not the capitol.", "Incorrect, Denver is in the state of Colorado."]
questions[1]=["What is the capitol of New Jersey?", "Princeton", "", "North Orange", "", "Trenton", "right", "Labrador", "", "That is not the capitol of New Jersey, Trenton is."]
hints[1]=["Incorrect, \"Princeton\" is the home of the famous New Jersey University but, is not the capitol.", "Incorrect, North Orange is a large city in New Jersey but, not the capitol.", "Correct! - Trenton is New Jersey's capitol.", "Incorrect, Labrador isn't even in New Jersey."]
questions[2]=["What is the capitol of Montana?", "Billings", "", "Helena", "right", "Shelby", "", "Tabasco", "", "That is not the capitol of Montana, Helena is."]
hints[2]=["Incorrect, Billings is a large city in Montana but, is not the capitol.", "Correct! - Helena is Montana's capitol.", "Incorrect, Shelby is in Montana though.", ""]
questions[3]=["What is the capitol of New York?", "Syracuse", "", "New York City", "", "Buffalo", "", "Albany", "right", "That is not the capitol of New York, Albany is."]
questions[4]=["What is the capitol of Kansas?", "Atchison", "", "Topeka", "right", "Dodge City", "", "Manhattan", "", "That is not the capitol of Kansas, Topeka is."]
hints[4]=["Wrong, Atchison is part of a song title and a Kansas city, not the capitol.", "Good Going! - Topeka's right!", ""]
questions[5]=["What is the capitol of Wisconsin?", "Franklin", "", "Green Bay", "", "Madison", "right", "Elkhorn", "", "That is not the capitol of Wisconsin, Madison is."]
questions[6]=["What is the capitol of Delaware?", "New Castle", "", "Dover", "right", "Camden", "", "Wilmington", "", "That is not the capitol of New Jersey, Dover is."]
questions[7]=["What is the capitol of Illinois?", "Glen Carbon", "", "Calumet", "", "Alsip", "", "Springfield", "right", "That is not the capitol of Illinois, Springfield is."]
questions[8]=["What is the capitol of Rhode Island?", "Providence", "right", "Newport", "", "Bristol", "", "Johnston", "", "That is not the capitol of Rhode Island, Providence is."]
questions[9]=["What is the capitol of Arkansas?", "De Queen", "", "Clinton", "", "Little Rock", "right", "Fayetteville", "", "That is not the capitol of Arkansas, Little Rock is."]
questions[10]=["What is the capitol of South Dakota?", "Custer", "", "Sioux Falls", "", "Aberdeen", "", "Pierre", "right", "That is not the capitol of South Dakota, Pierre is."]
questions[11]=["What is the capitol of California?", "Sacramento", "right", "Hayward", "", "Jackson", "", "Burbank", "", "That is not the capitol of California, Sacramento is."]
questions[12]=["What is the capitol of Nebraska?", "Omaha", "", "Kimball", "", "Lincoln", "right", "Crete", "", "That is not the capitol of Nebraska, Lincoln is."]
questions[13]=["What is the capitol of Massachusetts?", "Boston", "right", "Ipswich", "", "Peabody", "", "Milford", "", "That is not the capitol of Massachusetts, Boston is."]
questions[14]=["What is the capitol of Hawaii?", "Honolulu", "right", "Kailua", "", "Ewa Beach", "", "Maui", "", "That is not the capitol of Hawaii, Honolulu is."]
questions[15]=["Are we having fun yet?", "Yes", "right", "No", "", "Aw c\\'mon, aren\\'t you having fun?"]
questions[16]=["Do fish &quot;swim&quot; in the sea?", "Yes", "right", "No", "", "Fish really do &quot;swim&quot; in the sea."]

/*Configure the text portions of the "You scored" statement. Format is -
scoreStr1 "number right" scoreStr2 "total number of questions" scoreStr3 "percentage score" scoreStr4
Leave unchanged for default (You scored 6 out of 6 correct, 100%) */
var scoreStr1='You scored<span style="color:blue;">'
var scoreStr2='</span>out of<span style="color:blue;padding-left:.25ex;">'
var scoreStr3='</span>correct,<span style="color:blue;">'
var scoreStr4='</span>'

////////////////Stop Editing///////////////

for (i = 0; i < questions.length; i++){
eval('var tries'+i+'=0')
for (j = 0; j < questions[i].length; j++){
if (questions[i][j]=="")
questions[i][j]=("w"+i)+j
if (questions[i][j]=="right")
questions[i][j]="right"+i
}
}
var ie=document.all, tit=this.document.title
var moz=(document.getElementById&&!document.all)? 1 : 0
var selq, report, allowPeeking, qnum, tryLimitV, answersString
tryLimit>0? allowPeeking=1 : allowPeeking=0
var mathV=['zero', 'one', 'two', 'three', 'four', 'five', 'six']
document.getElementsByTagName? allowPeeking=allowPeeking : allowPeeking=0
if (allowPeeking){
mathV[tryLimit]==undefined? tryLimitV='<b>'+tryLimit+'</b>' : tryLimitV='<u>'+mathV[tryLimit]+'</u>';
ie? ie.peek.innerHTML='<br>Use the "Check Answer" buttons to see how you are doing.<br>Only '+tryLimitV+' Check Answer\'s per question allowed.' : document.getElementById('peek').innerHTML='<br>Use the "Check Answer" buttons to see how you are doing.<br>Only '+tryLimitV+' Check Answer\'s per question allowed.'
}

function showAnswer(el,ans,tryVar,cntrlVar){
if (eval('tries'+tryVar)>=tryLimit){
alert ('Sorry, only '+tryLimit+' Check Answer\'s per question.')
rbuts=document.getElementsByTagName('input')
for (j = 0; j < rbuts.length; j++)
if ((!disablePeekStyle)&&rbuts[j].name=='q'+tryVar&&rbuts[j].type!=='radio')
rbuts[j].disabled=1
else if (disablePeekStyle&&rbuts[j].name=='q'+tryVar)
rbuts[j].disabled=1
ie? ie[el].innerHTML='' : document.getElementById(el).innerHTML=''
if (cntrlVar!==undefined&&lastChanceTrue)
if (qnum)
ie? ie[el].innerHTML=selq : document.getElementById(el).innerHTML=selq
else
ie? ie[el].innerHTML=selq+' is: '+ ans : document.getElementById(el).innerHTML=selq+' is: '+ ans
return;
}
eval ('tries'+tryVar+'++')
if (qnum)
ie? ie[el].innerHTML=selq : document.getElementById(el).innerHTML=selq
else{
if (selq.indexOf('NO ANSWER')!==-1&&noAnserGiveClue||selq.indexOf('NO ANSWER')==-1)
ie? ie[el].innerHTML=selq+' is: '+ ans : document.getElementById(el).innerHTML=selq+' is: '+ ans
else
ie? ie[el].innerHTML=selq+' at least give it a try!' : document.getElementById(el).innerHTML=selq+' at least give it a try!'
}
}

function getSelect(quest){
qnum=''
var hnum=''
selq='NO ANSWER,'
selTest=document.getElementsByTagName('input')
for (i = 0; i < selTest.length; i++)
if (selTest[i].name==quest&&selTest[i].checked){
qnum=selTest[i].name.substr(selTest[i].name.indexOf('q')+1)
if (selTest[i].id.indexOf('w')!==-1)
hnum=Math.abs(selTest[i].id.substr(selTest[i].id.indexOf(qnum)+qnum.length))/2-1
else{
for (j = 0; j < questions[qnum].length; j++)
if (selTest[i].value==questions[qnum][j])
hnum=(j-1)/2
}
if (hints[qnum]!==undefined&&hints[qnum][hnum]!==undefined&&hints[qnum][hnum]!==''){
selq=hints[qnum][hnum]
qnum=1
}
else{
qnum=0
selq=selTest[i].value+','
}
}
}

function backToQuiz(){
this.document.title=tit
document.getElementById('results').innerHTML='';
document.getElementById('front').style.display='block';
document.getElementById('report').style.display='none';
}

function seeDetails(){
this.document.title=tit+' - Your Results'
document.getElementById('front').style.display='none';
document.getElementById('report').innerHTML=report;
document.getElementById('report').style.display='block'
}

function switchQ(cur,next){
document.getElementById(cur).style.display='none';
document.getElementById(next).style.display='inline';
}

function addup() {
var topReturn=''
if (dualReturn)
topReturn='<input type="button" value="Return to Quiz" style="margin:0 0 10px 20px;" onclick="backToQuiz();"><br>'
report='<h3>'+document.title+' - Your Results:</h3>'+topReturn+'<table align="center" cellpadding="10"><tr>'
var q, right, statement, total=0
quizQuests=new Array();
for (i = 0; i < questions.length; i++)
quizQuests[i]=0
if (document.forms.quiz.q0['right0']){
for (i = 0; i < questions.length; i++){
q="q"+i
right="right"+i
if (document.forms.quiz[q][right].checked)
quizQuests[i]=1
}
}
else if (document.getElementById){
for (i = 0; i < questions.length; i++){
right="right"+i
if (document.getElementById(right).checked)
quizQuests[i]=1
}
}
else
return;
for (i = 0; i < questions.length; i++)
total += quizQuests[i]
var seeDetails=''
if (document.getElementsByTagName){
for (i = 0; i < questions.length; i++){
q="q"+i
selq='No Answer'
selTest=document.getElementsByTagName('input')
for (j = 0; j < selTest.length; j++)
if (selTest[j].name==q&&selTest[j].checked)
selq=selTest[j].value
right="right"+i
if (i%reportColumns==0)
report+='</tr><tr>'
report+="<td>Question "+(i+1)+":<br>"+questions[i][0]+"<br>Your Answer: "+selq+"<br>Correct Answer: "+document.getElementById(right).value+"<br>Points: "+quizQuests[i]+"</td>"
}
var prcnt=Math.round(total/questions.length*100)
report+='</tr></table><br>Total Points: '+total+' out of &nbsp;'+ questions.length +', for a score of: ' +prcnt+'% &nbsp; '
if (prcnt<=50)
report+='Very&nbsp;Poor.&nbsp; <nobr>Your study skills need improving.</nobr>'
else if (prcnt<=60)
report+='Poor.&nbsp; <nobr>Spend more time studying.</nobr>'
else if (prcnt<=70)
report+='Not&nbsp;Too&nbsp;Bad.&nbsp; <nobr>You need to study more often.</nobr>'
else if (prcnt<=80)
report+='Good.&nbsp; <nobr>With a little more work you could be really proud.</nobr>'
else if (prcnt<=90)
report+='Very&nbsp;Good!&nbsp; <nobr>You still missed '+(mathV[questions.length-total]==undefined? questions.length-total : mathV[questions.length-total])+' questions, study a little more.</nobr>'
else if (prcnt<=99)
report+='Excellent!&nbsp; <nobr>Which '+(questions.length-total<2? 'question' : 'questions' )+' did you miss?</nobr>'
else if (prcnt==100)
report+='Perfect!&nbsp; <nobr>You should be really proud!</nobr>'
report+='<br><br><input type="button" value="Return to Quiz" style="margin:10px 0 0 20px;" onclick="backToQuiz();"></div>'
seeDetails='<input type="button" value="See Details" onclick="seeDetails();">'
}
statement=scoreStr1 +' '+ total +' '+ scoreStr2 +' '+ questions.length +' '+ scoreStr3 +' '+ prcnt +'% '+ scoreStr4 +' &nbsp; &nbsp;'+seeDetails
ie? ie.results.innerHTML=statement : document.getElementById('results').innerHTML=statement
}
function clearR(){
ie? ie.results.innerHTML='' : document.getElementById('results').innerHTML=''
for (i = 0; i < questions.length; i++)
if (allowPeeking){
eval('tries'+i+'=0')
ie? ie["ans"+i].innerHTML='' : document.getElementById("ans"+i).innerHTML=''
}
if (allowPeeking)
inputs=document.getElementsByTagName('input')
for (j = 0; j < inputs.length; j++)
inputs[j].disabled=0
pages=document.getElementsByTagName('table')
for (i = 0; i < pages.length; i++)
if (pages[i].className=='page')
pages[i].style.display='none'
else
pages[i].style.display='inline'
window.scrollTo(0,0);
}
document.write('<hr><form name="quiz">')
for (i = 0; i < questions.length; i++){
answersString=''
for (k = 1; k < questions[i].length-1; k+=2){
var peekRemove=(allowPeeking)? ' onmousedown="document.getElementById(\'ans'+i+'\').innerHTML=\'\'"' : ''
answersString+='<input id="'+questions[i][(k+1)]+'" type="radio" value="'+questions[i][k]+'" name="q'+i+'"'+peekRemove+'><label for="'+questions[i][(k+1)]+'"'+peekRemove+'>'+questions[i][k]+'</label><br>'
}
with (document){
write('<table id="pg'+i+'"'+(i>0? ' class="page"><tr><td style="padding:.5em .5em .8em .5em;" colspan="2" valign="top"><a href="javascript:toQuestion('+i+')" onclick="switchQ(\'pg'+i+'\',\'pg'+(i-1)+'\');return false;">Previous</a></td></tr><tr><td'+(allowPeeking? ' rowspan="2"' : '')+'><img src="spacer.gif" height="'+blockHeight+'" width="1"></td><td valign="top">' : '><tr><td style="padding:.5em .5em .8em .5em;" colspan="2" valign="top">&nbsp;</td></tr><tr><td'+(allowPeeking? ' rowspan="2"' : '')+'><img src="spacer.gif" height="'+blockHeight+'" width="1"></td><td valign="top">'))
write('Question '+(i+1)+':<br>')
write(questions[i][0]+'<br>')
write(answersString)
if (allowPeeking)
write('</td></tr><tr><td valign="bottom" style="padding-bottom:.5em;"><input class="chkans" type="button" value="Check Answer" name="q'+i+'" onclick="getSelect(\'q'+i+'\');if (moz? document.getElementById(\'right'+i+'\').checked : ie? ie.right'+i+'.checked: 0==1) {showAnswer(\'ans'+i+'\',\' Correct!\','+i+',1)}else if (moz||ie) {showAnswer(\'ans'+i+'\',\'Incorrect! '+ questions[i][questions[i].length-1] +'\','+i+')}">&nbsp;<span id="ans'+i+'" class="chkans"></span>')
write('</td></tr><tr><td style="padding:.5em;" colspan="2" valign="bottom"><a href="javascript:toQuestion('+(i+2)+')" '+(i<questions.length-1? 'onclick="switchQ(\'pg'+i+'\',\'pg'+(i+1)+'\');return false;">Next</a></td></tr></table>' : '</a></a></span>&nbsp;</td></tr></table>'))
}
}
with (document){
write('<hr><br>')
write('<input type="button" value="See Score" onclick="addup()">&nbsp;&nbsp;<span id="results"></span><br>&nbsp;<br>')
if (allowDoOvers)
write('<input type="button" value="Start Again" onclick="reset();clearR()">')
write('</form>')
}
if (moz&&document.getElementsByTagName&&allowPeeking){
window.onload=function(){
inputs=document.getElementsByTagName('input')
for (i = 0; i < inputs.length; i++)
inputs[i].disabled=0
}
}
</script></div><div id="report"></div></body></html>

askman
07-19-2005, 06:55 AM
Hello! Thanks for the code. I can't use it... This is all that appears in the screen, i saved the spacer.gif in the same folder....

State Capitols Quiz
This page will tell what you know about state capitols.

Directions:
Click on the correct answer.


This is all...

jscheuer1
07-19-2005, 09:01 AM
Too bad. Works fine here (copied and pasted from my previous message). I guess you will not be interested in the latest update either then.

ImperialSpider
07-19-2005, 06:57 PM
I was able to copy and paste the code, and it worked great. My Mother in law is a teacher for US History and Geography for her school here, in TEXAS. and if he is not interested...I am sure that she certainly would be. may I have the update please?


Thanks,

Imperial Spider

jscheuer1
07-19-2005, 07:38 PM
How can I refuse an Imperial Spider? With this latest update, I've tried to make the configuration comments more uniform and to the point. Also added is the ability to choose how many questions appear per virtual page. Next and previous are now buttons. Since you mentioned 'Texas' and 'school', I soon thought "might be Mac's". This is not tested on and probably will have problems on a Mac using anything other than a Mozilla based browser (NS7.2 and FF). This means that the two most likely default Mac browsers (IE5 Mac and Safari) probably will not like it. All in all it is fairly simple though and if I had a volunteer Mac tester I may be able to get it to work on those browsers. Who knows? It might work on them as is. I also changed common variable names like i, j, etc to be more complex to avoid conflicts with servers like Geocities. The script plus my above comments are now just a tad too large to paste into a message here, so I am attaching the script and the spacer.gif in a zip file.

Forgot to mention that there is now a jump to question feature using a select drop down.

askman
07-20-2005, 09:08 AM
jscheuer1 i am very interested to the latest update actually. You've got it exactly how i want it, but.... it can't be open in I.E. we're assuming that those computers used by the people in poor regions of Asia are not using Firefox. Is there any chance that it can be opened in Internet Explorer 5? And... another thing.. I can't use Firefox because i'm using this code in the very first intro...


<HEAD>

<SCRIPT LANGUAGE="JavaScript">


<!-- Begin
function fullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}
// End -->
</script>
</HEAD>



<BODY>

<a href="javascript:void(0);" onClick="fullScreen('CLOSE WINDOW.html');">Open Full Screen Window</a>



--------

the next page after this "Intro" will be in full screen, without the address bar ... all in full screen... it only work in internet explorer... in firefox... you can't use it because the scroll bar will disappear.

If there's any chance that we can use IE for this.. please...


(you've got it right in your 07-16-2005 09:19 PM message) :thumbsup:

Thanks again

jscheuer1
07-20-2005, 07:02 PM
I hope you are not talking about IE5 Mac, are you? Anyways, I started out making this compatible with IE4+ and Mozilla (NS7.2 or FF) for the PC. It became too involved for that and the current version requires IE6 (PC only) or Mozilla, as before (Mac or PC). Firefox is free and works on Macs and PCs. There is no reason to have this full screen without all those things on it. The odd thing is that it should work on IE5 Mac, as that browser has the getElementById capability which IE5 PC did not. It probably can be made to work on IE5 Mac or PC. I can test on a legacy IE5 PC but, have no Mac. So, which is it you are shooting for? If Mac I can give you a few test scripts to see what is bothering it. I know that if it is IE5 PC what it is and can fix it but it will take some time.

Added a little later:

Mozilla can do full screen too, the code may be a little different. Or just tell them to hit their F11 key.

jscheuer1
07-21-2005, 03:21 AM
Ok, I grabbed a copy of IE5.01 for the PC and this version works on it. It may also work on IE5 Mac. No way for me to tell. It still works on IE6 and Mozilla. It still requires spacer.gif but, since that is attached to a previous message and included in a previous attached zip, both in this thread, I am not including it here. Oddly enough, I was able to cut down on the size of the file a bit but, it is still just a tad too large to paste in. It is attached as a zip file to this message.

askman
07-21-2005, 05:29 AM
Hey you've been so good to me. Thanks A Lot! This is it! :thumbsup:

jscheuer1
07-21-2005, 05:51 AM
OK, but you still haven't told me if this is on IE5 Mac or IE5 PC. I just tested it on Konqueror (said to be similar to Safari) and although not perfect, it worked and all but one feature works (a minor one, you have to click on the radio buttons to select your answer - in all other browsers so far, clicking on the answer selects it as well). Fonts and some minor layout differences render it less than 'slick looking' but it works! So, I am awaiting an IE5 Mac test if anyone would be so kind. A Safari Mac test would probably be a good idea as well. If anyone can volunteer either of these it would be appreciated.

ImperialSpider
07-22-2005, 12:28 AM
I don't have a mac, nor does anyone I know, or I would be happy to help you with the testing... However, I would like to know what would I do to the code to disable the "See Details" button until all questions have been attempted by the user. That way they wont be able to read the answers before they actually take the quiz.

I looked at both codes you put up, and actually, I preferred the one with only one question at a time on screen. Just my preference. Also I would like this code to only allow one answer change per question instead of two changes before it "grays out" the options. (so you can check your answers to see if it is correct, and if not, you can change your answer once, but then it will not allow a second change.)

BTW, my mother in law (the teacher) loved it and wants to use it in her geography classes this fall. (I think they use windows platform)...Anyway's, If there is a way to make this quiz do like I want, can you show me or tell me what I need to do?

Thanks in Advance.

ImperialSpider

jscheuer1
07-22-2005, 12:50 AM
The latest release version has configuration options that will nearly match what you want. Actually, I think a bit better because if you disable only "see details" until the quiz is completed and not "see score", they can still use the score to figure out if the answer is right or not.

Working from the configuration of:
* Quiz Writing & Scoring Script v.6b_1
in no particular order . . .

Here is what you do, for one question per page:

/*Set number of Questions per virtual
'page', set to at least 1, best if
the total number of questions is
evenly divisible by this number. */
var numQuests=1

To disable "see details" and "see score" until all questions have been answered:

/*Set to (0) for allow 'See Score' when some
questions have not been answered. Set to
(1) to disallow 'See Score' until all
questions have been answered. */
var seeScoreOnlyCompleted=1

This will also trigger an alert if they try it anyway and send them to the lowest numbered incomplete question.

For only one answer change before gray out:

/*Set to number of 'Check Answer' tries allowed
per question. Set to (0) for no peeking */
var tryLimit=1

That's about it. I have a new version in the works that allows the user to choose the number of questions per 'page'. There are many other options already in the current release you have, they are all commented to explain what each one does. Play around with them and see for yourself.

askman
07-22-2005, 07:33 AM
hey IE 5 pc. there will be different users actually.
Another thing, do you have a script a java script... actually i've seen it before but i can't see it again.. it is an arrow pointing downward and upward located in the lower right corner of the screen, acts like a scrollbar just incase you don't have one... for Mozilla firefox users... i gave you the script for full screen right? it don't work in mozilla, the scrollbar simply disappears...

your code is perfect except that all i need in "see details" instead of showing in another page, just another score on the right side of % score.. example


(SCORE BUTTON) once clicked: your score is 50 out of 100, 50%, you have an average score i'll give you a "B".

askman
07-22-2005, 07:34 AM
just incase you don't know i have a template, i will insert your code inside a table... it works but the template will disappear once you clicked the "see details" button.

Willy Duitt
07-22-2005, 12:42 PM
just incase you don't know i have a template, i will insert your code inside a table... it works but the template will disappear once you clicked the "see details" button.

Gheesh... Even if you paid me...
I would not tolerate your dumbshyte...
Get a clue and at least try to adapt a working example to fit your needs...
Expecting somone to write you a custom script (for free) to your ever changing expectations is RUDE!! Show me the money!!

Either that, buy yourself a clue...

.....Willy

Willy Duitt
07-22-2005, 12:59 PM
BTW: jscheuer1

I long ago recognized your effort....
It's a decent script, but there comes a time...

.....Willy

jscheuer1
07-22-2005, 01:19 PM
I'm starting to be persuaded, Willy. Anyways, I don't intend to make those type of options available at this time. I can think of three solutions for askman. The obvious - link to the quiz from the template. Second choice is use an iframe on the template page:

<iframe src="quiz.htm" width="100%" height="160%" scrolling="auto" frameborder="0"></iframe>Quiz.htm should be changed to the name of the quiz page. The height can be increased or decreased as needed to eliminate a second vertical scrollbar (increase) without adding too much 'empty' height (decrease) to the page. Tested on IE5.01 sp2 PC. Depending upon how many questions you have, you may want to give the report table a 150% or 200% width in the style and say 8 or 10, columns in the configuration. Play with it. Third, if you put the top portion of your template display code right after:

<div id="front">on the quiz and put the bottom portion of your template display code right after the closing script tag:

</script>it should work out too.

askman
07-28-2005, 07:24 AM
i didn't try it yet but i'll do if i have a time. the thing is.. i'm not allowed to change the template, i can't use frames.

askman
08-05-2005, 07:13 AM
i'm already using your code :) how can i resize the drop down menu for navigation of questions? i have an attachments here so it would be easier for you to understand, i can't find it in your code... see above, because of the "Yellow" dropdown menu, the table was moved and it went out of the border, (because the Questions in this quizes are sometimes too long) i changed the "colspan" of my table(my template where i inserted your code) the table resized to its original size, lined with the "summary" but the dropdown menu from your java script code is still outside the border.

I don't do java script...
ok thanks

jscheuer1
08-05-2005, 09:18 AM
I'm not sure what version you are using so I'm attaching the latest. There are two choices I can think of right off:

1 ) Disable that feature, available here (in the latest version):

/*Allow "Jump to Question" via
select drop down? (1) for yes
(0) for no. */
var allowJump=0

2 ) In the style section set the #jump style font-size to say, 75%, that will make it take up less space. The place to do that is near the top of the page, in the style section and looks like this:

#jump { /* style for "jump to question" select box */
background-color:#ffffbf;
}Make it look like this:

#jump { /* style for "jump to question" select box */
background-color:#ffffbf;
font-size:75%;
}

askman
08-05-2005, 11:16 AM
this is the quiz version that i'm using: quiz6b_pages_t1_no_i_bak_pat.htm

-------------------------------------------------------------------

there is no allowJump in here and when i resized the font, still it didn't fit in... it stretches the inside of the table column and background.

the "see details" results is perfect fit inside the table.
can we change something so that instead of displaying the questions in the jump menu it will only display the number of question?









-------------------------------------------------------------

another thing, i encode the data inside the code questions and answers...

there is one problem...


here:
radio button -> ()


() choice a is the blah blah blah of the boom
beep blah blah blah



so i'll edit it to look good.. to be like this...


() choice a is the blah blah blah blah of the boom

beep blah blah blah


indented. but i used the &nbsp; code inside the code between the boom and the beep... The problem is, instead of displaying what i encoded (example)...

as you can see you choose the worst answer This is wrong because you have to be this and that


it displays like this (whenever you put a code such as &nbsp; in it):

choice a is the blah blah blah of the boom
beep blah blah blah, is: Incorrect!


------------------

now everything works perfect aside from those choices with long sentences because i have to edit it to look neat and the only way is to put a space in it but if i insert a &nbsp code, it displays a different output...

jscheuer1
08-05-2005, 04:31 PM
I'm not sure why it is doing that but, if you use the alternate answer (hints) array and substitute:

\xa0

for:

&nbsp;

in the questions array, it will work.

askman
08-09-2005, 03:11 AM
in the jump menu, can i make long questions in two lines? example



1. What is your favorite questions of all questions in all of
the questions that you've been asked and everything.....blah?


so that it will fit in my table template?

i tried resizing the font, it didn't work still it extends outside the border that's why the table cell stretches automatically

see my attachment: "screen" on page 4
------------------------------------------

Another thing, can I do or edit something in the code that once the "see details" was clicked only this will appear:
(example result)
Total Points: 2 out of 3, for a score of: 67% Not Too Bad. You need to study more often.


because when i add the \xa0 on the lists of answers so i can indent the second line, it also happened in the "results" after the "see details" was clicked. It scrambled in there which is something that is not supposed to happened. so it would be better if i don't show their answers on each questions only the total points details...

----------------------------------




-----------------------------------------------------

jscheuer1
08-14-2005, 04:50 AM
Well if you upgrade to the latest v7 (quiz10.zip) you can set the width of the select box here:

#jump { /* style for "jump to question" select box */
background-color:#ffffbf;
width:300px;
}in the style section. This will truncate longer questions but take care of the layout problem. As far as the \xa0 for answers and the report goes, you can set the report to one column if need be and add this:

report=report.replace(/\xa0/g,' ')to the script after the last line that begins:

report+=Also, being succinct in the writing of your quiz is a virtue.

askman
08-15-2005, 11:39 AM
Thanks, I can use that.

One last problem, in some instances, whenever i'm trying to click "next" button....

for example in number 2 the question is too long



What is 20r q30j4troaf a3jt o;ja; jajf a,fdm mva
alsjfa ;sjfamfa;mfaf

() radio button
() radio button
() radio button
() radio button

(check answer)

Correct, because you are correct because afj2 f f4a
2352524 245254 22ktakfga kfk

then in the next question.... (it is a 1 line question, since it is a 1 line questions the buttons and the texts are moving ... which makes the reader distracted... because everytime they click next with one line in the next questions.. the radio buttons will go up after they clicked the "check answer" because i put the answers below the "check answer button" instead in the right part.

ok i'll attached the .txt of my code for u to see...

THANKS A LOT!

=======================================================

Another thing, just in case you know this.... and if it's easy for you, how to make an answer pad in - web format? What i mean is, once you typed inside a Text Box which is probably 3 inches width and 4 inches height... then it autoscrolls... once the user clicked "submit" it will retyped in another window... with the right font for example: Times New Roman, then after that there is a "print" button in there, it will print the entire question and the Answers? Is that possible?

askman
08-22-2005, 08:16 AM
you'll see it in a code, once you answer and clicked "check answer" the answer choices moved upwards and the space between the question and the choices was altered... it must not happen

Dezzer
01-27-2015, 02:41 PM
How can i change the font on this?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum