- Posts: 60
- Thank you received: 7
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Prefill short text via URL and display it in text-display
- r0bis
- Topic Author
- Offline
- Senior Member
Less
More
5 years 6 months ago #175750
by r0bis
r0berts
Prefill short text via URL and display it in text-display was created by r0bis
Hi All,
I am struggling a bit with pre-fill and it would be great if someone could point me in the right direction:
Survey is on teaching feedback. I pre-fill name field from URL (given as a QR code). This allows me to display the name the students are giving responses for, but students are also able to edit the name, which I do not want. So I thought I would hide the name entry field - it still gets pre-filled from URL and display the name in "text-display" type question. However I cannot see how I can do this. My URL looks like this:
My survey is displayed as All-in -One - therefore I do not think I can use previous question field, even though it is prefilled. This also leads to a more general question - how can we display, list, refer-to parameters passed via URL?
Thanks
I am struggling a bit with pre-fill and it would be great if someone could point me in the right direction:
Survey is on teaching feedback. I pre-fill name field from URL (given as a QR code). This allows me to display the name the students are giving responses for, but students are also able to edit the name, which I do not want. So I thought I would hide the name entry field - it still gets pre-filled from URL and display the name in "text-display" type question. However I cannot see how I can do this. My URL looks like this:
Code:
http://lime.lan/lime/index.php/survey/index/sid/784141/newtest/Y?QDL000=Name Surname&QDT000=Name Surname
My survey is displayed as All-in -One - therefore I do not think I can use previous question field, even though it is prefilled. This also leads to a more general question - how can we display, list, refer-to parameters passed via URL?
Thanks
r0berts
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12921
- Thank you received: 3976
5 years 6 months ago - 5 years 6 months ago #175753
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Prefill short text via URL and display it in text-display
Hi,
With this link
you fill your short text question N1. And you set it to "Always hide this question".
In the text display you refer to the short text question by {N1}
Best regards
Joffm
With this link
Code:
https://www.myServer.de/survey/index.php/111111?newtest=Y&N1=MyName
In the text display you refer to the short text question by {N1}
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 5 years 6 months ago by Joffm.
The following user(s) said Thank You: r0bis
The topic has been locked.
- r0bis
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 60
- Thank you received: 7
5 years 6 months ago #175757
by r0bis
r0berts
Replied by r0bis on topic Prefill short text via URL and display it in text-display
Thanks very much, that is great. Exactly what I wanted.
In the interim I went a slightly roundabout way - I created 2nd question as an Equation, set that it should show only if question 1 is prefilled (i.e. relevance = {Q1}) and then 2nd question says You are giving feedback for {Q1}. Q1 is short text, hidden and mandatory.
This way I only show Q2 when Q1 is prefilled from URL. Otherwise neither Q1 nor Q2 are displayed. Which makes form useful also for nameless feedback submission - in that case results can be filtered (i.e. attached to a lecturere) by the time of submission. Even though Q1 is mandatory system lets me submit feedback without Q1 - if it is 'always hidden'.
Great system, thanks again.
In the interim I went a slightly roundabout way - I created 2nd question as an Equation, set that it should show only if question 1 is prefilled (i.e. relevance = {Q1}) and then 2nd question says You are giving feedback for {Q1}. Q1 is short text, hidden and mandatory.
This way I only show Q2 when Q1 is prefilled from URL. Otherwise neither Q1 nor Q2 are displayed. Which makes form useful also for nameless feedback submission - in that case results can be filtered (i.e. attached to a lecturere) by the time of submission. Even though Q1 is mandatory system lets me submit feedback without Q1 - if it is 'always hidden'.
Great system, thanks again.
r0berts
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
5 years 6 months ago #175765
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Prefill short text via URL and display it in text-display
Keep an eye on the URL itself. "Name Surname" can be problematic, because you have an emtpy space between Name and Surbname. Depending on the webserver such things can work, but you're better off keep it simple. No spaces, no special chars will help to prevent trouble.r0bis wrote:
Code:http://lime.lan/lime/index.php/survey/index/sid/784141/newtest/Y?QDL000=Name Surname&QDT000=Name Surname
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: r0bis
The topic has been locked.
- r0bis
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 60
- Thank you received: 7
5 years 6 months ago #175793
by r0bis
r0berts
Replied by r0bis on topic Prefill short text via URL and display it in text-display
Thanks. I use Apache and %20 works for whitespace. But I have seen URL parameters suggested in links in several different ways; is there an explanation what each bit in URL means? Especially if several fields are being filled? And what 'newtest' means? (I could make a decent write-up about this, if I get access to that information.)
r0berts
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
5 years 6 months ago #175795
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Prefill short text via URL and display it in text-display
newtest = Y does exactly what it indicates. It starts a new survey session so answers and response persistence are reset.
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: DenisChenu, r0bis
The topic has been locked.