Fix bug where Question Set children without media fails. HFP-1181
parent
b3887c0f56
commit
976e9567c6
|
@ -411,16 +411,22 @@ H5P.QuestionSet = function (options, contentId, contentData) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle autoplays, limit to one at a time
|
* Handle autoplays, limit to one at a time
|
||||||
|
*
|
||||||
|
* @param {number} currentQuestionIndex
|
||||||
*/
|
*/
|
||||||
var handleAutoPlay = function (currentQuestion) {
|
var handleAutoPlay = function (currentQuestionIndex) {
|
||||||
for (var i = 0; i < questionInstances.length; i++) {
|
for (var i = 0; i < questionInstances.length; i++) {
|
||||||
questionInstances[i].pause();
|
questionInstances[i].pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
var hasAutoPlay = params.questions[currentQuestion].params.media.params.playback.autoplay;
|
var currentQuestion = params.questions[currentQuestionIndex];
|
||||||
|
|
||||||
|
var hasAutoPlay = currentQuestion
|
||||||
|
&& currentQuestion.params.media
|
||||||
|
&& currentQuestion.params.media.params.playback.autoplay;
|
||||||
|
|
||||||
if (hasAutoPlay) {
|
if (hasAutoPlay) {
|
||||||
questionInstances[currentQuestion].play();
|
questionInstances[currentQuestionIndex].play();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue