Welcome to the LimeSurvey Community Forum

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

Irrelevant Group Not to Clear Data Possible?

  • sodiumchl
  • sodiumchl's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 10 months ago #216064 by sodiumchl
I'm running a closed survey with
  • Enable token-based response persistence: On
  • Allow multiple responses or update responses with one token:  On
  • Format: Group by group
  • Version 3.25.14+210218
Problem: Some of the groups relevance is dynamic via EM. Say, as example, the relevance of Group A depends on Question 1 in Group B. When the survey is updated, Group A may be rendered "irrelevant" temporarily by a mistake in the data entry of Question 1 in Group B. When this happens, all existing answers in Group A are erased! This is undesirable. 
Question: Is there any way to change the above behavior, i.e., not to clear its answers when a group is dynamically rendered irrelevant? If not via survey configuration, can someone please let me know which file/function in the source code that determines this behavior? Or is it possible to change this via a plugin?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #216111 by DenisChenu
Replied by DenisChenu on topic Irrelevant Group Not to Clear Data Possible?

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: holch, sodiumchl
The topic has been locked.
  • sodiumchl
  • sodiumchl's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 10 months ago #216136 by sodiumchl
Replied by sodiumchl on topic Irrelevant Group Not to Clear Data Possible?
That's it. Thank you so much!
The topic has been locked.
  • sodiumchl
  • sodiumchl's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 10 months ago - 2 years 10 months ago #216141 by sodiumchl
Replied by sodiumchl on topic Irrelevant Group Not to Clear Data Possible?
There is another issue, though. Say Group A has a question Q1, and Group C has a reference to it {Q1.NAOK}. When Group A is rendered "irrelevant" temporarily, {Q1.NAOK} is empty, so it is still effectively cleared in Group C, even with deletenonvalues=0. Is there any way to "fix" this? Thanks again.
Last edit: 2 years 10 months ago by sodiumchl.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #216155 by DenisChenu
Replied by DenisChenu on topic Irrelevant Group Not to Clear Data Possible?

There is another issue, though. Say Group A has a question Q1, and Group C has a reference to it {Q1.NAOK}. When Group A is rendered "irrelevant" temporarily, {Q1.NAOK} is empty, so it is still effectively cleared in Group C, even with deletenonvalues=0. Is there any way to "fix" this? Thanks again.
 
I don't think it muts happen.
If user already enter something in Group C : it must not be deleted.

If you can reproduce with a simple survey : best is to report the issue.

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: sodiumchl
The topic has been locked.
  • sodiumchl
  • sodiumchl's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 10 months ago - 2 years 10 months ago #216180 by sodiumchl
Replied by sodiumchl on topic Irrelevant Group Not to Clear Data Possible?
Attached is an example (with deletenonvalues=0 set in config.php).
Steps to reproduce the problem:
1. Goto https://{siteURL}/{sid}, select No for Question a in Group A, and some text for Question B in Group B. Next to Group C and submit.
2. Goto https://{siteURL}/{sid} again, select Yes for Question a in Group A. Group B is now hidden. Next to Group C and discover that {Qb.NAOK} is empty even though Qb retains its value in the database.
See also attached screenshots.
Last edit: 2 years 10 months ago by sodiumchl. Reason: typo
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #216181 by DenisChenu
Replied by DenisChenu on topic Irrelevant Group Not to Clear Data Possible?

Attached is an example (with deletenonvalues=0 set in config.php).
Steps to reproduce the problem:
1. Goto https://{siteURL}/{sid}, select No for Question a in Group A, and some text for Question B in Group B. Next to Group C and submit.
2. Goto https://{siteURL}/{sid} again, select Yes for Question a in Group A. Group B is now hidden. Next to Group C and discover that {Qb.NAOK} is empty even though Qb retains its value in the database.
See also attached screenshots.
 
OK : it's the desired behaviour.

deletenonvalues don't delete value in DB but : if a question is hidden by relevance : answer is empty in any condition for user.

You need another system, maybe with some :
- Hidden question at start (use for var)
- Equation in G2

Hidden question : showQb as short text
Equation in G2 : {showQb=Qb.NAOK} after Qb

The when you move out to G2 : showQb is set and don't disappear.

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.

Lime-years ahead

Online-surveys for every purse and purpose