I need to prefill a survey with answers for up to 50 questions (mostly numeric or short text) which will be hidden from the user, for example, ans1, ans2... ans50.
The survey will require a token as well.
Prefilled answers will be accessed by other survey questions in javascript functions using {qcode.shown} expression, i.e. {ans1.shown}.
I am able to get this to work by passing the survey answers in the URL, but due to the large number of parameters needed, the potential for people editing the URL, etc., I was hoping to use
a query to update the LimeSurvey table (lime_survey_sid).
While I was successful at doing this using the token value, it appears that the answers are not available to my javascript function using either {qcode.shown} or {qcode.NAOK} despite allowing multiple responses in token settings.
I suspect that the survey is not pulling answers from the lime_survey_sid table at start-up, but I was wondering if there was a way to force this?
Why don't you write this data in custom attributes of the token table? You can access those from within the survey, you can export them together with the survey results and they are hidden from the user.
As you require tokens anyway, this is the cleanest solution.
You can access these values with something like {TOKEN:ATTRIBUTE_1}, {TOKEN:ATTRIBUTE_2} etc.
Help us to help you!
Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
It works pretty well. For a Telephone survey I pipe information about the respondents into the survey and the interviewers can basically see the first name, last name, company name, sector code, address, telephone numbers etc.
All this information is stored in the token table and comes from a list that is either purchased from list providers or from the list of customers that our client provides us. Works fine.
You only need to set it up. Once it works and is tested you can create the token table in excel and upload it as CSV.
Help us to help you!
Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.