Merge branch 'release' into stable

pull/5/head
Frode Petterson 2016-06-21 16:28:43 +02:00
commit b982a09835
11 changed files with 503 additions and 211 deletions

View File

@ -55,6 +55,11 @@
.progress-dot.current { .progress-dot.current {
background: #285585; background: #285585;
} }
.progress-dot:focus {
outline-color: rgb(40, 130, 211);
outline-width: thin;
outline-style: solid;
}
.intro-page .title { .intro-page .title {
font-size: 2em; font-size: 2em;
@ -104,7 +109,7 @@
float: none; float: none;
} }
.questionset-results a.h5p-button.qs-retrybutton:before { .questionset-results button.h5p-button.qs-retrybutton:before {
font-family: 'H5PFontAwesome4'; font-family: 'H5PFontAwesome4';
padding-right: 0.5em; padding-right: 0.5em;
content: "\f01e"; content: "\f01e";
@ -128,8 +133,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;
} }
@ -164,7 +168,7 @@
content: "\f00c"; content: "\f00c";
} }
.questionset-results a.h5p-button.qs-solutionbutton:before { .questionset-results button.h5p-button.qs-solutionbutton:before {
font-family: 'H5PFontAwesome4'; font-family: 'H5PFontAwesome4';
content: "\f06e "; /* TODO: Use margin not whitespace, spacing is not content! */ content: "\f06e "; /* TODO: Use margin not whitespace, spacing is not content! */
} }
@ -174,6 +178,7 @@
} }
.video-container > video { .video-container > video {
background-color: #000; background-color: #000;
width: 100%;
} }
.video-container > .h5p-button { .video-container > .h5p-button {
position: absolute; position: absolute;
@ -190,22 +195,44 @@
text-align: center; text-align: center;
background: rgba(255, 255, 255, 0.9); background: rgba(255, 255, 255, 0.9);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#E6FFFFFF,endColorstr=#E6FFFFFF); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#E6FFFFFF,endColorstr=#E6FFFFFF);
padding: 0.625em;
} }
.questionset-results .feedback-section { .questionset-results .feedback-section {
margin: 1em; margin: 0.75em;
}
.questionset-results .greeting {
margin-top: 1em;
color: #777;
font-size: 1.25em;
} }
.questionset-results .feedback-section .feedback-text { .questionset-results .feedback-section .feedback-text {
font-weight: bold; font-weight: normal;
color: #1a73d9; color: #777;
} }
.questionset-results .buttons { .questionset-results .buttons {
margin-bottom: 1.5em; margin-bottom: 1.5em;
} }
.questionset-results .result-header,
.questionset-results .result-text {
color: #1a73d9;
font-weight: bold;
}
.questionset-results .result-header {
font-size: 2em;
margin-top: 1em;
}
.questionset-results .result-text {
font-size: 1.25em;
line-height: 1.25em;
margin: 1em 1em 2.25em;
}
/* No margin for questions when no frame */ /* No margin for questions when no frame */
.h5p-no-frame .questionset .h5p-question > * { .h5p-no-frame .questionset .h5p-question > * {
margin-left: 0; margin-left: 0;

View File

@ -40,7 +40,7 @@ H5P.QuestionSet = function (options, contentId) {
' <% if (progressType == "dots") { %>' + ' <% if (progressType == "dots") { %>' +
' <div class="dots-container">' + ' <div class="dots-container">' +
' <% for (var i=0; i<questions.length; i++) { %>' + ' <% 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>' + ' </div>' +
' <% } else if (progressType == "textual") { %>' + ' <% } else if (progressType == "textual") { %>' +
@ -52,14 +52,21 @@ H5P.QuestionSet = function (options, contentId) {
var resulttemplate = var resulttemplate =
'<div class="questionset-results">' + '<div class="questionset-results">' +
' <div class="greeting"><%= message %></div>' +
' <div class="feedback-section">' + ' <div class="feedback-section">' +
' <div class="feedback-scorebar"></div>' + ' <div class="feedback-scorebar"></div>' +
' <div class="feedback-text"></div>' + ' <div class="feedback-text"></div>' +
' </div>' + ' </div>' +
' <% if (comment) { %>' +
' <div class="result-header"><%= comment %></div>' +
' <% } %>' +
' <% if (resulttext) { %>' +
' <div class="result-text"><%= resulttext %></div>' +
' <% } %>' +
' <div class="buttons">' + ' <div class="buttons">' +
' <a class="h5p-joubelui-button h5p-button qs-finishbutton"><%= finishButtonText %></a>' + ' <button type="button" class="h5p-joubelui-button h5p-button qs-finishbutton"><%= finishButtonText %></button>' +
' <a class="h5p-joubelui-button h5p-button qs-solutionbutton"><%= solutionButtonText %></a>' + ' <button type="button" class="h5p-joubelui-button h5p-button qs-solutionbutton"><%= solutionButtonText %></button>' +
' <a class="h5p-joubelui-button h5p-button qs-retrybutton"></a>' + ' <button type="button" class="h5p-joubelui-button h5p-button qs-retrybutton"><%= retryButtonText %></button>' +
' </div>' + ' </div>' +
'</div>'; '</div>';
@ -76,30 +83,28 @@ H5P.QuestionSet = function (options, contentId) {
startButtonText: 'Start' startButtonText: 'Start'
}, },
texts: { texts: {
prevButton: 'Previous', prevButton: 'Previous question',
nextButton: 'Next', nextButton: 'Next question',
finishButton: 'Finish', finishButton: 'Finish',
textualProgress: 'Question: @current of @total questions' textualProgress: 'Question: @current of @total questions',
jumpToQuestion: 'Jump to question %d',
questionLabel: 'Question'
}, },
endGame: { endGame: {
showResultPage: true, showResultPage: true,
noResultMessage: 'Finished',
message: 'Your result:', message: 'Your result:',
successGreeting: 'Congratulations!', successGreeting: 'Congratulations!',
successComment: 'You have enough correct answers to pass the test.', successComment: 'You have enough correct answers to pass the test.',
failGreeting: 'Sorry!', failGreeting: 'Sorry!',
failComment: "You don't have enough correct answers to pass this test.", failComment: "You don't have enough correct answers to pass this test.",
scoreString: 'You got @score points of @total possible.', scoreString: 'You got @score of @total points',
finishButtonText: 'Finish', finishButtonText: 'Finish',
solutionButtonText: 'Show solution', solutionButtonText: 'Show solution',
retryButtonText: 'Retry', retryButtonText: 'Retry',
showAnimations: false showAnimations: false,
}, skipButtonText: 'Skip video'
override: { }
overrideButtons: false,
overrideShowSolutionButton: false,
overrideRetry: false
},
questionLabel: 'Question'
}; };
var template = new EJS({text: texttemplate}); var template = new EJS({text: texttemplate});
@ -113,19 +118,39 @@ H5P.QuestionSet = function (options, contentId) {
var up; var up;
renderSolutions = false; renderSolutions = false;
var $template = $(template.render(params));
// Set overrides for questions
var override;
if (params.override.showSolutionButton || params.override.retryButton) {
override = {};
if (params.override.showSolutionButton) {
// Force "Show solution" button to be on or off for all interactions
override.enableSolutionsButton =
(params.override.showSolutionButton === 'on' ? true : false);
}
if (params.override.retryButton) {
// Force "Retry" button to be on or off for all interactions
override.enableRetry =
(params.override.retryButton === 'on' ? true : false);
}
}
// Instantiate question instances // Instantiate question instances
for (var i = 0; i < params.questions.length; i++) { for (var i = 0; i < params.questions.length; i++) {
var question = params.questions[i]; var question = params.questions[i];
// TODO: Render on init, inject in template.
// override content parameters. question.jumpAriaLabel = params.texts.jumpToQuestion.replace('%d', i + 1);
if (params.override.overrideButtons) { if (override) {
// Extend subcontent with the overrided settings. // Extend subcontent with the overrided settings.
$.extend(question.params.behaviour, { $.extend(question.params.behaviour, override);
enableRetry: params.override.overrideRetry,
enableSolutionsButton: params.override.overrideShowSolutionButton
});
} }
question.params = question.params || {};
question.params.overrideSettings = question.params.overrideSettings || {};
question.params.overrideSettings.$confirmationDialogParent = $template.last();
question.params.overrideSettings.instance = this;
var questionInstance = H5P.newRunnable(question, contentId, undefined, undefined, {parent: self}); var questionInstance = H5P.newRunnable(question, contentId, undefined, undefined, {parent: self});
questionInstance.on('resize', function () { questionInstance.on('resize', function () {
up = true; up = true;
@ -242,6 +267,9 @@ H5P.QuestionSet = function (options, contentId) {
// Hide finish button // Hide finish button
questionInstances[questionInstances.length - 1].hideButton('finish'); questionInstances[questionInstances.length - 1].hideButton('finish');
// Mark all tasks as unanswered:
$('.progress-dot').removeClass('answered').addClass('unanswered');
//Force the last page to be reRendered //Force the last page to be reRendered
rendered = false; rendered = false;
}; };
@ -252,6 +280,17 @@ H5P.QuestionSet = function (options, contentId) {
rendered = false; rendered = false;
}; };
var moveQuestion = function (direction) {
_stopQuestion(currentQuestion);
if (currentQuestion + direction >= questionInstances.length) {
_displayEndGame();
}
else {
_showQuestion(currentQuestion + direction);
}
};
var _displayEndGame = function () { var _displayEndGame = function () {
if (rendered) { if (rendered) {
$myDom.children().hide().filter('.questionset-results').show(); $myDom.children().hide().filter('.questionset-results').show();
@ -271,37 +310,64 @@ H5P.QuestionSet = function (options, contentId) {
score: scoreString, score: scoreString,
passed: success passed: success
}; };
/**
* Makes our buttons behave like other buttons.
*
* @private
* @param {string} classSelector
* @param {function} handler
*/
var hookUpButton = function (classSelector, handler) {
$(classSelector, $myDom).click(handler).keypress(function (e) {
if (e.which === 32) {
handler();
e.preventDefault();
}
});
};
var displayResults = function () { var displayResults = function () {
self.triggerXAPICompleted(self.getScore(), self.totalScore(), success); self.triggerXAPICompleted(self.getScore(), self.totalScore(), success);
if (!params.endGame.showResultPage) {
self.trigger('h5pQuestionSetFinished', eventData);
return;
}
var eparams = { var eparams = {
comment: (success ? params.endGame.successGreeting : params.endGame.failGreeting), message: params.endGame.showResultPage ? params.endGame.message : params.endGame.noResultMessage,
comment: params.endGame.showResultPage ? (success ? params.endGame.successGreeting : params.endGame.failGreeting) : undefined,
resulttext: params.endGame.showResultPage ? (success ? params.endGame.successComment : params.endGame.failComment) : undefined,
finishButtonText: params.endGame.finishButtonText, finishButtonText: params.endGame.finishButtonText,
solutionButtonText: params.endGame.solutionButtonText solutionButtonText: params.endGame.solutionButtonText,
retryButtonText: params.endGame.retryButtonText
}; };
// Show result page. // Show result page.
$myDom.children().hide(); $myDom.children().hide();
$myDom.append(endTemplate.render(eparams)); $myDom.append(endTemplate.render(eparams));
$('.qs-finishbutton', $myDom).click(function () {
if (params.endGame.showResultPage) {
// Add event handlers to summary buttons
hookUpButton('.qs-finishbutton', function () {
self.trigger('h5pQuestionSetFinished', eventData); self.trigger('h5pQuestionSetFinished', eventData);
}); });
$('.qs-solutionbutton', $myDom).click(function () { hookUpButton('.qs-solutionbutton', function () {
showSolutions(); showSolutions();
$myDom.children().hide().filter('.questionset').show(); $myDom.children().hide().filter('.questionset').show();
_showQuestion(params.initialQuestion); _showQuestion(params.initialQuestion);
}); });
$('.qs-retrybutton', $myDom) hookUpButton('.qs-retrybutton', function () {
.html(params.endGame.retryButtonText)
.click(function () {
resetTask(); resetTask();
$myDom.children().hide().filter('.questionset').show(); $myDom.children().hide();
_showQuestion(params.initialQuestion);});
var $intro = $('.intro-page', $myDom);
if ($intro.length) {
// Show intro
$('.intro-page', $myDom).show();
}
else {
// Show first question
$('.questionset', $myDom).show();
_showQuestion(params.initialQuestion);
}
});
if (scoreBar === undefined) { if (scoreBar === undefined) {
scoreBar = H5P.JoubelUI.createScoreBar(totals); scoreBar = H5P.JoubelUI.createScoreBar(totals);
@ -309,6 +375,13 @@ H5P.QuestionSet = function (options, contentId) {
scoreBar.appendTo($('.feedback-scorebar', $myDom)); scoreBar.appendTo($('.feedback-scorebar', $myDom));
scoreBar.setScore(finals); scoreBar.setScore(finals);
$('.feedback-text', $myDom).html(scoreString); $('.feedback-text', $myDom).html(scoreString);
}
else {
// Remove buttons and feedback section
$('.qs-finishbutton, .qs-solutionbutton, .qs-retrybutton, .feedback-section', $myDom).remove();
}
self.trigger('resize');
}; };
if (params.endGame.showAnimations) { if (params.endGame.showAnimations) {
@ -365,7 +438,8 @@ H5P.QuestionSet = function (options, contentId) {
} }
// Render own DOM into target. // Render own DOM into target.
$myDom.html(template.render(params)); $myDom.children().remove();
$myDom.append($template);
if (params.backgroundImage !== undefined) { if (params.backgroundImage !== undefined) {
$myDom.css({ $myDom.css({
overflow: 'hidden', overflow: 'hidden',
@ -377,13 +451,15 @@ H5P.QuestionSet = function (options, contentId) {
if (params.introPage.backgroundImage !== undefined) { if (params.introPage.backgroundImage !== undefined) {
var $intro = $myDom.find('.intro-page'); var $intro = $myDom.find('.intro-page');
if ($intro.length) { if ($intro.length) {
var bgImg = params.introPage.backgroundImage;
var bgImgRatio = (bgImg.height / bgImg.width);
$intro.css({ $intro.css({
background: '#fff url("' + H5P.getPath(params.introPage.backgroundImage.path, contentId) + '") no-repeat 50% 50%', background: '#fff url("' + H5P.getPath(bgImg.path, contentId) + '") no-repeat 50% 50%',
backgroundSize: '100% auto' backgroundSize: 'auto 100%',
minHeight: bgImgRatio * +window.getComputedStyle($intro[0]).width.replace('px','')
}); });
} }
} }
var registerImageLoadedListener = function (question) { var registerImageLoadedListener = function (question) {
H5P.on(question, 'imageLoaded', function () { H5P.on(question, 'imageLoaded', function () {
self.trigger('resize'); self.trigger('resize');
@ -399,32 +475,27 @@ H5P.QuestionSet = function (options, contentId) {
// Listen for image resize // Listen for image resize
registerImageLoadedListener(question); registerImageLoadedListener(question);
// Disable feedback for question
question.setBehaviour({disableFeedback: true});
// Add next/finish button // Add next/finish button
if (questionInstances[questionInstances.length -1] === question) { if (questionInstances[questionInstances.length -1] === question) {
// Add finish question set button // Add finish question set button
question.addButton('finish', params.texts.finishButton, function () { question.addButton('finish', params.texts.finishButton,
_stopQuestion(currentQuestion); moveQuestion.bind(this, 1), false);
_displayEndGame();
}, false);
} else { } else {
// Add next question button // Add next question button
question.addButton('next', '', function () { question.addButton('next', '', moveQuestion.bind(this, 1), true, {
_stopQuestion(currentQuestion); href: '#', // Use href since this is a navigation button
_showQuestion(currentQuestion + 1); 'aria-label': params.texts.nextButton
}); });
} }
// Add previous question button // Add previous question button
if (questionInstances[0] !== question) { if (questionInstances[0] !== question) {
question.addButton('prev', '', function () { question.addButton('prev', '', moveQuestion.bind(this, -1), true, {
_stopQuestion(currentQuestion); href: '#', // Use href since this is a navigation button
_showQuestion(currentQuestion - 1); 'aria-label': params.texts.prevButton
}); });
} }
@ -433,7 +504,9 @@ H5P.QuestionSet = function (options, contentId) {
if (shortVerb === 'interacted' || if (shortVerb === 'interacted' ||
shortVerb === 'answered' || shortVerb === 'answered' ||
shortVerb === 'attempted') { shortVerb === 'attempted') {
if (questionInstances[currentQuestion].getAnswerGiven()) {
$('.progress-dot:eq(' + currentQuestion +')', $myDom).removeClass('unanswered').addClass('answered'); $('.progress-dot:eq(' + currentQuestion +')', $myDom).removeClass('unanswered').addClass('answered');
}
_updateButtons(); _updateButtons();
} }
if (shortVerb === 'completed') { if (shortVerb === 'completed') {
@ -441,13 +514,10 @@ H5P.QuestionSet = function (options, contentId) {
event.setVerb('answered'); event.setVerb('answered');
} }
if (event.data.statement.context.extensions === undefined) { if (event.data.statement.context.extensions === undefined) {
event.data.statement.context.extensions = []; event.data.statement.context.extensions = {};
} }
event.data.statement.context.extensions['http://id.tincanapi.com/extension/ending-point'] = currentQuestion + 1; event.data.statement.context.extensions['http://id.tincanapi.com/extension/ending-point'] = currentQuestion + 1;
}); });
if (question.getAnswerGiven()) {
$('.progress-dot:eq(' + i +')', $myDom).removeClass('unanswered').addClass('answered');
}
} }
// Allow other libraries to add transitions after the questions have been inited // Allow other libraries to add transitions after the questions have been inited
@ -455,19 +525,19 @@ H5P.QuestionSet = function (options, contentId) {
$('.qs-startbutton', $myDom).click(function () { $('.qs-startbutton', $myDom).click(function () {
$(this).parents('.intro-page').hide(); $(this).parents('.intro-page').hide();
$('.questionset', $myDom).removeClass('hidden'); $('.questionset', $myDom).show();
_showQuestion(currentQuestion); _showQuestion(params.initialQuestion);
}); });
// Set event listeners. // Set event listeners.
$('.progress-dot', $myDom).click(function () { $('.progress-dot', $myDom).click(function () {
_stopQuestion(currentQuestion); _stopQuestion(currentQuestion);
_showQuestion($(this).index()); _showQuestion($(this).index());
return false;
}); });
// Hide all but initial Question. // Hide all but initial Question.
_showQuestion(params.initialQuestion); _showQuestion(params.initialQuestion);
_updateButtons();
if (renderSolutions) { if (renderSolutions) {
showSolutions(); showSolutions();
@ -529,7 +599,7 @@ H5P.QuestionSet = function (options, contentId) {
} }
// Determine label // Determine label
var label = (params.questionLabel + ' ' + (i + 1)); var label = (params.texts.questionLabel + ' ' + (i + 1));
if (qParams.contentName !== undefined) { if (qParams.contentName !== undefined) {
label += ': ' + qParams.contentName; label += ': ' + qParams.contentName;
} }

View File

@ -74,6 +74,15 @@
{ {
"label": "نص التقدم", "label": "نص التقدم",
"description": "النص المستخدم إذا تم تحديد التقدم نصيا" "description": "النص المستخدم إذا تم تحديد التقدم نصيا"
},
{
"label": "Label for jumping to a certain question",
"description": "You must use the placeholder '%d' instead of the question number.",
"default": "Jump to question %d"
},
{
"label": "Copyright dialog question label",
"default": "Question"
} }
] ]
}, },
@ -83,6 +92,11 @@
{ {
"label": "عرض النتائج" "label": "عرض النتائج"
}, },
{
"label": "No results message",
"description": "Text displayed on end page when \"Display results\" is disabled",
"default": "Finished"
},
{ {
"label": "نص راس الملاحظات", "label": "نص راس الملاحظات",
"description": "سيتم عرض هذا العنوان في نهاية هذه المسابقة حيثما أجاب المستخدم على جميع الأسئلة المستعملة" "description": "سيتم عرض هذا العنوان في نهاية هذه المسابقة حيثما أجاب المستخدم على جميع الأسئلة المستعملة"
@ -139,25 +153,32 @@
}, },
{ {
"label": "إعدادات زر \"مشاهدة حل \" وزر \"إعادة المحاولة\" ", "label": "إعدادات زر \"مشاهدة حل \" وزر \"إعادة المحاولة\" ",
"description": "وهذه الخيارات تمكنك من تجاوز وقت العرض بزر \"مشاهدة حل \" وزر \"إعادة المحاولة \" في محتويات متكامل h5p.",
"fields": [ "fields": [
{ {
"label": "تفعيل زر تجاوز \"مشاهدة حل \" و إعدادات \"إعادة \"المحاولة", "label": "Override \"Show Solution\" button",
"description": "وإذا تم تفعيل هذه الأسئلة سيتم تجاهل الإعدادات الخاصة وسيتم استخدام الضبط أدناه بدلا من ذلك" "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.",
"options": [
{
"label": "Enabled"
}, },
{ {
"label": "تفعيل زر \"إظهار الحل\"", "label": "Disabled"
"description": "تفعيل هذا الخيار يجعل الأسئلة تظهر زر \"مشاهدة الحل\""
},
{
"label": "تفعيل زر \"إعادة المحاولة\"",
"description": "تفعيل هذا الخيار يجعل المستخدم قادرا على \"إعادة المحاولة\""
} }
] ]
}, },
{ {
"label": "Question label text", "label": "Override \"Retry\" button",
"default": "Question" "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.",
"options": [
{
"label": "Enabled"
},
{
"label": "Disabled"
}
]
}
]
} }
] ]
} }

View File

@ -79,6 +79,15 @@
"label": "Fortschrittstext", "label": "Fortschrittstext",
"description": "Verwendeter Text wenn Text Fortschrittsanzeige gewählt wurde.", "description": "Verwendeter Text wenn Text Fortschrittsanzeige gewählt wurde.",
"default": "Aktuelle Frage: @current von @total Fragen" "default": "Aktuelle Frage: @current von @total Fragen"
},
{
"label": "Label for jumping to a certain question",
"description": "You must use the placeholder '%d' instead of the question number.",
"default": "Jump to question %d"
},
{
"label": "Copyright dialog question label",
"default": "Question"
} }
] ]
}, },
@ -88,6 +97,11 @@
{ {
"label": "Ergebnisanzeige" "label": "Ergebnisanzeige"
}, },
{
"label": "No results message",
"description": "Text displayed on end page when \"Display results\" is disabled",
"default": "Finished"
},
{ {
"label": "Kopfzeile Feedback", "label": "Kopfzeile Feedback",
"default": "Dein Ergebnis:", "default": "Dein Ergebnis:",
@ -154,19 +168,30 @@
}, },
{ {
"label": "Einstellungen für \"Zeige die Lösung\" Button und \"Nochmal\".", "label": "Einstellungen für \"Zeige die Lösung\" Button und \"Nochmal\".",
"description": "Diese Möglichkeiten überschreiben die Anzeige von \"Zeige die Lösung\" Button und \"Nochmal\" bei integrierten h5p Inhalten.",
"fields": [ "fields": [
{ {
"label": "Aktiviert das Überschreiben für \"Zeige die Lösung\" Button und \"Wiederholen\" Einstellungen.", "label": "Override \"Show Solution\" button",
"description": "Wenn dies ausgewählt wurde, werden die Einstellungen der Frage ignoriert und stattdessen werden die nachfolgenden Einstellungen verwendet." "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.",
"options": [
{
"label": "Enabled"
}, },
{ {
"label": "Aktiviert \"Zeige die Lösung\" Buttons.", "label": "Disabled"
"description": "Wenn dies ausgewählt wurde, werden die Fragen den \"Zeige die Lösung\" Button haben." }
]
}, },
{ {
"label": "Aktiviert \"Wiederholen\".", "label": "Override \"Retry\" button",
"description": "Wenn diese Option gewählt wurde, ermöglicht es den Benutzern zu \"Wiederholen\" ." "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.",
"options": [
{
"label": "Enabled"
},
{
"label": "Disabled"
}
]
} }
] ]
} }

View File

@ -74,6 +74,15 @@
{ {
"label": "Texte de progression", "label": "Texte de progression",
"description": "Texte utilisé si la progression textuelle est utilisée." "description": "Texte utilisé si la progression textuelle est utilisée."
},
{
"label": "Label for jumping to a certain question",
"description": "You must use the placeholder '%d' instead of the question number.",
"default": "Jump to question %d"
},
{
"label": "Copyright dialog question label",
"default": "Question"
} }
] ]
}, },
@ -83,6 +92,11 @@
{ {
"label": "Montrer les résultats" "label": "Montrer les résultats"
}, },
{
"label": "No results message",
"description": "Text displayed on end page when \"Display results\" is disabled",
"default": "Finished"
},
{ {
"label": "Feedback de fin", "label": "Feedback de fin",
"description": "Ce texte sera affiché quand l'utilisateur aura totalement terminé le quiz." "description": "Ce texte sera affiché quand l'utilisateur aura totalement terminé le quiz."
@ -139,25 +153,32 @@
}, },
{ {
"label": "Options pour les boutons \"Montrer la solution\" et \"Réessayer\".", "label": "Options pour les boutons \"Montrer la solution\" et \"Réessayer\".",
"description": "Ces options vous permettent de choisir quand afficher les boutons \"Solutions\" et \"Réessayer\" dans votre acivité h5p..",
"fields": [ "fields": [
{ {
"label": "Activer les réglages par défaut pour les boutons \"Solution\" et \"Réessayer\".", "label": "Override \"Show Solution\" button",
"description": "Si cette option est choisie, les réglages seront valables pour toutes les questions, les réglages individuels ne seront pas pris en compte." "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.",
"options": [
{
"label": "Enabled"
}, },
{ {
"label": "Afficher le bouton \"Solution\".", "label": "Disabled"
"description": "Affiche le bouton \"Solution\"."
},
{
"label": "Afficher le bouton \"Réessayer\".",
"description": "Affiche le bouton \"Réessayer\"."
} }
] ]
}, },
{ {
"label": "Texte de la question", "label": "Override \"Retry\" button",
"default": "Question" "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.",
"options": [
{
"label": "Enabled"
},
{
"label": "Disabled"
}
]
}
]
} }
] ]
} }

View File

@ -74,6 +74,15 @@
{ {
"label": "Testo Avanzamento", "label": "Testo Avanzamento",
"description": "esto utilizzato se il testo Avanzamento è selezionato." "description": "esto utilizzato se il testo Avanzamento è selezionato."
},
{
"label": "Label for jumping to a certain question",
"description": "You must use the placeholder '%d' instead of the question number.",
"default": "Jump to question %d"
},
{
"label": "Copyright dialog question label",
"default": "Question"
} }
] ]
}, },
@ -83,6 +92,11 @@
{ {
"label": "Visualizza risultati" "label": "Visualizza risultati"
}, },
{
"label": "No results message",
"description": "Text displayed on end page when \"Display results\" is disabled",
"default": "Finished"
},
{ {
"label": "Intestazione Feedback", "label": "Intestazione Feedback",
"description": "Questa intestazione verrà visualizzata alla fine del quiz, dopo che l'utente avrà risposto a tutte le domande." "description": "Questa intestazione verrà visualizzata alla fine del quiz, dopo che l'utente avrà risposto a tutte le domande."
@ -139,25 +153,32 @@
}, },
{ {
"label": "Impostazioni per i pulsanti \"Mostra soluzione\" e \"Riprova\".", "label": "Impostazioni per i pulsanti \"Mostra soluzione\" e \"Riprova\".",
"description": "Queste opzioni consentono di ignorare quando visualizzare i pulsanti \"Mostra soluzione\" e \"Riprova\" nel contenuto H5P integrato.",
"fields": [ "fields": [
{ {
"label": "Abilita ignora impostazioni per \"Mostra soluzione\" e \"Riprova\".", "label": "Override \"Show Solution\" button",
"description": "Se questa opzione è abilitata le proprie impostazioni per le domande saranno ignorate e verranno utilizzate le impostazioni seguenti." "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.",
"options": [
{
"label": "Enabled"
}, },
{ {
"label": "Abilita pulsanti \"Mostra soluzione\".", "label": "Disabled"
"description": "L'attivazione di questa opzione farà in modo che le domande mostrino il tasto \"Mostra soluzione\"."
},
{
"label": "Abilita \"Riprova\".",
"description": "L'attivazione di questa opzione farà in modo che per l'utente sia abilitata l'opzione \"Riprova\"."
} }
] ]
}, },
{ {
"label": "Question label text", "label": "Override \"Retry\" button",
"default": "Question" "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.",
"options": [
{
"label": "Enabled"
},
{
"label": "Disabled"
}
]
}
]
} }
] ]
} }

