diff --git a/src/activities/memory-enumerate/ActivityInfo.qml b/src/activities/memory-enumerate/ActivityInfo.qml
--- a/src/activities/memory-enumerate/ActivityInfo.qml
+++ b/src/activities/memory-enumerate/ActivityInfo.qml
@@ -36,4 +36,5 @@
credit: ""
section: "math numeration"
createdInVersion: 0
+ levels: "1,2,3,4,5,6,7,8"
}
diff --git a/src/activities/memory-enumerate/MemoryEnumerate.qml b/src/activities/memory-enumerate/MemoryEnumerate.qml
--- a/src/activities/memory-enumerate/MemoryEnumerate.qml
+++ b/src/activities/memory-enumerate/MemoryEnumerate.qml
@@ -22,9 +22,7 @@
import QtQuick 2.6
import "../memory"
-import "dataset.js" as Dataset
MemoryCommon {
- dataset: Dataset.get()
backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
}
diff --git a/src/activities/memory-enumerate/dataset.js b/src/activities/memory-enumerate/dataset.js
deleted file mode 100644
--- 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
new file mode 100644
--- /dev/null
+++ b/src/activities/memory-enumerate/resource/1/Data.qml
@@ -0,0 +1,57 @@
+/* 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 string url: "qrc:/gcompris/src/activities/memory-enumerate/resource/"
+
+ property var texts: [
+ ["", 1],
+ ["", 2]
+ ]
+
+ property var images: [
+ [url + 'math_1.svg', ''],
+ [url + 'math_2.svg', ''],
+ ]
+
+ property var sounds: [
+ ["",
+ GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0031.$CA")],
+ ["",
+ GCompris.ApplicationInfo.getAudioFilePath("voices-$CA/$LOCALE/alphabet/U0032.$CA")]
+ ]
+
+ data: [
+ { // Level 1
+ "columns": 2,
+ "rows": 2,
+ "texts": texts.slice(0, 2),
+ "images": images.slice(0, 2),
+ "sounds": sounds.slice(0, 2)
+ }
+ ]
+}
diff --git a/src/activities/memory-enumerate/resource/2/Data.qml b/src/activities/memory-enumerate/resource/2/Data.qml
new file mode 100644
--- /dev/null
+++ b/src/activities/memory-enumerate/resource/2/Data.qml
@@ -0,0 +1,62 @@
+/* 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 3.")
+ difficulty: 1
+
+ property string url: "qrc:/gcompris/src/activities/memory-enumerate/resource/"
+
+ property var texts: [
+ ["", 1],
+ ["", 2],
+ ["", 3]
+
+ ]
+
+ property var images: [
+ [url + 'math_1.svg', ''],
+ [url + 'math_2.svg', ''],
+ [url + 'math_3.svg', '']
+ ]
+
+ property var sounds: [
+ ["",
+ 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: [
+ { // Level 1
+ "columns": 3,
+ "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
new file mode 100644
--- /dev/null
+++ b/src/activities/memory-enumerate/resource/3/Data.qml
@@ -0,0 +1,65 @@
+/* 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 4.")
+ difficulty: 1
+
+ property string url: "qrc:/gcompris/src/activities/memory-enumerate/resource/"
+
+ property var texts: [
+ ["", 1],
+ ["", 2],
+ ["", 3],
+ ["", 4]
+ ]
+
+ property var images: [
+ [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/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: [
+ { // Level 1
+ "columns": 4,
+ "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/4/Data.qml b/src/activities/memory-enumerate/resource/4/Data.qml
new file mode 100644
--- /dev/null
+++ b/src/activities/memory-enumerate/resource/4/Data.qml
@@ -0,0 +1,73 @@
+/* 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 5.")
+ difficulty: 2
+
+ property string 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: [
+ { // Level 1
+ "columns": 4,
+ "rows": 3,
+ "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
new file mode 100644
--- /dev/null
+++ b/src/activities/memory-enumerate/resource/5/Data.qml
@@ -0,0 +1,79 @@
+/* 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 6.")
+ difficulty: 3
+
+ property string 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: [
+ { // Level 1
+ "columns": 4,
+ "rows": 3,
+ "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
new file mode 100644
--- /dev/null
+++ b/src/activities/memory-enumerate/resource/6/Data.qml
@@ -0,0 +1,81 @@
+/* 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 7.")
+ difficulty: 3
+
+ property string 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: [
+ { // Level 1
+ "columns": 4,
+ "rows": 4,
+ "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
new file mode 100644
--- /dev/null
+++ b/src/activities/memory-enumerate/resource/7/Data.qml
@@ -0,0 +1,85 @@
+/* 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 8.")
+ difficulty: 3
+
+ property string 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: [
+ { // Level 1
+ "columns": 4,
+ "rows": 4,
+ "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
new file mode 100644
--- /dev/null
+++ b/src/activities/memory-enumerate/resource/8/Data.qml
@@ -0,0 +1,89 @@
+/* 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 9.")
+ difficulty: 3
+
+ property string 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: [
+ { // Level 1
+ "columns": 5,
+ "rows": 4,
+ "texts": texts.slice(0, 10),
+ "images": images.slice(0, 10),
+ "sounds": sounds.slice(0, 10)
+ }
+ ]
+}
diff --git a/src/activities/memory-math-add/ActivityInfo.qml b/src/activities/memory-math-add/ActivityInfo.qml
--- a/src/activities/memory-math-add/ActivityInfo.qml
+++ b/src/activities/memory-math-add/ActivityInfo.qml
@@ -40,4 +40,5 @@
credit: ""
section: "math memory arithmetic"
createdInVersion: 0
+ levels: "1,2,3,4,5,6,7,8,9,10"
}
diff --git a/src/activities/memory-math-add/MemoryMathAdd.qml b/src/activities/memory-math-add/MemoryMathAdd.qml
--- a/src/activities/memory-math-add/MemoryMathAdd.qml
+++ b/src/activities/memory-math-add/MemoryMathAdd.qml
@@ -22,9 +22,7 @@
import QtQuick 2.6
import "../memory"
-import "memory-adddataset.js" as Dataset
MemoryCommon {
- dataset: Dataset.get()
backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
}
diff --git a/src/activities/memory-math-add/memory-adddataset.js b/src/activities/memory-math-add/memory-adddataset.js
deleted file mode 100644
--- a/src/activities/memory-math-add/memory-adddataset.js
+++ /dev/null
@@ -1,77 +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 "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-
-var memory_cards = [
- { // Level 1
- columns: 5,
- rows: 2,
- texts: Memory.getAddTable(1)
- },
- { // Level 2
- columns: 5,
- rows: 2,
- texts: Memory.getAddTable(2)
- },
- { // Level 3
- columns: 5,
- rows: 2,
- texts: Memory.getAddTable(3)
- },
- { // Level 4
- columns: 5,
- rows: 2,
- texts: Memory.getAddTable(4)
- },
- { // Level 5
- columns: 5,
- rows: 2,
- texts: Memory.getAddTable(5)
- },
- { // Level 6
- columns: 5,
- rows: 2,
- texts: Memory.getAddTable(6)
- },
- { // Level 7
- columns: 5,
- rows: 2,
- texts: Memory.getAddTable(7)
- },
- { // Level 8
- columns: 5,
- rows: 2,
- texts: Memory.getAddTable(8)
- },
- { // Level 9
- columns: 5,
- rows: 2,
- texts: Memory.getAddTable(9)
- },
- { // Level 10
- columns: 5,
- rows: 2,
- texts: Memory.getAddTable(10)
- }
- ]
-
-
-function get() {
- return memory_cards
-}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-add/resource/1/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-add/resource/1/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-add/resource/1/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Find cards with equivalent quantities until 11.")
+ difficulty: 1
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getAddTable(1)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-add/resource/10/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-add/resource/10/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-add/resource/10/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Find cards with equivalent quantities until 20.")
+ difficulty: 5
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getAddTable(10)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-add/resource/2/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-add/resource/2/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-add/resource/2/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Find cards with equivalent quantities until 12.")
+ difficulty: 2
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getAddTable(2)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-add/resource/3/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-add/resource/3/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-add/resource/3/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Find cards with equivalent quantities until 13.")
+ difficulty: 3
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getAddTable(3)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-add/resource/4/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-add/resource/4/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-add/resource/4/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Find cards with equivalent quantities until 14.")
+ difficulty: 3
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getAddTable(4)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-add/resource/5/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-add/resource/5/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-add/resource/5/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Find cards with equivalent quantities until 15.")
+ difficulty: 3
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getAddTable(5)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-add/resource/6/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-add/resource/6/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-add/resource/6/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Find cards with equivalent quantities until 16.")
+ difficulty: 4
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getAddTable(6)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-add/resource/7/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-add/resource/7/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-add/resource/7/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Find cards with equivalent quantities until 17.")
+ difficulty: 4
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getAddTable(7)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-add/resource/8/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-add/resource/8/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-add/resource/8/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Find cards with equivalent quantities until 18.")
+ difficulty: 4
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getAddTable(8)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-add/resource/9/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-add/resource/9/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-add/resource/9/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Find cards with equivalent quantities until 19.")
+ difficulty: 5
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getAddTable(9)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/ActivityInfo.qml b/src/activities/memory-math-minus/ActivityInfo.qml
--- a/src/activities/memory-math-minus/ActivityInfo.qml
+++ b/src/activities/memory-math-minus/ActivityInfo.qml
@@ -38,4 +38,5 @@
credit: ""
section: "math memory arithmetic"
createdInVersion: 0
+ levels: "1,2,3,4,5,6,7,8,9,10"
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/MemoryMathMinus.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/MemoryMathMinus.qml
@@ -22,9 +22,7 @@
import QtQuick 2.6
import "../memory"
-import "memory-minusdataset.js" as Dataset
MemoryCommon {
- dataset: Dataset.get()
backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
}
diff --git a/src/activities/memory-math-minus/memory-minusdataset.js b/src/activities/memory-math-minus/memory-minusdataset.js
deleted file mode 100644
--- a/src/activities/memory-math-minus/memory-minusdataset.js
+++ /dev/null
@@ -1,77 +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 "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-
-var memory_cards = [
- { // Level 1
- columns: 5,
- rows: 2,
- texts: Memory.getMinusTable(1)
- },
- { // Level 2
- columns: 5,
- rows: 2,
- texts: Memory.getMinusTable(2)
- },
- { // Level 3
- columns: 5,
- rows: 2,
- texts: Memory.getMinusTable(3)
- },
- { // Level 4
- columns: 5,
- rows: 2,
- texts: Memory.getMinusTable(4)
- },
- { // Level 5
- columns: 5,
- rows: 2,
- texts: Memory.getMinusTable(5)
- },
- { // Level 6
- columns: 5,
- rows: 2,
- texts: Memory.getMinusTable(6)
- },
- { // Level 7
- columns: 5,
- rows: 2,
- texts: Memory.getMinusTable(7)
- },
- { // Level 8
- columns: 5,
- rows: 2,
- texts: Memory.getMinusTable(8)
- },
- { // Level 9
- columns: 5,
- rows: 2,
- texts: Memory.getMinusTable(9)
- },
- { // Level 10
- columns: 5,
- rows: 2,
- texts: Memory.getMinusTable(10)
- }
- ]
-
-
-function get() {
- return memory_cards
-}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/resource/1/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-minus/resource/1/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/resource/1/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Subtraction table of 1 with maximum minuend 11.")
+ difficulty: 3
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getMinusTable(1)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/resource/10/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-minus/resource/10/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/resource/10/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Subtraction table of 10 with maximum minuend 20.")
+ difficulty: 6
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getMinusTable(10)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/resource/2/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-minus/resource/2/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/resource/2/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Subtraction table of 2 with maximum minuend 12.")
+ difficulty: 3
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getMinusTable(2)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/resource/3/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-minus/resource/3/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/resource/3/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Subtraction table of 3 with maximum minuend 13.")
+ difficulty: 4
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getMinusTable(3)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/resource/4/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-minus/resource/4/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/resource/4/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Subtraction table of 4 with maximum minuend 14.")
+ difficulty: 4
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getMinusTable(4)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/resource/5/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-minus/resource/5/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/resource/5/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Subtraction table of 5 with maximum minuend 15.")
+ difficulty: 4
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getMinusTable(5)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/resource/6/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-minus/resource/6/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/resource/6/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Subtraction table of 6 with maximum minuend 16.")
+ difficulty: 5
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getMinusTable(6)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/resource/7/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-minus/resource/7/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/resource/7/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Subtraction table of 7 with maximum minuend 17.")
+ difficulty: 5
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getMinusTable(7)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/resource/8/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-minus/resource/8/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/resource/8/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Subtraction table of 8 with maximum minuend 18.")
+ difficulty: 5
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getMinusTable(8)
+ }
+ ]
}
diff --git a/src/activities/memory-math-minus/MemoryMathMinus.qml b/src/activities/memory-math-minus/resource/9/Data.qml
copy from src/activities/memory-math-minus/MemoryMathMinus.qml
copy to src/activities/memory-math-minus/resource/9/Data.qml
--- a/src/activities/memory-math-minus/MemoryMathMinus.qml
+++ b/src/activities/memory-math-minus/resource/9/Data.qml
@@ -1,10 +1,9 @@
-/* gcompris - MemoryMathMinus.qml
+/* GCompris - Data.qml
*
- * Copyright (C) 2014 JB BUTET
+ * Copyright (C) 2020 Deepak Kumar
*
* Authors:
- * Bruno Coudoin (GTK+ version)
- * JB BUTET (Qt Quick port)
+ * 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
@@ -17,14 +16,21 @@
* 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 .
+ * along with this program; if not, see .
*/
-import QtQuick 2.6
-import "../memory"
-import "memory-minusdataset.js" as Dataset
+import GCompris 1.0
+import "qrc:/gcompris/src/activities/memory/math_util.js" as Memory
-MemoryCommon {
- dataset: Dataset.get()
- backgroundImg: "qrc:/gcompris/src/activities/memory/resource/background.svg"
+Data {
+ objective: qsTr("Subtraction table of 9 with maximum minuend 19.")
+ difficulty: 6
+
+ data: [
+ { // Level 1
+ columns: 5,
+ rows: 2,
+ texts: Memory.getMinusTable(9)
+ }
+ ]
}
diff --git a/src/activities/memory/MemoryCommon.qml b/src/activities/memory/MemoryCommon.qml
--- a/src/activities/memory/MemoryCommon.qml
+++ b/src/activities/memory/MemoryCommon.qml
@@ -51,6 +51,7 @@
property bool keyNavigationVisible: false
Component.onCompleted: {
+ dialogActivityConfig.initialize()
activity.start.connect(start)
activity.stop.connect(stop)
}
@@ -66,13 +67,14 @@
property int selectionCount
property int tuxScore: tuxScore.text
property int playerScore: playerScore.text
- property var dataset: 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
+ property bool isMultipleDatasetMode: activity.datasetLoader.data != 0
}
onStart: Activity.start(items)
@@ -143,13 +145,35 @@
onClose: home()
}
+ DialogChooseLevel {
+ id: dialogActivityConfig
+ currentActivity: activity.activityInfo
+
+ onSaveData: {
+ 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 }
+ content: BarEnumContent { value: items.isMultipleDatasetMode ? (help | home | level | activityConfig) : (help | home | level) }
onHelpClicked: {
displayDialog(dialogHelp)
}
onPreviousLevelClicked: Activity.previousLevel()
+ onActivityConfigClicked: {
+ displayDialog(dialogActivityConfig)
+ }
onNextLevelClicked: Activity.nextLevel()
onHomeClicked: home()
}
diff --git a/src/activities/memory/memory.js b/src/activities/memory/memory.js
--- a/src/activities/memory/memory.js
+++ b/src/activities/memory/memory.js
@@ -37,7 +37,7 @@
items = items_
currentLevel = 0
- numberOfLevel = items.dataset.length
+ numberOfLevel = items.levels.length
initLevel()
}
@@ -54,11 +54,11 @@
items.blockClicks = false
// compute the number of cards
- var columns = items.dataset[currentLevel].columns
- var rows = items.dataset[currentLevel].rows
- var images = items.dataset[currentLevel].images
- var sounds = items.dataset[currentLevel].sounds
- var texts = items.dataset[currentLevel].texts
+ var columns = items.levels[currentLevel].columns
+ var rows = items.levels[currentLevel].rows
+ var images = items.levels[currentLevel].images
+ var sounds = items.levels[currentLevel].sounds
+ var texts = items.levels[currentLevel].texts
items.columns = columns
items.rows = rows
nbOfPair = rows * columns / 2
@@ -70,7 +70,7 @@
sounds ? sounds.length : 0,
texts ? texts.length : 0)
- if(rows * columns > maxData) {
+ if(rows * columns > maxData * 2) {
console.log("ERROR: Memory dataset does not have enough data pairs at level ",
currentLevel + 1)
return