Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/lab/exp10/quizconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ correctchoices[5]='b'
/////Don't edit beyond here//////////////////////////

function gradeit(){
var incorrect=null
var correct=null
for (q=1;q<=totalquestions;q++){
var thequestion=eval("document.myquiz.question"+q)
for (c=0;c<thequestion.length;c++){
if (thequestion[c].checked==true)
actualchoices[q]=thequestion[c].value
}

if (actualchoices[q]!=correctchoices[q]){ //process an incorrect choice
if (incorrect==null)
incorrect=q
if (actualchoices[q]==correctchoices[q]){ //process an correct choice
if (correct==null)
correct=q
else
incorrect+="/"+q
correct+="/"+q
}
}

if (incorrect==null)
incorrect="a/b"
document.cookie='q='+incorrect
if (correct==null)
correct="a/b"
document.cookie='q='+correct
if (document.cookie=='')
alert("Your browser does not accept cookies. Please adjust your browser settings.")
else
Expand All @@ -54,8 +54,8 @@ win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<center><h3>Solution to Quiz</h3></center>')
win2.document.write('<center><font face="Arial">')
for (i=1;i<=totalquestions;i++){
for (temp=0;temp<incorrect.length;temp++){
if (i==incorrect[temp])
for (temp=0;temp<correct.length;temp++){
if (i==correct[temp])
wrong=1
}
if (wrong==1){
Expand All @@ -66,6 +66,6 @@ else
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>")
}
win2.document.write('</center></font>')
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5>")
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had correctly answered.</h5>")
win2.document.close()
}
18 changes: 9 additions & 9 deletions src/lab/exp10/results.htm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<td height="25"><p><input type="text" name="p" size="24"></td>
</tr>
<tr>
<td height="17" bgcolor="#D3FFA8"><strong><font face="Arial">The questions you got wrong:</font></strong></td>
<td height="17" bgcolor="#D3FFA8"><strong><font face="Arial">The questions you got correct:</font></strong></td>
<td height="17"><p><textarea name="T2" rows="3" cols="24" wrap="virtual"></textarea></td>
</tr>
<tr>
Expand Down Expand Up @@ -51,14 +51,14 @@

}

var incorrect=results[parse].split("=")
incorrect=incorrect[1].split("/")
if (incorrect[incorrect.length-1]=='b')
incorrect=""
document.result[0].value=totalquestions-incorrect.length+" out of "+totalquestions
document.result[2].value=(totalquestions-incorrect.length)/totalquestions*100+"%"
for (temp=0;temp<incorrect.length;temp++)
document.result[1].value+=incorrect[temp]+", "
var correct=results[parse].split("=")
correct=correct[1].split("/")
if (correct[correct.length-1]=='b')
correct=""
document.result[0].value=correct.length+" out of "+totalquestions
document.result[2].value=(correct.length)/totalquestions*100+"%"
for (temp=0;temp<correct.length;temp++)
document.result[1].value+=correct[temp]+", "


</script>
Expand Down
22 changes: 11 additions & 11 deletions src/lab/exp8/quizconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ correctchoices[4]='a'
/////Don't edit beyond here//////////////////////////

function gradeit(){
var incorrect=null
var correct=null
for (q=1;q<=totalquestions;q++){
var thequestion=eval("document.myquiz.question"+q)
for (c=0;c<thequestion.length;c++){
if (thequestion[c].checked==true)
actualchoices[q]=thequestion[c].value
}

if (actualchoices[q]!=correctchoices[q]){ //process an incorrect choice
if (incorrect==null)
incorrect=q
if (actualchoices[q]==correctchoices[q]){ //process an correct choice
if (correct==null)
correct=q
else
incorrect+="/"+q
correct+="/"+q
}
}

if (incorrect==null)
incorrect="a/b"
document.cookie='q='+incorrect
if (correct==null)
correct="a/b"
document.cookie='q='+correct
if (document.cookie=='')
alert("Your browser does not accept cookies. Please adjust your browser settings.")
else
Expand All @@ -53,8 +53,8 @@ win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<center><h3>Solution to Quiz</h3></center>')
win2.document.write('<center><font face="Arial">')
for (i=1;i<=totalquestions;i++){
for (temp=0;temp<incorrect.length;temp++){
if (i==incorrect[temp])
for (temp=0;temp<correct.length;temp++){
if (i==correct[temp])
wrong=1
}
if (wrong==1){
Expand All @@ -65,6 +65,6 @@ else
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>")
}
win2.document.write('</center></font>')
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5>")
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had correctly answered.</h5>")
win2.document.close()
}
18 changes: 9 additions & 9 deletions src/lab/exp8/results.htm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<td height="25"><p><input type="text" name="p" size="24"></td>
</tr>
<tr>
<td height="17" bgcolor="#D3FFA8"><strong><font face="Arial">The questions you got wrong:</font></strong></td>
<td height="17" bgcolor="#D3FFA8"><strong><font face="Arial">The questions you got correct:</font></strong></td>
<td height="17"><p><textarea name="T2" rows="3" cols="24" wrap="virtual"></textarea></td>
</tr>
<tr>
Expand Down Expand Up @@ -51,14 +51,14 @@

}

var incorrect=results[parse].split("=")
incorrect=incorrect[1].split("/")
if (incorrect[incorrect.length-1]=='b')
incorrect=""
document.result[0].value=totalquestions-incorrect.length+" out of "+totalquestions
document.result[2].value=(totalquestions-incorrect.length)/totalquestions*100+"%"
for (temp=0;temp<incorrect.length;temp++)
document.result[1].value+=incorrect[temp]+", "
var correct=results[parse].split("=")
correct=correct[1].split("/")
if (correct[correct.length-1]=='b')
correct=""
document.result[0].value=correct.length+" out of "+totalquestions
document.result[2].value=(correct.length)/totalquestions*100+"%"
for (temp=0;temp<correct.length;temp++)
document.result[1].value+=correct[temp]+", "


</script>
Expand Down
22 changes: 11 additions & 11 deletions src/lab/exp9/quizconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ correctchoices[3]='a'
/////Don't edit beyond here//////////////////////////

function gradeit(){
var incorrect=null
var correct=null
for (q=1;q<=totalquestions;q++){
var thequestion=eval("document.myquiz.question"+q)
for (c=0;c<thequestion.length;c++){
if (thequestion[c].checked==true)
actualchoices[q]=thequestion[c].value
}

if (actualchoices[q]!=correctchoices[q]){ //process an incorrect choice
if (incorrect==null)
incorrect=q
if (actualchoices[q]==correctchoices[q]){ //process an correct choice
if (correct==null)
correct=q
else
incorrect+="/"+q
correct+="/"+q
}
}

if (incorrect==null)
incorrect="a/b"
document.cookie='q='+incorrect
if (correct==null)
correct="a/b"
document.cookie='q='+correct
if (document.cookie=='')
alert("Your browser does not accept cookies. Please adjust your browser settings.")
else
Expand All @@ -52,8 +52,8 @@ win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<center><h3>Solution to Quiz</h3></center>')
win2.document.write('<center><font face="Arial">')
for (i=1;i<=totalquestions;i++){
for (temp=0;temp<incorrect.length;temp++){
if (i==incorrect[temp])
for (temp=0;temp<correct.length;temp++){
if (i==correct[temp])
wrong=1
}
if (wrong==1){
Expand All @@ -64,6 +64,6 @@ else
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>")
}
win2.document.write('</center></font>')
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5>")
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had correctly answered.</h5>")
win2.document.close()
}
18 changes: 9 additions & 9 deletions src/lab/exp9/results.htm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<td height="25"><p><input type="text" name="p" size="24"></td>
</tr>
<tr>
<td height="17" bgcolor="#D3FFA8"><strong><font face="Arial">The questions you got wrong:</font></strong></td>
<td height="17" bgcolor="#D3FFA8"><strong><font face="Arial">The questions you got correct:</font></strong></td>
<td height="17"><p><textarea name="T2" rows="3" cols="24" wrap="virtual"></textarea></td>
</tr>
<tr>
Expand Down Expand Up @@ -51,14 +51,14 @@

}

var incorrect=results[parse].split("=")
incorrect=incorrect[1].split("/")
if (incorrect[incorrect.length-1]=='b')
incorrect=""
document.result[0].value=totalquestions-incorrect.length+" out of "+totalquestions
document.result[2].value=(totalquestions-incorrect.length)/totalquestions*100+"%"
for (temp=0;temp<incorrect.length;temp++)
document.result[1].value+=incorrect[temp]+", "
var correct=results[parse].split("=")
correct=correct[1].split("/")
if (correct[correct.length-1]=='b')
correct=""
document.result[0].value=correct.length+" out of "+totalquestions
document.result[2].value=(correct.length)/totalquestions*100+"%"
for (temp=0;temp<correct.length;temp++)
document.result[1].value+=correct[temp]+", "


</script>
Expand Down