View File

@ -62,11 +62,11 @@
"fields": [ "fields": [
{ {
"label": "Forrige-knappen", "label": "Forrige-knappen",
"default": "Forrige" "default": "Forrige spørsmål"
}, },
{ {
"label": "Neste-knappen", "label": "Neste-knappen",
"default": "Neste" "default": "Neste spørsmål"
}, },
{ {
"label": "Avslutt-knappen", "label": "Avslutt-knappen",
@ -76,6 +76,15 @@
"label": "Fremdriftstekst", "label": "Fremdriftstekst",
"description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total", "description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total",
"default": "Deloppgave @current av @total" "default": "Deloppgave @current av @total"
},
{
"label": "Merkelapp ved hopping til spørsmål",
"description": "Du må bruke plassholderen '%d' istedenfor spørsmålsnummeret.",
"default": "Hopp til spørsmål %d"
},
{
"label": "Opphavsrett spørsmål-etikett",
"default": "Spørsmål"
} }
] ]
}, },
@ -85,14 +94,19 @@
{ {
"label": "Vis resultater" "label": "Vis resultater"
}, },
{
"label": "Melding når resultater ikke vises",
"description": "Teksten vises på avslutnings-siden når resultater ikke vises",
"default": "Ferdig"
},
{ {
"label": "Overskrift over tilbakemeldinger", "label": "Overskrift over tilbakemeldinger",
"default": "Ditt resultat:", "default": "Resultat:",
"description": "Denne overskriften vises over tilbakemeldingene på slutten av spørsmålssettet." "description": "Denne overskriften vises over tilbakemeldingene på slutten av spørsmålssettet."
}, },
{ {
"label": "Poengvisningstekst", "label": "Poengvisningstekst",
"default": "Du fikk @score poeng av @total mulige.", "default": "@score av @total poeng",
"description": "Tekst som viser brukerens oppnådde poeng. \"@score\" blir erstattet med utregnet resultat, \"@total\" blir erstattet med høyest mulige resultat." "description": "Tekst som viser brukerens oppnådde poeng. \"@score\" blir erstattet med utregnet resultat, \"@total\" blir erstattet med høyest mulige resultat."
}, },
{ {
@ -102,27 +116,27 @@
}, },
{ {
"label": "Kommentar ved bestått", "label": "Kommentar ved bestått",
"default": "Du presterte godt!", "default": "Dette gikk bra.",
"description": "Denne kommentaren vises dersom brukeren har bestått spørsmålssettet." "description": "Denne kommentaren vises dersom brukeren har bestått spørsmålssettet."
}, },
{ {
"label": "Tittel ved ikke bestått", "label": "Tittel ved ikke bestått",
"default": "Ikke bestått", "default": "Dette gikk ikke så bra!",
"description": "Denne tittelen vises dersom brukeren ikke har bestått spørsmålssettet." "description": "Denne tittelen vises dersom brukeren ikke har bestått spørsmålssettet."
}, },
{ {
"label": "Kommentar ved ikke bestått", "label": "Kommentar ved ikke bestått",
"default": "Ikke bestått. Prøv igjen!", "default": "Det er litt mange feil her. Prøv igjen!",
"description": "Denne kommentaren vises dersom brukeren ikke har bestått spørsmålssettet." "description": "Denne kommentaren vises dersom brukeren ikke har bestått spørsmålssettet."
}, },
{ {
"label": "Tekst til \"Fasit\" knapp", "label": "Tekst til \"Fasit\" knapp",
"default": "Vis fasit", "default": "Gå gjennom fasit",
"description": "" "description": ""
}, },
{ {
"label": "Tekst til \"Prøv igjen\" knapp", "label": "Tekst til \"Prøv igjen\" knapp",
"default": "Prøv igjen", "default": "Prøv igjen!",
"description": "" "description": ""
}, },
{ {
@ -150,26 +164,33 @@
] ]
}, },
{ {
"label": "Innstillinger for \"Vis svar\" knapp og \"Prøv igjen\".", "label": "Innstillinger for «Fasit»- og «Prøv igjen»-knapp",
"description": "Disse instillingene lar deg overstyre når \"Vis svar\" knapp og \"Prøv igjen\" er slått på i integrert h5p innhold.",
"fields": [ "fields": [
{ {
"label": "Slå på overstyring for \"Vis svar\" og \"Prøv igjen\".", "label": "Overstyr «Fasit»-knapp",
"description": "Aktivering vil overstyre de følgende innstillingene for integrert innhold." "description": "Dette valget avgjør om «Fasit»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.",
"options": [
{
"label": "Aktivert"
}, },
{ {
"label": "Slå på \"Vis svar\" knapp.", "label": "Deaktivert"
"description": "Aktivering vil slå på \"Vis svar\" knappen."
},
{
"label": "Slå på \"Prøv igjen\".",
"description": "Aktivering vil slå på \"Prøv igjen\" ."
} }
] ]
}, },
{ {
"label": "Spørsmål-etikett", "label": "Overstyr «Prøv igjen»-knapp",
"default": "Spørsmål" "description": "Dette valget avgjør om «Prøv igjen»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.",
"options": [
{
"label": "Aktivert"
},
{
"label": "Deaktivert"
}
]
}
]
} }
] ]
} }

