Create a schema like this: (You can refer to the form attached)
MyFields
->SelectCard (field)
->Cards (group)
->CardNumber (repeating group)
->CardNum (field)
->Questions (repeating group)
->QuestionText (field)
->AnswerText (field)
To make this simple, I'm keeping the questions within the form itself not in an external
data like a sharepoint list or an external database.
Here are the steps I took to create this
1. Drag SelectCard into the canvas and make it into a dropdown menu
2. Right click on the Select Card drop down menu and select Get choices from fields in
this form. In this example it is the CardNumber repeating group.
3. Go to Data -> Default Values and right click on the CardNumber repeating group and add
your cards. I have 3 in this example. I added 2 questions for each of the 3 cards.
4. Drag the entire questions repeating group into the canvas as a repeating section with
controls. If you do a preview now you will see all questions for all of the cards. So
next you will need to create rules (conditional formatting) to show only the questions
from the selected card in the dropdown menu.
I have time to burn so I'll do the conditional formatting too :)
5. We will create the conditional formatting on the CardNumber repeating node. Select the
CardNumber repeating node and create a new rule.
It is a very simple rule -> If CardNum is not equal to SelectCard then hide this control.
There you go bro :)
If you want to explore more here are some related videos on youtube that you may find
useful
Data driven forms, what we did here
https://www.youtube.com/watch?v=THiTh55wiQs
How to use data connections in case you prefer the questions and the answer be saved
somewhere else like a sharepoint list or an access or sql database.
https://www.youtube.com/watch?v=rjUj0oevjSk
If you want extend what you can do with data driven forms
https://www.youtube.com/watch?v=THiTh55wiQs