- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
display the response ID to responder along the survey
- ftrifoglio
- Topic Author
- Offline
- New Member
Less
More
12 years 11 months ago #59531
by ftrifoglio
display the response ID to responder along the survey was created by ftrifoglio
As the title I would display to the user his response ID in a boilerplate question.
I tried with the {SAVEDID}, but I think it can be used just with the end URL.
I tried with the {SAVEDID}, but I think it can be used just with the end URL.
The topic has been locked.
- ftrifoglio
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
12 years 11 months ago #59572
by ftrifoglio
Replied by ftrifoglio on topic display the response ID to responder along the survey
I did it!
I'm not skilled with php, but I figured out that the response ID variable is
$saved_id = $_SESSION
Since I cannot use a php script in a question text, I have to create a placeholder to use in a boilerplate question.
The placeholders are created in the common_functions.php
I copied the function that create the placeholder {NUMBEROFQUESTIONS} and added to the next line. I renamed the placeholder and I replaced the variable $totalquestionsAsked with $_SESSION.
The line to add is
if (strpos($line, "{PLACEHOLDER}") !== false) $line=str_replace("{PLACEHOLDER}", $_SESSION, $line);
I guess it's not the best way to do it, but it works fine for me.
I'm not skilled with php, but I figured out that the response ID variable is
$saved_id = $_SESSION
Since I cannot use a php script in a question text, I have to create a placeholder to use in a boilerplate question.
The placeholders are created in the common_functions.php
I copied the function that create the placeholder {NUMBEROFQUESTIONS} and added to the next line. I renamed the placeholder and I replaced the variable $totalquestionsAsked with $_SESSION.
The line to add is
if (strpos($line, "{PLACEHOLDER}") !== false) $line=str_replace("{PLACEHOLDER}", $_SESSION, $line);
I guess it's not the best way to do it, but it works fine for me.
The topic has been locked.
- cycas
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
12 years 10 months ago #60655
by cycas
Replied by cycas on topic display the response ID to responder along the survey
I'm trying to do almost this same thing (with the permutation that I want to tag the ResponseID onto some other stuff inside a question field) and I cannot get this to work!
I've tried adding a placeholder, and my placeholder gets substituted OK, but there's nothing in $_SESSION?
So I tried echoing out $_SESSION in various places but nothing!
Anyone able to suggest what I am doing wrong?
I've tried adding a placeholder, and my placeholder gets substituted OK, but there's nothing in $_SESSION?
So I tried echoing out $_SESSION in various places but nothing!
Anyone able to suggest what I am doing wrong?
The topic has been locked.
- ftrifoglio
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
12 years 10 months ago - 12 years 10 months ago #60656
by ftrifoglio
Replied by ftrifoglio on topic display the response ID to responder along the survey
Did you activate the survey?
I guess that none value is assigned to that variable in the evaluation mode.
I guess that none value is assigned to that variable in the evaluation mode.
Last edit: 12 years 10 months ago by ftrifoglio.
The topic has been locked.
- cycas
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
12 years 10 months ago #60658
by cycas
Replied by cycas on topic display the response ID to responder along the survey
Oh NOOOOOOO !
I knew it had to be obvious, but did it have to be that simple? *bangs head repeatedly on desk*
I should have asked earlier. I am an idiot. THANK YOU!!!
I knew it had to be obvious, but did it have to be that simple? *bangs head repeatedly on desk*
I should have asked earlier. I am an idiot. THANK YOU!!!
The topic has been locked.
- pedrorobalo
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
11 years 1 month ago #92342
by pedrorobalo
Replied by pedrorobalo on topic display the response ID to responder along the survey
Hi cycas and ftrifoglio,
Where can I find the common_functions.php file?
Cheers
Where can I find the common_functions.php file?
Cheers
The topic has been locked.
- cycas
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
11 years 1 month ago #92349
by cycas
Replied by cycas on topic display the response ID to responder along the survey
Um - it's a little while since I've done anything with Limesurvey, but I think it should just be in your main survey directory - /public_html/survey/common_functions.php or /public_html/limesurvey/common_functions.php depending on where you installed it?
The topic has been locked.