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
065e790b
Commit
065e790b
authored
Apr 29, 2022
by
Lihinikaduwa D.N.R.
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch
parents
d18191f3
4377b9c5
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
2205 additions
and
43 deletions
+2205
-43
API/__pycache__/keyword_spotting_service.cpython-39.pyc
API/__pycache__/keyword_spotting_service.cpython-39.pyc
+0
-0
API/app.py
API/app.py
+54
-11
API/color.wav
API/color.wav
+0
-0
API/db/dbConnection.py
API/db/dbConnection.py
+1
-1
API/model/colorModel.py
API/model/colorModel.py
+17
-2
frontend/android/app/src/main/java/com/firstapp/MainApplication.java
...droid/app/src/main/java/com/firstapp/MainApplication.java
+1
-0
frontend/android/settings.gradle
frontend/android/settings.gradle
+2
-0
frontend/ios/Podfile
frontend/ios/Podfile
+2
-0
frontend/package-lock.json
frontend/package-lock.json
+308
-0
frontend/package.json
frontend/package.json
+3
-0
frontend/src/assets/color/black.jpg
frontend/src/assets/color/black.jpg
+0
-0
frontend/src/assets/color/blue.jpg
frontend/src/assets/color/blue.jpg
+0
-0
frontend/src/assets/color/green.jpg
frontend/src/assets/color/green.jpg
+0
-0
frontend/src/assets/color/red.jpg
frontend/src/assets/color/red.jpg
+0
-0
frontend/src/assets/color/white.jpg
frontend/src/assets/color/white.jpg
+0
-0
frontend/src/assets/color/yellow.png
frontend/src/assets/color/yellow.png
+0
-0
frontend/src/assets/game/back2.png
frontend/src/assets/game/back2.png
+0
-0
frontend/src/assets/game/finish.png
frontend/src/assets/game/finish.png
+0
-0
frontend/src/component/colorActivity.js
frontend/src/component/colorActivity.js
+1
-1
frontend/src/constants/Colors.js
frontend/src/constants/Colors.js
+1
-1
frontend/src/router/router.js
frontend/src/router/router.js
+49
-2
frontend/src/screen/Color.js
frontend/src/screen/Color.js
+2
-2
frontend/src/screen/activity/Black.js
frontend/src/screen/activity/Black.js
+246
-0
frontend/src/screen/activity/Blue.js
frontend/src/screen/activity/Blue.js
+1
-14
frontend/src/screen/activity/Blue2.js
frontend/src/screen/activity/Blue2.js
+217
-0
frontend/src/screen/activity/Green.js
frontend/src/screen/activity/Green.js
+217
-0
frontend/src/screen/activity/PrimaryType.js
frontend/src/screen/activity/PrimaryType.js
+200
-5
frontend/src/screen/activity/Red.js
frontend/src/screen/activity/Red.js
+217
-0
frontend/src/screen/activity/SecondaryType.js
frontend/src/screen/activity/SecondaryType.js
+197
-4
frontend/src/screen/activity/White.js
frontend/src/screen/activity/White.js
+217
-0
frontend/src/screen/activity/Yellow.js
frontend/src/screen/activity/Yellow.js
+217
-0
frontend/src/screen/client/Client.js
frontend/src/screen/client/Client.js
+4
-0
frontend/src/screen/sample/sam.js
frontend/src/screen/sample/sam.js
+31
-0
No files found.
API/__pycache__/keyword_spotting_service.cpython-39.pyc
deleted
100644 → 0
View file @
d18191f3
File deleted
API/app.py
View file @
065e790b
...
...
@@ -3,9 +3,15 @@
from
flask
import
Flask
,
redirect
,
url_for
,
render_template
,
request
,
jsonify
,
make_response
import
random
import
os
<<<<<<<
HEAD
from
API.model.colorModel
import
get_color_activities1
,
get_color_activities2
,
get_color_activity_result
from
API.model.readModel
import
get_reading_activities
,
save_activity_details
from
API.model.userModel
import
getUser
,
saveUserSession
=======
from
API.model.colorModel
import
get_color_activities1
,
get_color_activities2
,
get_color_activity_result
,
storeResult
from
API.model.readModel
import
get_reading_activities
from
API.model.userModel
import
getStudentByName
>>>>>>>
4377
b9c5fafb5c155a043560f662f4da96c37e12
from
API.routers.router
import
funtion_one
# from backend.IT18218640.keyword_spotting_service import Keyword_Spotting_service
...
...
@@ -45,22 +51,33 @@ def getColorActivitiesResult():
@
app
.
route
(
"/predict"
,
methods
=
[
"POST"
])
def
predict
():
<<<<<<<
HEAD
data
=
request
.
get_json
()
print
((
f
"{data}"
))
=======
fileitem
=
data
[
'uri'
]
try
:
data
=
request
.
get_json
()
>>>>>>>
4377
b9c5fafb5c155a043560f662f4da96c37e12
# if fileitem.filename:
# # strip the leading path from the file name
fn
=
os
.
path
.
basename
(
fileitem
)
#
# # open read and write the file into the server
open
(
fn
,
'wb'
)
.
write
(
fileitem
.
file
.
read
())
fileitem
=
data
[
'uri'
]
colorName
=
data
[
'colorNmae'
]
# print((f"{colorName}"))
# if fileitem.filename:
# # strip the leading path from the file name
fn
=
os
.
path
.
basename
(
fileitem
)
#
# # open read and write the file into the server
# open(fn, 'wb').write(fileitem.file.read())
resp
=
make_response
(
request
.
get_json
())
resp
.
headers
[
'Access-Control-Allow-Origin'
]
=
'*'
resp
.
headers
[
'Content-Type'
]
=
'application/json'
return
resp
resp
=
make_response
(
request
.
get_json
())
resp
.
headers
[
'Access-Control-Allow-Origin'
]
=
'*'
resp
.
headers
[
'Content-Type'
]
=
'application/json'
return
resp
except
ValueError
:
print
(
ValueError
)
# get audio file and save it
# audio_file = request.files["file"]
...
...
@@ -97,6 +114,26 @@ def predict():
# return jsonify("print")
# return "Print"
@
app
.
route
(
"/store"
,
methods
=
[
"POST"
])
def
store
():
req
=
request
.
get_json
()
value
=
req
[
'value'
]
date
=
req
[
'date'
]
result
=
"Good"
time
=
"2S"
usersId
=
1
try
:
response
=
storeResult
(
value
,
date
,
result
,
time
,
usersId
)
return
response
except
Exception
as
e
:
print
(
e
)
return
e
# Read Function Route (IT)
...
...
@@ -160,4 +197,10 @@ def reading():
if
__name__
==
"__main__"
:
<<<<<<<
HEAD
app
.
run
(
host
=
'192.168.1.101'
)
=======
app
.
run
(
host
=
'192.168.8.101'
)
# app.run(host='192.168.8.102')
# app.run(debug=True)
>>>>>>>
4377
b9c5fafb5c155a043560f662f4da96c37e12
API/color.wav
0 → 100644
View file @
065e790b
API/db/dbConnection.py
View file @
065e790b
...
...
@@ -12,7 +12,7 @@ def create_con():
database
=
"helply"
,
host
=
"127.0.0.1"
,
user
=
"root"
,
password
=
"
12345678
"
password
=
"
rp19970520
"
)
return
db
...
...
API/model/colorModel.py
View file @
065e790b
from
flask
import
jsonify
from
API.db.dbConnection
import
get_all_data
from
API.db.dbConnection
import
get_all_data
,
insert_data_json
,
insert_data
,
insert
def
get_color_activities1
():
data_dic
=
[]
...
...
@@ -42,6 +43,20 @@ def get_color_activities2():
return
jsonify
(
data_dic
)
def
storeResult
(
value
,
date
,
result
,
time
,
usersId
):
try
:
qry
=
'INSERT INTO coloractivityresult VALUES (NULL,
%
s,
%
s,
%
s,
%
s,
%
s)'
args
=
(
date
,
result
,
usersId
,
time
,
value
)
response
=
insert
(
qry
,
args
)
return
response
except
Exception
as
e
:
print
(
e
)
return
e
def
get_color_activity_result
():
data_dic
=
[]
...
...
@@ -51,7 +66,7 @@ def get_color_activity_result():
for
row
in
result
:
ob
=
{
"id
coloractivityr
esult"
:
row
[
0
],
"id
ColorActivityR
esult"
:
row
[
0
],
"idcolorActivities"
:
row
[
1
],
"date"
:
row
[
2
],
"time"
:
row
[
3
],
...
...
frontend/android/app/src/main/java/com/firstapp/MainApplication.java
View file @
065e790b
...
...
@@ -4,6 +4,7 @@ import android.app.Application;
import
android.content.Context
;
import
com.facebook.react.PackageList
;
import
com.facebook.react.ReactApplication
;
import
net.no_mad.tts.TextToSpeechPackage
;
import
com.facebook.react.ReactInstanceManager
;
import
com.facebook.react.ReactNativeHost
;
import
com.facebook.react.ReactPackage
;
...
...
frontend/android/settings.gradle
View file @
065e790b
rootProject
.
name
=
'firstApp'
include
':react-native-tts'
project
(
':react-native-tts'
).
projectDir
=
new
File
(
rootProject
.
projectDir
,
'../node_modules/react-native-tts/android'
)
apply
from:
file
(
"../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"
);
applyNativeModulesSettingsGradle
(
settings
)
include
':app'
frontend/ios/Podfile
View file @
065e790b
...
...
@@ -12,6 +12,8 @@ target 'firstApp' do
:hermes_enabled
=>
false
)
pod
'TextToSpeech'
,
:path
=>
'../node_modules/react-native-tts'
target
'firstAppTests'
do
inherit!
:complete
# Pods for testing
...
...
frontend/package-lock.json
View file @
065e790b
...
...
@@ -18,6 +18,8 @@
"react": "17.0.2",
"react-native": "0.66.2",
"react-native-audio-record": "^0.2.2",
"react-native-awesome-alerts": "^1.5.2",
"react-native-countdown-circle-timer": "^3.0.9",
"react-native-countdown-component": "^2.7.1",
"react-native-elements": "^3.4.2",
"react-native-fontawesome": "^7.0.0",
...
...
@@ -28,6 +30,7 @@
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.9.0",
"react-native-table-component": "^1.2.1",
"react-native-tts": "^4.1.0",
"react-native-vector-icons": "^9.0.0",
"react-redux": "^7.2.6",
"redux": "^4.1.2"
...
...
@@ -5468,6 +5471,12 @@
"node": ">=0.6"
}
},
"node_modules/boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
"peer": true
},
"node_modules/bplist-creator": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz",
...
...
@@ -6147,6 +6156,56 @@
"node": ">= 8"
}
},
"node_modules/css-select": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz",
"integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==",
"peer": true,
"dependencies": {
"boolbase": "^1.0.0",
"css-what": "^6.0.1",
"domhandler": "^4.3.1",
"domutils": "^2.8.0",
"nth-check": "^2.0.1"
},
"funding": {
"url": "https://github.com/sponsors/fb55"
}
},
"node_modules/css-tree": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
"integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==",
"peer": true,
"dependencies": {
"mdn-data": "2.0.14",
"source-map": "^0.6.1"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/css-tree/node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/css-what": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz",
"integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==",
"peer": true,
"engines": {
"node": ">= 6"
},
"funding": {
"url": "https://github.com/sponsors/fb55"
}
},
"node_modules/cssom": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz",
...
...
@@ -6343,6 +6402,32 @@
"@babel/runtime": "^7.1.2"
}
},
"node_modules/dom-serializer": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz",
"integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==",
"peer": true,
"dependencies": {
"domelementtype": "^2.0.1",
"domhandler": "^4.2.0",
"entities": "^2.0.0"
},
"funding": {
"url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
}
},
"node_modules/domelementtype": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
"integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/fb55"
}
],
"peer": true
},
"node_modules/domexception": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz",
...
...
@@ -6364,6 +6449,35 @@
"node": ">=8"
}
},
"node_modules/domhandler": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz",
"integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==",
"peer": true,
"dependencies": {
"domelementtype": "^2.2.0"
},
"engines": {
"node": ">= 4"
},
"funding": {
"url": "https://github.com/fb55/domhandler?sponsor=1"
}
},
"node_modules/domutils": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
"integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
"peer": true,
"dependencies": {
"dom-serializer": "^1.0.1",
"domelementtype": "^2.2.0",
"domhandler": "^4.2.0"
},
"funding": {
"url": "https://github.com/fb55/domutils?sponsor=1"
}
},
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
...
...
@@ -6420,6 +6534,15 @@
"node": ">=8.6"
}
},
"node_modules/entities": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
"integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
"peer": true,
"funding": {
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
"node_modules/envinfo": {
"version": "7.8.1",
"resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz",
...
...
@@ -10679,6 +10802,12 @@
"node": ">=0.10.0"
}
},
"node_modules/mdn-data": {
"version": "2.0.14",
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz",
"integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==",
"peer": true
},
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
...
...
@@ -11692,6 +11821,18 @@
"node": ">=8"
}
},
"node_modules/nth-check": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz",
"integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==",
"peer": true,
"dependencies": {
"boolbase": "^1.0.0"
},
"funding": {
"url": "https://github.com/fb55/nth-check?sponsor=1"
}
},
"node_modules/nullthrows": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz",
...
...
@@ -12508,6 +12649,14 @@
"resolved": "https://registry.npmjs.org/react-native-audio-record/-/react-native-audio-record-0.2.2.tgz",
"integrity": "sha512-+JEY3AWz21xylePbXZ81DLHcqU5oJYztn3Uel3ay53P3ZrvJlwfmOmyOuoavA9boPV1O0dLLQIu9gC7xbKwNvQ=="
},
"node_modules/react-native-awesome-alerts": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/react-native-awesome-alerts/-/react-native-awesome-alerts-1.5.2.tgz",
"integrity": "sha512-PPTzKLpwDKbjeghvrRkg7OunND4C7d4bQORVLBnhqUK2z2PfZiI3UCULU0tczzeOyavv5hVSrYNXKPXlvhfmVg==",
"dependencies": {
"prop-types": "^15.7.2"
}
},
"node_modules/react-native-codegen": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/react-native-codegen/-/react-native-codegen-0.0.7.tgz",
...
...
@@ -12518,6 +12667,16 @@
"nullthrows": "^1.1.1"
}
},
"node_modules/react-native-countdown-circle-timer": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/react-native-countdown-circle-timer/-/react-native-countdown-circle-timer-3.0.9.tgz",
"integrity": "sha512-7djFk+2QQS9FAhfIUhwQoc+P/7Vkn9EJApr6zUWK9B5QvHP07UlqIWfhIPqqeMa4kP6y5Y2S3YL+xeRsq2tNfg==",
"peerDependencies": {
"react": ">=16.8.0",
"react-native": ">=0.50.0",
"react-native-svg": ">=6.2.1"
}
},
"node_modules/react-native-countdown-component": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/react-native-countdown-component/-/react-native-countdown-component-2.7.1.tgz",
...
...
@@ -12653,11 +12812,30 @@
"react-native": "*"
}
},
"node_modules/react-native-svg": {
"version": "12.3.0",
"resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-12.3.0.tgz",
"integrity": "sha512-ESG1g1j7/WLD7X3XRFTQHVv0r6DpbHNNcdusngAODIxG88wpTWUZkhcM3A2HJTb+BbXTFDamHv7FwtRKWQ/ALg==",
"peer": true,
"dependencies": {
"css-select": "^4.2.1",
"css-tree": "^1.0.0-alpha.39"
},
"peerDependencies": {
"react": "*",
"react-native": ">=0.50.0"
}
},
"node_modules/react-native-table-component": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/react-native-table-component/-/react-native-table-component-1.2.2.tgz",
"integrity": "sha512-7bbsi5431iWcjj3toASh8lFHGi6AG/+MTd4M7GuksXKxx/CFs/Qwv1Ys7D2wgyuYKe3hxWNfSVrteFj0tOYXYw=="
},
"node_modules/react-native-tts": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/react-native-tts/-/react-native-tts-4.1.0.tgz",
"integrity": "sha512-tvf3lQ6u9MqztUie37qoPw5YQPqi0ql1lPhDsBBs/RRA6A/H1J9X9H/qb1A0Hx0ZpjavrEdtVSqQQ2JDZvZCTQ=="
},
"node_modules/react-native-vector-icons": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-9.0.0.tgz",
...
...
@@ -19456,6 +19634,12 @@
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.50.tgz",
"integrity": "sha512-+O2uoQWFRo8ysZNo/rjtri2jIwjr3XfeAgRjAUADRqGG+ZITvyn8J1kvXLTaKVr3hhGXk+f23tKfdzmklVM9vQ=="
},
"boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
"peer": true
},
"bplist-creator": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz",
...
...
@@ -20007,6 +20191,43 @@
"which": "^2.0.1"
}
},
"css-select": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz",
"integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==",
"peer": true,
"requires": {
"boolbase": "^1.0.0",
"css-what": "^6.0.1",
"domhandler": "^4.3.1",
"domutils": "^2.8.0",
"nth-check": "^2.0.1"
}
},
"css-tree": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
"integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==",
"peer": true,
"requires": {
"mdn-data": "2.0.14",
"source-map": "^0.6.1"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"peer": true
}
}
},
"css-what": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz",
"integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==",
"peer": true
},
"cssom": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz",
...
...
@@ -20161,6 +20382,23 @@
"@babel/runtime": "^7.1.2"
}
},
"dom-serializer": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz",
"integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==",
"peer": true,
"requires": {
"domelementtype": "^2.0.1",
"domhandler": "^4.2.0",
"entities": "^2.0.0"
}
},
"domelementtype": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
"integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
"peer": true
},
"domexception": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz",
...
...
@@ -20178,6 +20416,26 @@
}
}
},
"domhandler": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz",
"integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==",
"peer": true,
"requires": {
"domelementtype": "^2.2.0"
}
},
"domutils": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
"integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
"peer": true,
"requires": {
"dom-serializer": "^1.0.1",
"domelementtype": "^2.2.0",
"domhandler": "^4.2.0"
}
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
...
...
@@ -20222,6 +20480,12 @@
"ansi-colors": "^4.1.1"
}
},
"entities": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
"integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
"peer": true
},
"envinfo": {
"version": "7.8.1",
"resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz",
...
...
@@ -23449,6 +23713,12 @@
"object-visit": "^1.0.0"
}
},
"mdn-data": {
"version": "2.0.14",
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz",
"integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==",
"peer": true
},
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
...
...
@@ -24302,6 +24572,15 @@
"path-key": "^3.0.0"
}
},
"nth-check": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz",
"integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==",
"peer": true,
"requires": {
"boolbase": "^1.0.0"
}
},
"nullthrows": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz",
...
...
@@ -24919,6 +25198,14 @@
"resolved": "https://registry.npmjs.org/react-native-audio-record/-/react-native-audio-record-0.2.2.tgz",
"integrity": "sha512-+JEY3AWz21xylePbXZ81DLHcqU5oJYztn3Uel3ay53P3ZrvJlwfmOmyOuoavA9boPV1O0dLLQIu9gC7xbKwNvQ=="
},
"react-native-awesome-alerts": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/react-native-awesome-alerts/-/react-native-awesome-alerts-1.5.2.tgz",
"integrity": "sha512-PPTzKLpwDKbjeghvrRkg7OunND4C7d4bQORVLBnhqUK2z2PfZiI3UCULU0tczzeOyavv5hVSrYNXKPXlvhfmVg==",
"requires": {
"prop-types": "^15.7.2"
}
},
"react-native-codegen": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/react-native-codegen/-/react-native-codegen-0.0.7.tgz",
...
...
@@ -24929,6 +25216,12 @@
"nullthrows": "^1.1.1"
}
},
"react-native-countdown-circle-timer": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/react-native-countdown-circle-timer/-/react-native-countdown-circle-timer-3.0.9.tgz",
"integrity": "sha512-7djFk+2QQS9FAhfIUhwQoc+P/7Vkn9EJApr6zUWK9B5QvHP07UlqIWfhIPqqeMa4kP6y5Y2S3YL+xeRsq2tNfg==",
"requires": {}
},
"react-native-countdown-component": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/react-native-countdown-component/-/react-native-countdown-component-2.7.1.tgz",
...
...
@@ -25030,11 +25323,26 @@
"integrity": "sha512-mKOfBLIBFBcs9br1rlZDvxD5+mAl8Gfr5CounwJtxI6Z82rGrMO+Kgl9EIg3RMVf3G855a85YVqHJL2f5EDRlw==",
"requires": {}
},
"react-native-svg": {
"version": "12.3.0",
"resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-12.3.0.tgz",
"integrity": "sha512-ESG1g1j7/WLD7X3XRFTQHVv0r6DpbHNNcdusngAODIxG88wpTWUZkhcM3A2HJTb+BbXTFDamHv7FwtRKWQ/ALg==",
"peer": true,
"requires": {
"css-select": "^4.2.1",
"css-tree": "^1.0.0-alpha.39"
}
},
"react-native-table-component": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/react-native-table-component/-/react-native-table-component-1.2.2.tgz",
"integrity": "sha512-7bbsi5431iWcjj3toASh8lFHGi6AG/+MTd4M7GuksXKxx/CFs/Qwv1Ys7D2wgyuYKe3hxWNfSVrteFj0tOYXYw=="
},
"react-native-tts": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/react-native-tts/-/react-native-tts-4.1.0.tgz",
"integrity": "sha512-tvf3lQ6u9MqztUie37qoPw5YQPqi0ql1lPhDsBBs/RRA6A/H1J9X9H/qb1A0Hx0ZpjavrEdtVSqQQ2JDZvZCTQ=="
},
"react-native-vector-icons": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-9.0.0.tgz",
frontend/package.json
View file @
065e790b
...
...
@@ -20,6 +20,8 @@
"react"
:
"17.0.2"
,
"react-native"
:
"0.66.2"
,
"react-native-audio-record"
:
"^0.2.2"
,
"react-native-awesome-alerts"
:
"^1.5.2"
,
"react-native-countdown-circle-timer"
:
"^3.0.9"
,
"react-native-countdown-component"
:
"^2.7.1"
,
"react-native-elements"
:
"^3.4.2"
,
"react-native-fontawesome"
:
"^7.0.0"
,
...
...
@@ -30,6 +32,7 @@
"react-native-safe-area-context"
:
"^3.3.2"
,
"react-native-screens"
:
"^3.9.0"
,
"react-native-table-component"
:
"^1.2.1"
,
"react-native-tts"
:
"^4.1.0"
,
"react-native-vector-icons"
:
"^9.0.0"
,
"react-redux"
:
"^7.2.6"
,
"redux"
:
"^4.1.2"
...
...
frontend/src/assets/color/black.jpg
0 → 100644
View file @
065e790b
24.7 KB
frontend/src/assets/color/blue.jpg
0 → 100644
View file @
065e790b
113 KB
frontend/src/assets/color/green.jpg
0 → 100644
View file @
065e790b
16.2 KB
frontend/src/assets/color/red.jpg
0 → 100644
View file @
065e790b
12.2 KB
frontend/src/assets/color/white.jpg
0 → 100644
View file @
065e790b
29.7 KB
frontend/src/assets/color/yellow.png
0 → 100644
View file @
065e790b
53.5 KB
frontend/src/assets/game/back2.png
0 → 100644
View file @
065e790b
35.4 KB
frontend/src/assets/game/finish.png
0 → 100644
View file @
065e790b
53.5 KB
frontend/src/component/colorActivity.js
View file @
065e790b
...
...
@@ -10,7 +10,7 @@ export default function ColorActivity(props){
const
navigation
=
useNavigation
();
return
(
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
Blue
"
,
{
color
})}}
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
Blue
2
"
,
{
color
})}}
style
=
{{
borderWidth
:
5
,
borderColor
:
color
,
...
...
frontend/src/constants/Colors.js
View file @
065e790b
export
default
{
primary
:
'
#f7287b
'
,
secondary
:
'
#
c717fc
'
secondary
:
'
#
1DCE92
'
}
\ No newline at end of file
frontend/src/router/router.js
View file @
065e790b
...
...
@@ -7,9 +7,15 @@ import Home from '../screen/home';
import
Start
from
'
../screen/Start
'
;
import
Register
from
'
../screen/auth/Register
'
;
import
Login
from
'
../screen/auth/Login
'
;
import
Splash
from
'
../screen/splash/
s
plash
'
;
import
Splash
from
'
../screen/splash/
S
plash
'
;
import
Color
from
'
../screen/Color
'
;
import
Blue
from
'
../screen/activity/Blue
'
;
import
Blue2
from
'
../screen/activity/Blue2
'
;
import
Red
from
'
../screen/activity/Red
'
;
import
Green
from
'
../screen/activity/Green
'
;
import
Black
from
'
../screen/activity/Black
'
;
import
Yellow
from
'
../screen/activity/Yellow
'
;
import
White
from
'
../screen/activity/White
'
;
import
Read
from
'
../screen/Read
'
;
import
ReadActivity
from
'
../screen/reading/ReadActivity
'
;
import
ReadActivityBird
from
'
../screen/reading/advanced/ReadActivityBird
'
;
...
...
@@ -32,6 +38,8 @@ import GameScreenSix from '../screen/memory/elementry/GameScreenSix';
import
GameScreenSixAll
from
'
../screen/memory/elementry/GameScreenSixAll
'
;
import
GameOverScreen
from
'
../screen/memory/GameOverScreen
'
;
import
Sam
from
'
../screen/sample/sam
'
;
const
Stack
=
createNativeStackNavigator
();
const
AppRouter
=
()
=>
{
...
...
@@ -64,7 +72,11 @@ const AppRouter = () => {
component
=
{
Start
}
/
>
<
Stack
.
Screen
options
=
{{
headerShown
:
false
}}
options
=
{{
title
:
'
Color Activity
'
,
headerTintColor
:
'
white
'
,
headerStyle
:
{
backgroundColor
:
Colors
.
secondary
},
}}
name
=
"
Color
"
component
=
{
Color
}
/
>
...
...
@@ -73,6 +85,36 @@ const AppRouter = () => {
name
=
"
Blue
"
component
=
{
Blue
}
/
>
<
Stack
.
Screen
options
=
{{
headerShown
:
false
}}
name
=
"
Blue2
"
component
=
{
Blue2
}
/
>
<
Stack
.
Screen
options
=
{{
headerShown
:
false
}}
name
=
"
Red
"
component
=
{
Red
}
/
>
<
Stack
.
Screen
options
=
{{
headerShown
:
false
}}
name
=
"
Green
"
component
=
{
Green
}
/
>
<
Stack
.
Screen
options
=
{{
headerShown
:
false
}}
name
=
"
Black
"
component
=
{
Black
}
/
>
<
Stack
.
Screen
options
=
{{
headerShown
:
false
}}
name
=
"
Yellow
"
component
=
{
Yellow
}
/
>
<
Stack
.
Screen
options
=
{{
headerShown
:
false
}}
name
=
"
White
"
component
=
{
White
}
/
>
<
Stack
.
Screen
options
=
{{
title
:
'
Read Activity
'
,
...
...
@@ -196,6 +238,11 @@ const AppRouter = () => {
name
=
"
SecondaryType
"
component
=
{
SecondaryType
}
/
>
<
Stack
.
Screen
options
=
{{
headerShown
:
false
}}
name
=
"
Sam
"
component
=
{
Sam
}
/
>
<
/Stack.Navigator
>
<
/NavigationContainer
>
);
...
...
frontend/src/screen/Color.js
View file @
065e790b
...
...
@@ -25,14 +25,14 @@ export default function Color() {
<
SafeAreaView
>
<
ScrollView
>
<
View
>
{
/*
<View>
<View>
<ImageBackground source={require("../assets/color/background.png")}
style={styles.image}>
<Text style={styles.title}>Color Activity</Text>
</ImageBackground>
</View>
<
/View
>
</View>
*/
}
<
View
style
=
{{
marginTop
:
40
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
PrimaryType
"
,
{
title
:
'
Primary Activities
'
,
id
:
1
})
}}
...
...
frontend/src/screen/activity/Black.js
0 → 100644
View file @
065e790b
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
axios
from
"
axios
"
;
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
Black
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
black
"
;
React
.
useEffect
(()
=>
{
StatusBar
.
setHidden
(
true
);
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
Orientation
.
unlockAllOrientations
();
Orientation
.
lockToLandscape
();
});
return
unsubscribe
;
},
[
navigation
]);
useEffect
(()
=>
{
Voice
.
onSpeechStart
=
onSpeechStartHandler
;
Voice
.
onSpeechEnd
=
onSpeechEndHandler
;
Voice
.
onSpeechResults
=
onSpeechResultsHandler
;
Voice
.
onSpeechPartialResults
=
onSpeechPartialResults
;
// console.log(backColor);
return
()
=>
{
Voice
.
destroy
().
then
(
Voice
.
removeAllListeners
);
};
},
[]);
const
onSpeechStartHandler
=
e
=>
{
// console.log('start handler =>> ', e);
};
const
onSpeechEndHandler
=
e
=>
{
// console.log('end handler =>> ', e);
};
const
onSpeechResultsHandler
=
e
=>
{
// console.log('result handler =>> ', e);
// setTimeout(() => {
// alert("Please Pronouce Color");
// }, 3000);
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
)
{
var
color
=
"
Red
"
;
console
.
log
(
'
Your Answer is Correct
'
);
sendData
(
color
)
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
});
};
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
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);
// const value = e.value;
// console.log(value.length)
// setPartialResults(e.value);
};
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
const
startRecording
=
async
()
=>
{
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
console
.
log
(
'
error =>>
'
,
error
);
}
};
const
stopRecording
=
async
()
=>
{
try
{
await
Voice
.
stop
();
}
catch
(
error
)
{
console
.
log
(
error
);
}
};
return
(
<
SafeAreaView
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
<
View
>
<
View
style
=
{
styles
.
textBody
}
>
<
Text
style
=
{
styles
.
text
}
>
Say
the
name
of
this
color
?
<
/Text
>
<
/View
>
<
Image
style
=
{
styles
.
robo
}
source
=
{
require
(
"
../../assets/game/robo.png
"
)}
><
/Image
>
<
/View
>
<
View
>
<
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
>
<
/View
>
<
View
style
=
{{
marginTop
:
10
}}
>
<
BackButton
path
=
"
Color
"
/>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
row
"
,
marginLeft
:
420
,
marginTop
:
-
50
}}
>
<
View
style
=
{{}}
>
<
TouchableOpacity
onPress
=
{
startRecording
}
style
=
{{
width
:
"
30%
"
,
height
:
"
35%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/mic2.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
1
,
marginLeft
:
-
190
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
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
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/ImageBackground
>
<
/View
>
<
/SafeAreaView
>
)
}
const
styles
=
StyleSheet
.
create
({
body
:
{
flex
:
1
,
},
image
:
{
width
:
"
100%
"
,
height
:
"
100%
"
,
},
blackboard
:
{
marginTop
:
-
420
,
marginLeft
:
240
,
width
:
"
70%
"
,
height
:
500
,
},
robo
:
{
marginTop
:
-
70
,
marginLeft
:
-
5
,
width
:
150
,
height
:
200
,
},
textBody
:
{
marginTop
:
150
,
marginLeft
:
95
,
backgroundColor
:
"
#1DCE92
"
,
width
:
200
,
borderRadius
:
50
,
padding
:
5
,
},
text
:
{
fontSize
:
25
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
color
:
"
white
"
,
textAlign
:
'
center
'
,
fontWeight
:
'
bold
'
},
button
:
{
padding
:
10
,
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
})
\ No newline at end of file
frontend/src/screen/activity/Blue.js
View file @
065e790b
...
...
@@ -94,25 +94,12 @@ export default function Blue(color) {
const
formData
=
new
FormData
();
var
obj
=
{
uri
:
`file:
//
${
audioFile
}
`
,
uri
:
`file:
${
audioFile
}
`
,
type
:
'
audio/wav
'
,
name
:
'
color.wav
'
,
colorNmae
:
backColor
}
// formData.append(
// 'file',
// {
// uri: `file://${audioFile}`,
// type: 'audio/wav',
// name: 'color.wav',
// }
// );
// formData.append(
// 'name', backColor
// );
var
data
=
JSON
.
stringify
(
obj
)
console
.
log
(
data
);
...
...
frontend/src/screen/activity/Blue2.js
0 → 100644
View file @
065e790b
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
axios
from
"
axios
"
;
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
Blue2
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
blue
"
;
React
.
useEffect
(()
=>
{
StatusBar
.
setHidden
(
true
);
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
Orientation
.
unlockAllOrientations
();
Orientation
.
lockToLandscape
();
});
return
unsubscribe
;
},
[
navigation
]);
useEffect
(()
=>
{
Voice
.
onSpeechStart
=
onSpeechStartHandler
;
Voice
.
onSpeechEnd
=
onSpeechEndHandler
;
Voice
.
onSpeechResults
=
onSpeechResultsHandler
;
Voice
.
onSpeechPartialResults
=
onSpeechPartialResults
;
// console.log(backColor);
return
()
=>
{
Voice
.
destroy
().
then
(
Voice
.
removeAllListeners
);
};
},
[]);
const
onSpeechStartHandler
=
e
=>
{
// console.log('start handler =>> ', e);
};
const
onSpeechEndHandler
=
e
=>
{
// console.log('end handler =>> ', e);
};
const
onSpeechResultsHandler
=
e
=>
{
// console.log('result handler =>> ', e);
// setTimeout(() => {
// alert("Please Pronouce Color");
// }, 3000);
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
){
console
.
log
(
'
Your Answer is Correct
'
);
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
});
};
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
const
onSpeechPartialResults
=
e
=>
{
// console.log('onSpeechPartialResults: ', e);
// const value = e.value;
// console.log(value.length)
// setPartialResults(e.value);
};
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
const
startRecording
=
async
()
=>
{
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
console
.
log
(
'
error =>>
'
,
error
);
}
};
const
stopRecording
=
async
()
=>
{
try
{
await
Voice
.
stop
();
}
catch
(
error
)
{
console
.
log
(
error
);
}
};
return
(
<
SafeAreaView
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
<
View
>
<
View
style
=
{
styles
.
textBody
}
>
<
Text
style
=
{
styles
.
text
}
>
Say
the
name
of
this
color
?
<
/Text
>
<
/View
>
<
Image
style
=
{
styles
.
robo
}
source
=
{
require
(
"
../../assets/game/robo.png
"
)}
><
/Image
>
<
/View
>
<
View
>
<
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
>
<
/View
>
<
View
style
=
{{
marginTop
:
10
}}
>
<
BackButton
path
=
"
Color
"
/>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
row
"
,
marginLeft
:
420
,
marginTop
:
-
50
}}
>
<
View
style
=
{{}}
>
<
TouchableOpacity
onPress
=
{
startRecording
}
style
=
{{
width
:
"
30%
"
,
height
:
"
40%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/mic2.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
1
,
marginLeft
:
-
190
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
marginLeft
:
-
100
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
}}
style
=
{{
width
:
"
60%
"
,
height
:
"
40%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/next.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
.
9
,
marginLeft
:
-
90
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/ImageBackground
>
<
/View
>
<
/SafeAreaView
>
)
}
const
styles
=
StyleSheet
.
create
({
body
:
{
flex
:
1
,
},
image
:
{
width
:
"
100%
"
,
height
:
"
100%
"
,
},
blackboard
:
{
marginTop
:
-
420
,
marginLeft
:
240
,
width
:
"
70%
"
,
height
:
500
,
},
robo
:
{
marginTop
:
-
70
,
marginLeft
:
-
5
,
width
:
150
,
height
:
200
,
},
textBody
:
{
marginTop
:
150
,
marginLeft
:
95
,
backgroundColor
:
"
#1DCE92
"
,
width
:
200
,
borderRadius
:
50
,
padding
:
5
,
},
text
:
{
fontSize
:
25
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
color
:
"
white
"
,
textAlign
:
'
center
'
,
fontWeight
:
'
bold
'
},
button
:
{
padding
:
10
,
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
})
\ No newline at end of file
frontend/src/screen/activity/Green.js
0 → 100644
View file @
065e790b
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
axios
from
"
axios
"
;
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
Green
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
green
"
;
React
.
useEffect
(()
=>
{
StatusBar
.
setHidden
(
true
);
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
Orientation
.
unlockAllOrientations
();
Orientation
.
lockToLandscape
();
});
return
unsubscribe
;
},
[
navigation
]);
useEffect
(()
=>
{
Voice
.
onSpeechStart
=
onSpeechStartHandler
;
Voice
.
onSpeechEnd
=
onSpeechEndHandler
;
Voice
.
onSpeechResults
=
onSpeechResultsHandler
;
Voice
.
onSpeechPartialResults
=
onSpeechPartialResults
;
// console.log(backColor);
return
()
=>
{
Voice
.
destroy
().
then
(
Voice
.
removeAllListeners
);
};
},
[]);
const
onSpeechStartHandler
=
e
=>
{
// console.log('start handler =>> ', e);
};
const
onSpeechEndHandler
=
e
=>
{
// console.log('end handler =>> ', e);
};
const
onSpeechResultsHandler
=
e
=>
{
// console.log('result handler =>> ', e);
// setTimeout(() => {
// alert("Please Pronouce Color");
// }, 3000);
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
){
console
.
log
(
'
Your Answer is Correct
'
);
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
});
};
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
const
onSpeechPartialResults
=
e
=>
{
// console.log('onSpeechPartialResults: ', e);
// const value = e.value;
// console.log(value.length)
// setPartialResults(e.value);
};
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
const
startRecording
=
async
()
=>
{
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
console
.
log
(
'
error =>>
'
,
error
);
}
};
const
stopRecording
=
async
()
=>
{
try
{
await
Voice
.
stop
();
}
catch
(
error
)
{
console
.
log
(
error
);
}
};
return
(
<
SafeAreaView
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
<
View
>
<
View
style
=
{
styles
.
textBody
}
>
<
Text
style
=
{
styles
.
text
}
>
Say
the
name
of
this
color
?
<
/Text
>
<
/View
>
<
Image
style
=
{
styles
.
robo
}
source
=
{
require
(
"
../../assets/game/robo.png
"
)}
><
/Image
>
<
/View
>
<
View
>
<
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
>
<
/View
>
<
View
style
=
{{
marginTop
:
10
}}
>
<
BackButton
path
=
"
Color
"
/>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
row
"
,
marginLeft
:
420
,
marginTop
:
-
50
}}
>
<
View
style
=
{{}}
>
<
TouchableOpacity
onPress
=
{
startRecording
}
style
=
{{
width
:
"
30%
"
,
height
:
"
40%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/mic2.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
1
,
marginLeft
:
-
190
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
marginLeft
:
-
100
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
}}
style
=
{{
width
:
"
60%
"
,
height
:
"
40%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/next.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
.
9
,
marginLeft
:
-
90
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/ImageBackground
>
<
/View
>
<
/SafeAreaView
>
)
}
const
styles
=
StyleSheet
.
create
({
body
:
{
flex
:
1
,
},
image
:
{
width
:
"
100%
"
,
height
:
"
100%
"
,
},
blackboard
:
{
marginTop
:
-
420
,
marginLeft
:
240
,
width
:
"
70%
"
,
height
:
500
,
},
robo
:
{
marginTop
:
-
70
,
marginLeft
:
-
5
,
width
:
150
,
height
:
200
,
},
textBody
:
{
marginTop
:
150
,
marginLeft
:
95
,
backgroundColor
:
"
#1DCE92
"
,
width
:
200
,
borderRadius
:
50
,
padding
:
5
,
},
text
:
{
fontSize
:
25
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
color
:
"
white
"
,
textAlign
:
'
center
'
,
fontWeight
:
'
bold
'
},
button
:
{
padding
:
10
,
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
})
\ No newline at end of file
frontend/src/screen/activity/PrimaryType.js
View file @
065e790b
...
...
@@ -30,7 +30,7 @@ export default function PrimaryType(title) {
React
.
useEffect
(()
=>
{
getColorActivity1
();
//
getColorActivity1();
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
// The screen is focused
...
...
@@ -48,7 +48,7 @@ export default function PrimaryType(title) {
<
SafeAreaView
>
<
ScrollView
>
<
View
style
=
{{
marginBottom
:
50
}}
>
<
View
style
=
{{
marginBottom
:
50
}}
>
<
View
>
<
ImageBackground
source
=
{
require
(
"
../../assets/color/background.png
"
)}
style
=
{
styles
.
image
}
>
...
...
@@ -57,9 +57,167 @@ export default function PrimaryType(title) {
<
/View
>
<
/View
>
{
names
.
map
((
data
,
index
)
=>
{
return
(
<
ColorActivity
key
=
{
index
}
title
=
{
data
.
name
}
image
=
{
data
.
image
}
id
=
{
data
.
idcolorActivities
}
des
=
{
data
.
des
}
color
=
{
data
.
color
}
/>
)
})}
{
/* {names.map((data, index) => {
return (<ColorActivity key={index} title={data.name}
image={data.image} id={data.idcolorActivities}
des={data.des} color={data.color} />)
})} */
}
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
Red
"
)
}}
style
=
{{
borderWidth
:
5
,
borderColor
:
"
red
"
,
marginVertical
:
20
,
backgroundColor
:
"
#fff
"
,
paddingVertical
:
8
,
paddingHorizontal
:
15
,
padding
:
15
,
width
:
380
,
marginHorizontal
:
20
,
borderRadius
:
30
,
shadowColor
:
"
#000
"
,
shadowOffset
:
{
width
:
2
,
height
:
2
},
shadowOpacity
:
0.3
,
shadowRadius
:
1.5
,
marginBottom
:
50
,
}}
>
<
View
style
=
{[{
flexDirection
:
"
row
"
}]}
>
<
View
style
=
{
styles
.
cardImage
}
>
<
Image
source
=
{
require
(
"
../../assets/color/red.jpg
"
)}
style
=
{{
width
:
100
,
height
:
100
,
borderRadius
:
30
}}
><
/Image
>
<
/View
>
<
View
style
=
{{
flex
:
0.6
}}
>
{
/* <Text style={styles.cardDescription}>{id}</Text> */
}
<
Text
style
=
{
styles
.
cardTitle
}
>
Red
Color
<
/Text
>
<
Text
style
=
{
styles
.
cardLocation
}
>
Primary
Activity
<
/Text
>
<
View
style
=
{{
marginLeft
:
10
,
marginTop
:
5
,
width
:
40
,
height
:
40
,
borderRadius
:
100
,
backgroundColor
:
"
red
"
,
borderWidth
:
1
,
borderColor
:
"
black
"
,
}}
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
Green
"
)
}}
style
=
{{
borderWidth
:
5
,
borderColor
:
"
green
"
,
marginVertical
:
20
,
backgroundColor
:
"
#fff
"
,
paddingVertical
:
8
,
paddingHorizontal
:
15
,
padding
:
15
,
width
:
380
,
marginHorizontal
:
20
,
borderRadius
:
30
,
shadowColor
:
"
#000
"
,
shadowOffset
:
{
width
:
2
,
height
:
2
},
shadowOpacity
:
0.3
,
shadowRadius
:
1.5
,
marginBottom
:
50
,
}}
>
<
View
style
=
{[{
flexDirection
:
"
row
"
}]}
>
<
View
style
=
{
styles
.
cardImage
}
>
<
Image
source
=
{
require
(
"
../../assets/color/green.jpg
"
)}
style
=
{{
width
:
100
,
height
:
100
,
borderRadius
:
30
}}
><
/Image
>
<
/View
>
<
View
style
=
{{
flex
:
0.6
}}
>
{
/* <Text style={styles.cardDescription}>{id}</Text> */
}
<
Text
style
=
{
styles
.
cardTitle
}
>
Green
Color
<
/Text
>
<
Text
style
=
{
styles
.
cardLocation
}
>
Primary
Activity
<
/Text
>
<
View
style
=
{{
marginLeft
:
10
,
marginTop
:
5
,
width
:
40
,
height
:
40
,
borderRadius
:
100
,
backgroundColor
:
"
green
"
,
borderWidth
:
1
,
borderColor
:
"
black
"
,
}}
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
Black
"
)
}}
style
=
{{
borderWidth
:
5
,
borderColor
:
"
black
"
,
marginVertical
:
20
,
backgroundColor
:
"
#fff
"
,
paddingVertical
:
8
,
paddingHorizontal
:
15
,
padding
:
15
,
width
:
380
,
marginHorizontal
:
20
,
borderRadius
:
30
,
shadowColor
:
"
#000
"
,
shadowOffset
:
{
width
:
2
,
height
:
2
},
shadowOpacity
:
0.3
,
shadowRadius
:
1.5
,
marginBottom
:
50
,
}}
>
<
View
style
=
{[{
flexDirection
:
"
row
"
}]}
>
<
View
style
=
{
styles
.
cardImage
}
>
<
Image
source
=
{
require
(
"
../../assets/color/black.jpg
"
)}
style
=
{{
width
:
100
,
height
:
100
,
borderRadius
:
30
}}
><
/Image
>
<
/View
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
Text
style
=
{
styles
.
cardTitle
}
>
Black
Color
<
/Text
>
<
Text
style
=
{
styles
.
cardLocation
}
>
Primary
Activity
<
/Text
>
<
View
style
=
{{
marginLeft
:
10
,
marginTop
:
5
,
width
:
40
,
height
:
40
,
borderRadius
:
100
,
backgroundColor
:
"
black
"
,
borderWidth
:
1
,
borderColor
:
"
black
"
,
}}
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/ScrollView
>
<
/SafeAreaView
>
...
...
@@ -91,6 +249,43 @@ const styles = StyleSheet.create({
position
:
"
absolute
"
,
left
:
50
,
bottom
:
50
},
card
:
{
marginVertical
:
20
,
backgroundColor
:
"
#fff
"
,
paddingVertical
:
8
,
paddingHorizontal
:
15
,
padding
:
15
,
width
:
380
,
marginHorizontal
:
20
,
borderRadius
:
30
,
shadowColor
:
"
#000
"
,
shadowOffset
:
{
width
:
2
,
height
:
2
},
shadowOpacity
:
0.3
,
shadowRadius
:
1.5
,
},
cardTitle
:
{
fontWeight
:
"
bold
"
,
fontSize
:
30
,
marginLeft
:
10
,
},
cardLocation
:
{
fontSize
:
16
,
color
:
"
#777
"
,
marginLeft
:
10
,
},
cardDescription
:
{
fontSize
:
18
,
marginVertical
:
8
,
marginLeft
:
10
,
},
cardImage
:
{
padding
:
0
,
flex
:
0.4
}
})
frontend/src/screen/activity/Red.js
0 → 100644
View file @
065e790b
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
axios
from
"
axios
"
;
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
navigation
=
useNavigation
();
const
backColor
=
"
red
"
;
React
.
useEffect
(()
=>
{
StatusBar
.
setHidden
(
true
);
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
Orientation
.
unlockAllOrientations
();
Orientation
.
lockToLandscape
();
});
return
unsubscribe
;
},
[
navigation
]);
useEffect
(()
=>
{
Voice
.
onSpeechStart
=
onSpeechStartHandler
;
Voice
.
onSpeechEnd
=
onSpeechEndHandler
;
Voice
.
onSpeechResults
=
onSpeechResultsHandler
;
Voice
.
onSpeechPartialResults
=
onSpeechPartialResults
;
// console.log(backColor);
return
()
=>
{
Voice
.
destroy
().
then
(
Voice
.
removeAllListeners
);
};
},
[]);
const
onSpeechStartHandler
=
e
=>
{
// console.log('start handler =>> ', e);
};
const
onSpeechEndHandler
=
e
=>
{
// console.log('end handler =>> ', e);
};
const
onSpeechResultsHandler
=
e
=>
{
// console.log('result handler =>> ', e);
// setTimeout(() => {
// alert("Please Pronouce Color");
// }, 3000);
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
){
console
.
log
(
'
Your Answer is Correct
'
);
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
});
};
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
const
onSpeechPartialResults
=
e
=>
{
// console.log('onSpeechPartialResults: ', e);
// const value = e.value;
// console.log(value.length)
// setPartialResults(e.value);
};
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
const
startRecording
=
async
()
=>
{
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
console
.
log
(
'
error =>>
'
,
error
);
}
};
const
stopRecording
=
async
()
=>
{
try
{
await
Voice
.
stop
();
}
catch
(
error
)
{
console
.
log
(
error
);
}
};
return
(
<
SafeAreaView
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
<
View
>
<
View
style
=
{
styles
.
textBody
}
>
<
Text
style
=
{
styles
.
text
}
>
Say
the
name
of
this
color
?
<
/Text
>
<
/View
>
<
Image
style
=
{
styles
.
robo
}
source
=
{
require
(
"
../../assets/game/robo.png
"
)}
><
/Image
>
<
/View
>
<
View
>
<
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
>
<
/View
>
<
View
style
=
{{
marginTop
:
10
}}
>
<
BackButton
path
=
"
Color
"
/>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
row
"
,
marginLeft
:
420
,
marginTop
:
-
50
}}
>
<
View
style
=
{{}}
>
<
TouchableOpacity
onPress
=
{
startRecording
}
style
=
{{
width
:
"
30%
"
,
height
:
"
40%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/mic2.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
1
,
marginLeft
:
-
190
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
marginLeft
:
-
100
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
}}
style
=
{{
width
:
"
60%
"
,
height
:
"
40%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/next.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
.
9
,
marginLeft
:
-
90
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/ImageBackground
>
<
/View
>
<
/SafeAreaView
>
)
}
const
styles
=
StyleSheet
.
create
({
body
:
{
flex
:
1
,
},
image
:
{
width
:
"
100%
"
,
height
:
"
100%
"
,
},
blackboard
:
{
marginTop
:
-
420
,
marginLeft
:
240
,
width
:
"
70%
"
,
height
:
500
,
},
robo
:
{
marginTop
:
-
70
,
marginLeft
:
-
5
,
width
:
150
,
height
:
200
,
},
textBody
:
{
marginTop
:
150
,
marginLeft
:
95
,
backgroundColor
:
"
#1DCE92
"
,
width
:
200
,
borderRadius
:
50
,
padding
:
5
,
},
text
:
{
fontSize
:
25
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
color
:
"
white
"
,
textAlign
:
'
center
'
,
fontWeight
:
'
bold
'
},
button
:
{
padding
:
10
,
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
})
\ No newline at end of file
frontend/src/screen/activity/SecondaryType.js
View file @
065e790b
...
...
@@ -14,7 +14,7 @@ export default function SecondaryType(title) {
const
navigation
=
useNavigation
();
const
[
names
,
setNames
]
=
useState
([]);
const
[
names
,
setNames
]
=
useState
([]);
function
getColorActivity2
()
{
client
...
...
@@ -46,7 +46,7 @@ export default function SecondaryType(title) {
<
SafeAreaView
>
<
ScrollView
>
<
View
style
=
{{
marginBottom
:
50
}}
>
<
View
style
=
{{
marginBottom
:
50
}}
>
<
View
>
<
ImageBackground
source
=
{
require
(
"
../../assets/color/background.png
"
)}
style
=
{
styles
.
image
}
>
...
...
@@ -55,9 +55,165 @@ export default function SecondaryType(title) {
<
/View
>
<
/View
>
{
names
.
map
((
data
,
index
)
=>
{
{
/* {
names.map((data, index) => {
return (<ColorActivity key={index} title={data.name} image={data.image} id={data.idcolorActivities} des={data.des} color={data.color} />)
})}
})} */
}
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
Yellow
"
)
}}
style
=
{{
borderWidth
:
5
,
borderColor
:
"
yellow
"
,
marginVertical
:
20
,
backgroundColor
:
"
#fff
"
,
paddingVertical
:
8
,
paddingHorizontal
:
15
,
padding
:
15
,
width
:
380
,
marginHorizontal
:
20
,
borderRadius
:
30
,
shadowColor
:
"
#000
"
,
shadowOffset
:
{
width
:
2
,
height
:
2
},
shadowOpacity
:
0.3
,
shadowRadius
:
1.5
,
marginBottom
:
50
,
}}
>
<
View
style
=
{[{
flexDirection
:
"
row
"
}]}
>
<
View
style
=
{
styles
.
cardImage
}
>
<
Image
source
=
{
require
(
"
../../assets/color/yellow.png
"
)}
style
=
{{
width
:
100
,
height
:
100
,
borderRadius
:
30
}}
><
/Image
>
<
/View
>
<
View
style
=
{{
flex
:
0.6
}}
>
{
/* <Text style={styles.cardDescription}>{id}</Text> */
}
<
Text
style
=
{
styles
.
cardTitle
}
>
Yellow
Color
<
/Text
>
<
Text
style
=
{
styles
.
cardLocation
}
>
Secondary
Activity
<
/Text
>
<
View
style
=
{{
marginLeft
:
10
,
marginTop
:
5
,
width
:
40
,
height
:
40
,
borderRadius
:
100
,
backgroundColor
:
"
yellow
"
,
borderWidth
:
1
,
borderColor
:
"
black
"
,
}}
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
Blue2
"
)
}}
style
=
{{
borderWidth
:
5
,
borderColor
:
"
blue
"
,
marginVertical
:
20
,
backgroundColor
:
"
#fff
"
,
paddingVertical
:
8
,
paddingHorizontal
:
15
,
padding
:
15
,
width
:
380
,
marginHorizontal
:
20
,
borderRadius
:
30
,
shadowColor
:
"
#000
"
,
shadowOffset
:
{
width
:
2
,
height
:
2
},
shadowOpacity
:
0.3
,
shadowRadius
:
1.5
,
marginBottom
:
50
,
}}
>
<
View
style
=
{[{
flexDirection
:
"
row
"
}]}
>
<
View
style
=
{
styles
.
cardImage
}
>
<
Image
source
=
{
require
(
"
../../assets/color/blue.jpg
"
)}
style
=
{{
width
:
100
,
height
:
100
,
borderRadius
:
30
}}
><
/Image
>
<
/View
>
<
View
style
=
{{
flex
:
0.6
}}
>
{
/* <Text style={styles.cardDescription}>{id}</Text> */
}
<
Text
style
=
{
styles
.
cardTitle
}
>
Blue
Color
<
/Text
>
<
Text
style
=
{
styles
.
cardLocation
}
>
Secondary
Activity
<
/Text
>
<
View
style
=
{{
marginLeft
:
10
,
marginTop
:
5
,
width
:
40
,
height
:
40
,
borderRadius
:
100
,
backgroundColor
:
"
blue
"
,
borderWidth
:
1
,
borderColor
:
"
black
"
,
}}
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
White
"
)
}}
style
=
{{
borderWidth
:
5
,
borderColor
:
"
white
"
,
marginVertical
:
20
,
backgroundColor
:
"
#fff
"
,
paddingVertical
:
8
,
paddingHorizontal
:
15
,
padding
:
15
,
width
:
380
,
marginHorizontal
:
20
,
borderRadius
:
30
,
shadowColor
:
"
#000
"
,
shadowOffset
:
{
width
:
2
,
height
:
2
},
shadowOpacity
:
0.3
,
shadowRadius
:
1.5
,
marginBottom
:
50
,
}}
>
<
View
style
=
{[{
flexDirection
:
"
row
"
}]}
>
<
View
style
=
{
styles
.
cardImage
}
>
<
Image
source
=
{
require
(
"
../../assets/color/white.jpg
"
)}
style
=
{{
width
:
100
,
height
:
100
,
borderRadius
:
30
}}
><
/Image
>
<
/View
>
<
View
style
=
{{
flex
:
0.6
}}
>
{
/* <Text style={styles.cardDescription}>{id}</Text> */
}
<
Text
style
=
{
styles
.
cardTitle
}
>
White
Color
<
/Text
>
<
Text
style
=
{
styles
.
cardLocation
}
>
Secondary
Activity
<
/Text
>
<
View
style
=
{{
marginLeft
:
10
,
marginTop
:
5
,
width
:
40
,
height
:
40
,
borderRadius
:
100
,
backgroundColor
:
"
white
"
,
borderWidth
:
1
,
borderColor
:
"
black
"
,
}}
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/ScrollView
>
<
/SafeAreaView
>
...
...
@@ -89,6 +245,43 @@ const styles = StyleSheet.create({
position
:
"
absolute
"
,
left
:
50
,
bottom
:
50
},
card
:
{
marginVertical
:
20
,
backgroundColor
:
"
#fff
"
,
paddingVertical
:
8
,
paddingHorizontal
:
15
,
padding
:
15
,
width
:
380
,
marginHorizontal
:
20
,
borderRadius
:
30
,
shadowColor
:
"
#000
"
,
shadowOffset
:
{
width
:
2
,
height
:
2
},
shadowOpacity
:
0.3
,
shadowRadius
:
1.5
,
},
cardTitle
:
{
fontWeight
:
"
bold
"
,
fontSize
:
30
,
marginLeft
:
10
,
},
cardLocation
:
{
fontSize
:
16
,
color
:
"
#777
"
,
marginLeft
:
10
,
},
cardDescription
:
{
fontSize
:
18
,
marginVertical
:
8
,
marginLeft
:
10
,
},
cardImage
:
{
padding
:
0
,
flex
:
0.4
}
})
frontend/src/screen/activity/White.js
0 → 100644
View file @
065e790b
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
axios
from
"
axios
"
;
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
White
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
white
"
;
React
.
useEffect
(()
=>
{
StatusBar
.
setHidden
(
true
);
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
Orientation
.
unlockAllOrientations
();
Orientation
.
lockToLandscape
();
});
return
unsubscribe
;
},
[
navigation
]);
useEffect
(()
=>
{
Voice
.
onSpeechStart
=
onSpeechStartHandler
;
Voice
.
onSpeechEnd
=
onSpeechEndHandler
;
Voice
.
onSpeechResults
=
onSpeechResultsHandler
;
Voice
.
onSpeechPartialResults
=
onSpeechPartialResults
;
// console.log(backColor);
return
()
=>
{
Voice
.
destroy
().
then
(
Voice
.
removeAllListeners
);
};
},
[]);
const
onSpeechStartHandler
=
e
=>
{
// console.log('start handler =>> ', e);
};
const
onSpeechEndHandler
=
e
=>
{
// console.log('end handler =>> ', e);
};
const
onSpeechResultsHandler
=
e
=>
{
// console.log('result handler =>> ', e);
// setTimeout(() => {
// alert("Please Pronouce Color");
// }, 3000);
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
){
console
.
log
(
'
Your Answer is Correct
'
);
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
});
};
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
const
onSpeechPartialResults
=
e
=>
{
// console.log('onSpeechPartialResults: ', e);
// const value = e.value;
// console.log(value.length)
// setPartialResults(e.value);
};
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
const
startRecording
=
async
()
=>
{
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
console
.
log
(
'
error =>>
'
,
error
);
}
};
const
stopRecording
=
async
()
=>
{
try
{
await
Voice
.
stop
();
}
catch
(
error
)
{
console
.
log
(
error
);
}
};
return
(
<
SafeAreaView
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
<
View
>
<
View
style
=
{
styles
.
textBody
}
>
<
Text
style
=
{
styles
.
text
}
>
Say
the
name
of
this
color
?
<
/Text
>
<
/View
>
<
Image
style
=
{
styles
.
robo
}
source
=
{
require
(
"
../../assets/game/robo.png
"
)}
><
/Image
>
<
/View
>
<
View
>
<
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
>
<
/View
>
<
View
style
=
{{
marginTop
:
10
}}
>
<
BackButton
path
=
"
Color
"
/>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
row
"
,
marginLeft
:
420
,
marginTop
:
-
50
}}
>
<
View
style
=
{{}}
>
<
TouchableOpacity
onPress
=
{
startRecording
}
style
=
{{
width
:
"
30%
"
,
height
:
"
35%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/mic2.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
1
,
marginLeft
:
-
190
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
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
,
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/ImageBackground
>
<
/View
>
<
/SafeAreaView
>
)
}
const
styles
=
StyleSheet
.
create
({
body
:
{
flex
:
1
,
},
image
:
{
width
:
"
100%
"
,
height
:
"
100%
"
,
},
blackboard
:
{
marginTop
:
-
420
,
marginLeft
:
240
,
width
:
"
70%
"
,
height
:
500
,
},
robo
:
{
marginTop
:
-
70
,
marginLeft
:
-
5
,
width
:
150
,
height
:
200
,
},
textBody
:
{
marginTop
:
150
,
marginLeft
:
95
,
backgroundColor
:
"
#1DCE92
"
,
width
:
200
,
borderRadius
:
50
,
padding
:
5
,
},
text
:
{
fontSize
:
25
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
color
:
"
white
"
,
textAlign
:
'
center
'
,
fontWeight
:
'
bold
'
},
button
:
{
padding
:
10
,
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
})
\ No newline at end of file
frontend/src/screen/activity/Yellow.js
0 → 100644
View file @
065e790b
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
axios
from
"
axios
"
;
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
Yellow
()
{
const
navigation
=
useNavigation
();
const
backColor
=
"
yellow
"
;
React
.
useEffect
(()
=>
{
StatusBar
.
setHidden
(
true
);
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
Orientation
.
unlockAllOrientations
();
Orientation
.
lockToLandscape
();
});
return
unsubscribe
;
},
[
navigation
]);
useEffect
(()
=>
{
Voice
.
onSpeechStart
=
onSpeechStartHandler
;
Voice
.
onSpeechEnd
=
onSpeechEndHandler
;
Voice
.
onSpeechResults
=
onSpeechResultsHandler
;
Voice
.
onSpeechPartialResults
=
onSpeechPartialResults
;
// console.log(backColor);
return
()
=>
{
Voice
.
destroy
().
then
(
Voice
.
removeAllListeners
);
};
},
[]);
const
onSpeechStartHandler
=
e
=>
{
// console.log('start handler =>> ', e);
};
const
onSpeechEndHandler
=
e
=>
{
// console.log('end handler =>> ', e);
};
const
onSpeechResultsHandler
=
e
=>
{
// console.log('result handler =>> ', e);
// setTimeout(() => {
// alert("Please Pronouce Color");
// }, 3000);
const
value
=
e
.
value
;
if
(
value
.
includes
(
backColor
)
==
true
){
console
.
log
(
'
Your Answer is Correct
'
);
showAlert
=
()
=>
{
this
.
setState
({
showAlert
:
true
});
};
}
else
{
console
.
log
(
'
Your Answer is Incorrect
'
,
value
);
}
};
const
onSpeechPartialResults
=
e
=>
{
// console.log('onSpeechPartialResults: ', e);
// const value = e.value;
// console.log(value.length)
// setPartialResults(e.value);
};
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
const
startRecording
=
async
()
=>
{
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
console
.
log
(
'
error =>>
'
,
error
);
}
};
const
stopRecording
=
async
()
=>
{
try
{
await
Voice
.
stop
();
}
catch
(
error
)
{
console
.
log
(
error
);
}
};
return
(
<
SafeAreaView
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
<
View
>
<
View
style
=
{
styles
.
textBody
}
>
<
Text
style
=
{
styles
.
text
}
>
Say
the
name
of
this
color
?
<
/Text
>
<
/View
>
<
Image
style
=
{
styles
.
robo
}
source
=
{
require
(
"
../../assets/game/robo.png
"
)}
><
/Image
>
<
/View
>
<
View
>
<
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
>
<
/View
>
<
View
style
=
{{
marginTop
:
10
}}
>
<
BackButton
path
=
"
Color
"
/>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
row
"
,
marginLeft
:
420
,
marginTop
:
-
50
}}
>
<
View
style
=
{{}}
>
<
TouchableOpacity
onPress
=
{
startRecording
}
style
=
{{
width
:
"
30%
"
,
height
:
"
40%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/mic2.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
1
,
marginLeft
:
-
190
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
marginLeft
:
-
100
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
}}
style
=
{{
width
:
"
60%
"
,
height
:
"
40%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/next.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
.
9
,
marginLeft
:
-
90
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/ImageBackground
>
<
/View
>
<
/SafeAreaView
>
)
}
const
styles
=
StyleSheet
.
create
({
body
:
{
flex
:
1
,
},
image
:
{
width
:
"
100%
"
,
height
:
"
100%
"
,
},
blackboard
:
{
marginTop
:
-
420
,
marginLeft
:
240
,
width
:
"
70%
"
,
height
:
500
,
},
robo
:
{
marginTop
:
-
70
,
marginLeft
:
-
5
,
width
:
150
,
height
:
200
,
},
textBody
:
{
marginTop
:
150
,
marginLeft
:
95
,
backgroundColor
:
"
#1DCE92
"
,
width
:
200
,
borderRadius
:
50
,
padding
:
5
,
},
text
:
{
fontSize
:
25
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
color
:
"
white
"
,
textAlign
:
'
center
'
,
fontWeight
:
'
bold
'
},
button
:
{
padding
:
10
,
marginRight
:
50
,
color
:
"
#000000
"
,
marginLeft
:
50
,
}
})
\ No newline at end of file
frontend/src/screen/client/Client.js
View file @
065e790b
...
...
@@ -2,6 +2,10 @@ import axios from 'axios';
// export default axios.create({ baseURL: 'http://192.168.8.102:5000/', timeout: 15000, });
export
default
axios
.
create
({
<<<<<<<
HEAD
baseURL
:
'
http://192.168.1.101:5000/
'
,
=======
baseURL
:
'
http://192.168.8.101:5000/
'
,
>>>>>>>
4377
b9c5fafb5c155a043560f662f4da96c37e12
timeout
:
15000
,
});
frontend/src/screen/sample/sam.js
0 → 100644
View file @
065e790b
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
Tts
from
'
react-native-tts
'
;
export
default
function
sam
()
{
const
hand
=
()
=>
{
Tts
.
speak
(
'
Hello
'
);
Tts
.
setDefaultLanguage
(
'
si-US
'
);
Tts
.
voices
().
then
(
voices
=>
console
.
log
(
voices
));
Tts
.
sto
}
React
.
useEffect
(()
=>
{
// Tts.speak('Hello, world!');
// Tts.voices().then(voices => console.log(voices));
},
[]);
return
(
<
SafeAreaView
>
<
Text
onPress
=
{()
=>
hand
()}
>
Hellow
<
/Text
>
<
/SafeAreaView
>
)
}
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