Odoo Help


Set timer in website module

Umashankar Subramani
on 5/5/15, 5:32 AM 920 views


   I am working on a custom module, in which i have a doubt, i am trying to develop an online exam module, i need to display  timer in the respected page and after the completion of the time duration that particular page need to be closed. for eg. duration is 90min, the initial timer value is 90 and before completion it has to give some warning. How can i do this plz anyone give me some suggestion,,,,,,,,,,,,,,,



   I got the desired result , here is the javascript code i have used to display the timer in answer sheet and after completion of the timer it will automatically close the current page.


var seconds = 5400; #Total duration of the exam 90min

function secondPassed() {

var minutes = Math.round((seconds - 30)/60);

var remainingSeconds = seconds % 60;

if (remainingSeconds < 10) {

remainingSeconds = "0" + remainingSeconds;


document.getElementById('countdown').innerHTML = "Total Duration"+" " + minutes + ":" + remainingSeconds;

if (seconds == 0) {


document.getElementById('countdown').innerHTML = "Times Up Leave the Exam hall";


} else {




var countdownTimer = setInterval('secondPassed()', 1000);

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/5/15, 5:32 AM
Seen: 920 times
Last updated: 5/6/15, 8:49 AM