diff --git a/src/activities/scalesboard/ActivityInfo.qml b/src/activities/scalesboard/ActivityInfo.qml --- a/src/activities/scalesboard/ActivityInfo.qml +++ b/src/activities/scalesboard/ActivityInfo.qml @@ -37,4 +37,5 @@ credit:"" section: "math measures" createdInVersion: 0 + levels: "1,2,3,4,5" } diff --git a/src/activities/scalesboard/MasseArea.qml b/src/activities/scalesboard/MasseArea.qml --- a/src/activities/scalesboard/MasseArea.qml +++ b/src/activities/scalesboard/MasseArea.qml @@ -114,7 +114,7 @@ height: parent.height * 2 enabled: dropEnabledForThisLevel && dropEnabled } - + Flow { id: masseFlow anchors.topMargin: 4 @@ -191,6 +191,7 @@ enabled: model.dragEnabled onPressed: { + message.text = "" if(masseModel.contains(parent.masseIndex)) { parent.initDrag() } @@ -241,10 +242,10 @@ parent.Drag.cancel() parent.replace() } - + } } - + GCText { id: text anchors.fill: parent @@ -271,7 +272,7 @@ source: text } } - + } } diff --git a/src/activities/scalesboard/Question.qml b/src/activities/scalesboard/Question.qml --- a/src/activities/scalesboard/Question.qml +++ b/src/activities/scalesboard/Question.qml @@ -26,7 +26,6 @@ id: question property string text - property bool displayed: text != "" ? true : false property string answer property string userEntry @@ -39,7 +38,6 @@ border.color: "black" border.width: 2 radius: 8 - opacity: question.displayed ? 1 : 0 gradient: Gradient { GradientStop { position: 0.0; color: "#F0FFFFFF" } @@ -58,14 +56,8 @@ horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter wrapMode: TextEdit.WordWrap - opacity: question.displayed ? 1 : 0 text: question.text != "" ? question.text.arg(question.userEntry) : "" Behavior on opacity { NumberAnimation { duration: 100 } } } - - onUserEntryChanged: { - if(userEntry === question.answer) - bonus.good("flower") - } } diff --git a/src/activities/scalesboard/ScaleNumber.qml b/src/activities/scalesboard/ScaleNumber.qml --- a/src/activities/scalesboard/ScaleNumber.qml +++ b/src/activities/scalesboard/ScaleNumber.qml @@ -21,79 +21,5 @@ */ Scalesboard { - dataset: [ - { - "masses": [[1, "1"], [2, "2"], [2, "2"], [5, "5"], [5, "5"], [10, "10"], [10, "10"]], - "targets": [[3, "3"], [4, "4"], [6, "6"], [7, "7"], [8, "8"], [9, "9"]], - "rightDrop": false - }, - { - "masses": [[1, "1"], [2, "2"], [2, "2"], [5, "5"], [5, "5"], [10, "10"], [10, "10"]], - "targets": [[3, "3"], [4, "4"], [6, "6"], [7, "7"], [8, "8"], [9, "9"]], - "rightDrop": false - }, - { - "masses": [[1, "1"], [2, "2"], [2, "2"], [5, "5"], [5, "5"], [10, "10"], [10, "10"]], - "targets": [[12, "12"], [13, "13"], [14, "14"], [15, "15"], [16, "16"]], - "rightDrop": false - }, - { - "masses": [[2, "2"], [2, "2"], [5, "5"], [5, "5"], [5, "5"]], - "targets": [[8, "8"], [11, "11"], [13, "13"]], - "rightDrop": true, - "message": qsTr("Take care, you can drop weights on both sides of the scale.") - }, - { - "masses": [[2, "2"], [5, "5"], [10, "10"], [10, "10"], [12, "12"]], - "targets": [[3, "3"], [8, "8"], [13, "13"]], - "rightDrop": true - }, - { - "masses": [[2, "2"], [4, "4"], [7, "7"], [10, "10"], [12, "12"]], - "targets": [[3, "3"], [5, "5"], [8, "8"], [9, "9"]], - "rightDrop": true - }, - { - "masses": [[5, "5"], [8, "8"], [9, "9"], [10, "10"], [11, "11"], [12, "12"]], - "targets": [[6, "6"], [7, "7"], [13, "13"], [14, "14"], [15, "15"], [16, "16"], - [17, "17"], [18, "18"]], - "rightDrop": true - }, - { - "masses": [[1, "1"], [2, "2"], [2, "2"], [5, "5"], [5, "5"], [10, "10"], [10, "10"]], - "targets": [[3, "3"], [4, "4"], [6, "6"], [7, "7"], [8, "8"], [9, "9"]], - "rightDrop": false, - "message": qsTr("Now you have to guess the weight of the gift."), - "question": qsTr("Enter the weight of the gift: %1") - }, - { - "masses": [[2, "2"], [2, "2"], [5, "5"], [5, "5"], [5, "5"]], - "targets": [[8, "8"], [11, "11"], [13, "13"]], - "rightDrop": true, - "message": qsTr("Take care, you can drop weights on both sides of the scale."), - "question": qsTr("Enter the weight of the gift: %1") - }, - { - "masses": [[2, "2"], [5, "5"], [10, "10"], [10, "10"], [12, "12"]], - "targets": [[3, "3"], [8, "8"], [13, "13"]], - "rightDrop": true, - "question": qsTr("Enter the weight of the gift: %1") - }, - { - "masses": [[2, "2"], [4, "4"], [7, "7"], [10, "10"], [12, "12"]], - "targets": [[3, "3"], [5, "5"], [8, "8"], [9, "9"]], - "rightDrop": true, - "question": qsTr("Enter the weight of the gift: %1") - }, - { - "masses": [[5, "5"], [8, "8"], [9, "9"], [10, "10"], [11, "11"], [12, "12"]], - "targets": [[6, "6"], [7, "7"], [13, "13"], [14, "14"], [15, "15"], [16, "16"], - [17, "17"], [18, "18"]], - "rightDrop": true, - "question": qsTr("Enter the weight of the gift: %1") - }, -] - - } diff --git a/src/activities/scalesboard/Scalesboard.qml b/src/activities/scalesboard/Scalesboard.qml --- a/src/activities/scalesboard/Scalesboard.qml +++ b/src/activities/scalesboard/Scalesboard.qml @@ -29,7 +29,6 @@ ActivityBase { id: activity - property var dataset onStart: focus = true onStop: {} @@ -47,6 +46,7 @@ items.masseAreaLeft.weight > items.masseAreaRight.weight ? 20 : -20 Component.onCompleted: { + dialogActivityConfig.initialize() activity.start.connect(start) activity.stop.connect(stop) } @@ -61,25 +61,23 @@ property int numberOfSubLevels property int currentSubLevel property int giftWeight - property var dataset: activity.dataset + property int scaleHeight: background.scaleHeight + property var levels: activity.datasetLoader.data property alias masseAreaCenter: masseAreaCenter property alias masseAreaLeft: masseAreaLeft property alias masseAreaRight: masseAreaRight property alias masseCenterModel: masseAreaCenter.masseModel property alias masseRightModel: masseAreaRight.masseModel property alias question: question property alias numpad: numpad + property bool rightDrop } onStart: { Activity.start(items) } onStop: { Activity.stop() } property bool vert: background.width > background.height - onScaleHeightChanged: Activity.initCompleted && scaleHeight == 0 && question.hasText == "" ? - bonus.good("flower") : - activity.audioEffects.play('qrc:/gcompris/src/activities/erase/resource/eraser2.wav') - Image { id: scale source: Activity.url + "scale.svg" @@ -195,7 +193,7 @@ masseAreaLeft: masseAreaLeft masseAreaRight: masseAreaRight nbColumns: 3 - dropEnabledForThisLevel: items.dataset[bar.level - 1].rightDrop + dropEnabledForThisLevel: items.rightDrop audioEffects: activity.audioEffects Behavior on anchors.verticalCenterOffset { @@ -221,7 +219,6 @@ audioEffects: activity.audioEffects } - Message { id: message anchors { @@ -241,29 +238,69 @@ y: parent.height * 0.45 z: 1000 width: parent.width - y - text: items.dataset[bar.level - 1].question && background.scaleHeight == 0 ? - items.dataset[bar.level - 1].question : "" answer: items.giftWeight + visible: (items.question.text && background.scaleHeight === 0) ? true : false + } + + DialogChooseLevel { + id: dialogActivityConfig + currentActivity: activity.activityInfo - property bool hasText: items.dataset[bar.level - 1].question ? true : false + onSaveData: { + levelFolder = dialogActivityConfig.chosenLevels + currentActivity.currentLevels = dialogActivityConfig.chosenLevels + ApplicationSettings.setCurrentLevels(currentActivity.name, dialogActivityConfig.chosenLevels) + // restart activity on saving + background.start() + } + onClose: { + home() + } + onStartActivity: { + background.start() + } } DialogHelp { id: dialogHelp onClose: home() } + BarButton { + id: okButton + source: "qrc:/gcompris/src/core/resource/bar_ok.svg" + sourceSize.width: 60 * ApplicationInfo.ratio + anchors.bottom: bar.top + anchors.bottomMargin: parent.width * 0.03 + anchors.left: score.left + anchors.leftMargin: parent.width * 0.01 + visible: (!question.text || items.question.userEntry) ? true : false + ParticleSystemStarLoader { + id: okButtonParticles + clip: false + } + MouseArea { + id: okButtonMouseArea + anchors.fill: parent + onClicked: { + Activity.checkAnswer() + } + } + } + Bar { id: bar - content: BarEnumContent { value: help | home | level } + content: BarEnumContent { value: help | home | level | activityConfig } onHelpClicked: { displayDialog(dialogHelp) } onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: activity.home() - - onLevelChanged: message.text = items.dataset[bar.level - 1].message ? items.dataset[bar.level - 1].message : "" + onActivityConfigClicked: { + displayDialog(dialogActivityConfig) + } + onLevelChanged: message.text = items.levels[bar.level - 1].message ? items.levels[bar.level - 1].message : "" } Score { @@ -276,25 +313,27 @@ numberOfSubLevels: items.numberOfSubLevels currentSubLevel: items.currentSubLevel - opacity: question.displayed ? 0 : 1 } NumPad { id: numpad onAnswerChanged: question.userEntry = answer maxDigit: ('' + items.giftWeight).length + 1 - opacity: question.displayed ? 1 : 0 + opacity: question.visible ? 1 : 0 columnWidth: 60 * ApplicationInfo.ratio } Keys.onPressed: { - if(question.displayed) { - numpad.updateAnswer(event.key, true); + if(okButton.visible && (event.key === Qt.Key_Enter || event.key === Qt.Key_Return)) { + Activity.checkAnswer() + } + else if(question.visible) { + numpad.updateAnswer(event.key, true); } } Keys.onReleased: { - if(question.displayed) { + if(question.visible) { numpad.updateAnswer(event.key, false); } } diff --git a/src/activities/scalesboard/resource/1/Data.qml b/src/activities/scalesboard/resource/1/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard/resource/1/Data.qml @@ -0,0 +1,51 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 5.") + difficulty: 2 + data: [ + { + "masses": [[1, "1"], [1, "1"], [2, "2"], [1, "1"], [2, "2"], [1, "1"], [2, "2"]], + "targets": [[3, "3"], [4, "4"], [5, "5"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[6, "6"], [9, "9"], [2, "2"], [7, "7"], [6, "6"], [7, "7"], [8, "8"]], + "targets": [[4, "4"], [3, "3"], [5, "5"]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + }, + { + "masses": [[1, "1"], [1, "1"], [2, "2"], [1, "1"], [2, "2"], [1, "1"], [2, "2"]], + "targets": [[4, "4"], [3, "3"], [5, "5"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + } + ] +} + + + + diff --git a/src/activities/scalesboard/resource/2/Data.qml b/src/activities/scalesboard/resource/2/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard/resource/2/Data.qml @@ -0,0 +1,76 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 10.") + difficulty: 2 + data: [ + { + "masses": [[1, "1"], [1, "1"], [2, "2"], [1, "1"], [2, "2"], [1, "1"], [2, "2"]], + "targets": [[3, "3"], [4, "4"], [5, "5"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[1, "1"], [2, "2"], [2, "2"], [1, "1"], [2, "2"], [1, "1"], [2, "2"]], + "targets": [[3, "3"], [4, "4"], [5, "5"],[7,"7"],[8,"8"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[1, "1"], [1, "1"], [2, "2"], [1, "1"], [2, "2"], [1, "1"], [2, "2"]], + "targets": [[3, "3"], [4, "4"], [5, "5"],[7,"7"],[8,"8"],[10,"10"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[6, "6"], [7, "7"], [3, "3"], [7, "7"], [6, "6"], [7, "7"], [9, "9"]], + "targets": [[4, "4"], [8,"8"], [5, "5"]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale.") + }, + { + "masses": [[6, "6"], [9, "9"], [6, "6"], [5, "5"], [9, "9"], [7, "7"], [11, "11"]], + "targets": [[3, "3"], [8, "8"], [7,"7"],[10,"10"]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[1, "1"], [3, "3"], [2, "2"], [5, "5"], [7, "7"], [1, "1"], [2, "2"]], + "targets": [[4, "4"], [7, "7"], [10, "10"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + }, + { + "masses": [[1, "1"], [8, "8"], [2, "2"], [2, "2"], [7, "7"], [9, "9"], [6, "6"]], + "targets": [[4, "4"], [7, "7"], [10, "10"],[5,"5"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + } + ] +} + + + + diff --git a/src/activities/scalesboard/resource/3/Data.qml b/src/activities/scalesboard/resource/3/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard/resource/3/Data.qml @@ -0,0 +1,89 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 20.") + difficulty: 3 + data: [ + { + "masses": [[1, "1"], [1, "1"], [2, "2"], [1, "1"], [2, "2"], [1, "1"], [2, "2"]], + "targets": [[3, "3"], [4, "4"], [5, "5"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[1, "1"], [2, "2"], [2, "2"], [4, "4"], [2, "2"], [1, "1"], [2, "2"]], + "targets": [[3, "3"], [4, "4"], [5, "5"],[7,"7"],[8,"8"], [10,"10"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[3, "3"], [5, "5"], [7, "7"], [8, "8"], [9, "9"], [2, "2"], [5, "5"]], + "targets": [[8, "8"], [13, "13"], [15, "15"],[17,"17"],[20,"20"],[10,"10"],[11,"11"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[6, "6"], [9, "9"], [2, "2"], [5 ,"5"], [6, "6"], [10, "10"], [11, "11"]], + "targets": [[7, "7"], [8,"8"], [1, "1"]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale.") + }, + { + "masses": [[6, "6"], [4, "4"], [12, "12"], [11, "11"], [4, "4"], [13, "13"], [14, "14"]], + "targets": [[3, "3"], [8,"8"], [9, "9"], [7,"7"],[10,"10"]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[10, "10"], [7, "7"], [6, "6"], [11, "11"], [13, "13"], [11, "11"], [3, "3"]], + "targets": [[12, "12"], [15,"15"], [19, "19"], [20,"20"],[17,"17"]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[1, "1"], [3, "3"], [2, "2"], [5, "5"], [7, "7"], [1, "1"], [2, "2"]], + "targets": [[4, "4"], [7, "7"], [10, "10"],[6,"6"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + }, + { + "masses": [[1, "1"], [8, "8"], [2, "2"], [1, "1"], [7, "7"], [9, "9"], [10, "10"]], + "targets": [[4, "4"], [7, "7"], [10, "10"],[5,"5"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + }, + { + "masses": [[3, "3"], [5, "5"], [7, "7"], [8, "8"], [9, "9"], [2, "2"], [4, "4"]], + "targets": [[8, "8"], [13, "13"], [15, "15"],[17,"17"],[20,"20"],[10,"10"],[11,"11"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + } + ] +} + + + + diff --git a/src/activities/scalesboard/resource/4/Data.qml b/src/activities/scalesboard/resource/4/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard/resource/4/Data.qml @@ -0,0 +1,89 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 50.") + difficulty: 3 + data: [ + { + "masses": [[3, "3"], [5, "5"], [7, "7"], [8, "8"], [9, "9"], [2, "2"], [5, "5"]], + "targets": [[8, "8"], [13, "13"], [15, "15"],[17,"17"],[20,"20"],[10,"10"],[11,"11"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[10, "10"], [11, "11"], [14, "14"], [5, "5"], [15, "15"], [13, "13"], [12, "12"]], + "targets": [[22, "22"], [28, "28"], [19, "19"],[30,"30"],[20,"20"],[25,"25"],[27,"27"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[20, "20"], [28, "28"], [30, "30"], [12, "12"], [17, "17"], [29, "29"], [15, "15"]], + "targets": [[35, "35"], [48, "48"], [40, "40"], [50, "50"], [37, "37"], [49, "49"], [43, "43"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[10, "10"], [7, "7"], [6, "6"], [11, "11"], [13, "13"], [11, "11"], [3, "3"]], + "targets": [[12, "12"], [15,"15"], [19, "19"], [20,"20"],[17,"17"]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[14, "14"], [17, "17"], [5, "5"], [15, "15"], [22, "22"], [10, "10"], [20, "20"]], + "targets": [[23, "23"], [25,"25"], [29, "29"], [30,"30"],[17,"17"]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[21, "21"], [4, "4"], [15, "15"], [22, "22"], [24, "24"], [23, "23"], [24, "24"]], + "targets": [[42, "42"], [48,"48"], [39, "39"], [47,"47"]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[1, "1"], [7, "7"], [2, "2"], [5, "5"], [7, "7"], [1, "1"], [2, "2"]], + "targets": [[14, "14"], [19, "19"], [11, "11"],[15,"15"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + }, + { + "masses": [[11, "11"], [6, "6"], [2, "2"], [12, "12"], [13, "13"], [9, "9"], [10, "10"]], + "targets": [[17, "17"], [29, "29"], [23, "23"],[25,"25"],[21,"21"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + }, + { + "masses": [[23, "23"], [22, "22"], [30, "30"], [8, "8"], [24, "24"], [22, "22"], [20, "20"]], + "targets": [[44, "44"], [38, "38"], [50, "50"],[31,"31"],[47,"47"],[43,"43"],[30,"30"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + } + ] +} + + + + diff --git a/src/activities/scalesboard/resource/5/Data.qml b/src/activities/scalesboard/resource/5/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard/resource/5/Data.qml @@ -0,0 +1,109 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 100.") + difficulty: 4 + data: [ + { + "masses": [[3, "3"], [5, "5"], [7, "7"], [8, "8"], [9, "9"], [2, "2"], [5, "5"]], + "targets": [[8, "8"], [13, "13"], [15, "15"],[17,"17"],[20,"20"],[10,"10"],[11,"11"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[10, "10"], [11, "11"], [14, "14"], [5, "5"], [15, "15"], [13, "13"], [12, "12"]], + "targets": [[22, "22"], [28, "28"], [19, "19"],[30,"30"],[20,"20"],[25,"25"],[27,"27"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[20, "20"], [28, "28"], [30, "30"], [12, "12"], [17, "17"], [29, "29"], [15, "15"]], + "targets": [[35, "35"], [48, "48"], [40, "40"], [50, "50"], [37, "37"], [49, "49"], [43, "43"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[50, "50"], [28, "28"], [15, "15"], [10, "10"], [17, "17"], [29, "29"], [28, "28"]], + "targets": [[65, "65"], [78, "78"], [60, "60"], [94, "94"], [77, "77"], [85, "85"], [89, "89"]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[20, "20"], [14, "14"], [21, "21"], [13, "13"], [14, "14"], [22, "22"], [12, "12"]], + "targets": [[23, "23"], [25,"25"], [29, "29"], [30,"30"],[17,"17"]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[8, "8"], [6, "6"], [15, "15"], [10, "10"], [25, "25"], [23, "23"], [24, "24"]], + "targets": [[42, "42"], [41,"41"], [39, "39"], [40,"40"]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[50, "50"], [7, "7"], [18, "18"], [22, "22"], [24, "24"], [20, "20"], [13, "13"]], + "targets": [[83, "83"], [81,"81"], [79, "79"], [87,"87"]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[11, "11"], [6, "6"], [2, "2"], [12, "12"], [13, "13"], [9, "9"], [10, "10"]], + "targets": [[17, "17"], [29, "29"], [23, "23"],[25,"25"],[21,"21"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + }, + { + "masses": [[23, "23"], [22, "22"], [30, "30"], [8, "8"], [24, "24"], [22, "22"], [20, "20"]], + "targets": [[44, "44"], [38, "38"], [50, "50"],[31,"31"],[47,"47"],[43,"43"],[30,"30"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + }, + { + "masses": [[10, "10"], [11, "11"], [14, "14"], [5, "5"], [15, "15"], [13, "13"], [12, "12"]], + "targets": [[22, "22"], [28, "28"], [19, "19"],[30,"30"],[20,"20"],[25,"25"],[27,"27"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + }, + { + "masses": [[20, "20"], [28, "28"], [30, "30"], [12, "12"], [17, "17"], [29, "29"], [15, "15"]], + "targets": [[35, "35"], [48, "48"], [40, "40"], [50, "50"], [37, "37"], [49, "49"], [43, "43"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + }, + { + "masses": [[50, "50"], [28, "28"], [15, "15"], [10, "10"], [17, "17"], [29, "29"], [28, "28"]], + "targets": [[65, "65"], [78, "78"], [60, "60"], [94, "94"], [77, "77"], [85, "85"], [89, "89"]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift: %1") + } + ] +} + + + + diff --git a/src/activities/scalesboard/scalesboard.js b/src/activities/scalesboard/scalesboard.js --- a/src/activities/scalesboard/scalesboard.js +++ b/src/activities/scalesboard/scalesboard.js @@ -34,18 +34,20 @@ function start(items_) { items = items_ currentLevel = 0 - numberOfLevel = items.dataset.length + numberOfLevel = items.levels.length initLevel() } function stop() { } function initLevel() { items.bar.level = currentLevel + 1 - currentTargets = Core.shuffle(items.dataset[currentLevel].targets) + currentTargets = Core.shuffle(items.levels[currentLevel].targets) items.currentSubLevel = 1 items.numberOfSubLevels = currentTargets.length + items.rightDrop = items.levels[currentLevel].rightDrop + items.question.text = items.levels[currentLevel].question != undefined ? items.levels[currentLevel].question : "" displayLevel() } @@ -57,7 +59,7 @@ items.masseAreaLeft.init() items.masseAreaRight.init() items.masseAreaCenter.init() - var data = items.dataset[currentLevel] + var data = items.levels[currentLevel] for(var i=0; i < data.masses.length; i++) items.masseAreaCenter.addMasse("masse" + (i % 5 + 1) + ".svg", data.masses[i][0], @@ -75,6 +77,16 @@ initCompleted = true } +function checkAnswer() { + if((initCompleted && items.scaleHeight == 0 && !items.question.visible) + || (items.question.userEntry == items.question.answer)) { + items.bonus.good("flower") + } + else { + items.bonus.bad("flower") + } +} + function nextSubLevel() { if(items.numberOfSubLevels < ++items.currentSubLevel ) { nextLevel(); diff --git a/src/activities/scalesboard_weight/ActivityInfo.qml b/src/activities/scalesboard_weight/ActivityInfo.qml --- a/src/activities/scalesboard_weight/ActivityInfo.qml +++ b/src/activities/scalesboard_weight/ActivityInfo.qml @@ -37,4 +37,5 @@ credit: "" section: "math measures" createdInVersion: 0 + levels: "1,2,3,4,5,6" } diff --git a/src/activities/scalesboard_weight/ScalesboardWeight.qml b/src/activities/scalesboard_weight/ScalesboardWeight.qml --- a/src/activities/scalesboard_weight/ScalesboardWeight.qml +++ b/src/activities/scalesboard_weight/ScalesboardWeight.qml @@ -23,112 +23,4 @@ Scalesboard { - function g(value) { - /* g == gram */ - return qsTr("%1 g").arg(value) - } - - function kg(value) { - /* kg == kilogram */ - return qsTr("%1 kg").arg(value) - } - - dataset: [ - { - "masses": [[1, kg(1)], [2, kg(2)], [2, kg(2)], [5, kg(5)], - [5, kg(5)], [10, kg(10)], [10, kg(10)]], - "targets": [[3, kg(3)], [4, kg(4)], [6, kg(6)], [7, kg(7)], [8, kg(8)], [9, kg(9)]], - "rightDrop": false, - "message": qsTr('The "kg" symbol at the end of a number means kilogram.') + " " + - qsTr('The kilogram is a unit of mass, a property which corresponds to the ' + - 'common perception of how "heavy" an object is.') - }, - { - "masses": [[100, g(100)], [200, g(200)], [200, g(200)], [500, g(500)], - [500, g(500)], [1000, g(1000)], [1000, g(1000)]], - "targets": [[300, g(300)], [400, g(400)], [600, g(600)], [700, g(700)], - [800, g(800)], [900, g(900)]], - "rightDrop": false, - "message": qsTr('The "g" symbol at the end of a number means gram. One kilogram equals 1000 grams') - }, - { - "masses": [[100, g(100)], [200, g(200)], [200, g(200)], [500, g(500)], - [500, g(500)], [1000, kg(1)], [1000, kg(1)]], - "targets": [[1200, kg(1.2)], [1300, kg(1.3)], [1400, kg(1.4)], - [1500, kg(1.5)], [1600, kg(1.6)]], - "rightDrop": false, - "message": qsTr('Remember, one kilogram ("kg") equals 1000 grams ("g").') - }, - { - "masses": [[200, g(200)], [500, g(500)], [1000, kg(1)], [1000, kg(1)], [1200, kg(1.2)]], - "targets": [[300, g(300)], [800, g(800)], [1300, kg(1.3)]], - "rightDrop": true, - "message": qsTr("Take care, you can drop weights on both sides of the scale.") - }, - { - "masses": [[200, g(200)], [400, g(400)], [700, g(700)], [1000, kg(1)], [1200, kg(1.2)]], - "targets": [[300, g(300)], [500, g(500)], [800, g(800)], [900, g(900)]], - "rightDrop": true - }, - { - "masses": [[500, g(500)], [800, g(800)], [900, g(900)], [1000, kg(1)], - [1100, kg(1.1)], [1200, kg(1.2)]], - "targets": [[600, g(600)], [700, g(700)], [1300, kg(1.3)], [1400, kg(1.4)], - [1500, kg(1.5)], [1600, kg(1.6)], [1700, kg(1.7)], [1800, kg(1.8)]], - "rightDrop": true - }, - { - "masses": [[1, kg(1)], [2, kg(2)], [2, kg(2)], [5, kg(5)], - [5, kg(5)], [1, kg(10)], [1, kg(10)]], - "targets": [[3, kg(3)], [4, kg(4)], [6, kg(6)], [7, kg(7)], [8, kg(8)], [9, kg(9)]], - "rightDrop": false, - "message": qsTr("Now you have to guess the weight of the gift."), - "question": qsTr("Enter the weight of the gift in kilogram: %1") - }, - { - "masses": [[100, g(100)], [200, g(200)], [200, g(200)], [500, g(500)], - [500, g(500)], [1000, g(1000)], [1000, g(1000)]], - "targets": [[300, g(300)], [400, g(400)], [600, g(600)], [700, g(700)], - [800, g(800)], [900, g(900)]], - "rightDrop": false, - "question": qsTr("Enter the weight of the gift in gram: %1") - }, - { - "masses": [[2, kg(2)], [2, kg(2)], [5, kg(5)], [5, kg(5)], [5, kg(5)]], - "targets": [[8, kg(8)], [11, kg(11)], [13, kg(13)]], - "rightDrop": true, - "message": qsTr("Take care, you can drop weights on both sides of the scale."), - "question": qsTr("Enter the weight of the gift in gram: %1") - }, - { - "masses": [[100, g(100)], [200, g(200)], [200, g(200)], [500, g(500)], - [500, g(500)], [1000, kg(1)], [1000, kg(1)]], - "targets": [[1200, kg(1.2)], [1300, kg(1.3)], [1400, kg(1.4)], - [1500, kg(1.5)], [1600, kg(1.6)]], - "rightDrop": false, - "message": qsTr("Remember, one kilogram ('kg') equals 1000 grams ('g')."), - "question": qsTr("Enter the weight of the gift in gram: %1") - }, - { - "masses": [[200, g(200)], [500, g(500)], [1000, kg(1)], [1000, kg(1)], [1200, kg(1.2)]], - "targets": [[300, g(300)], [800, g(800)], [1300, kg(1.3)]], - "rightDrop": true, - "question": qsTr("Enter the weight of the gift in gram: %1") - }, - { - "masses": [[200, g(200)], [400, g(400)], [700, g(700)], [1000, kg(1)], [1200, kg(1.2)]], - "targets": [[300, g(300)], [500, g(500)], [800, g(800)], [900, g(900)]], - "rightDrop": true, - "question": qsTr("Enter the weight of the gift in gram: %1") - }, - { - "masses": [[500, g(500)], [800, g(800)], [900, g(900)], [1000, kg(1)], - [1100, kg(1.1)], [1200, kg(1.2)]], - "targets": [[600, g(600)], [700, g(700)], [1300, kg(1.3)], [1400, kg(1.4)], - [1500, kg(1.5)], [1600, kg(1.6)], [1700, kg(1.7)], [1800, kg(1.8)]], - "rightDrop": true, - "question": qsTr("Enter the weight of the gift in gram: %1") - } -] - } diff --git a/src/activities/scalesboard_weight/resource/1/Data.qml b/src/activities/scalesboard_weight/resource/1/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight/resource/1/Data.qml @@ -0,0 +1,57 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 5 grams.") + difficulty: 2 + + function g(value) { + /* g == gram */ + return qsTr("%1 g").arg(value) + } + + data: [ + { + "masses": [[1, g(1)], [1, g(1)], [2, g(2)], [1, g(1)], [2, g(2)], [1, g(1)], [2, g(2)]], + "targets": [[3, g(3)], [4, g(4)], [5, g(5)]], + "rightDrop": false, + "message": qsTr('The "g" symbol at the end of a number means gram.') + }, + { + "masses": [[6, g(6)], [9, g(9)], [2, g(2)], [7, g(7)], [6, g(6)], [7, g(7)], [8, g(8)]], + "targets": [[4, g(4)], [3, g(3)], [5, g(5)]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + }, + { + "masses": [[1, g(1)], [1, g(1)], [2, g(2)], [1, g(1)], [2, g(2)], [1, g(1)], [2, g(2)]], + "targets": [[4, g(4)], [3, g(3)], [5, g(5)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in grams: %1") + } + ] +} + + + + diff --git a/src/activities/scalesboard_weight/resource/2/Data.qml b/src/activities/scalesboard_weight/resource/2/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight/resource/2/Data.qml @@ -0,0 +1,70 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 10 grams.") + difficulty: 2 + + function g(value) { + /* g == gram */ + return qsTr("%1 g").arg(value) + } + + data: [ + { + "masses": [[1, g(1)], [1, g(1)], [2, g(2)], [1, g(1)], [2, g(2)], [1, g(1)], [2, g(2)]], + "targets": [[3, g(3)], [4, g(4)], [5, g(5)]], + "rightDrop": false, + "message": qsTr('The "g" symbol at the end of a number means gram. \n Drop weights on the left side to balance the scale.') + }, + { + "masses": [[1, g(1)], [2, g(2)], [2, g(2)], [1, g(1)], [2, g(2)], [1, g(1)], [2, g(2)]], + "targets": [[3, g(3)], [4, g(4)], [5, g(5)],[7,g(7)],[8,g(8)], [10,g(10)],[9,g(9)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[6, g(6)], [9, g(9)], [6, g(6)], [5, g(5)], [9, g(9)], [7, g(7)], [11, g(11)]], + "targets": [[3, g(3)], [8, g(8)], [7, g(7)],[10, g(10)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[1, g(1)], [1, g(1)], [2, g(2)], [1, g(1)], [2, g(2)], [1, g(1)], [2, g(2)]], + "targets": [[4, g(4)], [1, g(1)], [5, g(5)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + }, + { + "masses": [[1, g(1)], [8, g(8)], [2, g(2)], [2, g(2)], [7, g(7)], [9, g(9)], [6, g(6)]], + "targets": [[4, g(4)], [7, g(7)], [10, g(10)],[5, g(5)], [6, g(6)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + } + ] +} + + + + diff --git a/src/activities/scalesboard_weight/resource/3/Data.qml b/src/activities/scalesboard_weight/resource/3/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight/resource/3/Data.qml @@ -0,0 +1,73 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 20 grams.") + difficulty: 3 + + function g(value) { + /* g == gram */ + return qsTr("%1 g").arg(value) + } + + data: [ + { + "masses": [[1, g(1)], [2, g(2)], [2, g(2)], [1, g(1)], [2, g(2)], [1, g(1)], [2, g(2)]], + "targets": [[3, g(3)], [4, g(4)], [5, g(5)],[7,g(7)],[8,g(8)], [10,g(10)],[9,g(9)]], + "rightDrop": false, + "message": qsTr('The "g" symbol at the end of a number means gram. \n Drop weights on the left side to balance the scale.') + + }, + { + "masses": [[10, g(10)], [2, g(2)], [3, g(3)], [1, g(1)], [2, g(2)], [1, g(1)], [5, g(5)]], + "targets": [[13, g(13)], [14, g(14)], [15, g(15)],[17,g(17)],[18,g(18)], [20,g(20)],[19,g(19)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + + }, + { + "masses": [[2, g(2)], [20, g(20)], [6, g(6)], [5, g(5)], [9, g(9)], [9, g(9)], [20, g(20)]], + "targets": [[16, g(16)], [13, g(13)], [19, g(19)],[17, g(17)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[1, g(1)], [8, g(8)], [2, g(2)], [2, g(2)], [7, g(7)], [9, g(9)], [6, g(6)]], + "targets": [[4, g(4)], [7, g(7)], [10, g(10)],[5, g(5)], [6, g(6)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + }, + { + "masses": [[10, g(10)], [2, g(2)], [3, g(3)], [1, g(1)], [2, g(2)], [1, g(1)], [5, g(5)]], + "targets": [[13, g(13)], [14, g(14)], [15, g(15)],[17,g(17)],[18,g(18)], [20,g(20)],[19,g(19)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + + }, + ] +} + + + + diff --git a/src/activities/scalesboard_weight/resource/4/Data.qml b/src/activities/scalesboard_weight/resource/4/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight/resource/4/Data.qml @@ -0,0 +1,119 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 10 kilograms.") + difficulty: 3 + + function kg(value) { + /* kg == kilogram */ + return qsTr("%1 kg").arg(value) + } + + data: [ + { + "masses": [[1, kg(1)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)]], + "targets": [[1, kg(1)], [2, kg(2)], [3, kg(3)]], + "rightDrop": false, + "message": qsTr('The "kg" symbol at the end of a number means kilogram.') + " " + + qsTr('The kilogram is a unit of mass, a property which corresponds to the ' + + 'common perception of how "heavy" an object is. \n Drop weights on the left side to balance the scale.') + }, + { + "masses": [[1, kg(1)], [2, kg(2)], [2, kg(2)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)]], + "targets": [[2, kg(2)], [4, kg(4)], [5, kg(5)],[1, kg(1)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[1, kg(1)], [2, kg(2)], [2, kg(2)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)]], + "targets": [[3, kg(3)], [4, kg(4)], [5, kg(5)],[7, kg(7)],[2, kg(2)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[1, kg(1)], [2, kg(2)], [3, kg(3)], [5, kg(5)], [2, kg(2)], [4, kg(4)], [2, kg(2)]], + "targets": [[3, kg(3)], [4, kg(4)], [5, kg(5)],[7, kg(7)],[8, kg(8)], [10, kg(10)],[9, kg(9)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[5, kg(5)], [7, kg(7)], [9, kg(9)], [6, kg(6)], [5, kg(5)], [4, kg(4)], [7, kg(7)]], + "targets": [[2, kg(2)], [3, kg(3)],[1, kg(1)]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + + }, + { + "masses": [[5, kg(5)], [7, kg(7)], [9, kg(9)], [6, kg(6)], [5, kg(5)], [6, kg(6)], [7, kg(7)]], + "targets": [[4, kg(4)], [3, kg(3)],[5, kg(5)]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + + }, + { + "masses": [[8, kg(8)], [11, kg(11)], [9, kg(9)], [10, kg(10)], [12, kg(12)], [4, kg(4)], [9, kg(9)]], + "targets": [[2, kg(2)], [6, kg(6)],[7, kg(7)],[5, kg(5)]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + + }, + { + "masses": [[6, kg(6)], [9, kg(9)], [6, kg(6)], [5, kg(5)], [9, kg(9)], [7, kg(7)], [11, kg(11)]], + "targets": [[3, kg(3)], [8, kg(8)], [7, kg(7)],[10, kg(10)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[1, kg(1)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)]], + "targets": [[1, kg(1)], [2, kg(2)], [3, kg(3)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in kilogram: %1") + }, + { + "masses": [[1, kg(1)], [2, kg(2)], [2, kg(2)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)]], + "targets": [[3, kg(3)], [5, kg(5)], [7, kg(7)], [2, kg(2)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in kilogram: %1") + }, + { + "masses": [[1, kg(1)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)]], + "targets": [[4, kg(4)], [1, kg(1)], [5, kg(5)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in kilogram: %1") + }, + { + "masses": [[1, kg(1)], [8, kg(8)], [2, kg(2)], [2, kg(2)], [7, kg(7)], [9, kg(9)], [6, kg(6)]], + "targets": [[4, kg(4)], [7, kg(7)], [10, kg(10)],[5, kg(5)], [6, kg(6)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in kilogram: %1") + } + ] +} + + + + diff --git a/src/activities/scalesboard_weight/resource/5/Data.qml b/src/activities/scalesboard_weight/resource/5/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight/resource/5/Data.qml @@ -0,0 +1,115 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 100 grams.") + difficulty: 4 + + function g(value) { + /* g == gram */ + return qsTr("%1 g").arg(value) + } + data: [ + { + "masses": [[3, g(3)], [5, g(5)], [7, g(7)], [8, g(8)], [9, g(9)], [2, g(2)], [5, g(5)]], + "targets": [[8, g(8)], [13, g(13)], [15, g(15)],[17, g(17)],[20, g(20)],[10, g(10)],[11, g(11)]], + "rightDrop": false, + "message": qsTr('The "g" symbol at the end of a number means gram. \n Drop weights on the left side to balance the scale.') + }, + { + "masses": [[10, g(10)], [11, g(11)], [14, g(14)], [5, g(5)], [15, g(15)], [13, g(13)], [12, g(12)]], + "targets": [[22, g(22)], [28, g(28)], [19, g(19)],[30, g(30)],[20, g(20)],[25, g(25)],[27, g(27)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[20, g(20)], [28, g(28)], [30, g(30)], [12, g(12)], [17, g(17)], [29, g(29)], [15, g(15)]], + "targets": [[35, g(35)], [48, g(48)], [40, g(40)], [50, g(50)], [37, g(37)], [49, g(49)], [43, g(43)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[50, g(50)], [28, g(28)], [15, g(15)], [10, g(10)], [17, g(17)], [29, g(29)], [28, g(28)]], + "targets": [[65, g(65)], [78, g(78)], [60, g(60)], [94, g(94)], [77, g(77)], [85, g(85)], [89, g(89)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[20, g(20)], [14, g(14)], [21, g(21)], [13, g(13)], [14, g(14)], [22, g(22)], [12, g(12)]], + "targets": [[23, g(23)], [25, g(25)], [29, g(29)], [30, g(30)],[17, g(17)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[8, g(8)], [6, g(6)], [15, g(15)], [10, g(10)], [25, g(25)], [23, g(23)], [24, g(24)]], + "targets": [[42, g(42)], [41, g(41)], [39, g(39)], [40, g(40)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + + "masses": [[50, g(50)], [7, g(7)], [18, g(18)], [22, g(22)], [24, g(24)], [20, g(20)], [13, g(13)]], + "targets": [[83, g(83)], [81, g(81)], [79, g(79)], [87, g(87)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[11, g(11)], [6, g(6)], [2, g(2)], [12, g(12)], [13, g(13)], [9, g(9)], [10, g(10)]], + "targets": [[17, g(17)], [29, g(29)], [23, g(23)],[25, g(25)],[21, g(21)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + }, + { + "masses": [[23, g(23)], [22, g(22)], [30, g(30)], [8, g(8)], [24, g(24)], [22, g(22)], [20, g(20)]], + "targets": [[44, g(44)], [38, g(38)], [50, g(50)],[31, g(31)],[47, g(47)],[43, g(43)],[30, g(30)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + }, + { + "masses": [[10, g(10)], [11, g(11)], [14, g(14)], [5, g(5)], [15, g(15)], [13, g(13)], [12, g(12)]], + "targets": [[22, g(22)], [28, g(28)], [19, g(19)],[30, g(30)],[20, g(20)],[25, g(25)],[27, g(27)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + }, + { + "masses": [[20, g(20)], [28, g(28)], [30, g(30)], [12, g(12)], [17, g(17)], [29, g(29)], [15, g(15)]], + "targets": [[35, g(35)], [48, g(48)], [40, g(40)], [50, g(50)], [37, g(37)], [49, g(49)], [43, g(43)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + }, + { + "masses": [[50, g(50)], [28, g(28)], [15, g(15)], [10, g(10)], [17, g(17)], [29, g(29)], [28, g(28)]], + "targets": [[65, g(65)], [78, g(78)], [60, g(60)], [94, g(94)], [77, g(77)], [85, g(85)], [89, g(89)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + } + ] +} + + + + diff --git a/src/activities/scalesboard_weight/resource/6/Data.qml b/src/activities/scalesboard_weight/resource/6/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight/resource/6/Data.qml @@ -0,0 +1,97 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 10 kilograms including grams.") + difficulty: 4 + + function g(value) { + /* g == gram */ + return qsTr("%1 g").arg(value) + } + + function kg(value) { + /* kg == kilogram */ + return qsTr("%1 kg").arg(value) + } + + data: [ + + { + "masses": [[1, kg(1)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)]], + "targets": [[1, kg(1)], [2, kg(2)], [3, kg(3)], [5, kg(5)]], + "rightDrop": false, + "message": qsTr('The "kg" symbol at the end of a number means kilogram.' + " " + 'The kilogram is a unit of mass, a property which corresponds to the ' + 'common perception of how "heavy" an object is. \n Drop weights on the left side to balance the scale.') + }, + { + "masses": [[1, kg(1)], [2, kg(2)], [3, kg(3)], [5, kg(5)], [2, kg(2)], [4, kg(4)], [2, kg(2)]], + "targets": [[3, kg(3)], [4, kg(4)], [5, kg(5)],[7, kg(7)],[8, kg(8)], [10, kg(10)],[9, kg(9)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[100, g(100)], [200, g(200)], [200, g(200)], [2000, kg(2)],[500, g(500)], [1000, kg(1)], [1000, kg(1)]], + "targets": [[2200, kg(2.2)], [1300, kg(1.3)], [2400, kg(2.4)],[3500, kg(3.5)], [1600, kg(1.6)]], + "rightDrop": false, + "message": qsTr('Remember, one kilogram ("kg") equals 1000 grams ("g"). \n Drop weights on the left side to balance the scale.') + }, + { + "masses": [[5000, kg(5)], [2000, kg(2)], [200, g(200)], [500, g(500)],[400, g(400)], [1000, kg(1)], [1000, kg(1)]], + "targets": [[5200, kg(5.2)], [7200, kg(7.2)], [9400, kg(9.4)],[5500, kg(5.5)], [8900, kg(8.9)]], + "rightDrop": false, + "message": qsTr('Remember, one kilogram ("kg") equals 1000 grams ("g"). \n Drop weights on the left side to balance the scale.') + }, + { + "masses": [[1, kg(1)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)], [1, kg(1)], [2, kg(2)]], + "targets": [[4, kg(4)], [1, kg(1)], [5, kg(5)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in kilogram: %1") + }, + { + "masses": [[1, kg(1)], [8, kg(8)], [2, kg(2)], [2, kg(2)], [7, kg(7)], [9, kg(9)], [6, kg(6)]], + "targets": [[4, kg(4)], [7, kg(7)], [10, kg(10)],[5, kg(5)], [6, kg(6)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in kilogram: %1") + }, + { + "masses": [[100, g(100)], [200, g(200)], [200, g(200)], [2000, kg(2)],[500, g(500)], [1000, kg(1)], [1000, kg(1)]], + "targets": [[2200, kg(2.2)], [1300, kg(1.3)], [2400, kg(2.4)],[3500, kg(3.5)], [1600, kg(1.6)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + }, + { + "masses": [[5000, kg(5)], [2000, kg(2)], [200, g(200)], [500, g(500)],[400, g(400)], [1000, kg(1)], [1000, kg(1)]], + "targets": [[5200, kg(5.2)], [7200, kg(7.2)], [9400, kg(9.4)],[5500, kg(5.5)], [8900, kg(8.9)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in gram: %1") + }, + + ] +} + + + + diff --git a/src/activities/scalesboard_weight_avoirdupois/ActivityInfo.qml b/src/activities/scalesboard_weight_avoirdupois/ActivityInfo.qml --- a/src/activities/scalesboard_weight_avoirdupois/ActivityInfo.qml +++ b/src/activities/scalesboard_weight_avoirdupois/ActivityInfo.qml @@ -37,4 +37,5 @@ credit: "" section: "math measures" createdInVersion: 0 + levels:"1,2,3,4,5,6" } diff --git a/src/activities/scalesboard_weight_avoirdupois/ScalesboardWeight.qml b/src/activities/scalesboard_weight_avoirdupois/ScalesboardWeight.qml --- a/src/activities/scalesboard_weight_avoirdupois/ScalesboardWeight.qml +++ b/src/activities/scalesboard_weight_avoirdupois/ScalesboardWeight.qml @@ -22,66 +22,4 @@ Scalesboard { - function oz(value) { - /* oz == ounce */ - return qsTr("%1 oz").arg(value) - } - - function lb(value) { - /* lb == pound */ - return qsTr("%1 lb").arg(value) - } - - dataset: [ - { - "masses": [[1, lb(1)], [2, lb(2)], [2, lb(2)], [5, lb(5)], - [5, lb(5)], [10, lb(10)], [10, lb(10)]], - "targets": [[3, lb(3)], [4, lb(4)], [6, lb(6)], [7, lb(7)], [8, lb(8)], [9, lb(9)]], - "rightDrop": false, - "message": qsTr('The "lb" symbol at the end of a number means pound.') + " " + - qsTr('The pound is a unit of mass, a property which corresponds to the ' + - 'common perception of how "heavy" an object is. This unit is used in the USA.') - }, - { - "masses": [[1, oz(1)], [2, oz(2)], [2, oz(2)], [4, oz(4)], - [8, oz(8)], [16, oz(16)]], - "targets": [[3, oz(3)], [4, oz(4)], [6, oz(6)], [7, oz(7)], - [16, oz(16)], [24, oz(24)], [28, oz(28)]], - "rightDrop": false, - "message": qsTr('The "oz" symbol at the end of a number means ounce. One pound equals sixteen ounces') - }, - { - "masses": [[4, oz(4)], [4, oz(4)], [8, oz(8)], [8, oz(8)], - [8, oz(8)], [16, lb(1)]], - "targets": [[16, lb(1)], [20, oz(20)], [32, lb(2)], - [28, oz(28)]], - "rightDrop": false, - "message": qsTr('Remember, one pound ("lb") equals sixteen ounces ("oz").') - }, - { - "masses": [[1, oz(1)], [4, oz(4)], [6, oz(6)], [8, oz(8)], - [10, oz(10)], [16, lb(1)]], - "targets": [[3, oz(3)], [9, oz(9)], [11, oz(11)], [32, lb(2)]], - "rightDrop": true, - "message": qsTr("Take care, you can drop weights on both sides of the scale.") - }, - { - "masses": [[4, oz(4)], [4, oz(4)], [8, oz(8)], [8, oz(8)], - [8, oz(8)], [16, lb(1)]], - "targets": [[16, lb(1)], [20, oz(20)], [32, lb(2)], - [28, oz(28)]], - "rightDrop": false, - "message": qsTr("Now you have to guess the weight of the gift."), - "question": qsTr("Enter the weight of the gift in ounce: %1") - }, - { - "masses": [[1, oz(1)], [4, oz(4)], [6, oz(6)], [8, oz(8)], - [10, oz(10)], [16, lb(1)]], - "targets": [[3, oz(3)], [9, oz(9)], [11, oz(11)], [32, lb(2)]], - "rightDrop": true, - "message": qsTr("Take care, you can drop weights on both sides of the scale."), - "question": qsTr("Enter the weight of the gift in ounce: %1") - } -] - } diff --git a/src/activities/scalesboard_weight_avoirdupois/resource/1/Data.qml b/src/activities/scalesboard_weight_avoirdupois/resource/1/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight_avoirdupois/resource/1/Data.qml @@ -0,0 +1,57 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 5 ounces.") + difficulty: 2 + + function oz(value) { + /* oz == ounce */ + return qsTr("%1 oz").arg(value) + } + + data: [ + { + "masses": [[1, oz(1)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [2, oz(2)]], + "targets": [[3, oz(3)], [4, oz(4)], [5, oz(5)]], + "rightDrop": false, + "message": qsTr('The "oz" symbol at the end of a number means ounce. One pound equals sixteen ounces. \n Drop weights on the left side to balance the scale.' ) + }, + { + "masses": [[6, oz(6)], [9, oz(9)], [2, oz(2)], [7, oz(7)], [6, oz(6)], [7, oz(7)], [8, oz(8)]], + "targets": [[4, oz(4)], [3, oz(3)], [5, oz(5)]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + }, + { + "masses": [[1, oz(1)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [2, oz(2)]], + "targets": [[4, oz(4)], [3, oz(3)], [5, oz(5)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + } + ] +} + + + + diff --git a/src/activities/scalesboard_weight_avoirdupois/resource/2/Data.qml b/src/activities/scalesboard_weight_avoirdupois/resource/2/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight_avoirdupois/resource/2/Data.qml @@ -0,0 +1,71 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 10 ounces.") + difficulty: 2 + + function oz(value) { + /* oz == ounce */ + return qsTr("%1 oz").arg(value) + } + + data: [ + { + "masses": [[1, oz(1)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [2, oz(2)]], + "targets": [[3, oz(3)], [4, oz(4)], [5, oz(5)]], + "rightDrop": false, + "message": qsTr('The "oz" symbol at the end of a number means ounce. One pound equals sixteen ounces. \n Drop weights on the left side to balance the scale.' ) + }, + { + "masses": [[1, oz(1)], [2, oz(2)], [2, oz(2)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [2, oz(2)]], + "targets": [[3, oz(3)], [4, oz(4)], [5, oz(5)],[7, oz(7)],[8, oz(8)], [10, oz(10)],[9, oz(9)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[6, oz(6)], [9, oz(9)], [6, oz(6)], [5, oz(5)], [9, oz(9)], [7, oz(7)], [11, oz(11)]], + "targets": [[3, oz(3)], [8, oz(8)], [7, oz(7)],[10, oz(10)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[1, oz(1)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [2, oz(2)]], + "targets": [[4, oz(4)], [1, oz(1)], [5, oz(5)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + }, + { + "masses": [[1, oz(1)], [8, oz(8)], [2, oz(2)], [2, oz(2)], [7, oz(7)], [9, oz(9)], [6, oz(6)]], + "targets": [[4, oz(4)], [7, oz(7)], [10, oz(10)],[5, oz(5)], [6, oz(6)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + } + ] +} + + + + + diff --git a/src/activities/scalesboard_weight_avoirdupois/resource/3/Data.qml b/src/activities/scalesboard_weight_avoirdupois/resource/3/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight_avoirdupois/resource/3/Data.qml @@ -0,0 +1,71 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 20 ounces.") + difficulty: 3 + + function oz(value) { + /* oz == ounce */ + return qsTr("%1 oz").arg(value) + } + + data: [ + { + "masses": [[1, oz(1)], [2, oz(2)], [2, oz(2)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [2, oz(2)]], + "targets": [[3, oz(3)], [4, oz(4)], [5, oz(5)],[7, oz(7)],[8, oz(8)], [10, oz(10)],[9, oz(9)]], + "rightDrop": false, + "message": qsTr('The "oz" symbol at the end of a number means ounce. One pound equals sixteen ounces. \n Drop weights on the left side to balance the scale.' ) + + }, + { + "masses": [[10, oz(10)], [2, oz(2)], [3, oz(3)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [5, oz(5)]], + "targets": [[13, oz(13)], [14, oz(14)], [15, oz(15)],[17, oz(17)],[18, oz(18)], [20, oz(20)],[19, oz(19)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + + }, + { + "masses": [[2, oz(2)], [20, oz(20)], [6, oz(6)], [5, oz(5)], [9, oz(9)], [9, oz(9)], [20, oz(20)]], + "targets": [[16, oz(16)], [13, oz(13)], [19, oz(19)],[17, oz(17)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[1, oz(1)], [8, oz(8)], [2, oz(2)], [2, oz(2)], [7, oz(7)], [9, oz(9)], [6, oz(6)]], + "targets": [[4, oz(4)], [7, oz(7)], [10, oz(10)],[5, oz(5)], [6, oz(6)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + }, + { + "masses": [[10, oz(10)], [2, oz(2)], [3, oz(3)], [1, oz(1)], [2, oz(2)], [1, oz(1)], [5, oz(5)]], + "targets": [[13, oz(13)], [14, oz(14)], [15, oz(15)],[17, oz(17)],[18, oz(18)], [20, oz(20)],[19, oz(19)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + + }, + ] +} + + diff --git a/src/activities/scalesboard_weight_avoirdupois/resource/4/Data.qml b/src/activities/scalesboard_weight_avoirdupois/resource/4/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight_avoirdupois/resource/4/Data.qml @@ -0,0 +1,115 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 10 pounds.") + difficulty: 3 + + function lb(value) { + /* lb == pound */ + return qsTr("%1 lb").arg(value) + } + + data: [ + { + "masses": [[1, lb(1)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)]], + "targets": [[1, lb(1)], [2, lb(2)], [3, lb(3)]], + "rightDrop": false, + "message": qsTr('The "lb" symbol at the end of a number means pound.' + " " + + 'The pound is a unit of mass, a property which corresponds to the ' + + 'common perception of how "heavy" an object is. This unit is used in the USA.') + }, + { + "masses": [[1, lb(1)], [2, lb(2)], [2, lb(2)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)]], + "targets": [[2, lb(2)], [4, lb(4)], [5, lb(5)],[1, lb(1)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[1, lb(1)], [2, lb(2)], [2, lb(2)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)]], + "targets": [[3, lb(3)], [4, lb(4)], [5, lb(5)],[7, lb(7)],[2, lb(2)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[1, lb(1)], [2, lb(2)], [3, lb(3)], [5, lb(5)], [2, lb(2)], [4, lb(4)], [2, lb(2)]], + "targets": [[3, lb(3)], [4, lb(4)], [5, lb(5)],[7, lb(7)],[8, lb(8)], [10, lb(10)],[9, lb(9)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[5, lb(5)], [7, lb(7)], [9, lb(9)], [6, lb(6)], [5, lb(5)], [4, lb(4)], [7, lb(7)]], + "targets": [[2, lb(2)], [3, lb(3)],[1, lb(1)]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + + }, + { + "masses": [[5, lb(5)], [7, lb(7)], [9, lb(9)], [6, lb(6)], [5, lb(5)], [6, lb(6)], [7, lb(7)]], + "targets": [[4, lb(4)], [3, lb(3)],[5, lb(5)]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + + }, + { + "masses": [[8, lb(8)], [11, lb(11)], [9, lb(9)], [10, lb(10)], [12, lb(12)], [4, lb(4)], [9, lb(9)]], + "targets": [[2, lb(2)], [6, lb(6)],[7, lb(7)],[5, lb(5)]], + "rightDrop": true, + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + + }, + { + "masses": [[6, lb(6)], [9, lb(9)], [6, lb(6)], [5, lb(5)], [9, lb(9)], [7, lb(7)], [11, lb(11)]], + "targets": [[3, lb(3)], [8, lb(8)], [7, lb(7)],[10, lb(10)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[1, lb(1)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)]], + "targets": [[1, lb(1)], [2, lb(2)], [3, lb(3)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in pound: %1") + }, + { + "masses": [[1, lb(1)], [2, lb(2)], [2, lb(2)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)]], + "targets": [[3, lb(3)], [5, lb(5)], [7, lb(7)], [2, lb(2)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in pound: %1") + }, + { + "masses": [[1, lb(1)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)]], + "targets": [[4, lb(4)], [1, lb(1)], [5, lb(5)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in pound: %1") + }, + { + "masses": [[1, lb(1)], [8, lb(8)], [2, lb(2)], [2, lb(2)], [7, lb(7)], [9, lb(9)], [6, lb(6)]], + "targets": [[4, lb(4)], [7, lb(7)], [10, lb(10)],[5, lb(5)], [6, lb(6)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in pound: %1") + } + ] + } diff --git a/src/activities/scalesboard_weight_avoirdupois/resource/5/Data.qml b/src/activities/scalesboard_weight_avoirdupois/resource/5/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight_avoirdupois/resource/5/Data.qml @@ -0,0 +1,112 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 100 ounces.") + difficulty: 4 + + function oz(value) { + /* oz == ounce */ + return qsTr("%1 oz").arg(value) + } + + data: [ + { + "masses": [[3, oz(3)], [5, oz(5)], [7, oz(7)], [8, oz(8)], [9, oz(9)], [2, oz(2)], [5, oz(5)]], + "targets": [[8, oz(8)], [13, oz(13)], [15, oz(15)], [17, oz(17)], [20, oz(20)], [10, oz(10)], [11, oz(11)]], + "rightDrop": false, + "message": qsTr('The "oz" symbol at the end of a number means ounce. \n Drop weights on the left side to balance the scale.') + }, + { + "masses": [[10, oz(10)], [11, oz(11)], [14, oz(14)], [5, oz(5)], [15, oz(15)], [13, oz(13)], [12, oz(12)]], + "targets": [[22, oz(22)], [28, oz(28)], [19, oz(19)], [30, oz(30)], [20, oz(20)], [25, oz(25)], [27, oz(27)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[20, oz(20)], [28, oz(28)], [30, oz(30)], [12, oz(12)], [17, oz(17)], [29, oz(29)], [15, oz(15)]], + "targets": [[35, oz(35)], [48, oz(48)], [40, oz(40)], [50, oz(50)], [37, oz(37)], [49, oz(49)], [43, oz(43)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[50, oz(50)], [28, oz(28)], [15, oz(15)], [10, oz(10)], [17, oz(17)], [29, oz(29)], [28, oz(28)]], + "targets": [[65, oz(65)], [78, oz(78)], [60, oz(60)], [94, oz(94)], [77, oz(77)], [85, oz(85)], [89, oz(89)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + }, + { + "masses": [[20, oz(20)], [14, oz(14)], [21, oz(21)], [13, oz(13)], [14, oz(14)], [22, oz(22)], [12, oz(12)]], + "targets": [[23, oz(23)], [25, oz(25)], [29, oz(29)], [30, oz(30)],[17, oz(17)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[8, oz(8)], [6, oz(6)], [15, oz(15)], [10, oz(10)], [25, oz(25)], [23, oz(23)], [24, oz(24)]], + "targets": [[42, oz(42)], [41, oz(41)], [39, oz(39)], [40, oz(40)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[50, oz(50)], [7, oz(7)], [18, oz(18)], [22, oz(22)], [24, oz(24)], [20, oz(20)], [13, oz(13)]], + "targets": [[83, oz(83)], [81, oz(81)], [79, oz(79)], [87, oz(87)]], + "message": qsTr("Take care, you can drop weights on both sides of the scale."), + "rightDrop": true + }, + { + "masses": [[11, oz(11)], [6, oz(6)], [2, oz(2)], [12, oz(12)], [13, oz(13)], [9, oz(9)], [10, oz(10)]], + "targets": [[17, oz(17)], [29, oz(29)], [23, oz(23)], [25, oz(25)], [21, oz(21)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + }, + { + "masses": [[23, oz(23)], [22, oz(22)], [30, oz(30)], [8, oz(8)], [24, oz(24)], [22, oz(22)], [20, oz(20)]], + "targets": [[44, oz(44)], [38, oz(38)], [50, oz(50)], [31, oz(31)], [47, oz(47)], [43, oz(43)], [30, oz(30)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + }, + { + "masses": [[10, oz(10)], [11, oz(11)], [14, oz(14)], [5, oz(5)], [15, oz(15)], [13, oz(13)], [12, oz(12)]], + "targets": [[22, oz(22)], [28, oz(28)], [19, oz(19)], [30, oz(30)], [20, oz(20)], [25, oz(25)], [27, oz(27)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + }, + { + "masses": [[20, oz(20)], [28, oz(28)], [30, oz(30)], [12, oz(12)], [17, oz(17)], [29, oz(29)], [15, oz(15)]], + "targets": [[35, oz(35)], [48, oz(48)], [40, oz(40)], [50, oz(50)], [37, oz(37)], [49, oz(49)], [43, oz(43)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + }, + { + "masses": [[50, oz(50)], [28, oz(28)], [15, oz(15)], [10, oz(10)], [17, oz(17)], [29, oz(29)], [28, oz(28)]], + "targets": [[65, oz(65)], [78, oz(78)], [60, oz(60)], [94, oz(94)], [77, oz(77)], [85, oz(85)], [89, oz(89)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + } + ] +} + diff --git a/src/activities/scalesboard_weight_avoirdupois/resource/6/Data.qml b/src/activities/scalesboard_weight_avoirdupois/resource/6/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/scalesboard_weight_avoirdupois/resource/6/Data.qml @@ -0,0 +1,98 @@ +/* GCompris - Data.qml + * + * Copyright (C) 2020 Deepak Kumar + * + * Authors: + * Deepak Kumar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import "../../../../core" + +Dataset { + objective: qsTr("Balance the scales until 10 pound including ounces.") + difficulty: 4 + + function oz(value) { + /* oz == ounce */ + return qsTr("%1 oz").arg(value) + } + + function lb(value) { + /* lb == pound */ + return qsTr("%1 lb").arg(value) + } + + data: [ + { + "masses": [[1, lb(1)], [2, lb(2)], [2, lb(2)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)]], + "targets": [[3, lb(3)], [4, lb(4)], [5, lb(5)]], + "rightDrop": false, + "message": qsTr('The "lb" symbol at the end of a number means pound.' + " " + + 'The pound is a unit of mass, a property which corresponds to the ' + + 'common perception of how "heavy" an object is. This unit is used in the USA.') + + + }, + { + "masses": [[1, lb(1)], [2, lb(2)], [2, lb(2)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)]], + "targets": [[3, lb(3)], [4, lb(4)], [5, lb(5)], [7, lb(7)], [9, lb(9)], [10, lb(10)]], + "rightDrop": false, + "message": qsTr("Drop weights on the left side to balance the scale.") + + }, + { + "masses": [[8, oz(8)], [16, lb(1)], [16, lb(1)], [8, oz(8)], [48, lb(3)], [16, lb(1)]], + "targets": [[16, lb(1)], [64, lb(4)], [32, lb(2)],[80, lb(5)]], + "rightDrop": false, + "message": qsTr('Remember, one pound ("lb") equals sixteen ounces ("oz"). \n Drop the weights on the left side of the scale to balance the scale.') + }, + { + "masses": [[32, oz(32)], [80, lb(5)], [16, oz(16)], [64, lb(4)], [32, lb(2)], [16, lb(1)]], + "targets": [[96, lb(6)], [64, oz(64)], [32, lb(2)],[80, oz(80)],[128, lb(8)], [160, lb(10)]], + "rightDrop": false, + "message": qsTr('Remember, one pound ("lb") equals sixteen ounces ("oz"). \n Drop the weights on the left side of the scale to balance the scale.') + }, + { + "masses": [[1, lb(1)], [2, lb(2)], [2, lb(2)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [2, lb(2)]], + "targets": [[3, lb(3)], [4, lb(4)], [5, lb(5)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in pound: %1") + }, + { + "masses": [[6, oz(6)], [16, lb(1)], [32, lb(2)], [10, oz(10)], [16, lb(1)], [16, lb(1)]], + "targets": [[16, lb(1)], [64, lb(4)], [32, lb(2)],[80, lb(5)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + }, + { + "masses": [[1, lb(1)], [2, lb(2)], [4, lb(4)], [1, lb(1)], [2, lb(2)], [1, lb(1)], [3, lb(3)]], + "targets": [[3, lb(3)], [4, lb(4)], [5, lb(5)], [7, lb(7)], [9, lb(9)], [10, lb(10)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in pound: %1") + }, + { + "masses": [[32, oz(32)], [80, lb(5)], [16, oz(16)], [64, lb(4)], [32, lb(2)], [16, lb(1)]], + "targets": [[96, lb(6)], [64, lb(4)], [32, lb(2)],[80, lb(5)],[128, lb(8)], [160, lb(10)]], + "rightDrop": false, + "message": qsTr("Now you have to guess the weight of the gift."), + "question": qsTr("Enter the weight of the gift in ounce: %1") + }, + ] +} + +