multiple surveys with one token

More
7 years 1 week ago #50324 by alukard
alukard created the topic: multiple surveys with one token
Hello everyone

I need help, i hope you can tell me how to resolve this
(Excuse my english)
I have one survey and tokens to entry to the survey multiple times editing index.php like this:

Editt funcion submittokens() and replace lines:

_________________________________________________________________________
if (bIsTokenCompletedDatestamped($thissurvey))
{

$utquery .= "SET completed='$today'\n";
}

}
else
{

$utquery .= "SET completed='Y'\n";
/////////////////////////////////////////////////////////////////////

By this lines:

if (bIsTokenCompletedDatestamped($thissurvey))
{
//multiple token only for survey 71314

if ($surveyid == '71314') {
$utquery .= "SET completed='N'\n";
}else {
$utquery .= "SET completed='$today'\n";
}

}
else
{

//$utquery .= "SET completed='Y'\n";
*************************************************************************

only i have to change the id survey
Everythig its fine to this point
But i have created another survey, and i will create more, how can i edit this code for multiple responses with one token?

how can i add more id surveys in the function so i can use the token multiple times?

I hope you could understand me i help me with this

Please Log in to join the conversation.

More
7 years 1 week ago #50329 by DenisChenu
DenisChenu replied the topic: multiple surveys with one token
Use in_array function.
if ( in_array($surveyid, array('71314','85685','679676')) {

I think it's work.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
7 years 1 week ago #50367 by alukard
alukard replied the topic: multiple surveys with one token
Thanks for your answer Shnoulle

I´ve tried the way you explain but it doesn´t work, ´cause in the page loading it doesn´t show anything.

So, I tried this way and it works, I hope will be usefull for anybody:

if ($surveyid == '13716'OR'63828') {

Please Log in to join the conversation.

More
7 years 1 week ago #50381 by Mazi
Mazi replied the topic: multiple surveys with one token
That's another working solution.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
6 years 11 months ago #51171 by Gordon55M
Gordon55M replied the topic: multiple surveys with one token
Is their a way to specify in this code that the user is only able to participate in the survey twice? So they can take it once using their given token, then come back and take it again at a later time using the same token. Once they finish it that second time, it would lock them out from taking it a third time.

If this is possible and if there are code issues similar to above it would be a great help for some guidance, I am still fairly new to LimeSurvey after converting from Apian.

Please Log in to join the conversation.

More
5 years 3 weeks ago - 5 years 3 weeks ago #86194 by mascarpone
mascarpone replied the topic: multiple surveys with one token
Dear Colleagues

I am after the same question: can I provide a token (and hence 1 single link that I can controle (to which i can attribute a deadline, etc.)) to many different "interviewes"?

Thanks!
Last Edit: 5 years 3 weeks ago by mascarpone.

Please Log in to join the conversation.

More
5 years 3 weeks ago #86198 by Mazi
Mazi replied the topic: multiple surveys with one token
You can use the same token multiple times by manually creating a new token entry and setting the "uses left" value to 10 or 100 or 1.000 or whatever you need.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 2 weeks ago #86263 by mascarpone
mascarpone replied the topic: multiple surveys with one token
This is great!
Many thanks!

Mas

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now