Best way to code a Quiz Application


  1. _faith_

    _faith_ New Member

    Hi I'm new to these forums and sort of new to android development. I want to create a quiz application with a main screen, and a quiz screen with 3 controls


    I took a java intro course, and studied android myself. This is my second year into computer science at the U of Mn

    Main screen =
    1. new quiz
    2. high scores
    3. contact/misc info

    New quiz -> quiz screens that starts with questions.
    1. choose multiple choice questions with 5 choices. If choose correct display green button, otherwise, display red button
    2. can keep picking answers it until you figure out the right answer
    3. next question
    4. return to menu(may be unnecessary because of back button?)


    Here is a picture of my idea
    _________________________
    |****what is 1 + 1
    |a. 1
    |b. 2
    |c. 3
    |d. 4
    |e. 5
    |[prev][next]

    you can picking answers until it tells you when you get it right. (its a learning application)


    and it would choose 24 questions arbitrarily from a pool of lets say 100. After the last question [next] would give you your score out of 24, then let you go back to main menu.

    Whats a good way to think about designing this in terms of activities, intents, and the xml layouts that come with. I understand how very simple android programs work, but since there is a going to be a multitude of choices, would i need seperate activities for each correct/incorrect answer choice?

    If someone can draw me a diagram of the like the first 4 questions, and how they transition into each activity that would be awesome!!!!

    thanks in advance and please any help would be greatly appreciated.

    Advertisement
    :
  2. Digital Controller

    Digital Controller The Real Bass Creator Guide

    I have moved this thread into Application Requests as it sounds like you are kind of requesting someone to assist you with this app.

    Hope this helps :)
  3. dlhavema

    dlhavema Well-Known Member

    you'll want a few different activities:

    main - menu and buttons/links to about, help, etc..

    quiz - shows a given question of a set quiz. can be setup to have room for the question and then a ListView of answers. when a user clicks on an answer it is validated, a toast ( or other popup ) appears and shows them if they are right or wrong, and the next question pops up.

    contact/info - is this for you or for them?

    Some supporting features would be:
    a way to add new questions to the set ( server, xml file, etc.. )
    group the questions ( easy math, algebra, definitions, etc. )
  4. rexes

    rexes Member

    You will also need a database system at the background to make your work easier!
  5. prl91

    prl91 Active Member

    You should only need one activity. I would recommend just creating a different XML layout for static pages such as your help page and contact page, and then switching to those by calling them with a onclick receiver. You shouldn't need any global or local broadcast receivers or intents either, except for the onclick. That will just slow your app down. Not by a lot, but coding for performance early on will help you get into the mind set for future development, where it may be more important.
  6. sohguanh

    sohguanh Well-Known Member

    Generally there are two kind of UI. Developers more familiar with HTML5,Javascript etc will go for webview and phonegap to access android specific like notification,camera etc. Others do the native traditional way.

    As for database, it depends, some apps need to interface with server so database will reside in server instead of the local app database. However for performance, some data maybe cached in local app database when say internet connectivity is not available. Once available sync the local app data to the server.
  7. StevenHu

    StevenHu Well-Known Member

    You'll need to be able to save the number of answers right and wrong, and number of questions in a database or localStorage if you want to give them back later.

    You can make the answers as easily as a simple alert popup, so they are coded right into an HTML page (using PhoneGap, for instance).
Loading...

Share This Page