View File

@ -61,8 +61,8 @@
"label": "Ledetekster", "label": "Ledetekster",
"fields": [ "fields": [
{ {
"label": "Forrige-knappen", "label": "Førre-knappen",
"default": "Forrige" "default": "Førre"
}, },
{ {
"label": "Neste-knappen", "label": "Neste-knappen",
@ -75,7 +75,16 @@
{ {
"label": "Fremdriftstekst", "label": "Fremdriftstekst",
"description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total", "description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total",
"default": "Deloppgave @current av @total" "default": "Deloppgåve @current av @total"
},
{
"label": "Merkelapp ved hopping til spørsmål",
"description": "Du må bruke plassholderen '%d' istedenfor spørsmålstalet.",
"default": "Hopp til spørsmål %d"
},
{
"label": "Opphavsrett spørsmål-etikett",
"default": "Spørsmål"
} }
] ]
}, },
@ -85,14 +94,19 @@
{ {
"label": "Vis resultat" "label": "Vis resultat"
}, },
{
"label": "Melding når resultater ikke vises",
"description": "Teksten vises på avslutnings-siden når resultater ikke vises",
"default": "Ferdig"
},
{ {
"label": "Overskrift over tilbakemeldingar", "label": "Overskrift over tilbakemeldingar",
"default": "Ditt resultat:", "default": "Resultat:",
"description": "Denne overskriften vises over tilbakemeldingane på slutten av spørsmålssettet." "description": "Denne overskriften vises over tilbakemeldingane på slutten av spørsmålssettet."
}, },
{ {
"label": "Poengvisningstekst", "label": "Poengvisningstekst",
"default": "Du fikk @score poeng av @total mulige.", "default": "@score av @total poeng",
"description": "Tekst som viser brukerens oppnådde poeng. \"@score\" blir erstatta med utregna resultat, \"@total\" blir erstatta med høgest mulig resultat." "description": "Tekst som viser brukerens oppnådde poeng. \"@score\" blir erstatta med utregna resultat, \"@total\" blir erstatta med høgest mulig resultat."
}, },
{ {
@ -102,17 +116,17 @@
}, },
{ {
"label": "Kommentar ved bestått", "label": "Kommentar ved bestått",
"default": "Du presterte meget godt!", "default": "Dette gjekk bra.",
"description": "Denne kommentaren vises dersom brukaren har bestått spørsmålssettet." "description": "Denne kommentaren vises dersom brukaren har bestått spørsmålssettet."
}, },
{ {
"label": "Tittel ved ikkje bestått", "label": "Tittel ved ikkje bestått",
"default": "Ikkje bestått", "default": "Dette gjekk ikkje så bra!",
"description": "Denne tittelen visast dersom brukaren ikkje har bestått spørsmålssettet." "description": "Denne tittelen visast dersom brukaren ikkje har bestått spørsmålssettet."
}, },
{ {
"label": "Kommentar ved ikkje bestått", "label": "Kommentar ved ikkje bestått",
"default": "Dette er litt mange feil her. Prøv igjen!", "default": "Det er litt mange feil her. Prøv igjen!",
"description": "Denne kommentaren vises dersom brukaren ikkje har bestått spørsmålssettet." "description": "Denne kommentaren vises dersom brukaren ikkje har bestått spørsmålssettet."
}, },
{ {
@ -150,26 +164,33 @@
] ]
}, },
{ {
"label": "Innstillinger for \"Vis svar\" knapp og \"Prøv igjen\".", "label": "Innstillinger for «Fasit»- og «Prøv igjen»-knapp",
"description": "Disse instillingene lar deg overstyre når \"Vis svar\" knapp og \"Prøv igjen\" er slått på i integrert h5p innhald.",
"fields": [ "fields": [
{ {
"label": "Slå på overstyring for \"Vis svar\" og \"Prøv igjen\".", "label": "Overstyr «Fasit»-knapp",
"description": "Aktivering vil overstyre dei følgjande innstillingene for integrert innhald." "description": "Dette valget avgjør om «Fasit»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.",
"options": [
{
"label": "Aktivert"
}, },
{ {
"label": "Slå på \"Vis svar\" knapp.", "label": "Deaktivert"
"description": "Aktivering vil slå på \"Vis svar\" knappen."
},
{
"label": "Slå på \"Prøv igjen\".",
"description": "Aktivering vil slå på \"Prøv igjen\" ."
} }
] ]
}, },
{ {
"label": "Spørsmål-etikett", "label": "Overstyr «Prøv igjen»-knapp",
"default": "Spørsmål" "description": "Dette valget avgjør om «Prøv igjen»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.",
"options": [
{
"label": "Aktivert"
},
{
"label": "Deaktivert"
}
]
}
]
} }
] ]
} }

View File

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

View File

@ -110,11 +110,11 @@
"label": "Question type", "label": "Question type",
"description": "Library for this question.", "description": "Library for this question.",
"options": [ "options": [
"H5P.MultiChoice 1.6", "H5P.MultiChoice 1.7",
"H5P.DragQuestion 1.5", "H5P.DragQuestion 1.6",
"H5P.Blanks 1.4", "H5P.Blanks 1.6",
"H5P.MarkTheWords 1.5", "H5P.MarkTheWords 1.6",
"H5P.DragText 1.4" "H5P.DragText 1.5"
] ]
} }
}, },
@ -128,13 +128,13 @@
"name": "prevButton", "name": "prevButton",
"type": "text", "type": "text",
"label": "Back button", "label": "Back button",
"default": "Previous" "default": "Previous question"
}, },
{ {
"name": "nextButton", "name": "nextButton",
"type": "text", "type": "text",
"label": "Next button", "label": "Next button",
"default": "Next" "default": "Next question"
}, },
{ {
"name": "finishButton", "name": "finishButton",
@ -152,6 +152,19 @@
"strong", "strong",
"em" "em"
] ]
},
{
"name": "jumpToQuestion",
"type": "text",
"label": "Label for jumping to a certain question",
"description": "You must use the placeholder '%d' instead of the question number.",
"default": "Jump to question %d"
},
{
"name": "questionLabel",
"type": "text",
"label": "Copyright dialog question label",
"default": "Question"
} }
] ]
}, },
@ -166,6 +179,14 @@
"label": "Display results", "label": "Display results",
"default": true "default": true
}, },
{
"name": "noResultMessage",
"type": "text",
"label": "No results message",
"description": "Text displayed on end page when \"Display results\" is disabled",
"default": "Finished",
"optional": true
},
{ {
"name": "message", "name": "message",
"type": "text", "type": "text",
@ -183,7 +204,7 @@
"type": "text", "type": "text",
"label": "Score display text", "label": "Score display text",
"description": "Text used to display Total user score. \"@score\" will be replaced by calculated score, \"@total\" will be replaced by maximum possible score. ", "description": "Text used to display Total user score. \"@score\" will be replaced by calculated score, \"@total\" will be replaced by maximum possible score. ",
"default": "You got @score points of @total possible.", "default": "You got @score of @total points",
"optional": true "optional": true
}, },
{ {
@ -300,37 +321,43 @@
{ {
"name": "override", "name": "override",
"type": "group", "type": "group",
"label": "Settings for \"Show solution\" button and \"Retry\".", "label": "Settings for \"Show solution\" and \"Retry\" buttons",
"description": "These options will let you override when to display \"Show solution\" button and \"Retry\" in integrated h5p content.",
"optional": true, "optional": true,
"fields": [ "fields": [
{ {
"name": "overrideButtons", "name": "showSolutionButton",
"type": "boolean", "type": "select",
"label": "Enable override for \"Show solution\" and \"Retry\" settings.", "label": "Override \"Show Solution\" button",
"description": "If this is enabled the questions own settings will be ignored and the below settings will be used instead.", "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.",
"default": false "optional": true,
"options": [
{
"value": "on",
"label": "Enabled"
}, },
{ {
"name": "overrideShowSolutionButton", "value": "off",
"type": "boolean", "label": "Disabled"
"label": "Enable \"Show solution\" buttons.",
"description": "Enabling this option will make questions show the \"Show solution\" button.",
"default": false
},
{
"name": "overrideRetry",
"type": "boolean",
"label": "Enable \"Retry\".",
"description": "Enabling this option will make the user able to \"Retry\" .",
"default": false
} }
] ]
}, },
{ {
"name": "questionLabel", "name": "retryButton",
"type": "text", "type": "select",
"label": "Question label text", "label": "Override \"Retry\" button",
"default": "Question" "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.",
"optional": true,
"options": [
{
"value": "on",
"label": "Enabled"
},
{
"value": "off",
"label": "Disabled"
}
]
}
]
} }
] ]

View File

@ -14,6 +14,44 @@ H5PUpgrades['H5P.QuestionSet'] = (function ($) {
}); });
} }
} }
finished(null, parameters);
},
/**
* Asynchronous content upgrade hook.
* Upgrades content parameters to support IV 1.7.
*
* Groups all UI text strings to make them eaiser to translate and handle.
*
* @params {Object} parameters
* @params {function} finished
*/
8: function (parameters, finished) {
if (parameters.override) {
if (parameters.override.overrideButtons) {
// Set new variables
parameters.override.showSolutionButton =
(parameters.override.overrideShowSolutionButton ? 'on' : 'off');
parameters.override.retryButton =
(parameters.override.overrideRetry ? 'on' : 'off');
}
// Remove old field variables
delete parameters.override.overrideButtons;
delete parameters.override.overrideShowSolutionButton;
delete parameters.override.overrideRetry;
}
// Move copyright dialog question label
if (parameters.questionLabel) {
parameters.texts = parameters.texts || {};
parameters.texts.questionLabel = parameters.questionLabel;
}
// Remove old copyright dialog question label
delete parameters.questionLabel;
finished(null, parameters); finished(null, parameters);
} }
} }