Welcome to the LimeSurvey Community Forum

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

How to enable token persistance AND limit to only 1 response

  • DeveloperChris
  • DeveloperChris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #173431 by DeveloperChris
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?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #173444 by DenisChenu
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 , plugin development .
I don't answer to private message.
The topic has been locked.
More
5 years 6 months ago #173469 by jelo

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.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • DeveloperChris
  • DeveloperChris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #173475 by DeveloperChris
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.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #173481 by DenisChenu
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 , plugin development .
I don't answer to private message.
The following user(s) said Thank You: DeveloperChris
The topic has been locked.
More
5 years 6 months ago #173489 by jelo

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?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DeveloperChris
  • DeveloperChris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago - 5 years 6 months ago #173545 by DeveloperChris
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.

Code:
/*
 * 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: 5 years 6 months ago by DeveloperChris.
The topic has been locked.
More
5 years 6 months ago #173561 by jelo

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 ;-)

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • DeveloperChris
  • DeveloperChris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #173564 by DeveloperChris
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.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose