Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Set default array with Parameter

  • cablebeachside
  • cablebeachside's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #192261 by cablebeachside
Set default array with Parameter was created by cablebeachside
Hi,

I want to send out an email to our guests with something like the following:

Please let us know how you enjoyed your stay with us:
❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿
Not at all satisfied … Extremely Satisfied


For each of the 1 to 10 dots, I would add a hyperlink to our survey with a parameter R=01 to R=10. Eg:
Code:
xxxxx.limequery.com/survey/index/sid/nnnnn/newtest/Y/lang/en/R/06

I would like the survey to display with the rating pre-populated from the URL. However, I do want the guest to see this and be able to change their rating in the survey if they wish.

I have setup an array question called Welcome, with one sub-question called W1. This has answers W01 to W10.

I have setup a hidden short text question called Rating, which I then set using panel integration.

I have setup another hidden equation question with the following equation:
Code:
{Welcome_W1=if(!is_empty(Rating) && is_empty(Welcome_W1),join("W",Rating),Welcome_W1)}

However, this doesn't seem to work.

I have tried various combinations, but come up against problems every time.

I can get the rating and the calculation works, but it does not populate the array.

Has someone else done something similar and can you point me in the right direction?

Thanks,
Ross
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #192263 by Joffm
Replied by Joffm on topic Set default array with Parameter
Hi,

I do not see an issue


In this case I didn't use the panel integration. I just assigned the question code
www.example.com/survey/index.php/983555/newtest/Y/Q1/06

Joffm

File Attachment:

File Name: limesurvey...3555.lss
File Size:21 KB

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • cablebeachside
  • cablebeachside's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #192291 by cablebeachside
Replied by cablebeachside on topic Set default array with Parameter
Hello Joffm,

Thanks for the reply and the sample. I reviewed your survey and found a couple of issues with my settings.

I also wasn't aware that you could pass in default answers directly to questions, so I changed my approach to make it simpler by just passing in the Welcome_W1 value on the URL and deleting the first 3 questions.

eg: www.example.com/survey/index.php/983555/...est/Y/Welcome_W1/W06

This works much better.

Cheers,
Ross
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #192293 by Joffm
Replied by Joffm on topic Set default array with Parameter

I also wasn't aware that you could pass in default answers directly to questions

Therefore there is a manual: ;)
manual.limesurvey.org/URL_fields#Prefill...using_GET_parameters


But there is one more thing:
You have a scale 1-10. I am sure you want to calculate some statistical tests later, like mean, t-test, ...
To do that you need numerical values, but now your array uses "text" values.
Either you recode later in your statistc tool, or you'll only be able to do tests on nominal data, like CHI2.
Or you change your codes to 1-10 and pass the numerical value "http:www.example.com/.../Welcome_W1/6"

All the best

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose