Is there any extension or tool for dynamic quiz/exam/survey generation

Let's say i have a library of questions and answer choices (for survey purpose) in mysql online accessible by a php webserver. The questions are in the following format:
id question choices
1 What is it? robot, car, table, paper
2 Who am I? Joe, Ana, Carl, Pete
....
What i would like to do is when a screen initializes, it dynamicly generates an unknown number of questions (meeting certain criteria) in the following format:

  1. Who am I?
    (radio button) Joe
    (radio button) Ana
    (radio button) Carl
    (radio button) Pete
    (a submit button)
  2. .......

I would imagine i will need to inquire mysql database to get the entries in list with question and choices in sublists, it will also need to use the dynamiccomponent extension and radiobutton extension, but generating such dynamic components seems too much of a daunting task with a huge chunk of block in app inventor. I would think that such tasks are very common, just wonder whether there is a specific extension or sort of tool already out there for such purpose in App Inventor. Thanks!

Start with
https://www.google.com/search?q=ai2+makequiz

You don't need a display component for every list and every list item.

maybe to better formulate my quesiton, the number of questions is unknown (as long as they meet the criteria) so they need to be generated dynamiclly. Though the example is somewhat relevant, it is quite different. The main difference will be dynamic generation of components. I am not sure the dynamiccomponent extension can generate radio buttons (for multiple choices).

You need some way to generate right and wrong answers to questions.

That requires some corpus of knowledge (math, geography, history, food, biology) and some way of identifying plausible alternatives.

The current reincarnation of the quiz show You Bet Your Life (no, not the Squid Games) might give you ideas for how plausible multiple choice answers would be generated.

I do not need to worry about righ tor wrong answer, let's say it's a survey.

This is starting to sound like a Test Data Generator

i would say very similar to a test generator from an existing database, not data generator, but need to do it in App Inventor

Selection of random items from multiple lists is very straightforward.

I reiterate,

Not everything that is calculated needs to be stored.
Not everything that is stored need to be selected.
Not everything that is selected needs to be displayed.
Not everything that is displayed needs to be read.

.

1 Like

Selection is not much of an issue, I can inquire the mysql db with certain conditions to retrieve entries. The tricky part is to display them with dynamic components (particularly radiobuttons)

A small sliding window into a long list can be simple and convenient.
You probably encounter them online.

From my sample collection ...

https://groups.google.com/g/mitappinventortest/c/WEat3QJXUX4/m/-r3mNVSIAwAJ

Radio buttons:

randoms in range ...
https://groups.google.com/d/msg/mitappinventortest/pOWEZtYjx7s/mh0UrEJ5AQAJ

1 Like

Sounds a good idea to replace radiobuttons with listpicker for choices, now the cumbersome part is to display components dynamiclly. Not complete solution yet, but give you a :heartpulse:

you also might want to take a look at
A Multiple Choice Quiz: How to work with the advanced features
what is missing in the example is to read the questions and answers from the database...

Taifun

Aside from your firm belief that every photo needs a frame for it, there is the question of how to track the questions and answer choices in your database.

Your app sounds like your own version of Google Forms, which allows users to define their own forms and let other users enter data into those forms that would end up as rows in that Form's Google Sheet.

A Google Form is a form of schema, which you can represent in a dictionary.

also the components are not created dynamiclly in the example.

what is that? also i don't think what i am trying to make is sth very similar to google form

Will Mit punya's survey component do the work? :thinking:

Well, it is always one question and 4 possible answers to choose from...
Why do you think, you need something dynamic for that?
Taifun

the number of test questions are not certain because as long as the questions in db meet certain criteria, all questions should be retrieved. Also the number of choices for each question are not always the same (this is intentional, sorry that this is not reflected in my question, cannot edit it anymore).

can you share a link please?

here is what i can think of using listpicker for the choices, please share your thoughts.