Click to See Complete Forum and Search --> : woundering about this code


ksamri
07-18-2003, 08:14 AM
I been trying to change this code so it would start count down from 60 mints. currently is set to start with 10 seconds and moves to next question. I found this code somewhere and will be very useful for me if anyone can make this change.
thanks in advance.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E X A M C O N D U C TO R</title>
</head>
<body onload="RilTimer()" bgcolor="#C0C0C0">
<%

dim skip110(60, 2)
dim ans110(60,6)

public i
load()
public function load()
chphead110 = "Cellular Respiration"
skip110(1, 1) = "1. Respiration is"
skip110(1, 2) = "Amphibolic'"
ans110(1, 1) = "Catabolic"
ans110(1, 2) = "Anabolic"
ans110(1, 3) = "Amphibolic"
ans110(1, 4) = "Light sensitive'"
ans110(1, 5) = "Endothermic"

skip110(2, 1) = "2. Respiration takes place in plants in"
skip110(2, 2) = "Living cells during day and night"
ans110(2, 1) = "All cells"
ans110(2, 2) = "All living cells during day only"
ans110(2, 3) = "All living cells during night only"
ans110(2, 4) = "Living cells during day and night"
ans110(2, 5) = "Specialized organs"


skip110(50, 1) = "50. Why fleshy fruits give out pleasant odour"
skip110(50, 2) = "Esters are produced in fleshy fruits by alcohol produced in the interior parts of fleshy fruits by anaerobic respiration,which reacts with acids and produce the esters"
ans110(50, 1) = "Fleshy fruits contain essential oils"
ans110(50, 2) = "Esters are produced in fleshy fruits by alcohol produced in the interior parts of fleshy fruits by anaerobic respiration,which reacts with acids and produce the esters"
ans110(50, 3) = "Statement is not correct"
ans110(50, 4) = "Volatile oil present in outer pericarp"
ans110(50, 5) = "All above"

skip110(51, 1) = "51. Anaerobic respiration was originally reported by"
skip110(51, 2) = "Kostycehev"
ans110(51, 1) = "Pfeffer"
ans110(51, 2) = "Pasteur"
ans110(51, 3) = "Kostycehev"
ans110(51, 4) = "Calvin"
ans110(51, 5) = "Strasburgher"

skip110(52, 1) = "52. Which of the following intermdiates functions as a raw material for protein synthesis"
skip110(52, 2) = "Malic acid"
ans110(52, 1) = "Succnic acid"
ans110(52, 2) = "Oxaloacetic acid"
ans110(52, 3) = "Malic acid"
ans110(52, 4) = "Fumaric acid"
ans110(52, 5) = "â Ketoglutaric acid"

skip110(53, 1) = "53. The amount of energy released in anaerobic repiration is less than aerobic respiration because"
skip110(53, 2) = "Only partial oxidation of C-atoms takes place and NADHÅ does not yeild ATP"
ans110(53, 1) = "A large quantity of energy is utilised by the enzymes involved "
ans110(53, 2) = "Only partial oxidation of C-atoms takes place and NADHÅ does not yeild ATP"
ans110(53, 3) = "Organisms involved in anaerobic oxidation consumes a lot of energy"
ans110(53, 4) = "All above"
ans110(53, 5) = "Energy release is hindered by micro organism"

skip110(54, 1) = "54. Pick out the correct sequence of electron acceptors in ATP synthesis"
skip110(54, 2) = "Cyto b,c,a,a3"
ans110(54, 1) = "Cyto c,a,a3,b"
ans110(54, 2) = "Cyto a,c,b,a3"
ans110(54, 3) = "Cyto b,c,a,a3"
ans110(54, 4) = "Cyto c,a,a3,b"
ans110(54, 5) = "Any one"

skip110(55, 1) = "55. Energy released in bioluminiscence is in the form of"
skip110(55, 2) = "Light"
ans110(55, 1) = "Light"
ans110(55, 2) = "Heat"
ans110(55, 3) = "Fluorescence"
ans110(55, 4) = "Phosphorescence"
ans110(55, 5) = "None above"

skip110(56, 1) = "56. Which one is iron-porphyrin-protein complex"
skip110(56, 2) = "Cytochrome"
ans110(56, 1) = "Chlorophyll"
ans110(56, 2) = "Cytochrome"
ans110(56, 3) = "Phytochrome"
ans110(56, 4) = "Both A and C"
ans110(56, 5) = "PFr molecule"

