Welcome to the LimeSurvey Community Forum

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

Using the same token multiple times

  • jeroenbrouns
  • jeroenbrouns's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago #61153 by jeroenbrouns
Using the same token multiple times was created by jeroenbrouns
Hello,

I'm making an online survey for the University of Maastricht and just updated the previous version to 1.91+.

I need to know how to edit the files of limesurvey, so we can use the same token multiple times.

The research population will be divided in teams. Our plan is to give every team a token. Then the teamleader will distribute this same token to all their employees.

I already saw the article
opened by Samba who was asking the same question.

I tried to edit the index.php which was described by the documentation Schnoulle replied, but i guess this new version is a bit different from 1.74

this is my code:
Code:
elseif (bIsTokenCompletedDatestamped($thissurvey))
    {
        if (isset($usesleft) &amp;&amp; $usesleft<=1)
        {
      $utquery .= "SET usesleft=usesleft-1, completed='$today'\n";
    }
    else
    {
      $utquery .= "SET usesleft=usesleft-1\n";
    }
    }
    else
    {
        if (isset($usesleft) &amp;&amp; $usesleft<=1)
        {
      $utquery .= "SET usesleft=usesleft-1, completed='Y'\n";
    }
    else
    {
      $utquery .= "SET usesleft=usesleft-1\n";
    }
    }
    $utquery .= "WHERE token='".db_quote($clienttoken)."'";
 
    $utresult = $connect->Execute($utquery) or safe_die ("Couldn't update tokens table!<br />\n$utquery<br />\n".$connect->ErrorMsg());     //Checked

different from the one in the documentation:
Code:
if (bIsTokenCompletedDatestamped($thissurvey))
  {
 
  $utquery .= "SET completed='$today'\n";
  }
 
  }
  else
  {
 
  $utquery .= "SET completed='Y'\n";

greetings,

jeroen
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 10 months ago #61157 by holch
Replied by holch on topic Using the same token multiple times
Can't you just give out a token for any team member?

Maybe you have a very specific case where this isn't possible, but in general you should know more or less how many members a team has, right?

I would (depending of the final purpose of course this might not be possible, so this is just an idea) distribute a list of tokens to the team leader and he can give ich Team-Member one.

If you don't know the exact number necessary you just create some more links for safety.

I assume you want to have a token per team so that you can identify the person with the team. But this can be solved. You just create your tokens to have a certain code for the team in it.

E.g. the token would consist of a number code for the team and then a consecutive number. So for team 1 it would look like this:

T001001
T001002
T001003
...
T001999

Team 2

T002001
T002002
T002003
...
T002999


Just a suggestion, but maybe it is an option for you and you wouldn't have to touch the source code.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • jeroenbrouns
  • jeroenbrouns's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago #61172 by jeroenbrouns
Replied by jeroenbrouns on topic Using the same token multiple times
thanks for your response.

Yeah we thought of all possibilities, but the problem is:
The employees don't have an e-mail account, so communication has to be directly with the team leader. We didn't want to give all the employees a unique token, but give the team leader a token. in this way we put the responsibility by the team leader.

so basically we want to use the same token multiple times. We will add a few questions such as birthdate, first name so we can identify the person who filled it in afterwards with spss.

can you help us out?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 10 months ago #61173 by holch
Replied by holch on topic Using the same token multiple times
Nope, unfortunately not. I am not a developer and I don't see a change to use a token various times without going into the source code. But maybe one of the developers will show up here and can help.

As far as I remember, the issue came up a few times in the forum already, but I don't know if there was a solution for it.

Do you necessarily need a token then?

Can't you just taken an open survey and add a variable for each team at the end of the URL, that you write into a hidden question, so you would be able to know from which team it was.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 10 months ago #61176 by holch
Replied by holch on topic Using the same token multiple times
One other thing: as they don't have any email, the team leader will have to distribute the link somehow differently (e.g. on paper). So you could just provide a little paper with the link for each one. But that is just a suggestion as I don't know all the circumstances of the project, of course. Just trying to give ideas that might work without having to change the source code of Limesurvey, because for changing source code I am not much of a help. ;-)

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 10 months ago #61194 by tpartner
Replied by tpartner on topic Using the same token multiple times
How about using a "password" question at the beginning of the survey? Each team could be given the survey URL and a team "password" to enter into a text question. Quotas or conditions could then be used to allow access to the rest of the survey.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • jeroenbrouns
  • jeroenbrouns's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago - 12 years 10 months ago #61218 by jeroenbrouns
Replied by jeroenbrouns on topic Using the same token multiple times
Thanks for the ideas, but we really need an option That enables the multiple use of tokens, because we need to identify who from which team did fill in the survey. We really need an edit of the sourcecode. Still no one to help us out?

Distribution the token by paper is also not an option, because there are 2000 employees.

Greetings
Last edit: 12 years 10 months ago by jeroenbrouns.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 10 months ago #61221 by holch
Replied by holch on topic Using the same token multiple times
Hmm, but with multiple usage of the same token you will only know from which team it comes, not from whom.

I am wondering how you will distribute the token any other way, if there are no emails, but I guess you have your ways.

Unfortunately I can't help you with adapting the source code, I am just a user, not a developer.

From the information you have provided so far, I still think some of the solutions above (eg. password for each team) or a team-id included in the link to substitute the token would do the thing, but if you really think you need to go into the source code, maybe the users Mazi or Carsten can help you out. You might aslo want to write an email to the developers to see if someone can do this as paid support, if there is no one on the forum who will be able to help you. They sometimes do some custom programming for a fee, I have heard.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
12 years 10 months ago #61416 by phschwager
Replied by phschwager on topic Using the same token multiple times
Perhaps I am over simplifying. Couldn't you just use a text box? Then each team member would enter their team code in the text box? That would allow you to track the team responses and add in the name information and you are set.

Of course I could be totally missing what you are trying to accomplish.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 10 months ago #61419 by holch
Replied by holch on topic Using the same token multiple times
@phschwager: That is what Tpartner had already suggested, but it is not working for jeroenbrouns.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • mdekker
  • mdekker's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 6 months ago #65399 by mdekker
Replied by mdekker on topic Using the same token multiple times
In 1.91 reuse tokens is a default feature... in the token screen you can sent how many times the token can be used.

---
Menno Dekker
The topic has been locked.
More
12 years 6 months ago #65402 by dataguru
Replied by dataguru on topic Using the same token multiple times
Yes, and it works beautifully!!

Can the number of uses be set as part of importing a csv token table?
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose