not again............

hey all,

ive been trying to figure out how to solve a problem i am having

1)-java.lang.NullPointerException

i get this problem when a user does not check a box (multiple test exam), and thus does not update the persons results in the databse.

How can i solve this??? anyone have any idea?

2) i was wondering how (using jsp and html) can i send a question to a user one at a time( the q are stored in an array), get the answer from the user , process the answer if correct go on to next q and repeat process, if wrong go to solution and how it is worked out page then after the user has read solution they can click on a carry on which will take them on to the next q. and the process continues untiul q finish.

i was thinking of doing it in a html page with frames the first being a jsp page which displays the q and the second being where the user can input their answers.

can neone help me out????

if so v grateful.

thanku ill.
illinosisAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kennethxuConnect With a Mentor Commented:
whatever you stored as session attribute can be accessed from page to page. so you can trace which is current, which is next.
0
 
kennethxuCommented:
>> 1)-java.lang.NullPointerException i get this problem when a user does not check a box (multiple test exam).

if( request.getParameter( "checkboxname" ) == null ) {
   // user didn't check the check box.
   // you must handle this situation, otherwise NullPointerException.
}

>> 2) ....
you can save the current question number in the session:

store:
session.setAttribute( "questionNo", new Integer( questionNo ) );

retrieve:
Integer temp = ((Integer)session.getAttribute( "questionNo" ));
if( temp != null ) questionNo = temp.intValue();

BTW, you haven't follow up on your other questions for a long while, if you keep leaving your questions open without any update, you might find it is difficult to get help in future :)
0
 
illinosisAuthor Commented:
kennethxu ...thanx 4 ure help will try out tmor.

>>BTW, you haven't follow up on your other questions for a long while, if you keep leaving your questions open without any update, you might find it is difficult to get help in future :)

im soz...when a q is answered and it helps i reward the points and thank the all the peps 4 their help. i will post up updates from now on (i didnt realise this b4
:( ...if u tell me the q that u wud like the update on i will go back to that q and post an update (i didnt realise people still viewed them after they had been answered)...

Thanku...and i will post u an update on this q tmor.

Ill
0
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
kennethxuCommented:
just click on your name, you'll get the list of Q's belong to you. anyway this is the link:
http://www.experts-exchange.com/Web/Web_Languages/JSP/memberProfile.jsp?mbr=illinosis

it's better to let people know what's the result after you trid their comment, it given solution doesn't work, experts might give you another solution :)
0
 
illinosisAuthor Commented:
Hey kennethxu,

the exception handling worked.

But i am not too sure wat you mean for my second q. I get wat ure trying to say about session. but i dont get how to fire each q, from one page etc..i think i am getting confused.:(
0
 
girionisCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to kennethxu

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0
All Courses

From novice to tech pro — start learning today.