skip110(57, 1) = "57. How many pair of protons are pushed out when two electrons pass over electron transport chain"
skip110(57, 2) = "Three pairs"
ans110(57, 1) = "One pair"
ans110(57, 2) = "Two pairs"
ans110(57, 3) = "Three pairs"
ans110(57, 4) = "Four pairs"
ans110(57, 5) = "One only"

skip110(58, 1) = "58. Which observation supports the statement that Mitochondrion is the power house of the cell"
skip110(58, 2) = "It contains ATP"
ans110(58, 1) = "It has a double membrane structure"
ans110(58, 2) = "It has christae-internae"
ans110(58, 3) = "Enzymes of Kreb's cycle are present in it"
ans110(58, 4) = "It contains ATP"
ans110(58, 5) = "It is universal in occurence in living cells"

skip110(59, 1) = "59. Enzymes of Kreb's cycle are located in"
skip110(59, 2) = "Inner matrix of the mitochondria"
ans110(59, 1) = "Inner matrix of the mitochondria"
ans110(59, 2) = "Cytoplasm"
ans110(59, 3) = "Inner membrane of mitochondria"
ans110(59, 4) = "Perimitochondrial space"
ans110(59, 5) = "Outer membrane of mitochondria"

skip110(60, 1) = "60. Which are the chemicals involved in handing over the protons to the outer mitochondrial chamber"
skip110(60, 2) = "Fes-Fes"
ans110(60, 1) = "Fes-Fes"
ans110(60, 2) = "FAD-FMN"
ans110(60, 3) = "FMN and CoQ"
ans110(60, 4) = "FES-FMN"
ans110(60, 5) = "FMN alone"

End Function

i=request.item("cook")
if(i="") then
i=1
end if
'====================================
public markflag
public marks
public marks1
markflag=REQUEST.item("R1")
marks=request.item("mark")
if marks<>"" then
if i>1 and markflag <> 6 then
if skip110(i-1, 2)=ans110(i-1, markflag) then
marks1=marks+4
else
marks1=marks-1
end if
else
marks1=marks+0
end if
else
marks1=0
end if
'===================================

%>

<% if i < 50 then

%>
<center><form name="theTimer" action="testconductor2.asp" method="POST" onsubmit= "atsubmit()" ><table width="261">
<tr>
<td align=center width="251">
<font color="#FF0000"><font face="Verdana" size="2"><b>Time
Remaining&nbsp; </b></font><input type=text name="theTime" size=5 ></font>
</td>
</tr>
</table>&nbsp;
<table border="1" width="100%" height="203">
<tr>
<td width="100%" height="19"><font color="#FF0000"><%response.write(skip110(i,1))%></font></td>
</tr>
<tr>
<td width="100%" height="14"><font color="#FF0000"><input type="radio" value="1" name="R1"><%Response.write(ans110(i,1))%></font></td>
<input type="hidden" name="mark" value=<%response.write(marks1)%>>
</tr>
<tr>
<td width="100%" height="14"><font color="#FF0000"><input type="radio" value="2" name="R1"><%Response.write(ans110(i,2))%></font></td>
</tr>
<tr>
<td width="100%" height="14"><font color="#FF0000"><input type="radio" value="3" name="R1"><%Response.write(ans110(i,3))%></font></td>
</tr>
<tr>
<td width="100%" height="14"><font color="#FF0000"><input type="radio" value="4" name="R1"><%Response.write(ans110(i,4))%></font></td>
</tr>
<tr>
<td width="100%" height="14"><font color="#FF0000"><input type="radio" value="5" checked name="R1"><%Response.write(ans110(i,5))%></font></td>
</tr>
<tr>
<td width="100%" height="19">
<font color="#FF0000">
<input type="radio" name="R1" value="6" checked>Not Attempting</font>
</td>
</tr>
<tr>
<td width="100%" height="22">

<p align="center"><font color="#FF0000"><input type="submit" value="Next" name="B1">
<input type="hidden" value='<%response.write(i+1)%>' name="cook")>

</font>

</td>
</tr>
<tr>
<td width="100%" height="19">
</td>
</tr>
</table>
</form></center>
<p></p><font face="Bookman Old Style" size="10">
<%
else
response.write("End Of The Examinaton Yor Score Is ")
response.write(response.write(marks1))
end if%>
</font>
<p><b><font face="Bookman Old Style" size="2"><a href="javascript:window.close()">Click
Here to Close</a></font></b></p>
<script language="JavaScript">
var timeE=1;
var tStart = 20000;
var seconds=10;
var minutes=10
function RilTimer()
{
seconds--;
if (seconds<1)
{

minutes--;
seconds=10;

document.theTimer.submit();
}

else
{
document.theTimer.theTime.value = seconds;
setTimeout("RilTimer()", 1000);

}


}



