Pre-fill answer in hidden question with participant token value - for statistics

More
1 month 1 week ago #158531 by dotxm
dotxm created the topic: Pre-fill answer in hidden question with participant token value - for statistics
Hello, I am trying to allow a user to filter the results in the analysis page based on token value.

For instance:
Show the results of all the participants that have 'Europe' in their 'Region' token

This means that the question itself should be hidden from the participant. It only exists for analysis purposes.

I tried creating an equation question with the equation field set to any of the following, but it is always empty:
{TOKEN:ATTRIBUTE_1}
{if(1==1,TOKEN:ATTRIBUTE_1,'nothing')}
'something'
1

The relevance equation did not make any difference. With or without any value, I am getting nothing in the question.

It is clear to me that I am missing something very obvious here, but right now I am well and truly stuck.

Any ideas?

Please Log in to join the conversation.

More
1 month 1 week ago #158540 by tpartner
tpartner replied the topic: Pre-fill answer in hidden question with participant token value - for statistics
The first equation looks correct.

First leave the question visible so you can see if it is being loaded, then hide it with question class "hidden".

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: dotxm

Please Log in to join the conversation.

More
1 month 1 week ago #158557 by dotxm
dotxm replied the topic: Pre-fill answer in hidden question with participant token value - for statistics
Thank you, Tony!

It appears that when you try to hide a group of questions, then none of the answers is taken into account in the statistics.

The problem was that I wanted to hide the entire group, and I have set the group's relevance equation to 1==2.

Once I showed it again, and only set the questions with the class 'hidden', their data appeared in the statistics.

As for using these questions for statistics filtering, I changed the question type to free text, so that it would be possible to at least filter by entering text in the chosen boxes.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now