Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
21_22-J 38
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
21_22-J 38
21_22-J 38
Commits
1e002c7d
Commit
1e002c7d
authored
Apr 30, 2022
by
W.D.R.P. Sandeepa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some changes
parent
3415aefe
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
484 additions
and
117 deletions
+484
-117
API/app.py
API/app.py
+7
-2
API/db/__pycache__/dbConnection.cpython-39.pyc
API/db/__pycache__/dbConnection.cpython-39.pyc
+0
-0
API/model/__pycache__/colorModel.cpython-39.pyc
API/model/__pycache__/colorModel.cpython-39.pyc
+0
-0
API/model/colorModel.py
API/model/colorModel.py
+7
-7
frontend/src/component/TableList.js
frontend/src/component/TableList.js
+40
-7
frontend/src/screen/activity/Black.js
frontend/src/screen/activity/Black.js
+68
-7
frontend/src/screen/activity/Blue2.js
frontend/src/screen/activity/Blue2.js
+71
-20
frontend/src/screen/activity/Green.js
frontend/src/screen/activity/Green.js
+78
-17
frontend/src/screen/activity/Red.js
frontend/src/screen/activity/Red.js
+71
-21
frontend/src/screen/activity/White.js
frontend/src/screen/activity/White.js
+72
-19
frontend/src/screen/activity/Yellow.js
frontend/src/screen/activity/Yellow.js
+70
-17
No files found.
API/app.py
View file @
1e002c7d
...
...
@@ -36,8 +36,14 @@ def getColorActivities2():
@
app
.
route
(
"/getColorActivitiesResult"
)
def
getColorActivitiesResult
():
req
=
request
.
get_json
()
# userId = req['userId']
# print("data_dic")
return
get_color_activity_result
()
# result = get_color_activity_result(userId)
return
req
@
app
.
route
(
"/predict"
,
methods
=
[
"POST"
])
...
...
@@ -163,6 +169,5 @@ def reading():
body
=
jsonify
(
word
)
return
make_response
(
body
)
if
__name__
==
"__main__"
:
app
.
run
(
host
=
'192.168.8.101'
)
API/db/__pycache__/dbConnection.cpython-39.pyc
View file @
1e002c7d
No preview for this file type
API/model/__pycache__/colorModel.cpython-39.pyc
View file @
1e002c7d
No preview for this file type
API/model/colorModel.py
View file @
1e002c7d
from
flask
import
jsonify
from
API.db.dbConnection
import
get_all_data
,
insert_data_json
,
insert_data
,
insert
from
API.db.dbConnection
import
get_all_data
,
insert_data_json
,
insert_data
,
insert
,
get_data
def
get_color_activities1
():
...
...
@@ -57,20 +57,20 @@ def storeResult(date, result, userId, time, value):
print
(
e
)
return
e
def
get_color_activity_result
():
def
get_color_activity_result
(
userId
):
data_dic
=
[]
qry
=
'SELECT * FROM
coloractivityresult'
qry
=
'SELECT * FROM
`coloractivityresult` WHERE email = "{}"'
.
format
(
userId
)
result
=
get_
all_
data
(
qry
)
result
=
get_data
(
qry
)
for
row
in
result
:
ob
=
{
"idColorActivityResult"
:
row
[
0
],
"
idcolorActivities
"
:
row
[
1
],
"
date
"
:
row
[
2
],
"
date
"
:
row
[
1
],
"
result
"
:
row
[
2
],
"time"
:
row
[
3
],
"
result
"
:
row
[
4
],
"
value
"
:
row
[
4
],
}
data_dic
.
append
(
ob
)
...
...
frontend/src/component/TableList.js
View file @
1e002c7d
import
React
from
'
react
'
;
import
React
,
{
useEffect
,
useState
}
from
'
react
'
;
import
{
View
,
StyleSheet
,
ScrollView
}
from
'
react-native
'
;
import
{
Table
,
TableWrapper
,
Row
,
Rows
,
Col
}
from
'
react-native-table-component
'
;
import
client
from
'
../screen/client/Client
'
;
const
userId
=
1
;
const
CONTENT
=
{
tableHead
:
[
'
Date
'
,
'
Time
'
,
'
Name
'
,
'
Result
'
],
tableData
:
[
...
...
@@ -11,12 +15,41 @@ const CONTENT = {
[
'
4 jan 2022
'
,
'
2s
'
,
'
White
'
,
'
Good
'
],
[
'
5 jan 2022
'
,
'
2s
'
,
'
Blue
'
,
'
Good
'
],
[
'
6 jan 2022
'
,
'
2s
'
,
'
Yellow
'
,
'
Good
'
],
],
};
export
default
function
App
()
{
function
getResult
(
userId
)
{
var
data
=
{
userId
:
userId
,
user
:
"
userId
"
,
}
data
=
JSON
.
stringify
(
data
);
console
.
log
(
data
);
client
.
get
(
'
getColorActivitiesResult
'
,
data
,
{
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
});
}
useEffect
(()
=>
{
getResult
(
userId
);
},
[]);
return
(
<
ScrollView
>
...
...
@@ -26,14 +59,14 @@ export default function App() {
data
=
{
CONTENT
.
tableHead
}
flexArr
=
{[
1
,
1
,
1
,
1
]}
style
=
{
styles
.
head
}
textStyle
=
{
styles
.
text
}
//
textStyle={styles.text}
/
>
<
TableWrapper
style
=
{
styles
.
wrapper
}
>
<
Rows
data
=
{
CONTENT
.
tableData
}
flexArr
=
{[
1
,
1
,
1
,
1
]}
style
=
{
styles
.
row
}
textStyle
=
{
styles
.
text
}
//
textStyle={styles.text}
/
>
<
/TableWrapper
>
<
/Table
>
...
...
@@ -45,9 +78,9 @@ export default function App() {
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
0
,
paddingTop
:
20
,
paddingLeft
:
60
,
paddingRight
:
60
,
marginTop
:
0
,
},
head
:
{
height
:
60
,},
head
:
{
height
:
60
,
},
wrapper
:
{
flexDirection
:
'
row
'
},
title
:
{
flex
:
1
,
},
row
:
{
height
:
40
},
text
:
{
textAlign
:
'
center
'
,
fontSize
:
20
,
color
:
'
#fff
'
,
fontFamily
:
'
Menlo
'
},
// text: { textAlign: 'center', fontSize: 20, color: '#fff',
},
});
\ No newline at end of file
frontend/src/screen/activity/Black.js
View file @
1e002c7d
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
Orientation
from
'
react-native-orientation-locker
'
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Dimensions
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Dimensions
,
SafeAreaView
,
Modal
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
axios
from
"
axios
"
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
client
from
"
../client/Client
"
;
import
Voice
from
'
@react-native-voice/voice
'
;
...
...
@@ -14,8 +14,10 @@ import BackButton from "../../component/BackButton"
export
default
function
Black
()
{
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
navigation
=
useNavigation
();
React
.
useEffect
(()
=>
{
StatusBar
.
setHidden
(
true
);
...
...
@@ -102,7 +104,7 @@ export default function Black() {
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
...
...
@@ -130,7 +132,7 @@ export default function Black() {
const
startRecording
=
async
()
=>
{
setModalVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
...
...
@@ -149,6 +151,39 @@ export default function Black() {
return
(
<
SafeAreaView
>
<
View
>
<
Modal
animationType
=
"
slide
"
transparent
=
{
true
}
hidden
=
{
true
}
visible
=
{
modalVisible
}
onRequestClose
=
{()
=>
{
setModalVisible
(
!
modalVisible
);
}}
>
<
View
style
=
{
styles
.
centeredView
}
>
<
View
style
=
{
styles
.
modalView
}
>
<
CountDown
size
=
{
40
}
until
=
{
3
}
onFinish
=
{()
=>
setModalVisible
(
false
)}
// onFinish={() => navigation.navigate('GameScreenFiveAll')}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
black
'
}}
digitTxtStyle
=
{{
color
:
'
black
'
}}
timeLabelStyle
=
{{
color
:
'
red
'
,
fontWeight
:
'
bold
'
}}
separatorStyle
=
{{
color
:
'
black
'
}}
timeToShow
=
{[
'
S
'
]}
timeLabels
=
{{
s
:
'
Seconds
'
}}
style
=
{
styles
.
counter
}
/
>
<
/View
>
<
/View
>
<
/Modal
>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
...
...
@@ -242,6 +277,32 @@ const styles = StyleSheet.create({
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
},
centeredView
:
{
flex
:
1
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
marginTop
:
-
90
,
marginLeft
:
-
100
},
modalView
:
{
marginRight
:
20
,
backgroundColor
:
"
#00000000
"
,
borderRadius
:
20
,
padding
:
35
,
alignItems
:
"
center
"
,
// shadowColor: "#000",
// shadowOffset: {
// width: 0,
// height: 2
// },
// shadowOpacity: 0.25,
// shadowRadius: 4,
// elevation: 5
},
button
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
},
})
\ No newline at end of file
frontend/src/screen/activity/Blue2.js
View file @
1e002c7d
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
Orientation
from
'
react-native-orientation-locker
'
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Dimensions
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Modal
,
Dimensions
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
axios
from
"
axios
"
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
client
from
"
../client/Client
"
;
import
Voice
from
'
@react-native-voice/voice
'
;
import
Tts
from
'
react-native-tts
'
;
import
BackButton
from
"
../../component/BackButton
"
export
default
function
Blue2
()
{
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
navigation
=
useNavigation
();
React
.
useEffect
(()
=>
{
...
...
@@ -62,25 +62,25 @@ export default function Blue2() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
secondColor
[
4
])
==
true
)
{
if
(
value
.
includes
(
secondColor
[
4
])
==
true
)
{
console
.
log
(
'
Your Answer is Correct
'
);
sendData
(
mainColor
[
4
]);
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
showAlert
:
true
});
};
};
}
else
{
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
...
...
@@ -103,7 +103,7 @@ export default function Blue2() {
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
...
...
@@ -119,19 +119,19 @@ export default function Blue2() {
// console.log(value.length)
// setPartialResults(e.value);
};
};
const
onFinishCD
=
()
=>
{
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
}
const
startRecording
=
async
()
=>
{
setModalVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
...
...
@@ -150,6 +150,39 @@ export default function Blue2() {
return
(
<
SafeAreaView
>
<
View
>
<
Modal
animationType
=
"
slide
"
transparent
=
{
true
}
hidden
=
{
true
}
visible
=
{
modalVisible
}
onRequestClose
=
{()
=>
{
setModalVisible
(
!
modalVisible
);
}}
>
<
View
style
=
{
styles
.
centeredView
}
>
<
View
style
=
{
styles
.
modalView
}
>
<
CountDown
size
=
{
40
}
until
=
{
3
}
onFinish
=
{()
=>
setModalVisible
(
false
)}
// onFinish={() => navigation.navigate('GameScreenFiveAll')}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
black
'
}}
digitTxtStyle
=
{{
color
:
'
black
'
}}
timeLabelStyle
=
{{
color
:
'
red
'
,
fontWeight
:
'
bold
'
}}
separatorStyle
=
{{
color
:
'
black
'
}}
timeToShow
=
{[
'
S
'
]}
timeLabels
=
{{
s
:
'
Seconds
'
}}
style
=
{
styles
.
counter
}
/
>
<
/View
>
<
/View
>
<
/Modal
>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
...
...
@@ -243,6 +276,24 @@ const styles = StyleSheet.create({
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
},
centeredView
:
{
flex
:
1
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
marginTop
:
-
90
,
marginLeft
:
-
100
},
modalView
:
{
marginRight
:
20
,
backgroundColor
:
"
#00000000
"
,
borderRadius
:
20
,
padding
:
35
,
alignItems
:
"
center
"
,
},
button
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
},
})
\ No newline at end of file
frontend/src/screen/activity/Green.js
View file @
1e002c7d
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
Orientation
from
'
react-native-orientation-locker
'
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Dimensions
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Dimensions
,
Modal
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
axios
from
"
axios
"
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
client
from
"
../client/Client
"
;
import
Voice
from
'
@react-native-voice/voice
'
;
...
...
@@ -15,6 +15,8 @@ import BackButton from "../../component/BackButton"
export
default
function
Green
()
{
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
navigation
=
useNavigation
();
React
.
useEffect
(()
=>
{
...
...
@@ -62,7 +64,7 @@ export default function Green() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
secondColor
[
1
])
==
true
)
{
if
(
value
.
includes
(
secondColor
[
1
])
==
true
)
{
var
color
=
"
Green
"
;
...
...
@@ -72,17 +74,17 @@ export default function Green() {
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
showAlert
:
true
});
};
};
}
else
{
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
...
...
@@ -105,7 +107,7 @@ export default function Green() {
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
...
...
@@ -121,19 +123,19 @@ export default function Green() {
// console.log(value.length)
// setPartialResults(e.value);
};
};
const
onFinishCD
=
()
=>
{
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
}
const
startRecording
=
async
()
=>
{
setModalVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
...
...
@@ -152,6 +154,39 @@ export default function Green() {
return
(
<
SafeAreaView
>
<
View
>
<
Modal
animationType
=
"
slide
"
transparent
=
{
true
}
hidden
=
{
true
}
visible
=
{
modalVisible
}
onRequestClose
=
{()
=>
{
setModalVisible
(
!
modalVisible
);
}}
>
<
View
style
=
{
styles
.
centeredView
}
>
<
View
style
=
{
styles
.
modalView
}
>
<
CountDown
size
=
{
40
}
until
=
{
3
}
onFinish
=
{()
=>
setModalVisible
(
false
)}
// onFinish={() => navigation.navigate('GameScreenFiveAll')}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
black
'
}}
digitTxtStyle
=
{{
color
:
'
black
'
}}
timeLabelStyle
=
{{
color
:
'
red
'
,
fontWeight
:
'
bold
'
}}
separatorStyle
=
{{
color
:
'
black
'
}}
timeToShow
=
{[
'
S
'
]}
timeLabels
=
{{
s
:
'
Seconds
'
}}
style
=
{
styles
.
counter
}
/
>
<
/View
>
<
/View
>
<
/Modal
>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
...
...
@@ -245,6 +280,32 @@ const styles = StyleSheet.create({
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
},
centeredView
:
{
flex
:
1
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
marginTop
:
-
90
,
marginLeft
:
-
100
},
modalView
:
{
marginRight
:
20
,
backgroundColor
:
"
#00000000
"
,
borderRadius
:
20
,
padding
:
35
,
alignItems
:
"
center
"
,
// shadowColor: "#000",
// shadowOffset: {
// width: 0,
// height: 2
// },
// shadowOpacity: 0.25,
// shadowRadius: 4,
// elevation: 5
},
button
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
},
})
\ No newline at end of file
frontend/src/screen/activity/Red.js
View file @
1e002c7d
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
Orientation
from
'
react-native-orientation-locker
'
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Dimensions
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Dimensions
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
,
Modal
,
Pressable
}
from
'
react-native
'
;
import
axios
from
"
axios
"
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
client
from
"
../client/Client
"
;
import
Voice
from
'
@react-native-voice/voice
'
;
import
BackButton
from
"
../../component/BackButton
"
export
default
function
Red
()
{
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
navigation
=
useNavigation
();
React
.
useEffect
(()
=>
{
...
...
@@ -62,7 +61,7 @@ export default function Red() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
secondColor
[
0
])
==
true
)
{
if
(
value
.
includes
(
secondColor
[
0
])
==
true
)
{
console
.
log
(
'
Your Answer is Correct
'
);
...
...
@@ -70,17 +69,17 @@ export default function Red() {
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
showAlert
:
true
});
};
};
}
else
{
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
...
...
@@ -103,7 +102,7 @@ export default function Red() {
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
...
...
@@ -119,19 +118,19 @@ export default function Red() {
// console.log(value.length)
// setPartialResults(e.value);
};
};
const
onFinishCD
=
()
=>
{
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
}
const
startRecording
=
async
()
=>
{
setModalVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
...
...
@@ -150,6 +149,39 @@ export default function Red() {
return
(
<
SafeAreaView
>
<
View
>
<
Modal
animationType
=
"
slide
"
transparent
=
{
true
}
hidden
=
{
true
}
visible
=
{
modalVisible
}
onRequestClose
=
{()
=>
{
setModalVisible
(
!
modalVisible
);
}}
>
<
View
style
=
{
styles
.
centeredView
}
>
<
View
style
=
{
styles
.
modalView
}
>
<
CountDown
size
=
{
40
}
until
=
{
3
}
onFinish
=
{()
=>
setModalVisible
(
false
)}
// onFinish={() => navigation.navigate('GameScreenFiveAll')}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
black
'
}}
digitTxtStyle
=
{{
color
:
'
black
'
}}
timeLabelStyle
=
{{
color
:
'
red
'
,
fontWeight
:
'
bold
'
}}
separatorStyle
=
{{
color
:
'
black
'
}}
timeToShow
=
{[
'
S
'
]}
timeLabels
=
{{
s
:
'
Seconds
'
}}
style
=
{
styles
.
counter
}
/
>
<
/View
>
<
/View
>
<
/Modal
>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
...
...
@@ -186,7 +218,7 @@ export default function Red() {
<
/View
>
<
View
style
=
{{
marginLeft
:
-
100
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
}}
<
TouchableOpacity
onPress
=
{()
=>
{
}}
style
=
{{
width
:
"
60%
"
,
height
:
"
40%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/next.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
.
9
,
marginLeft
:
-
90
}}
/
>
<
/TouchableOpacity
>
...
...
@@ -243,6 +275,24 @@ const styles = StyleSheet.create({
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
},
centeredView
:
{
flex
:
1
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
marginTop
:
-
90
,
marginLeft
:
-
100
},
modalView
:
{
marginRight
:
20
,
backgroundColor
:
"
#00000000
"
,
borderRadius
:
20
,
padding
:
35
,
alignItems
:
"
center
"
,
},
button
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
},
})
\ No newline at end of file
frontend/src/screen/activity/White.js
View file @
1e002c7d
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
Orientation
from
'
react-native-orientation-locker
'
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Dimensions
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Modal
,
Dimensions
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
axios
from
"
axios
"
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
client
from
"
../client/Client
"
;
import
Voice
from
'
@react-native-voice/voice
'
;
...
...
@@ -15,6 +15,8 @@ import BackButton from "../../component/BackButton"
export
default
function
White
()
{
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
navigation
=
useNavigation
();
React
.
useEffect
(()
=>
{
...
...
@@ -62,7 +64,7 @@ export default function White() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
secondColor
[
5
])
==
true
)
{
if
(
value
.
includes
(
secondColor
[
5
])
==
true
)
{
console
.
log
(
'
Your Answer is Correct
'
);
...
...
@@ -70,17 +72,17 @@ export default function White() {
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
showAlert
:
true
});
};
};
}
else
{
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
...
...
@@ -103,7 +105,7 @@ export default function White() {
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
...
...
@@ -119,19 +121,19 @@ export default function White() {
// console.log(value.length)
// setPartialResults(e.value);
};
};
const
onFinishCD
=
()
=>
{
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
}
const
startRecording
=
async
()
=>
{
setModalVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
...
...
@@ -150,6 +152,39 @@ export default function White() {
return
(
<
SafeAreaView
>
<
View
>
<
Modal
animationType
=
"
slide
"
transparent
=
{
true
}
hidden
=
{
true
}
visible
=
{
modalVisible
}
onRequestClose
=
{()
=>
{
setModalVisible
(
!
modalVisible
);
}}
>
<
View
style
=
{
styles
.
centeredView
}
>
<
View
style
=
{
styles
.
modalView
}
>
<
CountDown
size
=
{
40
}
until
=
{
3
}
onFinish
=
{()
=>
setModalVisible
(
false
)}
// onFinish={() => navigation.navigate('GameScreenFiveAll')}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
black
'
}}
digitTxtStyle
=
{{
color
:
'
black
'
}}
timeLabelStyle
=
{{
color
:
'
red
'
,
fontWeight
:
'
bold
'
}}
separatorStyle
=
{{
color
:
'
black
'
}}
timeToShow
=
{[
'
S
'
]}
timeLabels
=
{{
s
:
'
Seconds
'
}}
style
=
{
styles
.
counter
}
/
>
<
/View
>
<
/View
>
<
/Modal
>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
...
...
@@ -185,10 +220,10 @@ export default function White() {
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
marginLeft
:
-
100
,
marginTop
:
-
15
}}
>
<
View
style
=
{{
marginLeft
:
-
100
,
marginTop
:
-
15
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
}}
style
=
{{
width
:
"
60%
"
,
height
:
"
50%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/finish.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
.
9
,
marginLeft
:
-
120
,
}}
/
>
<
Image
source
=
{
require
(
'
../../assets/game/finish.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
.
9
,
marginLeft
:
-
120
,
}}
/
>
<
/TouchableOpacity
>
<
/View
>
...
...
@@ -243,6 +278,24 @@ const styles = StyleSheet.create({
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
},
centeredView
:
{
flex
:
1
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
marginTop
:
-
90
,
marginLeft
:
-
100
},
modalView
:
{
marginRight
:
20
,
backgroundColor
:
"
#00000000
"
,
borderRadius
:
20
,
padding
:
35
,
alignItems
:
"
center
"
,
},
button
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
},
})
\ No newline at end of file
frontend/src/screen/activity/Yellow.js
View file @
1e002c7d
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
Orientation
from
'
react-native-orientation-locker
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Dimensions
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
Modal
,
View
,
Dimensions
,
SafeAreaView
,
ImageBackground
,
Button
,
Image
,
StatusBar
}
from
'
react-native
'
;
import
axios
from
"
axios
"
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
client
from
"
../client/Client
"
;
import
Voice
from
'
@react-native-voice/voice
'
;
...
...
@@ -15,6 +15,8 @@ import BackButton from "../../component/BackButton"
export
default
function
Yellow
()
{
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
navigation
=
useNavigation
();
React
.
useEffect
(()
=>
{
...
...
@@ -62,7 +64,7 @@ export default function Yellow() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
secondColor
[
3
])
==
true
)
{
if
(
value
.
includes
(
secondColor
[
3
])
==
true
)
{
console
.
log
(
'
Your Answer is Correct
'
);
...
...
@@ -70,17 +72,17 @@ export default function Yellow() {
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
showAlert
:
true
});
};
};
}
else
{
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
...
...
@@ -103,7 +105,7 @@ export default function Yellow() {
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
...
...
@@ -119,19 +121,19 @@ export default function Yellow() {
// console.log(value.length)
// setPartialResults(e.value);
};
};
const
onFinishCD
=
()
=>
{
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
}
const
startRecording
=
async
()
=>
{
setModalVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
...
...
@@ -150,6 +152,39 @@ export default function Yellow() {
return
(
<
SafeAreaView
>
<
View
>
<
Modal
animationType
=
"
slide
"
transparent
=
{
true
}
hidden
=
{
true
}
visible
=
{
modalVisible
}
onRequestClose
=
{()
=>
{
setModalVisible
(
!
modalVisible
);
}}
>
<
View
style
=
{
styles
.
centeredView
}
>
<
View
style
=
{
styles
.
modalView
}
>
<
CountDown
size
=
{
40
}
until
=
{
3
}
onFinish
=
{()
=>
setModalVisible
(
false
)}
// onFinish={() => navigation.navigate('GameScreenFiveAll')}
digitStyle
=
{{
backgroundColor
:
'
#FFF
'
,
borderWidth
:
2
,
borderColor
:
'
black
'
}}
digitTxtStyle
=
{{
color
:
'
black
'
}}
timeLabelStyle
=
{{
color
:
'
red
'
,
fontWeight
:
'
bold
'
}}
separatorStyle
=
{{
color
:
'
black
'
}}
timeToShow
=
{[
'
S
'
]}
timeLabels
=
{{
s
:
'
Seconds
'
}}
style
=
{
styles
.
counter
}
/
>
<
/View
>
<
/View
>
<
/Modal
>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
...
...
@@ -243,6 +278,24 @@ const styles = StyleSheet.create({
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
},
centeredView
:
{
flex
:
1
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
marginTop
:
-
90
,
marginLeft
:
-
100
},
modalView
:
{
marginRight
:
20
,
backgroundColor
:
"
#00000000
"
,
borderRadius
:
20
,
padding
:
35
,
alignItems
:
"
center
"
,
},
button
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
},
})
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment