diff --git a/src/activities/magic-hat-minus/ActivityInfo.qml b/src/activities/magic-hat-minus/ActivityInfo.qml index 51f3276e3..21cd08594 100644 --- a/src/activities/magic-hat-minus/ActivityInfo.qml +++ b/src/activities/magic-hat-minus/ActivityInfo.qml @@ -1,40 +1,41 @@ /* GCompris - ActivityInfo.qml * * Copyright (C) 2015 Thibaut ROMAIN * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import GCompris 1.0 ActivityInfo { name: "magic-hat-minus/MagicHat.qml" difficulty: 2 icon: "magic-hat-minus/magic-hat-minus.svg" author: "Thibaut ROMAIN <thibrom@gmail.com>" demo: true //: Activity title title: qsTr("The magician hat") //: Help title description: qsTr("Count how many items are under the magic hat after some have got away") // intro: "Click on the hat. How many stars are still hiding under the hat." //: Help goal goal: qsTr("Learn subtraction") //: Help prerequisite prerequisite: qsTr("Subtraction") //: Help manual manual: qsTr("Click on the hat to open it. Stars go in and a few stars escape. You have to count how many are still under the hat. Click on the bottom area to input your answer and on the OK button to validate your answer.") credit: "" section: "math arithmetic" createdInVersion: 0 + levels: "1,2,3,4,5,6" } diff --git a/src/activities/magic-hat-minus/MagicHat.qml b/src/activities/magic-hat-minus/MagicHat.qml index 2936a3926..6f98e95d8 100644 --- a/src/activities/magic-hat-minus/MagicHat.qml +++ b/src/activities/magic-hat-minus/MagicHat.qml @@ -1,239 +1,263 @@ /* GCompris - MagicHat.qml * * Copyright (C) 2014 Thibaut ROMAIN * * Authors: * (GTK+ version) * Thibaut ROMAIN (Qt Quick port) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" import "magic-hat.js" as Activity import "." ActivityBase { id: activity onStart: focus = true onStop: {} property string mode: "minus" pageComponent: Image { id: background anchors.fill: parent source: Activity.url + "background.svg" sourceSize.width: Math.max(parent.width, parent.height) fillMode: Image.PreserveAspectCrop property int starSize: Math.min(rightLayout.width / 12, background.height / 21) signal start signal stop property var starColors : ["1", "2", "3"] Component.onCompleted: { + dialogActivityConfig.initialize() activity.start.connect(start) activity.stop.connect(stop) } onStart: Activity.start(items, mode) onStop: Activity.stop() property bool vert: background.width >= (background.height - okButton.height) // Add here the QML items you need to access in javascript QtObject { id: items property Item main: activity.main property alias background: background property GCSfx audioEffects: activity.audioEffects property alias bar: bar + property var levels: activity.datasetLoader.item.data + property int maxValue: activity.datasetLoader.item.maxValue property alias bonus: bonus property alias hat: theHat property alias introductionText: introText property var repeatersList: [repeaterFirstRow, repeaterSecondRow, repeaterAnswerRow] } Item { id: mainlayout anchors.left: background.left width: background.width * 0.4 height: background.height z: 11 Hat { id: theHat starsSize: background.starSize audioEffects: activity.audioEffects } GCText { id: introText anchors { horizontalCenter: parent.horizontalCenter top: parent.top topMargin: 20 * ApplicationInfo.ratio } width: parent.width - 5 * ApplicationInfo.ratio fontSize: regularSize font.bold: true style: Text.Outline styleColor: "black" color: "white" wrapMode: TextEdit.WordWrap horizontalAlignment: TextEdit.AlignHCenter text: qsTr("Click on the hat to begin the game") } GCText { //: The math operation text: mode == "minus" ? qsTr("−") : qsTr("+") anchors.right: mainlayout.right anchors.rightMargin: 10 y: secondRow.y fontSize: 66 color: "white" style: Text.Outline styleColor: "black" } } Grid { id: rightLayout anchors { left: mainlayout.right right: background.vert ? okButton.left : background.right rightMargin: background.vert ? 0 : 10 verticalCenter: background.verticalCenter verticalCenterOffset: background.height/8 } height: background.height columns: 1 Column { id: firstRow height: background.starSize * 4 spacing: 5 z: 10 Repeater { id: repeaterFirstRow model: 3 StarsBar { barGroupIndex: 0 barIndex: index width: rightLayout.width backgroundColor: "grey" starsColor: starColors[index] theHat: items.hat starsSize: background.starSize opacity: 0 } } } Column { id: secondRow height: background.starSize * 4 spacing: 5 z: 9 Repeater { id: repeaterSecondRow model: 3 StarsBar { barGroupIndex: 1 barIndex: index width: rightLayout.width backgroundColor: "grey" starsColor: starColors[index] theHat: items.hat starsSize: background.starSize opacity: 0 } } } Rectangle { width: (background.starSize + 5) * 10 - 5 height: 5 * ApplicationInfo.ratio color: "white" } Rectangle { width: (background.starSize + 5) * 10 - 5 height: 10 * ApplicationInfo.ratio opacity: 0 } Column { id: answerRow height: background.starSize * 4 spacing: 5 Repeater { id: repeaterAnswerRow model: 3 StarsBar { barGroupIndex: 2 barIndex: index width: rightLayout.width backgroundColor: "#53b9c9" starsColor: starColors[index] authorizeClick: false theHat: items.hat starsSize: background.starSize opacity: 0 } } } } + DialogChooseLevel { + id: dialogActivityConfig + currentActivity: activity.activityInfo + + onSaveData: { + levelFolder = dialogActivityConfig.chosenLevel + currentActivity.currentLevel = dialogActivityConfig.chosenLevel + ApplicationSettings.setCurrentLevel(currentActivity.name, dialogActivityConfig.chosenLevel) + home() + } + onClose: { + home() + } + onStartActivity: { + background.start() + } + } + DialogHelp { id: dialogHelp onClose: home() } Bar { id: bar - content: BarEnumContent { value: help | home | level } + content: BarEnumContent { value: help | home | level | activityConfig } onHelpClicked: { displayDialog(dialogHelp) } + onActivityConfigClicked: { + displayDialog(dialogActivityConfig) + } onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: activity.home() } BarButton { id: okButton anchors { bottom: bar.top right: parent.right rightMargin: 10 * ApplicationInfo.ratio bottomMargin: 10 * ApplicationInfo.ratio } source: "qrc:/gcompris/src/core/resource/bar_ok.svg" sourceSize.width: 60 * ApplicationInfo.ratio onClicked: Activity.verifyAnswer() } Bonus { id: bonus Component.onCompleted: win.connect(Activity.nextLevel) } } } diff --git a/src/activities/magic-hat-minus/StarsBar.qml b/src/activities/magic-hat-minus/StarsBar.qml index a36a0a503..bcc7fda7b 100644 --- a/src/activities/magic-hat-minus/StarsBar.qml +++ b/src/activities/magic-hat-minus/StarsBar.qml @@ -1,107 +1,121 @@ /* GCompris - MagicHat.qml * * Copyright (C) 2014 Thibaut ROMAIN * * Authors: * (GTK+ version) * Thibaut ROMAIN (Qt Quick port) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import "magic-hat.js" as Activity +import "../../core" Item { id: item height: starsSize property int barGroupIndex property int barIndex property int nbStarsOn: 0 property bool authorizeClick: false + property int coefficient: 1 + property bool coefficientVisible: false property int starsSize property string backgroundColor property string starsColor: "1" property Item theHat property alias repeaterStars: repeaterStars Row { id: rowlayout height: item.height spacing: 5 + GCText { + id: text + visible: item.coefficientVisible + //: text displaying coefficient with which the set of stars is to be multiplied along with multiplication symbol. + text: qsTr("%1x").arg(item.coefficient) + fontSizeMode: Text.HorizontalFit + width: rowlayout.width / 10 + color: "white" + anchors.rightMargin: 20 + fontSize: tinySize + } Repeater { id: repeaterStars model: item.opacity == 1 ? 10 : 0 Item { id: star width: item.starsSize height: item.starsSize property alias starFixed: starFixed property alias starToMove: starToMove Star { id: starFixed barGroupIndex: item.barGroupIndex barIndex: item.barIndex backgroundColor: item.backgroundColor wantedColor: starsColor selected: index < nbStarsOn ? true : false width: item.starsSize height: item.starsSize displayBounds: true isClickable: item.authorizeClick } Star { id: starToMove barGroupIndex: item.barGroupIndex backgroundColor: item.backgroundColor wantedColor: starsColor selected: index < nbStarsOn ? true : false width: item.starsSize height: item.starsSize displayBounds: false isClickable: false enabled: selected ? true : false initialParent: star theHat: item.theHat.target } } } } function moveStars() { activity.audioEffects.play("qrc:/gcompris/src/core/resource/sounds/smudge.wav") for(var i=0; i * * 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 . */ .pragma library .import QtQuick 2.6 as Quick var url = "qrc:/gcompris/src/activities/magic-hat-minus/resource/" var currentLevel -var numberOfLevel = 9 +var numberOfLevel var numberOfUserStars var items; var mode; var magicHat var numberOfStars var nbStarsToAddOrRemove var nbStarsToCount var animationCount +var questionCoefficients = [] +var maxStarSlots = 30 +var answerCoefficients = [] +var coefficientsNeeded = false function start(items_, mode_) { items = items_ mode = mode_ magicHat = items.hat currentLevel = 0 + numberOfLevel = items.levels.length initLevel() } function stop() { } function initLevel() { items.bar.level = currentLevel + 1 magicHat.state = "NormalPosition" numberOfStars = new Array(0, 0, 0) numberOfUserStars = new Array(0, 0, 0) nbStarsToAddOrRemove = new Array(0, 0, 0) nbStarsToCount = new Array(0, 0, 0) animationCount = 0 if(currentLevel > 0) { items.introductionText.visible = false } else { items.introductionText.visible = true } - - for(var j=0; j<3; j++) { + coefficientsNeeded = (items.maxValue / maxStarSlots <= 1) ? false : true + for(var j = 0; j < 3; j++) { items.repeatersList[0].itemAt(j).initStars() items.repeatersList[1].itemAt(j).initStars() items.repeatersList[2].itemAt(j).resetStars() } - - var maxValue = mode === "minus" ? 10 : 9 - switch(currentLevel) { - case 0: numberOfStars[0] = getRandomInt(2,4) - break; - case 1: numberOfStars[0] = getRandomInt(2,6) - break; - case 2: numberOfStars[0] = getRandomInt(2,maxValue) - break; - case 3: numberOfStars[0] = getRandomInt(2,5) - numberOfStars[1] = getRandomInt(2,5) - break; - case 4: numberOfStars[0] = getRandomInt(2,8) - numberOfStars[1] = getRandomInt(2,8) - break; - case 5: numberOfStars[0] = getRandomInt(2,maxValue) - numberOfStars[1] = getRandomInt(2,maxValue) - break; - case 6: numberOfStars[0] = getRandomInt(2,4) - numberOfStars[1] = getRandomInt(2,4) - numberOfStars[2] = getRandomInt(2,4) - break; - case 7: numberOfStars[0] = getRandomInt(2,6) - numberOfStars[1] = getRandomInt(2,6) - numberOfStars[2] = getRandomInt(2,6) - break; - case 8: numberOfStars[0] = getRandomInt(2,8) - numberOfStars[1] = getRandomInt(2,8) - numberOfStars[2] = getRandomInt(2,8) - break; - case 9: numberOfStars[0] = getRandomInt(2,maxValue) - numberOfStars[1] = getRandomInt(2,maxValue) - numberOfStars[2] = getRandomInt(2,maxValue) - break; + if(!coefficientsNeeded) { + questionCoefficients[0] = questionCoefficients[1] = questionCoefficients[2] = 1; + answerCoefficients[0] = answerCoefficients[1] = answerCoefficients[2] = 1; + setCoefficientVisibility(false) + } else { + for(var i = 0; i < 3; i++) + questionCoefficients[i] = Math.round(items.levels[currentLevel].maxStars[i] / 10); + answerCoefficients[0] = items.maxValue / 100; + answerCoefficients[1] = items.maxValue / 20; + answerCoefficients[2] = items.maxValue / 10; + setCoefficientVisibility(true) + setWantedColor("1") } + var subtractor = (mode === "minus") ? 0 : 1 + numberOfStars[0] = (items.levels[currentLevel].maxStars[0] > 0) ? getRandomInt(items.levels[currentLevel].minStars[0], (items.levels[currentLevel].maxStars[0] / questionCoefficients[0]) - subtractor) : 0 + numberOfStars[1] = (items.levels[currentLevel].maxStars[1] > 0) ? getRandomInt(items.levels[currentLevel].minStars[1], (items.levels[currentLevel].maxStars[1] / questionCoefficients[1]) - subtractor) : 0 + numberOfStars[2] = (items.levels[currentLevel].maxStars[2] > 0) ? getRandomInt(items.levels[currentLevel].minStars[2], (items.levels[currentLevel].maxStars[2] / questionCoefficients[2]) - subtractor) : 0 for(var i=0; i<3; i++) { items.repeatersList[0].itemAt(i).nbStarsOn = numberOfStars[i] + items.repeatersList[0].itemAt(i).coefficient = questionCoefficients[i] items.repeatersList[1].itemAt(i).nbStarsOn = 0 + items.repeatersList[1].itemAt(i).coefficient = questionCoefficients[i] items.repeatersList[2].itemAt(i).nbStarsOn = 0 items.repeatersList[2].itemAt(i).authorizeClick = false + items.repeatersList[2].itemAt(i).coefficient = answerCoefficients[i] if(numberOfStars[i] > 0) { items.repeatersList[0].itemAt(i).opacity = 1 items.repeatersList[1].itemAt(i).opacity = 1 items.repeatersList[2].itemAt(i).opacity = 1 if(mode === "minus") nbStarsToAddOrRemove[i] = getRandomInt(1, numberOfStars[i]-1) else nbStarsToAddOrRemove[i] = getRandomInt(1, 10-numberOfStars[i]) } else { items.repeatersList[0].itemAt(i).opacity = 0 items.repeatersList[1].itemAt(i).opacity = 0 items.repeatersList[2].itemAt(i).opacity = 0 } } if(mode === "minus") { - for(var i=0; i<3; i++) { + for(var i = 0; i < 3; i++) { nbStarsToCount[i] = numberOfStars[i] - nbStarsToAddOrRemove[i] items.repeatersList[1].itemAt(i).nbStarsOn = 0 } } else { - for(var i=0; i<3; i++) { + for(var i = 0; i < 3; i++) { nbStarsToCount[i] = numberOfStars[i]+nbStarsToAddOrRemove[i] items.repeatersList[1].itemAt(i).nbStarsOn = nbStarsToAddOrRemove[i] } } } +function setCoefficientVisibility(visibility) { + for(var i = 0; i < 3; i++) { + for(var j = 0; j < 3; j++) { + items.repeatersList[j].itemAt(i).coefficientVisible = visibility + } + } +} + +function setWantedColor(colorValue) { + if(colorValue != null) { + for(var i = 0; i < 3; i++) { + for(var j = 0; j < 3; j++) { + items.repeatersList[j].itemAt(i).starsColor = colorValue + } + } + } +} + function userClickedAStar(barIndex,state) { if(state) numberOfUserStars[barIndex]++ else numberOfUserStars[barIndex]-- } function verifyAnswer() { - if(numberOfUserStars[0] === nbStarsToCount[0] && - numberOfUserStars[1] === nbStarsToCount[1] && - numberOfUserStars[2] === nbStarsToCount[2]) { - items.bonus.good("flower") + if(items.maxValue / maxStarSlots <= 1) { + if(numberOfUserStars[0] === nbStarsToCount[0] && + numberOfUserStars[1] === nbStarsToCount[1] && + numberOfUserStars[2] === nbStarsToCount[2]) { + items.bonus.good("flower") + } else { + items.bonus.bad("flower") + } } else { - items.bonus.bad("flower") + var starsCalculatedByUser = numberOfUserStars[0] * answerCoefficients[0] + numberOfUserStars[1] * answerCoefficients[1] + + numberOfUserStars[2] * answerCoefficients[2]; + var actualNumberOfStars = nbStarsToCount[0] * questionCoefficients[0] + nbStarsToCount[1] * questionCoefficients[1] + + nbStarsToCount[2] * questionCoefficients[2]; + if(starsCalculatedByUser == actualNumberOfStars) + items.bonus.good("flower") + else + items.bonus.bad("flower") } } function nextLevel() { if(numberOfLevel <= ++currentLevel ) { currentLevel = 0 } initLevel(); } function previousLevel() { if(--currentLevel < 0) { currentLevel = numberOfLevel - 1 } initLevel(); } function moveStarsUnderHat() { if(currentLevel == 0) { items.introductionText.visible = false } - for(var j=0; j<3; j++) { + for(var j = 0; j < 3; j++) { items.repeatersList[0].itemAt(j).moveStars() } } function moveBackMinusStars() { - for(var j=0; j<3; j++) { + for(var j = 0; j < 3; j++) { items.repeatersList[0].itemAt(j). moveBackMinusStars(items.repeatersList[1].itemAt(j), nbStarsToAddOrRemove[j]) } } function movePlusStars() { - for(var j=0; j<3; j++) { + for(var j = 0; j < 3; j++) { items.repeatersList[1].itemAt(j).moveStars() } } // Function called everytime the first animation ends function animation1Finished(barGroupIndex) { animationCount++ if(barGroupIndex == 0) { if(animationCount === numberOfStars[0] + numberOfStars[1] + numberOfStars[2]) { animationCount = 0 if(mode === "minus") moveBackMinusStars() else movePlusStars() } } else { animationCount = 0 userGuessNumberState() } } // Function called everytime the second animation ends function animation2Finished() { animationCount++ if(animationCount === nbStarsToAddOrRemove[0] + nbStarsToAddOrRemove[1] + nbStarsToAddOrRemove[2]) { animationCount = 0 userGuessNumberState() } } function userGuessNumberState() { - for(var i=0; i<3; i++) { + for(var i = 0; i < 3; i++) { if(numberOfStars[i] + nbStarsToAddOrRemove[i]) items.repeatersList[2].itemAt(i).authorizeClick = true } magicHat.state = "GuessNumber" } function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1) + min); } diff --git a/src/activities/magic-hat-minus/resource/1/Data.qml b/src/activities/magic-hat-minus/resource/1/Data.qml new file mode 100644 index 000000000..2f56a9c16 --- /dev/null +++ b/src/activities/magic-hat-minus/resource/1/Data.qml @@ -0,0 +1,43 @@ +/* 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("Learn to calculate remaining stars up to 5") + difficulty: 1 + property int maxValue: 5 + data: [ + { + "minStars" : [2, 0, 0], + "maxStars" : [3, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [4, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [5, 0, 0] + } + ] +} diff --git a/src/activities/magic-hat-minus/resource/2/Data.qml b/src/activities/magic-hat-minus/resource/2/Data.qml new file mode 100644 index 000000000..c8f68417c --- /dev/null +++ b/src/activities/magic-hat-minus/resource/2/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("Learn to calculate remaining stars up to 10") + difficulty: 2 + property int maxValue: 10 + data: [ + { + "minStars" : [2, 0, 0], + "maxStars" : [3, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [5, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [6, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [7, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [8, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [9, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [10, 0, 0] + } + ] +} diff --git a/src/activities/magic-hat-minus/resource/3/Data.qml b/src/activities/magic-hat-minus/resource/3/Data.qml new file mode 100644 index 000000000..eec3acaac --- /dev/null +++ b/src/activities/magic-hat-minus/resource/3/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("Learn to calculate remaining stars up to 30") + difficulty: 3 + property int maxValue: 30 + data: [ + { + "minStars" : [2, 0, 0], + "maxStars" : [5, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [10, 0, 0] + }, + { + "minStars" : [2, 2, 0], + "maxStars" : [8, 8, 0] + }, + { + "minStars" : [2, 2, 0], + "maxStars" : [10, 10, 0] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [9, 9, 7] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [10, 10, 10] + } + ] +} diff --git a/src/activities/magic-hat-minus/resource/4/Data.qml b/src/activities/magic-hat-minus/resource/4/Data.qml new file mode 100644 index 000000000..4e9a65fd1 --- /dev/null +++ b/src/activities/magic-hat-minus/resource/4/Data.qml @@ -0,0 +1,51 @@ +/* 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("Learn to calculate remaining stars up to 100 with coefficients") + difficulty: 4 + property int maxValue: 100 + data: [ + { + "minStars" : [2, 2, 0], + "maxStars" : [20, 10, 0] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [20, 20, 10] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [20, 20, 20] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [30, 30, 20] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [40, 40, 20] + } + ] +} diff --git a/src/activities/magic-hat-minus/resource/5/Data.qml b/src/activities/magic-hat-minus/resource/5/Data.qml new file mode 100644 index 000000000..cae43b448 --- /dev/null +++ b/src/activities/magic-hat-minus/resource/5/Data.qml @@ -0,0 +1,51 @@ +/* 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("Learn to calculate remaining stars up to 1000 with coefficients") + difficulty: 5 + property int maxValue: 1000 + data: [ + { + "minStars" : [2, 0, 0], + "maxStars" : [100, 0, 0] + }, + { + "minStars" : [2, 2, 0], + "maxStars" : [100, 100, 0] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [200, 200, 100] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [300, 300, 100] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [400, 400, 200] + } + ] +} diff --git a/src/activities/magic-hat-minus/resource/6/Data.qml b/src/activities/magic-hat-minus/resource/6/Data.qml new file mode 100644 index 000000000..9db84196a --- /dev/null +++ b/src/activities/magic-hat-minus/resource/6/Data.qml @@ -0,0 +1,51 @@ +/* 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("Learn to calculate remaining stars up to 10000 with coefficients") + difficulty: 6 + property int maxValue: 10000 + data: [ + { + "minStars" : [2, 0, 0], + "maxStars" : [1000, 0, 0] + }, + { + "minStars" : [2, 2, 0], + "maxStars" : [1000, 1000, 0] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [2000, 2000, 1000] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [3000, 3000, 1000] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [4000, 4000, 2000] + } + ] +} diff --git a/src/activities/magic-hat-plus/ActivityInfo.qml b/src/activities/magic-hat-plus/ActivityInfo.qml index 363966f9e..da9492174 100644 --- a/src/activities/magic-hat-plus/ActivityInfo.qml +++ b/src/activities/magic-hat-plus/ActivityInfo.qml @@ -1,40 +1,41 @@ /* GCompris - ActivityInfo.qml * * Copyright (C) 2015 Thib ROMAIN * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import GCompris 1.0 ActivityInfo { name: "magic-hat-plus/MagicHatPlus.qml" difficulty: 2 icon: "magic-hat-plus/magic-hat-plus.svg" author: "Thib ROMAIN <thibrom@gmail.com>" demo: true //: Activity title title: qsTr("The magician hat") //: Help title description: qsTr("Count how many items are under the magic hat") // intro: "Count the number of stars hidden under the hat and then click on the stars to indicate their number." //: Help goal goal: qsTr("Learn addition") //: Help prerequisite prerequisite: qsTr("Addition") //: Help manual manual: qsTr("Click on the hat to open it. Under the hat, how many stars can you see moving around? Count carefully. Click on the bottom area to input your answer and on the OK button to validate your answer.") credit: "" section: "math arithmetic" createdInVersion: 0 + levels: "1,2,3,4,5,6" } diff --git a/src/activities/magic-hat-plus/resource/1/Data.qml b/src/activities/magic-hat-plus/resource/1/Data.qml new file mode 100644 index 000000000..535d044a1 --- /dev/null +++ b/src/activities/magic-hat-plus/resource/1/Data.qml @@ -0,0 +1,43 @@ +/* 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("Learn to calculate total stars up to 5") + difficulty: 1 + property int maxValue: 5 + data: [ + { + "minStars" : [2, 0, 0], + "maxStars" : [3, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [4, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [5, 0, 0] + } + ] +} diff --git a/src/activities/magic-hat-plus/resource/2/Data.qml b/src/activities/magic-hat-plus/resource/2/Data.qml new file mode 100644 index 000000000..a79fd64ce --- /dev/null +++ b/src/activities/magic-hat-plus/resource/2/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("Learn to calculate total stars up to 10") + difficulty: 2 + property int maxValue: 10 + data: [ + { + "minStars" : [2, 0, 0], + "maxStars" : [3, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [4, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [5, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [6, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [7, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [8, 0, 0] + }, + { + "minStars" : [2, 0, 0], + "maxStars" : [9, 0, 0] + } + ] +} diff --git a/src/activities/magic-hat-plus/resource/3/Data.qml b/src/activities/magic-hat-plus/resource/3/Data.qml new file mode 100644 index 000000000..76ca90633 --- /dev/null +++ b/src/activities/magic-hat-plus/resource/3/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("Learn to calculate total stars up to 30") + difficulty: 3 + property int maxValue: 30 + data: [ + { + "minStars" : [2, 0, 0], + "maxStars" : [5, 0, 0] + }, + { + "minStars" : [2, 2, 0], + "maxStars" : [7, 3, 0] + }, + { + "minStars" : [2, 2, 0], + "maxStars" : [8, 8, 0] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [8, 8, 4] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [9, 9, 7] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [9, 9, 9] + } + ] +} diff --git a/src/activities/magic-hat-plus/resource/4/Data.qml b/src/activities/magic-hat-plus/resource/4/Data.qml new file mode 100644 index 000000000..0371a7e0f --- /dev/null +++ b/src/activities/magic-hat-plus/resource/4/Data.qml @@ -0,0 +1,51 @@ +/* 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("Learn to calculate total stars up to 100 with coefficients") + difficulty: 4 + property int maxValue: 100 + data: [ + { + "minStars" : [2, 2, 0], + "maxStars" : [20, 10, 0] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [20, 20, 10] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [20, 20, 20] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [30, 30, 20] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [40, 40, 20] + } + ] +} diff --git a/src/activities/magic-hat-plus/resource/5/Data.qml b/src/activities/magic-hat-plus/resource/5/Data.qml new file mode 100644 index 000000000..274de1216 --- /dev/null +++ b/src/activities/magic-hat-plus/resource/5/Data.qml @@ -0,0 +1,51 @@ +/* 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("Learn to calculate total stars up to 1000 with coefficients") + difficulty: 5 + property int maxValue: 1000 + data: [ + { + "minStars" : [2, 0, 0], + "maxStars" : [100, 0, 0] + }, + { + "minStars" : [2, 2, 0], + "maxStars" : [100, 100, 0] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [200, 200, 100] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [300, 300, 100] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [400, 400, 200] + } + ] +} diff --git a/src/activities/magic-hat-plus/resource/6/Data.qml b/src/activities/magic-hat-plus/resource/6/Data.qml new file mode 100644 index 000000000..642eab7f9 --- /dev/null +++ b/src/activities/magic-hat-plus/resource/6/Data.qml @@ -0,0 +1,51 @@ +/* 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("Learn to calculate total stars up to 10000 with coefficients") + difficulty: 6 + property int maxValue: 10000 + data: [ + { + "minStars" : [2, 0, 0], + "maxStars" : [1000, 0, 0] + }, + { + "minStars" : [2, 2, 0], + "maxStars" : [1000, 1000, 0] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [2000, 2000, 1000] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [3000, 3000, 1000] + }, + { + "minStars" : [2, 2, 2], + "maxStars" : [4000, 4000, 2000] + } + ] +}