Welcome, Guest
Username: Password: Remember me

TOPIC: Clear a previously answered question based on a user action

Clear a previously answered question based on a user action 2 years 10 months ago #70584

  • pjansell
  • pjansell's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Hello there,

I will try to explain this as clearly as possible, in the hope that somebody may be able to shed some light on a possible solution for us.

Here it goes - i have a straightforward 'Yes' or 'No' question which if the user clicks on 'No' another follow up question is presented (i.e made visible). If the users proceeds to fill in the comments for this follow up question, but then goes back and changes their initial answer in the first question to 'Yes' the follow up question disapppears as would be expected, but the value is still retained in the hidden comments field.

How do i clear the value from the follow up question, if the users opts to change their mind in the initial question? Does that make sense?
The administrator has disabled public write access.

Re: Clear a previously answered question based on a user action 2 years 10 months ago #70590

This is a well-known problem that almost any questionnaire system has. I think that it is possible to change/clear the hidden values using a simple javascript script, but I do not think this is desirable: if the yes/no value is changed again, it is pleasant if the values that has been entered before still exists.
In general you will use a spss or R script to analyse the results. The easiest way to tackle the program is in this script. (i.e. if the question "Do you smoke cigarettes" is answerd with "no", the number of cigarettes->0).
Greetz
Frans
The administrator has disabled public write access.

Re: Clear a previously answered question based on a user action 2 years 10 months ago #70593

  • Steve
  • Steve's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 494
  • Thank you received: 46
  • Karma: 17
Hello,

I agree with fransmarcelissen. If the participant changes his/her mind it is nice to have the previous answer in the text field.

I created a survey to test if the value of the text field will still be shown in the answers even if "No" is chosen. This doesn't seem to be the case, so I don't think there will be problems if the user fills out the question and then choses "No" in the previous question.
Mit freundlichen Grüßen/Best regards,

Stefan Gohlke
LimeSurvey Team
The administrator has disabled public write access.

Re: Clear a previously answered question based on a user action 2 years 10 months ago #70601

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
In config.php, you can set the value to be deleted when the question is hidden by conditions.

See $deletenonvalues - docs.limesurvey.org/Optional+settings&st...rvey#Survey_Behavior
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Clear a previously answered question based on a user action 2 years 10 months ago #70602

  • pjansell
  • pjansell's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Thanks guys, some excellent comments being put forward - i'd prefer to handle the issue at the application rather than the data level, but nonetheless very helpful all round - if that $deletenonvalues works out (thanks tpartner) that should do the trick.
Last Edit: 2 years 10 months ago by pjansell.
The administrator has disabled public write access.

Re: Clear a previously answered question based on a user action 2 years 10 months ago #70603

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4281
  • Thank you received: 807
  • Karma: 370
Tip: You can copy settings from config-defaults.php to config.php but never modify config-defaults.php.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Clear a previously answered question based on a user action 2 years 10 months ago #70789

  • pjansell
  • pjansell's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Tony, works like a charm - thanks!

Paul
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.151 seconds
Donation Image