简体   繁体   中英

How to combine lists in an Android quiz app

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 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM