There was a requirement to show the time taken to take the test in the test module. I started off with something like this.
I used the following code on the test page:
[code]
<body onload="" starttime =" new" onunload="endTime = new Date(); document.form1.timerField.value = endTime.getTime() - startTime.getTime()">
[/code]
But this was somehow not capturing the endTime.
So I had resorted to functions as follows using javascript.
var endtime
var starttime
var tdiff
function doStart() {
starttime = new Date();
document.form1.startTime.value = starttime.valueOf();
}
function doEnd() {
endtime=new Date()
document.form1.endTime.value = endtime.valueOf() ;
diff();
document.form1.submit;
}
function diff()
{
tdiff = endtime.valueOf() - starttime.valueOf();
document.form1.timerField.value = round_decimals((tdiff/60000),2) ;
}
This displays the time taken to complete the test on the results page by using the Request.Form("timerField")
Subscribe to:
Post Comments (Atom)
Free Power BI Classes for Week 7 (Last)
Just completed the last class of the F ree P ower BI classes of this series. Today we have covered Adding a canvas background Adding Imag...
-
From the past 3 days I have been working on resolving merged and hidden cells issues when an SSRS reports is exported to excel. ...
-
When I tried to access the report manager after a fresh installation of Sql Server Reporting Serivces 2016 using the url http://localhost/R...
-
I was trying to build an SSIS package that one of my colleagues has created. The first error that was thrown was as below: Exception des...
No comments:
Post a Comment