0 votes
ago in SoSci Survey (English) by s126407 (280 points)

Dear support,

I have a multiwave survey (i.e. project) containing:
quesionnaire 1. optin (collecting e-mails of future participants)
quesionnaire 2. part 1 of experiment (they will get an e-mail with the link to this questionnaire)
quesionnaire 3. part 2 of experiment (3 days later)
quesionnaire 4. part 3 of experiment (3 days later)
quesionnaire 5. feedback (immediately after questionnaire 4)

In the part 2 of the experiment (questionnaire 3) participans are solving 6 tests which measure cognitive abilities (crystalized, fluid, and visual) and I want to give feedback to participants (5. feedback) but because of ethical restrictions i can't give feedback in terms of scores, percentiles etc. for each ability.
So, i want to give feedback which will tell participants which of these three cognitive abilities is their strength (e.g. "Crystalized/fluid/visual abilities are your strong side"). I already made internal variables which will contain mean values for each of these abilities (each is represented with 2 tasks), and let's say these internal variables are labeled "MEAN_FLUID", "MEAN_CRYSTALIZED", and "MEAN_VISUAL", and i understand that i will need a placeholder for string value (name) of each of these abilities, but first i need sosci to take these three mean scores, sort them from min to max for each participant, and present only the name of the variable containing highest value of these three variables.

Since this is a multiwave survey each participants will have data in 5 lines and since questionnaire 3 will be presented in the third line (out of 5 for each participant) i need help telling sosci to take the third line for each participant (line 3 for participant 1, line 8 for participant 2, line 13 for participant 3 etc., then take variables "MEAN_FLUID", "MEAN_CRYSTALIZED", "MEAN_VISUAL", sort them highest to lowest, determine which variable has the highest value for a specific participants, and put the name of one of these variables instead of a placeholder in feedback text (sort of like: if MEAN_FLUID highest of the three variables, placeholder = fluid; if MEAN_CRYSTALIZED highest of the three variables, placeholder=crystalized, else placeholder = MEAN_VISUAL). Can you help me with the code for this?

Thank you in advance!

Best

1 Answer

0 votes
ago by SoSci Survey (353k points)
selected ago by s126407
 
Best answer

but first i need sosci to take these three mean scores, sort them from min to max for each participant, and present only the name of the variable containing highest value of these three variables.

You can use the PHP array functions for that. Let' create an array with nice labels and the values:

$a = [
  'Fluid' => value('MEAN_FLUID'),
  'Crystalized' => value('MEAN_CRYSTALIZED'),
  'Visual' => value('MEAN_VISUAL')
];

Now, you can sort by values:

asort($a);

And finally, you get the labels in the appropriate order:

$labels = array_keys($a);
debug($labels);

need help telling sosci to take the third line for each participant

You need the panelRecords() function to retrieve data from other cases with he same SERIAL.

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

...