Hi,
A few people have asked about some direction for a corona powered quiz framework. I cannot exactly share code as we did this for a client recently. But here are some thoughts to help you get started if you are new to corona / lua.
This is the approach we have taken. There may be better ways of doing the same.
The basic quiz will have the following:
A menu screen (just to start or select category or number of questions etc)
A main quiz screen:
a results screen
a review screen (optionally to review incorrect answers)
so we have 4 diff lua files and use director to switch between the screens. we have not played around with storyboard api yet, find director very simple to use per se.
In the main quiz screen we would create a new displaygroup (thats like a stage/ layer) for displaying something on screen and director requires you have one. you can have other displaygroups inserted into this main displaygroup as required. so for eg: for scores or some sort of a information bar which would would want to display on top you could have a separate displaygroup.
first of all read all the questions, the choices and correct answers all from a source into a lua array (this could be a file OR sqlite. advantage of sqllite is its a database and you can randomize questions using db or thru code. we read lua file and update sqllite. (this can be also improved to read from http a json/xml file and dynamically update question list)
Then you would create individual paragraph or text objects to lay them out on the screen. display your questions and choices from the array one at a time. Once a user selects the answer you could store that choice and even calculate his score and update on screen.
when user moves t the next question, you could cleanup the laid our objects (i.e remove them from displaygroup and set them to nil) and display the next set maintaining the session details in variables.
if anyone needs help, I can be contact at altafr@redbytes.in
regards
[import]uid: 55009 topic_id: 20686 reply_id: 320686[/import]