This discussion is archived
1 2 Previous Next 22 Replies Latest reply: Nov 22, 2012 6:56 AM by TPD-Opitz-Consulting-com RSS

Java questionaire app

800839 Newbie
Currently Being Moderated
Hi,

I'm basically wanting to develop a java questionaire app, that holds a bunch of questions and the corresponding correct answers. So the question i would imagine i would make appear on the label and then having four possible answers a b c and d . Then finally giving the user a score. I'm not really sure what the best way to do this using J2EE but i have searched high and low and cannot find a good piece of code to give me some ideas. My problem is everything i search in google about java questionaires etc it just gives me a million tests of java knowledge.

Have any of you guys built or seen any code that you could link me to ?

thanks
  • 1. Re: Java questionaire app
    Kayaman Guru
    Currently Being Moderated
    797836 wrote:
    Have any of you guys built or seen any code that you could link me to ?
    This is somewhat trivial. Do you know any Java EE at all?
  • 2. Re: Java questionaire app
    800839 Newbie
    Currently Being Moderated
    Thanks Kayaman. I have knowledge on J2EE, but what some sample questionaire app. so that i will get more idea on how i can go about it. Any help is really appreciated.
  • 3. Re: Java questionaire app
    gimbal2 Guru
    Currently Being Moderated
    797836 wrote:
    Thanks Kayaman. I have knowledge on J2EE, but what some sample questionaire app. so that i will get more idea on how i can go about it. Any help is really appreciated.
    J2EE huh? But that's knowledge from a decade ago.

    I'll assume you know JEE - but then you're clueless as to requirements capturing and application design? Being able to translate specifications into a solution is basically your job you know. You just can't tell me you don't at least have a global idea of how to attack this problem. So share it - what did you come up with yourself so far?
  • 4. Re: Java questionaire app
    Kayaman Guru
    Currently Being Moderated
    797836 wrote:
    Thanks Kayaman. I have knowledge on J2EE, but what some sample questionaire app. so that i will get more idea on how i can go about it. Any help is really appreciated.
    Well, what were you thinking of using. JSP? JSF? Plain servlets and HTML? Some other framework like Struts? Will you store the questions and answers in a database?
  • 5. Re: Java questionaire app
    800839 Newbie
    Currently Being Moderated
    Yes I am planning to store the questions and answers in the DB. The tech is not a problem what some samples on how we can do it?
  • 6. Re: Java questionaire app
    Kayaman Guru
    Currently Being Moderated
    797836 wrote:
    The tech is not a problem what some samples on how we can do it?
    So you haven't decided what tech you'll use? Why not? Don't you know any of the technologies I mentioned?

    Is this a school project and you're trying to steal someone else's code?
  • 7. Re: Java questionaire app
    800839 Newbie
    Currently Being Moderated
    This is not stealing mind you, this is getting some knowledge on the topic how exactly we can do it? I know the tech which u have mentioned. That is not a problem.
  • 8. Re: Java questionaire app
    TPD-Opitz-Consulting-com Expert
    Currently Being Moderated
    797836 wrote:
    Yes I am planning to store the questions and answers in the DB.
    So you should do first things first:
    Look at your requirements an decide which information need to be stored in the DB.
    Define the relationships between those information and convert this initial data model to 3rd normal form.
    When this is done it should be rather easy to create a WebApp using a framework of your choice.

    bye
    TPD
  • 9. Re: Java questionaire app
    aksarben Journeyer
    Currently Being Moderated
    It's unclear what you want. If you're just fishing for design ideas, take a look at Survey Monkey.
  • 10. Re: Java questionaire app
    Kayaman Guru
    Currently Being Moderated
    797836 wrote:
    This is not stealing mind you, this is getting some knowledge on the topic how exactly we can do it?
    True, although I can't really know whether you'll just "get some knowledge" or if you'll end up copying the code.
    I know the tech which u have mentioned. That is not a problem.
    I think that's exactly the problem. You may have heard of those, but it's obvious that you don't have the skills to use them.

    The whole program is basically as follows:
    1. Display question and some form of input for answers (radiobutton, list, what have you).
    2. On submit save the answer and check whether it's correct.


    Which part are you having problems with? I'll be glad to help with programming troubles. You're free to keep searching for your example code if you choose.
  • 11. Re: Java questionaire app
    939520 Explorer
    Currently Being Moderated
    If you haven't reached the experience level of programming with frameworks such as struts/spring and are still relatively new to JSP/Servlets, I suggest you make the program using JSP/servlets. I think it will get you up and running the quickest. Before doing so, I suggest you read a book on JSP (which normally covers servlets) rather than trying to find on-line pieces of completed code. Then, create a design as follows: a central servlet that all you JSP pages submits to. Have the servlet instantiate business logic that uses JDBC to communicate to the database (not exactly MVC design, but you can refactor later). In your database, have one table that holds the questions where each question has a primary key. Figure out how to read the table and display the questions. Add another table that holds the possible answers (parent/child table relationship). Display those under each question (with a checkbox for user input). Add a log in page to identify each user (userID/password). Create another table to hold the userID, questionID, and selected answer. In this way, you build up your design piece by piece instead of trying to do the entire database, etc at once. If you want, you can alternatively use JSF instead of JSP, after reading a book on it.
  • 12. Re: Java questionaire app
    800839 Newbie
    Currently Being Moderated
    To make it clear, I am working on a project that requires me to create a class containing 20 questions and then I have to randomly select 5 questions with the respective answers in objectives (4 of them), but with the possibility of any number. can you please tell me how I can do this? Any help is highly appreciated and links are welcome.
  • 13. Re: Java questionaire app
    Kayaman Guru
    Currently Being Moderated
    797836 wrote:
    To make it clear
    Oh I think it's clear already.
    can you please tell me how I can do this?
    See my previous post.
    Any help is highly appreciated and links are welcome.
    You don't seem to appreciate help though, you're just waiting for someone to post you a link to finished source.

    I doubt anyone will do that, and your project will fail unless you start actually doing something.
  • 14. Re: Java questionaire app
    800839 Newbie
    Currently Being Moderated
    Thanks. The real problem is not displaying the questions and the respective answers . Here we need to display the questions in random order by shuffling the questions frequently for the users and once a particular question has been answered correctly we need to remove it or label it saying that it is already answered hence the same question wont be displayed again for the same user? Now tell me how we can do the randomization and how we can label the questions which is been answered?
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points