Using the same token multiple times

More
6 years 1 week ago #61153 by jeroenbrouns
jeroenbrouns created the topic: Using the same token multiple times
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:
elseif (bIsTokenCompletedDatestamped($thissurvey))
    {
        if (isset($usesleft) && $usesleft<=1)
        {
			$utquery .= "SET usesleft=usesleft-1, completed='$today'\n";
    }
    else
    {
			$utquery .= "SET usesleft=usesleft-1\n";
    }
    }
    else
    {
        if (isset($usesleft) && $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:
if (bIsTokenCompletedDatestamped($thissurvey))
	{
 
	$utquery .= "SET completed='$today'\n";
	}
 
	}
	else
	{
 
	$utquery .= "SET completed='Y'\n";

greetings,

jeroen

Please Log in to join the conversation.

More
6 years 1 week ago #61157 by holch
holch replied the 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
6 years 5 days ago #61172 by jeroenbrouns
jeroenbrouns replied the 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?

Please Log in to join the conversation.

More
6 years 5 days ago #61173 by holch
holch replied the 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
6 years 5 days ago #61176 by holch
holch replied the 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
6 years 4 days ago #61194 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

More
6 years 4 days ago - 6 years 4 days ago #61218 by jeroenbrouns
jeroenbrouns replied the 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: 6 years 4 days ago by jeroenbrouns.

Please Log in to join the conversation.

More
6 years 4 days ago #61221 by holch
holch replied the 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
6 years 2 days ago #61416 by phschwager
phschwager replied the 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.

Please Log in to join the conversation.

More
6 years 1 day ago #61419 by holch
holch replied the topic: Using the same token multiple times
@phschwager: That is what Tpartner had already suggested, but it is not working for jeroenbrouns.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
5 years 8 months ago #65399 by mdekker
mdekker replied the 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

Please Log in to join the conversation.

More
5 years 8 months ago #65402 by dataguru
dataguru replied the 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?

Please Log in to join the conversation.

More
5 years 8 months ago #65403 by dataguru
dataguru replied the topic: Using the same token multiple times
Nevermind. I just answered my own question. :)

I exported a token table to get the field names.
The field "usesleft" was there, so I incorporated that into the csv file and it imported just fine!

Please Log in to join the conversation.

More
5 years 3 months ago #74865 by mfreund
mfreund replied the topic: Using the same token multiple times
Is there a place in the survey preferences to set the default number of uses per token?

I am in a similar situation, where I have a survey with public access but token-based tracking of respondents, where respondents will sign up on the registration page but then have the option of responding to the survey multiple times with the same token. (It is being used to collect ideas, and I want to allow people to submit multiple ideas if they choose.)

I have looked everywhere, but can't seem to find a setting to make the default number of uses per token more than 1. Obviously that can be changed manually in the token table or if I were importing a predefined token list, but as a public registration survey each person will be registering themselves and LS will create their token.

Is there a setting to do this?

Please Log in to join the conversation.

More
5 years 3 months ago #74879 by DenisChenu
DenisChenu replied the topic: Using the same token multiple times

mfreund wrote: Is there a setting to do this?

Not actually, maybe you can put a feature request, i think it's a good idea.

Maybe you can try:
ALTER TABLE `lime_tokens_XXXXX` CHANGE `usesleft` `usesleft` INT( 11 ) NULL DEFAULT '1000'
(replace XXXX with your survey-id ), not sure because i don't read the code for registration.

Denis

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.

Start now!

Just create your account and start using Limesurvey today.

Register now