Links for navigation + ARIA label

HFJ-1749
pull/4/head
Frode Petterson 2016-04-08 12:40:28 +02:00
parent 40fa6542e6
commit 2a26db16f6
2 changed files with 8 additions and 3 deletions

View File

@ -128,8 +128,7 @@
.h5p-question .h5p-question-prev, .h5p-question .h5p-question-prev,
.h5p-question .h5p-question-next { .h5p-question .h5p-question-next {
padding: 0; padding: 0.5em 0;
height: 2.1875em;
width: 2.1875em; width: 2.1875em;
} }

View File

@ -421,6 +421,9 @@ H5P.QuestionSet = function (options, contentId) {
question.addButton('next', '', function () { question.addButton('next', '', function () {
_stopQuestion(currentQuestion); _stopQuestion(currentQuestion);
_showQuestion(currentQuestion + 1); _showQuestion(currentQuestion + 1);
}, true, {
href: '#', // Use href since this is a navigation button
'aria-label': 'Next Question' // TODO: Translate
}); });
} }
@ -428,7 +431,10 @@ H5P.QuestionSet = function (options, contentId) {
if (questionInstances[0] !== question) { if (questionInstances[0] !== question) {
question.addButton('prev', '', function () { question.addButton('prev', '', function () {
_stopQuestion(currentQuestion); _stopQuestion(currentQuestion);
_showQuestion(currentQuestion - 1); _showQuestion(currentQuestion - 1);
}, true, {
href: '#', // Use href since this is a navigation button
'aria-label': 'Previous Question' // TODO: Translate
}); });
} }