H5P.ArithmeticQuiz.ResultPage = (function ($, UI) { /** * Creates a ResultPage instance * * @class * @namespace H5P.ArithmeticQuiz * @augments H5P.EventDispatcher * * @param {number} maxScore Max score * @param {Object} t Translation objects * @fires H5P.Event */ function ResultPage(maxScore, t){ H5P.EventDispatcher.call(this); var self = this; this.$resultPage = $('
', { 'class': 'h5p-baq-result-page' }); this.$feedbackContainer = $('
', { 'class': 'h5p-baq-result-page-feedback' }).appendTo(this.$resultPage); this.$scoreStatus = $('
', { 'class': 'h5p-baq-result-page-score-status', 'aria-live': 'assertive' }).appendTo(this.$feedbackContainer); this.$scoreStatus.append($('
', { 'class': 'h5p-baq-result-page-header', 'html': t.resultPageHeader })); this.maxScore = maxScore; this.scoreBar = UI.createScoreBar(maxScore); this.scoreBar.appendTo(this.$scoreStatus); this.$ariaScoreBar = $('
', { 'class': 'hidden-but-read', appendTo: this.$scoreStatus, }); this.$time = $('
', { 'class': 'h5p-baq-result-page-time', 'aria-hidden': true, }).appendTo(this.$scoreStatus); /** * Note: We need a separate assistive technology field for time because * some readers are not able to interpret the duration format of