Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By sanachr on
Hi every one,
i need to add a button on my quiz on the "quiz progress bar" near the timer countdown, that let user to stop/start countdown timer.
have you any idez to help.
thank you in advance
Sanachr
Comments
More details?
Please provide more detail inform of screen shot or which modules you are using? how are you configuring your quiz?
Thanks,
Vijay Thummar
my reply is not published,
my reply is not published, but i rewrite it...
i m using opigno quiz to create a test , and i added the jquery countdown to limit the duration of the test, you can see it here
i look for a solution that let me add a stop/start button for this timer, so the user can have a break and return after a while to his test.
thanks in advance
Sanachr
i need an event .click on the
i need an event .click on the div that contains the timer, that let me stop timer running.
thanks
i find this code on the
i find this code on the /contrib/jquery_countdown/jquery_countdown/jquery.countdown.js:
/* Pause a countdown widget at the current time.
Stop it running but remember and display the current time.
@param target (element) the containing division */
_pauseCountdown: function(target) {
this._hold(target, 'pause');
},
i have to call this function on an button.onclick event or .click with jquery...
have you an idea how to code it??
thanks
May this help
Make button or HTML something like
and your javascript code should be something like
You can change the HTML structure based on your requirement like button or toggle class etc.
Thanks,
Vijay Thummar
thank you, it works fine when
thank you, it works fine when i click on stop/resume, but when i refresh page, i find that the timer was working and it displays real time, as if it didn't stop.
you can have a look here and test it
thank you!!
You have to calculate "until"
You have to calculate "until" value, which is parameter of jQuery countdown on Pause/Resume and set it properly based on current time.
Thanks,
Vijay Thummar