Commit f9e52979 authored by W.D.R.P. Sandeepa's avatar W.D.R.P. Sandeepa

change some error

parent 50ce9a83
...@@ -256,4 +256,4 @@ def predict_pronounce(FPFN): ...@@ -256,4 +256,4 @@ def predict_pronounce(FPFN):
if __name__ == "__main__": if __name__ == "__main__":
app.run(host='192.168.1.101') app.run(host='192.168.8.100')
...@@ -12,7 +12,7 @@ def create_con(): ...@@ -12,7 +12,7 @@ def create_con():
database="helply", database="helply",
host="127.0.0.1", host="127.0.0.1",
user="root", user="root",
password="12345678" password="rp19970520"
) )
return db return db
......
...@@ -11,7 +11,7 @@ def get_reading_result(userId): ...@@ -11,7 +11,7 @@ def get_reading_result(userId):
def save_activity_details(userId, word, token, level, triedCount): def save_activity_details(userId, word, token, level, triedCount):
qry = 'INSERT INTO reading (id,userId,word,token,triedCount,level) VALUES (NULL, %s, %s, %s, %s, %s)' qry = 'INSERT INTO reading (id,userId,word,token,triedCount,level) VALUES (NULL, %s, %s, %s, %s, %s)'
args = (userId, word, token, level, triedCount) args = (userId, word, token, triedCount, level)
result = insert(qry, args) result = insert(qry, args)
return result return result
......
...@@ -31,6 +31,8 @@ export default function Black() { ...@@ -31,6 +31,8 @@ export default function Black() {
audioInit(); audioInit();
Tts.speak('Hello child, Say the name of this color');
const unsubscribe = navigation.addListener("focus", () => { const unsubscribe = navigation.addListener("focus", () => {
Orientation.unlockAllOrientations(); Orientation.unlockAllOrientations();
...@@ -154,7 +156,7 @@ export default function Black() { ...@@ -154,7 +156,7 @@ export default function Black() {
console.log('Your Answer is Incorrect', value); console.log('Your Answer is Incorrect', value);
setModalVisible3(true); setModalVisible3(true);
Tts.speak('Hey child, Your Answer is Incorrect. Please try again');
} }
...@@ -192,6 +194,8 @@ export default function Black() { ...@@ -192,6 +194,8 @@ export default function Black() {
console.log(response.data); console.log(response.data);
stopRecording(); stopRecording();
setModalVisible2(true); setModalVisible2(true);
Tts.speak('Hey child congratulations, Your Answer is Correct');
Tts.speak('Completed first round');
// navigation.navigate("Green"); // navigation.navigate("Green");
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
......
...@@ -21,6 +21,8 @@ export default function Blue(color) { ...@@ -21,6 +21,8 @@ export default function Blue(color) {
audioInit(); audioInit();
Tts.speak('Hello child, Say the name of this color');
const unsubscribe = navigation.addListener("focus", () => { const unsubscribe = navigation.addListener("focus", () => {
// The screen is focused // The screen is focused
// Call any action // Call any action
......
...@@ -28,6 +28,7 @@ export default function Blue2() { ...@@ -28,6 +28,7 @@ export default function Blue2() {
StatusBar.setHidden(true); StatusBar.setHidden(true);
audioInit(); audioInit();
Tts.speak('Hello child, Say the name of this color');
const unsubscribe = navigation.addListener("focus", () => { const unsubscribe = navigation.addListener("focus", () => {
...@@ -153,6 +154,7 @@ export default function Blue2() { ...@@ -153,6 +154,7 @@ export default function Blue2() {
console.log('Your Answer is Incorrect', value); console.log('Your Answer is Incorrect', value);
setModalVisible3(true); setModalVisible3(true);
Tts.speak('Hey child, Your Answer is Incorrect. Please try again');
} }
...@@ -191,6 +193,7 @@ export default function Blue2() { ...@@ -191,6 +193,7 @@ export default function Blue2() {
console.log(response.data); console.log(response.data);
stopRecording(); stopRecording();
setModalVisible2(true); setModalVisible2(true);
Tts.speak('Hey child congratulations, Your Answer is Correct');
// navigation.navigate("Green"); // navigation.navigate("Green");
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
......
...@@ -7,6 +7,7 @@ import axios from "axios"; ...@@ -7,6 +7,7 @@ import axios from "axios";
import CountDown from 'react-native-countdown-component'; import CountDown from 'react-native-countdown-component';
import { secondColor } from '../../assets/color/color'; import { secondColor } from '../../assets/color/color';
import client from "../client/Client"; import client from "../client/Client";
import Tts from 'react-native-tts';
import Voice from '@react-native-voice/voice'; import Voice from '@react-native-voice/voice';
import AsyncStorage from '@react-native-async-storage/async-storage'; import AsyncStorage from '@react-native-async-storage/async-storage';
import AudioRecord from 'react-native-audio-record'; import AudioRecord from 'react-native-audio-record';
...@@ -30,6 +31,8 @@ export default function Green({ navigation }) { ...@@ -30,6 +31,8 @@ export default function Green({ navigation }) {
audioInit(); audioInit();
Tts.speak('Hello child, Say the name of this color');
const unsubscribe = navigation.addListener("focus", () => { const unsubscribe = navigation.addListener("focus", () => {
Orientation.unlockAllOrientations(); Orientation.unlockAllOrientations();
...@@ -152,6 +155,7 @@ export default function Green({ navigation }) { ...@@ -152,6 +155,7 @@ export default function Green({ navigation }) {
console.log('Your Answer is Incorrect', value); console.log('Your Answer is Incorrect', value);
setModalVisible3(true); setModalVisible3(true);
Tts.speak('Hey child, Your Answer is Incorrect. Please try again');
} }
...@@ -190,6 +194,7 @@ export default function Green({ navigation }) { ...@@ -190,6 +194,7 @@ export default function Green({ navigation }) {
console.log(response.data); console.log(response.data);
stopRecording(); stopRecording();
setModalVisible2(true); setModalVisible2(true);
Tts.speak('Hey child congratulations, Your Answer is Correct');
// navigation.navigate("Green"); // navigation.navigate("Green");
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
......
...@@ -30,7 +30,7 @@ export default function Red({ navigation }) { ...@@ -30,7 +30,7 @@ export default function Red({ navigation }) {
audioInit(); audioInit();
Tts.speak('Hello child, Say the name of this color');
const unsubscribe = navigation.addListener("focus", () => { const unsubscribe = navigation.addListener("focus", () => {
...@@ -148,13 +148,14 @@ export default function Red({ navigation }) { ...@@ -148,13 +148,14 @@ export default function Red({ navigation }) {
sendData(mainColor[0]); sendData(mainColor[0]);
// audioStart(); audioStart();
} else { } else {
console.log('Your Answer is Incorrect', value); console.log('Your Answer is Incorrect', value);
setModalVisible3(true); setModalVisible3(true);
Tts.speak('Hey child, Your Answer is Incorrect. Please try again');
} }
...@@ -221,6 +222,7 @@ export default function Red({ navigation }) { ...@@ -221,6 +222,7 @@ export default function Red({ navigation }) {
console.log(response.data); console.log(response.data);
stopRecording(); stopRecording();
setModalVisible2(true); setModalVisible2(true);
Tts.speak('Hey child congratulations, Your Answer is Correct');
// navigation.navigate("Green"); // navigation.navigate("Green");
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
......
...@@ -7,6 +7,7 @@ import axios from "axios"; ...@@ -7,6 +7,7 @@ import axios from "axios";
import { secondColor } from '../../assets/color/color'; import { secondColor } from '../../assets/color/color';
import CountDown from 'react-native-countdown-component'; import CountDown from 'react-native-countdown-component';
import client from "../client/Client"; import client from "../client/Client";
import Tts from 'react-native-tts';
import AudioRecord from 'react-native-audio-record'; import AudioRecord from 'react-native-audio-record';
import Voice from '@react-native-voice/voice'; import Voice from '@react-native-voice/voice';
import AsyncStorage from '@react-native-async-storage/async-storage'; import AsyncStorage from '@react-native-async-storage/async-storage';
...@@ -28,6 +29,7 @@ export default function White() { ...@@ -28,6 +29,7 @@ export default function White() {
StatusBar.setHidden(true); StatusBar.setHidden(true);
audioInit(); audioInit();
Tts.speak('Hello child, Say the name of this color');
const unsubscribe = navigation.addListener("focus", () => { const unsubscribe = navigation.addListener("focus", () => {
...@@ -152,7 +154,7 @@ export default function White() { ...@@ -152,7 +154,7 @@ export default function White() {
console.log('Your Answer is Incorrect', value); console.log('Your Answer is Incorrect', value);
setModalVisible3(true); setModalVisible3(true);
Tts.speak('Hey child, Your Answer is Incorrect. Please try again');
} }
...@@ -190,6 +192,8 @@ export default function White() { ...@@ -190,6 +192,8 @@ export default function White() {
console.log(response.data); console.log(response.data);
stopRecording(); stopRecording();
setModalVisible2(true); setModalVisible2(true);
Tts.speak('Hey child congratulations, Your Answer is Correct');
Tts.speak('Completed second round');
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}) })
......
...@@ -7,6 +7,7 @@ import axios from "axios"; ...@@ -7,6 +7,7 @@ import axios from "axios";
import CountDown from 'react-native-countdown-component'; import CountDown from 'react-native-countdown-component';
import { mainColor } from '../../assets/color/color'; import { mainColor } from '../../assets/color/color';
import client from "../client/Client"; import client from "../client/Client";
import Tts from 'react-native-tts';
import Voice from '@react-native-voice/voice'; import Voice from '@react-native-voice/voice';
import AudioRecord from 'react-native-audio-record'; import AudioRecord from 'react-native-audio-record';
import AsyncStorage from '@react-native-async-storage/async-storage'; import AsyncStorage from '@react-native-async-storage/async-storage';
...@@ -28,6 +29,8 @@ export default function Yellow() { ...@@ -28,6 +29,8 @@ export default function Yellow() {
audioInit(); audioInit();
Tts.speak('Hello child, Say the name of this color');
const unsubscribe = navigation.addListener("focus", () => { const unsubscribe = navigation.addListener("focus", () => {
Orientation.unlockAllOrientations(); Orientation.unlockAllOrientations();
...@@ -151,6 +154,7 @@ export default function Yellow() { ...@@ -151,6 +154,7 @@ export default function Yellow() {
console.log('Your Answer is Incorrect', value); console.log('Your Answer is Incorrect', value);
setModalVisible3(true); setModalVisible3(true);
Tts.speak('Hey child, Your Answer is Incorrect. Please try again');
} }
...@@ -189,7 +193,8 @@ export default function Yellow() { ...@@ -189,7 +193,8 @@ export default function Yellow() {
console.log(response.data); console.log(response.data);
stopRecording(); stopRecording();
setModalVisible2(true); setModalVisible2(true);
// navigation.navigate("Green"); Tts.speak('Hey child congratulations, Your Answer is Correct');
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}) })
......
...@@ -2,6 +2,6 @@ import axios from 'axios'; ...@@ -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.102:5000/', timeout: 15000, });
export default axios.create({ export default axios.create({
baseURL: 'http://192.168.1.101:5000/', baseURL: 'http://192.168.8.100:5000/',
timeout: 15000, timeout: 15000,
}); });
...@@ -30,6 +30,7 @@ export default function ReadActivityBird() { ...@@ -30,6 +30,7 @@ export default function ReadActivityBird() {
const [modalVisible3, setModalVisible3] = useState(false); const [modalVisible3, setModalVisible3] = useState(false);
React.useEffect(() => { React.useEffect(() => {
Voice.destroy().then(Voice.removeAllListeners);
// StatusBar.setHidden(true); // StatusBar.setHidden(true);
// //
setModalVisible(true); setModalVisible(true);
...@@ -43,7 +44,7 @@ export default function ReadActivityBird() { ...@@ -43,7 +44,7 @@ export default function ReadActivityBird() {
}, [navigation]); }, [navigation]);
useEffect(() => { useEffect(() => {
Voice.destroy().then(Voice.removeAllListeners);
}, []); }, []);
useEffect(() => { useEffect(() => {
...@@ -79,7 +80,10 @@ export default function ReadActivityBird() { ...@@ -79,7 +80,10 @@ export default function ReadActivityBird() {
const onSpeechResultsHandler = e => { const onSpeechResultsHandler = e => {
setCount(count + 1); setCount(count + 1);
const result = e.value; const result = e.value;
if (result.includes('bird')) {
// console.log(result+"hfghdfghfhgf");
if (result.includes('Bird')) {
AsyncStorage.getItem('userId') AsyncStorage.getItem('userId')
.then(userId => { .then(userId => {
const data = { const data = {
......
...@@ -90,8 +90,14 @@ export default function ReadActivityFish() { ...@@ -90,8 +90,14 @@ export default function ReadActivityFish() {
}; };
const onSpeechStartHandler = e => { const onSpeechStartHandler = e => {
};
const onSpeechResultsHandler = e => {
setCount(count + 1); setCount(count + 1);
const result = e.value; const result = e.value;
// console.log(result+"hfghdfghfhgf");
if (result.includes('fish')) { if (result.includes('fish')) {
AsyncStorage.getItem('userId') AsyncStorage.getItem('userId')
.then(userId => { .then(userId => {
...@@ -111,10 +117,6 @@ export default function ReadActivityFish() { ...@@ -111,10 +117,6 @@ export default function ReadActivityFish() {
} }
}; };
const onSpeechResultsHandler = e => {
console.log('result handler =>> ', e);
};
const onSpeechError = e => { const onSpeechError = e => {
// console.log('onSpeechError: ', e); // console.log('onSpeechError: ', e);
// const result = DummyReadResult.value; // const result = DummyReadResult.value;
......
...@@ -97,7 +97,7 @@ export default function ReadActivityHe() { ...@@ -97,7 +97,7 @@ export default function ReadActivityHe() {
const onSpeechResultsHandler = e => { const onSpeechResultsHandler = e => {
setCount(count + 1); setCount(count + 1);
const result = e.value; const result = e.value;
if (result.includes('He')) { if (result.includes('he')) {
AsyncStorage.getItem('userId') AsyncStorage.getItem('userId')
.then(userId => { .then(userId => {
const data = { const data = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment