diff --git a/src/activities/memory-enumerate/ActivityInfo.qml b/src/activities/memory-enumerate/ActivityInfo.qml index 8613bc4cb..d073cdc04 100644 --- a/src/activities/memory-enumerate/ActivityInfo.qml +++ b/src/activities/memory-enumerate/ActivityInfo.qml @@ -1,40 +1,40 @@ /* GCompris - ActivityInfo.qml * * Copyright (C) 2015 Bruno Coudoin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import GCompris 1.0 ActivityInfo { name: "memory-enumerate/MemoryEnumerate.qml" difficulty: 2 icon: "memory-enumerate/memory-enumerate.svg" author: "Bruno Coudoin <bruno.coudoin@gcompris.net>" //: Activity title title: qsTr("Enumeration memory game") //: Help title description: qsTr("Turn the cards over to match the number with the drawn picture.") // intro: "Match a number card with a card displaying the same number of butterflies." //: Help goal goal: qsTr("Numeration training, memory.") //: Help prerequisite prerequisite: "" //: Help manual manual: qsTr("You can see some cards, but you can't see what's on the other side of them. Each card is hiding a number of pictures, or the written number.") credit: "" section: "math numeration" createdInVersion: 0 - levels: "1" + levels: "1,2,3,4,5,6,7,8" } diff --git a/src/activities/memory-enumerate/dataset.js b/src/activities/memory-enumerate/dataset.js deleted file mode 100644 index 42437fd0e..000000000 --- a/src/activities/memory-enumerate/dataset.js +++ /dev/null @@ -1,122 +0,0 @@ -/* GCompris - * - * Copyright (C) 2014 Bruno Coudoin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -.import GCompris 1.0 as GCompris //for ApplicationInfo - -var url = "qrc:/gcompris/src/activities/memory-enumerate/resource/" - -var texts = [ - ["", 0], - ["", 1], - ["", 2], - ["", 3], - ["", 4], - ["", 5], - ["", 6], - ["", 7], - ["", 8], - ["", 9] - ] - -var images = [ - [url + 'math_0.svg', ''], - [url + 'math_1.svg', ''], - [url + 'math_2.svg', ''], - [url + 'math_3.svg', ''], - [url + 'math_4.svg', ''], - [url + 'math_5.svg', ''], - [url + 'math_6.svg', ''], - [url + 'math_7.svg', ''], - [url + 'math_8.svg', ''], - [url + 'math_9.svg', ''] - ] - -var sounds = [ - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0030.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0031.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0032.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0033.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0034.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0035.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0036.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0037.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0038.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0039.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/10.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/11.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/12.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/13.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/14.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/15.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/16.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/17.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/18.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/19.$CA")], - ["", - GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/20.$CA")] - ] - - -var memory_cards = [ - { // Level 1 - columns: 3, - rows: 2, - texts: texts.slice(0, 6), - images: images.slice(0, 6), - sounds: sounds.slice(0, 6) - }, - { // Level 2 - columns: 3, - rows: 2, - texts: texts.slice(4, 10), - images: images.slice(4, 10), - sounds: sounds.slice(4, 10) - }, - { // Level 3 - columns: 5, - rows: 2, - texts: texts.slice(0, 10), - images: images.slice(0, 10), - sounds: sounds.slice(0, 10) - } - ] - - -function get() { - return memory_cards -} diff --git a/src/activities/memory-enumerate/resource/1/Data.qml b/src/activities/memory-enumerate/resource/1/Data.qml index 9dc2da141..fd83658f8 100644 --- a/src/activities/memory-enumerate/resource/1/Data.qml +++ b/src/activities/memory-enumerate/resource/1/Data.qml @@ -1,61 +1,61 @@ /* GCompris - Data.qml * * Copyright (C) 2020 Deepak Kumar * * Authors: * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import GCompris 1.0 import GCompris 1.0 as GCompris Data { objective: qsTr("Match the numbers up to 2.") difficulty: 1 property var url: "qrc:/gcompris/src/activities/memory-enumerate/resource/" property var texts: [ ["", 0], ["", 1], ["", 2], ] property var images: [ [url + 'math_0.svg', ''], [url + 'math_1.svg', ''], [url + 'math_2.svg', ''], ] property var sounds: [ ["", GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0030.$CA")], ["", GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0031.$CA")], ["", GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0032.$CA")] ] data: [ { // Level 1 - "columns": 2, + "columns": 1, "rows": 2, "texts": texts.slice(0, 3), "images": images.slice(0, 3), "sounds": sounds.slice(0, 3) } ] } diff --git a/src/activities/memory-enumerate/resource/2/Data.qml b/src/activities/memory-enumerate/resource/2/Data.qml index f36b3ba04..4500e821f 100644 --- a/src/activities/memory-enumerate/resource/2/Data.qml +++ b/src/activities/memory-enumerate/resource/2/Data.qml @@ -1,48 +1,65 @@ /* GCompris - Data.qml * - * Copyright (C) 2018 Johnny Jazeix + * Copyright (C) 2020 Deepak Kumar * * Authors: - * Johnny Jazeix + * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ + import GCompris 1.0 +import GCompris 1.0 as GCompris Data { - objective: qsTr("Numbers between 1 and 8") + objective: qsTr("Match the numbers up to 3.") difficulty: 1 + + property var url: "qrc:/gcompris/src/activities/memory-enumerate/resource/" + + property var texts: [ + ["", 0], + ["", 1], + ["", 2], + ["", 3] + ] + + property var images: [ + [url + 'math_0.svg', ''], + [url + 'math_1.svg', ''], + [url + 'math_2.svg', ''], + [url + 'math_3.svg', ''] + ] + + property var sounds: [ + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0030.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0031.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0032.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0033.$CA")] + ] + data: [ - { - "minNumber": 1, - "maxNumber": 1, /* Max number on each domino side */ - "numberOfFish": 3 - }, - { - "minNumber": 1, - "maxNumber": 2, - "numberOfFish": 4 - }, - { - "minNumber": 1, - "maxNumber": 3, - "numberOfFish": 5 - }, - { - "minNumber": 1, - "maxNumber": 4, - "numberOfFish": 5 - } + { // Level 1 + "columns": 2, + "rows": 2, + "texts": texts.slice(0, 4), + "images": images.slice(0, 4), + "sounds": sounds.slice(0, 4) + } ] } diff --git a/src/activities/memory-enumerate/resource/3/Data.qml b/src/activities/memory-enumerate/resource/3/Data.qml index f36b3ba04..26974b9f4 100644 --- a/src/activities/memory-enumerate/resource/3/Data.qml +++ b/src/activities/memory-enumerate/resource/3/Data.qml @@ -1,48 +1,69 @@ /* GCompris - Data.qml * - * Copyright (C) 2018 Johnny Jazeix + * Copyright (C) 2020 Deepak Kumar * * Authors: - * Johnny Jazeix + * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ + import GCompris 1.0 +import GCompris 1.0 as GCompris Data { - objective: qsTr("Numbers between 1 and 8") + objective: qsTr("Match the numbers up to 4.") difficulty: 1 + + property var url: "qrc:/gcompris/src/activities/memory-enumerate/resource/" + + property var texts: [ + ["", 0], + ["", 1], + ["", 2], + ["", 3], + ["", 4] + ] + + property var images: [ + [url + 'math_0.svg', ''], + [url + 'math_1.svg', ''], + [url + 'math_2.svg', ''], + [url + 'math_3.svg', ''], + [url + 'math_4.svg', ''] + ] + + property var sounds: [ + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0030.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0031.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0032.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0033.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0034.$CA")], + ] + data: [ - { - "minNumber": 1, - "maxNumber": 1, /* Max number on each domino side */ - "numberOfFish": 3 - }, - { - "minNumber": 1, - "maxNumber": 2, - "numberOfFish": 4 - }, - { - "minNumber": 1, - "maxNumber": 3, - "numberOfFish": 5 - }, - { - "minNumber": 1, - "maxNumber": 4, - "numberOfFish": 5 - } + { // Level 1 + "columns": 2, + "rows": 2, + "texts": texts.slice(0, 5), + "images": images.slice(0, 5), + "sounds": sounds.slice(0, 5) + } ] } diff --git a/src/activities/memory-enumerate/resource/4/Data.qml b/src/activities/memory-enumerate/resource/4/Data.qml index f36b3ba04..25926f9ae 100644 --- a/src/activities/memory-enumerate/resource/4/Data.qml +++ b/src/activities/memory-enumerate/resource/4/Data.qml @@ -1,48 +1,73 @@ /* GCompris - Data.qml * - * Copyright (C) 2018 Johnny Jazeix + * Copyright (C) 2020 Deepak Kumar * * Authors: - * Johnny Jazeix + * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ + import GCompris 1.0 +import GCompris 1.0 as GCompris Data { - objective: qsTr("Numbers between 1 and 8") - difficulty: 1 + objective: qsTr("Match the numbers up to 5.") + difficulty: 2 + + property var url: "qrc:/gcompris/src/activities/memory-enumerate/resource/" + + property var texts: [ + ["", 0], + ["", 1], + ["", 2], + ["", 3], + ["", 4], + ["", 5] + ] + + property var images: [ + [url + 'math_0.svg', ''], + [url + 'math_1.svg', ''], + [url + 'math_2.svg', ''], + [url + 'math_3.svg', ''], + [url + 'math_4.svg', ''], + [url + 'math_5.svg', ''], + ] + + property var sounds: [ + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0030.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0031.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0032.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0033.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0034.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0035.$CA")] + ] + data: [ - { - "minNumber": 1, - "maxNumber": 1, /* Max number on each domino side */ - "numberOfFish": 3 - }, - { - "minNumber": 1, - "maxNumber": 2, - "numberOfFish": 4 - }, - { - "minNumber": 1, - "maxNumber": 3, - "numberOfFish": 5 - }, - { - "minNumber": 1, - "maxNumber": 4, - "numberOfFish": 5 - } + { // Level 1 + "columns": 3, + "rows": 2, + "texts": texts.slice(0, 6), + "images": images.slice(0, 6), + "sounds": sounds.slice(0, 6) + } ] } diff --git a/src/activities/memory-enumerate/resource/5/Data.qml b/src/activities/memory-enumerate/resource/5/Data.qml index f36b3ba04..5cdbff0bc 100644 --- a/src/activities/memory-enumerate/resource/5/Data.qml +++ b/src/activities/memory-enumerate/resource/5/Data.qml @@ -1,48 +1,79 @@ /* GCompris - Data.qml * - * Copyright (C) 2018 Johnny Jazeix + * Copyright (C) 2020 Deepak Kumar * * Authors: - * Johnny Jazeix + * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ + import GCompris 1.0 +import GCompris 1.0 as GCompris Data { - objective: qsTr("Numbers between 1 and 8") - difficulty: 1 + objective: qsTr("Match the numbers up to 6.") + difficulty: 3 + + property var url: "qrc:/gcompris/src/activities/memory-enumerate/resource/" + + property var texts: [ + ["", 0], + ["", 1], + ["", 2], + ["", 3], + ["", 4], + ["", 5], + ["", 6], + + ] + + property var images: [ + [url + 'math_0.svg', ''], + [url + 'math_1.svg', ''], + [url + 'math_2.svg', ''], + [url + 'math_3.svg', ''], + [url + 'math_4.svg', ''], + [url + 'math_5.svg', ''], + [url + 'math_6.svg', ''], + + ] + + property var sounds: [ + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0030.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0031.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0032.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0033.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0034.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0035.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0036.$CA")] + ] + data: [ - { - "minNumber": 1, - "maxNumber": 1, /* Max number on each domino side */ - "numberOfFish": 3 - }, - { - "minNumber": 1, - "maxNumber": 2, - "numberOfFish": 4 - }, - { - "minNumber": 1, - "maxNumber": 3, - "numberOfFish": 5 - }, - { - "minNumber": 1, - "maxNumber": 4, - "numberOfFish": 5 - } + { // Level 1 + "columns": 3, + "rows": 2, + "texts": texts.slice(0, 7), + "images": images.slice(0, 7), + "sounds": sounds.slice(0, 7) + } ] } diff --git a/src/activities/memory-enumerate/resource/6/Data.qml b/src/activities/memory-enumerate/resource/6/Data.qml index f36b3ba04..8078c7135 100644 --- a/src/activities/memory-enumerate/resource/6/Data.qml +++ b/src/activities/memory-enumerate/resource/6/Data.qml @@ -1,48 +1,81 @@ /* GCompris - Data.qml * - * Copyright (C) 2018 Johnny Jazeix + * Copyright (C) 2020 Deepak Kumar * * Authors: - * Johnny Jazeix + * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ + import GCompris 1.0 +import GCompris 1.0 as GCompris Data { - objective: qsTr("Numbers between 1 and 8") - difficulty: 1 + objective: qsTr("Match the numbers up to 7.") + difficulty: 3 + + property var url: "qrc:/gcompris/src/activities/memory-enumerate/resource/" + + property var texts: [ + ["", 0], + ["", 1], + ["", 2], + ["", 3], + ["", 4], + ["", 5], + ["", 6], + ["", 7], + ] + + property var images: [ + [url + 'math_0.svg', ''], + [url + 'math_1.svg', ''], + [url + 'math_2.svg', ''], + [url + 'math_3.svg', ''], + [url + 'math_4.svg', ''], + [url + 'math_5.svg', ''], + [url + 'math_6.svg', ''], + [url + 'math_7.svg', ''] + ] + + property var sounds: [ + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0030.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0031.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0032.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0033.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0034.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0035.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0036.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0037.$CA")] + ] + data: [ - { - "minNumber": 1, - "maxNumber": 1, /* Max number on each domino side */ - "numberOfFish": 3 - }, - { - "minNumber": 1, - "maxNumber": 2, - "numberOfFish": 4 - }, - { - "minNumber": 1, - "maxNumber": 3, - "numberOfFish": 5 - }, - { - "minNumber": 1, - "maxNumber": 4, - "numberOfFish": 5 - } + { // Level 1 + "columns": 4, + "rows": 2, + "texts": texts.slice(0, 8), + "images": images.slice(0, 8), + "sounds": sounds.slice(0, 8) + } ] } diff --git a/src/activities/memory-enumerate/resource/7/Data.qml b/src/activities/memory-enumerate/resource/7/Data.qml index f36b3ba04..cd4de4287 100644 --- a/src/activities/memory-enumerate/resource/7/Data.qml +++ b/src/activities/memory-enumerate/resource/7/Data.qml @@ -1,48 +1,85 @@ /* GCompris - Data.qml * - * Copyright (C) 2018 Johnny Jazeix + * Copyright (C) 2020 Deepak Kumar * * Authors: - * Johnny Jazeix + * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ + import GCompris 1.0 +import GCompris 1.0 as GCompris Data { - objective: qsTr("Numbers between 1 and 8") - difficulty: 1 + objective: qsTr("Match the numbers up to 8.") + difficulty: 3 + + property var url: "qrc:/gcompris/src/activities/memory-enumerate/resource/" + + property var texts: [ + ["", 0], + ["", 1], + ["", 2], + ["", 3], + ["", 4], + ["", 5], + ["", 6], + ["", 7], + ["", 8] + ] + + property var images: [ + [url + 'math_0.svg', ''], + [url + 'math_1.svg', ''], + [url + 'math_2.svg', ''], + [url + 'math_3.svg', ''], + [url + 'math_4.svg', ''], + [url + 'math_5.svg', ''], + [url + 'math_6.svg', ''], + [url + 'math_7.svg', ''], + [url + 'math_8.svg', ''], + ] + + property var sounds: [ + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0030.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0031.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0032.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0033.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0034.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0035.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0036.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0037.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0038.$CA")] + ] + data: [ - { - "minNumber": 1, - "maxNumber": 1, /* Max number on each domino side */ - "numberOfFish": 3 - }, - { - "minNumber": 1, - "maxNumber": 2, - "numberOfFish": 4 - }, - { - "minNumber": 1, - "maxNumber": 3, - "numberOfFish": 5 - }, - { - "minNumber": 1, - "maxNumber": 4, - "numberOfFish": 5 - } + { // Level 1 + "columns": 4, + "rows": 2, + "texts": texts.slice(0, 9), + "images": images.slice(0, 9), + "sounds": sounds.slice(0, 9) + } ] } diff --git a/src/activities/memory-enumerate/resource/8/Data.qml b/src/activities/memory-enumerate/resource/8/Data.qml index f36b3ba04..dbc978ce9 100644 --- a/src/activities/memory-enumerate/resource/8/Data.qml +++ b/src/activities/memory-enumerate/resource/8/Data.qml @@ -1,48 +1,89 @@ /* GCompris - Data.qml * - * Copyright (C) 2018 Johnny Jazeix + * Copyright (C) 2020 Deepak Kumar * * Authors: - * Johnny Jazeix + * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ + import GCompris 1.0 +import GCompris 1.0 as GCompris Data { - objective: qsTr("Numbers between 1 and 8") - difficulty: 1 + objective: qsTr("Match the numbers up to 9.") + difficulty: 3 + + property var url: "qrc:/gcompris/src/activities/memory-enumerate/resource/" + + property var texts: [ + ["", 0], + ["", 1], + ["", 2], + ["", 3], + ["", 4], + ["", 5], + ["", 6], + ["", 7], + ["", 8], + ["", 9] + ] + + property var images: [ + [url + 'math_0.svg', ''], + [url + 'math_1.svg', ''], + [url + 'math_2.svg', ''], + [url + 'math_3.svg', ''], + [url + 'math_4.svg', ''], + [url + 'math_5.svg', ''], + [url + 'math_6.svg', ''], + [url + 'math_7.svg', ''], + [url + 'math_8.svg', ''], + [url + 'math_9.svg', ''] + ] + + property var sounds: [ + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0030.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0031.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0032.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0033.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0034.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0035.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0036.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0037.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0038.$CA")], + ["", + GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0039.$CA")], + ] + data: [ - { - "minNumber": 1, - "maxNumber": 1, /* Max number on each domino side */ - "numberOfFish": 3 - }, - { - "minNumber": 1, - "maxNumber": 2, - "numberOfFish": 4 - }, - { - "minNumber": 1, - "maxNumber": 3, - "numberOfFish": 5 - }, - { - "minNumber": 1, - "maxNumber": 4, - "numberOfFish": 5 - } + { // Level 1 + "columns": 5, + "rows": 2, + "texts": texts.slice(0, 10), + "images": images.slice(0, 10), + "sounds": sounds.slice(0, 10) + } ] } diff --git a/src/activities/memory/MemoryCommon.qml b/src/activities/memory/MemoryCommon.qml index 103363507..995c3253a 100644 --- a/src/activities/memory/MemoryCommon.qml +++ b/src/activities/memory/MemoryCommon.qml @@ -1,270 +1,270 @@ /* GCompris - MemoryCommon.qml * * Copyright (C) 2014 JB BUTET * * Authors: * Bruno Coudoin (GTK+ version) * JB BUTET (Qt Quick port) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "." import "../../core" import "memory.js" as Activity ActivityBase { id: activity focus: true property string backgroundImg property var dataset property bool withTux: false onStart: focus = true onStop: {} pageComponent: Image { id: background source: activity.backgroundImg sourceSize.width: Math.max(parent.width, parent.height) fillMode: Image.PreserveAspectCrop focus: true signal start signal stop property alias items: items property bool keyNavigationVisible: false Component.onCompleted: { dialogActivityConfig.initialize() activity.start.connect(start) activity.stop.connect(stop) } QtObject { id: items property alias bar: bar property alias bonus: bonus property GCSfx audioEffects: activity.audioEffects property bool withTux: activity.withTux property bool tuxTurn: false property var playQueue property int selectionCount property int tuxScore: tuxScore.text property int playerScore: playerScore.text - property var levels: activity.datasetLoader.data !== 0 ? activity.datasetLoader.data : activity.dataset + property var levels: activity.datasetLoader.data != 0 ? activity.datasetLoader.data : activity.dataset property alias containerModel: containerModel property alias grid: grid property bool blockClicks: false property int columns property int rows property int spacing: 5 * ApplicationInfo.ratio } onStart: Activity.start(items) onStop: Activity.stop() ListModel { id: containerModel } GridView { id: grid width: background.width - (items.columns + 1) * items.spacing - anchors.margins height: background.height - (items.rows + 1) * items.spacing - anchors.margins cellWidth: (background.width - (items.columns + 1) * items.spacing) / items.columns - anchors.margins cellHeight: (background.height - (items.rows + 1) * items.spacing) / (items.rows + 0.5) - anchors.margins anchors { left: background.left right: background.right top: background.top bottom: background.bottom margins: 5 * ApplicationInfo.ratio } model: containerModel function getItemAtIndex(i) { var xi = (i % items.columns) * cellWidth + anchors.margins var yi = (i / items.columns) * cellHeight + anchors.margins return itemAt(xi, yi) } delegate: CardItem { pairData: pairData_ tuxTurn: background.items.tuxTurn width: (background.width - (items.columns + 1) * items.spacing) / items.columns - 15 * ApplicationInfo.ratio height: (background.height - (items.rows + 1) * items.spacing) / (items.rows + 0.5) - 15 * ApplicationInfo.ratio audioVoices: activity.audioVoices audioEffects: activity.audioEffects onIsFoundChanged: background.keyNavigationVisible = false } interactive: false keyNavigationWraps: true highlightFollowsCurrentItem: true highlight: Rectangle { color: "#AAFFFFFF" radius: 10 visible: background.keyNavigationVisible Behavior on x { SpringAnimation { spring: 2; damping: 0.2 } } Behavior on y { SpringAnimation { spring: 2; damping: 0.2 } } } add: Transition { PathAnimation { path: Path { PathCurve { x: background.width / 3} PathCurve { y: background.height / 3} PathCurve {} } easing.type: Easing.InOutQuad duration: 2000 } } } DialogHelp { id: dialogHelp onClose: home() } DialogChooseLevel { id: dialogActivityConfig currentActivity: activity.activityInfo onSaveData: { - levelFolder = dialogActivityConfig.chosenLevel - currentActivity.currentLevel = dialogActivityConfig.chosenLevel - ApplicationSettings.setCurrentLevel(currentActivity.name, dialogActivityConfig.chosenLevel) - home() + levelFolder = dialogActivityConfig.chosenLevels + currentActivity.currentLevels = dialogActivityConfig.chosenLevels + ApplicationSettings.setCurrentLevels(currentActivity.name, dialogActivityConfig.chosenLevels) } onClose: { home() } onStartActivity: { + background.stop() background.start() } } Bar { id: bar content: BarEnumContent { value: help | home | level | activityConfig } onHelpClicked: { displayDialog(dialogHelp) } onPreviousLevelClicked: Activity.previousLevel() onActivityConfigClicked: { displayDialog(dialogActivityConfig) } onNextLevelClicked: Activity.nextLevel() onHomeClicked: home() } Image { id: player source: 'qrc:/gcompris/src/activities/memory/resource/children.svg' anchors { bottom: bar.bottom right: parent.right rightMargin: 2 * ApplicationInfo.ratio } width: height * 0.83 height: bar.height * 1.2 GCText { id: playerScore anchors.centerIn: parent anchors.verticalCenterOffset: parent.height / 6 color: "black" font.bold: true fontSize: largeSize style: Text.Outline styleColor: "white" text: items.playerScore } } Image { id: tux visible: activity.withTux source: 'qrc:/gcompris/src/activities/memory/resource/tux-teacher.svg' anchors { bottom: bar.bottom right: player.left rightMargin: 2 * ApplicationInfo.ratio } width: height * 0.83 height: bar.height * 1.2 GCText { id: tuxScore anchors.centerIn: parent anchors.verticalCenterOffset: parent.height / 6 color: "black" font.bold: true fontSize: largeSize style: Text.Outline styleColor: "white" text: items.tuxScore } } Bonus { id: bonus interval: 2000 Component.onCompleted: win.connect(Activity.nextLevel) } Keys.enabled: !items.blockClicks Keys.onPressed: { background.keyNavigationVisible = true if(event.key === Qt.Key_Left) { grid.moveCurrentIndexLeft() // skip the highlight on the already found cards while(grid.currentItem.isFound && !items.blockClicks) { grid.moveCurrentIndexLeft() } } else if(event.key === Qt.Key_Right) { grid.moveCurrentIndexRight() // skip the highlight on the already found cards while(grid.currentItem.isFound && !items.blockClicks) { grid.moveCurrentIndexRight() } } else if(event.key === Qt.Key_Up) { grid.moveCurrentIndexUp() // skip the highlight on the already found cards while(grid.currentItem.isFound && !items.blockClicks) { grid.moveCurrentIndexUp() } } else if(event.key === Qt.Key_Down) { grid.moveCurrentIndexDown() // skip the highlight on the already found cards while(grid.currentItem.isFound && !items.blockClicks) { grid.moveCurrentIndexDown() } } else if(event.key === Qt.Key_Space || event.key === Qt.Key_Enter || event.key === Qt.Key_Return) if(grid.currentItem.isBack && !grid.currentItem.isFound && !grid.currentItem.tuxTurn && items.selectionCount < 2) grid.currentItem.selected() } } }