Welcome to the LimeSurvey Community Forum

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

Message of missing answer which you can skip

  • steve_81
  • steve_81's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
8 years 7 months ago #123351 by steve_81
Hi guys,

is there any possibility, that a proband get a message/popup if he didn't answerd a question, but has the choice between like 'It was on purpose, I don't want to answer' and 'Oh, I forgot to answer' and led him to the next question block or leave him on the page to answer. It just should be a hint, it shouldn't be a mandatory question.
I hope you understand what I mean.

I wonderd if there is no onboard possibility, I saw it often in other questionnaires.
Is there already a solution, or any ideas of a workaround?

Thanks
Stefan
The topic has been locked.
More
8 years 7 months ago #123353 by jelo
This sounds like feature request for "Request Response" . It that really that common?

I know that Qualtrics offer mandatory and request response in combination with different validation rules.
That way you can define when to ask for response.

I don't see an easy workaround. You would need a Popup, which asks if the proband wants to answer the questions or just continue without answering the questions.

Sometime it would be nice to check, if a proband has answered a question at all. Think about a slider with a default value. How can we check if the default value is the answer? Or if the proband just overlooked the question?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago #123388 by tpartner
Replied by tpartner on topic Message of missing answer which you can skip
You can use the JavaScript Window confirm() Method .

Here's a quick example of checking a multiple-short-text question for answered items:
Code:
<script type="text/javascript" charset="utf-8">    
  $(document).ready(function() {
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Interrupt the Next/Submit click
    $('#movenextbtn, #movesubmitbtn').bind('click', function () {
      var unanswered = false;
 
      // Loop through all text inputs
      $('input.text', thisQuestion).each(function(i) {
        var thisValue = $(this).val();
        if(thisValue == '') {
          unanswered = true;
        }
      });
 
      // Pop up confirm if we found an unanswered item
      var cont = true;
      if(unanswered == true) {
        cont =  confirm('You have an unanswered item.\nDo you want to continue?');
      }
      return cont;
    });
  });
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • steve_81
  • steve_81's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
8 years 7 months ago #123391 by steve_81
Replied by steve_81 on topic Message of missing answer which you can skip
@jelo: Yes, one questionnaire was designed with Qualtrics, the other one I can't remember. Qualtrics has it onboard: www.qualtrics.com/university/researchsui...uestions/validation/

@tpartner: As always, perfect. Thanks for that code, it works perfect. Maybe I can transfer it to other types of questions, and share it here.

Thanks a lot.
Stefan
The topic has been locked.
More
8 years 7 months ago #123448 by jelo
Is that code able to check if two sliders on a Multiple numerical input question are untouched?
Is unanswered the case when there are default values defined? E.g. the two silders are on 100 and you want to ensure that probands answer is 100.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago #123458 by tpartner
Replied by tpartner on topic Message of missing answer which you can skip
No, that script won't work for sliders with default values set - the hidden text inputs will already have values on page load.

I think I remember a similar post but can't find it. Basically, you will need to put listeners on the sliders (with the slidechange event?) to set a variable when they are moved. I would also add a hidden question to record that, so you could prevent the check from happening if a respondent returns to the page.

Sadly, details of this workaround will have to wait - I don't have a computer with me this weekend and writing code on my phone is not one of my strengths :)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
8 years 7 months ago #123459 by jelo

tpartner wrote: I don't have a computer with me this weekend and writing code on my phone is not one of my strengths :)

Keep the phone in the pocket, too. Have a nice weekend.

You might talk about this thread:
www.limesurvey.org/en/forum/can-i-do-thi...s-and-hidden-handles

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago - 8 years 7 months ago #123521 by tpartner
Replied by tpartner on topic Message of missing answer which you can skip

Is that code able to check if two sliders on a Multiple numerical input question are untouched?


To achieve something like this for sliders with default values set, I would...

1) Add a multiple-short-text question in the same group, directly after the slider question. This question has the same sub-questions as the sliders (to record when a slider is manipulated) plus one extra sub-question (to record whether the page has been visited). We'll hide this question with JavaSccript.

2) Add the following script to the source of the slider question. If you want to apply this to several slider questions, you can move the handleSliders() function to template.js. I think the comments in the function adequately describe what's happening.
Code:
<script type="text/javascript" charset="utf-8">    
 
 
  $(document).ready(function() {
 
    // Apply the handleSliders() function to this question
    handleSliders($('#question{QID}'));
  });
 
  function handleSliders(thisQuestion) {
 
    // Identify and hide the hidden question
    var qHidden = $(thisQuestion).nextAll('.multiple-short-txt:eq(0)');
    $(qHidden).hide();
 
    // Initial classes on the slider sub-question items (rows)
    $('li.question-item', thisQuestion).addClass('slider-unmoved');
    $('input.text', qHidden).each(function(i) {
      if($(this).val() == 1) {
        $('li.question-item:eq('+i+')', thisQuestion).removeClass('slider-unmoved').addClass('slider-moved');
      }
    });
 
    // Listener on the sliders
    $('.ui-slider', thisQuestion).on('slidechange', function(event, ui) {
      var thisRow = $(this).closest('li.question-item');
      var thisRowIndex = $('li.question-item', $(this).closest('ul.questions-list')).index(thisRow);
      // Set the value in the hidden question
      if($('input.text', thisRow).val() != '') {
        thisRow.removeClass('slider-unmoved').addClass('slider-moved');
        $('input.text:eq('+thisRowIndex+')', qHidden).val(1);
      }
    });
 
    // Interrupt the Next/Submit click
    $('#movenextbtn, #movesubmitbtn').bind('click', function () {
 
      // Pop up confirm if we found an unmoved slider
      // Pop up only occurs once and only if the page has not been previously visited
      var cont = true;
      if($('.slider-unmoved', thisQuestion).length > 0 &amp;&amp; $('input.text:last', qHidden).val() != 1) {
        $('.slider-unmoved', thisQuestion).addClass('highlight');
        cont =  confirm('You have an unanswered item(s).\nDo you want to continue?');
      }
 
      $('input.text:last', qHidden).val(1);
      return cont;
    });
  }
</script>

3) Then you have 3 new classes on the slider question sub-question items (<li> elements):
- li.slider-unmoved
- li.slider-unmoved.highlight
- li.slider-moved
So, you could do something like this in template.css:
Code:
li.slider-unmoved.highlight .slider-label {
  background: pink;
}

Sample survey attached.

File Attachment:

File Name: limesurvey...5567.lss
File Size:21 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 7 months ago by tpartner.
The topic has been locked.
More
8 years 7 months ago #123584 by jelo
Thanks. This looks very sophisticated. But my JQuery book is still shrinkwraped. So just the statement of greenhorn.
Would you mind to tell me how much time do you invest for such a solution? This might be all lost when LS 3.0 is coming out. Not sure if a Plugin/API will allow to keep such workaround scripts more compatible.

One question: Which other surveytools do you use or have used in the past?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago - 8 years 7 months ago #123590 by tpartner
Replied by tpartner on topic Message of missing answer which you can skip

This looks very sophisticated....Would you mind to tell me how much time do you invest for such a solution?

This is actually not very complicated so only a few minutes - it takes almost as long to create the test survey as to write the script.


One question: Which other survey tools do you use or have used in the past?

Sorry, I don't feel this is the place to discuss my work experience. I, unlike some other people, am not here to sell my services or products.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 7 months ago by tpartner.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose