Welcome to the LimeSurvey Community Forum

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

Question visiblity delay not working following V6 update

  • bunty.hardcastle
  • bunty.hardcastle's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 weeks 2 days ago #259105 by bunty.hardcastle
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.4.12 from 5.6.57
Own server or LimeSurvey hosting:  LS hosting
Survey theme/template: Bootswatch (extended)
==================
Hi
I'm just upgrading from v5 to v6 and this part of my question no longer works as expected.
The question asks about a piece of audio, so the audio needs to play for 3 seconds before the question appears, so that the participant has had time to hear some of the audio. 

So the survey waits for 3 seconds following the handleFirstPlay being delivered from the html audio player and then removes the 'hidden' class from the question.
The audio player is presented in the group and the js below is run in the first question of the group (survey presented group by group.)

In v5 this works perfectly, in v6, the question is presented before the audio even begins playing. 

The 'hidden' class is definitely added, and this class is working on other parts of the question, but it's no longer working here.

FYI: Filter HTML for XSS is switched off to allow js to run.

What has changed in the update that may cause this, and what's the solution?

Here's the code from the group source:
p><b>How do you feel about this genre of music?</b>(If the audio doesn't start automatically, press PLAY to start)</p>
<audio autoplay="" controls="" onplay="handleFirstPlay()" src="{AUDIOFILELOCN}SONGQ01.mp3"> </audio>

Here's the code from the question source:
<script type="text/javascript">
var hasitrun;
   // Function unhide the first Q three secs after the player is played
    function handleFirstPlay() {
      if (hasitrun != 1) {
        hasitrun = 1;
        if ($('#question{QID}.question-container:visible').length == 0) {
          $('#question{QID}').hide().delay(3000).removeClass('hidden').fadeIn(300);
        }
      }
    }
</script>

Group LS file attached.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 weeks 2 days ago #259110 by Joffm
Hi,
LimeSurvey <6.x. was based on bootstrap3
LimeSurvey 6.x. is based on bootstrap5

You can't use "hidden". Use "d-none" instead.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 weeks 2 days ago #259112 by holch
And send LSS files, not LSG or LSQ files. They are language sensitive and they are a lot more work for the helpers in the forum. But Joffm has already given you the solution, I guess.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose