Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Using the same token multiple times

Using the same token multiple times 3 years 4 months ago #61153

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
The administrator has disabled public write access.

Re: Using the same token multiple times 3 years 4 months ago #61157

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2684
  • Thank you received: 326
  • Karma: 121
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: Using the same token multiple times 3 years 4 months ago #61172

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 administrator has disabled public write access.

Re: Using the same token multiple times 3 years 4 months ago #61173

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2684
  • Thank you received: 326
  • Karma: 121
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: Using the same token multiple times 3 years 4 months ago #61176

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2684
  • Thank you received: 326
  • Karma: 121
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. ;-)
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: Using the same token multiple times 3 years 4 months ago #61194

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4195
  • Thank you received: 789
  • Karma: 359
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Using the same token multiple times 3 years 4 months ago #61218

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: 3 years 4 months ago by jeroenbrouns.
The administrator has disabled public write access.

Re: Using the same token multiple times 3 years 4 months ago #61221

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2684
  • Thank you received: 326
  • Karma: 121
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: Using the same token multiple times 3 years 3 months ago #61416

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

Re: Using the same token multiple times 3 years 3 months ago #61419

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2684
  • Thank you received: 326
  • Karma: 121
@phschwager: That is what Tpartner had already suggested, but it is not working for jeroenbrouns.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.240 seconds
Donation Image