Welcome to the LimeSurvey Community Forum

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

Disabeling the possibility to change anwser of a question once first answered

  • etgagTEST2
  • etgagTEST2's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 6 months ago #221662 by etgagTEST2
Hi everyone,

I was wondering if it's possible to disable the possibility to change answer of a list (Radio) type question once it is first answered. I was thinking of something in the same fashion as with a question with a limit of time to answer, but in my case option to answer would disappear (or be disabled) as soon as the participant click on his answer.

Please let me know if you need more details or if my question seems odd.

Thanks a lot
Étienne
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 6 months ago #221664 by Joffm
I think the best is to trigger the "next"-button if an answer option was selected.
And of course you do not allow to "go back".
As I answer on my smartphone I can't show more, at the moment.

Probably  later

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: etgagTEST2
The topic has been locked.
  • etgagTEST2
  • etgagTEST2's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 6 months ago #221666 by etgagTEST2
Hi Joffm,

Thanks for that quick answer !

I should have written it earlier, my bad. Unfortunately, in my case it is not possible. Simply put, the question is paired with another one that measure the confidence level of the answer given to the first question, so it will make the experiment kind of odd if they are not clearly paired. Plus, the first question is part of a random group of the same kind of question, if I let the participant click next, I will have a hard time tracking wich confidence level goes with which answer (and it would make a bad user experience for the participant).

Thanks a lot !
Étienne
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 6 months ago #221669 by tpartner
I think disabling the radios is high-risk. People make mistakes and should be allowed to correct them.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
3 years 6 months ago #221670 by tammo
Maybe disable after answering "Are you sure" and then disable the answering possibilities and only then show the following question?

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The following user(s) said Thank You: etgagTEST2
The topic has been locked.
  • etgagTEST2
  • etgagTEST2's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 6 months ago #221672 by etgagTEST2
Hi Mr. Partner,

I totally agree in most situations.

In that specific context, allowing participant to change their answers, it brings some methodological limits. My goal is to assess confidence on an answer, but the very aspect of asking about confidence level might trigger the behavior of changing the answer. If that happen, I will have no way to know if the confidence level is about the first answer or the second one (or any other that could follow). Disabling the possibility to second guess was a way to limit this particular risk. Note that I am fully transparent with participants; I explicitly state that their answers are definitive at the moment that they click their answers.

Thanks for the warning though,
Étienne
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 6 months ago #221696 by DenisChenu
With gitlab.com/SondagesPro/QuestionSettingsType/answersAsReadonly

put !is_empty(self.NAOK)

Work when you come back to the page (but not just afetr click).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: etgagTEST2
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 6 months ago #221703 by tpartner

In that specific context, allowing participant to change their answers, it brings some methodological limits. My goal is to assess confidence on an answer, but the very aspect of asking about confidence level might trigger the behavior of changing the answer. If that happen, I will have no way to know if the confidence level is about the first answer or the second one (or any other that could follow). Disabling the possibility to second guess was a way to limit this particular risk. Note that I am fully transparent with participants; I explicitly state that their answers are definitive at the moment that they click their answers.

In that case, you can disable the radio inputs with JavaScript.

Place this script in the source of the question:

Code:
<script type="text/javascript" data-author="Tony Partner">  
  $(document).on('ready pjax:scriptcomplete',function(){
 
    var thisQuestion = $('#question{QID}');
 
    // Listener on radios
    $(':radio', thisQuestion).on('click', function(e){   
      $(':radio:not(:checked)', thisQuestion).prop('disabled', true);
    });
 
    // Returning to page
    if($(':radio:checked', thisQuestion).length > 0) {
      $(':radio:not(:checked)', thisQuestion).prop('disabled', true);
    }
    });
</script>

Sample survey attached: 

File Attachment:

File Name: limesurvey...1446.lss
File Size:34 KB

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: DenisChenu, etgagTEST2
The topic has been locked.
  • etgagTEST2
  • etgagTEST2's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 6 months ago #221762 by etgagTEST2
A huge thanks to you M. Partner, this piece of code was very usefull to me !
It helped me solve my problem and also enlightened me a bit more on how core code works. Might motivates me to dive deeper in JavaScript.

Best regards,
Étienne
The topic has been locked.
  • etgagTEST2
  • etgagTEST2's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 6 months ago #221763 by etgagTEST2
Thanks a lot to everyone that participated in this subject, the LimeSurvey community is awesome !

Which you all the best,
Étienne
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose