Hi, [Your Name]
first, is there a special reason that some of the subquestions of "CORTE" are empty?
And you said "up to 3 options", but set "Maximum answers" to 1.
Well, to answer your question:
LimeSurvey does not support loops.
The straightforward solution is to create group "G2" as many times as there are subquestions in "CORTE".
Then you display the respective groups with "condition (object was selected in CORTE)" like
G2_1: CORTE_1=="Y"
G2_2: CORTE_2=="Y"
...
G2_36: CORTE_36=="Y"
A more sophisticated and shorter way is to display only three groups and taylor the object.
Therefore you create a group with hidden equations
Like
the base list:
eqList0:
{join(list(that.CORTE.shown),',')}
capture the first name:
eqN1:
{trim(substr(eqList0,0,strpos(eqList0,',')))}
the new list
eqList1:
{str_replace(join(eqN1,','),'',eqList0)}
capture the second name (this is the first part of the new list):
eqN2:
{trim(substr(eqList1,0,strpos(eqList1,',')))}
capture the third name (this is the second part of the new list):
eqN3:
{trim(substr(eqList1,strpos(eqList1,',')+1))}
As you already tried to show. you pipe the resp. name into the question text
Como você prefere comprar <b>{eqN1}</b>?
This way you only need three groups.
And the second and third grpoup get the condition "name is not empty"
!is_empty(eqN2) !is_empty(eqN3)
Advantages/Disadvantages:
1. solution: straightforward, but you habe a lot of groups. Each group refers to one object
2. solution: only three groups needed, but you have to restructure the dataset. Each of the three groups can contain data of each object.
Joffm