Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:49:31+00:00 2026-06-09T04:49:31+00:00

I am working on a project Online examination just to gain knowledge . There

  • 0

I am working on a project Online examination just to gain knowledge.
There can be a case of power failure and when a candidate logs in again, then the time wasted during power failure must be given. But in my javascript code, the exam ends after exact 2 hours corresponding to server time(AJAX is used here). After time ends, the student is redirected to home page. I have thought of a solution but I dont find a start to implement it.

As the session is maintained, so I can maintain the time he used from
2 hours and can be stored in database. when he relogin then that
particular row which corresponds to him can be checked and the time
can be updated.

But I am not able to implement it. Please tell me if there is another solution to it or the direction in which I am thinking is right or wrong.

The exam clock resumes from the start of 2 hours. It doesn’t resume from the time which was ticking when the power failure was there. Its the same thing whether a power failure occurs or a candidate logs back again in this case atleast. And I am not asking for any code for this problem. I just want a hint or a direction in which I can think of. I just want to know what can be the concept behind it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:49:33+00:00Added an answer on June 9, 2026 at 4:49 am

    Formalizing the problem a bit:

    • A user logins in and begins their exam at t0. Their exam concludes at t120.
    • At some point (x minutes into exam) before the end of the exam (tx) there is a power failure and those being tested must resume the exam.
    • At some point after tx, ty the system comes back online.
    • At some point after or equal to ty, the user logs in again, call it tz. As you’ve indicated, this is equal to ty.
    • They’re entitled to 120 – x more minutes to complete the exam. The point at which the exam concludes is now tz + (120 – x).

    Possible Solution:

    Originally thought of a very session-oriented approach, but this might be the way to go:

    • Implement a system wide clock (think “heartbeat”) with a period p. For every interval p that the system is up, increment a global counter.
    • Record t0 as this global counter for each examination.
    • In another row, update the elapsed time an examination. This is the current value of t0. In your code you’ll likely have functionality to save their work in progress, update the elapsed time there. Also update the elapsed time on each page/section load. Note that if some work is lost between the last elapsed time update/in progress save, they’ll receive that time ‘back’ since their last elapsed update was never stored.
    • The interval p will be a policy decision. In theory someone could gain an extra p to complete their exam depending on the timing of the failure. If p is 1 second, it’s not a big deal. If it’s 5 minutes, it’s a bigger deal. Of course there will be performance tradeoffs for different values of p. Also since we’re not dealing with real-time systems here, there can be some skew with p.
    • Use transactions for everything. When the system resumes (and before the global clock starts ticking again), any transactions interrupted will need to be rolled back.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project on Online Examination. In this when the question paper
I am working on project -online file management where we have to tore file
I am working on online pdf library project. In this I have a feature
i am working on a online file management project.In which we are storing references
i am working on a project of online resume management system and i am
I am currently working on a project that will act like a Online selling
I'm working on a project using OpenCV, and there is a function which takes
I am working on an online reminder system project (ASP.NET 2.0 (C#) / SQL
I'm working on a project where there will be a MySQL database containing data
I am thinking of working on an online homework submission system where students can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.