The timer for the online exam countdown is created using JavaScript. If the timer reaches 0:0:00, it alerts the user and proceeds to the next webpage as shown below:
function myTimer(startVal,interval,outputId, dataField){
...
var current = this.value;
this.OutputCntrl.innerHTML = this.Hours(current) + ':' + this.Minutes(current) + ':' + this.Seconds(current);
this.currentTimeOut = setTimeout("Timer.go()", this.interval);
}
else {
window.alert("Time is up! Exam will proceed to next module.");
window.location = "Conf_English.aspx"
}
If there is still time remaining, options are displayed on the web form as shown below:
When the Proceed Button is clicked, the examinee's questions and answers (temporarily stored in a datatable) will be saved in the database.
The issue here is that the countdown timer is controlled by client-side script while the insertion of data is handled in the server-side code. Creating a JavaScript function to directly insert data into the database is not recommended due to security concerns in ASP.Net. Can someone suggest a better method for achieving this? Thank you.