Merge branch 'release' into stable
commit
d0f1da9e47
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"semantics": [
|
||||||
|
{
|
||||||
|
"label": "Cartes",
|
||||||
|
"entity": "une carte",
|
||||||
|
"field": {
|
||||||
|
"label": "Carte",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"label": "Image"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Description",
|
||||||
|
"description": "Petit texte affiché quand deux cartes identiques sont trouvées."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Localisation",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"label": "Texte pour une carte à retourner",
|
||||||
|
"default": "Retourner"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Texte pour le temps passé",
|
||||||
|
"default": "Durée écoulée"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Texte de feedback",
|
||||||
|
"default": "Bon travail!"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -3,7 +3,7 @@
|
||||||
"description": "See how many cards you can remember!",
|
"description": "See how many cards you can remember!",
|
||||||
"majorVersion": 1,
|
"majorVersion": 1,
|
||||||
"minorVersion": 1,
|
"minorVersion": 1,
|
||||||
"patchVersion": 4,
|
"patchVersion": 5,
|
||||||
"runnable": 1,
|
"runnable": 1,
|
||||||
"author": "Amendor AS",
|
"author": "Amendor AS",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -39,8 +39,9 @@ H5P.MemoryGame = (function (EventDispatcher, $) {
|
||||||
if (desc !== undefined) {
|
if (desc !== undefined) {
|
||||||
// Pause timer and show desciption.
|
// Pause timer and show desciption.
|
||||||
timer.stop();
|
timer.stop();
|
||||||
popup.show(desc, card.getImage(), function () {
|
popup.show(desc, card.getImage(), function () {
|
||||||
if (finished) {
|
if (finished) {
|
||||||
|
self.triggerXAPIScored(1, 1, 'completed');
|
||||||
// Game has finished
|
// Game has finished
|
||||||
$feedback.addClass('h5p-show');
|
$feedback.addClass('h5p-show');
|
||||||
}
|
}
|
||||||
|
@ -51,6 +52,7 @@ H5P.MemoryGame = (function (EventDispatcher, $) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (finished) {
|
else if (finished) {
|
||||||
|
self.triggerXAPIScored(1, 1, 'completed');
|
||||||
// Game has finished
|
// Game has finished
|
||||||
timer.stop();
|
timer.stop();
|
||||||
$feedback.addClass('h5p-show');
|
$feedback.addClass('h5p-show');
|
||||||
|
@ -72,6 +74,7 @@ H5P.MemoryGame = (function (EventDispatcher, $) {
|
||||||
*/
|
*/
|
||||||
var addCard = function (card, mate) {
|
var addCard = function (card, mate) {
|
||||||
card.on('flip', function () {
|
card.on('flip', function () {
|
||||||
|
self.triggerXAPI('interacted');
|
||||||
// Keep track of time spent
|
// Keep track of time spent
|
||||||
timer.start();
|
timer.start();
|
||||||
|
|
||||||
|
@ -112,6 +115,7 @@ H5P.MemoryGame = (function (EventDispatcher, $) {
|
||||||
* @param {H5P.jQuery} $container
|
* @param {H5P.jQuery} $container
|
||||||
*/
|
*/
|
||||||
self.attach = function ($container) {
|
self.attach = function ($container) {
|
||||||
|
this.triggerXAPI('attempted');
|
||||||
// TODO: Only create on first!
|
// TODO: Only create on first!
|
||||||
$container.addClass('h5p-memory-game').html('');
|
$container.addClass('h5p-memory-game').html('');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue