Commit 26aad304 authored by Sayan Biswas's avatar Sayan Biswas Committed by Bruno Coudoin
Browse files

algebra_div, add division activity

parent 4d76bc8f
......@@ -2,6 +2,7 @@
# Keep it sorted
advanced_colors
algebra_by
algebra_div
algebra_minus
algebra_plus
algorithm
......
......@@ -85,6 +85,10 @@ function calculateOperands()
firstOperandVal = coreItems.bar.level + 9
secondOperandVal = operations[coreItems.score.currentSubLevel - 1]
break;
case "/":
firstOperandVal = coreItems.bar.level * operations[coreItems.score.currentSubLevel - 1]
secondOperandVal = coreItems.bar.level
break;
}
otheritems.firstOp.text = firstOperandVal
......@@ -103,6 +107,9 @@ function getAnswer() {
case "-":
return (firstOperandVal - secondOperandVal)
case "/":
return (firstOperandVal / secondOperandVal)
}
}
......@@ -118,6 +125,9 @@ function validateAnswer(screenAnswer)
case "-":
return (getAnswer() === screenAnswer)
case "/":
return (getAnswer() === screenAnswer)
}
}
......
/* GCompris - ActivityInfo.qml
*
* Copyright (C) 2015 Sayan Biswas <techsayan01@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
ActivityInfo {
name: "algebra_div/AlgebraDiv.qml"
difficulty: 4
icon: "algebra_div/algebra_div.svg"
author: "Sayan Biswas <techsayan01@gmail.com>"
demo: false
title: qsTr("Division of numbers")
description: qsTr("Practice the division operation")
// intro: "Subtract the two numbers and type in your answer before the balloon landing"
goal: qsTr("Learn to find the difference between two numbers within a limited period of time")
prerequisite: qsTr("Division of small numbers")
manual: qsTr("Two numbers are displayed on the screen. Quickly find the division between them and use your computer's keyboard or the on-screen keypad to type it (ignore the decimal part). You have to be fast and submit the answer before the penguins in their balloon land!")
credit: ""
section: "math division"
}
\ No newline at end of file
/* GCompris - AlgebraDiv.qml
*
* Copyright (C) 2015 Sayan Biswas <techsayan01@gmail.com>
*
* Authors:
* Sayan Biswas (Qt version)
*
* 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 QtQuick 2.1
import "../../core"
import "../algebra_by/"
Algebra{
onStart:{
operand.text = "/"
}
}
GCOMPRIS_ADD_RCC(activities/algebra_div *.qml *.svg *.js resource/*)
This diff is collapsed.
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