var mymessage = "Sorry, Rilov protected this page";

function rilovclickcheck(keyp){
if (navigator.appName == "Netscape" && keyp.which == 3) {
alert(mymessage);
return false;
}

if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {
alert(mymessage);
return false;
}
}

document.onmousedown = rilovclickcheck;
function atsubmit()
{
timeE=100
}
</script>

Moderators Note
This is considered extremely rude to post the same question multiple times,and on top of that you have been responded in the previous thread for this question.
Both threads have been merged.

ksamri
07-19-2003, 08:59 AM
I posted this code on 18 , no one responded to this just woundering if this is difficult to fix or something else. Please at least let me know if is not doable because I been trying for few days with no luck.
All I need is to change the countdown time to start from 60 mints .currently is set at 10 sec/question total 10 mints.

thanks for any response.
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>E X A M C O N D U C TO R</title>
</head>
<body onload="RilTimer()" bgcolor="#C0C0C0">
<%

dim skip110(60, 2)
dim ans110(60,6)

public i
load()
public function load()
chphead110 = "Cellular Respiration"
skip110(1, 1) = "1. Respiration is"
skip110(1, 2) = "Amphibolic'"
ans110(1, 1) = "Catabolic"
ans110(1, 2) = "Anabolic"
ans110(1, 3) = "Amphibolic"
ans110(1, 4) = "Light sensitive'"
ans110(1, 5) = "Endothermic"

skip110(2, 1) = "2. Respiration takes place in plants in"
skip110(2, 2) = "Living cells during day and night"
ans110(2, 1) = "All cells"
ans110(2, 2) = "All living cells during day only"
ans110(2, 3) = "All living cells during night only"
ans110(2, 4) = "Living cells during day and night"
ans110(2, 5) = "Specialized organs"


skip110(50, 1) = "50. Why fleshy fruits give out pleasant odour"
skip110(50, 2) = "Esters are produced in fleshy fruits by alcohol produced in the interior parts of fleshy fruits by anaerobic respiration,which reacts with acids and produce the esters"
ans110(50, 1) = "Fleshy fruits contain essential oils"
ans110(50, 2) = "Esters are produced in fleshy fruits by alcohol produced in the interior parts of fleshy fruits by anaerobic respiration,which reacts with acids and produce the esters"
ans110(50, 3) = "Statement is not correct"
ans110(50, 4) = "Volatile oil present in outer pericarp"
ans110(50, 5) = "All above"

skip110(51, 1) = "51. Anaerobic respiration was originally reported by"
skip110(51, 2) = "Kostycehev"
ans110(51, 1) = "Pfeffer"
ans110(51, 2) = "Pasteur"
ans110(51, 3) = "Kostycehev"
ans110(51, 4) = "Calvin"
ans110(51, 5) = "Strasburgher"

skip110(52, 1) = "52. Which of the following intermdiates functions as a raw material for protein synthesis"
skip110(52, 2) = "Malic acid"
ans110(52, 1) = "Succnic acid"
ans110(52, 2) = "Oxaloacetic acid"
ans110(52, 3) = "Malic acid"
ans110(52, 4) = "Fumaric acid"
ans110(52, 5) = "â Ketoglutaric acid"

skip110(53, 1) = "53. The amount of energy released in anaerobic repiration is less than aerobic respiration because"
skip110(53, 2) = "Only partial oxidation of C-atoms takes place and NADHÅ does not yeild ATP"
ans110(53, 1) = "A large quantity of energy is utilised by the enzymes involved "
ans110(53, 2) = "Only partial oxidation of C-atoms takes place and NADHÅ does not yeild ATP"
ans110(53, 3) = "Organisms involved in anaerobic oxidation consumes a lot of energy"
ans110(53, 4) = "All above"
ans110(53, 5) = "Energy release is hindered by micro organism"

skip110(54, 1) = "54. Pick out the correct sequence of electron acceptors in ATP synthesis"
skip110(54, 2) = "Cyto b,c,a,a3"
ans110(54, 1) = "Cyto c,a,a3,b"
ans110(54, 2) = "Cyto a,c,b,a3"
ans110(54, 3) = "Cyto b,c,a,a3"
ans110(54, 4) = "Cyto c,a,a3,b"
ans110(54, 5) = "Any one"

