From cffdb198d583b3bb27dd149b3011d87a6f674cda Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 15 Apr 2016 12:45:16 +0200 Subject: [PATCH 1/7] Bumped patch --- library.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index 158341f..a831a73 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "description": "See how many cards you can remember!", "majorVersion": 1, "minorVersion": 1, - "patchVersion": 6, + "patchVersion": 8, "runnable": 1, "author": "Amendor AS", "license": "MIT", @@ -30,4 +30,4 @@ "path": "popup.js" } ] -} \ No newline at end of file +} From 3b79752b86aee9602fe81302ae9c0938a52b64cd Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Thu, 19 May 2016 09:40:22 +0200 Subject: [PATCH 2/7] Validate memory card params before use HFJ-1914 --- card.js | 13 +++++++++++++ memory-game.js | 12 +++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/card.js b/card.js index 0c0a608..dca1639 100644 --- a/card.js +++ b/card.js @@ -99,4 +99,17 @@ MemoryGame.Card.prototype = Object.create(EventDispatcher.prototype); MemoryGame.Card.prototype.constructor = MemoryGame.Card; + /** + * Check to see if the given object corresponds with the semantics for + * a memory game card. + * + * @param {object} params + * @returns {boolean} + */ + MemoryGame.Card.isValid = function (params) { + return (params !== undefined && + params.image !== undefined && + params.image.path !== undefined); + }; + })(H5P.MemoryGame, H5P.EventDispatcher, H5P.jQuery); diff --git a/memory-game.js b/memory-game.js index 98166b8..0f92b5e 100644 --- a/memory-game.js +++ b/memory-game.js @@ -101,11 +101,13 @@ H5P.MemoryGame = (function (EventDispatcher, $) { // Initialize cards. for (var i = 0; i < parameters.cards.length; i++) { - // Add two of each card - var cardOne = new MemoryGame.Card(parameters.cards[i], id); - var cardTwo = new MemoryGame.Card(parameters.cards[i], id); - addCard(cardOne, cardTwo); - addCard(cardTwo, cardOne); + if (MemoryGame.Card.isValid(parameters.cards[i])) { + // Add two of each card + var cardOne = new MemoryGame.Card(parameters.cards[i], id); + var cardTwo = new MemoryGame.Card(parameters.cards[i], id); + addCard(cardOne, cardTwo); + addCard(cardTwo, cardOne); + } } H5P.shuffleArray(cards); From c6b8ad44e4c2e8a938da19bcb933d39851cf8c0f Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Thu, 26 May 2016 14:07:14 +0200 Subject: [PATCH 3/7] Don't require that the user removes the final description to trigger completed https://www.drupal.org/node/2730223 --- memory-game.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/memory-game.js b/memory-game.js index 98166b8..6ca5e48 100644 --- a/memory-game.js +++ b/memory-game.js @@ -36,12 +36,15 @@ H5P.MemoryGame = (function (EventDispatcher, $) { var finished = (removed === cards.length); var desc = card.getDescription(); + if (finished) { + self.triggerXAPIScored(1, 1, 'completed'); + } + if (desc !== undefined) { // Pause timer and show desciption. timer.stop(); popup.show(desc, card.getImage(), function () { if (finished) { - self.triggerXAPIScored(1, 1, 'completed'); // Game has finished $feedback.addClass('h5p-show'); } @@ -52,7 +55,6 @@ H5P.MemoryGame = (function (EventDispatcher, $) { }); } else if (finished) { - self.triggerXAPIScored(1, 1, 'completed'); // Game has finished timer.stop(); $feedback.addClass('h5p-show'); From 212219e3fcd0a3a81027a7dd650eb123bea90641 Mon Sep 17 00:00:00 2001 From: isa-realia Date: Mon, 4 Jul 2016 19:14:13 +0200 Subject: [PATCH 4/7] Updated fr.json - translated new strings to french and / or modified some translations - added default strings and translated them to french --- language/fr.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/language/fr.json b/language/fr.json index 96828bb..e00969e 100644 --- a/language/fr.json +++ b/language/fr.json @@ -2,7 +2,7 @@ "semantics": [ { "label": "Cartes", - "entity": "une carte", + "entity": "carte", "field": { "label": "Carte", "fields": [ @@ -17,19 +17,19 @@ } }, { - "label": "Localisation", + "label": "Interface", "fields": [ { - "label": "Texte pour une carte à retourner", - "default": "Retourner" + "label": "Texte pour le nombre de cartes retournées", + "default": "Cartes retournées :" }, { "label": "Texte pour le temps passé", - "default": "Durée écoulée" + "default": "Temps écoulé :" }, { - "label": "Texte de feedback", - "default": "Bon travail!" + "label": "Texte de l'appréciation finale", + "default": "Bien joué !" } ] } From ee3a4d2c4a3dcf8c5702a7169c3a50d97d9a63e9 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 29 Jul 2016 14:38:03 +0200 Subject: [PATCH 5/7] Bumped patch version --- library.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index a831a73..38bfd60 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "description": "See how many cards you can remember!", "majorVersion": 1, "minorVersion": 1, - "patchVersion": 8, + "patchVersion": 9, "runnable": 1, "author": "Amendor AS", "license": "MIT", @@ -30,4 +30,4 @@ "path": "popup.js" } ] -} +} \ No newline at end of file From 953dbab15e913f89220ecac8df8f79b03e1b97e4 Mon Sep 17 00:00:00 2001 From: thomasmars Date: Fri, 14 Oct 2016 13:59:21 +0200 Subject: [PATCH 6/7] Added norwegian translation HFP-67 --- language/nb.json | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 language/nb.json diff --git a/language/nb.json b/language/nb.json new file mode 100644 index 0000000..b56939a --- /dev/null +++ b/language/nb.json @@ -0,0 +1,50 @@ +{ + "semantics": [ + { + "englishLabel": "Cards", + "label": "Kort", + "englishEntity": "card", + "entity": "kort", + "field": { + "englishLabel": "Card", + "label": "Kort", + "fields": [ + { + "englishLabel": "Image", + "label": "Bilde" + }, + { + "englishLabel": "Description", + "label": "Beskrivelse", + "englishDescription": "A short text that is displayed once the two equal cards are found.", + "description": "En kort tekst som vises hver gang et kort-par er funnet." + } + ] + } + }, + { + "englishLabel": "Localization", + "label": "Oversettelser", + "fields": [ + { + "englishLabel": "Card turns text", + "label": "Etikett for antall vendte kort", + "englishDefault": "Card turns", + "default": "Kort vendt" + }, + { + "englishLabel": "Time spent text", + "label": "Etikett for tid brukt", + "englishDefault": "Time spent", + "default": "Tid brukt" + }, + { + "englishLabel": "Feedback text", + "label": "Tilbakemeldingstekst", + "englishDefault": "Good work!", + "default": "Godt jobbet!" + } + ] + } + ] +} From 05d71ee3d49492a1e9f037f0f76e31893d8d3ccc Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Tue, 25 Oct 2016 19:41:16 +0200 Subject: [PATCH 7/7] Bumping for release --- library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.json b/library.json index 38bfd60..e11093b 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "description": "See how many cards you can remember!", "majorVersion": 1, "minorVersion": 1, - "patchVersion": 9, + "patchVersion": 10, "runnable": 1, "author": "Amendor AS", "license": "MIT",