Count down Timer in jsp

We are developing an Online Examination System. We are using jsp and servlets.
We need a count down timer which will start as user starts the test. When user refreshes the page during test, timer should continue counting and must not reset the counter. At the end of the test it will submit automatically.
Does jsp provide built in facility to manage timer?

Does jsp provide built in facility to manage timer?There is no build in facility to manage timer, but all you have to do is track it at the server end.
ie - not in javascript.
Store a timestamp for the user for when they started the test. Either in session, or in a database.
Then whenever they refresh their page, you look at the current time, the time they started the test and display the appropriate value.
By all means you can have a javascript countdown on the page, but the authorative time should be on the server.

Similar Messages

  • Count Down Timer in Webdynpro

    Hello All,
    I am in need to implement a <b>count down timer</b> for an online application developed in Webdynpro. The count down timer logic is available as a java script file.
    Options tried out till now..
    1. Included the the html file with java script into src/mimes/components
    2. Create a IFrame and provide the src file as the html file.
    Works fine. But ...
    - The problem with this option is when any action happens (eg. a button click), the same refreshes the entire view that makes the timer to start from first.
    Does anybody have any alternative solutions to implement this functionality. Kindly reply.
    Thanks & Regards,
    Venkat.

    Venkat,
    Then it seems the scenario is possible without JS at all.
    1. Bind <b>delay</b> of <b>TimedTrigger</b> to read-only calculated context attribute of type <b>integer</b>, say its name is <i>Timeout</i>.
    2. Define private view controller variable startTime:
    //@@begin others
    private long startTime;
    //@@end
    3. In wdDoInit initialize this variable as:
    startTime = System.currentTimeMillis();
    4. In generated getter for <i>Timeout</i> attribute write the following:
    return Math.max(1, (int) ( ( System.currentTimeMillis() - startTime ) / 1000 - 7200));
    This way TimedTrigger delay will be updated after every client-server request, so even user hit some buttons or links, total delay will be approx. the same. The only way to stop this self-updating timer is to navigate away from view -- answer to questions andl click submit. Otherwise TimedTrigger will fire event.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • Count down time

    Can someone help me with a count down time.
    in 30 secs or so. It will alarm and stopped.
    can someone show me how to
    1. turn on alarm.
    2. stop alarm (automatically)
    and repeat count down till stop button is pushed.
    i am not too familiar with RUN COMMAND. how would i automatically tell it to stop alarming after it was turned on?
    Solved!
    Go to Solution.
    Attachments:
    Countdown with alarm.zip ‏29 KB

    ben64 wrote:
    Use a state machine architecture
    state 1: countdown (stop pressed T: stop, F: play alarm if countdown finished)
    state 2: play alarm  (stop pressed T: stop, F:countdown)
    state 3: stop
    To play the alarm use Play Sound File.vi from the Graphic and Sound palette (Sound - Output sub-palette). After this vi you can set another countdown for the duration of the alarm and then use the Sound Output Clear.vi to stop the alarm from playing.
    For the countdown you can also used the Elapsed TIme express vi. For the GUI to be responsive never set a large loop time wait, loop every 100ms and check if stop was pressed or time is elapsed.
    Ben64
    for more information see my tag "Grandma"
    Jeff

  • Uninterruptible count down timer!

    Hi
    I'm a newbe in Labview and I have the followning problem: When a event occurs a signal should should "stay high" for at least 30 sec.
    So I need an uninterruptible count down timer! - that is when an event accours (boolean true/false) a count down timer should start! and NOT stop even when the boolean changes!! I have tried different approaches! and I can figure out have to create a count down timer! but NOT one that keeps going when the boolean "changes back"?????  hope you know what I mean?

    SInce you say "for at least 30 sec", the precision does not seem too important and its not worth to spin fast loops.
    You could just grab the current millisecond, then in a leisurly loop check every 500ms or so if the elapsed time exceeeds your timeout.
    You could just set an occurence when the event occurs, then use "wait on occurence" with the desired time wired as timeout. Now just wait until it times out.
    Another possibility would be to use the timeout case of an event structure.
    LabVIEW Champion . Do more with less code and in less time .

  • Count Down Time Zone?

    Hey all, i have come to this fourm a few times and every time
    i posted help i got it and i got the right help to. So here i am
    back again. Now here my problem. i made this count down for a
    certain event. (yes i got help from someone) and it works fine i
    made all the images it works great,,,so i though then i thought id
    experament. So i changed my computers time zone and guess what. The
    Time changed on the count down. Can i make my count down'er', count
    down from a specific time zone so it will count down and be the
    same for everyone? so no matter what time zone you have it will
    ONLY be for a certain type of time zone? Heres my Count down so
    far;
    http://snro.ifastnet.com/wipe.html
    And heres the script i have for my count down. Can someone
    give me a better code, so it will keep my counter the exact same
    just make it count down from only 1 specific Time zone? (AS below)
    quote:
    stop();
    currentDate = new Date();
    thisYear = currentDate.getFullYear();
    // Date( year, month-1, date [, hour [, minute [, second [,
    millisecond]]]])
    eventDate = new Date(thisYear, 9, 28, 12);
    eventMillisecs = eventDate.getTime();
    counter.onEnterFrame = function(){
    currentDate = new Date();
    currentMillisecs = currentDate.getTime();
    this.msecs = eventMillisecs - currentMillisecs;
    if (this.msecs <= 0){
    play();
    return;
    this.secs = Math.floor(this.msecs/1000);
    this.mins = Math.floor(this.secs/60);
    this.hours = Math.floor(this.mins/60);
    this.days = Math.floor(this.hours/24);
    this.msecs = string(this.msecs % 1000);
    this.secs = string(this.secs % 60);
    this.mins = string(this.mins % 60);
    this.hours = string(this.hours % 24);
    this.days = string(this.days);
    while (this.msecs.length < 3) this.msecs = "0" +
    this.msecs;
    if (this.secs.length < 2) this.secs = "0" + this.secs;
    if (this.mins.length < 2) this.mins = "0" + this.mins;
    if (this.hours.length < 2) this.hours = "0" + this.hours;
    while (this.days.length < 3) this.days = "0" + this.days;
    for(movie in this){
    if (this[movie]._parent == this)
    this[movie].evaluateFrameFrom(this);
    MovieClip.prototype.evaluateFrameFrom =
    function(variableClip){
    var nameArray = this._name.split("_");
    var numberSet = variableClip[nameArray[0]];
    var character = number(nameArray[1]);
    var frame = 1 + number(numberSet.charAt(character));
    if (this._currentframe != frame) this.gotoAndStop(frame);
    Thanks!
    Edit** If you can the time zone i need it clocked to is
    (GMT-06:00) Central Time (US & Canada)

    "Pitchsole" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hey all, i have come to this fourm a few times and every
    time i posted
    > help i
    > got it and i got the right help to. So here i am back
    again. Now here my
    > problem. i made this count down for a certain event.
    (yes i got help from
    > someone) and it works fine i made all the images it
    works great,,,so i
    > though
    > then i thought id experament. So i changed my computers
    time zone and
    > guess
    > what. The Time changed on the count down. Can i make my
    count down'er',
    > count
    > down from a specific time zone so it will count down and
    be the same for
    > everyone? so no matter what time zone you have it will
    ONLY be for a
    > certain
    > type of time zone? Heres my Count down so far;
    >
    >
    http://snro.ifastnet.com/wipe.html
    >
    > And heres the script i have for my count down. Can
    someone give me a
    > better
    > code, so it will keep my counter the exact same just
    make it count down
    > from
    > only 1 specific Time zone? (AS below)
    >
    >
    quote:
    stop();
    >
    > currentDate = new Date();
    > thisYear = currentDate.getFullYear();
    >
    > // Date( year, month-1, date [, hour [, minute [, second
    > millisecond]]]])
    > eventDate = new Date(thisYear, 9, 28, 12);
    > eventMillisecs = eventDate.getTime();
    >
    > counter.onEnterFrame = function(){
    > currentDate = new Date();
    > currentMillisecs = currentDate.getTime();
    > this.msecs = eventMillisecs - currentMillisecs;
    > if (this.msecs <= 0){
    > play();
    > return;
    > }
    > this.secs = Math.floor(this.msecs/1000);
    > this.mins = Math.floor(this.secs/60);
    > this.hours = Math.floor(this.mins/60);
    > this.days = Math.floor(this.hours/24);
    > this.msecs = string(this.msecs % 1000);
    > this.secs = string(this.secs % 60);
    > this.mins = string(this.mins % 60);
    > this.hours = string(this.hours % 24);
    > this.days = string(this.days);
    >
    > while (this.msecs.length < 3) this.msecs = "0" +
    this.msecs;
    > if (this.secs.length < 2) this.secs = "0" +
    this.secs;
    > if (this.mins.length < 2) this.mins = "0" +
    this.mins;
    > if (this.hours.length < 2) this.hours = "0" +
    this.hours;
    > while (this.days.length < 3) this.days = "0" +
    this.days;
    >
    > for(movie in this){
    > if (this[movie]._parent == this)
    this[movie].evaluateFrameFrom(this);
    > }
    > };
    >
    > MovieClip.prototype.evaluateFrameFrom =
    function(variableClip){
    > var nameArray = this._name.split("_");
    > var numberSet = variableClip[nameArray[0]];
    > var character = number(nameArray[1]);
    > var frame = 1 + number(numberSet.charAt(character));
    > if (this._currentframe != frame)
    this.gotoAndStop(frame);
    > };
    >
    > Thanks!
    >
    To let you be the one to further experiment I will point you
    in the right
    direction.
    http://www.adobe.com/livedocs/flashlite/2/main/wwhelp/wwhimpl/common/html/wwhelp.htm?conte xt=LiveDocs_Parts&file=00000468.html
    Use GMT as your main reference for everyone, then offeset
    that time to your
    timezone.

  • Count down timer

    I need some help. I have a web site that till tell the blight
    of cats and
    dogs in shelter and rescues that have a short time to live
    before they are
    put down to make room for other stray pets.
    I need a dynamic countdown timer in black with white numbers
    that countdown
    days, hours, and minutes (possibly seconds for dramatic
    effect). Anywhere I
    can find such a movie? I found a bunch of cheesy ones online
    and a bunch
    that do way too much.
    When the rescue or shelter moves the pet to LCP status, they
    will enter a
    date into the database. I need the time to use that as the
    starting point
    and count down till that date and time arrives. I am using
    coldfusion as the
    dev coding for the site.
    Please let me know where I can find such a movie or how much
    it will cost to
    have one done.
    Thanks.

    I did a search on FlashKit for you...take a look at:
    http://www.flashkit.com/search.php?term=countdown+timer&cat=movies&version=--&per=10&field =Description&orderby=Rating&andor=or&page=1&submit=Submit
    Hope this helps ;)

  • Count Down Timer By Button Windows Phone 8.1 C#

    I want to click a button and have a textblock count down from for example 1 minute.

    This is a simple sample:
    xaml
    <Page
    x:Class="CountDownApp01.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:CountDownApp01"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Grid>
    <Grid.RowDefinitions >
    <RowDefinition Height="*"/>
    <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="48" x:Name="txt"/>
    <Button Grid.Row="1" Content="start" Click="Button_Click" x:Name="button"/>
    </Grid>
    </Page>
    C#
    namespace CountDownApp01
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    private DispatcherTimer timer;
    private int basetime;
    public MainPage()
    this.InitializeComponent();
    this.NavigationCacheMode = NavigationCacheMode.Required;
    timer = new DispatcherTimer();
    timer.Interval = new TimeSpan(0, 0, 1);
    timer.Tick += timer_Tick;
    void timer_Tick(object sender, object e)
    basetime = basetime - 1;
    txt.Text = basetime.ToString();
    if (basetime ==0 )
    timer.Stop();
    button.IsEnabled = true;
    protected override void OnNavigatedTo(NavigationEventArgs e)
    private void Button_Click(object sender, RoutedEventArgs e)
    basetime = 60;
    button.IsEnabled = false;
    txt.Text = basetime.ToString();
    timer.Start();
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • I ignored a message saying I was the millionth visitor. Was this wise? The message gave a long code, two telephone numbers (one in Paris) and a count-down time limit. It was this that made me suspicious.

    A few days ago I received a message saying I was the millionth visitor and had won a prize which included money and a disneyland visit. I was given a long code, two telephone numbers (one in Paris) and a timed count-down of a few seconds (when I picked up the message). This made me suspicious and I ignored the whole thing. Was this wise?

    Yes, ignoring a message like that was wise.
    Maybe you are interested in a deal on real estate in southern Florida, like about halfway between Naples and Fort Lauderdale just south of I-75?

  • N97 no stop watch or count down timer?

    There are some basic functions you expect on every phone, not least on the flag ship of Nokia. I havn't had a nokia for a while but my last one had both timer and stop watch, I was really surprised to find these functions were missing and that you have to pay for third party apps to get these functions.
    There are several threads on this forum about these apps missing from other S60 models. Are there any plans on releasing these apps or do I need to get the freeking egg timer? 

    Thanks for that, great app! Simple and functional.
    It has a bug in it though. When the counter gets down to 5 sec or so, the time changes to 9.59.59. It happened twice the first two minutes I tested the app but I haven't been able to reproduce it now for a while now. Hope it doesn't happen when the cake is in the oven
    Still, even though s60 never had these apps, I can't see why they couldn't just start providing providing them. Unless they want 3rd party application programmers to have a really simple app to start with and make some chash to keep them going for more advanced apps. 
    Message Edited by sidan77 on 15-Jul-2009 09:51 PM

  • Count down timer not run in background

    On my 1520, with 8.1, i tried many timer apps and found the timer function failed when running in background. The even happened to the app, SuperTimer, which claimed to have overcame the issue. In Supertimer the countdown lags and even stop at times depending on what other things I am running. Really disappointing. It appears to be an issue wth Windows OS that none of the app programmers could fix.
    Disappointed
    Solved!
    Go to Solution.

    Have you allowed the app to run in background in the battery saver settings?

  • Stop watch or count down timer for the E71

    Hi,
    I can't seem to find an ap for a countdown timer. All my other Nokias have has this. Does it exist on the E71? Where can I get one if not?
    Cheers,
    Belinda

    Try applications like these:
    http://my-symbian.com/s60v3/software/applications.​php?name=Stopwatch&fldAuto=346&faq=10
    http://my-symbian.com/s60v3/software/applications.​php?name=Stopwatch_Plus&fldAuto=293&faq=10

  • My ipod is disabled with a timer counting down from 21,729,024 minutes how do i get rid of this to use my ipod ?

    our ipod has been disabled with a count down timer from 21,729,024 minutes, nothing else works ,can anyone help ?

    You need to place the iPod in recovery mode and then restore it via iTunes on yur computer.  You can restore from backup if you have a backup.  For recovery mode see:
    iPhone and iPod touch: Unable to update or restore

  • I need a count "UP" timer for a client.

    I have kind of a strange request, but it's from a strange client so it's not surprising.
    The client needs a counting UP timer, not a count DOWN timer, so please don't refer me to that widget, I already used it.
    The original countdown timer has expired, so now she wants a timer that will count the days, hours, minutes & seconds SINCE that timer expired.
    Website splash page: http://www.theapocalypse.ca so you can see what I mean.
    Is it possible to "crack" the existing widget and just "reverse" it, or is there something I can build in edge animate that will work?
    I know, WEIRD, but hey, a paycheque is a paycheque.
    Thanks guys!

    You may try this : http://www.tickcounter.com/countup/widget
    Thanks,
    Sanjit

  • Count down to page transition...how?

    On a self playing keynote presentation, I am pausing 4 seconds before each page transition to allow them to take in what is on the page. However, I do not want them to think the slide show is over. How do you put something on the slide to indicate there is another slide coming? I am thinking of a count down timer (4...3...2...1 next slide), but you cannot simply but that in as an element since the last element must play before the 4 second page transition starts.
    Any ideas?
    Thanks
    Bob

    At first I thought OP reads like an oxymoron. If I get what you are saying you need to do the transition manually not using the slide to slide transition then you can do 4,3,2,1; move an object from left to right or even use this little guy:
    Depends on your chosen transition as to how acurately it can be replicated manually but there are lots of options. If you use Magic Move you could even continue to use a transition and move/dissolve/scale/rotate some objects and have others hold there position on screen.

  • JSP: Date and Time Count down

    Hi All,
    Sorry if i come to the wrong place.
    I am thinking to write a code by using JSP to count down Date and Time. I have one field in my microsoft access format as Date/Time. I want to get the remain time by using the time in my microsoft access minus the current time in the machine and then count down the remain time.
    Could you please advise??
    Thanks for any advise you may give me,
    Kimsan

    Hi All,
    Sorry if i come to the wrong place.
    I am thinking to write a code by using JSP to count down Date and Time. I have one field in my microsoft access format as Date/Time. I want to get the remain time by using the time in my microsoft access minus the current time in the machine and then count down the remain time.
    Could you please advise??
    Thanks for any advise you may give me,
    Kimsan

