Reputation: 199
I'm new with Qualtrics, and I'm wondering if there is a way of creating a rule with javascript for the next button to appear only if a video is played or when fully watched?
I have this code but only with a timer
Qualtrics.SurveyEngine.addOnReady(
function() {
var delayTime = 7000 //This is the time of delay
var that = this;
$('NextButton').hide();
$('PreviousButton').hide();
setTimeout(function(){
$('NextButton').show();
$('PreviousButton').show();
},
delayTime
);
});
Thanks in advance
Upvotes: 0
Views: 239
Reputation: 5004
Are you using an html5 video tag? If so, you can use an 'ended' handler:
jQuery("#"+this.questionId+" video").on("ended", function() {
$('NextButton').show();
$('PreviousButton').show();
});
Upvotes: 1