Welcome, Guest
Username: Password: Remember me

TOPIC: Automatic token generation when token is used

Automatic token generation when token is used 3 years 4 months ago #60617

  • ryebank
  • ryebank's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Although this is partly a "can I do this" question I have posted under development because I know it will need some PHP tweaks.

I have a survey to capture results from a community questionnaire - this will go as a single printed copy to each household but individual household members will be allowed to enter further response sets online via LimeSurvey if they want. The printed copies will have unique numbers assigned to them to help us track response rates and even though they are delivered printed we will be encouraging people to do their return online. I will use the unique number as a token - but if say token 1234 is entered a second time on the token page I want to do a number of thing:
1. If token used but previous survey was not completed check if user want to complete now and if so show that partially completed response
2. If token used and fully completed or in above user opts to submit a new set of results then generate a new token based on the original one (e.g. 1234.1 or if that is also used 1234.2 etc.) and then enter the survey page with the new token

I have looked at the newtoken.php script from bugs.limesurvey.org/view.php?id=2982 and I can see how I could deal with the token generation - but where do I need to "inject" this to get the token page to run this (modified as required) when LimeSurvey finds the token has been used rather than going to the normal "token used" page?

And any help about how to implement the redirections would be welcome too!

Thanks in advance
The administrator has disabled public write access.

Re: Automatic token generation when token is used 3 years 4 months ago #60731

  • ryebank
  • ryebank's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
A real deathly hush in here ....

Anyway - I think I have figured where I need to start hacking - all the token checking seems to be in index.php and around line 640ish where the comment "//Check if TOKEN is used for EVERY PAGE" starts seems to be where I need to start my hack.

I'll keep this post updated in case this is of any use to anyone else in future
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.081 seconds
Donation Image