0

I am doing a project in jsp of creating question paper from question bank.
Here we have to generate a paper based on the language like c,c++.
we want to know how to generate the paper by considering two question from each area like inheritence,exception handling.the question has to be randomly gnererated from question bank database which has area_id and language_id and questions. Kindly give us a logic how to select questions accordingly.
we tried the following logic but it does not work.WE are working in net beans(derby server).

ResultSet rs = st.executeQuery("select tech,t.tid,a.tid,aid from technology t,area a where t.tid=a.tid ");
 while(rs.next())
     {
               if(option.equals(rs.getString(1)))
                   {
                            tid = rs.getString(2);
                    
                                 
                                
                                   if(tid.equals(rs.getString(3)))
                                       {
                                            aid = rs.getString(4);
                                            %>
                                            <p><%=aid%></p>
                                             
                                           <%
                                            
                                        
                                               
                                               ResultSet rp=st.executeQuery("select * from qp order by random() ");
                                           while(rp.next()){
                                               while(rp.getString(3).equals(rs.getString(4))){
                                            %> <p><%=rp.getString(4)%></p><%
                                            }
                                           }
                        }                   
                                              

          }}

Here we first selected the desired language(technology) and in each technlogy we have different areas.We selected the areas and put them in an array and from each array element we tried to select questions under each element to apply random number generation function to select question but it does not work.

Edited by peter_budo: Please do not use CODE SNIPPED option to post question. Use FORUM THREAD!

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by lisaroy1
-2

hi, i am also workin on similar problem....if u got any idea u plz do reply me....

Votes + Comments
Create your own thread and do not forget to include code you have so far!
0

you must be having some question code that must be unique so by using it and with the help of random() generate your random questions and store it into an array.

0

I was also working on same project named Online Examination and the problem iam facing is about the timer.I want that timer should start when the start button on the form is clicked and it shouls stop after 45 mins,I am using the java code but it is not working.Can anyone help me on this problem also

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.