0 votes
in SoSci Survey (English) by s152546 (190 points)
edited by SoSci Survey

Hello,
I am new to this platform.
I want to make a questionnaire for my dissertation with cascade filtering: I have a set of items from which the respondent selects a few (based on criterion 1), then, from the remaining ones select a few (based on criterion 2), etc. (Criterions are de responses in multiple choise matrix).
Subsequently, through consecutive selections, out of 120 items, there are a few (very few) that need to be displayed on a new page for an other tipe of analize.
For the first selection I used the PHP code:

 $ activ = getItems ('OS02', '==', '1');
question ('OS03', $ activ); 

but this does not work for the second time.

$ imp = getItems ('OS03', ' > ', '2');
question ('OS04', $ imp)

How can i solve the problem ?
If I fail with the PHP code, what other options would I have?
Introduction of each item separately and its separate analysis would make the questionnaire have over 300 questions, which is too much for an online questionnaire.
I look forward to solutions,

1 Answer

+1 vote
by SoSci Survey (305k points)

It may be that there are just too many spaces (especially the second parameter in getItems()). Please try this code:

$imp = getItems('OS03', '>', '2');
question ('OS04', $imp);

If that does not work, please post the debug-information for the page with that code.

If I fail with the PHP code, what other options would I have?

Why should you fail? There's no better time to learn a bit programming than now!

by s152546 (190 points)
Thanks for the quick reply, but after how can I then display as a text for a next question these result (items selected by filtering)?
by SoSci Survey (305k points)
I do not understand your question, sorry. Did I undestand you correctly, that you would like to display a second question OS04 that does only show those items/options that have received a value >2 in OS03?

If I got that right and the above code does not work, please post the debug information from the page.
by s152546 (190 points)
I'm sorry I was unclear, I'm trying to explain better.
Question OS04 involves a scale (fully labeled) with two answer options (yes / no) and I want the items answered "no" to be displayed on a later page in the instructions.
by SoSci Survey (305k points)
Then your code should look something like this:

$imp = getItems('OS03', '==', '2');
$texts = valueTexts('OS03', $imp, 'label');
replace('%selection%', implode(', ', $texts));

... and, of course, use the placeholder %selection% in the question within the instructions. The PHP code must be above the question on the same page.
by s152546 (190 points)
Thank you for the answer!!
by s152546 (190 points)
Hi, again
I come back for clarification
There are 7 groups of items (personal goals).
In each group there are between 15-23 items (total 126 items)
These items (eg from OS02) are filtered by subjects based on some criteria:
1. scale with 6 values (only the items that were answered with 1 or 2 are retained)
$activ = getItems('OS02', '==', '1');
question('OS03', $activ)
$ment = getItems('OS02','==', 2) ;
question('OS04', $ment);
2. scale with 4 values (items that were answered with 3 or 4 are retained)
$SigMentIpm = getItems('OS04', 'min', 3);
$SigActImp = getItems('OS03', 'min', 3);
if (count($SigMentIpm) > 0)
{question('OS06', $SigMentIpm); }
if (count($SigActImp) > 0)
 { question('OS05', $SigActImp); }
3. scale with yes / no variants (items answered with no are retained)

At the end of the selection for each group I would like to display the items that remained after the selection, if no item remained, we move on to the next group of items, without any feedback.

When the selections are completed for all the groups, in the introductory text for the next part of the questionnaire (necessary resources) I want all the objectives (items), from all groups, those that remained after the consecutive selections, to be displayed.
Could you help me with the commands that should be used?

Thank you
by SoSci Survey (305k points)
I would like to ask you for two things: (1) Could you please create a new (related) question, because it gets a bit confusing down here in the comments. (2) Please state how far you came, i.e., what already works, and then what next step does not work. Then we will go step by step.
asked Aug 6, 2020 in SoSci Survey (English) by s152546 (190 points)
edited Aug 6, 2020 by SoSci Survey
How to display items as text

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...