How to enable token persistance AND limit to only 1 response

More
3 weeks 5 hours ago #173431 by DeveloperChris
DeveloperChris created the topic: How to enable token persistance AND limit to only 1 response
Hi.

We want one response per token but with the ability for the user to return and edit that one response if requested to do so and ONLY if requested to do so.

The survey is set up to allow for not anonymous and token persistence. but we can't seem to restrict the number of responses to just one per token.

Either they can continuously edit the response even after submitted or they can create new responses. Neither of these are desirable.

I would expect that with token based persistence we could use the "uses left" field to control how many times they can edit their response.

In other words if it is set to 0 they can no longer edit their response NOR create new responses.

Is this possible?

Please Log in or Create an account to join the conversation.

More
3 weeks 3 hours ago #173444 by DenisChenu
DenisChenu replied the topic: How to enable token persistance AND limit to only 1 response
Not without some PHP dev currently.

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 or Create an account to join the conversation.

More
2 weeks 6 days ago #173469 by jelo
jelo replied the topic: How to enable token persistance AND limit to only 1 response

DeveloperChris wrote: I would expect that with token based persistence we could use the "uses left" field to control how many times they can edit their response.

This is an interesting point. What is a "use" when it comes to token?

There is room for a feature request. What about making a difference between counting "Entries" and "Submissions"? Modifies might be more difficult.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #173475 by DeveloperChris
DeveloperChris replied the topic: How to enable token persistance AND limit to only 1 response
The use counter decrements when a response is submitted. so thats a "use"

Allowing it to go below zero does not seem to make sense at all.

Whats the point of a "uses left" counter that is -22 ? the last 22 submissions should have been blocked.

To me that is the logical way it should work and the one I expected and unfortunately told my client. So when it came to launch people were able to return to edit an already submitted and reported on survey rendering the original invalid.

It was also the opposite to the business rules, so all in all embarrassing. I have implemented a javascript workaround (late last night) but have realised it may not work in all circumstances so this morning I have to rework it after testing.

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #173481 by DenisChenu
DenisChenu replied the topic: How to enable token persistance AND limit to only 1 response
Make a feature request, still a good idea.

Allow : token answer persistance +
New settings : use Use left for editing right or Survey counter rights.

Currently : If token answer persistance is set + allow edit reponse : Use left is not used.

You can
1. Make a feature request : www.limesurvey.org/community/feature-requests
2. Make a pull request : github.com/LimeSurvey/LimeSurvey/pulls
3.Create a plugin : (inspiration : gitlab.com/SondagesPro/coreAndTools/reloadAnyResponse )

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 .
The following user(s) said Thank You: DeveloperChris

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #173489 by jelo
jelo replied the topic: How to enable token persistance AND limit to only 1 response

DeveloperChris wrote: To me that is the logical way it should work and the one I expected and unfortunately told my client.

Using LimeSurvey for adhoc client work can be hard. Especially when the clients begin to compare LimeSurvey to other survey tools they know.

After being in similar situations, I have adapted to "Take nothing for granted. Test every relevant functionality after every update. Expect that is broken."

What version of LimeSurvey do you use?

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
2 weeks 5 days ago - 2 weeks 5 days ago #173545 by DeveloperChris
DeveloperChris replied the topic: How to enable token persistance AND limit to only 1 response
A little harsh?

For this particular task we are using 2.64.

For most of our other work we have migrated to 3.x.

We love using LS and have twisted it to our many needs. It's not as easy as some. But as we run literally hundreds of surveys and have very strict security requirements it is really our only choice.

Getting back to the issue as stated earlier, I have created a workaround which was quite simple in the end.

This works for the task we required it for.

/*
 * disable form if uses left is 0
 */
jQuery(document).ready(function ($) {
 
var uses = "{TOKEN:USESLEFT}";
 
if (uses<1) {
// hide all questions
$('[id^=question]').hide();
 
// disable next button
$('#movenextbtn, #movesubmitbtn').prop('disabled', 'true').addClass('ui-state-disabled');
 
// hide menu
$('#index-menu').hide();
 
// display alternate message text
$('.group-description').html('<p>message to advise users that they have no uses left</p>');
 
} 
});
Last Edit: 2 weeks 5 days ago by DeveloperChris.

Please Log in or Create an account to join the conversation.

More
2 weeks 5 days ago #173561 by jelo
jelo replied the topic: How to enable token persistance AND limit to only 1 response

DeveloperChris wrote: A little harsh?

I'm fine with that.

DeveloperChris wrote: We love using LS and have twisted it to our many needs. It's not as easy as some. But as we run literally hundreds of surveys and have very strict security requirements it is really our only choice.

LimeSurvey is leaning towards entry users (e.g. students). SaaS platform is getting more domiant. What would you use, if LimeSurvey wouldn't offer a on premise installation? The power user minority is not visble in the LimeSurvey audience ;-)

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey

Please Log in or Create an account to join the conversation.

More
2 weeks 5 days ago #173564 by DeveloperChris
DeveloperChris replied the topic: How to enable token persistance AND limit to only 1 response
If limesurvey wasnt an on premise offering, we would be building bespoke. When it comes to security saas is dead in my eyes.

With some of our clients it must be on prem and it must be secure.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!