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 Case") + } + } + + 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/AlphabetSequence.qml b/src/activities/alphabet-sequence/AlphabetSequence.qml --- a/src/activities/alphabet-sequence/AlphabetSequence.qml +++ b/src/activities/alphabet-sequence/AlphabetSequence.qml @@ -28,6 +28,7 @@ // Supports multigraphs, e.g. /sh/ or /sch/ gets treated as one letter property string alphabet: 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"); + showTutorial: false dataset: [ { data: activity.alphabet.split("/"), 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/NumbersOddEven.qml b/src/activities/numbers-odd-even/NumbersOddEven.qml --- a/src/activities/numbers-odd-even/NumbersOddEven.qml +++ b/src/activities/numbers-odd-even/NumbersOddEven.qml @@ -23,25 +23,6 @@ showTutorial: true - dataset: [ - { - 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".split(" "), - showNext: false - }, - { - data: "1 3 5 7 9 11 13 15 17 19 21".split(" "), - showNext: false - } - ] - tutorialInstructions: [ { "instruction": qsTr("This activity teaches about even and odd numbers."), 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 up to 20") + difficulty: 1 + // If the value of variable showNext is true then the next number to be selected is shown as hint, otherwise not. + 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 up to 30") + difficulty: 1 + // If the value of variable showNext is true then the next number to be selected is shown as hint, otherwise not. + 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,8 +64,9 @@ 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 { @@ -71,6 +74,7 @@ property alias background: background property alias bar: bar property alias bonus: bonus + property var levels: activity.datasetLoader.data property alias score: score property alias plane: plane property GCAudio audioVoices: activity.audioVoices @@ -78,6 +82,7 @@ property alias movePlaneTimer: movePlaneTimer property alias cloudCreation: cloudCreation property bool showTutorial: activity.showTutorial + property string letterMode: activity.mode } onStart: { Activity.start(items, dataset) } @@ -120,6 +125,29 @@ } } + 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() + } + onLoadData: { + if(activityData && activityData["mode"]) { + activity.mode = activityData["mode"]; + } + } + } + DialogHelp { id: dialogHelp onClose: home() @@ -127,11 +155,14 @@ 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/Sequence.qml b/src/activities/planegame/Sequence.qml --- a/src/activities/planegame/Sequence.qml +++ b/src/activities/planegame/Sequence.qml @@ -21,23 +21,4 @@ import QtQuick 2.6 Planegame { - - dataset: [ - { - data: "0 1 2 3 4 5 6 7 8 9 10".split(" "), - showNext: true - }, - { - data: "10 11 12 13 14 15 16 17 18 19 20".split(" "), - showNext: true - }, - { - data: "0 1 2 3 4 5 6 7 8 9 10".split(" "), - showNext: false - }, - { - data: "10 11 12 13 14 15 16 17 18 19 20".split(" "), - showNext: false - } - ] } 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,11 @@ Core.checkForVoices(items_.background); items = items_ - dataset = dataset_ + if(items.levels.length === 0) { + dataset = dataset_ + } else { + dataset = items.levels + } numberOfLevel = dataset.length currentLevel = 0 if(items.showTutorial === false) { @@ -75,10 +79,18 @@ } function initLevel() { - items.bar.level = currentLevel + 1; + 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 up to 15") + difficulty: 1 + // If the value of variable showNext is true then the next number to be selected is shown as hint, otherwise not. + 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 up to 20") + difficulty: 2 + // If the value of variable showNext is true then the next number to be selected is shown as hint, otherwise not. + 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 + } + ] +}