Converted progress dots to links + ARIA label

HFJ-1750
pull/4/head
Frode Petterson 2016-04-08 14:42:49 +02:00
parent 02cd4e1b7e
commit ab76075acc
8 changed files with 35 additions and 2 deletions

View File

@ -40,7 +40,7 @@ H5P.QuestionSet = function (options, contentId) {
' <% if (progressType == "dots") { %>' +
' <div class="dots-container">' +
' <% for (var i=0; i<questions.length; i++) { %>' +
' <span class="progress-dot unanswered"></span>' +
' <a href="#" class="progress-dot unanswered" aria-label="<%= questions[i].jumpAriaLabel %>"></a>' +
' <%} %>' +
' </div>' +
' <% } else if (progressType == "textual") { %>' +
@ -79,7 +79,8 @@ H5P.QuestionSet = function (options, contentId) {
prevButton: 'Previous',
nextButton: 'Next',
finishButton: 'Finish',
textualProgress: 'Question: @current of @total questions'
textualProgress: 'Question: @current of @total questions',
jumpToQuestion: 'Jump to question %d'
},
endGame: {
showResultPage: true,
@ -129,6 +130,7 @@ H5P.QuestionSet = function (options, contentId) {
for (var i = 0; i < params.questions.length; i++) {
var question = params.questions[i];
question.jumpAriaLabel = params.text.jumpToQuestion.replace(':num', i + 1);
if (override) {
// Extend subcontent with the overrided settings.
$.extend(question.params.behaviour, override);
@ -473,6 +475,7 @@ H5P.QuestionSet = function (options, contentId) {
$('.progress-dot', $myDom).click(function () {
_stopQuestion(currentQuestion);
_showQuestion($(this).index());
return false;
});
// Hide all but initial Question.

View File

@ -74,6 +74,10 @@
{
"label": "نص التقدم",
"description": "النص المستخدم إذا تم تحديد التقدم نصيا"
},
{
"label": "Label for jumping to a certain question",
"default": "Jump to question %d"
}
]
},

View File

@ -79,6 +79,10 @@
"label": "Fortschrittstext",
"description": "Verwendeter Text wenn Text Fortschrittsanzeige gewählt wurde.",
"default": "Aktuelle Frage: @current von @total Fragen"
},
{
"label": "Label for jumping to a certain question",
"default": "Jump to question %d"
}
]
},

View File

@ -74,6 +74,10 @@
{
"label": "Texte de progression",
"description": "Texte utilisé si la progression textuelle est utilisée."
},
{
"label": "Label for jumping to a certain question",
"default": "Jump to question %d"
}
]
},

View File

@ -74,6 +74,10 @@
{
"label": "Testo Avanzamento",
"description": "esto utilizzato se il testo Avanzamento è selezionato."
},
{
"label": "Label for jumping to a certain question",
"default": "Jump to question %d"
}
]
},

View File

@ -76,6 +76,10 @@
"label": "Fremdriftstekst",
"description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total",
"default": "Deloppgave @current av @total"
},
{
"label": "Merkelapp ved hopping til spørsmål",
"default": "Hopp til spørsmål %d"
}
]
},

View File

@ -76,6 +76,10 @@
"label": "Fremdriftstekst",
"description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total",
"default": "Deloppgave @current av @total"
},
{
"label": "Merkelapp ved hopping til spørsmål",
"default": "Hopp til spørsmål %d"
}
]
},

View File

@ -152,6 +152,12 @@
"strong",
"em"
]
},
{
"name": "jumpToQuestion",
"type": "text",
"label": "Label for jumping to a certain question",
"default": "Jump to question %d"
}
]
},