Best way to display test

I’m creating an app that will run the user through a series of test. The number of questions for each test is dynamic. I would like to use a navigation bar for each test. Since I don’t know how many questions there are, is it better to dynamically create view controllers or views to put in 1 view controller? I need to save all the data in the end and in some cases save in the middle of the test.

Or should I use multiple view controllers with a singleton to store my data?

  1. I suggest UIScrollView with subview per question.

So…take one scrollview and what is your questions array count, create that many views and add to scrollview.

Make scrollview pages enabled. When user select any option scroll scrollview and save result. If user end test between then also you got the data and use it for final calculation.

  1. You can use UITableView or UICollectionView with only one section and multiple rows as per your answers options. Everytime on next you have to increase count and pass current data into tableview or collection view and reload it.
1 Like

This topic was automatically closed after 166 days. New replies are no longer allowed.