File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Online Exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Online Exam" Watch "Online Exam" New topic
Author

Online Exam

Bismi Varghese
Greenhorn

Joined: Mar 09, 2013
Posts: 1

I am developing an online exam web application now. But i am confused about how i can access questions from database randomly..because i want to change questions for each student.
can you please give me some ideas. i am using struts frame work....
Thanks in advance
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
As the creator of several on-line exam engines, I have the following suggestions:

1. make authoring and editing questions as easy as possible.

2. committing to database storage limits your flexibility - suppose you want to add a new style of question - have to redesign the database, what a pain.

3. given 1 & 2 - I ended up using an XML "script" of questions kept in memory as a DOM.

Bill

Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2718
    
    6

Bismi Varghese wrote:
I am developing an online exam web application now. But i am confused about how i can access questions from database randomly..because i want to change questions for each student.

William has really nice suggestions you should think of.
If you want to stick to the database, here is what I did for this during my college.
1) Have a table with the question IDs and timestamp when it was asked.
2) Generate the random question ID and check the same in this table, if it exists, generate new question ID and update this table.
3) Have a script that runs every hour to remove records from the above table which are on hour old.

I don't know why I designed it that way, but it worked.

To prevent repeating a question to the same user, having the question ID in his/her session will suffice.


SCJP, SCWCD.
|Asking Good Questions|
Tiklu Mukherjee
Greenhorn

Joined: Mar 14, 2013
Posts: 7
Hi,

What i can figure it out and accordingly i have a solution,

Try to use JdbcRowSet object , when you create a JdbcRowSet Object pass the resultSet object as a parameter to JdbcRowSet Constructor as below:

where the resultSet object is " SCROLL_SENSITIVE ",so that you can move BACK and FORTH within the resultSet content.
NOTE: (rs) is the result set object that you need to define before jdbcrowset.
After you define the resultSet make the cursor point to the end of the ROW in the resultSet and get the count of that row.
the best advantage of using the JdbcRowSet is that you can scroll at any perticular location in the row , hence forth use

I hope you can figure it out ,or in-case let me know if you need more details .

Thanks,
abhijitmukherjee655@gmail.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Online Exam