Welcome to the LimeSurvey Community Forum

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

Hiding conditioned questions with timestamps

  • Jean_luetz
  • Jean_luetz's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 4 months ago #114008 by Jean_luetz
Dear all,

thanks to you guys I was able to write epoch time stamps in hidden short text variables ( see thread ).

I use this code to fill the text question and to hide it:
Code:
<script type="text/javascript" charset="utf-8">  
  $(document).ready(function(){
    if($('#question{QID} input.text').val() == '') {
      $('#question{QID} input.text').val(new Date().getTime());
    }
  });
</script>
<script type='text/javascript'> document.getElementById('questionQ').style.display='none'; </script>
 
 

That was all working out fine. Until I needed to impose conditions on these variables.

I have two randomly assigned (rand(1,2) experimental groups in the survey and each group is only shown half the questions with their corresponding time marker-questions.

So I assigned conditions to the markers and now they are visible all the time. Seems like the conditioning overwrites the code to hide them. If I hide them through the menu (hide all the time) they no longer record the time stamp.

The problem is that I need to put the conditions on the time markers, too. If I don´t, they work like they used to but then every participant is shown every question group (with every marker), regardless of his or her condition.

So if anyone has an idea how I can keep my conditions and still have hidden variables that record time I would appreciate it very much!

Thanks and cheers,
J
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 4 months ago #114027 by tpartner
Replied by tpartner on topic Hiding conditioned questions with timestamps
Try using this script in the source a a question to hide it. This uses positioning rather than display (which may be overridden by conditions) to hide the question.

Code:
<script type="text/javascript" charset="utf-8">  
  $(document).ready(function(){
    $('#question{QID}').css({
      'position': 'absolute',
      'left': '-9999em'
    });
  });
</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.
  • Jean_luetz
  • Jean_luetz's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 4 months ago #114039 by Jean_luetz
Replied by Jean_luetz on topic Hiding conditioned questions with timestamps
It works.
Thank you so much, again!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose