From eb7ccdd5239e0d9485ad3b183aed794767030a0a Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 24 Feb 2014 16:26:07 +0100 Subject: [PATCH 01/12] HFJ-179: Prepared for new API version. Using new resize events, removed some deprecated stuff. Fixed a bug in CP editor. --- css/questionset.css | 10 +++++----- js/questionset.js | 30 +++++------------------------- library.json | 16 +++++----------- 3 files changed, 15 insertions(+), 41 deletions(-) diff --git a/css/questionset.css b/css/questionset.css index 0f6bf83..261c28d 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -121,12 +121,12 @@ } .qs-footer a.next.button:after { - font-family: H5PFontAwesome; + font-family: H5PFontAwesome4; content: " \f054"; } .qs-footer a.prev.button:before { - font-family: H5PFontAwesome; + font-family: H5PFontAwesome4; content: "\f053 "; } @@ -135,12 +135,12 @@ } .qs-footer a.finish.button:before { - font-family: H5PFontAwesome; + font-family: H5PFontAwesome4; content: "\f00c "; } .questionset-results a.button.qs-solutionbutton:before { - font-family: H5PFontAwesome; + font-family: H5PFontAwesome4; content: "\f06e "; } @@ -244,4 +244,4 @@ font-style: normal; color: #6aa81b; text-align: left; -} \ No newline at end of file +} diff --git a/js/questionset.js b/js/questionset.js index be05071..200fc51 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -1,24 +1,5 @@ var H5P = H5P || {}; -if (H5P.getPath === undefined) { - /** - * Find the path to the content files based on the id of the content - * - * Also identifies and returns absolute paths - * - * @param {String} path Absolute path to a file, or relative path to a file in the content folder - * @param {Number} contentId Identifier of the content requesting the path - * @returns {String} The path to use. - */ - H5P.getPath = function (path, contentId) { - if (path.substr(0, 7) === 'http://' || path.substr(0, 8) === 'https://') { - return path; - } - - return H5PIntegration.getContentPath(contentId) + path; - }; -} - /** * Will render a Question with multiple choices for answers. * @@ -130,13 +111,11 @@ H5P.QuestionSet = function (options, contentId) { var question = params.questions[i]; // TODO: Render on init, inject in template. - var libraryObject = H5P.libraryFromString(question.library); $.extend(question.params, { displaySolutionsButton: false, postUserStatistics: false }); - var tmp = new (H5P.classFromName(libraryObject.machineName))(question.params, contentId); - questionInstances.push(tmp); + questionInstances.push(H5P.newRunnable(question, contentId)); } // Update button state. @@ -175,8 +154,9 @@ H5P.QuestionSet = function (options, contentId) { $('.question-container', $myDom).hide().eq(questionNumber).show(); // Trigger resize on question in case the size of the QS has changed. - if (questionInstances[questionNumber].resize !== undefined) { - questionInstances[questionNumber].resize(); + var instance = questionInstances[questionNumber]; + if (instance.$ !== undefined) { + instance.$.trigger('h5pResize'); } // Update progress indicator @@ -389,4 +369,4 @@ H5P.QuestionSet = function (options, contentId) { defaults: defaults // Provide defaults for inspection }; return returnObject; -}; \ No newline at end of file +}; diff --git a/library.json b/library.json index 4e2bf6b..26b09b2 100644 --- a/library.json +++ b/library.json @@ -3,11 +3,15 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 0, - "patchVersion": 39, + "patchVersion": 40, "runnable": 1, "fullscreen": 0, "machineName": "H5P.QuestionSet", "author": "Amendor AS", + "coreApi": { + "majorVersion": 1, + "minorVersion": 1 + }, "license": "cc-by-sa", "preloadedJs": [ {"path": "js/questionset.js"} @@ -16,21 +20,11 @@ {"path": "css/questionset.css"} ], "preloadedDependencies": [ - { - "machineName": "H5P.API", - "majorVersion": 1, - "minorVersion": 0 - }, { "machineName": "EmbeddedJS", "majorVersion": 1, "minorVersion": 0 }, - { - "machineName": "FontAwesome", - "majorVersion": 3, - "minorVersion": 1 - }, { "machineName": "H5P.Video", "majorVersion": 1, From 9e5e3b4e89313e79b2d91d0f3e16d3559e617c2e Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 26 Feb 2014 10:59:53 +0100 Subject: [PATCH 02/12] HFJ-170: Removed question padding. Removed unused outdated content example. --- css/questionset.css | 1 - library.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/css/questionset.css b/css/questionset.css index 261c28d..646d7ee 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -30,7 +30,6 @@ } .h5p-multichoice > .h5p-question { text-align: left; - padding: 0.5em 0.5em 0.4em; margin: 0.5em 0.5em 0.7em; background: rgba(255, 255, 255, 0.9); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#e6FFFFFF,endColorstr=#e6FFFFFF); diff --git a/library.json b/library.json index 26b09b2..503afd9 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 0, - "patchVersion": 40, + "patchVersion": 41, "runnable": 1, "fullscreen": 0, "machineName": "H5P.QuestionSet", From 856f0e8412c3b25e3100d18e78ad724816f1a7ba Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 19 Mar 2014 09:26:33 +0100 Subject: [PATCH 03/12] HFJ-179: Fixed usage of api-1.1 --- js/questionset.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index 200fc51..764ba43 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -155,8 +155,8 @@ H5P.QuestionSet = function (options, contentId) { // Trigger resize on question in case the size of the QS has changed. var instance = questionInstances[questionNumber]; - if (instance.$ !== undefined) { - instance.$.trigger('h5pResize'); + if (instance.resize !== undefined) { + instance.resize(); } // Update progress indicator From 36237099d6fd1528ce3f020977c450685f08fdba Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 19 Mar 2014 10:13:37 +0100 Subject: [PATCH 04/12] HFJ-188: Fixed libraries resize support. --- js/questionset.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index 764ba43..388678c 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -155,8 +155,8 @@ H5P.QuestionSet = function (options, contentId) { // Trigger resize on question in case the size of the QS has changed. var instance = questionInstances[questionNumber]; - if (instance.resize !== undefined) { - instance.resize(); + if (instance.$ !== undefined) { + instance.$.trigger('resize'); } // Update progress indicator From 8b50061e01fe6b99dd05f2507b796d3a88546aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20J=C3=B8rgensen?= Date: Fri, 21 Mar 2014 13:49:38 +0100 Subject: [PATCH 05/12] Fixed resizing in embed-iframe --- js/questionset.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/questionset.js b/js/questionset.js index 388678c..5e33045 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -335,6 +335,8 @@ H5P.QuestionSet = function (options, contentId) { if (renderSolutions) { showSolutions(); } + + this.$.trigger('resize'); return this; }; @@ -358,6 +360,7 @@ H5P.QuestionSet = function (options, contentId) { // Masquerade the main object to hide inner properties and functions. var returnObject = { + $: $(this), attach: attach, // Attach to DOM object getQuestions: function () {return questionInstances;}, getScore: getScore, From aa5387feef5df3afd48311348b29775ddc17cc3f Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Sun, 23 Mar 2014 01:27:49 +0100 Subject: [PATCH 06/12] HFJ-256: Added missing copyrights to boardgame. --- js/questionset.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/questionset.js b/js/questionset.js index 2151e29..6b4842f 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -379,6 +379,7 @@ H5P.QuestionSet = function (options, contentId) { if (questionInstance.getCopyrights !== undefined) { var rights = questionInstance.getCopyrights(); if (rights !== undefined) { + rights.setLabel('Question '+(i+1)); info.addContent(rights); } } From 8f85d4a5a7cdda182afead0298270c7d3a17cfb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20J=C3=B8rgensen?= Date: Tue, 7 Oct 2014 11:37:03 +0200 Subject: [PATCH 07/12] Removed some nn-text from the nb-translation --- language/nb.json | 2 +- library.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/language/nb.json b/language/nb.json index f679ee7..7ebfb34 100644 --- a/language/nb.json +++ b/language/nb.json @@ -75,7 +75,7 @@ { "label": "Fremdriftstekst", "description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total", - "default": "Deloppgåve @current av @total" + "default": "Deloppgave @current av @total" } ] }, diff --git a/library.json b/library.json index 8245144..dc7a52a 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 0, - "patchVersion": 53, + "patchVersion": 54, "runnable": 1, "fullscreen": 0, "machineName": "H5P.QuestionSet", From aa4c1d103586431c964d027bd25b1b6813d57097 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 8 Oct 2014 14:53:43 +0200 Subject: [PATCH 08/12] Moved introduction in semantics. --- language/nb.json | 48 ++++++++++----------- language/nn.json | 48 ++++++++++----------- semantics.json | 108 +++++++++++++++++++++++------------------------ 3 files changed, 102 insertions(+), 102 deletions(-) diff --git a/language/nb.json b/language/nb.json index f679ee7..c5f9772 100644 --- a/language/nb.json +++ b/language/nb.json @@ -1,5 +1,29 @@ { "semantics": [ + { + "label": "Introduksjon", + "fields": [ + { + "label": "Vis introduksjon" + }, + { + "label": "Tittel", + "description": "Tittel for intoduksjonssiden." + }, + { + "label": "Introduksjonstekst", + "description": "Denne teksten vises før spørsmålssettet starter." + }, + { + "label": "Tekst til \"Start\" knappen", + "default": "Start" + }, + { + "label": "Bakgrunnsbilde", + "description": "Bakgrunnsbilde for introduksjonssiden" + } + ] + }, { "label": "Bakgrunnsbilde", "description": "Bakgrunnsbilde for spørsmålssettet(ikke obligatorisk)." @@ -33,30 +57,6 @@ ] } }, - { - "label": "Introduksjon", - "fields": [ - { - "label": "Vis introduksjon" - }, - { - "label": "Tittel", - "description": "Tittel for intoduksjonssiden." - }, - { - "label": "Introduksjonstekst", - "description": "Denne teksten vises før spørsmålssettet starter." - }, - { - "label": "Tekst til \"Start\" knappen", - "default": "Start" - }, - { - "label": "Bakgrunnsbilde", - "description": "Bakgrunnsbilde for introduksjonssiden" - } - ] - }, { "label": "Ledetekster", "fields": [ diff --git a/language/nn.json b/language/nn.json index 9a558c7..e14190f 100644 --- a/language/nn.json +++ b/language/nn.json @@ -1,5 +1,29 @@ { "semantics": [ + { + "label": "Introduksjon", + "fields": [ + { + "label": "Vis introduksjon" + }, + { + "label": "Tittel", + "description": "Tittel for intoduksjonssiden." + }, + { + "label": "Introduksjonstekst", + "description": "Denne teksten vises før spørsmålssettet starter." + }, + { + "label": "Tekst til \"Start\" knappen", + "default": "Start" + }, + { + "label": "Bakgrunnsbilde", + "description": "Bakgrunnsbilde for introduksjonssiden" + } + ] + }, { "label": "Bakgrunnsbilde", "description": "Bakgrunnsbilde for spørsmålssettet(ikke obligatorisk)." @@ -33,30 +57,6 @@ ] } }, - { - "label": "Introduksjon", - "fields": [ - { - "label": "Vis introduksjon" - }, - { - "label": "Tittel", - "description": "Tittel for intoduksjonssiden." - }, - { - "label": "Introduksjonstekst", - "description": "Denne teksten vises før spørsmålssettet starter." - }, - { - "label": "Tekst til \"Start\" knappen", - "default": "Start" - }, - { - "label": "Bakgrunnsbilde", - "description": "Bakgrunnsbilde for introduksjonssiden" - } - ] - }, { "label": "Ledetekster", "fields": [ diff --git a/semantics.json b/semantics.json index 21583b4..7e061cc 100644 --- a/semantics.json +++ b/semantics.json @@ -1,57 +1,4 @@ [ - { - "name": "backgroundImage", - "type": "image", - "label": "Background image", - "optional": true, - "description": "An optional background image for the Question set." - }, - { - "name": "progressType", - "type": "select", - "label": "Progress indicator", - "description": "Question set progress indicator style.", - "options": [ - { - "value": "textual", - "label": "Textual" - }, - { - "value": "dots", - "label": "Dots" - } - ], - "default": "dots" - }, - { - "name": "passPercentage", - "type": "number", - "label": "Pass percentage", - "description": "Percentage of Total score required for passing the quiz.", - "min": 0, - "max": 100, - "step": 1, - "default": 50 - }, - { - "name": "questions", - "label": "Questions", - "type": "list", - "widget": "verticalTabs", - "min": 1, - "entity": "question", - "field": { - "name": "question", - "type": "library", - "label": "Question type", - "description": "Library for this question.", - "options": [ - "H5P.MultiChoice 1.0", - "H5P.DragQuestion 1.0", - "H5P.Blanks 1.0" - ] - } - }, { "name": "introPage", "type": "group", @@ -107,6 +54,59 @@ } ] }, + { + "name": "backgroundImage", + "type": "image", + "label": "Background image", + "optional": true, + "description": "An optional background image for the Question set." + }, + { + "name": "progressType", + "type": "select", + "label": "Progress indicator", + "description": "Question set progress indicator style.", + "options": [ + { + "value": "textual", + "label": "Textual" + }, + { + "value": "dots", + "label": "Dots" + } + ], + "default": "dots" + }, + { + "name": "passPercentage", + "type": "number", + "label": "Pass percentage", + "description": "Percentage of Total score required for passing the quiz.", + "min": 0, + "max": 100, + "step": 1, + "default": 50 + }, + { + "name": "questions", + "label": "Questions", + "type": "list", + "widget": "verticalTabs", + "min": 1, + "entity": "question", + "field": { + "name": "question", + "type": "library", + "label": "Question type", + "description": "Library for this question.", + "options": [ + "H5P.MultiChoice 1.0", + "H5P.DragQuestion 1.0", + "H5P.Blanks 1.0" + ] + } + }, { "name": "texts", "type": "group", @@ -278,4 +278,4 @@ } ] } -] \ No newline at end of file +] From a0a94d7b19def19fa6272232611015ad027239ee Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 8 Oct 2014 14:55:24 +0200 Subject: [PATCH 09/12] Up --- library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.json b/library.json index dc7a52a..a172167 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 0, - "patchVersion": 54, + "patchVersion": 55, "runnable": 1, "fullscreen": 0, "machineName": "H5P.QuestionSet", From 1ebb38b88bcc63dfe17a63d5fddd92f6f93bd66a Mon Sep 17 00:00:00 2001 From: Magnus Vik Magnussen Date: Thu, 9 Oct 2014 14:37:54 +0200 Subject: [PATCH 10/12] test commit: moved feedback arrow 1px to the right --- .gitignore | 1 + css/questionset.css | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b25c15b..e266972 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *~ +/nbproject/private/ \ No newline at end of file diff --git a/css/questionset.css b/css/questionset.css index 693b60f..bf83c08 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -247,7 +247,7 @@ content: ""; font-size: 5em; position: absolute; - left: -15px; + left: -14px; top: 36px; height: 0; width: 0; From a4f7bb1b96923665f54ef58ff285455eb1a0600e Mon Sep 17 00:00:00 2001 From: Magnus Vik Magnussen Date: Tue, 21 Oct 2014 15:10:49 +0200 Subject: [PATCH 11/12] modified position of arrow icons on next/prev buttons --- css/questionset.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/css/questionset.css b/css/questionset.css index bf83c08..1d3dec7 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -96,14 +96,14 @@ } .qs-footer .button, .qs-startbutton, .qs-finishbutton, .questionset-results .button, .video-container > .button { display: inline-block; - padding: 0.2em 1em; + padding: 0 0.7em; border: 0.2em solid #fff; border-radius: 0.4em; margin: 0 0.5em 1em; cursor: pointer; color: #ffffff; box-shadow: 0 0 0.5em #999; - + line-height: 1.9em; background: rgb(100,152,254); /* Old browsers */ background: -moz-linear-gradient(top, rgba(100,152,254,1) 0%, rgba(4,104,206,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(100,152,254,1)), color-stop(100%,rgba(4,104,206,1))); /* Chrome,Safari4+ */ @@ -116,7 +116,7 @@ text-decoration: none; box-shadow: 0 0 0.5em #999; color: #ffffff; - + border-color: #fff; background: rgb(4,104,206); /* Old browsers */ background: -moz-linear-gradient(top, rgba(4,104,206,1) 0%, rgba(100,152,254,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(4,104,206,1)), color-stop(100%,rgba(100,152,254,1))); /* Chrome,Safari4+ */ @@ -139,12 +139,12 @@ .qs-footer a.next.button:after { font-family: 'H5PFontAwesome4'; - content: " \f054"; /* TODO: Use margin not whitespace, spacing is not content! */ + content: "\f054"; /* TODO: Use margin not whitespace, spacing is not content! */ } .qs-footer a.prev.button:before { font-family: 'H5PFontAwesome4'; - content: "\f053 "; + content: "\f053"; } .questionset-results .qs-finishbutton { From 917a2d14990da7f97a0625d2662ef96079ae199c Mon Sep 17 00:00:00 2001 From: Magnus Vik Magnussen Date: Tue, 21 Oct 2014 15:20:31 +0200 Subject: [PATCH 12/12] modified color of progress dots --- css/questionset.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css/questionset.css b/css/questionset.css index 1d3dec7..52eb139 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -53,10 +53,10 @@ box-shadow: 0 0 0.5em #c7c7c7; } .progress-dot.answered { - background: #bccade; + background: #73a2d5; } .progress-dot.current { - background: #267ec9; + background: #285585; } .intro-page .title {