2014-09-16 14:33:14 +02:00
|
|
|
var H5PUpgrades = H5PUpgrades || {};
|
|
|
|
|
2017-10-17 16:16:46 +02:00
|
|
|
H5PUpgrades['H5P.MemoryGame'] = (function () {
|
2014-09-16 14:33:14 +02:00
|
|
|
return {
|
|
|
|
1: {
|
2017-01-23 15:46:06 +01:00
|
|
|
/**
|
|
|
|
* Asynchronous content upgrade hook.
|
|
|
|
* Upgrades content parameters to support Memory Game 1.1.
|
|
|
|
*
|
|
|
|
* Move card images into card object as this allows for additonal
|
|
|
|
* properties for each card.
|
|
|
|
*
|
|
|
|
* @params {object} parameters
|
|
|
|
* @params {function} finished
|
|
|
|
*/
|
|
|
|
1: function (parameters, finished) {
|
|
|
|
for (var i = 0; i < parameters.cards.length; i++) {
|
|
|
|
parameters.cards[i] = {
|
|
|
|
image: parameters.cards[i]
|
|
|
|
};
|
2014-09-16 14:33:14 +02:00
|
|
|
}
|
2017-01-23 15:46:06 +01:00
|
|
|
|
|
|
|
finished(null, parameters);
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Asynchronous content upgrade hook.
|
|
|
|
* Upgrades content parameters to support Memory Game 1.2.
|
|
|
|
*
|
|
|
|
* Add default behavioural settings for the new options.
|
|
|
|
*
|
|
|
|
* @params {object} parameters
|
|
|
|
* @params {function} finished
|
|
|
|
*/
|
|
|
|
2: function (parameters, finished) {
|
|
|
|
|
|
|
|
parameters.behaviour = {};
|
|
|
|
parameters.behaviour.useGrid = false;
|
|
|
|
parameters.behaviour.allowRetry = false;
|
2019-02-18 00:08:34 +01:00
|
|
|
parameters.behaviour.showTime = true;
|
|
|
|
parameters.behaviour.showTurns = true;
|
|
|
|
parameters.behaviour.showFeedback = true;
|
2017-01-23 15:46:06 +01:00
|
|
|
|
|
|
|
finished(null, parameters);
|
2014-09-16 14:33:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2017-10-17 16:16:46 +02:00
|
|
|
})();
|