Skip to content
This repository has been archived by the owner on Apr 14, 2020. It is now read-only.

Commit

Permalink
#50 Add: Data for list of menu in grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidborredom committed May 24, 2018
1 parent 2f5f9cb commit 86332a2
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 440 deletions.
15 changes: 14 additions & 1 deletion app/config/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export let strings = new LocalizedStrings({
KANJI_LIST : "KANJI LIST",
FLASH_CARD_HIRAGANA: "FLASH CARD HIRAGANA",
FLASH_CARD_KATAKANA: "FLASH CARD KATAKANA",

HIKA_ROMA: "Hiragana/Katakana to Romaji",
ROMA_HIKA: "Romaji to Hiragana/Katakana",
LISTEN: "Listening",
TRANSLATE_SENTENCE: "Translate the sentence",
FLASH_CARD: "Listening\n(Translate)",
FILL_THE_BLANKS: "Fill in the blanks",
REARRANGE: "Rearrange the sentence"
},
ja: {
loginGuest: "japan",
Expand Down Expand Up @@ -87,6 +93,13 @@ export let strings = new LocalizedStrings({
KANJI_LIST : "KANJI LIST",
FLASH_CARD_HIRAGANA: "FLASH CARD HIRAGANA",
FLASH_CARD_KATAKANA: "FLASH CARD KATAKANA",
HIKA_ROMA: "Hiragana/Katakana to Romaji",
ROMA_HIKA: "Romaji to Hiragana/Katakana",
LISTEN: "Listening",
TRANSLATE_SENTENCE: "Translate the sentence",
FLASH_CARD: "Listening\n(Translate)",
FILL_THE_BLANKS: "Fill in the blanks",
REARRANGE: "Rearrange the sentence"

}
});
4 changes: 2 additions & 2 deletions app/config/quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const quizItems = {
"type":"hiragana",
"romaji":"shi",
"moji":"し",
"audio":"shi.mp3",
"audio":"si.mp3",
"title":"shi",
},
{
Expand Down Expand Up @@ -932,7 +932,7 @@ export const quizItems = {
"type":"katakana",
"romaji":"shi",
"moji":"シ",
"audio":"shi.mp3",
"audio":"si.mp3",
"title":"shi",
},
{
Expand Down
2 changes: 2 additions & 0 deletions app/config/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import LearnListScreen from '../screens/Learn/LearnList';
import LearnHiraganaModule from '../screens/Learn/LearnModule';
import QuizMainScreen from '../screens/Quiz/quizMain';
import QuizListScreen from '../screens/Quiz/quizList';
import QuizBeforeScreen from '../screens/Quiz/quizBeforeList';
import QuizHiraganaListScreen from '../screens/Quiz/quizHiraganaList';
import QuizKatakanaListScreen from '../screens/Quiz/quizKatakanaList';
import HiraganaFlashcardScreen from '../screens/Study/hiraganaFlashcard';
Expand Down Expand Up @@ -55,6 +56,7 @@ const StudyStack = StackNavigator({
LearnListScreen: LearnListScreen,
QuizMain: QuizMainScreen,
QuizList: QuizStack,
QuizBefore: QuizListScreen,
LearnHiraganaModule:
{
screen: LearnHiraganaModule,
Expand Down
63 changes: 58 additions & 5 deletions app/config/studyList.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const StudyList = [{
type : 'Initial',
id: 'T001',
quizOptions: {
random: true,
random: false,
types:['romaji_moji', 'moji_romaji','audio_moji','audio_romaji'],
style:'quizSquared'
}
Expand All @@ -17,7 +17,7 @@ export const StudyList = [{
type : 'Initial',
id: 'T002',
quizOptions: {
random: false,
random: true,
types:['moji_english', 'english_moji','audio_english','audio_moji'],
withCorrection:true,
style:'quizLong'
Expand All @@ -39,9 +39,27 @@ export const StudyList = [{
{
title : 'TOPIC1_TITLE',
img : 'me_family',
lock : true,
lock : false,
type : 'Topic',
id: 'T004'
id: 'T004',
vocabulary:{
random:true,
types:['english_moji','english_fill','audio_english','audio_fill'],
withCorrection:true,
style:'quizLong'
},
grammar:{
random:true,
types:['english_moji','audio_english','fill','arrange'],
withCorrection:true,
style:'quizLong'
},
kanji:{
random:true,
types:['kanji_moji','kanji_fill','kanji_english','audio_kanji','moji_kanji'],
withCorrection:true,
style:'quizLong'
}
},
{
title : 'TOPIC2_TITLE',
Expand Down Expand Up @@ -216,4 +234,39 @@ TOPIC1_TITLE_and_kanji : [{
study : '4'
},
],
};
};

export const QuizListData = {
hiragana_katakana :[
{
title : 'HIKA_ROMA',
type : 'moji_romaji'
},
{
title : 'ROMA_HIKA',
type : 'romaji_moji'
},
{
title : 'LISTEN',
type : 'audio_moji'
}
],
grammar :[
{
title : 'TRANSLATE_SENTENCE',
type : 'english_moji',
},{
title : 'FLASH_CARD',
type : 'audio_english',
},
{
title : 'FILL_THE_BLANKS',
type : 'fill',
},
{
title : 'REARRANGE',
type : 'arrange',
}
],
};

80 changes: 80 additions & 0 deletions app/screens/Quiz/quizBeforeList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import React, { Component } from 'react';
import {
ActivityIndicator,
AsyncStorage,
Button,
StatusBar,
StyleSheet,
View,
ToolbarAndroid,
Text,
TouchableOpacity,
} from 'react-native';

import { withNavigation } from 'react-navigation';
import { strings } from '../../config/localization';
import { QuizListData } from '../../config/studyList';

class QuizBeforeScreen extends Component {

static navigationOptions = ({ navigation }) => {
subtitle = navigation.getParam('typeQuiz', null);
title = navigation.getParam('title', null);

return{
title: title,
tabBarVisible:false,
header: props => <Header
title={ strings[title] }
subtitle={ subtitle }
navigation={ navigation }
/>
}
};

constructor(props){
super(props);
this.list = QuizListData.hiragana_katakana;
this._onSetLanguageTo('en');
}

_onSetLanguageTo(value) {
strings.setLanguage(value);
}

render() {
return (
<View style={styles.containerFlexColumn}>
{this.list.map((item, key)=>(
<View key={key} style={styles.quizList}>
<TouchableOpacity onPress={this.quiz.bind(this, item.type)}>
<Text style={styles.hiraganaListText}> {strings[item.title]} </Text>
</TouchableOpacity>
</View>
))}
</View>
);
}

quiz = (type) => {
const { navigation } = this.props;

this.props.navigation.navigate('QuizList',(
{
type: navigation.getParam('type',null),
title: navigation.getParam('title',null),
studyType: navigation.getParam('studyType',null),
img: navigation.getParam('img',null),
topicId: navigation.getParam('topicId',null),
typeQuiz: navigation.getParam('typeQuiz',null),
quizOptions: navigation.getParam('quizOptions',null),
oneType: type,
index: navigation.getParam('index',null),
}
));
};
}

const styles = require('../../styles/quizStyle');

export default QuizBeforeScreen;
Loading

0 comments on commit 86332a2

Please sign in to comment.