diff --git a/src/activities/solar_system/ActivityInfo.qml b/src/activities/solar_system/ActivityInfo.qml index b9e19780d..f68b98fbf 100644 --- a/src/activities/solar_system/ActivityInfo.qml +++ b/src/activities/solar_system/ActivityInfo.qml @@ -1,43 +1,43 @@ /* GCompris - ActivityInfo.qml * * Copyright (C) 2018 Aman Kumar Gupta * * Authors: * Aman Kumar Gupta * * 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 GCompris 1.0 ActivityInfo { name: "solar_system/SolarSystem.qml" difficulty: 5 - icon: "solar_system/resource/sun_clip.svg" + icon: "solar_system/solar_system.svg" author: "Aman Kumar Gupta <gupta2140@gmail.com>" demo: true //: Activity title title: qsTr("Solar System") //: Help title description: qsTr("Answer the questions presented and get a 100% correctness among the options.") //intro: "Answer the questions presented and get a 100% correctness among the options." //: Help goal goal: "" //: Help prerequisite prerequisite: "" //: Help manual manual: qsTr("Click on a planet or the Sun to reveal questions. Each question contains 4 options. One of those is 100% correct. Try to answer the questions until you get a 100% closeness in the closeness meter.") credit: "" section: "fun" createdInVersion: 9500 } diff --git a/src/activities/solar_system/Dataset.js b/src/activities/solar_system/Dataset.js index 3caf7ea95..1290b56c5 100644 --- a/src/activities/solar_system/Dataset.js +++ b/src/activities/solar_system/Dataset.js @@ -1,383 +1,374 @@ /* GCompris - Dataset.js * * Copyright (C) 2018 Aman Kumar Gupta * * Authors: * Aman Kumar Gupta * * 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 . */ function get() { return [ { - "clipImg": "qrc:/gcompris/src/activities/solar_system/resource/sun_clip.svg", "realImg": "qrc:/gcompris/src/activities/solar_system/resource/sun_real.svg", "bodyName": qsTr("Sun"), "levels": [ { // sub-level 1 "question": qsTr("How large is the Sun compared to other planets in our Solar System?"), "options": [qsTr("Sixth largest"), qsTr("Third largest"), qsTr("Largest"), qsTr("Seventh largest")], "closeness": [17.5, 67, 100, 1] }, { // sub-level 2 "question": qsTr("The temperature of the Sun is around:"), "options": [qsTr("1000 degrees celsius"), qsTr("4500 degrees celsius"), qsTr("5505 degrees celsius"), qsTr("3638 degrees celsius")], "closeness": [1, 78, 100, 60] }, { // sub-level 3 "question": qsTr("How old is the Sun?"), "options": [qsTr("1.2 billion years"), qsTr("3 billion years"), qsTr("7 billion years"), qsTr("4.5 billion years")], "closeness": [1, 55, 25, 100] }, { // sub-level 4 "question": qsTr("How long does it take for the Sun’s light to reach the Earth?"), "options": [qsTr("8 minutes"), qsTr("30 minutes"), qsTr("60 minutes"), qsTr("15 minutes")], "closeness": [100, 58, 1, 86.6] }, { // sub-level 5 "question": qsTr("The Sun is as big as:"), "options": [qsTr("1 million Earths"), qsTr("2.6 million Earths"), qsTr("1.3 million Earths"), qsTr("5 million Earths")], "closeness": [92, 65, 100, 1] } ] }, { - "clipImg": "qrc:/gcompris/src/activities/solar_system/resource/mercury_clip.svg", "realImg": "qrc:/gcompris/src/activities/solar_system/resource/mercury_real.svg", "bodyName": qsTr("Mercury"), "temperatureHint": qsTr("The maximum temperature on Earth is 58 degrees celsius."), "lengthOfYearHint": qsTr("The length of a year on Venus is 225 days."), "levels": [ { // sub-level 1 "question": qsTr("At which position is Mercury in the Solar System?"), "options": [qsTr("Seventh"), qsTr("Sixth"), qsTr("First"), qsTr("Fourth")], "closeness": [1, 17.5, 100, 50.5] }, { // sub-level 2 "question": qsTr("How small is Mercury compared to other planets in our Solar System?"), "options": [qsTr("Smallest"), qsTr("Second smallest"), qsTr("Third smallest"), qsTr("Fifth smallest")], "closeness": [100, 75.3, 50.5, 1] }, { // sub-level 3 "question": qsTr("How many moons has Mercury?"), "options": ["5", "200", "0", "10"], "closeness": [97.5, 1, 100, 95] }, { // sub-level 4 "question": qsTr("The maximum temperature on Mercury is:"), "options": [qsTr("50 degrees celsius"), qsTr("35 degrees celsius"), qsTr("427 degrees celsius"), qsTr("273 degrees celsius")], "closeness": [4.8, 1, 100, 61] }, { // sub-level 5 "question": qsTr("How many days make a year on Mercury?"), "options": [qsTr("365 days"), qsTr("433 days"), qsTr("88 days"), qsTr("107 days")], "closeness": [20.5, 1, 100, 94.5] }, { // sub-level 6 "question": qsTr("How long is a day on Mercury?"), "options": [qsTr("50 Earth days"), qsTr("365 Earth days"), qsTr("59 Earth days"), qsTr("107 Earth days")], "closeness": [97, 1, 100, 84.4] } ] }, { - "clipImg": "qrc:/gcompris/src/activities/solar_system/resource/venus_clip.svg", "realImg": "qrc:/gcompris/src/activities/solar_system/resource/venus_real.svg", "bodyName": qsTr("Venus"), "temperatureHint": qsTr("The maximum temperature on Earth is 58 degrees celsius."), "lengthOfYearHint": qsTr("The length of a year on Earth is 365 days."), "levels": [ { // sub-level 1 "question": qsTr("At which position is Venus in the Solar System?"), "options": [qsTr("Seventh"), qsTr("Sixth"), qsTr("Second"), qsTr("Fourth")], "closeness": [1, 20.8, 100, 60.4] }, { // sub-level 2 "question": qsTr("Venus is as heavy as:"), "options": [qsTr("0.7 Earths"), qsTr("0.8 Earths"), qsTr("1.3 Earths"), qsTr("2.5 Earths")], "closeness": [94, 100, 71, 1] }, { // sub-level 3 "question": qsTr("How large is Venus compared to other planets in our Solar System?"), "options": [qsTr("Seventh largest"), qsTr("Sixth largest"), qsTr("Fifth largest"), qsTr("Fourth largest")], "closeness": [50.5, 100, 50.5, 1] }, { // sub-level 4 "question": qsTr("How long is a year on Venus?"), "options": [qsTr("225 days"), qsTr("365 days"), qsTr("116 days"), qsTr("100 days")], "closeness": [100, 1, 23, 11.6] }, { // sub-level 5 "question": qsTr("How long is a day on Venus?"), "options": [qsTr("117 Earth days"), qsTr("365 Earth days"), qsTr("88 Earth days"), qsTr("107 Earth days")], "closeness": [100, 1, 88.8, 96.4] }, { // sub-level 6 "question": qsTr("The maximum temperature on Venus is:"), "options": [qsTr("100 degrees celsius"), qsTr("20 degrees celsius"), qsTr("467 degrees celsius"), qsTr("45 degrees celsius")], "closeness": [18.7, 1, 100, 6.5] }, { // sub-level 7 "question": qsTr("How many moons has Venus?"), "options": ["5", "10", "2", "0"], "closeness": [63, 1, 100, 75.3] } ] }, { - "clipImg": "qrc:/gcompris/src/activities/solar_system/resource/earth_clip.svg", "realImg": "qrc:/gcompris/src/activities/solar_system/resource/earth_real.svg", "bodyName": qsTr("Earth"), "temperatureHint": qsTr("The maximum temperature on Mars is 20 degrees celsius."), "lengthOfYearHint": qsTr("The length of a year on Venus is 225 days."), "levels": [ { // sub-level 1 "question": qsTr("At which position is Earth in the Solar System?"), "options": [qsTr("Sixth"), qsTr("Third"), qsTr("First"), qsTr("Fifth")], "closeness": [1, 100, 35, 35] }, { // sub-level 2 "question": qsTr("How long does it take for Earth to complete one year?"), "options": [qsTr("200 days"), qsTr("30 days"), qsTr("7 days"), qsTr("365 days")], "closeness": [54.3, 7.3, 1, 100] }, { // sub-level 3 "question": qsTr("How many moons has Earth?"), "options": ["1", "5", "2", "3"], "closeness": [100, 15, 75, 50.5] }, { // sub-level 4 "question": qsTr("How long is a day on Earth?"), "options": [qsTr("12 hours"), qsTr("24 hours"), qsTr("365 hours"), qsTr("48 hours")], "closeness": [96.5, 100, 1, 93] }, { // sub-level 5 "question": qsTr("How many seasons has Earth?"), "options": ["2", "4", "6", "1"], "closeness": [34, 100, 34, 1] }, { // sub-level 6 "question": qsTr("Maximum temperature on Earth is:"), "options": [qsTr("100 degrees celsius"), qsTr("58 degrees celsius"), qsTr("30 degrees celsius"), qsTr("45 degrees celsius")], "closeness": [1, 100, 33, 69.3] }, { // sub-level 7 "question": qsTr("How large is Earth compared to other planets in our Solar System?"), "options": [qsTr("Seventh largest"), qsTr("Sixth largest"), qsTr("Fifth largest"), qsTr("Fourth largest")], "closeness": [1, 50.5, 100, 50.5] } ] }, { - "clipImg": "qrc:/gcompris/src/activities/solar_system/resource/mars_clip.svg", "realImg": "qrc:/gcompris/src/activities/solar_system/resource/mars_real.svg", "bodyName": qsTr("Mars"), "temperatureHint": qsTr("The maximum temperature on Earth is 58 degrees celsius."), "lengthOfYearHint": qsTr("The length of a year on Earth is 365 days."), "levels": [ { // sub-level 1 "question": qsTr("At which position is Mars in the Solar System?"), "options": [qsTr("Sixth"), qsTr("Fourth"), qsTr("First"), qsTr("Fifth")], "closeness": [34, 100, 1, 67] }, { // sub-level 2 "question": qsTr("The maximum temperature on Mars is:"), "options": [qsTr("20 degrees celsius"), qsTr("35 degrees celsius"), qsTr("100 degrees celsius"), qsTr("60 degrees celsius")], "closeness": [100, 81.4, 1, 51.5] }, { // sub-level 3 "question": qsTr("How big is the size of Mars compared to Earth?"), "options": [qsTr("The same"), qsTr("Half"), qsTr("Two times"), qsTr("Three times")], "closeness": [80, 100, 40.6, 1] }, { // sub-level 4 "question": qsTr("How many moons has Mars?"), "options": ["1", "5", "2", "3"], "closeness": [67, 1, 100, 50.5] }, { // sub-level 5 "question": qsTr("How long is a day on Mars?"), "options": [qsTr("12 hours"), qsTr("24 hours"), qsTr("24.5 hours"), qsTr("48 hours")], "closeness": [47.3, 91, 100, 1] }, { // sub-level 6 "question": qsTr("How long does it take for Mars to complete one year?"), "options": [qsTr("687 days"), qsTr("30 days"), qsTr("7 days"), qsTr("365 days")], "closeness": [100, 4.3, 1, 53] }, { // sub-level 7 "question": qsTr("How small is Mars compared to other planets in our Solar System?"), "options": [qsTr("Smallest"), qsTr("Second smallest"), qsTr("Third smallest"), qsTr("Fifth smallest")], "closeness": [67, 100, 67, 1] } ] }, { - "clipImg": "qrc:/gcompris/src/activities/solar_system/resource/jupiter_clip.svg", "realImg": "qrc:/gcompris/src/activities/solar_system/resource/jupiter_real.svg", "bodyName": qsTr("Jupiter"), "temperatureHint": qsTr("The maximum temperature on Mars is 20 degrees celsius."), "lengthOfYearHint": qsTr("The length of a year on Saturn is 29.5 Earth years."), "levels": [ { // sub-level 1 "question": qsTr("At which position is Jupiter in the Solar System?"), "options": [qsTr("Sixth"), qsTr("Fifth"), qsTr("First"), qsTr("Fourth")], "closeness": [75, 100, 1, 75] }, { // sub-level 2 "question": qsTr("How large is Jupiter compared to other planets in the Solar System?"), "options": [qsTr("Third largest"), qsTr("Largest"), qsTr("Fifth largest"), qsTr("Second largest")], "closeness": [50.5, 100, 1, 75] }, { // sub-level 3 "question": qsTr("The minimum temperature on Jupiter is:"), "options": [qsTr("-145 degrees celsius"), qsTr("100 degrees celsius"), qsTr("50 degrees celsius"), qsTr("-180 degrees celsius")], "closeness": [100, 63, 24.7, 1] }, { // sub-level 4 "question": qsTr("How many moons has Jupiter?"), "options": ["1", "20", "25", "53"], "closeness": [1, 37, 46.7, 100] }, { // sub-level 5 "question": qsTr("How long is one day on Jupiter?"), "options": [qsTr("10 hours"), qsTr("24 hours"), qsTr("12 hours"), qsTr("48 hours")], "closeness": [100, 63.5, 94.8, 1] }, { // sub-level 6 "question": qsTr("How long does it take for Jupiter to complete one year?"), "options": [qsTr("5 Earth years"), qsTr("12 Earth years"), qsTr("30 Earth years"), qsTr("1 Earth year")], "closeness": [61.5, 100, 1, 39.5] } ] }, { - "clipImg": "qrc:/gcompris/src/activities/solar_system/resource/saturn_clip.svg", "realImg": "qrc:/gcompris/src/activities/solar_system/resource/saturn_real.svg", "bodyName": qsTr("Saturn"), "temperatureHint": qsTr("The minimum temperature on Jupiter is -145 degrees celsius."), "lengthOfYearHint": qsTr("The length of a year on Jupiter is 12 Earth years."), "levels": [ { // sub-level 1 "question": qsTr("At which position is Saturn in the Solar System?"), "options": [qsTr("Sixth"), qsTr("Fourth"), qsTr("First"), qsTr("Fifth")], "closeness": [100, 60.4, 1, 80] }, { // sub-level 2 "question": qsTr("How large is Saturn compared to other planets in the Solar System?"), "options": [qsTr("Third largest"), qsTr("Largest"), qsTr("Fifth largest"), qsTr("Second largest")], "closeness": [67, 67, 1, 100] }, { // sub-level 3 "question": qsTr("How many moons has Saturn?"), "options": ["120", "1", "150", "200"], "closeness": [80, 1, 100, 60.8] }, { // sub-level 4 "question": qsTr("How long is one day on Saturn?"), "options": [qsTr("10.5 hours"), qsTr("24 hours"), qsTr("12 hours"), qsTr("48 hours")], "closeness": [100, 64.3, 96, 1] }, { // sub-level 5 "question": qsTr("The minimum temperature on Saturn is:"), "options": [qsTr("0 degrees celsius"), qsTr("100 degrees celsius"), qsTr("-178 degrees celsius"), qsTr("-100 degrees celsius")], "closeness": [36.6, 1, 100, 72] }, { // sub-level 6 "question": qsTr("How long does it take for Saturn to complete one year?"), "options": [qsTr("29.5 Earth years"), qsTr("20 Earth years"), qsTr("10 Earth years"), qsTr("1 Earth year")], "closeness": [100, 67, 32, 1] } ] }, { - "clipImg": "qrc:/gcompris/src/activities/solar_system/resource/uranus_clip.svg", "realImg": "qrc:/gcompris/src/activities/solar_system/resource/uranus_real.svg", "bodyName": qsTr("Uranus"), "temperatureHint": qsTr("The temperature on Saturn is -178 degrees celsius."), "lengthOfYearHint": qsTr("The length of a year on Saturn is 29.5 Earth years."), "levels": [ { // sub-level 1 "question": qsTr("At which position is Uranus in the Solar System?"), "options": [qsTr("Seventh"), qsTr("Fourth"), qsTr("Eighth"), qsTr("Fifth")], "closeness": [100, 1, 67, 34] }, { // sub-level 2 "question": qsTr("How many years does it take for Uranus to go once around the Sun?"), "options": [qsTr("1 year"), qsTr("24 years"), qsTr("68 years"), qsTr("84 years")], "closeness": [1, 28.4, 81, 100] }, { // sub-level 3 "question": qsTr("How many moons has Uranus?"), "options": ["120", "87", "27", "50"], "closeness": [1, 36, 100, 75.5] }, { // sub-level 4 "question": qsTr("How long is one day on Uranus?"), "options": [qsTr("10 hours"), qsTr("27 hours"), qsTr("17 hours"), qsTr("48 hours")], "closeness": [77.6, 68, 100, 1] }, { // sub-level 5 "question": qsTr("How large is Uranus compared to other planets in the Solar System?"), "options": [qsTr("Third largest"), qsTr("Largest"), qsTr("Seventh largest"), qsTr("Second largest")], "closeness": [100, 50.5, 1, 75] }, { // sub-level 6 "question": qsTr("The maximum temperature on Uranus is:"), "options": [qsTr("100 degrees celsius"), qsTr("-216 degrees celsius"), qsTr("0 degrees celsius"), qsTr("-100 degrees celsius")], "closeness": [1, 100, 32.3, 63.6] } ] }, { - "clipImg": "qrc:/gcompris/src/activities/solar_system/resource/neptune_clip.svg", "realImg": "qrc:/gcompris/src/activities/solar_system/resource/neptune_real.svg", "bodyName": qsTr("Neptune"), "temperatureHint": qsTr("The maximum temperature on Saturn is -178 degrees celsius."), "lengthOfYearHint": qsTr("The length of a year on Uranus is 84 years."), "levels": [ { // sub-level 1 "question": qsTr("At which position is Neptune in the Solar System?"), "options": [qsTr("Seventh"), qsTr("Fourth"), qsTr("Eighth"), qsTr("Fifth")], "closeness": [75, 1, 100, 25.7] }, { // sub-level 2 "question": qsTr("How long does it take for Neptune to make one revolution around the Sun?"), "options": [qsTr("165 years"), qsTr("3 years"), qsTr("100 years"), qsTr("1 year")], "closeness": [100, 2, 60.7, 1] }, { // sub-level 3 "question": qsTr("How many moons has Neptune?"), "options": ["120", "87", "14", "50"], "closeness": [1, 31.8, 100, 66.3] }, { // sub-level 4 "question": qsTr("How long is one day on Neptune?"), "options": [qsTr("16 hours"), qsTr("27 hours"), qsTr("17 hours"), qsTr("48 hours")], "closeness": [100, 66, 97, 1] }, { // sub-level 5 "question": qsTr("The average temperature on Neptune is:"), "options": [qsTr("100 degrees celsius"), qsTr("30 degrees celsius"), qsTr("-210 degrees celsius"), qsTr("-100 degrees celsius")], "closeness": [1, 23, 100, 64] }, { // sub-level 6 "question": qsTr("How large is Neptune compared to other planets in the Solar System?"), "options": [qsTr("Fourth largest"), qsTr("Largest"), qsTr("Third largest"), qsTr("Second largest")], "closeness": [100, 1, 67, 34] } ] } ]; } diff --git a/src/activities/solar_system/SolarSystem.qml b/src/activities/solar_system/SolarSystem.qml index 0413caf41..fad933004 100644 --- a/src/activities/solar_system/SolarSystem.qml +++ b/src/activities/solar_system/SolarSystem.qml @@ -1,337 +1,337 @@ /* GCompris - SolarSystem.qml * * Copyright (C) 2018 Aman Kumar Gupta * * Authors: * Aman Kumar Gupta * * 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" import "solar_system.js" as Activity ActivityBase { id: activity onStart: { focus = true; } onStop: {} pageComponent: Rectangle { id: background anchors.fill: parent property bool horizontalLayout: background.width > background.height Image { id: stars fillMode: Image.PreserveAspectCrop source: "qrc:/gcompris/src/activities/solar_system/resource/background.jpg" width: horizontalLayout ? parent.width * 2.5 : parent.height * 2.5 height: stars.width sourceSize.width: stars.width sourceSize.height: stars.width x: horizontalLayout ? -stars.width * 0.48 : -stars.width * 0.5 + parent.width * 0.5 y: horizontalLayout ? -stars.height * 0.5 + parent.height * 0.5 : -stars.height * 0.5 + parent.height * 0.9 transform: Rotation { origin.x: stars.width / 2; origin.y: stars.height / 2; angle: 0; NumberAnimation on angle{ loops: Animation.Infinite from: 0 to: 360 duration: 108000 } } } signal start signal stop Component.onCompleted: { activity.start.connect(start) activity.stop.connect(stop) } // Add here the QML items you need to access in javascript QtObject { id: items property Item main: activity.main property alias background: background property alias bar: bar property alias bonus: bonus property alias planetsModel: planetsModel property alias mainQuizScreen: mainQuizScreen property alias dialogActivityConfig: dialogActivityConfig property bool assessmentMode: false property bool solarSystemVisible: true property bool quizScreenVisible: false property string temperatureHint property string lengthOfYearHint } onStart: { dialogActivityConfig.getInitialConfiguration() Activity.start(items) } onStop: Activity.stop() IntroMessage { id: message anchors { top: parent.top topMargin: 10 right: parent.right rightMargin: 5 left: parent.left leftMargin: 5 } z: 10 readonly property string commonInstruction: qsTr("Mode: %1

There are two modes in the activity which you can switch from the configuration window:
1. Normal mode - In this mode you can play and learn about the Solar System.
2. Assessment mode - In this mode you can test your knowledge about the Solar System.").arg(items.assessmentMode ? qsTr("Assessment") : qsTr("Normal")) readonly property var normalModeInstructions: [ commonInstruction, qsTr("Click on the Sun or any planet to reveal questions. Each question will have 4 options, out of which one is correct."), qsTr("After a planet is clicked, the Closeness meter at the bottom-right corner of the screen represents the degree of correctness of your selected answer. The least correct answer is represented by 1%. Try again until you reach a 100% closeness by following the closeness meter, or hint which indicates the correct answer.") ] readonly property var assessmentModeInstructions: [ commonInstruction, qsTr("There are 20 questions initially with 4 options each. The progress bar at the bottom right of the screen shows your percentage score."), qsTr("If your answer is correct, your score will increase.
If your answer is wrong, your score decreases and one more question will be asked in the end along with the incorrectly answered question.
Maximum 25 questions will be asked after which no more question will be added."), qsTr("You should score above 90% to pass the assessment and become a Solar System expert!") ] intro: items.assessmentMode ? assessmentModeInstructions : normalModeInstructions onIntroChanged: index = 0 } ListModel { id: planetsModel } readonly property int itemWidth: horizontalLayout ? background.width / 9 : (background.height - bar.height) / 9 // Arrangement of all the planets in the solar system GridView { id: planetView y: horizontalLayout ? (parent.height - bar.height) / 2 - cellHeight/2 : 0 x: horizontalLayout ? 0 : parent.width / 2 - cellHeight / 2 layoutDirection: Qt.LeftToRight verticalLayoutDirection: GridView.BottomToTop width: horizontalLayout ? parent.width : cellWidth height: horizontalLayout ? cellHeight : parent.height - bar.height clip: false interactive: false visible: items.solarSystemVisible cellWidth: background.itemWidth cellHeight: cellWidth model: planetsModel delegate: PlanetInSolarModel { - planetImageSource: clipImg + planetImageSource: realImg planetName: bodyName } } QuizScreen { id: mainQuizScreen visible: items.quizScreenVisible } Rectangle { id: solarSystemImageHint radius: 30 border.width: 5 border.color: "black" width: parent.width height: parent.height visible: false z: 2000 parent: items.assessmentMode ? background : hintDialog onVisibleChanged: { if(visible) { hintCloseAnimation.stop() hintAppearAnimation.start() } else { solarSystemImageHint.x = 0 solarSystemImageHint.y = 0 } } Image { id: solarSystemImage source: "qrc:/gcompris/src/activities/solar_system/resource/hint_solar_model.png" sourceSize.width: parent.width - 6 * ApplicationInfo.ratio fillMode: Image.PreserveAspectCrop anchors.centerIn: parent } NumberAnimation { id: hintAppearAnimation target: solarSystemImageHint property: horizontalLayout ? "x" : "y" from: horizontalLayout ? -width : -height to: 0 duration: 1200 easing.type: Easing.OutBack } GCButtonCancel { id: cancelButton onClose: hintCloseAnimation.start() } SequentialAnimation { id: hintCloseAnimation NumberAnimation { target: solarSystemImageHint property: horizontalLayout ? "x" : "y" to: horizontalLayout ? -width : -height duration: 1200 easing.type: Easing.InSine } onStopped: solarSystemImageHint.visible = false } } // Hint dialog while playing the quiz DialogBackground { id: hintDialog visible: false readonly property string hint1: qsTr("1. The farther a planet from the Sun, the lower is its temperature.
%1").arg(items.temperatureHint) readonly property string hint2: qsTr("2. The duration of a year on a planet increases as we go away from the Sun.
%1").arg(items.lengthOfYearHint) title: qsTr("Hint") content: "%1
%2".arg(hint1).arg(hint2) onClose: { solarSystemImageHint.visible = false home() } button0Text: qsTr("View solar system") onButton0Hit: solarSystemImageHint.visible = true } DialogActivityConfig { id: dialogActivityConfig currentActivity: activity content: Component { Item { width: dialogActivityConfig.width height: dialogActivityConfig.height property alias assessmentModeBox: assessmentModeBox property bool initialCheckStatus GCDialogCheckBox { id: assessmentModeBox width: dialogActivityConfig.width text: qsTr("Assessment mode") checked: items.assessmentMode } } } onLoadData: { if(dataToSave && dataToSave["assessmentMode"]) items.assessmentMode = dataToSave["assessmentMode"] === "true" ? true : false Activity.numberOfLevel = items.assessmentMode ? 1 : 2 } onSaveData: { if(!dialogActivityConfig.configItem) { return } dialogActivityConfig.configItem.initialCheckStatus = items.assessmentMode if(dialogActivityConfig.configItem.assessmentModeBox.checked != items.assessmentMode) { items.assessmentMode = !items.assessmentMode dataToSave["assessmentMode"] = items.assessmentMode ? "true" : "false" Activity.numberOfLevel = items.assessmentMode ? 1 : 2 } } onClose: { if(items.assessmentMode != dialogActivityConfig.configItem.initialCheckStatus) { if(items.assessmentMode) Activity.startAssessmentMode() else { Activity.showSolarModel() } } home() } } DialogHelp { id: dialogHelp onClose: home() } Bar { id: bar content: items.mainQuizScreen.restartAssessmentMessage.visible ? withConfigWithRestart : items.solarSystemVisible ? withConfig : items.assessmentMode ? withConfigWithHint : Activity.indexOfSelectedPlanet == 0 ? withoutConfigWithoutHint : withoutConfigWithHint property BarEnumContent withConfig: BarEnumContent { value: help | home | config } property BarEnumContent withoutConfigWithHint: BarEnumContent { value: help | home | level | hint } property BarEnumContent withoutConfigWithoutHint: BarEnumContent { value: help | home | level } property BarEnumContent withConfigWithRestart: BarEnumContent { value: help | home | config | reload } property BarEnumContent withConfigWithHint: BarEnumContent { value: help | home | config | hint } onHelpClicked: { displayDialog(dialogHelp) } onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: { mainQuizScreen.closenessMeter.stopAnimations() if(items.solarSystemVisible || items.assessmentMode) activity.home() else Activity.showSolarModel() } onHintClicked: { if(items.assessmentMode) solarSystemImageHint.visible = true else displayDialog(hintDialog) } onConfigClicked: { dialogActivityConfig.active = true displayDialog(dialogActivityConfig) } onReloadClicked: Activity.startAssessmentMode() } Bonus { id: bonus Component.onCompleted: win.connect(Activity.nextLevel) } } } diff --git a/src/activities/solar_system/resource/README b/src/activities/solar_system/resource/README index 1be01c730..24252041a 100644 --- a/src/activities/solar_system/resource/README +++ b/src/activities/solar_system/resource/README @@ -1,31 +1,11 @@ -The following images are taken from https://openclipart.org: -1. venus_clip.svg: https://openclipart.org/detail/118789/venus-dan-gerhards-01 by Anonymus -2. earth_clip.svg: https://openclipart.org/detail/128/earth-with-continents-separated by jonadab -3. mars_clip.svg: https://openclipart.org/detail/260429/remix-of-cartoon-red-planet-fixed-pdf-export by rygle -4. saturn_clip.svg: https://openclipart.org/detail/262648/saturn by Carlos Carrillo -5. uranus_clip.svg: https://openclipart.org/detail/262716/my-planet-uranus by Camilo.oyuela -6. neptune_clip.svg: https://openclipart.org/detail/262724/neptune-planet by kamilon -7. sun_clip.svg: https://openclipart.org/detail/176488/sun-by-purzen-176488 by purzen - -The following image is taken from http://maxpixel.freegreatpicture.com/Solar-System-World-Outer-Space-Planet-Globe-Moon-26619 : -License: CC0 Public Domain -mercury_clip.svg - -The following image is taken from http://clipart-library.com/clipart/62845.htm : -jupiter_clip.svg - -The following image is taken from http://www.publicdomainpictures.net/view-image.php?image=9767 -License: CC0 Public Domain -background.jpg - The following images are modified as per use: License: Public domain 1. mercury_real.svg: https://en.wikipedia.org/wiki/File:Mercury_Globe-MESSENGER_mosaic_centered_at_0degN-0degE.jpg by NASA-APL 2. venus_real.svg: https://commons.wikimedia.org/wiki/File:Venus_globe_-_transparent_background.png by NASA 3. earth_real.svg: https://commons.wikimedia.org/wiki/File:The_Blue_Marble.jpg 4. mars_real.svg: https://commons.wikimedia.org/wiki/File:Mars_Hubble.jpg by NASA and the Hubble Heritage Team 5. jupiter_real.svg: https://commons.wikimedia.org/wiki/File:Jupiter_(transparent).png -6. saturn_real.png: https://commons.wikimedia.org/wiki/File:Saturn_during_Equinox.jpg by NASA/JPL/Space Science Institute +6. saturn_real.svg: https://commons.wikimedia.org/wiki/File:Saturn_during_Equinox.jpg by NASA/JPL/Space Science Institute 7. uranus_real.svg: https://commons.wikimedia.org/wiki/File:Uranus.jpg by NASA/JPL 8. neptune_real.svg: https://commons.wikimedia.org/wiki/File:Neptune.jpg by NASA/JPL -9. sun_real.svg: https://commons.wikimedia.org/wiki/File:The_Sun_by_the_Atmospheric_Imaging_Assembly_of_NASA%27s_SolarDynamics_Observatory_-_20100879.jpg by NASA/SDO \ No newline at end of file +9. sun_real.svg: https://commons.wikimedia.org/wiki/File:The_Sun_by_the_Atmospheric_Imaging_Assembly_of_NASA%27s_SolarDynamics_Observatory_-_20100879.jpg by NASA/SDO diff --git a/src/activities/solar_system/resource/earth_clip.svg b/src/activities/solar_system/resource/earth_clip.svg deleted file mode 100644 index 5bc7bcd32..000000000 --- a/src/activities/solar_system/resource/earth_clip.svg +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - Openclipart - - - Earth with continents separated - 2006-09-11T08:15:36 - Since the flood, the continents have drifted further apart, and the ocean level has risen, covering some of the land and changing the continents' shapes at the edges. Some of the pieces have bumped together, forming high mountain chains. - https://openclipart.org/detail/128/earth-with-continents-separated-by-jonadab - - - jonadab - - - - - continent - contour - earth - flood - geography - geology - globe - planet - sea - world - - - - - - - - - - - diff --git a/src/activities/solar_system/resource/jupiter_clip.svg b/src/activities/solar_system/resource/jupiter_clip.svg deleted file mode 100644 index 51857e769..000000000 --- a/src/activities/solar_system/resource/jupiter_clip.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - \ No newline at end of file diff --git a/src/activities/solar_system/resource/mars_clip.svg b/src/activities/solar_system/resource/mars_clip.svg deleted file mode 100644 index fffb762a4..000000000 --- a/src/activities/solar_system/resource/mars_clip.svg +++ /dev/null @@ -1,624 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/solar_system/resource/mercury_clip.svg b/src/activities/solar_system/resource/mercury_clip.svg deleted file mode 100644 index 510f10080..000000000 --- a/src/activities/solar_system/resource/mercury_clip.svg +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/solar_system/resource/neptune_clip.svg b/src/activities/solar_system/resource/neptune_clip.svg deleted file mode 100644 index 20cfc65e8..000000000 --- a/src/activities/solar_system/resource/neptune_clip.svg +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/solar_system/resource/saturn_clip.svg b/src/activities/solar_system/resource/saturn_clip.svg deleted file mode 100644 index 519bf9c8f..000000000 --- a/src/activities/solar_system/resource/saturn_clip.svg +++ /dev/null @@ -1,401 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - diff --git a/src/activities/solar_system/resource/sun_clip.svg b/src/activities/solar_system/resource/sun_clip.svg deleted file mode 100644 index a2212daa6..000000000 --- a/src/activities/solar_system/resource/sun_clip.svg +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Openclipart - - - Sun - 2013-03-23T14:39:38 - A simple sun for a cartoonish or naivistic scene. - https://openclipart.org/detail/176488/sun-by-purzen-176488 - - - purzen - - - - - book - bright - cartoon - drawing - flower - scene - shine - sky - summer - sun - sunflower - sunshine - - - - - - - - - - - diff --git a/src/activities/solar_system/resource/uranus_clip.svg b/src/activities/solar_system/resource/uranus_clip.svg deleted file mode 100644 index 2bf7cbcd0..000000000 --- a/src/activities/solar_system/resource/uranus_clip.svg +++ /dev/null @@ -1,745 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/activities/solar_system/resource/venus_clip.svg b/src/activities/solar_system/resource/venus_clip.svg deleted file mode 100644 index 32d53ea14..000000000 --- a/src/activities/solar_system/resource/venus_clip.svg +++ /dev/null @@ -1,687 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Openclipart - - - - - - - - - - - diff --git a/src/activities/solar_system/solar_system.js b/src/activities/solar_system/solar_system.js index faefa4948..069b6407b 100644 --- a/src/activities/solar_system/solar_system.js +++ b/src/activities/solar_system/solar_system.js @@ -1,180 +1,180 @@ /* GCompris - solar_system.js * * Copyright (C) 2018 Aman Kumar Gupta * * Authors: * Aman Kumar Gupta * * 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 . */ .pragma library .import QtQuick 2.6 as Quick .import "Dataset.js" as Dataset .import "qrc:/gcompris/src/core/core.js" as Core var currentLevel = 0 var numberOfLevel var items var dataset var currentPlanetLevels var currentSubLevel var indexOfSelectedPlanet var assessmentModeQuestions = [] var allQuestions = [] function start(items_) { items = items_ currentLevel = 0 dataset = Dataset.get() for(var i = 0; i < dataset.length; ++i) { items.planetsModel.append({ - "clipImg": dataset[i].clipImg, + "realImg": dataset[i].realImg, "bodyName": dataset[i].bodyName }); } if(items.assessmentMode) startAssessmentMode() } function stop() { } function initLevel() { currentSubLevel = 0 items.bar.level = currentLevel + 1 items.mainQuizScreen.score.numberOfSubLevels = currentPlanetLevels.length Core.shuffle(currentPlanetLevels) nextSubLevel(false) } function nextSubLevel(isAssessmentMode) { items.mainQuizScreen.score.currentSubLevel = currentSubLevel var optionListShuffle = [] if(!isAssessmentMode) { items.mainQuizScreen.closenessMeterValue = 0 if(currentSubLevel+1 > items.mainQuizScreen.score.numberOfSubLevels) { items.bonus.good("flower") return } else { items.mainQuizScreen.question = currentPlanetLevels[currentSubLevel].question for(var i = 0 ; i < 4 ; i ++) { optionListShuffle.push({ "optionValue": currentPlanetLevels[currentSubLevel].options[i], "closeness": currentPlanetLevels[currentSubLevel].closeness[i] }); } } } else if(!items.mainQuizScreen.restartAssessmentMessage.visible) { items.mainQuizScreen.question = assessmentModeQuestions[0].question for(var i = 0 ; i < 4 ; i ++) { optionListShuffle.push({ "optionValue": assessmentModeQuestions[0].options[i], "closeness": assessmentModeQuestions[0].closeness[i] }); } } items.mainQuizScreen.closenessMeter.stopAnimations() if((currentSubLevel + 1) <= items.mainQuizScreen.score.numberOfSubLevels) { items.mainQuizScreen.optionListModel.clear() Core.shuffle(optionListShuffle) for(var i = 0 ; i < optionListShuffle.length ; i ++) items.mainQuizScreen.optionListModel.append(optionListShuffle[i]) currentSubLevel++ } } function showSolarModel() { items.quizScreenVisible = false items.solarSystemVisible = true } function startAssessmentMode() { items.solarSystemVisible = false items.quizScreenVisible = true items.mainQuizScreen.numberOfCorrectAnswers = 0 items.mainQuizScreen.score.numberOfSubLevels = 20 currentSubLevel = 0 assessmentModeQuestions = [] allQuestions = [] for(var i = 0; i < dataset.length; i++) { for(var j = 0; j < dataset[i].levels.length; j++) allQuestions.push(dataset[i].levels[j]) } Core.shuffle(allQuestions) assessmentModeQuestions = allQuestions.slice(0, 20) nextSubLevel(true) } function appendAndAddQuestion() { var incorrectAnsweredQuestion = assessmentModeQuestions.shift() assessmentModeQuestions.push(incorrectAnsweredQuestion) if(items.mainQuizScreen.score.numberOfSubLevels == 24) items.mainQuizScreen.score.numberOfSubLevels++ else if(items.mainQuizScreen.score.numberOfSubLevels < 24) { assessmentModeQuestions.push(allQuestions[items.mainQuizScreen.score.numberOfSubLevels]) items.mainQuizScreen.score.numberOfSubLevels += 2 } else if(items.mainQuizScreen.numberOfCorrectAnswers) items.mainQuizScreen.numberOfCorrectAnswers-- nextSubLevel(true) } function showQuizScreen(index) { currentLevel = 0 indexOfSelectedPlanet = index items.solarSystemVisible = false items.quizScreenVisible = true currentPlanetLevels = dataset[indexOfSelectedPlanet].levels items.mainQuizScreen.planetRealImage = dataset[indexOfSelectedPlanet].realImg if(indexOfSelectedPlanet != 0) { items.temperatureHint = dataset[indexOfSelectedPlanet].temperatureHint items.lengthOfYearHint = dataset[indexOfSelectedPlanet].lengthOfYearHint } initLevel() } function nextLevel() { if(numberOfLevel <= ++currentLevel) { currentLevel = 0 } if(!items.assessmentMode) initLevel() else startAssessmentMode() } function previousLevel() { if(--currentLevel < 0) { currentLevel = numberOfLevel - 1 } initLevel(); }