Welcome to the LimeSurvey Community Forum

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

Help needed: How to prevent duplicate survey entries with 'newtest=Y' in the URL

More
3 days 20 hours ago - 3 days 15 hours ago #272638 by mateomaranon
Your LimeSurvey version: Versión 6.6.7+241028
Own server or LimeSurvey hosting:  Own Sever
Survey theme/template: BoostWatch
==================
Hello,I'm seeking advice for a problem I'm facing with a research project that integrates an external experiment with LimeSurvey.My workflow is as follows:
  1. Participants complete a web-based experiment on an external platform.
  2. Upon completion, they are redirected to a LimeSurvey link.
  3. The experiment's data is passed through the URL, which includes the
    Code:
    newtest=Y
    parameter. This is necessary to create a new survey response and pre-populate the fields with the data.
The issue is that if a participant refreshes the first page of the LimeSurvey or re-accesses the URL from their browser history, a new, duplicate survey entry is created. The
Code:
newtest=Y
parameter forces a new entry every time the page loads.I'm looking for a way to prevent this duplication. I can execute JavaScript in the LimeSurvey survey.Any guidance, code examples, or suggestions would be greatly appreciated.

My Survey: 
 

Attachment not found



Mateo 
Facultad de Psicología - Universidad Nacional de Córdoba
 
 
Last edit: 3 days 15 hours ago by DenisChenu. Reason: remove duplicates

Please Log in to join the conversation.

More
3 days 15 hours ago #272644 by DenisChenu
I really don't have any idea about an integrated solution.

Maybe : can you check if you allow user to print answers ? If yes : try to deactivate this option and use the link without the newtest=Y
In previous version, if user are not allowed to print answers : session are reset.
 
Else
I think I use 2 plugins here :  gitlab.com/SondagesPro/SurveyAccess/surveyChaining with  gitlab.com/SondagesPro/coreAndTools/reloadAnyResponse
OR : create a simple PHP script file to reset session and redirect to the link without newtest

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

More
3 days 9 hours ago #272652 by holch
I don't think that the "newtest" is necessary, or are they on the same computer / browser?

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.

More
3 days 4 hours ago - 3 days 4 hours ago #272661 by mateomaranon
I'm using the newtest parameter because, according to the documentation, it is required for the URL-based field pre-filling to work.
Documentation:  www.limesurvey.org/manual/URL_fields
This is an example of the link they are redirected to. The data stored is as follows: 
encuestas3.unc.edu.ar/index.php?r=survey/index&sid=892672& newtest=Y&lang=es&
timestamp=2025-09-19T12%3A43%3A07.551Z&consentimiento_aceptado=si&promedio_aj
ustado=1.1
&promedio_no_ajustado=1.1&total_globos_explotados=0&max_infladas=2&total
_puntos=55
The issue is that if a participant refreshes the survey page on their device using this link, a new entry is created, leading to a duplicate record with the same URL data (It is an open survey).


 
Last edit: 3 days 4 hours ago by mateomaranon. Reason: Miss Information

Please Log in to join the conversation.

More
3 days 3 hours ago #272666 by Joffm
In an open survey there is no "token-based persistence". (no tokens)
Therefore there is the links "Resume later" resp. "Load unfinished survey" to be able to stop the survey and continue later on the page where you left.
The parameter "newtest=Y" is usually used while testing.
If you test and stop in the middle you probably want to change something and start a new test instead of continue where you stopped.
It is also usefull if you e.g. have some computers in a shopping mall where people fill a short survey.
Now if one person stops in the middle the next should start at the beginning of a new survey.

But usually you do not use "newtest=Y" in a normal open survey.

Joffm
   
 

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

Please Log in to join the conversation.

More
2 days 17 hours ago #272667 by DenisChenu

Maybe : can you check if you allow user to print answers ? If yes : try to deactivate this option and use the link without the newtest=Y
In previous version, if user are not allowed to print answers : session are reset. 
 
Please, read … 
Manual tell to ask newtest when testing or to be easy (working in 90% of situation)

You ask on forum, a core dev and an excellent helper tell you to test without.

Just test, please !

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: mateomaranon

Please Log in to join the conversation.

More
2 days 5 hours ago #272672 by mateomaranon
Thank you very much, I had tested it before and it didn't work, but now I managed to get it working. I didn't write on the forum because I was busy, I'm only able to do it now.Thanks again for the help.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose