Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer added for each question #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 26 additions & 3 deletions account.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,30 @@
echo '</table></div>';

}?>
<!--<span id="countdown" class="timer"></span>

<span id="countdown"></span>
<script>
var sec=59;
function settimer(){
var remainsec=sec;
var remainmin=Math.floor((sec/60))%60;
if(remainsec<10){
remainsec = "0" + remainsec;
}
document.getElementById('countdown').innerHTML = remainmin + ":" + remainsec;
if(remainsec==0)
{
var button=document.getElementById('sub');
button.form.submit();
}
else
{
sec--;
}
}
var countdown=setInterval('settimer()',1000);
</script>
<!-- <span id="countdown" class="timer"></span>
<script>
var seconds = 40;
function secondPassed() {
Expand All @@ -133,7 +156,7 @@ function secondPassed() {
}
}
var countdownTimer = setInterval('secondPassed()', 1000);
</script>-->
</script> -->

<!--home closed-->

Expand Down Expand Up @@ -161,7 +184,7 @@ function secondPassed() {
$optionid=$row['optionid'];
echo'<input type="radio" name="ans" value="'.$optionid.'">'.$option.'<br /><br />';
}
echo'<br /><button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span>&nbsp;Submit</button></form></div>';
echo'<br /><button type="submit" class="btn btn-primary" id="sub"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span>&nbsp;Submit</button></form></div>';
//header("location:dash.php?q=4&step=2&eid=$id&n=$total");
}
//result display
Expand Down