开发者

How to combine lists in an Android quiz app

开发者 https://www.devze.com 2023-02-13 21:30 出处:网络
So I\'m making a quiz show app for school (Android), and what I am planning is that the user can select, using a checklist, what chapters he wants to be quizzed on.

So I'm making a quiz show app for school (Android), and what I am planning is that the user can select, using a checklist, what chapters he wants to be quizzed on.

Using only one list per chapter, it is easy to make a quiz by chapter, but let's say I check the boxes chapter 3,4 and 6. How do I combine those lists with the questions so that the app will have a quiz with all those questions in those chapters.

I am planning to have around 15 chapters, so 15 checkboxes with 15C14 possibilites of ways of choosing the chapters. How would I put that in programming language so that it shows the questions of the开发者_JS百科 ticked chapters?

Also, is there a way to randomize the questions in a list when it is put out as questions?


Karan,

It looks like you want to be using a MergeCursor shown here: http://developer.android.com/reference/android/database/MergeCursor.html

You can use this to combined the checked chapters into a single Cursor then use an Adapter to display the single list.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号