Fix unused semantics.

HFJ-1710
pull/4/head
Thomas Marstrander 2016-03-17 14:09:13 +01:00
parent 1be48174bb
commit 3036f888af
10 changed files with 66 additions and 44 deletions

View File

@ -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',
questionLabel: 'Question'
},
endGame: {
showResultPage: true,
@ -92,14 +93,14 @@ H5P.QuestionSet = function (options, contentId) {
finishButtonText: 'Finish',
solutionButtonText: 'Show solution',
retryButtonText: 'Retry',
showAnimations: false
showAnimations: false,
skipButtonText: 'Skip video'
},
override: {
overrideButtons: false,
overrideShowSolutionButton: false,
overrideRetry: false
},
questionLabel: 'Question'
}
};
var template = new EJS({text: texttemplate});
@ -252,6 +253,17 @@ H5P.QuestionSet = function (options, contentId) {
rendered = false;
};
var moveQuestion = function (direction) {
_stopQuestion(currentQuestion);
if (currentQuestion + direction >= questionInstances.length) {
_displayEndGame();
}
else {
_showQuestion(currentQuestion + direction);
}
};
var _displayEndGame = function () {
if (rendered) {
$myDom.children().hide().filter('.questionset-results').show();
@ -406,26 +418,22 @@ H5P.QuestionSet = function (options, contentId) {
if (questionInstances[questionInstances.length -1] === question) {
// Add finish question set button
question.addButton('finish', params.texts.finishButton, function () {
_stopQuestion(currentQuestion);
_displayEndGame();
}, false);
question.addButton('finish', params.texts.finishButton,
moveQuestion.bind(this, 1), false);
} else {
// Add next question button
question.addButton('next', '', function () {
_stopQuestion(currentQuestion);
_showQuestion(currentQuestion + 1);
});
question.addButton('next', '', moveQuestion.bind(this, 1), true,
{title: params.texts.nextButton});
}
// Add previous question button
if (questionInstances[0] !== question) {
question.addButton('prev', '', function () {
_stopQuestion(currentQuestion);
_showQuestion(currentQuestion - 1);
});
question.addButton('prev', '', moveQuestion.bind(this, -1), true,
{title: params.texts.prevButton}
);
}
question.on('xAPI', function (event) {
@ -529,7 +537,7 @@ H5P.QuestionSet = function (options, contentId) {
}
// Determine label
var label = (params.questionLabel + ' ' + (i + 1));
var label = (params.texts.questionLabel + ' ' + (i + 1));
if (qParams.contentName !== undefined) {
label += ': ' + qParams.contentName;
}

View File

@ -74,6 +74,10 @@
{
"label": "نص التقدم",
"description": "النص المستخدم إذا تم تحديد التقدم نصيا"
},
{
"label": "Question label text",
"default": "Question"
}
]
},
@ -154,10 +158,6 @@
"description": "تفعيل هذا الخيار يجعل المستخدم قادرا على \"إعادة المحاولة\""
}
]
},
{
"label": "Question label text",
"default": "Question"
}
]
}

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": "Question label text",
"default": "Question"
}
]
},

View File

@ -74,6 +74,10 @@
{
"label": "Texte de progression",
"description": "Texte utilisé si la progression textuelle est utilisée."
},
{
"label": "Question label text",
"default": "Question"
}
]
},
@ -154,10 +158,6 @@
"description": "Affiche le bouton \"Réessayer\"."
}
]
},
{
"label": "Texte de la question",
"default": "Question"
}
]
}

View File

@ -74,6 +74,10 @@
{
"label": "Testo Avanzamento",
"description": "esto utilizzato se il testo Avanzamento è selezionato."
},
{
"label": "Question label text",
"default": "Question"
}
]
},
@ -154,10 +158,6 @@
"description": "L'attivazione di questa opzione farà in modo che per l'utente sia abilitata l'opzione \"Riprova\"."
}
]
},
{
"label": "Question label text",
"default": "Question"
}
]
}

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": "Spørsmåls-etikett",
"default": "Spørsmål"
}
]
},
@ -166,10 +170,6 @@
"description": "Aktivering vil slå på \"Prøv igjen\" ."
}
]
},
{
"label": "Spørsmål-etikett",
"default": "Spørsmål"
}
]
}

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": "Spørsmål-etikett",
"default": "Spørsmål"
}
]
},
@ -166,10 +170,6 @@
"description": "Aktivering vil slå på \"Prøv igjen\" ."
}
]
},
{
"label": "Spørsmål-etikett",
"default": "Spørsmål"
}
]
}

View File

@ -3,7 +3,7 @@
"description": "Put together a set of different questions that has to be solved. (Quiz)",
"contentType": "question",
"majorVersion": 1,
"minorVersion": 7,
"minorVersion": 8,
"patchVersion": 0,
"embedTypes": [
"iframe"

View File

@ -152,6 +152,12 @@
"strong",
"em"
]
},
{
"name": "questionLabel",
"type": "text",
"label": "Copyright dialog question label",
"default": "Question"
}
]
},
@ -326,11 +332,5 @@
"default": false
}
]
},
{
"name": "questionLabel",
"type": "text",
"label": "Question label text",
"default": "Question"
}
]

View File

@ -14,6 +14,16 @@ H5PUpgrades['H5P.QuestionSet'] = (function ($) {
});
}
}
finished(null, parameters);
},
8: function (parameters, finished) {
parameters.texts = parameters.texts || {};
if (parameters.questionLabel) {
parameters.texts.questionLabel = parameters.questionLabel;
delete parameters.questionLabel;
}
finished(null, parameters);
}
}