Maybe you are looking for

  • I have iphone 4s and when i plug it into an non iphone player it does not work on my other iphone it works fine

    i bought an iphone 4s for my girl friend as a gift and it is now in the philippines, when i try to play the music from non iphone player it does not work when i put it in the charging port of it, on my iphone 4s it works fine, no i am in cebu city an

  • Save and Protect your iPad Device: How to Save and Prolong the battery life of your new ipad

    Please, as you read add more answers to this on how to prolong and save your ipad battery life. Thank you Saving the battery life of your iPad 1.Keep Your iDevice Out of the Sun Whatever you do, don’t leave your iPhone or iPod sitting in a hot car—he

  • Payment Budget Exceeded

    Hi all, We encountered "payment budget for year 2007 exceeded" problem when posting to a particular funds centre and commitment item.  The standard SAP FM report shows that there are sufficient available budget for that funds centre and commitment it

  • Problem in printing across columns

    Hello, I have a requirement to print the records across, for which I created the RTF template and was able to print across using @column. But here is the problem.. eg: item,                                     reference1,        reference2,         

  • WebLogic Server 10.3.5 shows 10.3.4 components

    Hi, This may be a silly question, but I will ask it anyway. Why is it that when I run config.sh to create a WebLogic Server domain, it lists 10.3.4 components when I get to the Select Domain Source screen? For example, Basic WebLogic Server Domain -