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
2ee15d1b
Commit
2ee15d1b
authored
Jul 16, 2022
by
Lihinikaduwa D.N.R.
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'it18257632' into 'master'
add new alert See merge request
!203
parents
d3b03468
08e79bd0
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
262 additions
and
210 deletions
+262
-210
frontend/src/assets/read/data/ReadData.js
frontend/src/assets/read/data/ReadData.js
+3
-0
frontend/src/assets/read/image/record.png
frontend/src/assets/read/image/record.png
+0
-0
frontend/src/assets/read/image/record1.png
frontend/src/assets/read/image/record1.png
+0
-0
frontend/src/assets/read/image/record2.png
frontend/src/assets/read/image/record2.png
+0
-0
frontend/src/assets/read/image/record3.png
frontend/src/assets/read/image/record3.png
+0
-0
frontend/src/component/reading/CountDownModal.js
frontend/src/component/reading/CountDownModal.js
+176
-0
frontend/src/component/reading/ReadModalNotice.js
frontend/src/component/reading/ReadModalNotice.js
+28
-179
frontend/src/screen/reading/advanced/ReadActivityBird.js
frontend/src/screen/reading/advanced/ReadActivityBird.js
+7
-1
frontend/src/screen/reading/advanced/ReadActivityDog.js
frontend/src/screen/reading/advanced/ReadActivityDog.js
+6
-1
frontend/src/screen/reading/advanced/ReadActivityFish.js
frontend/src/screen/reading/advanced/ReadActivityFish.js
+4
-1
frontend/src/screen/reading/basic/ReadActivityGo.js
frontend/src/screen/reading/basic/ReadActivityGo.js
+5
-0
frontend/src/screen/reading/basic/ReadActivityHe.js
frontend/src/screen/reading/basic/ReadActivityHe.js
+6
-4
frontend/src/screen/reading/basic/ReadActivityNo.js
frontend/src/screen/reading/basic/ReadActivityNo.js
+27
-24
No files found.
frontend/src/assets/read/data/ReadData.js
View file @
2ee15d1b
...
...
@@ -25,6 +25,9 @@ export const ImagePaths = {
correct
:
require
(
'
../image/correct.png
'
),
chart
:
require
(
'
../image/chart.png
'
),
record
:
require
(
'
../image/record.png
'
),
record1
:
require
(
'
../image/record1.png
'
),
record2
:
require
(
'
../image/record2.png
'
),
record3
:
require
(
'
../image/record3.png
'
),
};
export
const
DummyReadResult
=
{
...
...
frontend/src/assets/read/image/record.png
View replaced file @
d3b03468
View file @
2ee15d1b
864 KB
|
W:
|
H:
44.4 KB
|
W:
|
H:
2-up
Swipe
Onion skin
frontend/src/assets/read/image/record1.png
0 → 100644
View file @
2ee15d1b
864 KB
frontend/src/assets/read/image/record2.png
0 → 100644
View file @
2ee15d1b
19.2 KB
frontend/src/assets/read/image/record3.png
0 → 100644
View file @
2ee15d1b
50.8 KB
frontend/src/component/reading/CountDownModal.js
0 → 100644
View file @
2ee15d1b
import
React
,
{
useEffect
,
useState
}
from
'
react
'
;
import
{
Text
,
TouchableOpacity
,
StyleSheet
,
View
,
Modal
,
Image
,
}
from
'
react-native
'
;
import
{
useNavigation
}
from
'
@react-navigation/native
'
;
import
{
ImagePaths
}
from
'
../../assets/read/data/ReadData
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
export
default
function
CountDownModal
(
props
)
{
const
{
caption
,
validity
,
visibility
,
imagePath
}
=
props
;
const
[
modalVisible
,
setModalVisible
]
=
useState
(
visibility
);
useEffect
(()
=>
{
showModal
();
},
[]);
const
showModal
=
()
=>
{
setModalVisible
(
true
);
setTimeout
(()
=>
{
setModalVisible
(
false
);
},
3000
);
};
return
(
<
Modal
animationType
=
"
fade
"
transparent
=
{
true
}
hidden
=
{
true
}
visible
=
{
modalVisible
}
onRequestClose
=
{()
=>
{
setModalVisible
(
!
modalVisible
);
}}
>
<
View
style
=
{
styles
.
centeredView
}
>
<
View
style
=
{
styles
.
modalView
}
>
<
View
style
=
{[
styles
.
buttonClose2
]}
>
<
Image
source
=
{
ImagePaths
.
record1
}
resizeMode
=
"
contain
"
style
=
{{
width
:
200
,
height
:
140
,
marginBottom
:
-
10
}}
/
>
<
/View
>
<
Text
style
=
{
styles
.
headStyle2
}
>
Listening
....
<
/Text
>
<
/View
>
<
/View
>
<
/Modal
>
);
}
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
,
},
centeredView
:
{
flex
:
1
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
marginTop
:
-
90
,
marginLeft
:
50
,
},
modalView
:
{
margin
:
20
,
backgroundColor
:
'
#FFFFFFEF
'
,
borderRadius
:
20
,
padding
:
20
,
borderWidth
:
5
,
borderColor
:
'
#d9d9d9
'
,
alignItems
:
'
center
'
,
shadowColor
:
'
red
'
,
shadowOffset
:
{
width
:
0
,
height
:
2
,
},
shadowOpacity
:
0.25
,
shadowRadius
:
4
,
elevation
:
5
,
},
button
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
,
},
centeredView3
:
{
flex
:
1
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
marginTop
:
-
20
,
},
modalView3
:
{
margin
:
20
,
backgroundColor
:
'
white
'
,
borderRadius
:
20
,
padding
:
35
,
alignItems
:
'
center
'
,
shadowColor
:
'
#000
'
,
shadowOffset
:
{
width
:
0
,
height
:
2
,
},
shadowOpacity
:
0.25
,
shadowRadius
:
4
,
elevation
:
5
,
},
modalText
:
{
marginBottom
:
15
,
textAlign
:
'
center
'
,
fontSize
:
20
,
},
modalTextBold
:
{
marginBottom
:
15
,
textAlign
:
'
center
'
,
fontSize
:
20
,
fontWeight
:
'
bold
'
,
},
modalText
:
{
marginBottom
:
15
,
textAlign
:
'
center
'
,
fontSize
:
20
,
},
modalTextBold
:
{
marginBottom
:
15
,
textAlign
:
'
center
'
,
fontSize
:
20
,
fontWeight
:
'
bold
'
,
},
headStyle2
:
{
color
:
'
#99a5ff
'
,
fontWeight
:
'
bold
'
,
textAlign
:
'
center
'
,
fontSize
:
30
,
marginBottom
:
5
,
},
});
frontend/src/component/reading/ReadModalNotice.js
View file @
2ee15d1b
...
...
@@ -9,31 +9,34 @@ import {
}
from
'
react-native
'
;
import
{
useNavigation
}
from
'
@react-navigation/native
'
;
import
{
ImagePaths
}
from
'
../../assets/read/data/ReadData
'
;
import
CountDown
from
'
react-native-countdown-component
'
;
export
default
function
ReadModalNotice
(
props
)
{
const
{
caption
,
validity
,
visibility
,
imagePath
}
=
props
;
const
[
modalVisible
,
setModalVisible
]
=
useState
(
visibility
);
const
navigate
=
()
=>
{};
useEffect
(()
=>
{
showModal
();
},
[]);
const
showModal
=
()
=>
{
setModalVisible
(
true
);
setTimeout
(()
=>
{
setModalVisible
(
false
);
},
2000
);
};
return
(
<
Modal
animationType
=
"
fade
"
transparent
=
{
true
}
hidden
=
{
true
}
visible
=
{
modalVisible
}
>
<
View
style
=
{
styles
.
centeredView2
}
>
<
View
style
=
{
styles
.
modalView2
}
>
<
Text
style
=
{
styles
.
headStyle2
}
>
Press
The
Button
<
/Text
>
<
Text
style
=
{
styles
.
head2Style2
}
>
And
Pronounce
<
/Text
>
<
TouchableOpacity
style
=
{[
styles
.
buttonClose2
]}
onPress
=
{()
=>
setModalVisible
(
false
)}
>
<
Image
source
=
{
ImagePaths
.
correct
}
resizeMode
=
"
contain
"
style
=
{{
width
:
100
,
height
:
70
,
marginBottom
:
-
10
}}
/
>
<
/TouchableOpacity
>
<
View
style
=
{
styles
.
centeredView
}
>
<
View
style
=
{
styles
.
modalView
}
>
<
Text
style
=
{
styles
.
headStyle
}
>
Press
The
Button
<
/Text
>
<
Text
style
=
{
styles
.
headStyle
}
>
And
Pronounce
<
/Text
>
<
Text
style
=
{
styles
.
headStyle
}
>
The
Word
!<
/Text
>
<
/View
>
<
/View
>
<
/Modal
>
...
...
@@ -41,189 +44,35 @@ export default function ReadModalNotice(props) {
}
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
,
},
centeredView
:
{
flex
:
1
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
marginTop
:
-
90
,
marginLeft
:
-
100
,
marginTop
:
-
420
,
},
modalView
:
{
marginRight
:
20
,
backgroundColor
:
'
#00000000
'
,
borderRadius
:
20
,
padding
:
35
,
alignItems
:
'
center
'
,
},
button
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
,
},
centeredView3
:
{
flex
:
1
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
marginTop
:
-
20
,
},
modalView3
:
{
margin
:
20
,
backgroundColor
:
'
#FFFFFF
'
,
backgroundColor
:
'
#FFFFFF
EF
'
,
borderRadius
:
20
,
padding
:
20
,
borderWidth
:
5
,
// borderColor: '#1DCE92',
alignItems
:
'
center
'
,
// shadowColor: 'red',
// shadowOffset: {
// width: 0,
// height: 2,
// },
shadowOpacity
:
0.25
,
shadowRadius
:
4
,
elevation
:
5
,
},
button3
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
,
},
buttonOpen3
:
{
backgroundColor
:
'
#F194FF
'
,
},
buttonClose3
:
{
backgroundColor
:
'
#1DCE92
'
,
},
textStyle3
:
{
color
:
'
white
'
,
fontWeight
:
'
bold
'
,
textAlign
:
'
center
'
,
},
headStyle3
:
{
color
:
'
black
'
,
fontWeight
:
'
bold
'
,
textAlign
:
'
center
'
,
fontSize
:
30
,
marginBottom
:
5
,
},
head2Style3
:
{
color
:
'
black
'
,
fontWeight
:
'
bold
'
,
textAlign
:
'
center
'
,
fontSize
:
30
,
marginBottom
:
20
,
},
modalText3
:
{
marginBottom
:
15
,
textAlign
:
'
center
'
,
},
alert3
:
{
backgroundColor
:
'
rgba(255, 0, 0, 0.74)
'
,
borderRadius
:
50
,
width
:
100
,
height
:
100
,
marginBottom
:
20
,
marginTop
:
-
65
,
},
centeredView2
:
{
flex
:
1
,
justifyContent
:
'
center
'
,
borderColor
:
'
#d9d9d9
'
,
alignItems
:
'
center
'
,
marginTop
:
22
,
shadowColor
:
'
red
'
,
shadowOffset
:
{
width
:
0
,
height
:
2
,
},
modalView2
:
{
marginTop
:
-
10
,
margin
:
20
,
backgroundColor
:
'
#FFFFFFEF
'
,
borderRadius
:
20
,
padding
:
35
,
borderWidth
:
5
,
// borderColor: '#red',
alignItems
:
'
center
'
,
// shadowColor: 'red',
// shadowOffset: {
// width: 0,
// height: 2,
// },
shadowOpacity
:
0.25
,
shadowRadius
:
4
,
elevation
:
5
,
},
button2
:
{
borderRadius
:
20
,
padding
:
10
,
elevation
:
2
,
},
buttonOpen2
:
{
backgroundColor
:
'
#F194FF
'
,
},
buttonClose2
:
{
// backgroundColor: "#1DCE92",
},
textStyle2
:
{
color
:
'
white
'
,
fontWeight
:
'
bold
'
,
textAlign
:
'
center
'
,
},
modalText2
:
{
marginBottom
:
15
,
textAlign
:
'
center
'
,
},
headStyle2
:
{
color
:
'
black
'
,
fontWeight
:
'
bold
'
,
textAlign
:
'
center
'
,
fontSize
:
30
,
marginBottom
:
5
,
},
head2Style2
:
{
headStyle
:
{
color
:
'
black
'
,
fontWeight
:
'
bold
'
,
textAlign
:
'
center
'
,
fontSize
:
30
,
marginBottom
:
20
,
fontSize
:
25
,
},
alert2
:
{
// backgroundColor: 'rgba(0, 181, 0, 0.45)',
...
...
frontend/src/screen/reading/advanced/ReadActivityBird.js
View file @
2ee15d1b
...
...
@@ -21,6 +21,7 @@ import Client from '../../client/Client';
import
ReadModal
from
'
../../../component/reading/ReadModal
'
;
import
ReadModalFailed
from
'
../../../component/reading/ReadModalFailed
'
;
import
ReadModalNotice
from
'
../../../component/reading/ReadModalNotice
'
;
import
CountDownModal
from
'
../../../component/reading/CountDownModal
'
;
export
default
function
ReadActivityBird
()
{
const
navigation
=
useNavigation
();
...
...
@@ -29,6 +30,7 @@ export default function ReadActivityBird() {
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
modalVisible2
,
setModalVisible2
]
=
useState
(
false
);
const
[
modalVisible3
,
setModalVisible3
]
=
useState
(
false
);
const
[
countDownVisible
,
setCountDownVisible
]
=
useState
(
false
);
React
.
useEffect
(()
=>
{
Voice
.
destroy
().
then
(
Voice
.
removeAllListeners
);
...
...
@@ -140,6 +142,7 @@ export default function ReadActivityBird() {
};
const
startRecording
=
async
()
=>
{
setCountDownVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
...
...
@@ -163,6 +166,9 @@ export default function ReadActivityBird() {
<
ReadModalFailed
visible
=
"
true
"
imagePath
=
{
ImagePaths
.
bird1
}
/
>
)}
{
modalVisible
&&
<
ReadModalNotice
visible
=
"
true
"
/>
}
{
countDownVisible
&&
<
CountDownModal
visible
=
"
true
"
/>
}
<
View
style
=
{{
flexDirection
:
'
column
'
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
...
...
frontend/src/screen/reading/advanced/ReadActivityDog.js
View file @
2ee15d1b
...
...
@@ -21,6 +21,7 @@ import Client from '../../client/Client';
import
ReadModal
from
'
../../../component/reading/ReadModal
'
;
import
ReadModalFailed
from
'
../../../component/reading/ReadModalFailed
'
;
import
ReadModalNotice
from
'
../../../component/reading/ReadModalNotice
'
;
import
CountDownModal
from
'
../../../component/reading/CountDownModal
'
;
export
default
function
ReadActivityDog
()
{
const
navigation
=
useNavigation
();
...
...
@@ -29,6 +30,7 @@ export default function ReadActivityDog() {
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
modalVisible2
,
setModalVisible2
]
=
useState
(
false
);
const
[
modalVisible3
,
setModalVisible3
]
=
useState
(
false
);
const
[
countDownVisible
,
setCountDownVisible
]
=
useState
(
false
);
React
.
useEffect
(()
=>
{
// StatusBar.setHidden(true);
...
...
@@ -137,6 +139,7 @@ export default function ReadActivityDog() {
};
const
startRecording
=
async
()
=>
{
setCountDownVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
...
...
@@ -162,6 +165,8 @@ export default function ReadActivityDog() {
{
modalVisible
&&
<
ReadModalNotice
visible
=
"
true
"
/>
}
{
countDownVisible
&&
<
CountDownModal
visible
=
"
true
"
/>
}
<
View
style
=
{{
flexDirection
:
'
column
'
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
...
...
frontend/src/screen/reading/advanced/ReadActivityFish.js
View file @
2ee15d1b
...
...
@@ -21,6 +21,7 @@ import Client from '../../client/Client';
import
ReadModal
from
'
../../../component/reading/ReadModal
'
;
import
ReadModalFailed
from
'
../../../component/reading/ReadModalFailed
'
;
import
ReadModalNotice
from
'
../../../component/reading/ReadModalNotice
'
;
import
CountDownModal
from
'
../../../component/reading/CountDownModal
'
;
export
default
function
ReadActivityFish
()
{
const
navigation
=
useNavigation
();
...
...
@@ -29,6 +30,7 @@ export default function ReadActivityFish() {
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
modalVisible2
,
setModalVisible2
]
=
useState
(
false
);
const
[
modalVisible3
,
setModalVisible3
]
=
useState
(
false
);
const
[
countDownVisible
,
setCountDownVisible
]
=
useState
(
false
);
React
.
useEffect
(()
=>
{
// StatusBar.setHidden(true);
...
...
@@ -155,6 +157,7 @@ export default function ReadActivityFish() {
};
const
startRecording
=
async
()
=>
{
setCountDownVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
...
...
frontend/src/screen/reading/basic/ReadActivityGo.js
View file @
2ee15d1b
...
...
@@ -21,6 +21,7 @@ import Client from '../../client/Client';
import
ReadModal
from
'
../../../component/reading/ReadModal
'
;
import
ReadModalFailed
from
'
../../../component/reading/ReadModalFailed
'
;
import
ReadModalNotice
from
'
../../../component/reading/ReadModalNotice
'
;
import
CountDownModal
from
'
../../../component/reading/CountDownModal
'
;
export
default
function
ReadActivityGo
()
{
const
navigation
=
useNavigation
();
...
...
@@ -29,6 +30,7 @@ export default function ReadActivityGo() {
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
modalVisible2
,
setModalVisible2
]
=
useState
(
false
);
const
[
modalVisible3
,
setModalVisible3
]
=
useState
(
false
);
const
[
countDownVisible
,
setCountDownVisible
]
=
useState
(
false
);
React
.
useEffect
(()
=>
{
// StatusBar.setHidden(true);
...
...
@@ -133,6 +135,7 @@ export default function ReadActivityGo() {
};
const
startRecording
=
async
()
=>
{
setCountDownVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
...
...
@@ -157,6 +160,8 @@ export default function ReadActivityGo() {
)}
{
modalVisible
&&
<
ReadModalNotice
visible
=
"
true
"
/>
}
{
countDownVisible
&&
<
CountDownModal
visible
=
"
true
"
/>
}
<
View
style
=
{{
flexDirection
:
'
column
'
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
...
...
frontend/src/screen/reading/basic/ReadActivityHe.js
View file @
2ee15d1b
...
...
@@ -21,6 +21,7 @@ import Client from '../../client/Client';
import
ReadModal
from
'
../../../component/reading/ReadModal
'
;
import
ReadModalFailed
from
'
../../../component/reading/ReadModalFailed
'
;
import
ReadModalNotice
from
'
../../../component/reading/ReadModalNotice
'
;
import
CountDownModal
from
'
../../../component/reading/CountDownModal
'
;
export
default
function
ReadActivityHe
()
{
const
navigation
=
useNavigation
();
...
...
@@ -29,6 +30,7 @@ export default function ReadActivityHe() {
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
modalVisible2
,
setModalVisible2
]
=
useState
(
false
);
const
[
modalVisible3
,
setModalVisible3
]
=
useState
(
false
);
const
[
countDownVisible
,
setCountDownVisible
]
=
useState
(
false
);
React
.
useEffect
(()
=>
{
// StatusBar.setHidden(true);
...
...
@@ -153,6 +155,7 @@ export default function ReadActivityHe() {
};
const
startRecording
=
async
()
=>
{
setCountDownVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
...
...
@@ -175,10 +178,9 @@ export default function ReadActivityHe() {
{
modalVisible3
&&
(
<
ReadModalFailed
visible
=
"
true
"
imagePath
=
{
ImagePaths
.
robot1
}
/
>
)}
{
modalVisible
&&
<
ReadModalNotice
visible
=
"
true
"
/>
}
<
View
style
=
{{
flexDirection
:
'
column
'
}}
>
{
countDownVisible
&&
<
CountDownModal
visible
=
"
true
"
/>
}
<
View
style
=
{{
flexDirection
:
'
column
'
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
ImagePaths
.
backgroundBasic
}
>
...
...
frontend/src/screen/reading/basic/ReadActivityNo.js
View file @
2ee15d1b
...
...
@@ -23,6 +23,7 @@ import Client from '../../client/Client';
import
ReadModal
from
'
../../../component/reading/ReadModal
'
;
import
ReadModalFailed
from
'
../../../component/reading/ReadModalFailed
'
;
import
ReadModalNotice
from
'
../../../component/reading/ReadModalNotice
'
;
import
CountDownModal
from
'
../../../component/reading/CountDownModal
'
;
export
default
function
ReadActivityNo
()
{
const
navigation
=
useNavigation
();
...
...
@@ -31,6 +32,7 @@ export default function ReadActivityNo() {
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
modalVisible2
,
setModalVisible2
]
=
useState
(
false
);
const
[
modalVisible3
,
setModalVisible3
]
=
useState
(
false
);
const
[
countDownVisible
,
setCountDownVisible
]
=
useState
(
false
);
React
.
useEffect
(()
=>
{
// StatusBar.setHidden(true);
...
...
@@ -49,7 +51,7 @@ export default function ReadActivityNo() {
useEffect
(()
=>
{
Voice
.
onSpeechStart
=
onSpeechStartHandler
;
Voice
.
onSpeechResults
=
onSpeechResultsHandler
;
Voice
.
onSpeechError
=
onSpeechError
;
//
Voice.onSpeechError = onSpeechError;
return
()
=>
{
Voice
.
destroy
().
then
(
Voice
.
removeAllListeners
);
...
...
@@ -186,26 +188,26 @@ export default function ReadActivityNo() {
};
const
onSpeechError
=
e
=>
{
setCount
(
count
+
1
);
const
result
=
DummyReadResult
.
value
;
if
(
result
.
includes
(
'
no
'
))
{
AsyncStorage
.
getItem
(
'
userId
'
)
.
then
(
userId
=>
{
const
data
=
{
word
:
'
No
'
,
userId
:
userId
,
level
:
'
Basic
'
,
triedCount
:
count
,
};
getToken
(
data
);
})
.
catch
(
error
=>
{
console
.
log
(
error
);
});
}
else
{
setModalVisible3
(
true
);
}
console
.
log
(
'
count
'
,
count
);
//
setCount(count + 1);
//
const result = DummyReadResult.value;
//
if (result.includes('no')) {
//
AsyncStorage.getItem('userId')
//
.then(userId => {
//
const data = {
//
word: 'No',
//
userId: userId,
//
level: 'Basic',
//
triedCount: count,
//
};
//
getToken(data);
//
})
//
.catch(error => {
//
console.log(error);
//
});
//
} else {
//
setModalVisible3(true);
//
}
//
console.log('count', count);
};
const
getToken
=
data
=>
{
...
...
@@ -219,6 +221,7 @@ export default function ReadActivityNo() {
};
const
startRecording
=
async
()
=>
{
setCountDownVisible
(
true
);
try
{
await
Voice
.
start
(
'
en-US
'
);
}
catch
(
error
)
{
...
...
@@ -242,9 +245,9 @@ export default function ReadActivityNo() {
<
ReadModalFailed
visible
=
"
true
"
imagePath
=
{
ImagePaths
.
robot1
}
/
>
)}
{
modalVisible
&&
(
<
ReadModalNotice
visible
=
"
true
"
/>
)
}
{
modalVisible
&&
<
ReadModalNotice
visible
=
"
true
"
/>
}
{
countDownVisible
&&
<
CountDownModal
visible
=
"
true
"
/>
}
<
View
style
=
{{
flexDirection
:
'
column
'
}}
>
<
ImageBackground
...
...
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