Prefill short text via URL and display it in text-display

More
2 weeks 6 days ago #175750 by r0bis
r0bis created the topic: Prefill short text via URL and display it in text-display
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:
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

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago - 2 weeks 6 days ago #175753 by Joffm
Joffm replied the topic: Prefill short text via URL and display it in text-display
Hi,


With this link
https://www.myServer.de/survey/index.php/111111?newtest=Y&N1=MyName
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


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last Edit: 2 weeks 6 days ago by Joffm.
The following user(s) said Thank You: r0bis

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #175757 by r0bis
r0bis replied the 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.

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #175765 by jelo
jelo replied the topic: Prefill short text via URL and display it in text-display

r0bis wrote:

http://lime.lan/lime/index.php/survey/index/sid/784141/newtest/Y?QDL000=Name Surname&QDT000=Name Surname

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.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey
The following user(s) said Thank You: r0bis

Please Log in or Create an account to join the conversation.

More
2 weeks 5 days ago #175793 by r0bis
r0bis replied the 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.)

Please Log in or Create an account to join the conversation.

More
2 weeks 5 days ago #175795 by tpartner
tpartner replied the 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

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!