diff --git a/src/activities/alphabet-sequence/ActivityConfig.qml b/src/activities/alphabet-sequence/ActivityConfig.qml new file mode 100644 --- /dev/null +++ b/src/activities/alphabet-sequence/ActivityConfig.qml @@ -0,0 +1,58 @@ +/* GCompris - ActivityConfig.qml + * +* Copyright (C) 2019 Akshay Kumar + * + * Authors: + * Akshay 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 QtQuick 2.6 + +import "../../core" + +Item { + id: activityConfiguration + property Item background + property alias modeBox: modeBox + property var availableModes: [ + { "text": qsTr("Lower Case"), "value": "lower" }, + { "text": qsTr("Upper Case"), "value": "upper" }, + ] + Flow { + id: flow + spacing: 5 + width: parent.width + GCComboBox { + id: modeBox + model: availableModes + background: activityConfiguration.background + label: qsTr("Select Domino Representation") + } + } + + property var dataToSave + function setDefaultValues() { + for(var i = 0 ; i < availableModes.length ; i++) { + if(availableModes[i].value === dataToSave["mode"]) { + modeBox.currentIndex = i; + break; + } + } + } + function saveValues() { + var newMode = availableModes[modeBox.currentIndex].value; + dataToSave = {"mode": newMode}; + } +} diff --git a/src/activities/alphabet-sequence/ActivityInfo.qml b/src/activities/alphabet-sequence/ActivityInfo.qml --- a/src/activities/alphabet-sequence/ActivityInfo.qml +++ b/src/activities/alphabet-sequence/ActivityInfo.qml @@ -37,4 +37,5 @@ credit: "" section: "reading letters" createdInVersion: 0 + levels: "1,2,3" } diff --git a/src/activities/alphabet-sequence/resource/1/Data.qml b/src/activities/alphabet-sequence/resource/1/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/alphabet-sequence/resource/1/Data.qml @@ -0,0 +1,63 @@ + +/* GCompris - Data.qml + * + * Copyright (C) 2019 Akshay Kumar + * + * Authors: + * Akshay 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 QtQuick 2.6 +import GCompris 1.0 +import "../../../../core" + +Dataset { + objective: qsTr("Select letters in alphabetical order") + difficulty: 1 + data: [ + { + data: qsTr("a/b/c/d/e").split("/"), + showNext: true + }, + { + data: qsTr("f/g/h/i/j/k").split("/"), + showNext: true + }, + { + data: qsTr("a/b/c/d/e/f/g/h/i/j/k").split("/"), + showNext: false + }, + { + data: qsTr("l/m/n/o/p").split("/"), + showNext: false + }, + { + data: qsTr("q/r/s/t/u").split("/"), + showNext: false + }, + { + data: qsTr("a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u").split("/"), + showNext: false + }, + { + data: qsTr("u/v/w/x/y/z").split("/"), + showNext: false + }, + { + data: qsTr("a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z").split("/"), + showNext: false + } + ] +} diff --git a/src/activities/alphabet-sequence/resource/2/Data.qml b/src/activities/alphabet-sequence/resource/2/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/alphabet-sequence/resource/2/Data.qml @@ -0,0 +1,143 @@ + +/* GCompris - Data.qml + * + * Copyright (C) 2019 Akshay Kumar + * + * Authors: + * Akshay 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 QtQuick 2.6 +import GCompris 1.0 +import "../../../../core" + +Dataset { + objective: qsTr("Select words in alphabetical order") + difficulty: 2 + data: [ + { + data: [ + qsTr("fruit"), + qsTr("road"), + qsTr("meat"), + qsTr("speech"), + qsTr("gold"), + qsTr("trip"), + qsTr("dance") + ].sort(), + showNext: true + }, + { + data: [ + qsTr("witch"), + qsTr("ghost"), + qsTr("trip"), + qsTr("house"), + qsTr("live"), + qsTr("like"), + qsTr("road"), + ].sort(), + showNext: true + }, + { + data: [ + qsTr("old"), + qsTr("crown"), + qsTr("tear"), + qsTr("bench"), + qsTr("computer"), + qsTr("key"), + ].sort(), + showNext: true + }, + { + data: [ + qsTr("brake"), + qsTr("dream"), + qsTr("prince"), + qsTr("talk"), + qsTr("fly"), + qsTr("history"), + ].sort(), + showNext: false + }, + { + data: [ + qsTr("watch"), + qsTr("shampoo"), + qsTr("sun"), + qsTr("apple"), + qsTr("table"), + qsTr("socks"), + ].sort(), + showNext: false + }, + { + data: [ + qsTr("needle"), + qsTr("couch"), + qsTr("peanuts"), + qsTr("stock"), + qsTr("shoes"), + ].sort(), + showNext: false + }, + { + data: [ + qsTr("needle"), + qsTr("couch"), + qsTr("peanuts"), + qsTr("stock"), + qsTr("shoes"), + ].sort(), + showNext: false + }, + { + data: [ + qsTr("hanger"), + qsTr("toothbrush"), + qsTr("plastic"), + qsTr("machine"), + qsTr("shampoo"), + qsTr("towel"), + ].sort(), + showNext: false + }, + { + data: [ + qsTr("bread"), + qsTr("waist"), + qsTr("law"), + qsTr("firm"), + qsTr("fibre"), + qsTr("move"), + qsTr("bright"), + qsTr("green"), + ].sort(), + showNext: false + }, + { + data: [ + qsTr("rush"), + qsTr("trade"), + qsTr("line"), + qsTr("boy"), + qsTr("girl"), + qsTr("key"), + ].sort(), + showNext: false + }, + ] +} diff --git a/src/activities/alphabet-sequence/resource/3/Data.qml b/src/activities/alphabet-sequence/resource/3/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/alphabet-sequence/resource/3/Data.qml @@ -0,0 +1,99 @@ + +/* GCompris - Data.qml + * + * Copyright (C) 2019 Akshay Kumar + * + * Authors: + * Akshay 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 QtQuick 2.6 +import GCompris 1.0 +import "../../../../core" + +Dataset { + objective: qsTr("Select words(with common initials) in alphabetical order") + difficulty: 3 + data: [ + { + data: [ + qsTr("band"), + qsTr("beautiful"), + qsTr("balance"), + qsTr("ball"), + qsTr("basket"), + qsTr("base"), + ].sort(), + showNext: true + }, + { + data: [ + qsTr("connection"), + qsTr("cook"), + qsTr("condition"), + qsTr("control"), + qsTr("conscious"), + qsTr("complex"), + ].sort(), + showNext: true + }, + { + data: [ + qsTr("discovery"), + qsTr("digestion"), + qsTr("direction"), + qsTr("discussion"), + qsTr("disease"), + qsTr("dirty"), + ].sort(), + showNext: true + }, + { + data: [ + qsTr("engine"), + qsTr("elastic"), + qsTr("egg"), + qsTr("effect"), + qsTr("enough"), + qsTr("end"), + qsTr("electric"), + ].sort(), + showNext: false + }, + { + data: [ + qsTr("family"), + qsTr("face"), + qsTr("fall"), + qsTr("fat"), + qsTr("fact"), + qsTr("false"), + qsTr("far") + ].sort(), + showNext: false + }, + { + data: [ + qsTr("fertile"), + qsTr("feeling"), + qsTr("fiction"), + qsTr("field"), + qsTr("fight"), + qsTr("female"), + ].sort(), + showNext: false + } + ] +} diff --git a/src/activities/numbers-odd-even/ActivityInfo.qml b/src/activities/numbers-odd-even/ActivityInfo.qml --- a/src/activities/numbers-odd-even/ActivityInfo.qml +++ b/src/activities/numbers-odd-even/ActivityInfo.qml @@ -36,5 +36,6 @@ manual: qsTr("Catch the odd or even number clouds. With a keyboard use the arrow keys to move the helicopter. With a pointing device you just click or tap on the target location. To know which number you have to catch you can either remember it or check the bottom right corner.") credit: "" section: "math numeration" - createdInVersion: 0 + createdInVersion: 0 + levels: "1,2" } diff --git a/src/activities/numbers-odd-even/resource/1/Data.qml b/src/activities/numbers-odd-even/resource/1/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/numbers-odd-even/resource/1/Data.qml @@ -0,0 +1,55 @@ + +/* GCompris - Data.qml + * + * Copyright (C) 2019 Akshay Kumar + * + * Authors: + * Akshay 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 QtQuick 2.6 +import GCompris 1.0 +import "../../../../core" + +Dataset { + objective: qsTr("Select even and odd numbers upto 20") + difficulty: 1 + data: [ + { + data: "0 2 4".split(" "), + showNext: true + }, + { + data: "1 3 5".split(" "), + showNext: true + }, + { + data: "0 2 4 6 8 10 12".split(" "), + showNext: true + }, + { + data: "1 3 5 7 9 11 13".split(" "), + showNext: false + }, + { + data: "0 2 4 6 8 10 12 14 16 18 20".split(" "), + showNext: false + }, + { + data: "1 3 5 7 9 11 13 15 17 19 21".split(" "), + showNext: false + } + ] +} diff --git a/src/activities/numbers-odd-even/resource/2/Data.qml b/src/activities/numbers-odd-even/resource/2/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/numbers-odd-even/resource/2/Data.qml @@ -0,0 +1,55 @@ + +/* GCompris - Data.qml + * + * Copyright (C) 2019 Akshay Kumar + * + * Authors: + * Akshay 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 QtQuick 2.6 +import GCompris 1.0 +import "../../../../core" + +Dataset { + objective: qsTr("Select even and odd numbers upto 30") + difficulty: 1 + data: [ + { + data: "0 2 4 6 8 10 12 14 16 18 20".split(" "), + showNext: true + }, + { + data: "1 3 5 7 9 11 13 15 17 19 21".split(" "), + showNext: true + }, + { + data: "0 2 4 6 8 10 12 14 16 18 20 22 24 26".split(" "), + showNext: false + }, + { + data: "1 3 5 7 9 11 13 15 17 19 21 23 25 27".split(" "), + showNext: false + }, + { + data: "0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30".split(" "), + showNext: false + }, + { + data: "1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31".split(" "), + showNext: false + } + ] +} diff --git a/src/activities/planegame/ActivityInfo.qml b/src/activities/planegame/ActivityInfo.qml --- a/src/activities/planegame/ActivityInfo.qml +++ b/src/activities/planegame/ActivityInfo.qml @@ -35,6 +35,7 @@ //: Help manual manual: qsTr("Catch the clouds in increasing order. With a keyboard use the arrow keys to move the helicopter. With a pointing device you just click or tap on the target location. To know which number you have to catch you can either remember it or check the bottom right corner.") credit: "" - section: "math numeration" - createdInVersion: 0 + section: "math numeration" + createdInVersion: 0 + levels: "1,2" } diff --git a/src/activities/planegame/Cloud.qml b/src/activities/planegame/Cloud.qml --- a/src/activities/planegame/Cloud.qml +++ b/src/activities/planegame/Cloud.qml @@ -55,11 +55,17 @@ GCText { id: number + height: cloud.height / 2 + width: cloud.width / 2 anchors.horizontalCenter: cloud.horizontalCenter anchors.verticalCenter: cloud.verticalCenter + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter color: "black" font.bold: true - fontSize: 18 + font.pointSize: 100 + minimumPointSize: 10 + fontSizeMode: Text.Fit } Component.onCompleted: { diff --git a/src/activities/planegame/Planegame.qml b/src/activities/planegame/Planegame.qml --- a/src/activities/planegame/Planegame.qml +++ b/src/activities/planegame/Planegame.qml @@ -35,6 +35,8 @@ Keys.onPressed: Activity.processPressedKey(event) Keys.onReleased: Activity.processReleasedKey(event) + property string mode: "lower" + property var dataset property var tutorialInstructions property bool showTutorial: false @@ -62,22 +64,25 @@ sourceSize.width: parent.width Component.onCompleted: { - activity.start.connect(start) - activity.stop.connect(stop) + dialogActivityConfig.initialize() + activity.start.connect(start) + activity.stop.connect(stop) } QtObject { id: items property alias background: background property alias bar: bar property alias bonus: bonus + property var levels: activity.datasetLoader.item.data property alias score: score property alias plane: plane property GCAudio audioVoices: activity.audioVoices property GCSfx audioEffects: activity.audioEffects property alias movePlaneTimer: movePlaneTimer property alias cloudCreation: cloudCreation property bool showTutorial: activity.showTutorial + property var letterMode: activity.mode } onStart: { Activity.start(items, dataset) } @@ -120,18 +125,47 @@ } } + DialogChooseLevel { + id: dialogActivityConfig + currentActivity: activity.activityInfo + onSaveData: { + levelFolder = dialogActivityConfig.chosenLevel + currentActivity.currentLevel = dialogActivityConfig.chosenLevel + ApplicationSettings.setCurrentLevel(currentActivity.name, dialogActivityConfig.chosenLevel) + home() + activity.focus = true + background.stop() + background.start() + } + onLoadData: { + if(activityData && activityData["mode"]) { + activity.mode = activityData["mode"]; + Activity.initLevel() + } + } + onClose: { + home() + } + onStartActivity: { + background.start() + } + } + DialogHelp { id: dialogHelp onClose: home() } Bar { id: bar - content: BarEnumContent { value: items.showTutorial ? (help | home) : (help | home | level) } + content: BarEnumContent { value: items.showTutorial ? (help | home | activityConfig) : (help | home | level | activityConfig) } onHelpClicked: displayDialog(dialogHelp) onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: activity.home() + onActivityConfigClicked: { + displayDialog(dialogActivityConfig) + } } Bonus { diff --git a/src/activities/planegame/planegame.js b/src/activities/planegame/planegame.js --- a/src/activities/planegame/planegame.js +++ b/src/activities/planegame/planegame.js @@ -49,7 +49,7 @@ Core.checkForVoices(items_.background); items = items_ - dataset = dataset_ + dataset = items.levels numberOfLevel = dataset.length currentLevel = 0 if(items.showTutorial === false) { @@ -78,7 +78,15 @@ items.bar.level = currentLevel + 1; currentSubLevel = 0 numberOfSubLevels = dataset[currentLevel].data.length - + if(items.letterMode === "upper") { + for(var i = 0; i < numberOfSubLevels; i++) { + dataset[currentLevel].data[i] = dataset[currentLevel].data[i].toUpperCase() + } + } else { + for(var i = 0; i < numberOfSubLevels; i++) { + dataset[currentLevel].data[i] = dataset[currentLevel].data[i].toLowerCase() + } + } items.movePlaneTimer.stop(); items.cloudCreation.stop() diff --git a/src/activities/planegame/resource/1/Data.qml b/src/activities/planegame/resource/1/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/planegame/resource/1/Data.qml @@ -0,0 +1,59 @@ + +/* GCompris - Data.qml + * + * Copyright (C) 2019 Akshay Kumar + * + * Authors: + * Akshay 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 QtQuick 2.6 +import GCompris 1.0 +import "../../../../core" + +Dataset { + objective: qsTr("Count numbers upto 15") + difficulty: 1 + data: [ + { + data: "0 1 2 3".split(" "), + showNext: true + }, + { + data: "0 1 2 3 4 5".split(" "), + showNext: true + }, + { + data: "0 1 2 3 4 5 6 7".split(" "), + showNext: true + }, + { + data: "0 1 2 3 4 5 6 7 8 9".split(" "), + showNext: false + }, + { + data: "0 1 2 3 4 5 6 7 8 9 10 11".split(" "), + showNext: false + }, + { + data: "0 1 2 3 4 5 6 7 8 9 10 11 12 13".split(" "), + showNext: false + }, + { + data: "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15".split(" "), + showNext: false + } + ] +} diff --git a/src/activities/planegame/resource/2/Data.qml b/src/activities/planegame/resource/2/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/planegame/resource/2/Data.qml @@ -0,0 +1,55 @@ + +/* GCompris - Data.qml + * + * Copyright (C) 2019 Akshay Kumar + * + * Authors: + * Akshay 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 QtQuick 2.6 +import GCompris 1.0 +import "../../../../core" + +Dataset { + objective: qsTr("Count numbers upto 20") + difficulty: 2 + data: [ + { + data: "0 1 2 3 4 5 6 7 8 9 10".split(" "), + showNext: true + }, + { + data: "0 1 2 3 4 5 6 7 8 9 10 11 12".split(" "), + showNext: true + }, + { + data: "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14".split(" "), + showNext: false + }, + { + data: "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16".split(" "), + showNext: false + }, + { + data: "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18".split(" "), + showNext: false + }, + { + data: "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20".split(" "), + showNext: false + } + ] +}