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
  • r0bis's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 5 months ago #175750 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:
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
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 months ago - 5 years 5 months ago #175753 by Joffm
Hi,


With this link
Code:
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
Last edit: 5 years 5 months ago by Joffm.
The following user(s) said Thank You: r0bis
The topic has been locked.
  • r0bis
  • r0bis's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 5 months ago #175757 by r0bis
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.

r0berts
The topic has been locked.
More
5 years 5 months ago #175765 by jelo

r0bis wrote:

Code:
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.

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
  • r0bis's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 5 months ago #175793 by r0bis
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
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 months ago #175795 by tpartner
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.

Lime-years ahead

Online-surveys for every purse and purpose