skip110(55, 1) = "55. Energy released in bioluminiscence is in the form of"
skip110(55, 2) = "Light"
ans110(55, 1) = "Light"
ans110(55, 2) = "Heat"
ans110(55, 3) = "Fluorescence"
ans110(55, 4) = "Phosphorescence"
ans110(55, 5) = "None above"

skip110(56, 1) = "56. Which one is iron-porphyrin-protein complex"
skip110(56, 2) = "Cytochrome"
ans110(56, 1) = "Chlorophyll"
ans110(56, 2) = "Cytochrome"
ans110(56, 3) = "Phytochrome"
ans110(56, 4) = "Both A and C"
ans110(56, 5) = "PFr molecule"

skip110(57, 1) = "57. How many pair of protons are pushed out when two electrons pass over electron transport chain"
skip110(57, 2) = "Three pairs"
ans110(57, 1) = "One pair"
ans110(57, 2) = "Two pairs"
ans110(57, 3) = "Three pairs"
ans110(57, 4) = "Four pairs"
ans110(57, 5) = "One only"

skip110(58, 1) = "58. Which observation supports the statement that Mitochondrion is the power house of the cell"
skip110(58, 2) = "It contains ATP"
ans110(58, 1) = "It has a double membrane structure"
ans110(58, 2) = "It has christae-internae"
ans110(58, 3) = "Enzymes of Kreb's cycle are present in it"
ans110(58, 4) = "It contains ATP"
ans110(58, 5) = "It is universal in occurence in living cells"

skip110(59, 1) = "59. Enzymes of Kreb's cycle are located in"
skip110(59, 2) = "Inner matrix of the mitochondria"
ans110(59, 1) = "Inner matrix of the mitochondria"
ans110(59, 2) = "Cytoplasm"
ans110(59, 3) = "Inner membrane of mitochondria"
ans110(59, 4) = "Perimitochondrial space"
ans110(59, 5) = "Outer membrane of mitochondria"

skip110(60, 1) = "60. Which are the chemicals involved in handing over the protons to the outer mitochondrial chamber"
skip110(60, 2) = "Fes-Fes"
ans110(60, 1) = "Fes-Fes"
ans110(60, 2) = "FAD-FMN"
ans110(60, 3) = "FMN and CoQ"
ans110(60, 4) = "FES-FMN"
ans110(60, 5) = "FMN alone"

End Function

i=request.item("cook")
if(i="") then
i=1
end if
'====================================
public markflag
public marks
public marks1
markflag=REQUEST.item("R1")
marks=request.item("mark")
if marks<>"" then
if i>1 and markflag <> 6 then
if skip110(i-1, 2)=ans110(i-1, markflag) then
marks1=marks+4
else
marks1=marks-1
end if
else
marks1=marks+0
end if
else
marks1=0
end if
'===================================

%>

<% if i < 50 then

%>
<center><form name="theTimer" action="testconductor2.asp" method="POST" onsubmit= "atsubmit()" ><table width="261">
<tr>
<td align=center width="251">
<font color="#FF0000"><font face="Verdana" size="2"><b>Time
Remaining </b></font><input type=text name="theTime" size=5 ></font>
</td>
</tr>
</table>
<table border="1" width="100%" height="203">
<tr>
<td width="100%" height="19"><font color="#FF0000"><%response.write(skip110(i,1))%></font></td>
</tr>
<tr>
<td width="100%" height="14"><font color="#FF0000"><input type="radio" value="1" name="R1"><%Response.write(ans110(i,1))%></font></td>
<input type="hidden" name="mark" value=<%response.write(marks1)%>>
</tr>
<tr>
<td width="100%" height="14"><font color="#FF0000"><input type="radio" value="2" name="R1"><%Response.write(ans110(i,2))%></font></td>
</tr>
<tr>
<td width="100%" height="14"><font color="#FF0000"><input type="radio" value="3" name="R1"><%Response.write(ans110(i,3))%></font></td>
</tr>
<tr>
<td width="100%" height="14"><font color="#FF0000"><input type="radio" value="4" name="R1"><%Response.write(ans110(i,4))%></font></td>
</tr>
<tr>
<td width="100%" height="14"><font color="#FF0000"><input type="radio" value="5" checked name="R1"><%Response.write(ans110(i,5))%></font></td>
</tr>
<tr>
<td width="100%" height="19">
<font color="#FF0000">
<input type="radio" name="R1" value="6" checked>Not Attempting</font>
</td>
</tr>
<tr>
<td width="100%" height="22">

