Welcome to the LimeSurvey Community Forum

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

Generating tokens without certain characters

  • Franziska_Neumayer
  • Franziska_Neumayer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 7 months ago #230486 by Franziska_Neumayer
Generating tokens without certain characters was created by Franziska_Neumayer
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================Dear LimeSurvey community,

We are carrying out a survey with high school students. Before they can start the survey, they have to enter a token that was generated by LimeSurvey. The issue is, that students often confuse certain characters such as the letter “O” and the number “0” or the letter “l” with the number “1”. To make our tokens more user-friendly, we would like to exclude these characters from our tokens.

Does anyone know how to define that certain characters are not used in the auto-generated tokens?

Any help would be highly appreciated. If you need further information, please let me know.
Best
Franziska

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #230498 by holch

Does anyone know how to define that certain characters are not used in the auto-generated tokens?

I think I remember to have read a similar request and if I am not mistaken, there was a solution, but I am not sure if this required "hacking" the source code or not. But I can't remember that there would be an option in the Limesurvey admin, where you can choose the letters and numbers that should be included (or excluded) when generating tokens. Maybe this is something that can be set in the config file of the installation, but I have never seen or done it and I can't find that specific post here in the forum that I think to remember.

But quick and dirty, there is always the option to upload your own tokens within the CSV file, where you could provide your own token codes.

By the way: Why did you not answer the basic questions about your version of Limesurvey, where it is installed, etc?

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #230499 by Joffm
Hi, Franziska,
why didn't you answer the questions at the beginning?
This is important for us to know what we can recommend.
Which version, which rights? Are you allowed to install plugins, to insert javascript? And other things.

You see, in version 5.x. there is a plugin "customToken" here you can limit the used characters.

And anyway, you can always create your own tokens (EXCEL, or whatever).
Insert them into the csv file and upload.

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #230500 by holch

You see, in version 5.x. there is a plugin "customToken" here you can limit the used characters.


How is this plugin used? I check in the "settings" tab, it says there are no settings.

I checked in "configuration --> Global Survey --> Participant Settings". Nothing.

OK, found it. well hidden. It is within the left column "settings tab" of a survey, right at the bottom under "simple plugins" -> "Settings for plugin customToken".

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

  • Franziska_Neumayer
  • Franziska_Neumayer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 7 months ago #230505 by Franziska_Neumayer
Replied by Franziska_Neumayer on topic Generating tokens without certain characters
Dear Joffm,

Thanks for your reply!

Here are the answers to your questions:
- LimeSurvey Version: 3.28.19+220712
- Own Server
- Survey theme/template: „fruity“

I have full access and I am also allowed to install plugins. Inserting javascripts should be possible, but I would need to check on that. Updating on version 5.1 might be a bit risky since participants are currently answering our survey. Same applies to the upload of own tokens: Since there are constantly new participants added to our survey, there is a high risk to produce duplicates which might cause issues.
Or is there a way to handle this? E.g. having an extremely large number of tokens with tokens being extracted from this list one after the other?

Please Log in to join the conversation.

  • Franziska_Neumayer
  • Franziska_Neumayer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 7 months ago #230506 by Franziska_Neumayer
Replied by Franziska_Neumayer on topic Generating tokens without certain characters
Dear holch,

Thanks for your quick reply. For further details, please see my reply to Joffms post.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #230509 by Joffm

Since there are constantly new participants added to our survey, there is a high risk to produce duplicates which might cause issues.
Or is there a way to handle this? E.g. having an extremely large number of tokens with tokens being extracted from this list one after the other?


Create the tokens "well defined".
1. Use a different length as the automatically generated tokens. (Isn't it 15 characters?)
So you avoid duplicates of already existing tokens.

2. A rough idea:
Create tokens randomly with a length of 8 characters (only desired characters) . This you can easily do in EXCEL
Then add an autoincrement number to it (without 0 and 1) (5 digits ->  32768 options) (6 digits ->  262144 options)
This way you are sure not to generate duplicates.
Like:
agfeutzq22222
lkiurztt22223
tretrete22224
...
So even if your EXCEL macro generates doubles you add different numbers.

Joffm



 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Franziska_Neumayer
  • Franziska_Neumayer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 7 months ago #230537 by Franziska_Neumayer
Replied by Franziska_Neumayer on topic Generating tokens without certain characters
Dear Joffm,

thank you for your good suggestions. As the participants get created on another site via php-scripts and a call to the API, I will have to check, whether we can change the handling of tokens in such a substantial manner during production. Apart from that: the current length of the tokens is set to 7 characters. I need to check, whether the manual insertion of tokens longer that length 7 is feasible.
 

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago - 2 years 7 months ago #230540 by holch

As the participants get created on another site via php-scripts and a call to the API


So you create the participants externally and insert them into Limesurvey via API? Why don't you create the token then in this external script and already set it while creating the participant via the API?

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
Last edit: 2 years 7 months ago by holch.

Please Log in to join the conversation.

  • Franziska_Neumayer
  • Franziska_Neumayer's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 6 months ago - 2 years 6 months ago #230575 by Franziska_Neumayer
Replied by Franziska_Neumayer on topic Generating tokens without certain characters
Dear holch, because Limesurvey is able to create tokens on the fly when creating participants. As it works flawless, there was no reason beforehand to create tokens ourselves and keep track of which tokens were already used etc. As such solutions are more probable to generate errors, I would consider it good practice to use in-built Limesurvey functions if they exist. The problem that participants frequently can not distinguish between letters (O,l) and numbers (0,1) in some cases, became only evident afterwards.

We are considering to introduce an own token table and lookup-service now if it does not pose a danger to our current setup. However, a simple option to exclude certain characters for future tokens in the Limesurvey options would be more feasible and I will also consider upgrading to the most current LS Version and utilizing the above mentioned plugin.
Last edit: 2 years 6 months ago by Franziska_Neumayer. Reason: clarification, outline

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 months ago #230584 by holch
I totally understand. I am just trying to help to find a solution to your issue. Either you update to LS5 which has such a function with the plugin that Joffm mentioned, or you create the tokens externally with your own script and pipe it into Limesurvey via API. Of course you could also hack Limesurvey, but this for me is the worst approach, as any update could break the custom functions and I know what that usually means: No more updates ever.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 months ago - 2 years 6 months ago #230585 by holch

However, a simple option to exclude certain characters for future tokens in the Limesurvey options would be more feasible

Of course, this is the ideal approach and it is already available, but not in LS3 and as LS3 won't receive any new features (only security updates and bug fixes for a certain time) this means upgrading to LS5.

I have read about the first development versions of LS6 already, so as soon as this is going forward LS3 probably becomes EOL anyway and probably won't even receive any secuirty updates and bug fixes anymore. So from what I see, in not such a distant future an Upgrade to LS5 is necessary anyway. So it is a good idea to have this in mind already and be prepared. I also wouldn't spend to much efforts in customizing LS3 now. Because again, this means that an upgrade to LS5 will take forever or will never happen and the installation will be without bug fixes and security updates for a long while. We see this all the time in universities.

So if you can hold off a little bit, you might install LS5 in parallel, test it, see if it meets your needs, see if you can connect your current script to generate the users, etc. and then move on to LS5 if everything is set up well. 

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
Last edit: 2 years 6 months ago by holch.

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose