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

Commit

Permalink
#50 fix conflict with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidborredom committed Jun 20, 2018
2 parents b77ef94 + e40aaf3 commit d6d6c7c
Show file tree
Hide file tree
Showing 22 changed files with 451 additions and 26 deletions.
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:screenOrientation="portrait"
android:largeHeap="true"
android:theme="@style/AppTheme">
<meta-data
Expand Down
31 changes: 30 additions & 1 deletion app/actions/summary.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SUMMARY_HOME , SUMMARY_TEST , SUMMARY_QUIZ , SUMMARY_ALL, SUMMARY_LEARN , SUMMARY_LOCK } from '../lib/constants';
import { SUMMARY_HOME , SUMMARY_TEST , SUMMARY_QUIZ , SUMMARY_ALL, SUMMARY_LEARN , SUMMARY_LOCK , SUMMARY_HISTORY} from '../lib/constants';
import { AsyncStorage } from 'react-native';
import * as SummaryHelper from '../actions/summaryHelper';

Expand Down Expand Up @@ -109,6 +109,28 @@ export function getSummaryV2(topicId, categoryId, studyId){
}


export function getHistory(topicId, categoryId, studyId){
console.log("running history");
return (dispatch) => {
getJWT().then( JWT => {
console.log(JWT);

fetch('https://e-learning-backend.herokuapp.com/api/v1/summaries?topicId=' + topicId + '&categoryId='+ categoryId,{
method: 'GET',
headers: {
'Authorization' : JWT,
'Accept': 'application/json',
'Content-Type': 'application/json',
},
}).then(data => data.json())
.then(json => {
dispatch(getHistoryDispatch(json))
})
.catch(err => dispatch(failedSummary(err)))
})
};
}