<p align="center"><font color="#FF0000"><input type="submit" value="Next" name="B1">
<input type="hidden" value='<%response.write(i+1)%>' name="cook")>

</font>

</td>
</tr>
<tr>
<td width="100%" height="19">
</td>
</tr>
</table>
</form></center>
<p></p><font face="Bookman Old Style" size="10">
<%
else
response.write("End Of The Examinaton Yor Score Is ")
response.write(response.write(marks1))
end if%>
</font>
<p><b><font face="Bookman Old Style" size="2"><a href="javascript:window.close()">Click
Here to Close</a></font></b></p>
<script language="JavaScript">
var timeE=1;
var tStart = 20000;
var seconds=10;
var minutes=10
function RilTimer()
{
seconds--;
if (seconds<1)
{

minutes--;
seconds=10;

document.theTimer.submit();
}

else
{
document.theTimer.theTime.value = seconds;
setTimeout("RilTimer()", 1000);

}


}



var mymessage = "Sorry, Rilov protected this page";

function rilovclickcheck(keyp){
if (navigator.appName == "Netscape" && keyp.which == 3) {
alert(mymessage);
return false;
}

if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {
alert(mymessage);
return false;
}
}

document.onmousedown = rilovclickcheck;
function atsubmit()
{
timeE=100
}
</script>

Khalid Ali
07-19-2003, 10:10 AM
Reason (I thin) no body responded was that there were way too many lines to go through in your code,which is kinda intimidating for a volunteer work,,anyways..

locat this this line of code in your code

<script type="text/javascript">

</script>

and replace everythying in between those tags inclusive of those tags themselves with the code below..


<script language="JavaScript">
var timeE=1;
var tStart = 20000;
var seconds=60;
var minutes=59
function RilTimer(){
seconds--;

if (seconds<1){
minutes--;
seconds=60;
document.theTimer.submit();
}else{
var timeStr = ((minutes<10)?"0"+minutes:minutes)+":"+((seconds<10)?"0"+seconds:seconds);
document.theTimer.theTime.value = timeStr;
setTimeout("RilTimer()", 1000);
}
}

var mymessage = "Sorry, Rilov protected this page";

function rilovclickcheck(keyp){
if (navigator.appName == "Netscape" && keyp.which == 3) {
alert(mymessage);
return false;
}

if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {
alert(mymessage);
return false;
}
}

document.onmousedown = rilovclickcheck;
function atsubmit(){
timeE=100
}
</script>

ksamri
07-19-2003, 10:37 AM
thanks Khalid you are a good man
appreciate your response and I'll try it.

Khalid Ali
07-19-2003, 10:57 AM
:p
You are welcome

ksamri
07-19-2003, 10:58 AM
it worked but now countdown start at 59:59 and when it gets to 59:00 it changes to 59:59 again so minutes does move down.
any suggestion
thanks

ksamri
07-19-2003, 10:59 AM
sorry for repost but it should be minutes does not.

it worked but now countdown start at 59:59 and when it gets to 59:00 it changes to 59:59 again so minutes does not move down.
any suggestion
thanks

Khalid Ali
07-19-2003, 03:16 PM
You have to look at the logic of the program..It seems to me that you intent to have th ecounter sapn over a number of webpages where user will sill out data....however,if my assumption is true then in the logic youare using that will never heppen.Offcourse if you only want this page to be open for a period of 60 minutes and then forward to the next page then code will work..just replace this part of the code

function RilTimer(){
seconds--;

if (seconds<1){
minutes--;
seconds=60;
document.theTimer.submit();
}else{
var timeStr = ((minutes<10)?"0"+minutes:minutes)+":"+((seconds<10)?"0"+seconds:seconds);
document.theTimer.theTime.value = timeStr;
setTimeout("RilTimer()", 1000);
}
}

with this one

function RilTimer(){
seconds--;
seconds= (seconds<1)?(seconds=60,minutes--):seconds;
minutes =(minutes<1)?document.theTimer.submit():minutes;
var timeStr = ((minutes<10)?"0"+minutes:minutes)+":"+((seconds<10)?"0"+seconds:seconds);
document.theTimer.theTime.value = timeStr;
setTimeout("RilTimer()", 1000);
}

Mr J
07-20-2003, 12:35 PM
Just alter

var seconds=10;

to whatever you want it to be

60 minites = 3600 seconds