diff --git a/src/activities/clockgame/ActivityInfo.qml b/src/activities/clockgame/ActivityInfo.qml --- a/src/activities/clockgame/ActivityInfo.qml +++ b/src/activities/clockgame/ActivityInfo.qml @@ -37,5 +37,5 @@ credit: "" section: "math measures" createdInVersion: 0 - levels: "1,2" + levels: "1,2,3,4,5" } diff --git a/src/activities/clockgame/Clockgame.qml b/src/activities/clockgame/Clockgame.qml --- a/src/activities/clockgame/Clockgame.qml +++ b/src/activities/clockgame/Clockgame.qml @@ -77,6 +77,7 @@ } Score { + id: score anchors { bottom: bar.top bottomMargin: 10 * ApplicationInfo.ratio @@ -420,16 +421,6 @@ } } - onReleased: { - Activity.selectedArrow = null - //todo replace this with Ok button - if (items.currentH === items.targetH - && items.currentM === items.targetM - && items.currentS === items.targetS) { - items.bonus.good("gnu") - } - } - onMouseXChanged: { /* Move */ if (Activity.selectedArrow !== null) { @@ -464,6 +455,27 @@ } } + 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.right + anchors.leftMargin: parent.width * 0.05 + ParticleSystemStarLoader { + id: okButtonParticles + clip: false + } + MouseArea { + id: okButtonMouseArea + anchors.fill: parent + onClicked: { + Activity.checkAnswer() + } + } + } + DialogChooseLevel { id: dialogActivityConfig currentActivity: activity.activityInfo diff --git a/src/activities/clockgame/clockgame.js b/src/activities/clockgame/clockgame.js --- a/src/activities/clockgame/clockgame.js +++ b/src/activities/clockgame/clockgame.js @@ -84,6 +84,17 @@ } } +function checkAnswer() { + if (items.currentH === items.targetH + && items.currentM === items.targetM + && items.currentS === items.targetS) { + items.bonus.good("gnu") + } + else { + items.bonus.bad("gnu") + } +} + function nextLevel() { if (numberOfLevel <= ++currentLevel) { currentLevel = 0 diff --git a/src/activities/clockgame/resource/1/Data.qml b/src/activities/clockgame/resource/1/Data.qml --- a/src/activities/clockgame/resource/1/Data.qml +++ b/src/activities/clockgame/resource/1/Data.qml @@ -1,9 +1,9 @@ /* GCompris - Data.qml * - * Copyright (C) 2018 Johnny Jazeix + * Copyright (C) 2020 Deepak Kumar * * Authors: - * Johnny Jazeix + * 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 @@ -21,36 +21,22 @@ import "../../../../core" Dataset { - objective: qsTr("Set and display time on analog clock for full half and quarters of an hour.") + objective: qsTr("Set and display time on analog clock for full hours.") difficulty: 2 data: [ - { - "numberOfSubLevels": 5, - "fixedMinutes": 0, - "displayMinutesHand": false, - "fixedSeconds": 0, - "displaySecondsHand": false - }, - { - "numberOfSubLevels": 5, - "fixedMinutes": 15, - "displayMinutesHand": true, - "fixedSeconds": 0, - "displaySecondsHand": false - }, - { - "numberOfSubLevels": 5, - "fixedMinutes": 30, - "displayMinutesHand": true, - "fixedSeconds": 0, - "displaySecondsHand": false - }, - { - "numberOfSubLevels": 5, - "fixedMinutes": 45, - "displayMinutesHand": true, - "fixedSeconds": 0, - "displaySecondsHand": false - } + { + "numberOfSubLevels": 5, + "fixedMinutes": 0, + "displayMinutesHand": false, + "fixedSeconds": 0, + "displaySecondsHand": false + }, + { + "numberOfSubLevels": 5, + "fixedMinutes": 0, + "displayMinutesHand": false, + "fixedSeconds": 0, + "displaySecondsHand": false + } ] } diff --git a/src/activities/clockgame/resource/2/Data.qml b/src/activities/clockgame/resource/2/Data.qml --- a/src/activities/clockgame/resource/2/Data.qml +++ b/src/activities/clockgame/resource/2/Data.qml @@ -1,9 +1,9 @@ /* GCompris - Data.qml * - * Copyright (C) 2018 Johnny Jazeix + * Copyright (C) 2020 Deepak Kumar * * Authors: - * Johnny Jazeix + * 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 @@ -21,32 +21,22 @@ import "../../../../core" Dataset { - objective: qsTr("Set and display time on analog clock for a time containing minutes and seconds.") - difficulty: 4 + objective: qsTr("Set and display time on analog clock for full and half hours.") + difficulty: 2 data: [ - { - "numberOfSubLevels": 5, - "displayMinutesHand": true, - "fixedSeconds": 0, - "displaySecondsHand": false - }, - { - "numberOfSubLevels": 5, - "fixedMinutes": 0, - "displayMinutesHand": true, - "fixedSeconds": 30, - "displaySecondsHand": true - }, - { - "numberOfSubLevels": 5, - "displayMinutesHand": true, - "displaySecondsHand": true - }, - { - "numberOfSubLevels": 10, - "displayMinutesHand": true, - "displaySecondsHand": true, - "zonesVisible": false - } + { + "numberOfSubLevels": 5, + "fixedMinutes": 0, + "displayMinutesHand": false, + "fixedSeconds": 0, + "displaySecondsHand": false + }, + { + "numberOfSubLevels": 5, + "fixedMinutes": 30, + "displayMinutesHand": true, + "fixedSeconds": 0, + "displaySecondsHand": false + } ] } diff --git a/src/activities/clockgame/resource/1/Data.qml b/src/activities/clockgame/resource/3/Data.qml copy from src/activities/clockgame/resource/1/Data.qml copy to src/activities/clockgame/resource/3/Data.qml diff --git a/src/activities/clockgame/resource/4/Data.qml b/src/activities/clockgame/resource/4/Data.qml new file mode 100644 --- /dev/null +++ b/src/activities/clockgame/resource/4/Data.qml @@ -0,0 +1,56 @@ +/* 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("Set and display time on analog clock for a time containing minutes.") + difficulty: 3 + data: [ + { + "numberOfSubLevels": 5, + "fixedMinutes": 25, + "displayMinutesHand": true, + "fixedSeconds": 0, + "displaySecondsHand": false + }, + { + "numberOfSubLevels": 5, + "fixedMinutes": 55, + "displayMinutesHand": true, + "fixedSeconds": 0, + "displaySecondsHand": false + }, + { + "numberOfSubLevels": 5, + "fixedMinutes": 35, + "displayMinutesHand": true, + "fixedSeconds": 0, + "displaySecondsHand": false + }, + { + "numberOfSubLevels": 10, + "displayMinutesHand": true, + "fixedSeconds": 0, + "displaySecondsHand": false + } + + ] +} diff --git a/src/activities/clockgame/resource/2/Data.qml b/src/activities/clockgame/resource/5/Data.qml copy from src/activities/clockgame/resource/2/Data.qml copy to src/activities/clockgame/resource/5/Data.qml --- a/src/activities/clockgame/resource/2/Data.qml +++ b/src/activities/clockgame/resource/5/Data.qml @@ -24,29 +24,36 @@ objective: qsTr("Set and display time on analog clock for a time containing minutes and seconds.") difficulty: 4 data: [ - { - "numberOfSubLevels": 5, - "displayMinutesHand": true, - "fixedSeconds": 0, - "displaySecondsHand": false - }, - { - "numberOfSubLevels": 5, - "fixedMinutes": 0, - "displayMinutesHand": true, - "fixedSeconds": 30, - "displaySecondsHand": true - }, - { - "numberOfSubLevels": 5, - "displayMinutesHand": true, - "displaySecondsHand": true - }, - { - "numberOfSubLevels": 10, - "displayMinutesHand": true, - "displaySecondsHand": true, - "zonesVisible": false - } + { + "numberOfSubLevels": 5, + "displayMinutesHand": true, + "fixedSeconds": 0, + "displaySecondsHand": false + }, + { + "numberOfSubLevels": 5, + "fixedMinutes": 25, + "displayMinutesHand": true, + "fixedSeconds": 30, + "displaySecondsHand": true + }, + { + "numberOfSubLevels": 5, + "fixedMinutes": 15, + "displayMinutesHand": true, + "fixedSeconds": 45, + "displaySecondsHand": true, + }, + { + "numberOfSubLevels": 5, + "displayMinutesHand": true, + "displaySecondsHand": true + }, + { + "numberOfSubLevels": 10, + "displayMinutesHand": true, + "displaySecondsHand": true, + "zonesVisible": false + } ] }