• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Test Engine in MVC

 
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there, I am building a test engine in MVC and want to add a functionality in which user session should not be killed i.e. suppose a person undergoing a test, suddenly faced a powercut, and when the power comes back , he or she should go back to the state at where they was interrupted by power-cut. The session should be resumed where he or she left the test. I am not asking for any code, just hints as I have no idea how to achieve this. Prometric test engine have this functionality already.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bobby,
First you need a way to identify the user is the same person. Presumably you already have a username/password.

You also probably want to make sure the person only has one session at a time so you'd want to invalidate the first session when a new one is created. One way to do this is to create a map of username to HttpSession so you can call invalidate. Another way is to have a filter or servlet check the database to see what the "current" session id is for the user.

Finally, you want to store the state of the test in something more durable than a session (database or file system is good.) That way you can re-load the new session with the current state when the user logs in again.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you. I am using Microsoft c# .net and asp.net mvc. sorry , I forgot to mention this on my post. The answer you have provided me gave me some nice ideas though.

 
Author and all-around good cowpoke
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bobby Sharma wrote:Hi there, I am building a test engine in MVC and want to add a functionality in which user session should not be killed i.e. suppose a person undergoing a test, suddenly faced a powercut, and when the power comes back , he or she should go back to the state at where they was interrupted by power-cut. The session should be resumed where he or she left the test. I am not asking for any code, just hints as I have no idea how to achieve this. Prometric test engine have this functionality already.



I used a Model class to represent a user/test combination. This class contains everything needed to identify the state of the test - answers to questions already done, whether or not test has been graded yet etc.

Also this Model class is serializable and each user/test combination has a unique ID which must be in text suitable for use as a file name.

The Model class object is serialized to disk after every significant action, keeping a copy in memory if possible.

If the user drops the connection and reconnects, the unique id can be used to recover the state he was in last.

Now you may think that serializing the object to disk frequently is slow, I can assure you that it is not compared to everything else going on.

MVC orientation will help in all aspects of creating a Test engine.

Bill

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic