- Posts: 40
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Deleting response or resetting response for an existing token
- jsibley
- Topic Author
- Offline
- Senior Member
Less
More
7 years 2 months ago #147579
by jsibley
Deleting response or resetting response for an existing token was created by jsibley
Using remotecontrol 2, I'd like to be able to delete the response corresponding to a token or, if that is impossible, to reset all of the questions and subquestions for a response to "No answer".
The reason for this is that I want potential users of the survey to be able to try it out and the tokens contain a lot of fields used in the survey.
I will use Drupal to send the remotecontrol commands to Limesurvey and to manage the entire process.
So, would someone need to add a function to remotecontrol to delete a given response and/or a function to iterate through all questions and subquestions so that they can be reset or does anything along these lines (or another solution) exist?
Thanks for any help on this.
The reason for this is that I want potential users of the survey to be able to try it out and the tokens contain a lot of fields used in the survey.
I will use Drupal to send the remotecontrol commands to Limesurvey and to manage the entire process.
So, would someone need to add a function to remotecontrol to delete a given response and/or a function to iterate through all questions and subquestions so that they can be reset or does anything along these lines (or another solution) exist?
Thanks for any help on this.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
7 years 2 months ago #147601
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Deleting response or resetting response for an existing token
There does not seem to be a method to remove responses but there is one to update responses -
api.limesurvey.org/classes/remotecontrol...thod_update_response
.
But if the goal is to allow respondents to "test" the survey, why not give them access to the clearall button to remove the response or give the tokens multiple uses?
But if the goal is to allow respondents to "test" the survey, why not give them access to the clearall button to remove the response or give the tokens multiple uses?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: jsibley
The topic has been locked.
- jsibley
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 40
- Thank you received: 0
7 years 2 months ago #147642
by jsibley
Replied by jsibley on topic Deleting response or resetting response for an existing token
Thank you.
I think providing the clear all button could be a workable solution, although not ideal (the user would see a previous tester's results, clear them, and start over). If I do this, what might I have to do to make the "clear all" button appear?
Also, since the "clear all" button exists, does that mean that the function behind it could be added fairly easily to remotecontrol?
Thanks.
I think providing the clear all button could be a workable solution, although not ideal (the user would see a previous tester's results, clear them, and start over). If I do this, what might I have to do to make the "clear all" button appear?
Also, since the "clear all" button exists, does that mean that the function behind it could be added fairly easily to remotecontrol?
Thanks.
The topic has been locked.
- jsibley
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 40
- Thank you received: 0
7 years 2 months ago #147643
by jsibley
Replied by jsibley on topic Deleting response or resetting response for an existing token
I should probably clarify that each token has a number of attributes that have been set and that are important to how the survey is presented. This is why even a tester needs a token and why I want to reset the response or delete it, so that the user can create a new response.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
7 years 2 months ago #147651
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Deleting response or resetting response for an existing token
I don't get how a respondent would see a previous response unless they have the same token or are on the same machine.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jsibley
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 40
- Thank you received: 0
7 years 2 months ago #147653
by jsibley
Replied by jsibley on topic Deleting response or resetting response for an existing token
Maybe I'm going about this the wrong way, but I create tokens in Drupal as well as a number of attributes. They are then synchronized with Limesurvey.
I suppose I could basically clone these tokens for each tester, but I think it is easier to reuse them, along with their attributes. The tester sees a series of links (they are rating several other people), each of which corresponds to a token and is a link to Limesurvey with the appropriate link.
I hope that clarifies a bit.
I suppose I could basically clone these tokens for each tester, but I think it is easier to reuse them, along with their attributes. The tester sees a series of links (they are rating several other people), each of which corresponds to a token and is a link to Limesurvey with the appropriate link.
I hope that clarifies a bit.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
7 years 2 months ago #147654
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Deleting response or resetting response for an existing token
If you want to re-use tokens, give the tokens multiple uses and append ?newtest=Y to the survey URL. I think that should start a new response.
Make sure "Enable token-based response persistence" is set to NO - manual.limesurvey.org/Survey_settings#Tokens
Make sure "Enable token-based response persistence" is set to NO - manual.limesurvey.org/Survey_settings#Tokens
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jsibley
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 40
- Thank you received: 0
7 years 2 months ago #147664
by jsibley
Replied by jsibley on topic Deleting response or resetting response for an existing token
Thanks, again. ?newtest=Y could work, but I have an array that should be reset to "no answer" but, instead, gets reset to 1 (out of 5).
Is this a bug or is this by design?
Thanks.
Is this a bug or is this by design?
Thanks.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
7 years 2 months ago #147677
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Deleting response or resetting response for an existing token
No clue without more details about your LS version, questions settings, etc.
As far as I know, an array should not be "reset" to anything unless something else (like JavaScript) influences it.
As far as I know, an array should not be "reset" to anything unless something else (like JavaScript) influences it.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.