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>
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.