Welcome to the LimeSurvey Community Forum

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

Admin Username Variable in Survey

  • marcgold
  • marcgold's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 8 months ago #187649 by marcgold
Admin Username Variable in Survey was created by marcgold
We have a slightly different usecase where the only people taking surveys are admin users. We use the Execute survey to collect data during interviews so we can enable routing and styling. The Admin complete form just isnt right.

the first question we always ask is the interviewers name, (will always be the name of the logged in user).
So it would be very useful to be able to automatically fill this field based on the name of the user logged in.

We place a button at the end of a survey with the variable {SID} ie www.URL.com/{SID } that allows them to restart a new survey

So is there an equivalent variable for User Name - or can we add one. Also, is there a list anywhere of all available variables.

Looking forward to any replies.

LS 3.17.7
The topic has been locked.
  • gabrieljenik
  • gabrieljenik's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
4 years 8 months ago #187654 by gabrieljenik
Replied by gabrieljenik on topic Admin Username Variable in Survey
Hi,

Let me suggest you this plugin, which will allow you to autoprefill answers based on cookies, with very easy usage.
www.encuesta.biz/en/product/limesurvey-question-cookies/

Each admin may have its own questions prefilled the way they want, as answers to be used for prefilling are held on each browser.

Thanks!

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .

The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago - 4 years 8 months ago #187656 by Joffm
Replied by Joffm on topic Admin Username Variable in Survey

We place a button at the end of a survey with the variable {SID} ie www.URL.com/{SID } that allows them to restart a new survey


If you do that, you may add the interviewers name as well, like www.URL.com/{SID}?newtest=Y&name={Q0 }

The first time, when the interviewer starts the first questionnaire the field is empty and he may enter his name the usual way.


Restarting the questionnaire you capture it with "panel integration" and fill the field automatically



Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 8 months ago by Joffm.
The topic has been locked.
  • marcgold
  • marcgold's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 8 months ago #187657 by marcgold
Replied by marcgold on topic Admin Username Variable in Survey
Hi Joffm

Nice solution, and its was the one that we were considering but it has its limitations.

We use a template that fills a lot of the boilerplate questions and interviewer (Admin Name) is one of them. Using the Variable {SID} means we do not need to adjust the URL everytime and cuts down on the possibility of a mistake.

As the QID will change on every survey it will need to be updated every time and mistakes may crop up. As we are building between 5 - 10 a day this then becomes a tedious task.

But like the thinking. And useful to others just not so perfect for our use case.
Really looking for a way of adding this as a variable so I can place it in the default text.
The topic has been locked.
  • marcgold
  • marcgold's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 8 months ago - 4 years 8 months ago #187658 by marcgold
Replied by marcgold on topic Admin Username Variable in Survey
Actually Joffm,
Just looked again at your response and how you constructed the URL. How do you pass that in the URL to a specific question when the {QID} changes every time.

the way we do this now is is limesurveyurl.com/12345/12345X111X222 where 12345X111X222 is the Full QID.

Have I missed a trick here? We're not using panel integration . Should we?

Marc
Last edit: 4 years 8 months ago by marcgold.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #187660 by Joffm
Replied by Joffm on topic Admin Username Variable in Survey
Yes, exactly, "Panel integration"




You see, the question ("short text") where the name will appear is Q0

and the parameter added to the URL is "name"

The text of the end-url then is:

www.myServer.com/survey/{SID}?newtest=Y&name={Q0 }

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • marcgold
  • marcgold's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 8 months ago #187680 by marcgold
Replied by marcgold on topic Admin Username Variable in Survey
Firstly Thank you both for your input @gabrieljenik @Joffm

Both solutions work for the use case and I wanted to just feedback my views on both based with some very limited testing.

I can see some very useful use cases for both solutions as they do work in different ways. These are just my views and feel free to chip in. Just thought this may be useful to others on the forum.

Panel Integration
Very nice, and I didn't know you could do that, so learning something new is always exciting.

Pro's:
Easy to use and Core LS so updates / bug fixes are handled
Able to pass multiple data as a post variable in URL from other site
Able to use variables within existing survey and End statement

Con's:
With a lot of variables the $Post variables URL will get quite long
If using it to pass data from one site to another the user has the ability to mess with the URL.

LS Question Cookie

Pro's
Very simple to install and activate
can set multiple cookies and TTL's on each and every text question - therefore no need for long $POST variables
Not easy for user to mess with variable data (without a cookie editor).

Con's
Cookies are held in plain text - I worry about 3rd party browser attacks that may be able to steal cookie data if storing sensitive data. This needs to be thought about.
No ability to pass data from another site via this method - however I am looking at setting domain level cookies to see if this gets around this. Both sites are in the same domain ie site1.example.com and site2.example.com. Different domains would break the browsers security rules for cookies so would be unreliable.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose