data cleaning of answers in not relevant questions

Plus d'informations
il y a 5 mois 3 semaines #179673 par KompetenzZ
Hi community,

is there an option (I guess with javascript) to remove the inputs (the answers given by respondents) from a multiple choice and multiple numerical input question when the question gets "hidden" because the question is currently not relevant (concerning relevance equation). So to say data cleaning.
In other words, when a question was answered, but then the relevance equation changes to wrong (not relevant), the question becomes hidden, and then the answer input of respondents in the question should be removed (cleaned).

LS Version 3.14

Cheers kompetenzz

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 5 mois 3 semaines #179686 par tpartner
There is no JavaScript method to detect when an element is hidden or to detect class changes so you would need to put listeners on the questions that are triggering the relevance change. These listeners (and the resulting callbacks) would vary depending on the question types and IDs.

Having said that, I don't see what the problem is. The answers in irrelevant questions only persist until the survey page (group) is submitted.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 mois 3 semaines - il y a 5 mois 3 semaines #179690 par DenisChenu

tpartner écrit: There is no JavaScript method to detect when an element is hidden or to detect class changes so you would need to put listeners on the questions that are triggering the relevance change.

Sorry Tony,

Currently :
Relevance updated (set to on/off) : github.com/LimeSurvey/LimeSurvey/blob/2f...survey/survey.js#L24
Class change due to error : github.com/LimeSurvey/LimeSurvey/blob/ma...urvey/survey.js#L342

Else :

In other words, when a question was answered, but then the relevance equation changes to wrong (not relevant), the question becomes hidden, and then the answer input of respondents in the question should be removed (cleaned).

It's the case (by default) when move next only, then if user check a input:checkbox by error , it don't loose previous answer.
Why do you want to clean previous value ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Dernière édition: il y a 5 mois 3 semaines par DenisChenu.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 mois 3 semaines #179692 par tpartner
@DenisChenu, no need to apologize. Do you have a solution?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 mois 3 semaines #179695 par KompetenzZ
Hi,

sorry, I didn't know that the previous values are cleaned anyway by clicking next. In that case everything is fine. I just thought that I need to remove the answers of hidden questions afterwards in the data analysis in spss. Thank you.

Cheers kompetenzz

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 mois 2 semaines #179722 par DenisChenu

tpartner écrit: @DenisChenu, no need to apologize. Do you have a solution?

I think we don't need solution, since LS behaviour cleanup value when move next.

But else : usage of on(!relevance:off' can do the trics

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 mois 2 semaines #179971 par KompetenzZ
Hi,

can you please tell me where to insert this '!relevance:off'. I would need the solution yet because I have this question multiple numeric question where the answer option 'thereof irrigated' is showed when 'cropland' is > 0. But when respondents type something in 'thereof irrigated' and then change back 'cropland' to 0 they cannot proceed further because 'thereof irrigated' cannot be greater than 'cropland' (I did it with max value of the <input type="number"> field). In that case the answer option 'thereof irrigated' is hidden (if it is shown, it would have a red background) and the respondent doesn't know why he cannot proceed.

'thereof irrigated' cannot be greater than 'cropland':


when 'cropland' is 0 and 'thereof irrigated' has a value inside, respondents cannot proceed:

Cheers kompetenzz
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 mois 1 semaine - il y a 5 mois 1 semaine #179973 par DenisChenu
Can you send a lss with just this question ?

I think it must work out of the box, but maybe validation of question must be fixed :).

Demo.sondages.me/582387

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Dernière édition: il y a 5 mois 1 semaine par DenisChenu.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 mois 1 semaine #179991 par DenisChenu
It's your script to fix :
var grass = $( '#question{QID} input.form-control.em_sq_validation:eq(2)').val();
if(grass > 0) {
    $( '#question{QID} input.form-control.em_sq_validation:eq(3)').attr({
       "max" : grass
    });
}else {
$( '#question{QID} input.form-control.em_sq_validation:eq(3)').removeAttr('max');
}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 mois 1 semaine #179992 par KompetenzZ
Sure, never thought about a simple else statement :)
I'm sorry that I did not have this idea before.

Cheers kompetenzz

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!