diff --git a/src/activities/planegame/Planegame.qml b/src/activities/planegame/Planegame.qml --- a/src/activities/planegame/Planegame.qml +++ b/src/activities/planegame/Planegame.qml @@ -32,6 +32,27 @@ onStart: { focus = true; } onStop: { } + // Tutorial section starts + + Image { + id: tutorialImage + source: "../digital_electricity/resource/texture01.png" + anchors.fill: parent + fillMode: Image.Tile + z: 5 + visible: true + Tutorial { + id: tutorialSection + tutorialDetails: Activity.tutorialInstructions + useImage: false + onSkipPressed: { + Activity.initLevel() + tutorialImage.visible = false + } + } + } + // Tutorial sections ends + Keys.onPressed: Activity.processPressedKey(event) Keys.onReleased: Activity.processReleasedKey(event) diff --git a/src/activities/planegame/planegame.js b/src/activities/planegame/planegame.js --- a/src/activities/planegame/planegame.js +++ b/src/activities/planegame/planegame.js @@ -41,6 +41,35 @@ var items var dataset +var tutorialInstructions = [ + { + "instruction": qsTr("This activity teaches about even and odd numbers."), + "instructionQml": " " + }, + { + "instruction": qsTr("Even numbers are numbers which leave remainder 0 when divisible by 2."), + "instructionQml" : "qrc:/gcompris/src/activities/planegame/resource/tutorial1.qml" + }, + { + "instruction": qsTr("Odd numbers are numbers which do not leave remainder 0 when divisible by 2."), + "instructionQml": "qrc:/gcompris/src/activities/planegame/resource/tutorial2.qml" + }, + { + "instruction": qsTr("Exercise: \n To test your understanding."), + "instructionQml": "qrc:/gcompris/src/activities/planegame/resource/tutorial3.qml" + }, + { + "instruction": qsTr("Exercise: \n To test your understanding."), + "instructionQml": "qrc:/gcompris/src/activities/planegame/resource/tutorial4.qml" + }, + { + "instruction": qsTr("Exercise \n To test your understanding."), + "instructionQml": "qrc:/gcompris/src/activities/planegame/resource/tutorial5.qml" + } + + ] + + var cloudComponent = Qt.createComponent(url + "Cloud.qml"); var clouds = new Array; var cloudsErased = new Array; diff --git a/src/activities/planegame/resource/tutorial1.qml b/src/activities/planegame/resource/tutorial1.qml new file mode 100644 --- /dev/null +++ b/src/activities/planegame/resource/tutorial1.qml @@ -0,0 +1,43 @@ +/* GCompris - tutorial1.qml + * + * Copyright (C) 2019 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 QtQuick 2.6 +import GCompris 1.0 + +import "../../../core" + +Rectangle { + anchors.fill: parent + color: "#80FFFFFF" + + GCText { + id: even + text: qsTr("For example: 12, 38, 52, 68, 102, 118, 168, 188, 502, 532, 700, 798, 842, 892 , 1000.All of these numbers are even numbers as they leave remainder 0 when divisible by 2.") + fontSizeMode: Text.Fit + color: "black" + minimumPixelSize: 10 + horizontalAlignment: Text.AlignLeft + width: Math.min(implicitWidth, 0.8 * parent.width) + height: Math.min(implicitHeight, 0.5 * parent.height) + wrapMode: Text.WordWrap + z: 2 + } +} diff --git a/src/activities/planegame/resource/tutorial2.qml b/src/activities/planegame/resource/tutorial2.qml new file mode 100644 --- /dev/null +++ b/src/activities/planegame/resource/tutorial2.qml @@ -0,0 +1,42 @@ +/* GCompris - tutorial1.qml + * + * Copyright (C) 2019 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 QtQuick 2.6 +import GCompris 1.0 + +import "../../../core" + +Rectangle { + anchors.fill: parent + color: "#80FFFFFF" + + GCText { + id: odd + text: qsTr("For example: 15, 19, 51, 65, 103, 119, 169, 185, 505, 533, 701, 799, 845, 897, 1001.All of these numbers are odd numbers as they do not leave remainder 0 when divisible by 2.") + fontSizeMode: Text.Fit + color: "black" + horizontalAlignment: Text.AlignLeft + width: Math.min(implicitWidth, 0.8 * parent.width) + height: Math.min(implicitHeight, 0.5 * parent.height) + wrapMode: Text.WordWrap + z: 2 + } + } diff --git a/src/activities/planegame/resource/tutorial3.qml b/src/activities/planegame/resource/tutorial3.qml new file mode 100644 --- /dev/null +++ b/src/activities/planegame/resource/tutorial3.qml @@ -0,0 +1,146 @@ +/* GCompris - tutorial3.qml + * + * Copyright (C) 2019 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 QtQuick 2.6 +import GCompris 1.0 + +import "../../../core" + +Rectangle { + id:rect1 + anchors.fill: parent + color: "#80FFFFFF" + + GCText { + id: question + anchors{ + left: parent.left + verticalCenter: parent.verticalCenter + leftMargin: parent.height * 0.5 + } + + text: qsTr( "Choose the even number") + font.pixelSize: parent.height * 0.15 + color:"black" + horizontalAlignment: Text.AlignLeft + width : 0.2 * parent.width + height: 0.9 * parent.height + z : 2 + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + + GCText { + id:evenno + anchors { + left: parent.left + verticalCenter: parent.verticalCenter + top: parent.top + topMargin: parent.width * 0.2 + leftMargin: parent.width * 0.3 + } + + text: "2" + font.pixelSize: parent.height * 0.8 + color: "black" + horizontalAlignment: Text.AlignRight + width: 0.9 * parent.width + height: 0.9 * parent.height + z: 2 + + MouseArea { + anchors.fill: evenno + onClicked: rightmessage.visible = true + } + } + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + + GCText { + id: oddno + anchors { + left: parent.left + verticalCenter: parent.verticalCenter + top: parent.top + topMargin: parent.width * 0.2 + leftMargin: parent.width * 1.2 + } + text: "5" + font.pixelSize: parent.height * 0.8 + color: "black" + horizontalAlignment: Text.AlignRight + width: 0.9 * parent.width + height: 0.9 * parent.height + z: 2 + + + MouseArea { + anchors.fill: oddno + onClicked: wrongmessage.visible = true + } + } + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + anchors.verticalCenter: parent.verticalCenter + anchors.top: parent.bottom + anchors.left :parent.left + anchors.leftMargin: parent.height * 0.9 + + GCText { + id: rightmessage + text: qsTr("Great") + font.pixelSize: parent.height * 0.5 + color: "black" + horizontalAlignment: Text.AlignRight + width: 0.9 * parent.width + height: 0.9 * parent.height + visible:false + z: 2 + } + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + anchors.verticalCenter: parent.verticalCenter + anchors.top: parent.bottom + + GCText { + id: wrongmessage + text: qsTr("No,this is not an even number as it do not leave remainder 0 when divisible by 2.") + font.pixelSize: parent.height * 0.1 + color: "black" + horizontalAlignment: Text.AlignLeft + width: 0.5 * parent.width + height: 0.5 * parent.height + visible:false + z: 2 + } + } +} diff --git a/src/activities/planegame/resource/tutorial4.qml b/src/activities/planegame/resource/tutorial4.qml new file mode 100644 --- /dev/null +++ b/src/activities/planegame/resource/tutorial4.qml @@ -0,0 +1,146 @@ +/* GCompris - tutorial4.qml + * + * Copyright (C) 2019 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 QtQuick 2.6 +import GCompris 1.0 + +import "../../../core" + +Rectangle { + id:rect1 + anchors.fill: parent + color: "#80FFFFFF" + + GCText { + id: question + anchors{ + left: parent.left + verticalCenter: parent.verticalCenter + leftMargin: parent.height * 0.5 + } + + text: qsTr( "Choose the even number") + font.pixelSize: parent.height * 0.15 + color:"black" + horizontalAlignment: Text.AlignLeft + width : 0.2 * parent.width + height: 0.9 * parent.height + z : 2 + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + + GCText { + id:evenno + anchors { + left: parent.left + verticalCenter: parent.verticalCenter + top: parent.top + topMargin: parent.width * 0.2 + leftMargin: parent.width * 0.3 + } + + text: "52" + font.pixelSize: parent.height * 0.8 + color: "black" + horizontalAlignment: Text.AlignRight + width: 0.9 * parent.width + height: 0.9 * parent.height + z: 2 + + MouseArea { + anchors.fill: parent + onClicked: rightmessage.visible = true + } + } + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + + GCText { + id: oddno + anchors { + left: parent.left + verticalCenter: parent.verticalCenter + top: parent.top + topMargin: parent.width * 0.2 + leftMargin: parent.width * 1.2 + } + text: "59" + font.pixelSize: parent.height * 0.8 + color: "black" + horizontalAlignment: Text.AlignRight + width: 0.9 * parent.width + height: 0.9 * parent.height + z: 2 + + + MouseArea { + anchors.fill: oddno + onClicked: wrongmessage.visible = true + } + } + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + anchors.verticalCenter: parent.verticalCenter + anchors.top: parent.bottom + anchors.left :parent.left + anchors.leftMargin: parent.height * 0.9 + + GCText { + id: rightmessage + text: qsTr("Great") + font.pixelSize: parent.height * 0.5 + color: "black" + horizontalAlignment: Text.AlignRight + width: 0.9 * parent.width + height: 0.9 * parent.height + visible:false + z: 2 + } + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + anchors.verticalCenter: parent.verticalCenter + anchors.top: parent.bottom + + GCText { + id: wrongmessage + text: qsTr("No,this is not an even number as it do not leave remainder 0 when divisible by 2.") + font.pixelSize: parent.height * 0.1 + color: "black" + horizontalAlignment: Text.AlignLeft + width: 0.5 * parent.width + height: 0.5 * parent.height + visible:false + z: 2 + } + } +} diff --git a/src/activities/planegame/resource/tutorial5.qml b/src/activities/planegame/resource/tutorial5.qml new file mode 100644 --- /dev/null +++ b/src/activities/planegame/resource/tutorial5.qml @@ -0,0 +1,146 @@ +/* GCompris - tutorial5.qml + * + * Copyright (C) 2019 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 QtQuick 2.6 +import GCompris 1.0 + +import "../../../core" + +Rectangle { + id:rect1 + anchors.fill: parent + color: "#80FFFFFF" + + GCText { + id: question + anchors{ + left: parent.left + verticalCenter: parent.verticalCenter + leftMargin: parent.height * 0.5 + } + + text: qsTr( "Choose the even number") + font.pixelSize: parent.height * 0.15 + color:"black" + horizontalAlignment: Text.AlignLeft + width : 0.2 * parent.width + height: 0.9 * parent.height + z : 2 + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + + GCText { + id:evenno + anchors { + left: parent.left + verticalCenter: parent.verticalCenter + top: parent.top + topMargin: parent.width * 0.2 + leftMargin: parent.width * 0.4 + } + + text: "108" + font.pixelSize: parent.height * 0.8 + color: "black" + horizontalAlignment: Text.AlignRight + width: 0.9 * parent.width + height: 0.9 * parent.height + z: 2 + + MouseArea { + anchors.fill: evenno + onClicked: rightmessage.visible = true + } + } + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + + GCText { + id: oddno + anchors { + left: parent.left + verticalCenter: parent.verticalCenter + top: parent.top + topMargin: parent.width * 0.2 + leftMargin: parent.width * 1.6 + } + text: "111" + font.pixelSize: parent.height * 0.8 + color: "black" + horizontalAlignment: Text.AlignRight + width: 0.9 * parent.width + height: 0.9 * parent.height + z: 2 + + + MouseArea { + anchors.fill: oddno + onClicked: wrongmessage.visible = true + } + } + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + anchors.verticalCenter: parent.verticalCenter + anchors.top: parent.bottom + anchors.left :parent.left + anchors.leftMargin: parent.height * 0.9 + + GCText { + id: rightmessage + text: qsTr("Great") + font.pixelSize: parent.height * 0.5 + color: "black" + horizontalAlignment: Text.AlignRight + width: 0.9 * parent.width + height: 0.9 * parent.height + visible:false + z: 2 + } + } + + Item { + width: parent.width * 0.3 + height: parent.height * 0.6 + anchors.verticalCenter: parent.verticalCenter + anchors.top: parent.bottom + + GCText { + id: wrongmessage + text: qsTr("No,this is not an even number as it do not leave remainder 0 when divisible by 2.") + font.pixelSize: parent.height * 0.1 + color: "black" + horizontalAlignment: Text.AlignLeft + width: 0.5 * parent.width + height: 0.5 * parent.height + visible:false + z: 2 + } + } +}