diff --git a/app/assets/img/topic/1.jpg b/app/assets/img/topic/1.jpg index e801cad..7902057 100644 Binary files a/app/assets/img/topic/1.jpg and b/app/assets/img/topic/1.jpg differ diff --git a/app/assets/img/topic/10.jpg b/app/assets/img/topic/10.jpg index 85bba9c..4a728df 100644 Binary files a/app/assets/img/topic/10.jpg and b/app/assets/img/topic/10.jpg differ diff --git a/app/assets/img/topic/11.jpg b/app/assets/img/topic/11.jpg index 352b0da..cb47b51 100644 Binary files a/app/assets/img/topic/11.jpg and b/app/assets/img/topic/11.jpg differ diff --git a/app/assets/img/topic/12.jpg b/app/assets/img/topic/12.jpg index f72021b..e893c60 100644 Binary files a/app/assets/img/topic/12.jpg and b/app/assets/img/topic/12.jpg differ diff --git a/app/assets/img/topic/14.jpg b/app/assets/img/topic/14.jpg index c2349a3..2dc9004 100644 Binary files a/app/assets/img/topic/14.jpg and b/app/assets/img/topic/14.jpg differ diff --git a/app/assets/img/topic/15.jpg b/app/assets/img/topic/15.jpg index 40c7f52..49dff10 100644 Binary files a/app/assets/img/topic/15.jpg and b/app/assets/img/topic/15.jpg differ diff --git a/app/assets/img/topic/2.jpg b/app/assets/img/topic/2.jpg index 60398a7..efa096d 100644 Binary files a/app/assets/img/topic/2.jpg and b/app/assets/img/topic/2.jpg differ diff --git a/app/assets/img/topic/3.jpg b/app/assets/img/topic/3.jpg index 53c0d7a..691669c 100644 Binary files a/app/assets/img/topic/3.jpg and b/app/assets/img/topic/3.jpg differ diff --git a/app/assets/img/topic/4.jpg b/app/assets/img/topic/4.jpg index 0b8f89f..6073711 100644 Binary files a/app/assets/img/topic/4.jpg and b/app/assets/img/topic/4.jpg differ diff --git a/app/assets/img/topic/5.jpg b/app/assets/img/topic/5.jpg index b1f78aa..7ba7d19 100644 Binary files a/app/assets/img/topic/5.jpg and b/app/assets/img/topic/5.jpg differ diff --git a/app/assets/img/topic/6.jpg b/app/assets/img/topic/6.jpg index 872c862..9dffdbd 100644 Binary files a/app/assets/img/topic/6.jpg and b/app/assets/img/topic/6.jpg differ diff --git a/app/assets/img/topic/7.jpg b/app/assets/img/topic/7.jpg index 57491a6..7131c4e 100644 Binary files a/app/assets/img/topic/7.jpg and b/app/assets/img/topic/7.jpg differ diff --git a/app/assets/img/topic/8.jpg b/app/assets/img/topic/8.jpg index 2b5d551..16a2f14 100644 Binary files a/app/assets/img/topic/8.jpg and b/app/assets/img/topic/8.jpg differ diff --git a/app/assets/img/topic/9.jpg b/app/assets/img/topic/9.jpg index 8c0421b..1424be0 100644 Binary files a/app/assets/img/topic/9.jpg and b/app/assets/img/topic/9.jpg differ diff --git a/app/assets/img/topic/character exp dissapoint.png b/app/assets/img/topic/character exp dissapoint.png index ad796e4..580802f 100644 Binary files a/app/assets/img/topic/character exp dissapoint.png and b/app/assets/img/topic/character exp dissapoint.png differ diff --git a/app/assets/img/topic/character exp happy.png b/app/assets/img/topic/character exp happy.png index f11c2f0..a74a962 100644 Binary files a/app/assets/img/topic/character exp happy.png and b/app/assets/img/topic/character exp happy.png differ diff --git a/app/assets/img/topic/character exp normal.png b/app/assets/img/topic/character exp normal.png index 9ee75c9..458be99 100644 Binary files a/app/assets/img/topic/character exp normal.png and b/app/assets/img/topic/character exp normal.png differ diff --git a/app/assets/img/topic/class.jpg b/app/assets/img/topic/class.jpg deleted file mode 100644 index e801cad..0000000 Binary files a/app/assets/img/topic/class.jpg and /dev/null differ diff --git a/app/assets/img/topic/health.jpg b/app/assets/img/topic/health.jpg deleted file mode 100644 index c2349a3..0000000 Binary files a/app/assets/img/topic/health.jpg and /dev/null differ diff --git a/app/assets/img/topic/image_loading.jpg b/app/assets/img/topic/image_loading.jpg index 954ea14..d2a8f36 100644 Binary files a/app/assets/img/topic/image_loading.jpg and b/app/assets/img/topic/image_loading.jpg differ diff --git a/app/assets/img/topic/image_loading.png b/app/assets/img/topic/image_loading.png index eea751b..fe27f9e 100644 Binary files a/app/assets/img/topic/image_loading.png and b/app/assets/img/topic/image_loading.png differ diff --git a/app/assets/img/topic/kotatsu_room.jpg b/app/assets/img/topic/kotatsu_room.jpg deleted file mode 100644 index 59b2e15..0000000 Binary files a/app/assets/img/topic/kotatsu_room.jpg and /dev/null differ diff --git a/app/assets/img/topic/market.png b/app/assets/img/topic/market.png deleted file mode 100644 index 40c7f52..0000000 Binary files a/app/assets/img/topic/market.png and /dev/null differ diff --git a/app/assets/img/topic/me_family.jpg b/app/assets/img/topic/me_family.jpg deleted file mode 100644 index b1f78aa..0000000 Binary files a/app/assets/img/topic/me_family.jpg and /dev/null differ diff --git a/app/assets/img/topic/number_chara.jpg b/app/assets/img/topic/number_chara.jpg deleted file mode 100644 index 4fa5317..0000000 Binary files a/app/assets/img/topic/number_chara.jpg and /dev/null differ diff --git a/app/assets/img/topic/office.jpg b/app/assets/img/topic/office.jpg deleted file mode 100644 index 1498df0..0000000 Binary files a/app/assets/img/topic/office.jpg and /dev/null differ diff --git a/app/assets/img/topic/ramen_shop.jpg b/app/assets/img/topic/ramen_shop.jpg deleted file mode 100644 index 2b5d551..0000000 Binary files a/app/assets/img/topic/ramen_shop.jpg and /dev/null differ diff --git a/app/assets/img/topic/society.jpg b/app/assets/img/topic/society.jpg deleted file mode 100644 index 85bba9c..0000000 Binary files a/app/assets/img/topic/society.jpg and /dev/null differ diff --git a/app/assets/img/topic/travel.jpg b/app/assets/img/topic/travel.jpg deleted file mode 100644 index f72021b..0000000 Binary files a/app/assets/img/topic/travel.jpg and /dev/null differ diff --git a/app/component/answerButton.js b/app/component/answerButton.js index 9089e88..eebda39 100644 --- a/app/component/answerButton.js +++ b/app/component/answerButton.js @@ -23,7 +23,7 @@ class AnswerButton extends Component { _renderIcon(){ let iconName = ''; - console.log(this.props.isCorrect); + switch (this.props.isCorrect) { case 1: iconName = 'circle-o'; diff --git a/app/component/fillBlank.js b/app/component/fillBlank.js index 5cd0778..7f86ccf 100644 --- a/app/component/fillBlank.js +++ b/app/component/fillBlank.js @@ -206,7 +206,7 @@ class FillBlank extends Component { if(this.emptyBox[i].char) filled[filled.length] = this.emptyBox[i].char; } - console.log(this.shuffledString.length, 'wee', filled.length); + if(filled.length == this.shuffledString.length){ this.onSelectAnswer(filled.join('')); diff --git a/app/component/fillButton.js b/app/component/fillButton.js index 95f9865..2f8e3d1 100644 --- a/app/component/fillButton.js +++ b/app/component/fillButton.js @@ -161,7 +161,7 @@ class FillButton extends Component { if(this.emptyBox[i].char) filled[filled.length] = this.emptyBox[i].char; } - console.log(this.shuffledString.length, 'wee', filled.length); + if(filled.length == this.shuffledString.length){ this.onSelectAnswer(filled.join('')); diff --git a/app/component/question.js b/app/component/question.js index 1b537a9..3c49bd6 100644 --- a/app/component/question.js +++ b/app/component/question.js @@ -143,7 +143,7 @@ class QuestionPanel extends Component { playDifferentAudio = this.currentAudio != this.props.question.id && this.props.format == 'audio'; if(playDifferentAudio || forcePlay){ - console.log(this.currentAudio + ' - ' + this.props.question.id); + this.currentAudio = this.props.question.id; this.quizAudio.play((success) => { diff --git a/app/config/image_list.js b/app/config/image_list.js index 39af1f7..0b5114c 100644 --- a/app/config/image_list.js +++ b/app/config/image_list.js @@ -1,16 +1,6 @@ export const ImageData = { loading : require('../assets/img/topic/image_loading.jpg'), - default_bg : require('../assets/img/topic/class.jpg'), - class : require('../assets/img/topic/class.jpg'), - health : require('../assets/img/topic/health.jpg'), - kotatsu_room : require('../assets/img/topic/kotatsu_room.jpg'), - market : require('../assets/img/topic/market.png'), - me_family : require('../assets/img/topic/me_family.jpg'), - number_chara : require('../assets/img/topic/number_chara.jpg'), - office : require('../assets/img/topic/office.jpg'), - ramen_shop : require('../assets/img/topic/ramen_shop.jpg'), - society : require('../assets/img/topic/society.jpg'), - travel : require('../assets/img/topic/travel.jpg'), + default_bg : require('../assets/img/topic/1.jpg'), // Character happy : require('../assets/img/char/char-happy.png'), sad : require('../assets/img/char/char-sad.png'), diff --git a/app/screens/Quiz/quizFlash.js b/app/screens/Quiz/quizFlash.js index 3f60c5f..b56f500 100644 --- a/app/screens/Quiz/quizFlash.js +++ b/app/screens/Quiz/quizFlash.js @@ -83,6 +83,7 @@ import { this.timerResume = false; this.time = 6000; + this.state = { timesUp: false, expression: 'default', @@ -104,8 +105,8 @@ import { typeQuiz : '', index : '', format:'', - showCorrect:false - } + showCorrect:false + } this._onSetLanguageTo('en'); @@ -193,10 +194,9 @@ import { ); } - componentWillMount() { + componentDidMount() { const { navigation } = this.props; - - console.log(this.props.navigation); + this.oneType = navigation.getParam('oneType',null); this.mounted = true; idList = navigation.getParam('idList', null); @@ -211,7 +211,7 @@ import { index: navigation.getParam('index', null), isTopicTest: navigation.getParam('isTopicTest', null) } - console.log(this.initialParams); + this.setState(this.initialParams); this.setInitial(); @@ -232,11 +232,11 @@ import { } else{ shuffledQuiz = this.shuffleItems(this.quizItems); - + console.log(shuffledQuiz,'a--'); this.allQuestion = shuffledQuiz.map((question) => this.shuffleAnswers(question, shuffledQuiz) ); - + console.log(this.allQuestion,'s--'); this.currentQuestion = this.allQuestion[0]; this.setState({ @@ -267,7 +267,7 @@ import { } componentWillUnmount(){ - this.mounted = false; + this.mounted = false; } // set items @@ -354,24 +354,29 @@ import { array.answerOption[i] = randomItem; } - console.log(array); + return array; }; // randomized question - shuffleItems(array) { - var currentIndex = array.length, temporaryValue, randomIndex; - + shuffleItems(array) { + var currentIndex = array.length, temporaryValue, randomIndex, output = []; + var limit = this.initialParams.type == 'Test' ? 25 : array.length; + while (0 !== currentIndex) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; - + temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; - array[randomIndex] = temporaryValue; + array[randomIndex] = temporaryValue; } - - return array; + + for(i = 0; i < limit; i++){ + output[i] = array[i]; + } + + return output; }; randomQuizFormat(){ @@ -385,7 +390,7 @@ import { quizFormat = this.oneType ? [this.oneType] : this.quizOptions.types; quizFormatLength = quizFormat.length; randomIndex = Math.floor(Math.random() * quizFormatLength); - + time = this.time; switch (quizFormat[randomIndex]) { case 'romaji_moji': @@ -440,8 +445,10 @@ import { paramFormat = { answerFormat: 'moji', questionFormat: 'audio', - time: this.state.time * 1.5 + }; + + time = time * 1.5; break; @@ -449,8 +456,10 @@ import { paramFormat = { answerFormat: 'moji', questionFormat: 'english', - time:this.state.time * 1.5 + }; + + time = time * 1.5; break; @@ -458,8 +467,10 @@ import { paramFormat = { answerFormat: 'moji', questionFormat: 'kanji', - time:this.state.time * 1.5 + }; + + time = time * 1.5; break; @@ -495,18 +506,23 @@ import { paramFormat = { answerFormat: 'moji', questionFormat: 'fill', - time:this.state.time * 1.5 - }; + + }; + + time = time * 1.5; + break; case 'arrange': paramFormat = { answerFormat: 'moji', questionFormat: 'arrange', - time:this.state.time * 2 - }; - break; + + }; + time = time * 2; + + break; default: paramFormat = { @@ -515,7 +531,10 @@ import { }; break; } + paramFormat.time = time; paramFormat.format = quizFormat[randomIndex]; + + console.log(paramFormat.time,'time2',this.time); this.setState(paramFormat); } @@ -542,17 +561,18 @@ import { timesUp: false, expression:'default', correct: 0, - showCorrect:false, - time:this.time + showCorrect:false }); } else{ this.setEndQuiz(); + this.props.navigation.navigate('ScoreScreen',{ index : this.state.index, typeQuiz : this.state.type, studyTitle : this.title }); + } } @@ -601,16 +621,14 @@ import { var endTime = ( new Date().getTime() / 1000); var parseValue = this.reduxParam; - console.log(parseValue); + parseValue['finishTime'] = endTime; parseValue['quizData'] = this.studyRecord; this.props.endLearn(parseValue); //call our action }; - goNextQuestion() { - - this.setNextQuestion(); - + goNextQuestion() { + this.setNextQuestion(); } onTimesUp = (val) => { @@ -625,7 +643,7 @@ import { expression:'sad' }); - setTimeout(() => { + setTimeout(() => { this.setNextQuestion(); }, this.state.pause); } @@ -652,8 +670,13 @@ import { this.addScore(isCorrect); if(this.study.type == 'TOPIC' && this.state.type == 'Quiz' && this.showCorrect){ + setTimeout(() => { + + this.setState({ + showCorrect: this.showCorrect + }); - stopTimerParam.showCorrect = this.showCorrect; + }, this.state.pause); } else{ @@ -661,11 +684,12 @@ import { this.showCorrect = false; this.setNextQuestion(); - }, this.state.pause); + }, this.state.pause); } this.setState(stopTimerParam); + }; addScore = (isCorrect) => { diff --git a/app/screens/Study/topiclist.js b/app/screens/Study/topiclist.js index bb670e5..175986f 100644 --- a/app/screens/Study/topiclist.js +++ b/app/screens/Study/topiclist.js @@ -64,7 +64,8 @@ navigateToLearn=(type, categoryId)=>{ param.isTopicTest = true; param.studyType = this.state.title; - + param.type = 'Test'; + this.props.navigation.navigate('QuizFlash',( param )); diff --git a/app/screens/main.js b/app/screens/main.js index 1de5420..68b8f76 100644 --- a/app/screens/main.js +++ b/app/screens/main.js @@ -29,8 +29,8 @@ class MainScreen extends Component { // Render any loading content that you like here render() { console.log(this.props.data); - if (this.props.data) { - if(this.props.data.userId){ + if (true) { + if(true){ return ( );