Make readspeakers announce current question of total when changing question.
HFJ-2041pull/5/head
parent
c9fed3ddf1
commit
653d12a85e
|
@ -125,6 +125,13 @@
|
|||
transition: none;
|
||||
}
|
||||
|
||||
.qs-progress-announcer {
|
||||
height: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.h5p-question .h5p-question-prev,
|
||||
.h5p-question .h5p-question-finish,
|
||||
.h5p-question .h5p-question-next {
|
||||
|
|
|
@ -31,6 +31,7 @@ H5P.QuestionSet = function (options, contentId) {
|
|||
' <div class="buttons"><a class="qs-startbutton h5p-joubelui-button h5p-button"><%= introPage.startButtonText %></a></div>' +
|
||||
'</div>' +
|
||||
'<% } %>' +
|
||||
'<div tabindex="-1" class="qs-progress-announcer"></div>' +
|
||||
'<div class="questionset<% if (introPage.showIntroPage) { %> hidden<% } %>">' +
|
||||
' <% for (var i=0; i<questions.length; i++) { %>' +
|
||||
' <div class="question-container"></div>' +
|
||||
|
@ -88,7 +89,8 @@ H5P.QuestionSet = function (options, contentId) {
|
|||
finishButton: 'Finish',
|
||||
textualProgress: 'Question: @current of @total questions',
|
||||
jumpToQuestion: 'Jump to question %d',
|
||||
questionLabel: 'Question'
|
||||
questionLabel: 'Question',
|
||||
readSpeakerProgress: 'Question @current of @total'
|
||||
},
|
||||
endGame: {
|
||||
showResultPage: true,
|
||||
|
@ -224,6 +226,17 @@ H5P.QuestionSet = function (options, contentId) {
|
|||
$('.progress-dot:eq(' + questionNumber +')', $myDom).addClass('current');
|
||||
}
|
||||
|
||||
// Announce question number of total, must use timeout because of buttons logic
|
||||
setTimeout(function () {
|
||||
var humanizedProgress = params.texts.readSpeakerProgress
|
||||
.replace('@current', (currentQuestion + 1).toString())
|
||||
.replace('@total', questionInstances.length.toString());
|
||||
|
||||
$('.qs-progress-announcer', $myDom)
|
||||
.html(humanizedProgress)
|
||||
.focus();
|
||||
}, 0);
|
||||
|
||||
// Remember where we are
|
||||
_updateButtons();
|
||||
self.trigger('resize');
|
||||
|
|
|
@ -83,6 +83,11 @@
|
|||
{
|
||||
"label": "Copyright dialog question label",
|
||||
"default": "Question"
|
||||
},
|
||||
{
|
||||
"label": "Readspeaker progress",
|
||||
"description": "May use @current and @total question variables",
|
||||
"default": "Question @current of @total"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -88,6 +88,11 @@
|
|||
{
|
||||
"label": "Copyright dialog question label",
|
||||
"default": "Question"
|
||||
},
|
||||
{
|
||||
"label": "Readspeaker progress",
|
||||
"description": "May use @current and @total question variables",
|
||||
"default": "Question @current of @total"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -83,6 +83,11 @@
|
|||
{
|
||||
"label": "Copyright dialog question label",
|
||||
"default": "Question"
|
||||
},
|
||||
{
|
||||
"label": "Readspeaker progress",
|
||||
"description": "May use @current and @total question variables",
|
||||
"default": "Question @current of @total"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -83,6 +83,11 @@
|
|||
{
|
||||
"label": "Copyright dialog question label",
|
||||
"default": "Question"
|
||||
},
|
||||
{
|
||||
"label": "Readspeaker progress",
|
||||
"description": "May use @current and @total question variables",
|
||||
"default": "Question @current of @total"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -85,6 +85,11 @@
|
|||
{
|
||||
"label": "Opphavsrett spørsmål-etikett",
|
||||
"default": "Spørsmål"
|
||||
},
|
||||
{
|
||||
"label": "Fremdriftstekst for hjelpemiddelteknologi",
|
||||
"description": "Kan bruke @current og @total variabler",
|
||||
"default": "Deloppgave @current av @total"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -85,6 +85,11 @@
|
|||
{
|
||||
"label": "Opphavsrett spørsmål-etikett",
|
||||
"default": "Spørsmål"
|
||||
},
|
||||
{
|
||||
"label": "Fremdriftstekst for hjelpemiddelteknologi",
|
||||
"description": "Kan bruke @current og @total variabler",
|
||||
"default": "Deloppgave @current av @total"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -165,6 +165,13 @@
|
|||
"type": "text",
|
||||
"label": "Copyright dialog question label",
|
||||
"default": "Question"
|
||||
},
|
||||
{
|
||||
"name": "readSpeakerProgress",
|
||||
"type": "text",
|
||||
"label": "Readspeaker progress",
|
||||
"description": "May use @current and @total question variables",
|
||||
"default": "Question @current of @total"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue