uitableview - Need advice to make a quiz in iPhone? -


i trying make quiz application iphone. there 10 questions in quiz, has question button ( go previous question) , next question (go next question). user must completed in 15 mins.

i using uitableview store answer (a, b, c, d) , user answer using "checkmark" however, meet problem:

in question 1, selected row 1 (b answer) answer. when press next question, row 1 selected, it's similar other question when press next question or question button although answer question 1?

in opinion, should use uitableview or other object? if use uitableview, can fix it? can give me recommend?

thanks you,

can see project: http://i5.upanh.com/2013/0826/06//57290900.screenshot20130826at11713pm.png

yes, ofcourse can uitableview. suggest create nsmutabledictionary below, return questions array count in numberofrowsinsection , parse dictionary , show in uitableview.

the selected variable inside answers array can bound checkbox in cell. add member variable keeping current questionindex (which 0 initially) , increment/decrement value in next/previous button , reload tableview update based on index.

    {         "questions": [         {             "question": "what x?",             "answers": [                 {                     "option 1": "x 1",                     "selected": false                 },                 {                     "option 2": "x 2",                     "selected": false                 }             ],             "correct_answer": "option 1"         }     ] } 

hope gives idea.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -