Index: src/activities/share/ActivityConfig.qml =================================================================== --- src/activities/share/ActivityConfig.qml +++ src/activities/share/ActivityConfig.qml @@ -49,7 +49,7 @@ if(dataToSave["mode"] === undefined) { dataToSave["mode"] = "true"; } - easyModeBox.checked = (dataToSave.mode === "true") + easyModeBox.checked = (dataToSave.mode === "true") } function saveValues() { Index: src/activities/share/Share.qml =================================================================== --- src/activities/share/Share.qml +++ src/activities/share/Share.qml @@ -282,13 +282,15 @@ id: girlWidget name: "girl" total: items.totalGirls + visible: items.totalGirls !== 0 current: background.currentGirls placedInChild: background.placedInGirls } ChildWidget { id: boyWidget name: "boy" + visible: items.totalBoys !== 0 total: items.totalBoys current: background.currentBoys placedInChild: background.placedInBoys @@ -365,8 +367,7 @@ } } onStartActivity: { - background.stop() - background.start() + Activity.reloadRandom() } onClose: home() @@ -380,7 +381,7 @@ Bar { id: bar - content: BarEnumContent { value: help | home | level | reload | activityConfig } + content: BarEnumContent { value: help | home | level | reload | activityConfig} onHelpClicked: { displayDialog(dialogHelp) } Index: src/activities/share/resource/1/Data.qml =================================================================== --- src/activities/share/resource/1/Data.qml +++ src/activities/share/resource/1/Data.qml @@ -26,13 +26,13 @@ data: [ [ { - "instruction": qsTr("Paul wants to equally share 2 pieces of candy between 2 of his friends: one girl and one boy. Can you help him? First, place the children in center, then drag the pieces of candy to each of them."), + "instruction": qsTr("Paul wants to equally share 2 pieces of candy between 2 of his girl friends. Can you help him? First, place the children in center, then drag the pieces of candy to each of them."), "randomisedInputData": false, - "totalBoys": 1, - "totalGirls": 1, + "totalBoys": 0, + "totalGirls": 2, "totalCandies": 2, "showCount": true, - "forceShowBasket": "false", + "forceShowBasket": false, "placedInGirls": 0, "placedInBoys": 0 }, @@ -59,7 +59,7 @@ "placedInBoys": 0 }, { - "instruction": qsTr("He wants to give 7 more pieces of candy to his friends"), + "instruction": qsTr("He wants to give 7 more pieces of candy to his friends."), "randomisedInputData": false, "totalBoys": 1, "totalGirls": 1, @@ -83,18 +83,18 @@ ], [ { - "instruction": qsTr("George wants to equally share 3 pieces of candy between 3 of his friends: two girls and one boy. Can he equally split the pieces of candy between his friends? First, place the children in center, then drag the pieces of candy to each of them. Be careful, a rest will remain!"), + "instruction": qsTr("George wants to equally share 3 pieces of candy between 3 of his girl friends. Can he equally split the pieces of candy between his friends? First, place the children in center, then drag the pieces of candy to each of them."), "randomisedInputData": false, - "totalBoys": 1, - "totalGirls": 2, + "totalBoys": 0, + "totalGirls": 3, "totalCandies": 3, "showCount": true, "forceShowBasket": false, "placedInGirls": 0, "placedInBoys": 0 }, { - "instruction": qsTr("Maria wants to equally share 6 pieces of candy between 3 of her friends: one girl and two boys. Can she equally split the pieces of candy between her friends? First, place the children in center, then drag the pieces of candy to each of them. Be careful, a rest will remain!"), + "instruction": qsTr("Maria wants to equally share 6 pieces of candy between 3 of her friends: one girl and two boys. Can she equally split the pieces of candy between her friends? First, place the children in center, then drag the pieces of candy to each of them."), "randomisedInputData": false, "totalBoys": 2, "totalGirls": 1, @@ -116,7 +116,7 @@ "placedInBoys": 1 }, { - "instruction": qsTr("Paul wants to equally share 12 pieces of candy between 3 of his friends: two boy and one girls. Can he equally split the pieces of candy between his friends? First, place the children in center, then drag the pieces of candy to each of them."), + "instruction": qsTr("Paul wants to equally share 12 pieces of candy between 3 of his friends: two boys and one girl. Can he equally split the pieces of candy between his friends? First, place the children in center, then drag the pieces of candy to each of them."), "randomisedInputData": false, "totalBoys": 2, "totalGirls": 1, @@ -140,18 +140,18 @@ ], [ { - "instruction": qsTr("Alice wants to equally share 4 pieces of candy between 4 of her friends: two girl and two boys. Can you help her? First, place the children in the center, then drag the pieces of candy to each of them."), + "instruction": qsTr("Alice wants to equally share 4 pieces of candy between 4 of her girl friends. Can you help her? First, place the children in the center, then drag the pieces of candy to each of them."), "randomisedInputData": false, - "totalBoys": 2, - "totalGirls": 2, + "totalBoys": 0, + "totalGirls": 4, "totalCandies": 4, "showCount": false, "forceShowBasket": false, "placedInGirls": 0, "placedInBoys": 0 }, { - "instruction": qsTr("Now, Alice wants to give 8 pieces of candy to her friends"), + "instruction": qsTr("Now, Alice wants to give 8 pieces of candy to her friends."), "randomisedInputData": false, "totalBoys": 2, "totalGirls": 2, @@ -173,7 +173,7 @@ "placedInBoys": 0 }, { - "instruction": qsTr("Alice wants to give 16 pieces of candy to her friends"), + "instruction": qsTr("Alice wants to give 16 pieces of candy to her friends."), "randomisedInputData": false, "totalBoys": 2, "totalGirls": 2, @@ -197,18 +197,18 @@ ], [ { - "instruction": qsTr("Michael wants to equally share 5 pieces of candy between 5 of his friends: two girl and three boy. Can you help him? First, place the children in center, then drag the pieces of candy to each of them!"), + "instruction": qsTr("Michael wants to equally share 5 pieces of candy between 5 of his girl friends. Can you help him? First, place the children in center, then drag the pieces of candy to each of them!"), "randomisedInputData": false, - "totalBoys": 3, - "totalGirls": 2, + "totalBoys": 0, + "totalGirls": 5, "totalCandies": 5, "showCount": false, "forceShowBasket": false, "placedInGirls": 0, "placedInBoys": 0 }, { - "instruction": qsTr("Helen has 5 friends: two boy and three girls. She wants to give them 10 pieces of candy. Help her split the pieces of candy between her friends!"), + "instruction": qsTr("Helen has 5 friends: two boys and three girls. She wants to give them 10 pieces of candy. Help her split the pieces of candy between her friends!"), "randomisedInputData": false, "totalBoys": 2, "totalGirls": 3, @@ -241,7 +241,7 @@ "placedInBoys": 0 }, { - "instruction": qsTr("Paul wants to equally share 20 pieces of candy between 5 of his friends: two girl and three boy. Can you help him? First, place the children in center, then drag the pieces of candy to each of them!"), + "instruction": qsTr("Paul wants to equally share 20 pieces of candy between 5 of his friends: two girls and three boys. Can you help him? First, place the children in center, then drag the pieces of candy to each of them!"), "randomisedInputData": false, "totalBoys": 3, "totalGirls": 2, @@ -254,18 +254,18 @@ ], [ { - "instruction": qsTr("Charles wants to share his 6 pieces of candy with 2 of his friends: one boy and one girls. Can he split the pieces of candy equally?"), + "instruction": qsTr("Charles wants to share his 6 pieces of candy with 2 of his friends: two girls. Can he split the pieces of candy equally?"), "randomisedInputData": false, - "totalBoys": 1, - "totalGirls": 1, + "totalBoys": 0, + "totalGirls": 2, "totalCandies": 6, "showCount": true, "forceShowBasket": true, "placedInGirls": 0, "placedInBoys": 0 }, { - "instruction": qsTr("For her birthday, Elizabeth has 8 pieces of candy to share with 3 of her friends: two girls and one boys. How should she split the pieces of candy to her friends?"), + "instruction": qsTr("For her birthday, Elizabeth has 8 pieces of candy to share with 3 of her friends: two girls and one boy. How should she split the pieces of candy to her friends?"), "randomisedInputData": false, "totalBoys": 1, "totalGirls": 2, @@ -287,7 +287,7 @@ "placedInBoys": 0 }, { - "instruction": qsTr("George wants to equally share 14 pieces of candy between 4 of his friends: two girl and two boy. Can he equally split the pieces of candy between his friends? First, place the children in center, then drag the pieces of candy to each of them. Be careful, a rest will remain!"), + "instruction": qsTr("George wants to equally share 14 pieces of candy between 4 of his friends: two girls and two boys. Can he equally split the pieces of candy between his friends? First, place the children in center, then drag the pieces of candy to each of them."), "randomisedInputData": false, "totalBoys": 2, "totalGirls": 2, @@ -298,7 +298,7 @@ "placedInBoys": 0 }, { - "instruction": qsTr("Maria wants to equally share 25 pieces of candy between 5 of her friends: three girl and two boys. Can she equally split the pieces of candy between her friends? First, place the children in center, then drag the pieces of candy to each of them. Be careful, a rest will remain!"), + "instruction": qsTr("Maria wants to equally share 25 pieces of candy between 5 of her friends: three girls and two boys. Can she equally split the pieces of candy between her friends? First, place the children in center, then drag the pieces of candy to each of them."), "randomisedInputData": false, "totalBoys": 2, "totalGirls": 3, Index: src/activities/share/resource/2/Data.qml =================================================================== --- src/activities/share/resource/2/Data.qml +++ src/activities/share/resource/2/Data.qml @@ -21,18 +21,18 @@ import GCompris 1.0 Data { - objective: qsTr( "Split a number of candies equally between kids with some extra candy left to put in jar.") + objective: qsTr( "Split a number of candies equally between kids with may or may not some extra candy left to put in jar.") difficulty: 5 data: [ [ { - "instruction": qsTr("Paul wants to equally share 2 pieces of candy between 2 of his friends: one girl and one boy. Can you help him? First, place the children in center, then drag the pieces of candy to each of them."), + "instruction": qsTr("Paul wants to equally share 2 pieces of candy between 2 of his girl friends. Can you help him? First, place the children in center, then drag the pieces of candy to each of them."), "randomisedInputData": false, - "totalBoys": 1, - "totalGirls": 1, + "totalBoys": 0, + "totalGirls": 2, "totalCandies": 2, "showCount": true, - "forceShowBasket": "true", + "forceShowBasket": true, "placedInGirls": 0, "placedInBoys": 0 }, @@ -70,7 +70,7 @@ "placedInBoys": 0 }, { - "instruction": qsTr("Paul has only 11 pieces of candy left. He eats 2 pieces of candy and he gives the rest to his friends. Can you help him equally split the 10 remaining pieces of candy?"), + "instruction": qsTr("Paul has only 11 pieces of candy left. He eats 2 pieces of candy and he gives the rest to his friends. Can you help him equally split the 9 remaining pieces of candy?"), "randomisedInputData": false, "totalBoys": 1, "totalGirls": 1, @@ -83,14 +83,14 @@ ], [ { - "instruction": qsTr("Bob wants to give 3 pieces of candy to his friends: two boys and one girl, his girlfriend already has one candy. Can you help him equally split the pieces of candy so that each friend will have the same amount of pieces of candy?"), + "instruction": qsTr("Bob wants to give 3 pieces of candy to his girl friends. Can you help him equally split the pieces of candy so that each friend will have the same amount of pieces of candy?"), "randomisedInputData": false, - "totalBoys": 2, - "totalGirls": 1, + "totalBoys": 0, + "totalGirls": 3, "totalCandies": 3, "showCount": true, "forceShowBasket": true, - "placedInGirls": 1, + "placedInGirls": 0, "placedInBoys": 0 }, { @@ -129,10 +129,10 @@ ], [ { - "instruction": qsTr("Alice wants to equally share 4 pieces of candy between 4 of her friends: two girl and two boys. Can you help her? First, place the children in the center, then drag the pieces of candy to each of them."), + "instruction": qsTr("Alice wants to equally share 4 pieces of candy between 4 of her girl friends. Can you help her? First, place the children in the center, then drag the pieces of candy to each of them."), "randomisedInputData": false, - "totalBoys": 2, - "totalGirls": 2, + "totalBoys": 0, + "totalGirls": 4, "totalCandies": 4, "showCount": false, "forceShowBasket": true, @@ -186,18 +186,18 @@ ], [ { - "instruction": qsTr("Help Jon split 11 pieces of candies between three boys and two girls. The rest will remain to Jon."), + "instruction": qsTr("Help Jon split 11 pieces of candies between five girls. The rest will remain to Jon."), "randomisedInputData": false, - "totalBoys": 3, - "totalGirls": 2, + "totalBoys": 0, + "totalGirls": 5, "totalCandies": 11, "showCount": false, "forceShowBasket": true, "placedInGirls": 0, "placedInBoys": 0 }, { - "instruction": qsTr("Jon wants to share the rest of his pieces of candies with his brother and his sister. Can you split them equally, knowing that his brother already has two pieces of candies?"), + "instruction": qsTr("Jon wants to share the rest of his pieces of candies with his brothers and his sisters. Can you split them equally, knowing that his brothers already has two pieces of candy?"), "randomisedInputData": false, "totalBoys": 2, "totalGirls": 3, @@ -208,7 +208,7 @@ "placedInBoys": 2 }, { - "instruction": qsTr("Help Tux split some pieces of candies to his friends: 19 pieces of candies to four boy and one girls."), + "instruction": qsTr("Help Tux split some pieces of candies to his friends: 19 pieces of candy to four boys and one girl."), "randomisedInputData": false, "totalBoys": 4, "totalGirls": 1, @@ -219,7 +219,7 @@ "placedInBoys": 0 }, { - "instruction": qsTr("Help Maria split 18 pieces of candies between three boys and two girls. The rest will remain to Jon."), + "instruction": qsTr("Help Maria split 18 pieces of candy between three boys and two girls."), "randomisedInputData": false, "totalBoys": 3, "totalGirls": 2, @@ -232,18 +232,18 @@ ], [ { - "instruction": qsTr("Charles wants to share his 6 pieces of candy with 2 of his friends: one boy and one girls. Can he split the pieces of candy equally?"), + "instruction": qsTr("Charles wants to share his 6 pieces of candy with 2 of his two girl friends. Can he split the pieces of candy equally?"), "randomisedInputData": false, - "totalBoys": 1, - "totalGirls": 1, + "totalBoys": 0, + "totalGirls": 2, "totalCandies": 6, "showCount": true, "forceShowBasket": true, "placedInGirls": 0, "placedInBoys": 0 }, { - "instruction": qsTr("For her birthday, Elizabeth has 8 pieces of candy to share with 3 of her friends: two girls and one boys. How should she split the pieces of candy to her friends?"), + "instruction": qsTr("For her birthday, Elizabeth has 8 pieces of candy to share with 3 of her friends: two girls and one boy. How should she split the pieces of candy to her friends?"), "randomisedInputData": false, "totalBoys": 1, "totalGirls": 2, @@ -265,7 +265,7 @@ "placedInBoys": 0 }, { - "instruction": qsTr("George wants to equally share 14 pieces of candy between 4 of his friends: two girl and two boy. Can he equally split the pieces of candy between his friends? First, place the children in center, then drag the pieces of candy to each of them. Be careful, a rest will remain!"), + "instruction": qsTr("George wants to equally share 14 pieces of candy between 4 of his friends: two girls and two boys. Can he equally split the pieces of candy between his friends? First, place the children in center, then drag the pieces of candy to each of them. Be careful."), "randomisedInputData": false, "totalBoys": 2, "totalGirls": 2, @@ -276,7 +276,7 @@ "placedInBoys": 1 }, { - "instruction": qsTr("Maria wants to equally share 23 pieces of candy between 5 of her friends: three girl and two boys. Can she equally split the pieces of candy between her friends? First, place the children in center, then drag the pieces of candy to each of them. Be careful, a rest will remain!"), + "instruction": qsTr("Maria wants to equally share 23 pieces of candy between 5 of her friends: three girls and two boys. Can she equally split the pieces of candy between her friends? First, place the children in center, then drag the pieces of candy to each of them. Be careful, a rest will remain!"), "randomisedInputData": false, "totalBoys": 2, "totalGirls": 3, Index: src/activities/share/resource/3/Data.qml =================================================================== --- src/activities/share/resource/3/Data.qml +++ src/activities/share/resource/3/Data.qml @@ -27,8 +27,8 @@ [ { "randomisedInputData": true, - "maxBoys": 2, - "maxGirls": 2, + "maxBoys": 0, + "maxGirls": 4, "maxCandies": 6, "alreadyPlaced": false }, @@ -64,8 +64,8 @@ [ { "randomisedInputData": true, - "maxBoys": 1, - "maxGirls": 3, + "maxBoys": 0, + "maxGirls": 4, "maxCandies": 6, "alreadyPlaced": false }, @@ -101,8 +101,8 @@ [ { "randomisedInputData": true, - "maxBoys": 3, - "maxGirls": 2, + "maxBoys": 0, + "maxGirls": 5, "maxCandies": 10, "alreadyPlaced": false }, @@ -138,8 +138,8 @@ [ { "randomisedInputData": true, - "maxBoys": 2, - "maxGirls": 2, + "maxBoys": 0, + "maxGirls": 4, "maxCandies": 10, "alreadyPlaced": true }, @@ -175,8 +175,8 @@ [ { "randomisedInputData": true, - "maxBoys": 3, - "maxGirls": 3, + "maxBoys": 0, + "maxGirls": 6, "maxCandies": 8, "alreadyPlaced": true }, Index: src/activities/share/share.js =================================================================== --- src/activities/share/share.js +++ src/activities/share/share.js @@ -29,6 +29,7 @@ var savedPlacedInGirls var savedPlacedInBoys var savedCurrentCandies +var subLevelData function start(items_) { items = items_ @@ -47,7 +48,7 @@ function setUp() { var levelData = items.levels numberOfLevel = items.levels.length - var subLevelData = levelData[currentLevel][items.currentSubLevel]; + subLevelData = levelData[currentLevel][items.currentSubLevel]; // use board levels if (!subLevelData["randomisedInputData"]) { items.totalBoys = subLevelData.totalBoys @@ -175,7 +176,7 @@ } function reloadRandom() { - if (currentLevel < 7) { + if (!subLevelData["randomisedInputData"]) { initLevel() } else {