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