From 333d3f4161d341cbc16128dc41e1278c82c4f761 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 15 Apr 2016 09:49:50 +0200 Subject: [PATCH] Show intro when retrying HFJ-1816 --- js/questionset.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index a137df5..cdfde73 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -327,8 +327,19 @@ H5P.QuestionSet = function (options, contentId) { }); hookUpButton('.qs-retrybutton', function () { resetTask(); - $myDom.children().hide().filter('.questionset').show(); - _showQuestion(params.initialQuestion); + $myDom.children().hide(); + + var $intro = $('.intro-page', $myDom); + if ($intro.length) { + // Show intro + $('.intro-page', $myDom).show(); + //$('.questionset', $myDom).show(); + } + else { + // Show first question + $('.questionset', $myDom).show(); + _showQuestion(params.initialQuestion); + } }); if (scoreBar === undefined) { @@ -488,8 +499,8 @@ H5P.QuestionSet = function (options, contentId) { $('.qs-startbutton', $myDom).click(function () { $(this).parents('.intro-page').hide(); - $('.questionset', $myDom).removeClass('hidden'); - _showQuestion(currentQuestion); + $('.questionset', $myDom).show(); + _showQuestion(params.initialQuestion); }); // Set event listeners.