Commit c9324786 authored by Timothée Giet's avatar Timothée Giet

clockgame, improve and simplify dataset

parent c86a18ba
......@@ -37,5 +37,5 @@ ActivityInfo {
credit: ""
section: "math measures"
createdInVersion: 0
levels: "1,2,3,4,5"
levels: "1,2,3,4,5,6"
}
......@@ -67,6 +67,9 @@ ActivityBase {
property bool minutesHandVisible
property bool secondsHandVisible
property bool zonesVisible
property bool hoursMarksVisible
property bool hoursVisible
property bool minutesVisible
}
onStart: {
......@@ -148,7 +151,7 @@ ActivityBase {
property int radius: Math.min(background.width * 1.4, background.height)
/* The yellow zones */
/* The light grey zones */
Image {
id: zones
source: activity.resourceUrl + "clock_zones.svg"
......@@ -195,7 +198,7 @@ ActivityBase {
}
z: 4
color: "#d56a3a"
visible: items.minutesHandVisible
visible: items.minutesHandVisible && items.minutesVisible
}
}
/* The seconds */
......@@ -242,7 +245,7 @@ ActivityBase {
}
z: 4
color: "#3a81d5"
visible: items.bar.level < 7
visible: items.hoursVisible
}
}
......@@ -264,8 +267,7 @@ ActivityBase {
(index + 1) * 2 * Math.PI / 12)
}
z: 4
visible: items.bar.level < 9 || (items.bar.level === 9
&& ((index + 1) % 3) === 0)
visible: items.hoursMarksVisible || !items.hoursMarksVisible && (index + 1) % 3 === 0
}
}
......
......@@ -74,6 +74,27 @@ function initLevel() {
else {
items.zonesVisible = true
}
if(items.levels[currentLevel].hoursMarksVisible !== undefined) {
items.hoursMarksVisible = items.levels[currentLevel].hoursMarksVisible
}
else {
items.hoursMarksVisible = true
}
if(items.levels[currentLevel].hoursVisible !== undefined) {
items.hoursVisible = items.levels[currentLevel].hoursVisible
}
else {
items.hoursVisible = true
}
if(items.levels[currentLevel].minutesVisible !== undefined) {
items.minutesVisible = items.levels[currentLevel].minutesVisible
}
else {
items.minutesVisible = true
}
}
function nextTry() {
......
......@@ -24,13 +24,6 @@ Data {
objective: qsTr("Full hours.")
difficulty: 4
data: [
{
"numberOfSubLevels": 5,
"fixedMinutes": 0,
"displayMinutesHand": false,
"fixedSeconds": 0,
"displaySecondsHand": false
},
{
"numberOfSubLevels": 5,
"fixedMinutes": 0,
......
......@@ -21,30 +21,9 @@
import GCompris 1.0
Data {
objective: qsTr("Full and half hours.")
objective: qsTr("Half hours.")
difficulty: 4
data: [
{
"numberOfSubLevels": 5,
"fixedMinutes": 0,
"displayMinutesHand": true,
"fixedSeconds": 0,
"displaySecondsHand": false
},
{
"numberOfSubLevels": 5,
"fixedMinutes": 0,
"displayMinutesHand": true,
"fixedSeconds": 0,
"displaySecondsHand": false
},
{
"numberOfSubLevels": 5,
"fixedMinutes": 30,
"displayMinutesHand": true,
"fixedSeconds": 0,
"displaySecondsHand": false
},
{
"numberOfSubLevels": 5,
"fixedMinutes": 30,
......
......@@ -21,23 +21,9 @@
import GCompris 1.0
Data {
objective: qsTr("Full half and quarters of an hour.")
objective: qsTr("Quarters of an hour.")
difficulty: 5
data: [
{
"numberOfSubLevels": 5,
"fixedMinutes": 0,
"displayMinutesHand": true,
"fixedSeconds": 0,
"displaySecondsHand": false
},
{
"numberOfSubLevels": 5,
"fixedMinutes": 0,
"displayMinutesHand": true,
"fixedSeconds": 0,
"displaySecondsHand": false
},
{
"numberOfSubLevels": 5,
"fixedMinutes": 15,
......@@ -45,20 +31,6 @@ Data {
"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,
......
......@@ -26,31 +26,9 @@ Data {
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
}
]
}
......@@ -24,36 +24,10 @@ Data {
objective: qsTr("Time containing minutes and seconds.")
difficulty: 6
data: [
{
"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
}
]
}
/* GCompris - Data.qml
*
* Copyright (C) 2018 Johnny Jazeix <jazeix@gmail.com>
*
* Authors:
* Johnny Jazeix <jazeix@gmail.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
import GCompris 1.0
Data {
objective: qsTr("No hints.")
difficulty: 6
data: [
{
"numberOfSubLevels": 5,
"displayMinutesHand": true,
"displaySecondsHand": true,
"hoursVisible": false
},
{
"numberOfSubLevels": 5,
"displayMinutesHand": true,
"displaySecondsHand": true,
"hoursVisible": false,
"hoursMarksVisible": false
},
{
"numberOfSubLevels": 5,
"displayMinutesHand": true,
"displaySecondsHand": true,
"hoursVisible": false,
"hoursMarksVisible": false,
"zonesVisible": false
},
{
"numberOfSubLevels": 5,
"displayMinutesHand": true,
"displaySecondsHand": true,
"hoursVisible": false,
"hoursMarksVisible": false,
"zonesVisible": false,
"minutesVisible": false
}
]
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment