Welcome, Guest
Username: Password: Remember me

TOPIC: multiple surveys with one token

multiple surveys with one token 3 years 6 months ago #50324

  • alukard
  • alukard's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 1
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
The administrator has disabled public write access.

Re:multiple surveys with one token 3 years 6 months ago #50329

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5850
  • Thank you received: 716
  • Karma: 222
Use in_array function.
if ( in_array($surveyid, array('71314','85685','679676')) {

I think it's work.
The administrator has disabled public write access.

Re:multiple surveys with one token 3 years 6 months ago #50367

  • alukard
  • alukard's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 1
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') {
The administrator has disabled public write access.

Re:multiple surveys with one token 3 years 6 months ago #50381

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
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)limesurvey.org'"
The administrator has disabled public write access.

Re:multiple surveys with one token 3 years 5 months ago #51171

  • Gordon55M
  • Gordon55M's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Karma: 0
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.
The administrator has disabled public write access.

Re:multiple surveys with one token 1 year 6 months ago #86194

  • mas_carpone
  • mas_carpone's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 86
  • Thank you received: 4
  • Karma: 0
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: 1 year 6 months ago by mas_carpone.
The administrator has disabled public write access.

Re:multiple surveys with one token 1 year 6 months ago #86198

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
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)limesurvey.org'"
The administrator has disabled public write access.

Re:multiple surveys with one token 1 year 6 months ago #86263

  • mas_carpone
  • mas_carpone's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 86
  • Thank you received: 4
  • Karma: 0
This is great!
Many thanks!

Mas
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.164 seconds
Donation Image