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
e9e4bfe5
Commit
e9e4bfe5
authored
May 01, 2022
by
W.D.R.P. Sandeepa
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'it18218640' into 'master'
It18218640 See merge request
!167
parents
73d032b1
d6c8e846
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
53 deletions
+148
-53
.idea/inspectionProfiles/Project_Default.xml
.idea/inspectionProfiles/Project_Default.xml
+2
-0
API/app.py
API/app.py
+1
-1
backend/IT18256888/app.py
backend/IT18256888/app.py
+2
-1
frontend/src/screen/Color.js
frontend/src/screen/Color.js
+5
-5
frontend/src/screen/activity/Red.js
frontend/src/screen/activity/Red.js
+137
-45
frontend/src/screen/client/Client.js
frontend/src/screen/client/Client.js
+1
-1
No files found.
.idea/inspectionProfiles/Project_Default.xml
View file @
e9e4bfe5
...
...
@@ -14,6 +14,8 @@
<option
name=
"ignoredIdentifiers"
>
<list>
<option
value=
"tensorflow.keras"
/>
<option
value=
"backend.IT18256888.app.flask_marshmallow"
/>
<option
value=
"backend.IT18256888.app.*"
/>
</list>
</option>
</inspection_tool>
...
...
API/app.py
View file @
e9e4bfe5
...
...
@@ -210,4 +210,4 @@ def reading():
return
make_response
(
body
)
if
__name__
==
"__main__"
:
app
.
run
(
host
=
'192.168.8.10
1
'
)
app
.
run
(
host
=
'192.168.8.10
0
'
)
backend/IT18256888/app.py
View file @
e9e4bfe5
...
...
@@ -124,4 +124,5 @@ def add_result():
#run the flask file
if
__name__
==
"__main__"
:
# app.run(debug=True)
app
.
run
(
host
=
'0.0.0.0'
,
port
=
5000
,
debug
=
True
)
app
.
run
(
host
=
'192.168.8.101'
)
# app.run(host='0.0.0.0', port=5000, debug=True)
frontend/src/screen/Color.js
View file @
e9e4bfe5
...
...
@@ -34,16 +34,16 @@ export default function Color() {
.
then
(
res
=>
{
console
.
log
(
res
.
data
);
if
(
res
.
status
==
200
)
{
console
.
log
(
res
.
data
);
const
t
oken
=
res
.
data
.
token
;
//
console.log(res.data);
const
colorT
oken
=
res
.
data
.
token
;
try
{
AsyncStorage
.
setItem
(
'
token
'
,
t
oken
);
navigation
.
navigate
(
"
PrimaryType
"
,
{
title
:
'
Primary Activities
'
,
id
:
1
}
)
AsyncStorage
.
setItem
(
'
colorToken
'
,
colorT
oken
);
console
.
log
(
colorToken
)
}
catch
(
error
)
{
console
.
log
(
error
);
}
navigation
.
navigate
(
path
);
navigation
.
navigate
(
"
PrimaryType
"
,
{
title
:
'
Primary Activities
'
,
id
:
1
})
}
})
.
catch
(
error
=>
{
...
...
frontend/src/screen/activity/Red.js
View file @
e9e4bfe5
...
...
@@ -13,9 +13,11 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
export
default
function
Red
()
{
const
colorToken
=
AsyncStorage
.
getItem
(
'
colorSession
'
);
const
[
colorToken
,
setColorToken
]
=
useState
();
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
colorData
,
setColorData
]
=
useState
({
activity
:
''
});
const
[
modalVisible2
,
setModalVisible2
]
=
useState
(
false
);
const
[
colorData
,
setColorData
]
=
useState
({
activity
:
''
});
const
navigation
=
useNavigation
();
...
...
@@ -38,8 +40,7 @@ export default function Red() {
Voice
.
onSpeechEnd
=
onSpeechEndHandler
;
Voice
.
onSpeechResults
=
onSpeechResultsHandler
;
Voice
.
onSpeechPartialResults
=
onSpeechPartialResults
;
// console.log(backColor);
// Voice.onSpeechError = onSpeechError;
return
()
=>
{
Voice
.
destroy
().
then
(
Voice
.
removeAllListeners
);
...
...
@@ -48,15 +49,9 @@ export default function Red() {
useEffect
(()
=>
{
console
.
log
(
colorToken
);
// AsyncStorage.getItem('token')
// .then(value => {
// console.log(value);
// })
// .catch(error => {
// console.log(error);
// });
},
[]);
// console.log(colorToken);
},
[]);
const
onSpeechStartHandler
=
e
=>
{
// console.log('start handler =>> ', e);
...
...
@@ -98,35 +93,72 @@ export default function Red() {
};
// const onSpeechError = e => {
// console.log('onSpeechError: ', e);
// const value = e.value;
// if (value.includes(secondColor[0]) == true) {
// console.log('Your Answer is Correct');
// sendData(mainColor[0])
// // 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
();
AsyncStorage
.
getItem
(
'
colorToken
'
)
.
then
(
res
=>
{
var
todayData
=
date
+
'
-
'
+
month
+
'
-
'
+
year
;
var
date
=
new
Date
().
getDate
();
var
month
=
new
Date
().
getMonth
()
+
1
;
var
year
=
new
Date
().
getFullYear
();
var
data
=
{
value
:
value
,
date
:
todayData
,
token
:
colorToken
,
}
var
todayData
=
date
+
'
-
'
+
month
+
'
-
'
+
year
;
var
data
=
{
value
:
value
,
date
:
todayData
,
token
:
res
,
}
data
=
JSON
.
stringify
(
data
);
setColorData
(
data
);
data
=
JSON
.
stringify
(
data
);
console
.
log
(
data
);
setColorData
(
data
);
// console.log(localStorage.getItem('colorSession'));
client
.
post
(
'
store
'
,
data
,
{
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
// setModalVisible2(true);
// navigation.navigate("Green");
}).
catch
(
err
=>
{
console
.
log
(
err
);
})
client
.
post
(
'
store
'
,
data
,
{
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
},
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
})
})
.
catch
(
error
=>
{
console
.
log
(
error
);
});
}
...
...
@@ -139,17 +171,9 @@ export default function Red() {
// setPartialResults(e.value);
};
const
onFinishCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Finished...
'
);
}
const
onPressCD
=
()
=>
{
Alert
.
alert
(
'
Countdown Component Pressed...
'
);
}
const
startRecording
=
async
()
=>
{
setModalVisible
(
true
);
//
setModalVisible(true);
try
{
await
Voice
.
start
(
'
en-US
'
);
...
...
@@ -201,6 +225,32 @@ export default function Red() {
<
/View
>
<
View
>
<
Modal
animationType
=
"
slide
"
transparent
=
{
true
}
hidden
=
{
true
}
visible
=
{
modalVisible2
}
onRequestClose
=
{()
=>
{
setModalVisible2
(
!
modalVisible2
);
}}
>
<
View
style
=
{
styles
.
centeredView2
}
>
<
View
style
=
{
styles
.
modalView2
}
>
<
Text
>
Your
answer
is
Corect
<
/Text
>
<
Pressable
style
=
{[
styles
.
button
,
styles
.
buttonClose2
]}
onPress
=
{()
=>
navigation
.
navigate
(
"
Green
"
)}
>
<
Text
style
=
{
styles
.
textStyle2
}
>
Next
Game
<
/Text
>
<
/Pressable
>
<
/View
>
<
/View
>
<
/Modal
>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
...
...
@@ -237,7 +287,7 @@ export default function Red() {
<
/View
>
<
View
style
=
{{
marginLeft
:
-
100
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
}}
<
TouchableOpacity
onPress
=
{()
=>
{
navigation
.
navigate
(
"
Green
"
)
}}
style
=
{{
width
:
"
60%
"
,
height
:
"
40%
"
,
borderRadius
:
50
}}
>
<
Image
source
=
{
require
(
'
../../assets/game/next.png
'
)}
resizeMode
=
'
contain
'
style
=
{{
flex
:
.
9
,
marginLeft
:
-
90
}}
/
>
<
/TouchableOpacity
>
...
...
@@ -314,4 +364,46 @@ const styles = StyleSheet.create({
elevation
:
2
},
centeredView2
:
{
flex
:
1
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
marginTop
:
22
},
modalView2
:
{
margin
:
20
,
backgroundColor
:
"
white
"
,
borderRadius
:
20
,
padding
:
35
,
alignItems
:
"
center
"
,
shadowColor
:
"
#000
"
,
shadowOffset
:
{
width
:
0
,
height
:
2
},
shadowOpacity
:
0.25
,
shadowRadius
:
4
,
elevation
:
5
},
button2
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
},
buttonOpen2
:
{
backgroundColor
:
"
#F194FF
"
,
},
buttonClose2
:
{
backgroundColor
:
"
#2196F3
"
,
},
textStyle2
:
{
color
:
"
white
"
,
fontWeight
:
"
bold
"
,
textAlign
:
"
center
"
},
modalText2
:
{
marginBottom
:
15
,
textAlign
:
"
center
"
}
})
\ No newline at end of file
frontend/src/screen/client/Client.js
View file @
e9e4bfe5
...
...
@@ -2,6 +2,6 @@ import axios from 'axios';
// export default axios.create({ baseURL: 'http://192.168.8.102:5000/', timeout: 15000, });
export
default
axios
.
create
({
baseURL
:
'
http://192.168.8.10
1
:5000/
'
,
baseURL
:
'
http://192.168.8.10
0
:5000/
'
,
timeout
:
15000
,
});
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