@nakamura-123/pages 1.3.16 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component/Article/ArticleCategoryList.js +88 -33
- package/dist/component/Article/ArticleContentView.d.ts +1 -0
- package/dist/component/Article/ArticleContentView.js +56 -14
- package/dist/component/Article/ArticleRow.d.ts +3 -2
- package/dist/component/Article/ArticleRow.js +42 -16
- package/dist/component/Basic/BasicProgressBar.js +7 -5
- package/dist/component/Basic/MiniTestCard.js +15 -9
- package/dist/component/Basic/Paw5s.js +2 -1
- package/dist/component/Basic/SubCategoryList.js +13 -18
- package/dist/component/Coin/CoinCheck.js +1 -1
- package/dist/component/Coin/CoinFnc.d.ts +2 -2
- package/dist/component/Coin/CoinFnc.js +13 -11
- package/dist/component/Coin/WaitingPayBanner.js +2 -3
- package/dist/component/Grade/GAllTags.d.ts +3 -0
- package/dist/component/Grade/GAllTags.js +45 -0
- package/dist/component/Grade/GradeCard/ChangeWeeklyModal.js +7 -3
- package/dist/component/Grade/GradeCard/DatePickerModal.js +2 -1
- package/dist/component/Grade/GradeCard/Square3sGrade.js +1 -1
- package/dist/component/Grade/GradeCard/TargetDate.js +1 -1
- package/dist/component/Grade/QuizCntGraph.js +2 -1
- package/dist/component/Grade/Square4s.js +4 -4
- package/dist/component/Grade/UnitCircles.d.ts +4 -2
- package/dist/component/Grade/UnitCircles.js +6 -5
- package/dist/component/Grade/YearCircles.d.ts +4 -2
- package/dist/component/Grade/YearCircles.js +7 -5
- package/dist/component/KeyboardCloseBar.js +2 -1
- package/dist/component/QuizSet/QuizOptionDrill.js +3 -14
- package/dist/component/Result/QuizFlatList.js +161 -57
- package/dist/component/Result/ResultActions.d.ts +7 -0
- package/dist/component/Result/ResultActions.js +107 -0
- package/dist/component/Result/ResultHero.d.ts +7 -0
- package/dist/component/Result/ResultHero.js +166 -0
- package/dist/component/SettingBtns/LanguageModal.d.ts +9 -0
- package/dist/component/SettingBtns/LanguageModal.js +103 -0
- package/dist/component/SettingBtns/TransBtn.js +7 -84
- package/dist/component/Tag5s.js +2 -2
- package/dist/component/TagBadge5s.js +7 -5
- package/dist/component/TestPage/BarChartContainer.js +2 -1
- package/dist/component/TestPage/Square3s.js +3 -2
- package/dist/engine/components.d.ts +19 -0
- package/dist/engine/components.js +19 -0
- package/dist/engine/drill.d.ts +3 -0
- package/dist/engine/drill.js +24 -0
- package/dist/engine/grammar.d.ts +3 -0
- package/dist/engine/grammar.js +22 -0
- package/dist/engine/index.d.ts +5 -0
- package/dist/engine/index.js +17 -0
- package/dist/engine/tango.d.ts +3 -0
- package/dist/engine/tango.js +28 -0
- package/dist/engine/types.d.ts +46 -0
- package/dist/engine/types.js +2 -0
- package/dist/functions/createQuizFncG.d.ts +12 -0
- package/dist/functions/createQuizFncG.js +40 -0
- package/dist/functions/nextItemFnc.d.ts +12 -0
- package/dist/functions/nextItemFnc.js +56 -0
- package/dist/functions/questionFormatD.d.ts +1 -0
- package/dist/functions/questionFormatD.js +14 -13
- package/dist/functions/questionFormatG.d.ts +7 -0
- package/dist/functions/questionFormatG.js +31 -0
- package/dist/functions/retryQuizFnc.d.ts +1 -0
- package/dist/functions/retryQuizFnc.js +13 -0
- package/dist/functions/tagFncG.d.ts +5 -0
- package/dist/functions/tagFncG.js +24 -0
- package/dist/functions/tagFncJ.d.ts +2 -2
- package/dist/functions/tagFncJ.js +1 -1
- package/dist/hooks/BadgeHook.d.ts +1 -1
- package/dist/hooks/BadgeHook.js +3 -3
- package/dist/hooks/ExitQuizHook.js +9 -7
- package/dist/hooks/basicHook.d.ts +9 -1
- package/dist/hooks/basicHook.js +17 -8
- package/dist/hooks/quizActionHook.d.ts +3 -1
- package/dist/hooks/quizActionHook.js +33 -1
- package/dist/hooks/quizHook.d.ts +6 -2
- package/dist/hooks/quizHook.js +39 -4
- package/dist/hooks/resultHook.d.ts +10 -0
- package/dist/hooks/resultHook.js +85 -0
- package/dist/page/ArticleDetail.js +25 -12
- package/dist/page/CoinPage.js +2 -2
- package/dist/page/FAQPage.js +4 -3
- package/dist/page/GetBadgePage.js +5 -4
- package/dist/page/GradePage.js +6 -9
- package/dist/page/HistoryPage.js +7 -4
- package/dist/page/HomePage.js +7 -3
- package/dist/page/QuizPage.js +4 -4
- package/dist/page/QuizSettingPage.js +3 -6
- package/dist/page/QuizSetupPage.js +6 -14
- package/dist/page/ReportPage.js +1 -1
- package/dist/page/ResultPage.js +8 -25
- package/dist/page/SettingPage.js +36 -3
- package/dist/page/TestPage.js +7 -14
- package/dist/quiz/Title.js +5 -2
- package/dist/quiz/check/Check.js +11 -7
- package/dist/quiz/check/NextQuizBtn.js +3 -2
- package/dist/quiz/check/SelectTag.js +7 -0
- package/dist/quiz/common/MyTextqqyy.d.ts +1 -0
- package/dist/quiz/common/MyTextqqyy.js +2 -2
- package/dist/quiz/common/RenderImgOrText.d.ts +2 -0
- package/dist/quiz/common/RenderImgOrText.js +2 -2
- package/dist/quiz/common/RubyText.d.ts +3 -1
- package/dist/quiz/common/RubyText.js +20 -5
- package/dist/quiz/grammar/GAnswer.d.ts +8 -0
- package/dist/quiz/grammar/GAnswer.js +115 -0
- package/dist/quiz/grammar/GGuideBtn.d.ts +8 -0
- package/dist/quiz/grammar/GGuideBtn.js +43 -0
- package/dist/quiz/grammar/GQuestion.d.ts +8 -0
- package/dist/quiz/grammar/GQuestion.js +109 -0
- package/dist/quiz/grammar/QuizContentsGrammar.d.ts +10 -0
- package/dist/quiz/grammar/QuizContentsGrammar.js +31 -0
- package/dist/quiz/jAnswer/JAnswerContents.js +12 -5
- package/dist/quiz/jQuestion/JQuestionBottomText.d.ts +2 -1
- package/dist/quiz/jQuestion/JQuestionBottomText.js +3 -1
- package/dist/quiz/save/QuizSaveData.js +1 -1
- package/dist/quiz/setting/Above3BtnJ.js +5 -4
- package/dist/quiz/setting/Bottom3Btn.js +5 -4
- package/dist/quiz/setting/GuideBtn.js +3 -2
- package/dist/quiz/setting/RepeatBtn.js +2 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/filterType.d.ts +2 -1
- package/package.json +23 -3
|
@@ -1,93 +1,197 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 =
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
7
30
|
const react_native_1 = require("react-native");
|
|
8
31
|
const react_redux_1 = require("react-redux");
|
|
9
32
|
const lib_1 = require("@nakamura-123/lib");
|
|
10
33
|
const common_1 = require("@nakamura-123/common");
|
|
11
34
|
const MyTextqqyy_1 = __importDefault(require("../../quiz/common/MyTextqqyy"));
|
|
12
35
|
const RubyText_1 = __importDefault(require("../../quiz/common/RubyText"));
|
|
36
|
+
const JQuestionBottomText_1 = require("../../quiz/jQuestion/JQuestionBottomText");
|
|
37
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
38
|
+
const resultHook_1 = require("../../hooks/resultHook");
|
|
39
|
+
// 見直す一覧。番号・○×・問題文・訳・今の付箋。「すべて/×だけ」で切り替え、行をタップするとその問題を見直す
|
|
13
40
|
const QuizFlatList = ({ navigation }) => {
|
|
14
41
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
42
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
43
|
+
const [filter, setFilter] = (0, react_1.useState)("all");
|
|
44
|
+
const quizList = (0, resultHook_1.useFrozenOnRetry)((0, react_redux_1.useSelector)((state) => state.quiz.quizList));
|
|
45
|
+
const lang = (0, quizHook_1.useGrammarLang)();
|
|
46
|
+
const grammarTrans = (0, react_redux_1.useSelector)((state) => state.app.grammarTrans[lang]);
|
|
47
|
+
const items = quizList.map((quiz, index) => {
|
|
48
|
+
var _a;
|
|
49
|
+
const base = { index, isCorrected: quiz.isCorrected, tag: quiz.tag };
|
|
50
|
+
if (quiz.system === "grammar")
|
|
51
|
+
return Object.assign(Object.assign({}, base), { system: "grammar", question: quiz.sentence, sub: (_a = grammarTrans === null || grammarTrans === void 0 ? void 0 : grammarTrans[quiz.quizId]) !== null && _a !== void 0 ? _a : null });
|
|
52
|
+
if (quiz.system === "JLPT")
|
|
53
|
+
return Object.assign(Object.assign({}, base), { system: "JLPT", question: quiz.question, sub: (0, JQuestionBottomText_1.getAnswerText)(quiz, quiz.form) || null });
|
|
54
|
+
return Object.assign(Object.assign({}, base), { system: "drill", question: quiz.question[0].replace(/zz/g, " 空欄"), sub: null });
|
|
25
55
|
});
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
const text = item.question.replace(/zz/g, " 空欄");
|
|
29
|
-
const icon = item.isCorrected ? "circle" : "times";
|
|
30
|
-
const iconColor = item.isCorrected ? "red" : "blue";
|
|
31
|
-
return (<react_native_1.TouchableOpacity style={styles.itemContainer} activeOpacity={0.7} onPress={() => handlePress(item.index)}>
|
|
32
|
-
<react_native_1.View>
|
|
33
|
-
<common_1.IconInCircle name="tag" circleColor={item.color} size={11} iconColor="white"/>
|
|
34
|
-
<react_native_1.View style={{ position: "absolute", top: -5, right: -5 }}>
|
|
35
|
-
<common_1.Icon5 name={icon} size={11} color={iconColor}/>
|
|
36
|
-
</react_native_1.View>
|
|
37
|
-
</react_native_1.View>
|
|
38
|
-
<react_native_1.View style={styles.questionBoxJ}>
|
|
39
|
-
{item.system === "JLPT" ? (<RubyText_1.default fsize="sm" isNoWrap>
|
|
40
|
-
{text}
|
|
41
|
-
</RubyText_1.default>) : (<MyTextqqyy_1.default isNotSearch fsize="xs">
|
|
42
|
-
{text}
|
|
43
|
-
</MyTextqqyy_1.default>)}
|
|
44
|
-
</react_native_1.View>
|
|
45
|
-
</react_native_1.TouchableOpacity>);
|
|
46
|
-
};
|
|
47
|
-
// 03_タップ時の処理
|
|
56
|
+
const wrongCnt = items.filter((item) => item.isCorrected !== true).length;
|
|
57
|
+
const shown = filter === "all" ? items : items.filter((item) => item.isCorrected !== true);
|
|
48
58
|
const handlePress = (index) => {
|
|
49
|
-
// タップ時の処理を記述してください
|
|
50
59
|
dispatch({ type: "quiz/jumpToTurn", payload: index });
|
|
51
60
|
dispatch({ type: "quiz/toResult" });
|
|
52
61
|
navigation.navigate("Quiz");
|
|
53
62
|
};
|
|
63
|
+
const renderItem = ({ item }) => {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
return (<react_native_1.TouchableOpacity style={styles.row} activeOpacity={0.7} onPress={() => handlePress(item.index)}>
|
|
66
|
+
<common_1.MyText fsize="xs" color="ltBlack" style={styles.num}>
|
|
67
|
+
{item.index + 1}
|
|
68
|
+
</common_1.MyText>
|
|
69
|
+
<Badge isCorrected={item.isCorrected} system={item.system}/>
|
|
70
|
+
<react_native_1.View style={styles.texts}>
|
|
71
|
+
<QuestionText item={item}/>
|
|
72
|
+
{item.sub && (<common_1.MyText fsize="xs" color="ltBlack" numberOfLines={1}>
|
|
73
|
+
{item.sub}
|
|
74
|
+
</common_1.MyText>)}
|
|
75
|
+
</react_native_1.View>
|
|
76
|
+
<common_1.IconInCircle name="tag" size={10} iconColor="white" circleColor={(_b = (_a = lib_1.tagLevels.find((level) => level.level === item.tag)) === null || _a === void 0 ? void 0 : _a.color) !== null && _b !== void 0 ? _b : "light"} cStyle={styles.tag}/>
|
|
77
|
+
</react_native_1.TouchableOpacity>);
|
|
78
|
+
};
|
|
54
79
|
return (<react_native_1.View style={styles.container}>
|
|
55
|
-
<react_native_1.
|
|
80
|
+
<react_native_1.View style={styles.head}>
|
|
81
|
+
<common_1.MyText fsize="sm" weight={700}>
|
|
82
|
+
{t("quiz.result.review")}
|
|
83
|
+
</common_1.MyText>
|
|
84
|
+
<react_native_1.View style={styles.seg}>
|
|
85
|
+
{["all", "wrong"].map((f) => (<react_native_1.Pressable key={f} onPress={() => setFilter(f)} style={[styles.segItem, filter === f && styles.segOn]}>
|
|
86
|
+
<common_1.MyText fsize="xs" color={filter === f ? "white" : "text"}>
|
|
87
|
+
{f === "all"
|
|
88
|
+
? `${t("quiz.result.all")} ${items.length}`
|
|
89
|
+
: `${t("quiz.result.wrongOnly")} ${wrongCnt}`}
|
|
90
|
+
</common_1.MyText>
|
|
91
|
+
</react_native_1.Pressable>))}
|
|
92
|
+
</react_native_1.View>
|
|
93
|
+
</react_native_1.View>
|
|
94
|
+
<react_native_1.FlatList data={shown} keyExtractor={(item) => String(item.index)} renderItem={renderItem} style={styles.list} showsVerticalScrollIndicator={false} ItemSeparatorComponent={() => <react_native_1.View style={styles.border}/>}/>
|
|
95
|
+
</react_native_1.View>);
|
|
96
|
+
};
|
|
97
|
+
// ○は赤(過去問は丸、JLPT・文法はチェック)、×は青のバツ、答えずに進めた問題は横棒
|
|
98
|
+
const Badge = ({ isCorrected, system }) => {
|
|
99
|
+
const correctIcon = system === "drill" ? "circle" : "check";
|
|
100
|
+
const background = isCorrected === undefined ? lib_1.colors.light : isCorrected ? lib_1.colors.red : lib_1.colors.blue;
|
|
101
|
+
const icon = isCorrected === undefined ? "minus" : isCorrected ? correctIcon : "times";
|
|
102
|
+
return (<react_native_1.View style={[styles.badge, { backgroundColor: background }]}>
|
|
103
|
+
<common_1.Icon5 name={icon} size={11} color="white"/>
|
|
56
104
|
</react_native_1.View>);
|
|
57
105
|
};
|
|
106
|
+
// 文法は例文をふりがなを外して2行まで出し、文法の部分(udl[ ])に下線を引く
|
|
107
|
+
const QuestionText = ({ item }) => {
|
|
108
|
+
if (item.system === "grammar") {
|
|
109
|
+
const parts = lib_1.utilFnc.parseRubyText(item.question);
|
|
110
|
+
return (<common_1.MyText fsize="sm" numberOfLines={2}>
|
|
111
|
+
{parts.map((part, i) => (<react_native_1.Text key={i} style={part.udl ? styles.udl : undefined}>
|
|
112
|
+
{part.base}
|
|
113
|
+
</react_native_1.Text>))}
|
|
114
|
+
</common_1.MyText>);
|
|
115
|
+
}
|
|
116
|
+
if (item.system === "JLPT")
|
|
117
|
+
return (<RubyText_1.default fsize="sm" isNoWrap>
|
|
118
|
+
{item.question}
|
|
119
|
+
</RubyText_1.default>);
|
|
120
|
+
return (<MyTextqqyy_1.default isNotSearch fsize="xs" numberOfLines={2} style={styles.drillText}>
|
|
121
|
+
{item.question}
|
|
122
|
+
</MyTextqqyy_1.default>);
|
|
123
|
+
};
|
|
58
124
|
const styles = react_native_1.StyleSheet.create({
|
|
59
125
|
container: {
|
|
60
126
|
flex: 1,
|
|
61
|
-
backgroundColor: lib_1.colors.beige,
|
|
62
|
-
borderRadius: 10,
|
|
63
|
-
marginTop: 10,
|
|
64
|
-
},
|
|
65
|
-
listContent: {
|
|
66
|
-
padding: 16,
|
|
67
127
|
width: "100%",
|
|
128
|
+
},
|
|
129
|
+
head: {
|
|
130
|
+
flexDirection: "row",
|
|
131
|
+
justifyContent: "space-between",
|
|
132
|
+
alignItems: "center",
|
|
133
|
+
marginTop: 14,
|
|
134
|
+
marginBottom: 6,
|
|
135
|
+
marginHorizontal: 2,
|
|
136
|
+
},
|
|
137
|
+
seg: {
|
|
138
|
+
flexDirection: "row",
|
|
68
139
|
backgroundColor: lib_1.colors.bkBeige,
|
|
69
|
-
|
|
140
|
+
borderRadius: 8,
|
|
141
|
+
padding: 2,
|
|
142
|
+
},
|
|
143
|
+
segItem: {
|
|
144
|
+
paddingHorizontal: 9,
|
|
145
|
+
paddingVertical: 2,
|
|
146
|
+
borderRadius: 6,
|
|
147
|
+
},
|
|
148
|
+
segOn: {
|
|
149
|
+
backgroundColor: lib_1.colors.text,
|
|
70
150
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
151
|
+
list: {
|
|
152
|
+
backgroundColor: lib_1.colors.bkBeige,
|
|
153
|
+
borderRadius: 12,
|
|
154
|
+
marginBottom: 14,
|
|
155
|
+
},
|
|
156
|
+
row: {
|
|
157
|
+
flexDirection: "row",
|
|
74
158
|
alignItems: "center",
|
|
75
|
-
|
|
76
|
-
|
|
159
|
+
paddingVertical: 9,
|
|
160
|
+
paddingLeft: 6,
|
|
161
|
+
paddingRight: 10,
|
|
77
162
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
163
|
+
num: {
|
|
164
|
+
width: 20,
|
|
165
|
+
textAlign: "center",
|
|
166
|
+
marginRight: 2,
|
|
167
|
+
},
|
|
168
|
+
tag: {
|
|
169
|
+
width: 22,
|
|
170
|
+
height: 22,
|
|
171
|
+
},
|
|
172
|
+
border: {
|
|
173
|
+
height: 1,
|
|
174
|
+
backgroundColor: lib_1.colors.beige,
|
|
175
|
+
},
|
|
176
|
+
badge: {
|
|
177
|
+
width: 26,
|
|
178
|
+
height: 26,
|
|
179
|
+
borderRadius: 13,
|
|
180
|
+
alignItems: "center",
|
|
82
181
|
justifyContent: "center",
|
|
182
|
+
marginRight: 10,
|
|
183
|
+
},
|
|
184
|
+
texts: {
|
|
185
|
+
flex: 1,
|
|
186
|
+
minWidth: 0,
|
|
187
|
+
marginRight: 6,
|
|
83
188
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
height: "100%",
|
|
189
|
+
udl: {
|
|
190
|
+
textDecorationLine: "underline",
|
|
191
|
+
textDecorationColor: lib_1.colors.green,
|
|
88
192
|
},
|
|
89
|
-
|
|
90
|
-
|
|
193
|
+
drillText: {
|
|
194
|
+
margin: 0,
|
|
91
195
|
},
|
|
92
196
|
});
|
|
93
197
|
exports.default = QuizFlatList;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const common_1 = require("@nakamura-123/common");
|
|
9
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
10
|
+
const resultHook_1 = require("../../hooks/resultHook");
|
|
11
|
+
// 大きいボタンは「×の問題だけ解く」と「次へ」(次の項目があるときだけ)。全問○なら左は「全問やり直す」になる。
|
|
12
|
+
// 下の薄い段に「全問やり直す」(×があるとき)と「成績を見る」。戻るは画面左上にあるので置かない
|
|
13
|
+
const ResultActions = ({ navigation }) => {
|
|
14
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
15
|
+
const wrongCnt = (0, resultHook_1.useFrozenOnRetry)((0, resultHook_1.useWrongCount)());
|
|
16
|
+
const retry = (0, resultHook_1.useRetryQuizAction)(navigation);
|
|
17
|
+
const next = (0, resultHook_1.useNextInResult)(navigation);
|
|
18
|
+
return (<react_native_1.View style={styles.container}>
|
|
19
|
+
<react_native_1.View style={styles.acts}>
|
|
20
|
+
<common_1.PressAnimatedWrap onPress={() => retry(wrongCnt > 0)} outerStyle={styles.actOuter} style={[styles.act, styles.ghost]}>
|
|
21
|
+
<common_1.Icon5 name="redo" size={13} color="text" style={styles.icon}/>
|
|
22
|
+
<common_1.MyText fsize="sm" weight={700}>
|
|
23
|
+
{wrongCnt > 0
|
|
24
|
+
? t("quiz.result.retryWrong", { cnt: wrongCnt })
|
|
25
|
+
: t("quiz.result.retryAll")}
|
|
26
|
+
</common_1.MyText>
|
|
27
|
+
</common_1.PressAnimatedWrap>
|
|
28
|
+
{next && (<common_1.PressAnimatedWrap onPress={next.go} outerStyle={styles.actOuter} style={[styles.act, styles.fill]}>
|
|
29
|
+
<common_1.MyText fsize="sm" weight={700} color="white">
|
|
30
|
+
{t(next.kind === "article"
|
|
31
|
+
? "quiz.result.nextLesson"
|
|
32
|
+
: "quiz.result.nextQuiz")}
|
|
33
|
+
</common_1.MyText>
|
|
34
|
+
<common_1.Icon5 name="arrow-right" size={13} color="white" style={styles.iconRight}/>
|
|
35
|
+
</common_1.PressAnimatedWrap>)}
|
|
36
|
+
</react_native_1.View>
|
|
37
|
+
<react_native_1.View style={styles.subacts}>
|
|
38
|
+
{wrongCnt > 0 && (<>
|
|
39
|
+
<react_native_1.Pressable style={styles.sub} onPress={() => retry(false)}>
|
|
40
|
+
<common_1.Icon5 name="redo" size={11} color="ltBlack" style={styles.icon}/>
|
|
41
|
+
<common_1.MyText fsize="xs" color="ltBlack">
|
|
42
|
+
{t("quiz.result.retryAll")}
|
|
43
|
+
</common_1.MyText>
|
|
44
|
+
</react_native_1.Pressable>
|
|
45
|
+
<react_native_1.View style={styles.sep}/>
|
|
46
|
+
</>)}
|
|
47
|
+
<react_native_1.Pressable style={styles.sub} onPress={() => navigation.navigate("Grade")}>
|
|
48
|
+
<common_1.Icon5 name="chart-line" size={11} color="ltBlack" style={styles.icon}/>
|
|
49
|
+
<common_1.MyText fsize="xs" color="ltBlack">
|
|
50
|
+
{t("quiz.result.seeGrade")}
|
|
51
|
+
</common_1.MyText>
|
|
52
|
+
</react_native_1.Pressable>
|
|
53
|
+
</react_native_1.View>
|
|
54
|
+
</react_native_1.View>);
|
|
55
|
+
};
|
|
56
|
+
const styles = react_native_1.StyleSheet.create({
|
|
57
|
+
container: {
|
|
58
|
+
width: "100%",
|
|
59
|
+
},
|
|
60
|
+
acts: {
|
|
61
|
+
flexDirection: "row",
|
|
62
|
+
gap: 8,
|
|
63
|
+
marginTop: 10,
|
|
64
|
+
},
|
|
65
|
+
actOuter: {
|
|
66
|
+
flex: 1,
|
|
67
|
+
},
|
|
68
|
+
act: {
|
|
69
|
+
height: 40,
|
|
70
|
+
borderRadius: 10,
|
|
71
|
+
flexDirection: "row",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
justifyContent: "center",
|
|
74
|
+
},
|
|
75
|
+
ghost: {
|
|
76
|
+
backgroundColor: lib_1.colors.bkBeige,
|
|
77
|
+
borderWidth: 1.5,
|
|
78
|
+
borderColor: lib_1.colors.blue,
|
|
79
|
+
},
|
|
80
|
+
fill: {
|
|
81
|
+
backgroundColor: lib_1.colors.green,
|
|
82
|
+
},
|
|
83
|
+
icon: {
|
|
84
|
+
marginRight: 6,
|
|
85
|
+
},
|
|
86
|
+
iconRight: {
|
|
87
|
+
marginLeft: 6,
|
|
88
|
+
},
|
|
89
|
+
subacts: {
|
|
90
|
+
flexDirection: "row",
|
|
91
|
+
justifyContent: "center",
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
paddingTop: 9,
|
|
94
|
+
},
|
|
95
|
+
sub: {
|
|
96
|
+
flexDirection: "row",
|
|
97
|
+
alignItems: "center",
|
|
98
|
+
paddingHorizontal: 7,
|
|
99
|
+
},
|
|
100
|
+
sep: {
|
|
101
|
+
width: 1,
|
|
102
|
+
height: 12,
|
|
103
|
+
backgroundColor: lib_1.colors.ltBlack,
|
|
104
|
+
opacity: 0.5,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
exports.default = ResultActions;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const react_redux_1 = require("react-redux");
|
|
9
|
+
const common_1 = require("@nakamura-123/common");
|
|
10
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
11
|
+
// 結果画面の上のカード。キャラ・言葉・点数・はんこを1枚にまとめる(試作 lesson_flow.html の「はんこ」案)。
|
|
12
|
+
// はんこは画像を使わず、枠・内側の細い輪・回転で描く。色は点数の段階の色
|
|
13
|
+
const ResultHero = ({ scoreInfo }) => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
16
|
+
const pawIcon = (0, common_1.usePawIcon)();
|
|
17
|
+
const imgs = (0, react_redux_1.useSelector)((state) => state.app.imgs);
|
|
18
|
+
const showCharactor = (0, react_redux_1.useSelector)((state) => { var _a, _b; return (_b = (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.showCharactor) !== null && _b !== void 0 ? _b : false; });
|
|
19
|
+
const selected = (0, react_redux_1.useSelector)((state) => state.quiz.selected);
|
|
20
|
+
const isShuffle = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.option.isShuffle);
|
|
21
|
+
const first = (0, react_redux_1.useSelector)((state) => state.quiz.quizList[0]);
|
|
22
|
+
const isMeaning = (first === null || first === void 0 ? void 0 : first.system) === "grammar" && first.form === "meaning";
|
|
23
|
+
const { score, quizCnt, percent } = scoreInfo;
|
|
24
|
+
const level = (_a = lib_1.scoreLevels.find((L) => percent <= L.maxPercent)) !== null && _a !== void 0 ? _a : lib_1.scoreLevels[2];
|
|
25
|
+
const color = lib_1.colors[level.color];
|
|
26
|
+
// ミニテストの題名には「ミニテスト」が入っているので形式を足さない
|
|
27
|
+
const kind = selected.type === "miniTest"
|
|
28
|
+
? null
|
|
29
|
+
: isMeaning
|
|
30
|
+
? t("quiz.result.meaning")
|
|
31
|
+
: t(isShuffle ? "quiz.result.random" : "quiz.result.ordered");
|
|
32
|
+
return (<react_native_1.View style={styles.card}>
|
|
33
|
+
<react_native_1.View style={styles.chip}>
|
|
34
|
+
<common_1.MyText fsize="xs" color="gray" numberOfLines={1}>
|
|
35
|
+
{kind ? `${selected.lesson.title}・${kind}` : selected.lesson.title}
|
|
36
|
+
</common_1.MyText>
|
|
37
|
+
</react_native_1.View>
|
|
38
|
+
<react_native_1.View style={styles.row}>
|
|
39
|
+
{showCharactor && (<react_native_1.View style={styles.charaBox}>
|
|
40
|
+
<react_native_1.View style={[styles.blob, { backgroundColor: color }]}/>
|
|
41
|
+
<react_native_1.Image style={styles.chara} source={(_b = imgs.chara) === null || _b === void 0 ? void 0 : _b[level.level]}/>
|
|
42
|
+
</react_native_1.View>)}
|
|
43
|
+
<react_native_1.View style={styles.texts}>
|
|
44
|
+
<common_1.MyText style={styles.enTitle}>{level.enTitle}</common_1.MyText>
|
|
45
|
+
<common_1.MyText fsize="xs" color="gray">
|
|
46
|
+
{t(`quiz.result.level.${level.level}`)}
|
|
47
|
+
</common_1.MyText>
|
|
48
|
+
<react_native_1.View style={styles.scoreRow}>
|
|
49
|
+
<react_native_1.View>
|
|
50
|
+
<common_1.MyText fsize="xs" color="ltBlack">
|
|
51
|
+
{t(isMeaning ? "quiz.result.understood" : "quiz.result.correctCnt")}
|
|
52
|
+
</common_1.MyText>
|
|
53
|
+
<react_native_1.View style={styles.num}>
|
|
54
|
+
<common_1.MyText weight={700} style={styles.score}>
|
|
55
|
+
{score}
|
|
56
|
+
</common_1.MyText>
|
|
57
|
+
<common_1.MyText color="gray" style={styles.cnt}>
|
|
58
|
+
/{quizCnt}
|
|
59
|
+
</common_1.MyText>
|
|
60
|
+
</react_native_1.View>
|
|
61
|
+
</react_native_1.View>
|
|
62
|
+
<react_native_1.View style={[styles.hanko, { borderColor: color }]}>
|
|
63
|
+
<react_native_1.View style={[styles.hankoInner, { borderColor: color }]}/>
|
|
64
|
+
<common_1.Icon5 name={pawIcon} size={16} color={level.color}/>
|
|
65
|
+
<common_1.MyText weight={700} style={[styles.hankoText, { color }]}>
|
|
66
|
+
{percent}%
|
|
67
|
+
</common_1.MyText>
|
|
68
|
+
</react_native_1.View>
|
|
69
|
+
</react_native_1.View>
|
|
70
|
+
</react_native_1.View>
|
|
71
|
+
</react_native_1.View>
|
|
72
|
+
</react_native_1.View>);
|
|
73
|
+
};
|
|
74
|
+
const styles = react_native_1.StyleSheet.create({
|
|
75
|
+
card: {
|
|
76
|
+
width: "100%",
|
|
77
|
+
marginTop: 50,
|
|
78
|
+
backgroundColor: lib_1.colors.bkBeige,
|
|
79
|
+
borderRadius: 18,
|
|
80
|
+
paddingVertical: 12,
|
|
81
|
+
paddingHorizontal: 14,
|
|
82
|
+
overflow: "hidden",
|
|
83
|
+
},
|
|
84
|
+
chip: {
|
|
85
|
+
alignSelf: "flex-start",
|
|
86
|
+
maxWidth: "100%",
|
|
87
|
+
backgroundColor: lib_1.colors.beige,
|
|
88
|
+
borderRadius: 10,
|
|
89
|
+
paddingHorizontal: 9,
|
|
90
|
+
paddingVertical: 1,
|
|
91
|
+
},
|
|
92
|
+
row: {
|
|
93
|
+
flexDirection: "row",
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
marginTop: 2,
|
|
96
|
+
},
|
|
97
|
+
charaBox: {
|
|
98
|
+
width: 100,
|
|
99
|
+
height: 100,
|
|
100
|
+
marginRight: 10,
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
justifyContent: "center",
|
|
103
|
+
},
|
|
104
|
+
// キャラの後ろの丸は真ん中(2026-10-03に利用者が決めた)
|
|
105
|
+
blob: {
|
|
106
|
+
position: "absolute",
|
|
107
|
+
width: 106,
|
|
108
|
+
height: 106,
|
|
109
|
+
borderRadius: 53,
|
|
110
|
+
opacity: 0.22,
|
|
111
|
+
},
|
|
112
|
+
chara: {
|
|
113
|
+
width: 100,
|
|
114
|
+
height: 100,
|
|
115
|
+
resizeMode: "contain",
|
|
116
|
+
},
|
|
117
|
+
texts: {
|
|
118
|
+
flex: 1,
|
|
119
|
+
},
|
|
120
|
+
enTitle: {
|
|
121
|
+
fontSize: 21,
|
|
122
|
+
lineHeight: 26,
|
|
123
|
+
},
|
|
124
|
+
scoreRow: {
|
|
125
|
+
flexDirection: "row",
|
|
126
|
+
alignItems: "center",
|
|
127
|
+
marginTop: 4,
|
|
128
|
+
},
|
|
129
|
+
num: {
|
|
130
|
+
flexDirection: "row",
|
|
131
|
+
alignItems: "baseline",
|
|
132
|
+
},
|
|
133
|
+
score: {
|
|
134
|
+
fontSize: 36,
|
|
135
|
+
lineHeight: 40,
|
|
136
|
+
},
|
|
137
|
+
cnt: {
|
|
138
|
+
fontSize: 15,
|
|
139
|
+
marginLeft: 3,
|
|
140
|
+
},
|
|
141
|
+
hanko: {
|
|
142
|
+
marginLeft: "auto",
|
|
143
|
+
width: 54,
|
|
144
|
+
height: 54,
|
|
145
|
+
borderRadius: 27,
|
|
146
|
+
borderWidth: 3,
|
|
147
|
+
alignItems: "center",
|
|
148
|
+
justifyContent: "center",
|
|
149
|
+
backgroundColor: "rgba(255,255,255,0.35)",
|
|
150
|
+
transform: [{ rotate: "-14deg" }],
|
|
151
|
+
},
|
|
152
|
+
hankoInner: {
|
|
153
|
+
position: "absolute",
|
|
154
|
+
top: 2,
|
|
155
|
+
left: 2,
|
|
156
|
+
right: 2,
|
|
157
|
+
bottom: 2,
|
|
158
|
+
borderRadius: 22,
|
|
159
|
+
borderWidth: 1.5,
|
|
160
|
+
},
|
|
161
|
+
hankoText: {
|
|
162
|
+
fontSize: 11,
|
|
163
|
+
lineHeight: 13,
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
exports.default = ResultHero;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Store } from "@nakamura-123/types";
|
|
3
|
+
export declare const LANGUAGE_NAMES: Record<Store.Language, string>;
|
|
4
|
+
type LanguageModalProps = {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare const LanguageModal: React.FC<LanguageModalProps>;
|
|
9
|
+
export default LanguageModal;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LANGUAGE_NAMES = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const react_redux_1 = require("react-redux");
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
12
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
13
|
+
// 選ぶ人が読めるよう、それぞれの言語で書く
|
|
14
|
+
exports.LANGUAGE_NAMES = {
|
|
15
|
+
en: "English",
|
|
16
|
+
ja: "日本語",
|
|
17
|
+
ko: "한국어",
|
|
18
|
+
zhHans: "简体中文",
|
|
19
|
+
zhHant: "繁體中文",
|
|
20
|
+
};
|
|
21
|
+
// 言語を選ぶ画面。ホームの言語ボタンと設定画面から開く
|
|
22
|
+
const LanguageModal = ({ visible, onClose }) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
25
|
+
const { i18n } = (0, common_1.useDrillTranslation)();
|
|
26
|
+
const languages = (_a = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.languages)) !== null && _a !== void 0 ? _a : ["en", "ja"];
|
|
27
|
+
const current = (0, react_redux_1.useSelector)((state) => state.setting.language);
|
|
28
|
+
const handleLanguageSelect = (language) => {
|
|
29
|
+
i18n === null || i18n === void 0 ? void 0 : i18n.changeLanguage(language); // 言語を切り替える
|
|
30
|
+
dispatch({ type: "setting/setLanguage", payload: language });
|
|
31
|
+
dispatch(stores_1.settingStorage.saveSetting());
|
|
32
|
+
onClose();
|
|
33
|
+
};
|
|
34
|
+
return (<react_native_1.Modal transparent={true} visible={visible} animationType="slide" onRequestClose={onClose}>
|
|
35
|
+
<react_native_1.View style={styles.modalContainer}>
|
|
36
|
+
<react_native_1.View style={styles.modalContent}>
|
|
37
|
+
<react_native_1.Text style={styles.modalTitle}>Select Language</react_native_1.Text>
|
|
38
|
+
{languages.map((language) => (<react_native_1.TouchableOpacity key={language} style={[
|
|
39
|
+
styles.modalButton,
|
|
40
|
+
language === current && styles.modalButtonCurrent,
|
|
41
|
+
]} onPress={() => handleLanguageSelect(language)}>
|
|
42
|
+
<react_native_1.Text style={styles.modalButtonText}>
|
|
43
|
+
{exports.LANGUAGE_NAMES[language]}
|
|
44
|
+
</react_native_1.Text>
|
|
45
|
+
</react_native_1.TouchableOpacity>))}
|
|
46
|
+
<react_native_1.TouchableOpacity style={styles.modalCloseButton} onPress={onClose}>
|
|
47
|
+
<react_native_1.Text style={styles.modalCloseButtonText}>Close</react_native_1.Text>
|
|
48
|
+
</react_native_1.TouchableOpacity>
|
|
49
|
+
</react_native_1.View>
|
|
50
|
+
</react_native_1.View>
|
|
51
|
+
</react_native_1.Modal>);
|
|
52
|
+
};
|
|
53
|
+
const styles = react_native_1.StyleSheet.create({
|
|
54
|
+
modalContainer: {
|
|
55
|
+
flex: 1,
|
|
56
|
+
justifyContent: "center",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
59
|
+
},
|
|
60
|
+
modalContent: {
|
|
61
|
+
width: 300,
|
|
62
|
+
padding: 20,
|
|
63
|
+
backgroundColor: "#fff",
|
|
64
|
+
borderRadius: 10,
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
},
|
|
67
|
+
modalTitle: {
|
|
68
|
+
fontSize: 18,
|
|
69
|
+
fontWeight: "bold",
|
|
70
|
+
marginBottom: 20,
|
|
71
|
+
},
|
|
72
|
+
modalButton: {
|
|
73
|
+
padding: 10,
|
|
74
|
+
backgroundColor: lib_1.colors.light,
|
|
75
|
+
borderRadius: 5,
|
|
76
|
+
marginVertical: 5,
|
|
77
|
+
width: "100%",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
// 選択中の枠で大きさが変わらないよう、ふだんも透明な枠を持つ
|
|
80
|
+
borderWidth: 2,
|
|
81
|
+
borderColor: "transparent",
|
|
82
|
+
},
|
|
83
|
+
modalButtonCurrent: {
|
|
84
|
+
borderColor: lib_1.colors.darkGray,
|
|
85
|
+
},
|
|
86
|
+
modalButtonText: {
|
|
87
|
+
color: "#000",
|
|
88
|
+
fontSize: 16,
|
|
89
|
+
},
|
|
90
|
+
modalCloseButton: {
|
|
91
|
+
marginTop: 10,
|
|
92
|
+
padding: 10,
|
|
93
|
+
backgroundColor: "#ccc",
|
|
94
|
+
borderRadius: 5,
|
|
95
|
+
width: "100%",
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
},
|
|
98
|
+
modalCloseButtonText: {
|
|
99
|
+
color: "#000",
|
|
100
|
+
fontSize: 16,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
exports.default = LanguageModal;
|