[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [gcompris/gsoc_pulkit_digital_electricity] src/activities/digital_electricity: digital_electricity:
From: Rudra Nil Basu <null () kde ! org>
Date: 2017-08-21 13:31:25
Message-ID: E1djmnd-00084h-HZ () code ! kde ! org
[Download RAW message or body]
Git commit d73ebd7b0fc938f0564f34c09798cd4590db7679 by Rudra Nil Basu.
Committed on 21/08/2017 at 11:00.
Pushed by rudranilbasu into branch 'gsoc_pulkit_digital_electricity'.
digital_electricity: Moved level 6 to the end
Level 6: Implementing XOR gate using basic gates is moved to the final
level and the numbering of all the levels coming after it (originally)
is decremented by 1.
Signed-off-by: Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>
M +28 -28 src/activities/digital_electricity/Dataset.qml
M +10 -10 src/activities/digital_electricity/digital_electricity.js
https://commits.kde.org/gcompris/d73ebd7b0fc938f0564f34c09798cd4590db7679
diff --git a/src/activities/digital_electricity/Dataset.qml \
b/src/activities/digital_electricity/Dataset.qml index 438dd160..12e0da34 100644
--- a/src/activities/digital_electricity/Dataset.qml
+++ b/src/activities/digital_electricity/Dataset.qml
@@ -208,19 +208,6 @@ QtObject {
]
},
// level 6
- {
- inputComponentList: [zero, notGate, orGate, andGate],
- playAreaComponentList: [one, one, switchKey, switchKey, digitalLight],
- determiningComponentsIndex: [2, 3, 4],
- wires: [ ],
- playAreaComponentPositionX: [0.0, 0.0, 0.1, 0.1, 0.8],
- playAreaComponentPositionY: [0.0, 0.8, 0.3, 0.6, 0.4],
- type: [problemType.equation2Variables],
- introMessage: [
- qsTr("Light the bulb using both the switches such that the bulb will \
glow only when either the first switch is on and the second switch is off or the \
first switch is off and the second switch is on.")
- ]
- },
- // level 7
{
inputComponentList: [zero, one],
playAreaComponentList: [nandGate, digitalLight],
@@ -236,7 +223,7 @@ QtObject {
qsTr("Light the bulb using the NAND gate provided.")
]
},
- // level 8
+ // level 7
{
inputComponentList: [zero, one, andGate, orGate, nandGate],
playAreaComponentList: [switchKey, switchKey, switchKey, digitalLight],
@@ -251,7 +238,7 @@ QtObject {
qsTr("2. Both of the second and the third switches are turned on.")
]
},
- // level 9
+ // level 8
{
inputComponentList: [zero, one],
playAreaComponentList: [xorGate, digitalLight],
@@ -266,7 +253,7 @@ QtObject {
qsTr("Light the bulb using the XOR gate provided.")
]
},
- // level 10
+ // level 9
{
inputComponentList: [zero, one, xorGate],
playAreaComponentList: [switchKey, switchKey, switchKey, digitalLight],
@@ -279,7 +266,7 @@ QtObject {
qsTr("Light the bulb using the three switches such that the bulb \
glows when odd number of the switches are turned on") ]
},
- // level 11
+ // level 10
{
inputComponentList: [one, notGate],
playAreaComponentList: [norGate, digitalLight],
@@ -294,7 +281,7 @@ QtObject {
qsTr("Light the bulb using the NOR gate provided.")
]
},
- // level 12
+ // level 11
{
inputComponentList: [nandGate],
playAreaComponentList: [one, switchKey, digitalLight],
@@ -307,7 +294,7 @@ QtObject {
qsTr("Use the gates such that the bulb will glow only when the \
switch is turned off and remain off when the switch is turned on.") ]
},
- // level 13
+ // level 12
{
inputComponentList: [nandGate],
playAreaComponentList: [one, switchKey, switchKey, digitalLight],
@@ -320,7 +307,7 @@ QtObject {
qsTr("Create a circuit using the components provided such that the \
bulb glows only when both of the switches are turned on.") ]
},
- // level 14
+ // level 13
{
inputComponentList: [nandGate],
playAreaComponentList: [one, switchKey, switchKey, digitalLight],
@@ -333,7 +320,7 @@ QtObject {
qsTr("Create a circuit using the components provided such that the \
bulb glows when either of the switches are turned on.") ]
},
- // level 15
+ // level 14
{
inputComponentList: [nandGate],
playAreaComponentList: [one, switchKey, switchKey, digitalLight],
@@ -346,7 +333,7 @@ QtObject {
qsTr("Create a circuit using the components provided such that the \
bulb glows only when both of the switches are turned off.") ]
},
- // level 16
+ // level 15
{
inputComponentList: [norGate],
playAreaComponentList: [one, switchKey, digitalLight],
@@ -359,7 +346,7 @@ QtObject {
qsTr("Use the gates such that the bulb will glow only when the \
switch is turned off and remain off when the switch is turned on.") ]
},
- // level 17
+ // level 16
{
inputComponentList: [norGate],
playAreaComponentList: [one, switchKey, switchKey, digitalLight],
@@ -372,7 +359,7 @@ QtObject {
qsTr("Create a circuit using the components provided such that the \
bulb glows only when both of the switches are turned on.") ]
},
- // level 18
+ // level 17
{
inputComponentList: [norGate],
playAreaComponentList: [one, switchKey, switchKey, digitalLight],
@@ -385,7 +372,7 @@ QtObject {
qsTr("Create a circuit using the components provided such that the \
bulb glows when either of the switches are turned on.") ]
},
- // level 19
+ // level 18
{
inputComponentList: [norGate],
playAreaComponentList: [one, switchKey, switchKey, digitalLight],
@@ -398,7 +385,7 @@ QtObject {
qsTr("Create a circuit using the components provided such that the \
bulb will glow when at least one of the switches are turned off.") ]
},
- // level 20
+ // level 19
{
inputComponentList: [one, andGate, notGate, norGate, xorGate, nandGate, \
orGate],
playAreaComponentList: [switchKey, switchKey, comparator, digitalLight],
@@ -412,7 +399,7 @@ QtObject {
qsTr("Create a circuit using the components provided such that the \
bulb will glow when the value of the current flowing through the first switch is less \
than or equal to that of the second switch.") ]
},
- // level 21
+ // level 20
{
inputComponentList: [one, switchKey, nandGate, norGate, andGate, orGate, \
notGate],
playAreaComponentList: [bcdToSevenSegment, sevenSegmentDisplay],
@@ -428,7 +415,7 @@ QtObject {
qsTr("Display the number \"6\" in the seven segment display.")
]
},
- // level 22
+ // level 21
{
inputComponentList: [one, switchKey, nandGate, norGate, andGate, orGate, \
notGate],
playAreaComponentList: [signalGenerator, bcdCounter, bcdToSevenSegment, \
sevenSegmentDisplay], @@ -442,6 +429,19 @@ QtObject {
qsTr("The BCD counter placed under it is a special type of counter \
which can count from 0 to 9 and back to 0 on application of a clock \
signal."),
qsTr("Connect the components to make sure that the count of 0 to 9 \
is visible in the seven segment dispay provided.") ]
+ },
+ // level 22
+ {
+ inputComponentList: [zero, notGate, orGate, andGate],
+ playAreaComponentList: [one, one, switchKey, switchKey, digitalLight],
+ determiningComponentsIndex: [2, 3, 4],
+ wires: [ ],
+ playAreaComponentPositionX: [0.0, 0.0, 0.1, 0.1, 0.8],
+ playAreaComponentPositionY: [0.0, 0.8, 0.3, 0.6, 0.4],
+ type: [problemType.equation2Variables],
+ introMessage: [
+ qsTr("Light the bulb using both the switches such that the bulb will \
glow only when either the first switch is on and the second switch is off or the \
first switch is off and the second switch is on.") + ]
}
]
}
diff --git a/src/activities/digital_electricity/digital_electricity.js \
b/src/activities/digital_electricity/digital_electricity.js index 067df79c..8711337c \
100644
--- a/src/activities/digital_electricity/digital_electricity.js
+++ b/src/activities/digital_electricity/digital_electricity.js
@@ -217,17 +217,17 @@ function checkAnswer() {
updateComponent(switch2.index)
var operationResult
- if (currentLevel == 6) {
+ if (currentLevel == 22) {
operationResult = A ^ B
- } else if (currentLevel == 13 || currentLevel == 17) {
+ } else if (currentLevel == 12 || currentLevel == 16) {
operationResult = A & B
- } else if (currentLevel == 14 || currentLevel == 18) {
+ } else if (currentLevel == 13 || currentLevel == 17) {
operationResult = A | B
- } else if (currentLevel == 15) {
+ } else if (currentLevel == 14) {
operationResult = !(A | B)
- } else if (currentLevel == 19) {
+ } else if (currentLevel == 18) {
operationResult = !(A & B)
- } else if (currentLevel == 20) {
+ } else if (currentLevel == 19) {
operationResult = (A <= B)
}
@@ -266,9 +266,9 @@ function checkAnswer() {
updateComponent(switch3.index)
var operationResult
- if (currentLevel == 8) {
+ if (currentLevel == 7) {
operationResult = A | (B & C)
- } else if (currentLevel == 10) {
+ } else if (currentLevel == 9) {
operationResult = A ^ (B ^ C)
}
@@ -288,7 +288,7 @@ function checkAnswer() {
}
items.bonus.good('tux')
} else if (problemType == items.tutorialDataset.problemType.others) {
- if (currentLevel == 21) {
+ if (currentLevel == 20) {
var bcdToSevenSegment = determiningComponents[0]
var decimalValue =
@@ -304,7 +304,7 @@ function checkAnswer() {
items.bonus.bad('tux')
processingAnswer = false
return
- } else if (currentLevel == 22) {
+ } else if (currentLevel == 21) {
var bcdCounter = determiningComponents[0]
var bcdOutput =
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic