Best way to make a quiz app?

Discussion in 'iOS Programming' started by alexandergre, Dec 16, 2009.

  1. alexandergre macrumors member


    Jul 28, 2009
    what is the best way to make a quiz app?

    where the questions are randomly sorted.
    Questions have multiple choices.
    Some questions may have pictures.
    result will be show like this: Right answers: 12 of 52

    I can do the program above. but I want to know the easiet way to do it?
    any tips?
  2. NickFalk macrumors 6502


    Jun 9, 2004
    While I haven't spent any time truly thinking through the pro's and cons my first instinct would be to make a Question-class and have the instance return an NSDictionary including all the attributes for that single question. (The question, alternatives, picture/other media (if applicable) etc.)

    And obviously(?) the questions should be stored in a database.
  3. AugustoCazares macrumors newbie

    Dec 17, 2009
    Well i'm actually working on a app Quizz in my work rigth now, i'm using a Quizz class that has information of the quizz,questions&answers, and profiles properties. i'm getting all the information form a plist, the Quizz class is a subclass of NSDictionary to make things easy at the moment of serealize the plist and the class, i also implemented view controllers for the quizz,questions and profile, the quizz controller suscribed protocolos of the other view controller to share the information it's very simple, i also implemented the answers ramdomly shown, you have to make a method that shuffle the mapping (an array) of the original position of the answers (or questions) you can exchange some positions ramdomly for the shuffle, it works pretty well form me, the work comes when the information of the quizz is on a server and u have to download another quizzes from the appstore (i'm doing this rigth now). you can PM if have a question. Saludos.
  4. maniacdev macrumors newbie

    Dec 17, 2009
    Vancouver, BC
    The way I did it was by placing everything in a SQLite database, had the primary field just be the number of the question, and just randomly picked a number. Changing the text/questions to whatever matched up.

    You can store the image data in the database, or just the image names and copy them into the project separately then display them.
  5. miep macrumors newbie

    Jul 6, 2007
    I'd use Core Data - it's very easy to use.

    Just make a Question entity with all the required attributes, create class files, and voila.
  6. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Normally, best != easiest.

Share This Page