Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

alexandergre

macrumors member
Original poster
Jul 28, 2009
58
0
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?
 
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.
 
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.
 
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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.