@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
|
@@ -3,39 +3,38 @@ 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
|
-
var question = (0, quizHook_1.useQuestionDataD)();
|
|
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 FillDiagram_1 = __importDefault(require("./FillDiagram"));
|
|
11
|
+
const SearchYoutue_1 = __importDefault(require("./SearchYoutue"));
|
|
12
|
+
const RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
|
|
13
|
+
const QuestionReference_1 = __importDefault(require("./QuestionReference"));
|
|
14
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
15
|
+
const QuestionFormats_1 = require("./QuestionFormats");
|
|
16
|
+
const quizHook_2 = require("../../hooks/quizHook");
|
|
17
|
+
const Question = ({ navigation }) => {
|
|
18
|
+
let question = (0, quizHook_1.useQuestionDataD)();
|
|
20
19
|
if (!question)
|
|
21
20
|
return null;
|
|
22
21
|
// クイズの問題文を取得
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const { yearId, style, title, form } = question;
|
|
23
|
+
const multiState = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.multi);
|
|
24
|
+
const mode = (0, quizHook_2.useGetMode)();
|
|
25
|
+
const isQuizMode = mode === "quiz";
|
|
27
26
|
if (form === "multi")
|
|
28
|
-
question = (0, QuestionFormats_1.formatMultiQuestion)({ question
|
|
27
|
+
question = (0, QuestionFormats_1.formatMultiQuestion)({ question, multiState, mode });
|
|
29
28
|
if (form === "blank")
|
|
30
29
|
question = (0, QuestionFormats_1.formatBlankQuestion)(question, question.blankAns, isQuizMode);
|
|
31
|
-
|
|
30
|
+
const questionWords = question.question;
|
|
32
31
|
// ボタン部分
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const diagramPath = findDiagramInStyle(style);
|
|
33
|
+
const isYoutubeSearch = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.isYoutubeSearch; });
|
|
35
34
|
// 問題文章がmultiの場合の整形
|
|
36
35
|
return (<react_native_1.View style={styles.container}>
|
|
37
36
|
{/* 問題表示 */}
|
|
38
|
-
{questionWords.map(
|
|
37
|
+
{questionWords.map((word, index) => (<RenderImgOrText_1.default key={index} word={word} imgKey={"q" + yearId} navigation={navigation}/>))}
|
|
39
38
|
<QuestionReference_1.default />
|
|
40
39
|
{/* ボタン類(youtube、全体図) */}
|
|
41
40
|
<react_native_1.View style={styles.btnBox}>
|
|
@@ -46,10 +45,10 @@ var Question = function (_a) {
|
|
|
46
45
|
};
|
|
47
46
|
// 関数定義
|
|
48
47
|
// styleから図のパスを取得
|
|
49
|
-
|
|
50
|
-
return style.find(
|
|
48
|
+
const findDiagramInStyle = (style) => {
|
|
49
|
+
return style.find((item) => item.includes("diagram"));
|
|
51
50
|
};
|
|
52
|
-
|
|
51
|
+
const styles = react_native_1.StyleSheet.create({
|
|
53
52
|
container: {
|
|
54
53
|
justifyContent: "flex-start",
|
|
55
54
|
backgroundColor: lib_1.colors.ltBeige,
|
|
@@ -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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.formatBlankQuestion = exports.formatMultiQuestion = void 0;
|
|
15
4
|
// 01.メインロジック・複数選択問題のフォーマット
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var questionTexts = question.question, multiSel = question.multiSel, selectedIndexes = question.selectedIndexes;
|
|
5
|
+
const formatMultiQuestion = ({ question, multiState, mode, }) => {
|
|
6
|
+
const { question: questionTexts, multiSel, selectedIndexes } = question;
|
|
19
7
|
// ansSels を抽出
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
return __assign(__assign({}, question), { question: formattedQuestions });
|
|
8
|
+
const formattedQuestions = questionTexts.map((qText) => replaceMultiText(qText, multiState, multiSel, mode, selectedIndexes));
|
|
9
|
+
return Object.assign(Object.assign({}, question), { question: formattedQuestions });
|
|
24
10
|
};
|
|
25
11
|
exports.formatMultiQuestion = formatMultiQuestion;
|
|
26
12
|
// 02.複数選択問題のzz1部分を赤や青、答えに置き換える
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
ansSels.forEach(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
13
|
+
const RED_ZZ = "ZZAZZ";
|
|
14
|
+
const BLUE_ZZ = "ZZBZZ";
|
|
15
|
+
const replaceMultiText = (qText, multiState, multiSel, mode, selectedIndexes) => {
|
|
16
|
+
let returnText = qText;
|
|
17
|
+
const ansSels = multiSel.map((array) => { var _a, _b; return (_b = (_a = array.find((a) => a.isCorrect)) === null || _a === void 0 ? void 0 : _a.choice) !== null && _b !== void 0 ? _b : ""; });
|
|
18
|
+
ansSels.forEach((sel, i) => {
|
|
19
|
+
const nom = i + 1;
|
|
20
|
+
const regex = new RegExp(`zz${nom}`, "g");
|
|
21
|
+
const state = mode === "quiz"
|
|
36
22
|
? checkMultiState(multiState, i)
|
|
37
23
|
: checkMultiStateResult(multiSel, selectedIndexes, i);
|
|
38
24
|
if (state === "this")
|
|
@@ -40,15 +26,15 @@ var replaceMultiText = function (qText, multiState, multiSel, mode, selectedInde
|
|
|
40
26
|
else if (state === "next")
|
|
41
27
|
returnText = returnText.replace(regex, BLUE_ZZ);
|
|
42
28
|
else if (state === "correct")
|
|
43
|
-
returnText = returnText.replace(regex,
|
|
29
|
+
returnText = returnText.replace(regex, `JJ${sel}JJ`);
|
|
44
30
|
else if (state === "inCorrect")
|
|
45
|
-
returnText = returnText.replace(regex,
|
|
31
|
+
returnText = returnText.replace(regex, `JB${sel}BJ`);
|
|
46
32
|
});
|
|
47
33
|
return returnText;
|
|
48
34
|
};
|
|
49
35
|
// 03.zz1などの形を判定する
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
const checkMultiState = (multiState, index) => {
|
|
37
|
+
const { turn: mTurn, mode: mMode, isCorrects } = multiState;
|
|
52
38
|
if (index === mTurn && mMode === "quiz")
|
|
53
39
|
return "this";
|
|
54
40
|
if (index > mTurn)
|
|
@@ -56,33 +42,31 @@ var checkMultiState = function (multiState, index) {
|
|
|
56
42
|
return isCorrects[index] ? "correct" : "inCorrect";
|
|
57
43
|
};
|
|
58
44
|
// 04.check時とresult時の表示
|
|
59
|
-
|
|
45
|
+
const checkMultiStateResult = (multiSel, selectedIndexes, index) => {
|
|
60
46
|
if (!selectedIndexes || selectedIndexes.length === 0)
|
|
61
47
|
return "inCorrect";
|
|
62
48
|
if (multiSel.length > selectedIndexes.length)
|
|
63
49
|
return "inCorrect";
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
const selectedIndex = selectedIndexes[index];
|
|
51
|
+
const isCorrect = multiSel[index][selectedIndex].isCorrect;
|
|
66
52
|
if (isCorrect)
|
|
67
53
|
return "correct";
|
|
68
54
|
else
|
|
69
55
|
return "inCorrect";
|
|
70
56
|
};
|
|
71
57
|
// 10. 穴埋め問題のフォーマット
|
|
72
|
-
|
|
73
|
-
return
|
|
74
|
-
return replaceBlankText(qText, blankAns, isQuizMode);
|
|
75
|
-
}) });
|
|
58
|
+
const formatBlankQuestion = (question, blankAns, isQuizMode) => {
|
|
59
|
+
return Object.assign(Object.assign({}, question), { question: question.question.map((qText) => replaceBlankText(qText, blankAns, isQuizMode)) });
|
|
76
60
|
};
|
|
77
61
|
exports.formatBlankQuestion = formatBlankQuestion;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
blankAns.forEach(
|
|
81
|
-
|
|
82
|
-
|
|
62
|
+
const replaceBlankText = (qText, blankAns, isQuizMode) => {
|
|
63
|
+
let returnText = qText;
|
|
64
|
+
blankAns.forEach((ans, i) => {
|
|
65
|
+
const nom = i + 1;
|
|
66
|
+
const regex = new RegExp(`zz${nom}`, "g");
|
|
83
67
|
returnText = isQuizMode
|
|
84
|
-
? returnText.replace(regex,
|
|
85
|
-
: returnText.replace(regex,
|
|
68
|
+
? returnText.replace(regex, `XX${nom}XX`)
|
|
69
|
+
: returnText.replace(regex, `JJ${ans}JJ`);
|
|
86
70
|
});
|
|
87
71
|
return returnText;
|
|
88
72
|
};
|
|
@@ -3,19 +3,19 @@ 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
|
-
|
|
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 QuestionReference = () => {
|
|
11
|
+
const quizSource = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.quizName) === null || _a === void 0 ? void 0 : _a.quizReference; });
|
|
12
12
|
if (quizSource === "")
|
|
13
13
|
return null;
|
|
14
14
|
return (<react_native_1.View style={styles.container}>
|
|
15
15
|
<common_1.MyText style={styles.text}> 出典:{quizSource}</common_1.MyText>
|
|
16
16
|
</react_native_1.View>);
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
const styles = react_native_1.StyleSheet.create({
|
|
19
19
|
container: {
|
|
20
20
|
flex: 1,
|
|
21
21
|
alignItems: "flex-end",
|
|
@@ -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
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return (<common_1.MiniIconBtn onPress={function () { return lib_1.utilFnc.handleYoutubeSearch(searchWord); }} icon="youtube" title="検索" color="beige" size="sm" outline/>);
|
|
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
|
+
const SearchYoutube = ({ title }) => {
|
|
12
|
+
const examName = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.quizName) === null || _a === void 0 ? void 0 : _a.appName; });
|
|
13
|
+
const searchWord = `${examName}+${title}`;
|
|
14
|
+
return (<common_1.MiniIconBtn onPress={() => lib_1.utilFnc.handleYoutubeSearch(searchWord)} icon="youtube" title="検索" color="beige" size="sm" outline/>);
|
|
16
15
|
};
|
|
17
16
|
// 関数定義
|
|
18
17
|
// 画像パスを取得
|
|
19
|
-
|
|
18
|
+
const styles = react_native_1.StyleSheet.create({});
|
|
20
19
|
exports.default = SearchYoutube;
|
|
@@ -23,35 +23,34 @@ 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
|
-
|
|
39
|
-
|
|
40
|
-
(0, react_1.useEffect)(function () {
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const react_native_1 = require("react-native");
|
|
28
|
+
const react_redux_1 = require("react-redux");
|
|
29
|
+
const Animatable = __importStar(require("react-native-animatable"));
|
|
30
|
+
const common_1 = require("@nakamura-123/common");
|
|
31
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
32
|
+
const { loadQuizFromStorage } = stores_1.saveStorage;
|
|
33
|
+
const QuizSaveData = ({ navigation, saveKey }) => {
|
|
34
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
35
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
36
|
+
const isExistedSaveData = (0, react_redux_1.useSelector)((state) => state.score.isSave[saveKey]);
|
|
37
|
+
const lessonTitle = (0, react_redux_1.useSelector)((state) => state.quiz.selected.lesson.title);
|
|
38
|
+
const turn = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state.turn);
|
|
39
|
+
(0, react_1.useEffect)(() => {
|
|
41
40
|
dispatch(loadQuizFromStorage(saveKey));
|
|
42
41
|
}, []);
|
|
43
42
|
if (!isExistedSaveData)
|
|
44
43
|
return null;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const title = t("quiz.continue.title");
|
|
45
|
+
const note = `【${lessonTitle}】${turn + 1}${t("quiz.continue.note")}`;
|
|
46
|
+
const onPress = () => {
|
|
48
47
|
navigation.navigate("Quiz");
|
|
49
48
|
};
|
|
50
49
|
return (<Animatable.View style={styles.fixedBottom} animation="fadeIn" duration={500} useNativeDriver>
|
|
51
50
|
<common_1.RectangleCard title={title} note={note} left={<common_1.IconInCircle name="save" size={30}/>} onPress={onPress} color="blue" style={styles.card}/>
|
|
52
51
|
</Animatable.View>);
|
|
53
52
|
};
|
|
54
|
-
|
|
53
|
+
const styles = react_native_1.StyleSheet.create({
|
|
55
54
|
fixedBottom: {
|
|
56
55
|
position: "absolute",
|
|
57
56
|
bottom: 0,
|
|
@@ -3,33 +3,28 @@ 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
|
-
var btnList = [
|
|
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 stores_1 = require("@nakamura-123/stores");
|
|
11
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
12
|
+
const quizActionHook_1 = require("../../hooks/quizActionHook");
|
|
13
|
+
const Bottom3BtnJ = ({ navigation }) => {
|
|
14
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
15
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
16
|
+
const nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
|
|
17
|
+
const { turn, activeTurn } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
|
|
18
|
+
const isActiveTurn = turn === activeTurn;
|
|
19
|
+
const btnList = [
|
|
21
20
|
// 1つ目
|
|
22
|
-
createBtnInfo("arrow-left", "Back",
|
|
23
|
-
return dispatch(stores_1.quizAction.beforeTurn());
|
|
24
|
-
}),
|
|
21
|
+
createBtnInfo("arrow-left", "Back", () => dispatch(stores_1.quizAction.beforeTurn())),
|
|
25
22
|
// 2つ目
|
|
26
|
-
createBtnInfo("envelope", "Mail",
|
|
23
|
+
createBtnInfo("envelope", "Mail", () => navigation.navigate("Report")),
|
|
27
24
|
// 3つ目 quizなら「パス」、checkなら「次へ」
|
|
28
25
|
mode === "quiz"
|
|
29
|
-
? createBtnInfo("arrow-right", "Skip",
|
|
30
|
-
|
|
31
|
-
})
|
|
32
|
-
: createBtnInfo("arrow-right", "Next", function () {
|
|
26
|
+
? createBtnInfo("arrow-right", "Skip", () => dispatch(stores_1.quizAction.changeMode("check")))
|
|
27
|
+
: createBtnInfo("arrow-right", "Next", () => {
|
|
33
28
|
if (mode === "result" || !isActiveTurn)
|
|
34
29
|
dispatch(stores_1.quizAction.nextTurn());
|
|
35
30
|
else
|
|
@@ -37,15 +32,15 @@ var Bottom3BtnJ = function (_a) {
|
|
|
37
32
|
}),
|
|
38
33
|
];
|
|
39
34
|
return (<react_native_1.View style={styles.container}>
|
|
40
|
-
{btnList.map(
|
|
35
|
+
{btnList.map((btn) => (<common_1.IconTextBtn btn={btn} key={btn.text}/>))}
|
|
41
36
|
</react_native_1.View>);
|
|
42
37
|
};
|
|
43
|
-
|
|
44
|
-
icon
|
|
45
|
-
text
|
|
46
|
-
onPress
|
|
47
|
-
});
|
|
48
|
-
|
|
38
|
+
const createBtnInfo = (icon, text, onPress) => ({
|
|
39
|
+
icon,
|
|
40
|
+
text,
|
|
41
|
+
onPress,
|
|
42
|
+
});
|
|
43
|
+
const styles = react_native_1.StyleSheet.create({
|
|
49
44
|
container: {
|
|
50
45
|
flexDirection: "row",
|
|
51
46
|
justifyContent: "center",
|
|
@@ -3,33 +3,28 @@ 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
|
-
var btnList = [
|
|
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 stores_1 = require("@nakamura-123/stores");
|
|
11
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
12
|
+
const quizActionHook_1 = require("../../hooks/quizActionHook");
|
|
13
|
+
const NextQuiz = ({ navigation }) => {
|
|
14
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
15
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
16
|
+
const nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
|
|
17
|
+
const { turn, activeTurn } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
|
|
18
|
+
const isActiveTurn = turn === activeTurn;
|
|
19
|
+
const btnList = [
|
|
21
20
|
// 1つ目
|
|
22
|
-
createBtnInfo("arrow-left", "戻る",
|
|
23
|
-
return dispatch(stores_1.quizAction.beforeTurn());
|
|
24
|
-
}),
|
|
21
|
+
createBtnInfo("arrow-left", "戻る", () => dispatch(stores_1.quizAction.beforeTurn())),
|
|
25
22
|
// 2つ目
|
|
26
|
-
createBtnInfo("envelope", "報告",
|
|
23
|
+
createBtnInfo("envelope", "報告", () => navigation.navigate("Report")),
|
|
27
24
|
// 3つ目 quizなら「パス」、checkなら「次へ」
|
|
28
25
|
mode === "quiz"
|
|
29
|
-
? createBtnInfo("question-circle", "パス",
|
|
30
|
-
|
|
31
|
-
})
|
|
32
|
-
: createBtnInfo("arrow-right", "次へ", function () {
|
|
26
|
+
? createBtnInfo("question-circle", "パス", () => dispatch(stores_1.quizAction.changeMode("check")))
|
|
27
|
+
: createBtnInfo("arrow-right", "次へ", () => {
|
|
33
28
|
if (mode === "result" || !isActiveTurn)
|
|
34
29
|
dispatch(stores_1.quizAction.nextTurn());
|
|
35
30
|
else
|
|
@@ -37,15 +32,15 @@ var NextQuiz = function (_a) {
|
|
|
37
32
|
}),
|
|
38
33
|
];
|
|
39
34
|
return (<react_native_1.View style={styles.container}>
|
|
40
|
-
{btnList.map(
|
|
35
|
+
{btnList.map((btn) => (<common_1.IconTextBtn btn={btn} key={btn.text}/>))}
|
|
41
36
|
</react_native_1.View>);
|
|
42
37
|
};
|
|
43
|
-
|
|
44
|
-
icon
|
|
45
|
-
text
|
|
46
|
-
onPress
|
|
47
|
-
});
|
|
48
|
-
|
|
38
|
+
const createBtnInfo = (icon, text, onPress) => ({
|
|
39
|
+
icon,
|
|
40
|
+
text,
|
|
41
|
+
onPress,
|
|
42
|
+
});
|
|
43
|
+
const styles = react_native_1.StyleSheet.create({
|
|
49
44
|
container: {
|
|
50
45
|
flexDirection: "row",
|
|
51
46
|
justifyContent: "center",
|
|
@@ -3,39 +3,36 @@ 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 mode = (0, quizHook_1.useGetMode)();
|
|
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 quizHook_1 = require("../../hooks/quizHook");
|
|
10
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
11
|
+
const GuideBtn = ({ navigation }) => {
|
|
12
|
+
const question = (0, quizHook_1.useQuestionDataJ)();
|
|
13
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
15
14
|
if (mode === "quiz")
|
|
16
15
|
return <react_native_1.View></react_native_1.View>; // modeがquizでない場合は何も表示しない
|
|
17
|
-
|
|
16
|
+
const quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
|
|
18
17
|
if (quizId === null || !question)
|
|
19
18
|
return <react_native_1.View></react_native_1.View>; // quizIdがnullの場合は何も表示しない
|
|
20
|
-
|
|
19
|
+
const quizType = question.form === "basicSelImg" || question.form === "listenSelImg"
|
|
21
20
|
? "jpSentence"
|
|
22
21
|
: "jpWord";
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const searchBtn = createBtnInfo("search", "Search", () => {
|
|
23
|
+
const searchWord = lib_1.utilFnc.parseRubyText(question[quizType]);
|
|
24
|
+
const removeRuby = lib_1.utilFnc.removeRuby(searchWord);
|
|
26
25
|
lib_1.utilFnc.handleSearchTrans(removeRuby);
|
|
27
26
|
});
|
|
28
|
-
|
|
29
|
-
return navigation.navigate("Guide", { quizId: quizId });
|
|
30
|
-
});
|
|
27
|
+
const guideBtn = createBtnInfo("book", "Guide", () => navigation.navigate("Guide", { quizId: quizId }));
|
|
31
28
|
return (<react_native_1.View style={{ flexDirection: "row", alignItems: "center" }}>
|
|
32
29
|
<common_1.IconTextBtn btn={searchBtn} style={{ marginLeft: "auto" }} key={searchBtn.text}/>
|
|
33
30
|
<common_1.IconTextBtn btn={guideBtn} key={guideBtn.text}/>
|
|
34
31
|
</react_native_1.View>);
|
|
35
32
|
};
|
|
36
|
-
|
|
37
|
-
icon
|
|
38
|
-
text
|
|
39
|
-
onPress
|
|
40
|
-
});
|
|
33
|
+
const createBtnInfo = (icon, text, onPress) => ({
|
|
34
|
+
icon,
|
|
35
|
+
text,
|
|
36
|
+
onPress,
|
|
37
|
+
});
|
|
41
38
|
exports.default = GuideBtn;
|
|
@@ -23,42 +23,37 @@ 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
|
-
var quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const react_native_1 = require("react-native");
|
|
28
|
+
const react_redux_1 = require("react-redux");
|
|
29
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
30
|
+
const common_1 = require("@nakamura-123/common");
|
|
31
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
32
|
+
const react_redux_2 = require("react-redux");
|
|
33
|
+
const RepeatBtn = ({ isPreLoad }) => {
|
|
34
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
35
|
+
const question = (0, quizHook_1.useQuestionDataJ)();
|
|
36
|
+
const quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
|
|
38
37
|
if (quizId === null)
|
|
39
38
|
return <react_native_1.View></react_native_1.View>; // quizIdがnullの場合は何も表示しない
|
|
40
39
|
// 音声の設定
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
var finishedVoiceReset = function () {
|
|
50
|
-
return dispatch({ type: "quiz/changeFinishVoice", payload: false });
|
|
51
|
-
};
|
|
40
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
41
|
+
const voice = (0, quizHook_1.useGetVoicePath)(quizId);
|
|
42
|
+
const wordVoice = (0, quizHook_1.useGetVoicePath)(quizId, "word");
|
|
43
|
+
const sentenceVoice = (0, quizHook_1.useGetVoicePath)(quizId, "sentence");
|
|
44
|
+
const voiceVolume = (0, react_redux_2.useSelector)((state) => state.quizCfg.inQuizOption.voiceVolume);
|
|
45
|
+
const finishedVoice = () => dispatch({ type: "quiz/changeFinishVoice", payload: true });
|
|
46
|
+
const finishedVoiceReset = () => dispatch({ type: "quiz/changeFinishVoice", payload: false });
|
|
52
47
|
// 音声のプリロード・初回再生
|
|
53
|
-
(0, react_1.useEffect)(
|
|
48
|
+
(0, react_1.useEffect)(() => {
|
|
54
49
|
if (!isPreLoad || !wordVoice || !sentenceVoice)
|
|
55
50
|
return;
|
|
56
|
-
|
|
51
|
+
const isPlay = mode === "quiz";
|
|
57
52
|
if (voice)
|
|
58
53
|
lib_1.voiceFnc.preloadVoiceById(voice, isPlay, voiceVolume, finishedVoice);
|
|
59
54
|
else
|
|
60
55
|
finishedVoice();
|
|
61
|
-
return
|
|
56
|
+
return () => {
|
|
62
57
|
lib_1.voiceFnc.unloadVoiceById(wordVoice);
|
|
63
58
|
lib_1.voiceFnc.unloadVoiceById(sentenceVoice);
|
|
64
59
|
finishedVoiceReset();
|
|
@@ -66,15 +61,13 @@ var RepeatBtn = function (_a) {
|
|
|
66
61
|
}, [quizId]);
|
|
67
62
|
if (!voice)
|
|
68
63
|
return <react_native_1.View></react_native_1.View>; // voiceがnullの場合は何も表示しない
|
|
69
|
-
|
|
70
|
-
return lib_1.voiceFnc.playVoice(voice, voiceVolume);
|
|
71
|
-
});
|
|
64
|
+
const btn = createBtnInfo("volume-up", "Repeat", () => lib_1.voiceFnc.playVoice(voice, voiceVolume));
|
|
72
65
|
return (<common_1.IconTextBtn btn={btn} style={{ marginRight: "auto" }} key={btn.text}/> // IconTextBtnを使用
|
|
73
66
|
);
|
|
74
67
|
};
|
|
75
|
-
|
|
76
|
-
icon
|
|
77
|
-
text
|
|
78
|
-
onPress
|
|
79
|
-
});
|
|
68
|
+
const createBtnInfo = (icon, text, onPress) => ({
|
|
69
|
+
icon,
|
|
70
|
+
text,
|
|
71
|
+
onPress,
|
|
72
|
+
});
|
|
80
73
|
exports.default = RepeatBtn;
|