@nakamura-123/pages 1.1.17 → 1.1.23
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/Basic/Badge5s.js +18 -30
- package/dist/component/Basic/BasicContents.js +38 -39
- package/dist/component/Basic/BasicProgressBar.js +16 -17
- package/dist/component/Basic/BasicSetting.js +14 -15
- package/dist/component/Basic/MiniTestCard.js +32 -33
- package/dist/component/Basic/Paw5s.js +9 -13
- package/dist/component/Basic/SelectedExamCnt.js +14 -15
- package/dist/component/Basic/SubCategoryLeft.js +5 -6
- package/dist/component/Basic/SubCategoryList.js +49 -62
- package/dist/component/Boot/SelectRange.js +18 -21
- package/dist/component/Boot/ToggleRange.js +11 -14
- package/dist/component/Coin/AppReviews.js +9 -10
- package/dist/component/Coin/CatchCopy.js +6 -6
- package/dist/component/Coin/CoinCheck.js +18 -54
- package/dist/component/Coin/CoinFnc.js +210 -282
- package/dist/component/Coin/CoinPageComponent.d.ts +1 -0
- package/dist/component/Coin/CoinPageComponent.js +22 -22
- package/dist/component/Coin/ReceiptFnc.js +3 -3
- package/dist/component/Coin/Recommend.js +10 -10
- package/dist/component/Coin/WaitingPayBanner.js +8 -9
- package/dist/component/Discription.js +6 -7
- package/dist/component/Grade/AllTags.js +12 -12
- package/dist/component/Grade/BasicBadge.js +20 -32
- package/dist/component/Grade/GradeCard/ChangeWeeklyModal.js +8 -10
- package/dist/component/Grade/GradeCard/ChangeWeeklyTargetBtn.js +21 -22
- package/dist/component/Grade/GradeCard/DatePickerModal.js +17 -19
- package/dist/component/Grade/GradeCard/GradeCard.js +19 -20
- package/dist/component/Grade/GradeCard/Square3sGrade.js +16 -17
- package/dist/component/Grade/GradeCard/TargetDate.js +19 -20
- package/dist/component/Grade/GradeCard/WeeklyAchivedRate.js +7 -8
- package/dist/component/Grade/GradeCard/WeeklyProgress.js +19 -29
- package/dist/component/Grade/JAllTags.js +16 -16
- package/dist/component/Grade/QuizCntGraph.js +31 -45
- package/dist/component/Grade/ShareBtn.js +30 -68
- package/dist/component/Grade/Square4s.js +14 -15
- package/dist/component/Grade/UnitCircles.js +18 -23
- package/dist/component/Grade/YearCircles.js +17 -22
- package/dist/component/Guide.js +6 -7
- package/dist/component/Home/OpeningMsg.js +14 -14
- package/dist/component/OnlineInput/OnlineInputFnc.js +6 -6
- package/dist/component/OnlineInput/OnlineSaveBtn.js +7 -8
- package/dist/component/OnlineInput/OnlineSavedList.js +13 -14
- package/dist/component/OnlineInput/PasswardModal.js +64 -110
- package/dist/component/OnlineInput/PasswordIdModal.js +40 -80
- package/dist/component/QuizSet/QuizOptionDrill.js +29 -42
- package/dist/component/Result/AdCard.js +21 -16
- package/dist/component/Result/CharaCard.js +15 -16
- package/dist/component/Result/LessonTitle.js +10 -10
- package/dist/component/Result/QuizFlatList.js +26 -30
- package/dist/component/Result/ScoreCircle.js +8 -9
- package/dist/component/SelectRange/SelectYearRange.js +22 -34
- package/dist/component/SettingBtns/QuizOptionSelector.js +16 -17
- package/dist/component/SettingBtns/Range.js +9 -9
- package/dist/component/SettingBtns/TransBtn.js +17 -17
- package/dist/component/TabAnimeView.js +9 -10
- package/dist/component/Tag5s.js +10 -14
- package/dist/component/TagBadge5s.js +16 -17
- package/dist/component/TagBadge5sPress.js +14 -15
- package/dist/component/TestPage/AverageBar.js +12 -24
- package/dist/component/TestPage/BarChartContainer.js +30 -31
- package/dist/component/TestPage/ChartControl.js +5 -6
- package/dist/component/TestPage/Square3s.js +12 -13
- package/dist/functions/badgeBasicFnc.js +22 -42
- package/dist/functions/badgeDailyFnc.js +24 -35
- package/dist/functions/badgeFilter.js +16 -18
- package/dist/functions/badgeFnc.js +24 -33
- package/dist/functions/createQuizFncD.js +33 -33
- package/dist/functions/createQuizFncJ.js +27 -33
- package/dist/functions/gradeFnc.js +48 -87
- package/dist/functions/oldStorageFnc.js +77 -200
- package/dist/functions/questionFilterD.js +19 -28
- package/dist/functions/questionFilterJ.js +9 -9
- package/dist/functions/questionFormatD.js +34 -47
- package/dist/functions/questionFormatJ.js +30 -41
- package/dist/functions/tagFncD.js +37 -39
- package/dist/functions/tagFncJ.js +16 -19
- package/dist/functions/testFnc.js +6 -7
- package/dist/hooks/BadgeHook.js +24 -35
- package/dist/hooks/ExitQuizHook.js +21 -21
- package/dist/hooks/basicHook.js +12 -12
- package/dist/hooks/quizActionHook.js +44 -57
- package/dist/hooks/quizHook.d.ts +2 -1
- package/dist/hooks/quizHook.js +58 -48
- package/dist/index.js +25 -25
- package/dist/page/BadgePage.js +26 -29
- package/dist/page/BasicPage.js +23 -25
- package/dist/page/BootPage.js +48 -53
- package/dist/page/CoinPage.d.ts +1 -0
- package/dist/page/CoinPage.js +90 -144
- package/dist/page/FAQPage.js +23 -23
- package/dist/page/GetBadgePage.js +35 -71
- package/dist/page/GradePage.js +26 -27
- package/dist/page/GuidePage.js +28 -33
- package/dist/page/HistoryPage.js +25 -33
- package/dist/page/HomePage.d.ts +1 -0
- package/dist/page/HomePage.js +62 -108
- package/dist/page/ImgZoom.js +8 -9
- package/dist/page/InformationPage.js +15 -15
- package/dist/page/JDetailSettingPage.js +23 -25
- package/dist/page/OnlineInputPage.js +19 -20
- package/dist/page/QuizPage.js +25 -26
- package/dist/page/QuizSettingPage.js +19 -19
- package/dist/page/QuizSetupPage.js +40 -43
- package/dist/page/ReportPage.js +55 -94
- package/dist/page/ResultPage.js +55 -103
- package/dist/page/SettingPage.js +35 -40
- package/dist/page/TestPage.js +41 -44
- package/dist/quiz/QuizContentsDrill.js +17 -18
- package/dist/quiz/QuizContentsJLPT.js +8 -9
- package/dist/quiz/Title.js +22 -22
- package/dist/quiz/answer/Answer.js +20 -20
- package/dist/quiz/answer/BlangGuide.js +10 -10
- package/dist/quiz/answer/BlankAnswer.js +11 -12
- package/dist/quiz/answer/BlankBtn.js +10 -10
- package/dist/quiz/answer/CheckButton.js +6 -9
- package/dist/quiz/answer/ChoiceView.js +15 -30
- package/dist/quiz/answer/Input/CollapseExplain.js +10 -11
- package/dist/quiz/answer/Input/InputAnswerBtn.js +9 -9
- package/dist/quiz/answer/Input/InputBox.js +17 -18
- package/dist/quiz/answer/Input/InputCounter.js +6 -7
- package/dist/quiz/answer/Input/InputFnc.js +10 -19
- package/dist/quiz/answer/Input/InputSaveSelector.js +12 -13
- package/dist/quiz/answer/Input/InputTab.js +12 -13
- package/dist/quiz/answer/Input/InputWarnning.js +13 -14
- package/dist/quiz/answer/InputGuide.js +10 -10
- package/dist/quiz/answer/InputNav.js +38 -39
- package/dist/quiz/answer/MultiChoice.js +20 -22
- package/dist/quiz/answer/MultiGuide.js +10 -10
- package/dist/quiz/answer/MultiNextBtn.js +13 -14
- package/dist/quiz/answer/NormalChoice.js +29 -42
- package/dist/quiz/answer/NormalMultiGuide.js +11 -12
- package/dist/quiz/answer/styles/getChoiceStyle.js +4 -4
- package/dist/quiz/check/Check.js +17 -18
- package/dist/quiz/check/NextQuizBtn.js +18 -19
- package/dist/quiz/check/SelectTag.js +36 -51
- package/dist/quiz/common/MyTextqqyy.js +29 -47
- package/dist/quiz/common/PageContainerWrap.js +14 -15
- package/dist/quiz/common/RenderImgOrText.js +17 -18
- package/dist/quiz/common/RubyText.js +21 -35
- package/dist/quiz/common/ZoomableImage.js +6 -9
- package/dist/quiz/explain/CorrectedBar.js +13 -14
- package/dist/quiz/explain/Explain.js +9 -10
- package/dist/quiz/explain/ExplainLogic.js +17 -23
- package/dist/quiz/explain/MovieBtn.js +10 -11
- package/dist/quiz/explain/MultiExplain.js +12 -24
- package/dist/quiz/explain/NormalExplain.js +29 -30
- package/dist/quiz/function/choiceFnc.js +2 -2
- package/dist/quiz/jAnswer/JAnswer.js +24 -26
- package/dist/quiz/jAnswer/JAnswerContents.js +12 -27
- package/dist/quiz/jQuestion/JQuestion.js +12 -13
- package/dist/quiz/jQuestion/JQuestionBottomText.js +14 -15
- package/dist/quiz/jQuestion/JQuestionText.js +13 -14
- package/dist/quiz/jQuestion/QuizCnt.js +9 -9
- package/dist/quiz/jQuestion/TimeLimit.js +23 -25
- package/dist/quiz/question/FillDiagram.js +12 -13
- package/dist/quiz/question/Question.js +25 -26
- package/dist/quiz/question/QuestionFormats.js +29 -45
- package/dist/quiz/question/QuestionReference.js +7 -7
- package/dist/quiz/question/SearchYoutue.js +10 -11
- package/dist/quiz/save/QuizSaveData.js +18 -19
- package/dist/quiz/setting/Above3BtnJ.js +25 -30
- package/dist/quiz/setting/Bottom3Btn.js +25 -30
- package/dist/quiz/setting/GuideBtn.js +19 -22
- package/dist/quiz/setting/RepeatBtn.js +27 -34
- package/dist/quiz/setting/ReturnBtn.js +8 -20
- package/dist/quiz/setting/ReturnSaveBtn.js +21 -33
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,44 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var multiSel = question.multiSel, selectedIndexes = question.selectedIndexes;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const MyTextqqyy_1 = __importDefault(require("../common/MyTextqqyy"));
|
|
9
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
10
|
+
const MultiExplain = ({ question }) => {
|
|
11
|
+
const { multiSel, selectedIndexes } = question;
|
|
24
12
|
return (<react_native_1.View style={styles.container}>
|
|
25
|
-
{multiSel.map(
|
|
26
|
-
{choices.map(
|
|
27
|
-
|
|
13
|
+
{multiSel.map((choices, index) => (<react_native_1.View key={index} style={styles.sectionBox}>
|
|
14
|
+
{choices.map((choice, i) => {
|
|
15
|
+
const color = choice.isCorrect
|
|
28
16
|
? "red"
|
|
29
17
|
: selectedIndexes[index] === i
|
|
30
18
|
? "blue"
|
|
31
19
|
: "ltBeige";
|
|
32
|
-
return (<react_native_1.View key={i} style={
|
|
20
|
+
return (<react_native_1.View key={i} style={Object.assign(Object.assign({}, styles.textBox), { borderColor: lib_1.colors[color] })}>
|
|
33
21
|
<MyTextqqyy_1.default style={{ color: lib_1.colors[color] }}>
|
|
34
22
|
{choice.choice}
|
|
35
23
|
</MyTextqqyy_1.default>
|
|
36
24
|
</react_native_1.View>);
|
|
37
25
|
})}
|
|
38
|
-
</react_native_1.View>)
|
|
26
|
+
</react_native_1.View>))}
|
|
39
27
|
</react_native_1.View>);
|
|
40
28
|
};
|
|
41
|
-
|
|
29
|
+
const styles = react_native_1.StyleSheet.create({
|
|
42
30
|
container: {
|
|
43
31
|
flex: 1,
|
|
44
32
|
justifyContent: "center",
|
|
@@ -3,32 +3,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var fsize = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.inQuizOption.fsize; });
|
|
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 lib_1 = require("@nakamura-123/lib");
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
|
|
12
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
13
|
+
const ExplainLogic_1 = require("./ExplainLogic");
|
|
14
|
+
const ZoomableImage_1 = __importDefault(require("../common/ZoomableImage"));
|
|
15
|
+
const MyTextqqyy_1 = __importDefault(require("../common/MyTextqqyy"));
|
|
16
|
+
const MovieBtn_1 = __importDefault(require("./MovieBtn"));
|
|
17
|
+
const NormalExplain = ({ navigation }) => {
|
|
18
|
+
const question = (0, quizHook_1.useQuestionDataD)();
|
|
19
|
+
const rImgs = (0, react_redux_1.useSelector)((state) => state.app.imgs.rImgs);
|
|
20
|
+
const mImgs = (0, react_redux_1.useSelector)((state) => state.app.imgs.mImgs);
|
|
21
|
+
const fsize = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption.fsize);
|
|
23
22
|
if (!question)
|
|
24
23
|
return null;
|
|
25
|
-
|
|
24
|
+
const { yearId, explain } = question;
|
|
26
25
|
if (!explain)
|
|
27
26
|
return null;
|
|
28
|
-
|
|
27
|
+
const explainInfos = explain.map((word) => {
|
|
29
28
|
return (0, ExplainLogic_1.getExplainDatas)(word, question);
|
|
30
29
|
});
|
|
31
|
-
|
|
30
|
+
const formIsInput = question.form === "input";
|
|
32
31
|
// 解説がない場合
|
|
33
32
|
if (explainInfos.length === 0)
|
|
34
33
|
return (<react_native_1.View style={styles.container}>
|
|
@@ -36,33 +35,33 @@ var NormalExplain = function (_a) {
|
|
|
36
35
|
こちらの問題の解説は掲載しておりません。過去問題集やWEBサイトなどでご確認ください。
|
|
37
36
|
</MyTextqqyy_1.default>
|
|
38
37
|
</react_native_1.View>);
|
|
39
|
-
|
|
38
|
+
const marginBottom = getMarginBottom(fsize);
|
|
40
39
|
// 解説表示
|
|
41
40
|
return (<react_native_1.View style={styles.container}>
|
|
42
41
|
{/* 解説表示 */}
|
|
43
|
-
{explainInfos.map(
|
|
44
|
-
|
|
42
|
+
{explainInfos.map((I, index) => {
|
|
43
|
+
const color = I.color && !I.word.startsWith("/") ? I.color : "ltBeige";
|
|
45
44
|
if (I.viewType === "base") {
|
|
46
|
-
|
|
45
|
+
const mt20 = I.color === "light" ? 25 : 0;
|
|
47
46
|
return (<react_native_1.View style={{
|
|
48
47
|
backgroundColor: lib_1.colors[color],
|
|
49
|
-
marginBottom
|
|
48
|
+
marginBottom,
|
|
50
49
|
marginTop: mt20,
|
|
51
50
|
}} key={index}>
|
|
52
51
|
<RenderImgOrText_1.default word={I.word} imgKey={"a" + yearId} navigation={navigation}/>
|
|
53
52
|
</react_native_1.View>);
|
|
54
53
|
}
|
|
55
54
|
if (I.viewType === "copy") {
|
|
56
|
-
return (<react_native_1.View style={{ backgroundColor: lib_1.colors[color], marginBottom
|
|
55
|
+
return (<react_native_1.View style={{ backgroundColor: lib_1.colors[color], marginBottom }} key={index}>
|
|
57
56
|
<RenderImgOrText_1.default word={I.word} imgKey={"a" + yearId} navigation={navigation} selectable={true}/>
|
|
58
57
|
</react_native_1.View>);
|
|
59
58
|
}
|
|
60
59
|
if (I.viewType === "rImg") {
|
|
61
|
-
|
|
60
|
+
const path = lib_1.utilFnc.getrImgPath(rImgs, I.word);
|
|
62
61
|
return (<ZoomableImage_1.default key={index} path={path} navigation={navigation} maxHeightValue={1000}/>);
|
|
63
62
|
}
|
|
64
63
|
if (I.viewType === "mImg") {
|
|
65
|
-
|
|
64
|
+
const pathes = lib_1.utilFnc.getmImgPathes(mImgs, I.yearId, I.num);
|
|
66
65
|
return (<MovieBtn_1.default key={index} pathes={pathes} word={I.word} navigation={navigation} index={index}/>);
|
|
67
66
|
}
|
|
68
67
|
})}
|
|
@@ -71,7 +70,7 @@ var NormalExplain = function (_a) {
|
|
|
71
70
|
</common_1.MyText>)}
|
|
72
71
|
</react_native_1.View>);
|
|
73
72
|
};
|
|
74
|
-
|
|
73
|
+
const styles = react_native_1.StyleSheet.create({
|
|
75
74
|
container: {
|
|
76
75
|
justifyContent: "flex-start",
|
|
77
76
|
backgroundColor: lib_1.colors.ltBeige,
|
|
@@ -82,7 +81,7 @@ var styles = react_native_1.StyleSheet.create({
|
|
|
82
81
|
marginTop: 10,
|
|
83
82
|
},
|
|
84
83
|
});
|
|
85
|
-
|
|
84
|
+
const getMarginBottom = (fsize) => {
|
|
86
85
|
switch (fsize) {
|
|
87
86
|
case "xs":
|
|
88
87
|
return 3;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calcMaxChoiceLength = void 0;
|
|
4
|
-
|
|
5
|
-
return choices.reduce(
|
|
4
|
+
const calcMaxChoiceLength = (choices) => {
|
|
5
|
+
return choices.reduce((max, current) => {
|
|
6
6
|
return Math.max(max, current.choice.length);
|
|
7
7
|
}, 0);
|
|
8
8
|
};
|
|
@@ -3,41 +3,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var isCorrected = (question === null || question === void 0 ? void 0 : question.isCorrected) === false ? false : (question === null || question === void 0 ? void 0 : question.isCorrected) || null;
|
|
6
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
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 quizHook_1 = require("../../hooks/quizHook");
|
|
11
|
+
const JAnswerContents_1 = __importDefault(require("./JAnswerContents"));
|
|
12
|
+
const react_redux_2 = require("react-redux");
|
|
13
|
+
const quizActionHook_1 = require("../../hooks/quizActionHook");
|
|
14
|
+
const getChoiceStyle_1 = require("../answer/styles/getChoiceStyle");
|
|
15
|
+
const JAnswer = ({ navigation }) => {
|
|
16
|
+
const dispatch = (0, react_redux_2.useDispatch)();
|
|
17
|
+
const question = (0, quizHook_1.useQuestionDataJ)();
|
|
18
|
+
const selectedIndexes = (question === null || question === void 0 ? void 0 : question.selectedIndexes) || [];
|
|
19
|
+
const choices = (question === null || question === void 0 ? void 0 : question.choices) || [];
|
|
20
|
+
const form = question === null || question === void 0 ? void 0 : question.form;
|
|
21
|
+
const useHandleCheck = (0, quizActionHook_1.useChangeModeToCheck)("JLPT", question);
|
|
22
|
+
const { isDoublePress } = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption);
|
|
23
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
24
|
+
const isCorrected = (question === null || question === void 0 ? void 0 : question.isCorrected) === false ? false : (question === null || question === void 0 ? void 0 : question.isCorrected) || null;
|
|
26
25
|
// 選択肢を選んだ時の処理
|
|
27
|
-
|
|
26
|
+
const handleChoice = (i) => {
|
|
28
27
|
var _a;
|
|
29
28
|
if (mode !== "quiz")
|
|
30
29
|
return;
|
|
31
30
|
dispatch(stores_1.quizAction.replaceSelectedIndex([i]));
|
|
32
|
-
|
|
31
|
+
const correct = (_a = choices[i]) === null || _a === void 0 ? void 0 : _a.isCorrect;
|
|
33
32
|
// 共通処理
|
|
34
33
|
useHandleCheck && useHandleCheck(correct);
|
|
35
34
|
};
|
|
36
35
|
// 選択肢のアウトラインの色を決める
|
|
37
|
-
|
|
38
|
-
var choice = _a.choice, isCorrect = _a.isCorrect;
|
|
36
|
+
const wordAndColors = choices.map(({ choice, isCorrect }, i) => {
|
|
39
37
|
if (form === "basicSelImg" || form === "listenSelImg")
|
|
40
|
-
choice =
|
|
38
|
+
choice = `/${choice}`;
|
|
41
39
|
return {
|
|
42
40
|
word: choice,
|
|
43
41
|
color: (0, getChoiceStyle_1.getChoiceOutlineColor)(selectedIndexes, mode, isCorrect, i),
|
|
@@ -46,7 +44,7 @@ var JAnswer = function (_a) {
|
|
|
46
44
|
// imgだった場合、表示させるためのTopKey
|
|
47
45
|
return (<JAnswerContents_1.default wordAndColors={wordAndColors} isDoublePress={isDoublePress} handleChoice={handleChoice} isNotSearch={false} navigation={navigation} isCorrected={isCorrected}/>);
|
|
48
46
|
};
|
|
49
|
-
|
|
47
|
+
const styles = react_native_1.StyleSheet.create({
|
|
50
48
|
container: {
|
|
51
49
|
backgroundColor: "#fff",
|
|
52
50
|
},
|
|
@@ -1,38 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var wordAndColors = _a.wordAndColors, isDoublePress = _a.isDoublePress, handleChoice = _a.handleChoice, isNotSearch = _a.isNotSearch, navigation = _a.navigation, isCorrected = _a.isCorrected;
|
|
6
|
+
const common_1 = require("@nakamura-123/common");
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
|
|
10
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
11
|
+
const RepeatBtn_1 = __importDefault(require("../setting/RepeatBtn"));
|
|
12
|
+
const GuideBtn_1 = __importDefault(require("../setting/GuideBtn"));
|
|
13
|
+
const JAnswerContents = ({ wordAndColors, isDoublePress, handleChoice, isNotSearch, navigation, isCorrected, }) => {
|
|
26
14
|
return (<react_native_1.View>
|
|
27
15
|
<react_native_1.View style={styles.bottomBtnBox}>
|
|
28
16
|
<RepeatBtn_1.default isPreLoad={true}/>
|
|
29
17
|
<GuideBtn_1.default navigation={navigation}/>
|
|
30
18
|
</react_native_1.View>
|
|
31
19
|
<react_native_1.View style={styles.container}>
|
|
32
|
-
{wordAndColors.map(
|
|
33
|
-
|
|
34
|
-
return (<common_1.DoubleTapWrapper key={i} onPress={function () { return handleChoice(i); }} isDoublePress={isDoublePress}>
|
|
35
|
-
<react_native_1.View style={__assign(__assign({}, styles.choice), { borderColor: lib_1.colors[color] })}>
|
|
20
|
+
{wordAndColors.map(({ word, color }, i) => (<common_1.DoubleTapWrapper key={i} onPress={() => handleChoice(i)} isDoublePress={isDoublePress}>
|
|
21
|
+
<react_native_1.View style={Object.assign(Object.assign({}, styles.choice), { borderColor: lib_1.colors[color] })}>
|
|
36
22
|
{color === "red" && (<>
|
|
37
23
|
<react_native_1.View style={styles.maruBox}>
|
|
38
24
|
<common_1.IconInCircle name="check" size={15} iconColor="green" cStyle={{ width: 25, height: 25 }}/>
|
|
@@ -48,12 +34,11 @@ var JAnswerContents = function (_a) {
|
|
|
48
34
|
</common_1.BoundText>)}
|
|
49
35
|
<RenderImgOrText_1.default word={word} isNotSearch={isNotSearch}/>
|
|
50
36
|
</react_native_1.View>
|
|
51
|
-
</common_1.DoubleTapWrapper>)
|
|
52
|
-
})}
|
|
37
|
+
</common_1.DoubleTapWrapper>))}
|
|
53
38
|
</react_native_1.View>
|
|
54
39
|
</react_native_1.View>);
|
|
55
40
|
};
|
|
56
|
-
|
|
41
|
+
const styles = react_native_1.StyleSheet.create({
|
|
57
42
|
container: {
|
|
58
43
|
justifyContent: "space-between",
|
|
59
44
|
flexDirection: "row",
|
|
@@ -3,18 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var question = (0, quizHook_1.useQuestionDataJ)();
|
|
6
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const TimeLimit_1 = __importDefault(require("./TimeLimit"));
|
|
10
|
+
const QuizCnt_1 = __importDefault(require("./QuizCnt"));
|
|
11
|
+
const JQuestionText_1 = __importDefault(require("./JQuestionText"));
|
|
12
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
13
|
+
const JQuestionBottomText_1 = __importDefault(require("./JQuestionBottomText"));
|
|
14
|
+
const Above3BtnJ_1 = __importDefault(require("../setting/Above3BtnJ"));
|
|
15
|
+
const JQuestion = ({ navigation }) => {
|
|
16
|
+
const question = (0, quizHook_1.useQuestionDataJ)();
|
|
18
17
|
return (<react_native_1.View>
|
|
19
18
|
<react_native_1.View style={styles.container}>
|
|
20
19
|
<QuizCnt_1.default />
|
|
@@ -25,7 +24,7 @@ var JQuestion = function (_a) {
|
|
|
25
24
|
<Above3BtnJ_1.default navigation={navigation}/>
|
|
26
25
|
</react_native_1.View>);
|
|
27
26
|
};
|
|
28
|
-
|
|
27
|
+
const styles = react_native_1.StyleSheet.create({
|
|
29
28
|
container: {
|
|
30
29
|
backgroundColor: lib_1.colors.bkBeige,
|
|
31
30
|
alignItems: "center",
|
|
@@ -3,28 +3,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var answerText = getAnswerText(question, form);
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
9
|
+
const RubyText_1 = __importDefault(require("../common/RubyText"));
|
|
10
|
+
const JQuestionBottomText = ({ question }) => {
|
|
11
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
12
|
+
const form = question === null || question === void 0 ? void 0 : question.form;
|
|
13
|
+
const answerText = getAnswerText(question, form);
|
|
15
14
|
if (mode === "quiz")
|
|
16
15
|
return null;
|
|
17
16
|
return (<react_native_1.View style={styles.container}>
|
|
18
17
|
<RubyText_1.default>{answerText}</RubyText_1.default>
|
|
19
18
|
</react_native_1.View>);
|
|
20
19
|
};
|
|
21
|
-
|
|
20
|
+
const getAnswerText = (question, form) => {
|
|
22
21
|
if (!question || !form)
|
|
23
22
|
return "";
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
const { enSentence, enWord, jpWord } = question;
|
|
24
|
+
const enSentenceForms = ["basicSelImg", "listenSelImg"];
|
|
25
|
+
const enWordForms = ["basicSelEn", "listenSelEn"];
|
|
26
|
+
const jpWordForms = ["basicSelJp", "listenSelJp"];
|
|
28
27
|
if (enSentenceForms.includes(form))
|
|
29
28
|
return enSentence;
|
|
30
29
|
if (enWordForms.includes(form))
|
|
@@ -33,7 +32,7 @@ var getAnswerText = function (question, form) {
|
|
|
33
32
|
return jpWord;
|
|
34
33
|
return enWord; // fallback
|
|
35
34
|
};
|
|
36
|
-
|
|
35
|
+
const styles = react_native_1.StyleSheet.create({
|
|
37
36
|
container: {
|
|
38
37
|
padding: 10,
|
|
39
38
|
alignItems: "center",
|
|
@@ -3,25 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var mode = (0, quizHook_1.useGetMode)();
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const RubyText_1 = __importDefault(require("../common/RubyText"));
|
|
9
|
+
const RepeatBtn_1 = __importDefault(require("../setting/RepeatBtn"));
|
|
10
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
11
|
+
const JQuestionText = ({ question }) => {
|
|
12
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
14
13
|
if (!question)
|
|
15
14
|
return null;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const quizText = question.question;
|
|
16
|
+
const form = question === null || question === void 0 ? void 0 : question.form;
|
|
17
|
+
const listenForms = [
|
|
19
18
|
"listenSelImg",
|
|
20
19
|
"listenSelEn",
|
|
21
20
|
"listenSelJp",
|
|
22
21
|
];
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const isListenForm = listenForms.includes(form);
|
|
23
|
+
const fontSize = form === "basicSelImg" || form === "listenSelImg" ? "xl" : "xxxl";
|
|
25
24
|
if (isListenForm && mode === "quiz")
|
|
26
25
|
return (<react_native_1.View style={styles.container}>
|
|
27
26
|
<RepeatBtn_1.default />
|
|
@@ -30,7 +29,7 @@ var JQuestionText = function (_a) {
|
|
|
30
29
|
<RubyText_1.default fsize={fontSize}>{quizText}</RubyText_1.default>
|
|
31
30
|
</react_native_1.View>);
|
|
32
31
|
};
|
|
33
|
-
|
|
32
|
+
const styles = react_native_1.StyleSheet.create({
|
|
34
33
|
container: {
|
|
35
34
|
height: 100,
|
|
36
35
|
justifyContent: "center",
|
|
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const react_redux_1 = require("react-redux");
|
|
7
|
+
const common_1 = require("@nakamura-123/common");
|
|
8
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const react_native_1 = require("react-native");
|
|
11
|
+
const QuizCnt = () => {
|
|
12
|
+
const turn = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state.turn) + 1;
|
|
13
|
+
const quizLength = (0, react_redux_1.useSelector)((state) => state.quiz.quizList.length);
|
|
14
14
|
return (<react_native_1.View style={styles.circle}>
|
|
15
15
|
<common_1.MyText style={styles.mainText}>
|
|
16
16
|
{turn}
|
|
@@ -18,7 +18,7 @@ var QuizCnt = function () {
|
|
|
18
18
|
</common_1.MyText>
|
|
19
19
|
</react_native_1.View>);
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
const styles = react_native_1.StyleSheet.create({
|
|
22
22
|
circle: {
|
|
23
23
|
// marginVertical: 10,
|
|
24
24
|
marginTop: 3,
|
|
@@ -23,31 +23,30 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var finishedVoice = (0, react_redux_2.useSelector)(function (state) { return state.quiz.currentInfo.jlpt.isFinishVoice; });
|
|
26
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const react_native_1 = require("react-native");
|
|
29
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
30
|
+
const native_1 = require("@react-navigation/native");
|
|
31
|
+
const react_redux_1 = require("react-redux");
|
|
32
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
33
|
+
const react_redux_2 = require("react-redux");
|
|
34
|
+
const TimeLimit = ({ timeLimit = 10000 }) => {
|
|
35
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
36
|
+
const animationRef = (0, react_1.useRef)(null);
|
|
37
|
+
const finishedVoice = (0, react_redux_2.useSelector)((state) => state.quiz.currentInfo.jlpt.isFinishVoice);
|
|
39
38
|
// if (!timeLimit) timeLimit = 10000;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
(0, react_1.useEffect)(
|
|
39
|
+
const progressAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(1)).current;
|
|
40
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
41
|
+
const isFocused = (0, native_1.useIsFocused)();
|
|
42
|
+
const barColor = timeLimit ? lib_1.colors.ltGreen : lib_1.colors.bkBeige;
|
|
43
|
+
(0, react_1.useEffect)(() => {
|
|
45
44
|
var _a;
|
|
46
45
|
if (!timeLimit || mode !== "quiz" || !isFocused)
|
|
47
46
|
return;
|
|
48
47
|
(_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.stop(); // 前のアニメーション停止
|
|
49
|
-
progressAnim.stopAnimation(
|
|
50
|
-
|
|
48
|
+
progressAnim.stopAnimation((currentValue) => {
|
|
49
|
+
const remaining = currentValue * timeLimit;
|
|
51
50
|
animationRef.current = react_native_1.Animated.timing(progressAnim, {
|
|
52
51
|
toValue: 0,
|
|
53
52
|
duration: remaining,
|
|
@@ -55,8 +54,7 @@ var TimeLimit = function (_a) {
|
|
|
55
54
|
});
|
|
56
55
|
if (finishedVoice)
|
|
57
56
|
animationRef.current.start();
|
|
58
|
-
|
|
59
|
-
var value = _a.value;
|
|
57
|
+
const listenerId = progressAnim.addListener(({ value }) => {
|
|
60
58
|
if (value <= 0) {
|
|
61
59
|
dispatch(stores_1.quizAction.setIsCorrected(false));
|
|
62
60
|
dispatch(stores_1.quizAction.changeMode("check"));
|
|
@@ -64,12 +62,12 @@ var TimeLimit = function (_a) {
|
|
|
64
62
|
}
|
|
65
63
|
});
|
|
66
64
|
});
|
|
67
|
-
return
|
|
65
|
+
return () => {
|
|
68
66
|
var _a;
|
|
69
67
|
(_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
70
68
|
};
|
|
71
69
|
}, [timeLimit, mode, isFocused, finishedVoice]);
|
|
72
|
-
|
|
70
|
+
const widthInterpolate = progressAnim.interpolate({
|
|
73
71
|
inputRange: [0, 1],
|
|
74
72
|
outputRange: ["0%", "100%"],
|
|
75
73
|
});
|
|
@@ -80,7 +78,7 @@ var TimeLimit = function (_a) {
|
|
|
80
78
|
]}/>
|
|
81
79
|
</react_native_1.View>);
|
|
82
80
|
};
|
|
83
|
-
|
|
81
|
+
const styles = react_native_1.StyleSheet.create({
|
|
84
82
|
backgroundBar: {
|
|
85
83
|
marginTop: 10,
|
|
86
84
|
width: "90%",
|
|
@@ -3,25 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return (<common_1.MiniIconBtn onPress={function () { return navigation.navigate("ImgZoom", { path: diagramPathNum }); }} icon="image" title="全体図" color="beige" size="sm" outline outerStyle={{ marginLeft: 5 }}/>);
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_redux_1 = require("react-redux");
|
|
8
|
+
const common_1 = require("@nakamura-123/common");
|
|
9
|
+
const FillDiagram = ({ navigation, word, yearId, }) => {
|
|
10
|
+
const qImgs = (0, react_redux_1.useSelector)((state) => state.app.imgs.qImgs);
|
|
11
|
+
const diagramPathNum = getFullImgPathFromWord(word, qImgs, yearId);
|
|
12
|
+
return (<common_1.MiniIconBtn onPress={() => navigation.navigate("ImgZoom", { path: diagramPathNum })} icon="image" title="全体図" color="beige" size="sm" outline outerStyle={{ marginLeft: 5 }}/>);
|
|
14
13
|
};
|
|
15
14
|
// 関数定義
|
|
16
15
|
// 画像パスを取得
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const getFullImgPathFromWord = (word, qImgs, yearId) => {
|
|
17
|
+
const num = extractNumberFromString(word);
|
|
18
|
+
const path = qImgs["diagram"][`q${yearId}_${num}`];
|
|
20
19
|
return path;
|
|
21
20
|
};
|
|
22
21
|
// 数字を抽出
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const extractNumberFromString = (input) => {
|
|
23
|
+
const match = input.match(/\d+/);
|
|
25
24
|
return match ? parseInt(match[0], 10) : null;
|
|
26
25
|
};
|
|
27
26
|
exports.default = FillDiagram;
|