diff --git a/src/activities/magic-hat-minus/ActivityInfo.qml b/src/activities/magic-hat-minus/ActivityInfo.qml index 30f29097b..21cd08594 100644 --- a/src/activities/magic-hat-minus/ActivityInfo.qml +++ b/src/activities/magic-hat-minus/ActivityInfo.qml @@ -1,41 +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" + 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 853d8979a..647fb856a 100644 --- a/src/activities/magic-hat-minus/MagicHat.qml +++ b/src/activities/magic-hat-minus/MagicHat.qml @@ -1,241 +1,241 @@ /* 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: { 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 var range: activity.datasetLoader.item.range + property var 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 } } } } DialogHelp { id: dialogHelp onClose: home() } Bar { id: bar content: BarEnumContent { value: help | home | level } onHelpClicked: { displayDialog(dialogHelp) } 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 efb46393f..d350c0163 100644 --- a/src/activities/magic-hat-minus/StarsBar.qml +++ b/src/activities/magic-hat-minus/StarsBar.qml @@ -1,121 +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 var maxRange 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: qsTr(item.coefficient.toString() + " x") + text: qsTr("%1%2").arg(item.coefficient).arg("x") 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 var numberOfUserStars var items; var mode; var magicHat var numberOfStars var nbStarsToAddOrRemove var nbStarsToCount var animationCount -var coffieients = [] -var answerCofficients = [] +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 } - coefficientsNeeded = items.range / 30 <= 1 ? false : 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() } if(!coefficientsNeeded) { - coffieients[0] = coffieients[1] = coffieients[2] = 1; - answerCofficients[0] = answerCofficients[1] = answerCofficients[2] = 1; + questionCoefficients[0] = questionCoefficients[1] = questionCoefficients[2] = 1; + answerCoefficients[0] = answerCoefficients[1] = answerCoefficients[2] = 1; setCoefficientVisibility(false) setWantedColor() } else { for(var i = 0; i < 3; i++) - coffieients[i] = Math.round(items.levels[currentLevel].maxStars[i] / 10); - answerCofficients[0] = items.range / 100; - answerCofficients[1] = items.range / 20; - answerCofficients[2] = items.range / 10; + 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] / coffieients[0]) - subtractor) : 0 - numberOfStars[1] = items.levels[currentLevel].maxStars[1] > 0 ? getRandomInt(items.levels[currentLevel].minStars[1], (items.levels[currentLevel].maxStars[1] / coffieients[1]) - subtractor) : 0 - numberOfStars[2] = items.levels[currentLevel].maxStars[2] > 0 ? getRandomInt(items.levels[currentLevel].minStars[2], (items.levels[currentLevel].maxStars[2] / coffieients[2]) - subtractor) : 0 + 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 = coffieients[i] + items.repeatersList[0].itemAt(i).coefficient = questionCoefficients[i] items.repeatersList[1].itemAt(i).nbStarsOn = 0 - items.repeatersList[1].itemAt(i).coefficient = coffieients[i] + 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 = answerCofficients[i] + 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++) { - items.repeatersList[0].itemAt(i).coefficientVisible = visibility - items.repeatersList[1].itemAt(i).coefficientVisible = visibility - items.repeatersList[2].itemAt(i).coefficientVisible = visibility - items.repeatersList[0].itemAt(i).maxRange = items.range.toString() - items.repeatersList[1].itemAt(i).maxRange = items.range.toString() - items.repeatersList[2].itemAt(i).maxRange = items.range.toString() + for(var i = 0; i < 3; i++) { + for(var j = 0; j < 3; j++) { + items.repeatersList[j].itemAt(i).coefficientVisible = visibility + items.repeatersList[j].itemAt(i).maxRange = items.maxValue.toString() + } } } function setWantedColor(colorValue) { if(colorValue != null) { - for(var i=0; i<3; i++) { - items.repeatersList[0].itemAt(i).starsColor = colorValue - items.repeatersList[1].itemAt(i).starsColor = colorValue - items.repeatersList[2].itemAt(i).starsColor = colorValue + 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(items.range / 30 <= 1) { + 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 { - var userStars = numberOfUserStars[0] * answerCofficients[0] + numberOfUserStars[1] * answerCofficients[1] + - numberOfUserStars[2] * answerCofficients[2]; - var toBeStars = nbStarsToCount[0] * coffieients[0] + nbStarsToCount[1] * coffieients[1] + - nbStarsToCount[2] * coffieients[2]; - if( userStars == toBeStars) + 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 index 945f5d20e..a20bf1428 100644 --- a/src/activities/magic-hat-minus/resource/1/Data.qml +++ b/src/activities/magic-hat-minus/resource/1/Data.qml @@ -1,46 +1,46 @@ /* 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 upto 5") difficulty: 1 - property var range: 10 + property int maxValue: 10 data: [ { "level" : "1", "minStars" : [2, 0, 0], "maxStars" : [3, 0, 0] }, { "level" : "2", "minStars" : [2, 0, 0], "maxStars" : [4, 0, 0] }, { "level" : "3", "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 index 016c95074..7080fbf26 100644 --- a/src/activities/magic-hat-minus/resource/2/Data.qml +++ b/src/activities/magic-hat-minus/resource/2/Data.qml @@ -1,66 +1,66 @@ /* 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 upto 10") difficulty: 2 - property var range: 10 + property int maxValue: 10 data: [ { "level" : "1", "minStars" : [2, 0, 0], "maxStars" : [3, 0, 0] }, { "level" : "2", "minStars" : [2, 0, 0], "maxStars" : [5, 0, 0] }, { "level" : "3", "minStars" : [2, 0, 0], "maxStars" : [6, 0, 0] }, { "level" : "4", "minStars" : [2, 0, 0], "maxStars" : [7, 0, 0] }, { "level" : "5", "minStars" : [2, 0, 0], "maxStars" : [8, 0, 0] }, { "level" : "6", "minStars" : [2, 0, 0], "maxStars" : [9, 0, 0] }, { "level" : "7", "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 index b79426ef5..438f023fd 100644 --- a/src/activities/magic-hat-minus/resource/3/Data.qml +++ b/src/activities/magic-hat-minus/resource/3/Data.qml @@ -1,61 +1,61 @@ /* 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 upto 30") difficulty: 3 - property var range: 10 + property int maxValue: 10 data: [ { "level" : "1", "minStars" : [2, 0, 0], "maxStars" : [5, 0, 0] }, { "level" : "2", "minStars" : [2, 0, 0], "maxStars" : [10, 0, 0] }, { "level" : "3", "minStars" : [2, 2, 0], "maxStars" : [8, 8, 0] }, { "level" : "4", "minStars" : [2, 2, 0], "maxStars" : [10, 10, 0] }, { "level" : "5", "minStars" : [2, 2, 2], "maxStars" : [9, 9, 7] }, { "level" : "6", "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 index 31ebf6458..6d6219fe3 100644 --- a/src/activities/magic-hat-minus/resource/4/Data.qml +++ b/src/activities/magic-hat-minus/resource/4/Data.qml @@ -1,56 +1,56 @@ /* 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 upto 100 with coefficients") difficulty: 4 - property var range: 100 + property int maxValue: 100 data: [ { "level" : "1", "minStars" : [2, 2, 0], "maxStars" : [20, 10, 0] }, { "level" : "2", "minStars" : [2, 2, 2], "maxStars" : [20, 20, 10] }, { "level" : "3", "minStars" : [2, 2, 2], "maxStars" : [20, 20, 20] }, { "level" : "4", "minStars" : [2, 2, 2], "maxStars" : [30, 30, 20] }, { "level" : "5", "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 index cf6234343..3875e20a3 100644 --- a/src/activities/magic-hat-minus/resource/5/Data.qml +++ b/src/activities/magic-hat-minus/resource/5/Data.qml @@ -1,56 +1,56 @@ /* 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 upto 1000 with coefficients") difficulty: 5 - property var range: 1000 + property int maxValue: 1000 data: [ { "level" : "1", "minStars" : [2, 0, 0], "maxStars" : [100, 0, 0] }, { "level" : "2", "minStars" : [2, 2, 0], "maxStars" : [100, 100, 0] }, { "level" : "3", "minStars" : [2, 2, 2], "maxStars" : [200, 200, 100] }, { "level" : "4", "minStars" : [2, 2, 2], "maxStars" : [300, 300, 100] }, { "level" : "5", "minStars" : [2, 2, 2], "maxStars" : [400, 400, 200] } ] } diff --git a/src/activities/magic-hat-minus/resource/5/Data.qml b/src/activities/magic-hat-minus/resource/6/Data.qml similarity index 82% copy from src/activities/magic-hat-minus/resource/5/Data.qml copy to src/activities/magic-hat-minus/resource/6/Data.qml index cf6234343..48aedaf99 100644 --- a/src/activities/magic-hat-minus/resource/5/Data.qml +++ b/src/activities/magic-hat-minus/resource/6/Data.qml @@ -1,56 +1,56 @@ /* 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 upto 1000 with coefficients") - difficulty: 5 - property var range: 1000 + difficulty: 6 + property int maxValue: 10000 data: [ { "level" : "1", - "minStars" : [2, 0, 0], - "maxStars" : [100, 0, 0] + "minStars" : [2, 2, 0], + "maxStars" : [500, 500, 0] }, { "level" : "2", "minStars" : [2, 2, 0], - "maxStars" : [100, 100, 0] + "maxStars" : [1000, 1000, 0] }, { "level" : "3", "minStars" : [2, 2, 2], - "maxStars" : [200, 200, 100] + "maxStars" : [2000, 2000, 1000] }, { "level" : "4", "minStars" : [2, 2, 2], - "maxStars" : [300, 300, 100] + "maxStars" : [3000, 3000, 1000] }, { "level" : "5", "minStars" : [2, 2, 2], - "maxStars" : [400, 400, 200] + "maxStars" : [4000, 4000, 2000] } ] } diff --git a/src/activities/magic-hat-plus/resource/1/Data.qml b/src/activities/magic-hat-plus/resource/1/Data.qml index ad4d36998..bfe015162 100644 --- a/src/activities/magic-hat-plus/resource/1/Data.qml +++ b/src/activities/magic-hat-plus/resource/1/Data.qml @@ -1,46 +1,46 @@ /* 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 upto 5") difficulty: 1 - property var range: 5 + property int maxValue: 5 data: [ { "level" : "1", "minStars" : [2, 0, 0], "maxStars" : [3, 0, 0] }, { "level" : "2", "minStars" : [2, 0, 0], "maxStars" : [4, 0, 0] }, { "level" : "3", "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 index db5f9b7a3..0feefa268 100644 --- a/src/activities/magic-hat-plus/resource/2/Data.qml +++ b/src/activities/magic-hat-plus/resource/2/Data.qml @@ -1,66 +1,66 @@ /* 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 upto 10") difficulty: 2 - property var range: 10 + property int maxValue: 10 data: [ { "level" : "1", "minStars" : [2, 0, 0], "maxStars" : [3, 0, 0] }, { "level" : "2", "minStars" : [2, 0, 0], "maxStars" : [4, 0, 0] }, { "level" : "3", "minStars" : [2, 0, 0], "maxStars" : [5, 0, 0] }, { "level" : "4", "minStars" : [2, 0, 0], "maxStars" : [6, 0, 0] }, { "level" : "5", "minStars" : [2, 0, 0], "maxStars" : [7, 0, 0] }, { "level" : "6", "minStars" : [2, 0, 0], "maxStars" : [8, 0, 0] }, { "level" : "7", "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 index 3d84461d7..11cbdb214 100644 --- a/src/activities/magic-hat-plus/resource/3/Data.qml +++ b/src/activities/magic-hat-plus/resource/3/Data.qml @@ -1,61 +1,61 @@ /* 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 upto 30") difficulty: 3 - property var range: 30 + property int maxValue: 30 data: [ { "level" : "1", "minStars" : [2, 0, 0], "maxStars" : [5, 0, 0] }, { "level" : "2", "minStars" : [2, 2, 0], "maxStars" : [7, 3, 0] }, { "level" : "3", "minStars" : [2, 2, 0], "maxStars" : [8, 8, 0] }, { "level" : "4", "minStars" : [2, 2, 2], "maxStars" : [8, 8, 4] }, { "level" : "5", "minStars" : [2, 2, 2], "maxStars" : [9, 9, 7] }, { "level" : "6", "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 index f3ada840d..0feefd417 100644 --- a/src/activities/magic-hat-plus/resource/4/Data.qml +++ b/src/activities/magic-hat-plus/resource/4/Data.qml @@ -1,56 +1,56 @@ /* 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 upto 100 with coefficients") difficulty: 4 - property var range: 100 + property int maxValue: 100 data: [ { "level" : "1", "minStars" : [2, 2, 0], "maxStars" : [20, 10, 0] }, { "level" : "2", "minStars" : [2, 2, 2], "maxStars" : [20, 20, 10] }, { "level" : "3", "minStars" : [2, 2, 2], "maxStars" : [20, 20, 20] }, { "level" : "4", "minStars" : [2, 2, 2], "maxStars" : [30, 30, 20] }, { "level" : "5", "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-plus/resource/5/Data.qml similarity index 92% copy from src/activities/magic-hat-minus/resource/5/Data.qml copy to src/activities/magic-hat-plus/resource/5/Data.qml index cf6234343..2ba4aa638 100644 --- a/src/activities/magic-hat-minus/resource/5/Data.qml +++ b/src/activities/magic-hat-plus/resource/5/Data.qml @@ -1,56 +1,56 @@ /* 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 upto 1000 with coefficients") + objective: qsTr("Learn to calculate total stars upto 1000 with coefficients") difficulty: 5 - property var range: 1000 + property int maxValue: 1000 data: [ { "level" : "1", "minStars" : [2, 0, 0], "maxStars" : [100, 0, 0] }, { "level" : "2", "minStars" : [2, 2, 0], "maxStars" : [100, 100, 0] }, { "level" : "3", "minStars" : [2, 2, 2], "maxStars" : [200, 200, 100] }, { "level" : "4", "minStars" : [2, 2, 2], "maxStars" : [300, 300, 100] }, { "level" : "5", "minStars" : [2, 2, 2], "maxStars" : [400, 400, 200] } ] } diff --git a/src/activities/magic-hat-minus/resource/4/Data.qml b/src/activities/magic-hat-plus/resource/6/Data.qml similarity index 77% copy from src/activities/magic-hat-minus/resource/4/Data.qml copy to src/activities/magic-hat-plus/resource/6/Data.qml index 31ebf6458..eb309e80b 100644 --- a/src/activities/magic-hat-minus/resource/4/Data.qml +++ b/src/activities/magic-hat-plus/resource/6/Data.qml @@ -1,56 +1,56 @@ /* 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 upto 100 with coefficients") - difficulty: 4 - property var range: 100 + objective: qsTr("Learn to calculate total stars upto 10000 with coefficients") + difficulty: 6 + property int maxValue: 10000 data: [ { "level" : "1", "minStars" : [2, 2, 0], - "maxStars" : [20, 10, 0] + "maxStars" : [500, 500, 0] }, { "level" : "2", - "minStars" : [2, 2, 2], - "maxStars" : [20, 20, 10] + "minStars" : [2, 2, 0], + "maxStars" : [1000, 1000, 0] }, { "level" : "3", "minStars" : [2, 2, 2], - "maxStars" : [20, 20, 20] + "maxStars" : [2000, 2000, 1000] }, { "level" : "4", "minStars" : [2, 2, 2], - "maxStars" : [30, 30, 20] + "maxStars" : [3000, 3000, 1000] }, { "level" : "5", "minStars" : [2, 2, 2], - "maxStars" : [40, 40, 20] + "maxStars" : [4000, 4000, 2000] } ] }