From da540afb82604a8a42e79c4ec2e2821e052683f4 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Tue, 5 Jul 2016 09:50:41 +0200 Subject: [PATCH] Announce results when finsihed HFJ-2042 --- js/questionset.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index f47d002..fac4bf5 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -250,9 +250,8 @@ H5P.QuestionSet = function (options, contentId) { .replace('@total', questionInstances.length.toString()); $('.qs-progress-announcer', $myDom) - .show() .html(humanizedProgress) - .focus(); + .show().focus(); if (instance && instance.readFeedback) { instance.readFeedback(); @@ -467,6 +466,16 @@ H5P.QuestionSet = function (options, contentId) { scoreBar.appendTo($('.feedback-scorebar', $myDom)); scoreBar.setScore(finals); $('.feedback-text', $myDom).html(scoreString); + + // Announce that the question set is complete + setTimeout(function () { + $('.qs-progress-announcer', $myDom) + .html(eparams.message + '.' + + scoreString + '.' + + eparams.comment + '.' + + eparams.resulttext) + .show().focus(); + }, 0); } else { // Remove buttons and feedback section