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
84d89021
Commit
84d89021
authored
Apr 29, 2022
by
Lihinikaduwa D.N.R.
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch
parents
c9cdc737
7a211c05
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
195 additions
and
54 deletions
+195
-54
API/app.py
API/app.py
+6
-26
API/db/dbConnection.py
API/db/dbConnection.py
+1
-1
API/model/__pycache__/colorModel.cpython-39.pyc
API/model/__pycache__/colorModel.cpython-39.pyc
+0
-0
API/model/colorModel.py
API/model/colorModel.py
+3
-3
API/routers/__pycache__/dic_config.cpython-39.pyc
API/routers/__pycache__/dic_config.cpython-39.pyc
+0
-0
API/routers/__pycache__/router.cpython-39.pyc
API/routers/__pycache__/router.cpython-39.pyc
+0
-0
API/util/__pycache__/util.cpython-39.pyc
API/util/__pycache__/util.cpython-39.pyc
+0
-0
frontend/src/assets/color/color.js
frontend/src/assets/color/color.js
+3
-0
frontend/src/screen/activity/Black.js
frontend/src/screen/activity/Black.js
+8
-7
frontend/src/screen/activity/Blue2.js
frontend/src/screen/activity/Blue2.js
+36
-5
frontend/src/screen/activity/Green.js
frontend/src/screen/activity/Green.js
+36
-3
frontend/src/screen/activity/Red.js
frontend/src/screen/activity/Red.js
+34
-3
frontend/src/screen/activity/White.js
frontend/src/screen/activity/White.js
+34
-3
frontend/src/screen/activity/Yellow.js
frontend/src/screen/activity/Yellow.js
+34
-3
No files found.
API/app.py
View file @
84d89021
...
...
@@ -11,10 +11,6 @@ from API.routers.router import funtion_one
# from backend.IT18218640.keyword_spotting_service import Keyword_Spotting_service
# from flask_mysqldb import MySQL
# import MySQLdb.cursors
# import re
app
=
Flask
(
__name__
)
...
...
@@ -114,35 +110,19 @@ def store():
date
=
req
[
'date'
]
result
=
"Good"
time
=
"2S"
user
s
Id
=
1
userId
=
1
try
:
response
=
storeResult
(
value
,
date
,
result
,
time
,
usersId
)
return
response
response
=
storeResult
(
date
,
result
,
userId
,
time
,
value
)
print
(
response
)
body
=
jsonify
(
value
)
return
make_response
(
body
)
except
Exception
as
e
:
print
(
e
)
return
e
# Read Function Route (IT)
@
app
.
route
(
"/testings"
)
def
checkothers
():
return
"testing funtions"
@
app
.
route
(
"/ru"
)
def
abc
():
response_val
=
funtion_one
()
# d = jsonify(
# message="Successfully request done",
# data=response_val
# )
# return make_response(d, 200)
return
response_val
# Loging
@
app
.
route
(
"/login"
,
methods
=
[
'POST'
])
def
login
():
...
...
@@ -199,4 +179,4 @@ def reading():
if
__name__
==
"__main__"
:
app
.
run
(
host
=
'192.168.
1.100
'
)
app
.
run
(
host
=
'192.168.
8.101
'
)
API/db/dbConnection.py
View file @
84d89021
...
...
@@ -12,7 +12,7 @@ def create_con():
database
=
"helply"
,
host
=
"127.0.0.1"
,
user
=
"root"
,
password
=
"
12345678
"
password
=
"
rp19970520
"
)
return
db
...
...
API/model/__pycache__/colorModel.cpython-39.pyc
View file @
84d89021
No preview for this file type
API/model/colorModel.py
View file @
84d89021
...
...
@@ -43,12 +43,12 @@ def get_color_activities2():
return
jsonify
(
data_dic
)
def
storeResult
(
value
,
date
,
result
,
time
,
usersId
):
def
storeResult
(
date
,
result
,
userId
,
time
,
value
):
try
:
qry
=
'INSERT INTO coloractivityresult VALUES (NULL,
%
s,
%
s,
%
s,
%
s,
%
s)'
qry
=
'INSERT INTO coloractivityresult
(idColorActivityResult, date, result, userId, time, value)
VALUES (NULL,
%
s,
%
s,
%
s,
%
s,
%
s)'
args
=
(
date
,
result
,
user
s
Id
,
time
,
value
)
args
=
(
date
,
result
,
userId
,
time
,
value
)
response
=
insert
(
qry
,
args
)
return
response
...
...
API/routers/__pycache__/dic_config.cpython-39.pyc
View file @
84d89021
No preview for this file type
API/routers/__pycache__/router.cpython-39.pyc
View file @
84d89021
No preview for this file type
API/util/__pycache__/util.cpython-39.pyc
View file @
84d89021
No preview for this file type
frontend/src/assets/color/color.js
0 → 100644
View file @
84d89021
export
const
mainColor
=
[
"
Red
"
,
"
Green
"
,
"
Black
"
,
"
Yellow
"
,
"
Blue
"
,
"
White
"
];
export
const
secondColor
=
[
"
red
"
,
"
green
"
,
"
black
"
,
"
yellow
"
,
"
blue
"
,
"
white
"
];
\ No newline at end of file
frontend/src/screen/activity/Black.js
View file @
84d89021
...
...
@@ -3,17 +3,19 @@ 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
axios
from
"
axios
"
;
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
Black
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
black
"
;
React
.
useEffect
(()
=>
{
StatusBar
.
setHidden
(
true
);
...
...
@@ -59,13 +61,11 @@ export default function Black() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
)
{
var
color
=
"
Red
"
;
if
(
value
.
includes
(
secondColor
[
2
])
==
true
)
{
console
.
log
(
'
Your Answer is Correct
'
);
sendData
(
color
)
sendData
(
mainColor
[
2
]
)
showAlert
=
()
=>
{
this
.
setState
({
...
...
@@ -73,6 +73,7 @@ export default function Black() {
});
};
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
...
...
@@ -165,7 +166,7 @@ export default function Black() {
<
Image
style
=
{
styles
.
blackboard
}
source
=
{
require
(
"
../../assets/game/blackboard.png
"
)}
><
/Image
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
backColor
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
secondColor
[
2
]
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
/View
>
<
/View
>
...
...
frontend/src/screen/activity/Blue2.js
View file @
84d89021
...
...
@@ -3,10 +3,12 @@ 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
axios
from
"
axios
"
;
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
"
...
...
@@ -14,7 +16,6 @@ import BackButton from "../../component/BackButton"
export
default
function
Blue2
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
blue
"
;
React
.
useEffect
(()
=>
{
...
...
@@ -61,10 +62,12 @@ export default function Blue2() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
){
if
(
value
.
includes
(
secondColor
[
4
]
)
==
true
){
console
.
log
(
'
Your Answer is Correct
'
);
sendData
(
mainColor
[
4
]);
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
...
...
@@ -81,6 +84,34 @@ export default function Blue2() {
};
function
sendData
(
value
)
{
var
date
=
new
Date
().
getDate
();
var
month
=
new
Date
().
getMonth
()
+
1
;
var
year
=
new
Date
().
getFullYear
();
var
todayData
=
date
+
'
-
'
+
month
+
'
-
'
+
year
;
var
data
=
{
value
:
value
,
date
:
todayData
}
data
=
JSON
.
stringify
(
data
);
client
.
post
(
'
store
'
,
data
,
{
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
})
}
const
onSpeechPartialResults
=
e
=>
{
// console.log('onSpeechPartialResults: ', e);
...
...
@@ -136,7 +167,7 @@ export default function Blue2() {
<
Image
style
=
{
styles
.
blackboard
}
source
=
{
require
(
"
../../assets/game/blackboard.png
"
)}
><
/Image
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
backColor
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
secondColor
[
4
]
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
/View
>
<
/View
>
...
...
frontend/src/screen/activity/Green.js
View file @
84d89021
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
axios
from
"
axios
"
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
{
secondColor
}
from
'
../../assets/color/color
'
;
import
client
from
"
../client/Client
"
;
import
Voice
from
'
@react-native-voice/voice
'
;
...
...
@@ -14,7 +16,6 @@ import BackButton from "../../component/BackButton"
export
default
function
Green
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
green
"
;
React
.
useEffect
(()
=>
{
...
...
@@ -61,10 +62,14 @@ export default function Green() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
){
if
(
value
.
includes
(
secondColor
[
1
])
==
true
){
var
color
=
"
Green
"
;
console
.
log
(
'
Your Answer is Correct
'
);
sendData
(
mainColor
[
1
])
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
...
...
@@ -81,6 +86,34 @@ export default function Green() {
};
function
sendData
(
value
)
{
var
date
=
new
Date
().
getDate
();
var
month
=
new
Date
().
getMonth
()
+
1
;
var
year
=
new
Date
().
getFullYear
();
var
todayData
=
date
+
'
-
'
+
month
+
'
-
'
+
year
;
var
data
=
{
value
:
value
,
date
:
todayData
}
data
=
JSON
.
stringify
(
data
);
client
.
post
(
'
store
'
,
data
,
{
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
})
}
const
onSpeechPartialResults
=
e
=>
{
// console.log('onSpeechPartialResults: ', e);
...
...
@@ -136,7 +169,7 @@ export default function Green() {
<
Image
style
=
{
styles
.
blackboard
}
source
=
{
require
(
"
../../assets/game/back2.png
"
)}
><
/Image
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
backColor
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
secondColor
[
1
]
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
/View
>
<
/View
>
...
...
frontend/src/screen/activity/Red.js
View file @
84d89021
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
axios
from
"
axios
"
;
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,7 +16,6 @@ import BackButton from "../../component/BackButton"
export
default
function
Red
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
red
"
;
React
.
useEffect
(()
=>
{
...
...
@@ -61,10 +62,12 @@ export default function Red() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
){
if
(
value
.
includes
(
secondColor
[
0
]
)
==
true
){
console
.
log
(
'
Your Answer is Correct
'
);
sendData
(
mainColor
[
0
])
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
...
...
@@ -81,6 +84,34 @@ export default function Red() {
};
function
sendData
(
value
)
{
var
date
=
new
Date
().
getDate
();
var
month
=
new
Date
().
getMonth
()
+
1
;
var
year
=
new
Date
().
getFullYear
();
var
todayData
=
date
+
'
-
'
+
month
+
'
-
'
+
year
;
var
data
=
{
value
:
value
,
date
:
todayData
}
data
=
JSON
.
stringify
(
data
);
client
.
post
(
'
store
'
,
data
,
{
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
})
}
const
onSpeechPartialResults
=
e
=>
{
// console.log('onSpeechPartialResults: ', e);
...
...
@@ -136,7 +167,7 @@ export default function Red() {
<
Image
style
=
{
styles
.
blackboard
}
source
=
{
require
(
"
../../assets/game/blackboard.png
"
)}
><
/Image
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
backColor
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
secondColor
[
0
]
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
/View
>
<
/View
>
...
...
frontend/src/screen/activity/White.js
View file @
84d89021
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
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
axios
from
"
axios
"
;
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,7 +16,6 @@ import BackButton from "../../component/BackButton"
export
default
function
White
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
white
"
;
React
.
useEffect
(()
=>
{
...
...
@@ -61,10 +62,12 @@ export default function White() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
){
if
(
value
.
includes
(
secondColor
[
5
]
)
==
true
){
console
.
log
(
'
Your Answer is Correct
'
);
sendData
(
mainColor
[
5
])
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
...
...
@@ -81,6 +84,34 @@ export default function White() {
};
function
sendData
(
value
)
{
var
date
=
new
Date
().
getDate
();
var
month
=
new
Date
().
getMonth
()
+
1
;
var
year
=
new
Date
().
getFullYear
();
var
todayData
=
date
+
'
-
'
+
month
+
'
-
'
+
year
;
var
data
=
{
value
:
value
,
date
:
todayData
}
data
=
JSON
.
stringify
(
data
);
client
.
post
(
'
store
'
,
data
,
{
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
})
}
const
onSpeechPartialResults
=
e
=>
{
// console.log('onSpeechPartialResults: ', e);
...
...
@@ -136,7 +167,7 @@ export default function White() {
<
Image
style
=
{
styles
.
blackboard
}
source
=
{
require
(
"
../../assets/game/blackboard.png
"
)}
><
/Image
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
backColor
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
secondColor
[
5
]
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
/View
>
<
/View
>
...
...
frontend/src/screen/activity/Yellow.js
View file @
84d89021
import
{
useNavigation
}
from
"
@react-navigation/native
"
;
import
Orientation
from
'
react-native-orientation-locker
'
;
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
axios
from
"
axios
"
;
import
CountDown
from
'
react-native-countdown-component
'
;
import
{
mainColor
}
from
'
../../assets/color/color
'
;
import
client
from
"
../client/Client
"
;
import
Voice
from
'
@react-native-voice/voice
'
;
...
...
@@ -14,7 +16,6 @@ import BackButton from "../../component/BackButton"
export
default
function
Yellow
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
yellow
"
;
React
.
useEffect
(()
=>
{
...
...
@@ -61,10 +62,12 @@ export default function Yellow() {
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
){
if
(
value
.
includes
(
secondColor
[
3
]
)
==
true
){
console
.
log
(
'
Your Answer is Correct
'
);
sendData
(
mainColor
[
3
])
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
...
...
@@ -81,6 +84,34 @@ export default function Yellow() {
};
function
sendData
(
value
)
{
var
date
=
new
Date
().
getDate
();
var
month
=
new
Date
().
getMonth
()
+
1
;
var
year
=
new
Date
().
getFullYear
();
var
todayData
=
date
+
'
-
'
+
month
+
'
-
'
+
year
;
var
data
=
{
value
:
value
,
date
:
todayData
}
data
=
JSON
.
stringify
(
data
);
client
.
post
(
'
store
'
,
data
,
{
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
})
}
const
onSpeechPartialResults
=
e
=>
{
// console.log('onSpeechPartialResults: ', e);
...
...
@@ -136,7 +167,7 @@ export default function Yellow() {
<
Image
style
=
{
styles
.
blackboard
}
source
=
{
require
(
"
../../assets/game/blackboard.png
"
)}
><
/Image
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
backColor
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
secondColor
[
3
]
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
/View
>
<
/View
>
...
...
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