export function getHomeSummary(studentID){
return (dispatch) => {
fetch('http://www.mocky.io/v2/5b06d14d2f00002b00c61f1b')
Expand Down Expand Up @@ -171,5 +193,12 @@ export function getLockDispatch(data){
}
}

export function getHistoryDispatch(data){
return {
type: SUMMARY_HISTORY,
data : data.activities,
}
}

export function failedSummary(err){
}
Binary file modified app/assets/img/topic/10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/img/topic/11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/img/topic/12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/img/topic/13.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/img/topic/14.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/img/topic/15.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/img/topic/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/img/topic/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/img/topic/7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/img/topic/8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/img/topic/9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 26 additions & 16 deletions app/config/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ export let strings = new LocalizedStrings({
KATAKANA_LIST_TITLE: 'Katakana',
NUMBER_TITLE : "Number",
GREETING_TITLE : "Greeting",
TOPIC1_TITLE : "Myself",
TOPIC2_TITLE : "Family",
TOPIC3_TITLE : "House",
TOPIC4_TITLE : "Living environments",
TOPIC5_TITLE : "Free time",
TOPIC6_TITLE : "Entertainment",
TOPIC7_TITLE : "Living",
TOPIC8_TITLE : "Human Life",
TOPIC1_TITLE : "Myself and Work",
TOPIC2_TITLE : "Life and Hobbies",
TOPIC3_TITLE : "House and Town",
TOPIC4_TITLE : "Travel and transportation",
TOPIC5_TITLE : "Shopping",
TOPIC6_TITLE : "Family",
TOPIC7_TITLE : "Day Off",
TOPIC8_TITLE : "Relationship with people",
TOPIC9_TITLE : "Travel",
TOPIC10_TITLE : "Traffic",
TOPIC11_TITLE : "health",
Expand Down Expand Up @@ -165,6 +165,12 @@ export let strings = new LocalizedStrings({
SUMMARY_TOTAL :"TOTAL",

WARNING : "Warning",
HISTORY : 'History',
TIME : 'TIME',
SCORE : 'SCORE',
DETAIL : 'DETAIL',


},
ja: {
loginGuest: "ログイン",
Expand All @@ -179,14 +185,14 @@ export let strings = new LocalizedStrings({
KATAKANA_LIST_TITLE: 'カタカナ',
NUMBER_TITLE : "数字",
GREETING_TITLE : "あいさつ",
TOPIC1_TITLE : "自分",
TOPIC2_TITLE : "家族",
TOPIC3_TITLE : "住まい",
TOPIC4_TITLE : "住環境",
TOPIC5_TITLE : "自由時間",
TOPIC6_TITLE : "娯楽",
TOPIC7_TITLE : "生活",
TOPIC8_TITLE : "人生",
TOPIC1_TITLE : "私と仕事",
TOPIC2_TITLE : "生活と趣味",
TOPIC3_TITLE : "家と町",
TOPIC4_TITLE : "旅行と交通",
TOPIC5_TITLE : "買い物",
TOPIC6_TITLE : "家族",
TOPIC7_TITLE : "休みの日",
TOPIC8_TITLE : "人との関係",
TOPIC9_TITLE : "旅行",
TOPIC10_TITLE : "交通",
TOPIC11_TITLE : "健康",
Expand Down Expand Up @@ -328,6 +334,10 @@ export let strings = new LocalizedStrings({
T022_MSG : 'トラブル・マナーのテスト取ってお願いします。',
T023_MSG : '言語と文化のテスト取ってお願いします。',
T024_MSG : '言語と文化のテスト取ってお願いします。',
HISTORY : '履歴',
TIME : '時間',
SCORE : 'スコア',
DETAIL : '詳細',

}
});
5 changes: 5 additions & 0 deletions app/config/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import SummaryLearnDetail from '../screens/Summary/summaryLearn';
import reviewScreen from '../screens/Summary/reviewSummary';
import mainSettings from '../screens/Setting/mainsetting';

import historyListScreen from '../screens/Summary/historyList';
import historyDetailScreen from '../screens/Summary/historyDetail';

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

Expand Down Expand Up @@ -83,6 +85,9 @@ const StudyStack = StackNavigator({
LearnHL1: LearnHL1Screen,
summaryLearnData : SummaryLearnDetail,
reviewScreen : reviewScreen,
historyListScreen : historyListScreen,
historyDetailScreen : historyDetailScreen,

});

const SummaryStack = StackNavigator({
Expand Down
3 changes: 3 additions & 0 deletions app/lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ export const SUMMARY_QUIZ = 'SUMMARY_QUIZ'; //import the action for Summary Quix
export const SUMMARY_ALL = 'SUMMARY_ALL'; //import the action for Summary Quix
export const SUMMARY_LEARN = 'SUMMARY_LEARN'; //import the action for Summary Quix
export const SUMMARY_LOCK = 'SUMMARY_LOCK'; //import the action for Summary Quix
export const SUMMARY_HISTORY = 'SUMMARY_HISTORY'; //import the action for Summary Quix




11 changes: 9 additions & 2 deletions app/reducers/summary.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SUMMARY_HOME , SUMMARY_TEST , SUMMARY_QUIZ , SUMMARY_ALL, SUMMARY_LEARN, SUMMARY_LOCK } from '../lib/constants';
import { SUMMARY_HOME , SUMMARY_TEST , SUMMARY_QUIZ , SUMMARY_ALL, SUMMARY_LEARN, SUMMARY_LOCK , SUMMARY_HISTORY} from '../lib/constants';

const initialState = {
dateFrom:'',
Expand All @@ -7,6 +7,7 @@ const initialState = {
quizData: [],
showLearn : [],
lock : [],
historyData : [],
countSummary: []
};

Expand Down Expand Up @@ -47,7 +48,13 @@ export default function userReducer (state = initialState, action) {
lock: [],
lock : action.data,
});
return state;
return state;
case SUMMARY_HISTORY:
state = Object.assign({}, state, {
historyData: [],
historyData : action.data,
});
return state;
default:
return state;
}
Expand Down
33 changes: 29 additions & 4 deletions app/screens/Study/hiraganaList.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,21 @@ class HiraganaListScreen extends Component {
));

}
navigateHistory = (type) => {
this.props.getHistory(this.state.topicId, this.state.topicId + this.state.categoryId, this.state.topicId + this.state.categoryId );
this.props.navigation.navigate('historyListScreen',(
{
index : this.state.index,
type : type,
title : this.state.title,
categoryId : this.state.categoryId,
studyType: this.state.studyType,
img: this.state.img,
}
));

}


goToReview = (type) => {
this.props.navigation.navigate('reviewScreen',(
Expand Down Expand Up @@ -192,15 +207,21 @@ class HiraganaListScreen extends Component {

<View style={[study.cardBox, study.borderBox, study.p3]}>
<Text style={[study.textLg, study.textBlack]}>{ strings['STUDY_QUIZ'] }</Text>
<View style={study.buttonContainer}>
<TouchableOpacity style={study.button} onPress={this.navigateReview.bind(this, 'QUIZ')}>
<Icon name='search' color='#fff'/>
<Text style={[study.textWhite, study.textMd, study.mR10]} > { strings['STUDY_REVIEW'] }</Text>
</TouchableOpacity>
</View>
<Text style={[study.textLg, study.textCenter, study.textBold, study.textBlack]}>{ scoreQuiz }</Text>
<View style={study.buttonContainer}>
<TouchableOpacity style={[study.button, study.mR10]} onPress={this.navigateToLearn.bind(this, 'Quiz', this.state.topicId)}>
<TouchableOpacity style={[study.button, study.mR10]} onPress={this.navigateToLearn.bind(this, 'Quiz')}>
<Icon name='play-arrow' color='#fff'/>
<Text style={[study.textWhite, study.textMd]} > { strings['STUDY_START'] }</Text>
</TouchableOpacity>
<TouchableOpacity style={study.button} onPress={this.navigateReview.bind(this, 'QUIZ')}>
<Icon name='search' color='#fff'/>
<Text style={[study.textWhite, study.textMd]} > { strings['STUDY_REVIEW'] }</Text>
<TouchableOpacity style={[study.button]} onPress={this.navigateHistory.bind(this, 'QUIZ')}>
<Icon name='history' color='#fff'/>
<Text style={[study.textWhite, study.textMd]} >{ strings['HISTORY'] }</Text>
</TouchableOpacity>
</View>
</View>
Expand All @@ -214,6 +235,10 @@ class HiraganaListScreen extends Component {
<Icon name='play-arrow' color='#fff'/>
<Text style={[study.textWhite, study.textMd]} > { strings['STUDY_START'] }</Text>
</TouchableOpacity>
<TouchableOpacity style={[study.button]} onPress={this.navigateHistory.bind(this, 'TEST')}>
<Icon name='history' color='#fff'/>
<Text style={[study.textWhite, study.textMd]} >{ strings['HISTORY'] }</Text>
</TouchableOpacity>
</View>
</View>
) }
Expand Down
9 changes: 6 additions & 3 deletions app/screens/Study/studyList.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ImageData } from '../../config/image_list';

import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import * as Actions from '../../actions/study'; //Import your actions
import * as Actions from '../../actions/summary'; //Import your actions

import style from 'react-native-datepicker/style';

Expand All @@ -38,6 +38,10 @@ class StudyListScreen extends Component {
lockedMessage=(item, index)=>{
alert(strings[item.topic_id + '_MSG'] );
}

componentWillMount(){
this.props.getLockRecord();
}

navigateToLearn=(item, index)=>{
item['index'] = index;
Expand Down Expand Up @@ -76,7 +80,6 @@ class StudyListScreen extends Component {
}

checkLock = (topic_id) =>{


if(this.props.lock){
if(this.props.lock[topic_id]){
Expand All @@ -89,7 +92,7 @@ class StudyListScreen extends Component {
return false;
}
}else{
return true;
return false;
}
}

Expand Down
Loading

0 comments on commit d6d6c7c

Please sign in to comment.