@nakamura-123/pages 0.0.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/Badge5s.d.ts +9 -0
- package/dist/component/Badge5s.js +46 -0
- package/dist/component/BasicSetting.d.ts +9 -0
- package/dist/component/BasicSetting.js +31 -0
- package/dist/component/Boot/IconTitleAndToggle.d.ts +8 -0
- package/dist/component/Boot/IconTitleAndToggle.js +20 -0
- package/dist/component/Boot/SelectRange.d.ts +6 -0
- package/dist/component/Boot/SelectRange.js +44 -0
- package/dist/component/Boot/SelectUnit.d.ts +6 -0
- package/dist/component/Boot/SelectUnit.js +41 -0
- package/dist/component/Boot/ToggleRange.d.ts +8 -0
- package/dist/component/Boot/ToggleRange.js +54 -0
- package/dist/component/Coin/AppReviews.d.ts +10 -0
- package/dist/component/Coin/AppReviews.js +45 -0
- package/dist/component/Coin/CatchCopy.d.ts +3 -0
- package/dist/component/Coin/CatchCopy.js +31 -0
- package/dist/component/Coin/Recommend.d.ts +3 -0
- package/dist/component/Coin/Recommend.js +87 -0
- package/dist/component/Grade/AllBadges.d.ts +7 -0
- package/dist/component/Grade/AllBadges.js +41 -0
- package/dist/component/Grade/AllTags.d.ts +5 -0
- package/dist/component/Grade/AllTags.js +32 -0
- package/dist/component/Grade/BasicBadge.d.ts +7 -0
- package/dist/component/Grade/BasicBadge.js +72 -0
- package/dist/component/Grade/ChangeWeeklyTargetBtn.d.ts +5 -0
- package/dist/component/Grade/ChangeWeeklyTargetBtn.js +39 -0
- package/dist/component/Grade/DatePickerModal.d.ts +8 -0
- package/dist/component/Grade/DatePickerModal.js +45 -0
- package/dist/component/Grade/GradeCard/ChangeWeeklyModal.d.ts +13 -0
- package/dist/component/Grade/GradeCard/ChangeWeeklyModal.js +39 -0
- package/dist/component/Grade/GradeCard/ChangeWeeklyTargetBtn.d.ts +7 -0
- package/dist/component/Grade/GradeCard/ChangeWeeklyTargetBtn.js +60 -0
- package/dist/component/Grade/GradeCard/DatePickerModal.d.ts +8 -0
- package/dist/component/Grade/GradeCard/DatePickerModal.js +49 -0
- package/dist/component/Grade/GradeCard/GradeCard.d.ts +7 -0
- package/dist/component/Grade/GradeCard/GradeCard.js +53 -0
- package/dist/component/Grade/GradeCard/Square3sGrade.d.ts +11 -0
- package/dist/component/Grade/GradeCard/Square3sGrade.js +60 -0
- package/dist/component/Grade/GradeCard/TargetDate.d.ts +7 -0
- package/dist/component/Grade/GradeCard/TargetDate.js +60 -0
- package/dist/component/Grade/GradeCard/WeeklyAchivedRate.d.ts +9 -0
- package/dist/component/Grade/GradeCard/WeeklyAchivedRate.js +28 -0
- package/dist/component/Grade/GradeCard/WeeklyProgress.d.ts +11 -0
- package/dist/component/Grade/GradeCard/WeeklyProgress.js +88 -0
- package/dist/component/Grade/GradeCard.d.ts +4 -0
- package/dist/component/Grade/GradeCard.js +53 -0
- package/dist/component/Grade/QuizCntGraph.d.ts +8 -0
- package/dist/component/Grade/QuizCntGraph.js +104 -0
- package/dist/component/Grade/Scuare3sGrade.d.ts +9 -0
- package/dist/component/Grade/Scuare3sGrade.js +35 -0
- package/dist/component/Grade/ShareBtn.d.ts +6 -0
- package/dist/component/Grade/ShareBtn.js +86 -0
- package/dist/component/Grade/Square3sGrade.d.ts +9 -0
- package/dist/component/Grade/Square3sGrade.js +63 -0
- package/dist/component/Grade/Square4s.d.ts +7 -0
- package/dist/component/Grade/Square4s.js +63 -0
- package/dist/component/Grade/TargetDate.d.ts +4 -0
- package/dist/component/Grade/TargetDate.js +56 -0
- package/dist/component/Grade/WeeklyAchivedRate.d.ts +7 -0
- package/dist/component/Grade/WeeklyAchivedRate.js +28 -0
- package/dist/component/Grade/WeeklyProgress.d.ts +9 -0
- package/dist/component/Grade/WeeklyProgress.js +80 -0
- package/dist/component/HeadNavigator.d.ts +0 -0
- package/dist/component/HeadNavigator.js +49 -0
- package/dist/component/HomePage.d.ts +8 -0
- package/dist/component/HomePage.js +44 -0
- package/dist/component/MiniTestCard.d.ts +9 -0
- package/dist/component/MiniTestCard.js +75 -0
- package/dist/component/Paw4s.d.ts +7 -0
- package/dist/component/Paw4s.js +51 -0
- package/dist/component/Paw5s.d.ts +7 -0
- package/dist/component/Paw5s.js +51 -0
- package/dist/component/QuizSet/QuizOptionDrill.d.ts +5 -0
- package/dist/component/QuizSet/QuizOptionDrill.js +46 -0
- package/dist/component/QuizSet/QuizSetDrill.d.ts +5 -0
- package/dist/component/QuizSet/QuizSetDrill.js +43 -0
- package/dist/component/Result/CharaCard.d.ts +7 -0
- package/dist/component/Result/CharaCard.js +43 -0
- package/dist/component/Result/LessonTitle.d.ts +3 -0
- package/dist/component/Result/LessonTitle.js +42 -0
- package/dist/component/Result/QuizFlatList.d.ts +7 -0
- package/dist/component/Result/QuizFlatList.js +76 -0
- package/dist/component/Result/ScoreBox.d.ts +7 -0
- package/dist/component/Result/ScoreBox.js +61 -0
- package/dist/component/Result/ScoreCircle.d.ts +7 -0
- package/dist/component/Result/ScoreCircle.js +59 -0
- package/dist/component/SelectRange/SelectYearRange.d.ts +7 -0
- package/dist/component/SelectRange/SelectYearRange.js +105 -0
- package/dist/component/SettingBtns/Config.d.ts +8 -0
- package/dist/component/SettingBtns/Config.js +17 -0
- package/dist/component/SettingBtns/Grade.d.ts +8 -0
- package/dist/component/SettingBtns/Grade.js +17 -0
- package/dist/component/SettingBtns/QuizOptionSelector.d.ts +7 -0
- package/dist/component/SettingBtns/QuizOptionSelector.js +43 -0
- package/dist/component/SettingBtns/Range.d.ts +5 -0
- package/dist/component/SettingBtns/Range.js +44 -0
- package/dist/component/SettingBtns/Report.d.ts +5 -0
- package/dist/component/SettingBtns/Report.js +16 -0
- package/dist/component/SettingBtns/Setting.d.ts +0 -0
- package/dist/component/SettingBtns/Setting.js +1 -0
- package/dist/component/Square3s.d.ts +7 -0
- package/dist/component/Square3s.js +38 -0
- package/dist/component/SubCagegoryList.d.ts +8 -0
- package/dist/component/SubCagegoryList.js +120 -0
- package/dist/component/SubCategoryLeft.d.ts +5 -0
- package/dist/component/SubCategoryLeft.js +14 -0
- package/dist/component/SubCategoryList.d.ts +9 -0
- package/dist/component/SubCategoryList.js +77 -0
- package/dist/component/TabAnimeView.d.ts +7 -0
- package/dist/component/TabAnimeView.js +61 -0
- package/dist/component/TabContents.d.ts +1 -0
- package/dist/component/TabContents.js +18 -0
- package/dist/component/TabContentsWrap.d.ts +7 -0
- package/dist/component/TabContentsWrap.js +38 -0
- package/dist/component/Tag5s.d.ts +6 -0
- package/dist/component/Tag5s.js +49 -0
- package/dist/component/TagBadge5s.d.ts +7 -0
- package/dist/component/TagBadge5s.js +63 -0
- package/dist/component/TagBadge5sPress.d.ts +6 -0
- package/dist/component/TagBadge5sPress.js +29 -0
- package/dist/component/TestCard.d.ts +7 -0
- package/dist/component/TestCard.js +57 -0
- package/dist/component/TestPage/AverageBar.d.ts +11 -0
- package/dist/component/TestPage/AverageBar.js +74 -0
- package/dist/component/TestPage/BarChart.d.ts +7 -0
- package/dist/component/TestPage/BarChart.js +107 -0
- package/dist/component/TestPage/BarChartContainer.d.ts +9 -0
- package/dist/component/TestPage/BarChartContainer.js +99 -0
- package/dist/component/TestPage/BarGraph.d.ts +11 -0
- package/dist/component/TestPage/BarGraph.js +60 -0
- package/dist/component/TestPage/ChartControl.d.ts +10 -0
- package/dist/component/TestPage/ChartControl.js +43 -0
- package/dist/component/TestPage/Square3s.d.ts +9 -0
- package/dist/component/TestPage/Square3s.js +35 -0
- package/dist/component/UnitPage.d.ts +10 -0
- package/dist/component/UnitPage.js +15 -0
- package/dist/functions/InQuizFnc.d.ts +0 -0
- package/dist/functions/InQuizFnc.js +1 -0
- package/dist/functions/badgeBasicFnc.d.ts +14 -0
- package/dist/functions/badgeBasicFnc.js +68 -0
- package/dist/functions/badgeDailyFnc.d.ts +15 -0
- package/dist/functions/badgeDailyFnc.js +65 -0
- package/dist/functions/badgeFilter.d.ts +17 -0
- package/dist/functions/badgeFilter.js +33 -0
- package/dist/functions/badgeFnc.d.ts +15 -0
- package/dist/functions/badgeFnc.js +68 -0
- package/dist/functions/createQuizFnc.d.ts +13 -0
- package/dist/functions/createQuizFnc.js +69 -0
- package/dist/functions/gradeFnc.d.ts +16 -0
- package/dist/functions/gradeFnc.js +83 -0
- package/dist/functions/questionFilter.d.ts +16 -0
- package/dist/functions/questionFilter.js +79 -0
- package/dist/functions/questionFormat.d.ts +7 -0
- package/dist/functions/questionFormat.js +89 -0
- package/dist/functions/tagFnc.d.ts +22 -0
- package/dist/functions/tagFnc.js +105 -0
- package/dist/functions/testFnc.d.ts +8 -0
- package/dist/functions/testFnc.js +21 -0
- package/dist/helper/scoreFnc.d.ts +10 -0
- package/dist/helper/scoreFnc.js +40 -0
- package/dist/helper/tagFnc.d.ts +23 -0
- package/dist/helper/tagFnc.js +69 -0
- package/dist/helper/testFnc.d.ts +7 -0
- package/dist/helper/testFnc.js +17 -0
- package/dist/hooks/BadgeHook.d.ts +1 -0
- package/dist/hooks/BadgeHook.js +65 -0
- package/dist/hooks/ExitQuizHook.d.ts +2 -0
- package/dist/hooks/ExitQuizHook.js +54 -0
- package/dist/hooks/basicHook.d.ts +3 -0
- package/dist/hooks/basicHook.js +14 -0
- package/dist/hooks/quizActionHook.d.ts +5 -0
- package/dist/hooks/quizActionHook.js +86 -0
- package/dist/hooks/quizHook.d.ts +15 -0
- package/dist/hooks/quizHook.js +60 -0
- package/dist/hooks/selector.d.ts +6 -0
- package/dist/hooks/selector.js +24 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +68 -0
- package/dist/page/BadgePage.d.ts +8 -0
- package/dist/page/BadgePage.js +58 -0
- package/dist/page/BasicPage.d.ts +9 -0
- package/dist/page/BasicPage.js +125 -0
- package/dist/page/BootPage.d.ts +9 -0
- package/dist/page/BootPage.js +116 -0
- package/dist/page/CoinPage.d.ts +9 -0
- package/dist/page/CoinPage.js +51 -0
- package/dist/page/GetBadgePage.d.ts +7 -0
- package/dist/page/GetBadgePage.js +173 -0
- package/dist/page/GradePage.d.ts +7 -0
- package/dist/page/GradePage.js +37 -0
- package/dist/page/HistoryPage.d.ts +11 -0
- package/dist/page/HistoryPage.js +62 -0
- package/dist/page/HomePage.d.ts +8 -0
- package/dist/page/HomePage.js +80 -0
- package/dist/page/ImgZoom.d.ts +10 -0
- package/dist/page/ImgZoom.js +29 -0
- package/dist/page/QuixPage.d.ts +7 -0
- package/dist/page/QuixPage.js +33 -0
- package/dist/page/QuizPage.d.ts +7 -0
- package/dist/page/QuizPage.js +98 -0
- package/dist/page/QuizSettingPage.d.ts +7 -0
- package/dist/page/QuizSettingPage.js +72 -0
- package/dist/page/QuizSetupPage.d.ts +7 -0
- package/dist/page/QuizSetupPage.js +85 -0
- package/dist/page/ReportPage.d.ts +8 -0
- package/dist/page/ReportPage.js +185 -0
- package/dist/page/ResultPage.d.ts +7 -0
- package/dist/page/ResultPage.js +47 -0
- package/dist/page/SettingPage.d.ts +7 -0
- package/dist/page/SettingPage.js +62 -0
- package/dist/page/TestPage.d.ts +9 -0
- package/dist/page/TestPage.js +101 -0
- package/dist/page/UnitPage.d.ts +9 -0
- package/dist/page/UnitPage.js +127 -0
- package/dist/page/ZoomImg.d.ts +0 -0
- package/dist/page/ZoomImg.js +1 -0
- package/dist/quiz/GoBackAlert.d.ts +2 -0
- package/dist/quiz/GoBackAlert.js +30 -0
- package/dist/quiz/MyImage.d.ts +9 -0
- package/dist/quiz/MyImage.js +60 -0
- package/dist/quiz/MyTextqqyy.d.ts +10 -0
- package/dist/quiz/MyTextqqyy.js +80 -0
- package/dist/quiz/Question.d.ts +3 -0
- package/dist/quiz/Question.js +43 -0
- package/dist/quiz/Quiz.d.ts +9 -0
- package/dist/quiz/Quiz.js +44 -0
- package/dist/quiz/QuizTitle.d.ts +3 -0
- package/dist/quiz/QuizTitle.js +51 -0
- package/dist/quiz/Title.d.ts +3 -0
- package/dist/quiz/Title.js +51 -0
- package/dist/quiz/answer/Answer.d.ts +3 -0
- package/dist/quiz/answer/Answer.js +41 -0
- package/dist/quiz/answer/BlankAnswer.d.ts +7 -0
- package/dist/quiz/answer/BlankAnswer.js +33 -0
- package/dist/quiz/answer/BlankBtn.d.ts +3 -0
- package/dist/quiz/answer/BlankBtn.js +50 -0
- package/dist/quiz/answer/ChoiceView.d.ts +17 -0
- package/dist/quiz/answer/ChoiceView.js +53 -0
- package/dist/quiz/answer/CommonChoice.d.ts +0 -0
- package/dist/quiz/answer/CommonChoice.js +1 -0
- package/dist/quiz/answer/MultiChoice.d.ts +7 -0
- package/dist/quiz/answer/MultiChoice.js +66 -0
- package/dist/quiz/answer/MultiChoiceContainer.d.ts +7 -0
- package/dist/quiz/answer/MultiChoiceContainer.js +71 -0
- package/dist/quiz/answer/MultiChoiceLogic.d.ts +0 -0
- package/dist/quiz/answer/MultiChoiceLogic.js +1 -0
- package/dist/quiz/answer/MultiNextBtn.d.ts +7 -0
- package/dist/quiz/answer/MultiNextBtn.js +36 -0
- package/dist/quiz/answer/NormalChoice.d.ts +7 -0
- package/dist/quiz/answer/NormalChoice.js +64 -0
- package/dist/quiz/answer/NormalChoiceContainer.d.ts +7 -0
- package/dist/quiz/answer/NormalChoiceContainer.js +76 -0
- package/dist/quiz/answer/NormalChoiceView.d.ts +17 -0
- package/dist/quiz/answer/NormalChoiceView.js +53 -0
- package/dist/quiz/answer/NormalSelect.d.ts +5 -0
- package/dist/quiz/answer/NormalSelect.js +28 -0
- package/dist/quiz/answer/memo.d.ts +9 -0
- package/dist/quiz/answer/memo.js +114 -0
- package/dist/quiz/answer/style/getChoiceStyle.d.ts +2 -0
- package/dist/quiz/answer/style/getChoiceStyle.js +17 -0
- package/dist/quiz/answer/styles/getChoiceStyle.d.ts +5 -0
- package/dist/quiz/answer/styles/getChoiceStyle.js +32 -0
- package/dist/quiz/answer/util/choiceFnc.d.ts +2 -0
- package/dist/quiz/answer/util/choiceFnc.js +9 -0
- package/dist/quiz/check/Check.d.ts +8 -0
- package/dist/quiz/check/Check.js +82 -0
- package/dist/quiz/check/NextQuiz.d.ts +8 -0
- package/dist/quiz/check/NextQuiz.js +42 -0
- package/dist/quiz/check/NextQuizBtn.d.ts +8 -0
- package/dist/quiz/check/NextQuizBtn.js +67 -0
- package/dist/quiz/check/SelectTag.d.ts +5 -0
- package/dist/quiz/check/SelectTag.js +86 -0
- package/dist/quiz/common/MyImage.d.ts +6 -0
- package/dist/quiz/common/MyImage.js +56 -0
- package/dist/quiz/common/MyTextqqyy.d.ts +11 -0
- package/dist/quiz/common/MyTextqqyy.js +133 -0
- package/dist/quiz/common/PageContainerWrap.d.ts +10 -0
- package/dist/quiz/common/PageContainerWrap.js +38 -0
- package/dist/quiz/common/RenderImgOrText.d.ts +11 -0
- package/dist/quiz/common/RenderImgOrText.js +21 -0
- package/dist/quiz/common/ZoomableImage.d.ts +9 -0
- package/dist/quiz/common/ZoomableImage.js +18 -0
- package/dist/quiz/explain/CorrectBar.d.ts +7 -0
- package/dist/quiz/explain/CorrectBar.js +46 -0
- package/dist/quiz/explain/CorrectedBar.d.ts +7 -0
- package/dist/quiz/explain/CorrectedBar.js +45 -0
- package/dist/quiz/explain/Example.d.ts +8 -0
- package/dist/quiz/explain/Example.js +107 -0
- package/dist/quiz/explain/Explain.d.ts +8 -0
- package/dist/quiz/explain/Explain.js +59 -0
- package/dist/quiz/explain/ExplainLogic.d.ts +17 -0
- package/dist/quiz/explain/ExplainLogic.js +52 -0
- package/dist/quiz/function/choiceFnc.d.ts +2 -0
- package/dist/quiz/function/choiceFnc.js +9 -0
- package/dist/quiz/function/turnModeFnc.d.ts +0 -0
- package/dist/quiz/function/turnModeFnc.js +31 -0
- package/dist/quiz/question/FillDiagram.d.ts +10 -0
- package/dist/quiz/question/FillDiagram.js +27 -0
- package/dist/quiz/question/Question.d.ts +8 -0
- package/dist/quiz/question/Question.js +61 -0
- package/dist/quiz/question/QuestionFormat.d.ts +8 -0
- package/dist/quiz/question/QuestionFormat.js +69 -0
- package/dist/quiz/question/QuestionFormats.d.ts +9 -0
- package/dist/quiz/question/QuestionFormats.js +75 -0
- package/dist/quiz/question/QuestionMultiFormat.d.ts +7 -0
- package/dist/quiz/question/QuestionMultiFormat.js +43 -0
- package/dist/quiz/question/QuestionTxtFomat.d.ts +7 -0
- package/dist/quiz/question/QuestionTxtFomat.js +42 -0
- package/dist/quiz/question/SearchYoutue.d.ts +6 -0
- package/dist/quiz/question/SearchYoutue.js +20 -0
- package/dist/quiz/question/questionStyleFormat.d.ts +8 -0
- package/dist/quiz/question/questionStyleFormat.js +61 -0
- package/dist/quiz/save/QuizSaveData.d.ts +9 -0
- package/dist/quiz/save/QuizSaveData.js +68 -0
- package/dist/quiz/setting/Bottom3Btn.d.ts +8 -0
- package/dist/quiz/setting/Bottom3Btn.js +79 -0
- package/dist/quiz/setting/ReturnBtn.d.ts +7 -0
- package/dist/quiz/setting/ReturnBtn.js +77 -0
- package/dist/quiz/setting/ReturnSaveBtn.d.ts +7 -0
- package/dist/quiz/setting/ReturnSaveBtn.js +94 -0
- package/dist/quiz/styles/getChoiceStyle.d.ts +5 -0
- package/dist/quiz/styles/getChoiceStyle.js +32 -0
- package/dist/quiz/util/choiceFnc.d.ts +2 -0
- package/dist/quiz/util/choiceFnc.js +9 -0
- package/dist/quiz/util/commonFnc.d.ts +0 -0
- package/dist/quiz/util/commonFnc.js +1 -0
- package/dist/quiz/util/customHook.d.ts +0 -0
- package/dist/quiz/util/customHook.js +1 -0
- package/dist/quiz/util/customSelector.d.ts +5 -0
- package/dist/quiz/util/customSelector.js +16 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/homePage.d.ts +12 -0
- package/dist/types/homePage.js +2 -0
- package/package.json +23 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
var react_1 = __importDefault(require("react"));
|
|
16
|
+
var react_redux_1 = require("react-redux");
|
|
17
|
+
var stores_1 = require("@nakamura-123/stores");
|
|
18
|
+
var ChoiceView_1 = __importDefault(require("./ChoiceView"));
|
|
19
|
+
var choiceFnc_1 = require("../function/choiceFnc");
|
|
20
|
+
var getChoiceStyle_1 = require("./styles/getChoiceStyle");
|
|
21
|
+
var quizHook_1 = require("../../hooks/quizHook");
|
|
22
|
+
var quizActionHook_1 = require("../../hooks/quizActionHook");
|
|
23
|
+
// ここには独自のロジックを書く
|
|
24
|
+
var NormalChoice = function (_a) {
|
|
25
|
+
var question = _a.question;
|
|
26
|
+
var dispatch = (0, react_redux_1.useDispatch)();
|
|
27
|
+
var useHandleCheck = (0, quizActionHook_1.useChangeModeToCheck)();
|
|
28
|
+
var choices = question.choices, quizStyles = question.style, yearId = question.yearId, selectedIndexes = question.selectedIndexes;
|
|
29
|
+
var _b = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.inQuizOption; }), isUserVertical = _b.isVertical, isDoublePress = _b.isDoublePress;
|
|
30
|
+
var mode = (0, quizHook_1.useGetMode)();
|
|
31
|
+
// 選択肢を選んだ時の処理
|
|
32
|
+
var correctCnt = choices.filter(function (choice) { return choice.isCorrect; }).length;
|
|
33
|
+
var handleChoice = function (i) {
|
|
34
|
+
if (mode !== "quiz")
|
|
35
|
+
return;
|
|
36
|
+
var newSelectedIndexes = selectedIndexes.includes(i)
|
|
37
|
+
? selectedIndexes.filter(function (index) { return index !== i; })
|
|
38
|
+
: __spreadArray(__spreadArray([], selectedIndexes, true), [i], false);
|
|
39
|
+
dispatch(stores_1.quizAction.replaceSelectedIndex(newSelectedIndexes));
|
|
40
|
+
var isFinished = newSelectedIndexes.length >= correctCnt;
|
|
41
|
+
if (!isFinished)
|
|
42
|
+
return;
|
|
43
|
+
// 選択肢を選択(複数答えがあるときは全て)選んだ場合、checkモードへ移行する際の処理
|
|
44
|
+
var isCorrected = newSelectedIndexes.every(function (index) { var _a; return (_a = choices[index]) === null || _a === void 0 ? void 0 : _a.isCorrect; });
|
|
45
|
+
// 共通処理
|
|
46
|
+
useHandleCheck(isCorrected);
|
|
47
|
+
};
|
|
48
|
+
// 選択肢のアウトラインの色を決める
|
|
49
|
+
var wordAndColors = choices.map(function (_a, i) {
|
|
50
|
+
var choice = _a.choice, isCorrect = _a.isCorrect;
|
|
51
|
+
return ({
|
|
52
|
+
word: choice,
|
|
53
|
+
color: (0, getChoiceStyle_1.getChoiceOutlineColor)(selectedIndexes, mode, isCorrect, i),
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
// 最大文字数を計算
|
|
57
|
+
var maxChoiceLength = (0, choiceFnc_1.calcMaxChoiceLength)(choices);
|
|
58
|
+
// imgだった場合、表示させるためのTopKey
|
|
59
|
+
var imgKey = "a".concat(yearId);
|
|
60
|
+
// 縦に4つ並べるか横に2つ並べるかを決める
|
|
61
|
+
var isVertical = (0, getChoiceStyle_1.checkIsVertical)(quizStyles, isUserVertical);
|
|
62
|
+
return (<ChoiceView_1.default wordAndColors={wordAndColors} isDoublePress={isDoublePress} handleChoice={handleChoice} maxChoiceLength={maxChoiceLength} imgKey={imgKey} isVertical={isVertical} isNotSearch={mode === "quiz"}/>);
|
|
63
|
+
};
|
|
64
|
+
exports.default = NormalChoice;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Store } from "@nakamura-123/types";
|
|
3
|
+
interface NormalChoiceContainerProps {
|
|
4
|
+
question: Store.DQInStoreNormal;
|
|
5
|
+
}
|
|
6
|
+
declare const NormalChoiceContainer: React.FC<NormalChoiceContainerProps>;
|
|
7
|
+
export default NormalChoiceContainer;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
var react_1 = __importDefault(require("react"));
|
|
16
|
+
var react_redux_1 = require("react-redux");
|
|
17
|
+
var stores_1 = require("@nakamura-123/stores");
|
|
18
|
+
var react_2 = require("@realm/react");
|
|
19
|
+
var ChoiceView_1 = __importDefault(require("./ChoiceView"));
|
|
20
|
+
var choiceFnc_1 = require("../function/choiceFnc");
|
|
21
|
+
var getChoiceStyle_1 = require("./styles/getChoiceStyle");
|
|
22
|
+
var db_1 = require("@nakamura-123/db");
|
|
23
|
+
var quizHook_1 = require("../../hooks/quizHook");
|
|
24
|
+
var common_1 = require("@nakamura-123/common");
|
|
25
|
+
// ここには独自のロジックを書く
|
|
26
|
+
var NormalChoiceContainer = function (_a) {
|
|
27
|
+
var question = _a.question;
|
|
28
|
+
var dispatch = (0, react_redux_1.useDispatch)();
|
|
29
|
+
var realm = (0, react_2.useRealm)();
|
|
30
|
+
var dailyLogDB = (0, react_2.useQuery)(db_1.DailyLogSchema);
|
|
31
|
+
var playSound = common_1.commonHook.usePlaySound();
|
|
32
|
+
var choices = question.choices, quizStyles = question.style, yearId = question.yearId, selectedIndexes = question.selectedIndexes;
|
|
33
|
+
var _b = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.inQuizOption; }), isUserVertical = _b.isVertical, isDoublePress = _b.isDoublePress;
|
|
34
|
+
var mode = (0, quizHook_1.useGetMode)();
|
|
35
|
+
// 選択肢を選んだ時の処理
|
|
36
|
+
var correctCnt = choices.filter(function (choice) { return choice.isCorrect; }).length;
|
|
37
|
+
var tagId = question ? (0, quizHook_1.useTagIdByYearNum)(yearId, question.num) : null;
|
|
38
|
+
var tagLv = question.tag;
|
|
39
|
+
var handleChoice = function (i) {
|
|
40
|
+
if (mode !== "quiz")
|
|
41
|
+
return;
|
|
42
|
+
var newSelectedIndexes = selectedIndexes.includes(i)
|
|
43
|
+
? selectedIndexes.filter(function (index) { return index !== i; })
|
|
44
|
+
: __spreadArray(__spreadArray([], selectedIndexes, true), [i], false);
|
|
45
|
+
dispatch(stores_1.quizAction.replaceSelectedIndex(newSelectedIndexes));
|
|
46
|
+
var isFinished = newSelectedIndexes.length >= correctCnt;
|
|
47
|
+
if (!isFinished)
|
|
48
|
+
return;
|
|
49
|
+
var isCorrected = newSelectedIndexes.every(function (index) { var _a; return (_a = choices[index]) === null || _a === void 0 ? void 0 : _a.isCorrect; });
|
|
50
|
+
var soundType = isCorrected ? "correct" : "btn";
|
|
51
|
+
playSound(soundType);
|
|
52
|
+
dispatch(stores_1.quizAction.changeMode("check"));
|
|
53
|
+
dispatch(stores_1.quizAction.setIsCorrected(isCorrected));
|
|
54
|
+
if (tagId)
|
|
55
|
+
dispatch(db_1.TagModel.autoChangeTagLevel(realm, tagId, tagLv, isCorrected));
|
|
56
|
+
if (isCorrected)
|
|
57
|
+
dispatch(stores_1.quizAction.addOnePoint());
|
|
58
|
+
dispatch(db_1.DailyLogModel.addOneCntToday(realm, dailyLogDB));
|
|
59
|
+
};
|
|
60
|
+
// 選択肢のアウトラインの色を決める
|
|
61
|
+
var wordAndColors = choices.map(function (_a, i) {
|
|
62
|
+
var choice = _a.choice, isCorrect = _a.isCorrect;
|
|
63
|
+
return ({
|
|
64
|
+
word: choice,
|
|
65
|
+
color: (0, getChoiceStyle_1.getChoiceOutlineColor)(selectedIndexes, "check", isCorrect, i),
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
// 最大文字数を計算
|
|
69
|
+
var maxChoiceLength = (0, choiceFnc_1.calcMaxChoiceLength)(choices);
|
|
70
|
+
// imgだった場合、表示させるためのTopKey
|
|
71
|
+
var imgKey = "a".concat(yearId);
|
|
72
|
+
// 縦に4つ並べるか横に2つ並べるかを決める
|
|
73
|
+
var isVertical = (0, getChoiceStyle_1.checkIsVertical)(quizStyles, isUserVertical);
|
|
74
|
+
return (<ChoiceView_1.default wordAndColors={wordAndColors} isDoublePress={isDoublePress} handleChoice={handleChoice} maxChoiceLength={maxChoiceLength} imgKey={imgKey} isVertical={isVertical} isNotSearch={mode === "quiz"}/>);
|
|
75
|
+
};
|
|
76
|
+
exports.default = NormalChoiceContainer;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OutlineColor } from "../styles/getChoiceStyle";
|
|
3
|
+
type WordAndColors = {
|
|
4
|
+
word: string;
|
|
5
|
+
color: OutlineColor;
|
|
6
|
+
};
|
|
7
|
+
interface Props {
|
|
8
|
+
wordAndColors: WordAndColors[];
|
|
9
|
+
isVertical: boolean;
|
|
10
|
+
isDoublePress: boolean;
|
|
11
|
+
handleChoice: (index: number) => void;
|
|
12
|
+
maxChoiceLength: number;
|
|
13
|
+
imgKey: string;
|
|
14
|
+
isNotSearch?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const ChoiceView: React.FC<Props>;
|
|
17
|
+
export default ChoiceView;
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var react_native_1 = require("react-native");
|
|
19
|
+
var common_1 = require("@nakamura-123/common");
|
|
20
|
+
var RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
|
|
21
|
+
var getChoiceStyle_1 = require("../styles/getChoiceStyle");
|
|
22
|
+
var lib_1 = require("@nakamura-123/lib");
|
|
23
|
+
// ここにはMultiと共通のロジックを書く
|
|
24
|
+
// 基本的にはロジックが変わるので、ここにはロジックを書かない
|
|
25
|
+
var ChoiceView = function (_a) {
|
|
26
|
+
var wordAndColors = _a.wordAndColors, isVertical = _a.isVertical, isDoublePress = _a.isDoublePress, handleChoice = _a.handleChoice, maxChoiceLength = _a.maxChoiceLength, imgKey = _a.imgKey, isNotSearch = _a.isNotSearch;
|
|
27
|
+
return (<react_native_1.View style={__assign(__assign({}, styles.container), { flexDirection: "row", flexWrap: "wrap" })}>
|
|
28
|
+
{wordAndColors.map(function (_a, i) {
|
|
29
|
+
var word = _a.word, color = _a.color;
|
|
30
|
+
return (<common_1.DoubleTapWrapper key={i} onPress={function () { return handleChoice(i); }} isDoublePress={isDoublePress}>
|
|
31
|
+
<react_native_1.View style={(styles.choice,
|
|
32
|
+
(0, getChoiceStyle_1.getChoiceStyle)(isVertical, maxChoiceLength, color))}>
|
|
33
|
+
<RenderImgOrText_1.default word={word} imgKey={imgKey} isNotSearch={isNotSearch}/>
|
|
34
|
+
</react_native_1.View>
|
|
35
|
+
</common_1.DoubleTapWrapper>);
|
|
36
|
+
})}
|
|
37
|
+
</react_native_1.View>);
|
|
38
|
+
};
|
|
39
|
+
var styles = react_native_1.StyleSheet.create({
|
|
40
|
+
container: {
|
|
41
|
+
justifyContent: "space-between",
|
|
42
|
+
flexDirection: "row",
|
|
43
|
+
flexWrap: "wrap",
|
|
44
|
+
},
|
|
45
|
+
choice: {
|
|
46
|
+
backgroundColor: lib_1.colors.ltBeige,
|
|
47
|
+
flexDirection: "row",
|
|
48
|
+
marginBottom: 5,
|
|
49
|
+
borderRadius: 3,
|
|
50
|
+
borderWidth: 1,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
exports.default = ChoiceView;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var react_native_1 = require("react-native");
|
|
8
|
+
var react_redux_1 = require("react-redux");
|
|
9
|
+
var lib_1 = require("@nakamura-123/lib");
|
|
10
|
+
var common_1 = require("@nakamura-123/common");
|
|
11
|
+
var Answer = function (_a) {
|
|
12
|
+
var turn = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.state.turn; });
|
|
13
|
+
var question = (0, react_redux_1.useSelector)(function (state) { return state.quiz.quizList[turn]; });
|
|
14
|
+
var form = question.form;
|
|
15
|
+
var qImgs = (0, react_redux_1.useSelector)(function (state) { return state.app.imgs.qImgs; });
|
|
16
|
+
return (<react_native_1.View style={styles.container}>
|
|
17
|
+
<common_1.MyText>選択肢</common_1.MyText>
|
|
18
|
+
</react_native_1.View>);
|
|
19
|
+
};
|
|
20
|
+
var styles = react_native_1.StyleSheet.create({
|
|
21
|
+
container: {
|
|
22
|
+
justifyContent: "flex-start",
|
|
23
|
+
backgroundColor: lib_1.colors.ltBeige,
|
|
24
|
+
padding: 10,
|
|
25
|
+
},
|
|
26
|
+
text: {},
|
|
27
|
+
});
|
|
28
|
+
exports.default = Answer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StackNavigationProp } from "@react-navigation/stack";
|
|
3
|
+
import { Store, Nav } from "@nakamura-123/types";
|
|
4
|
+
interface NormalChoiceProps {
|
|
5
|
+
question: Store.DQInStoreNormal;
|
|
6
|
+
navigation: StackNavigationProp<Nav.RootStackParamList>;
|
|
7
|
+
}
|
|
8
|
+
declare const NormalChoice: React.FC<NormalChoiceProps>;
|
|
9
|
+
export default NormalChoice;
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
37
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
38
|
+
if (ar || !(i in from)) {
|
|
39
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
40
|
+
ar[i] = from[i];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
44
|
+
};
|
|
45
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
|
+
};
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
var react_1 = __importStar(require("react"));
|
|
50
|
+
var react_native_1 = require("react-native");
|
|
51
|
+
var react_redux_1 = require("react-redux");
|
|
52
|
+
var lib_1 = require("@nakamura-123/lib");
|
|
53
|
+
var stores_1 = require("@nakamura-123/stores");
|
|
54
|
+
var common_1 = require("@nakamura-123/common");
|
|
55
|
+
var RenderImgOrText_1 = __importDefault(require("../common/RenderImgOrText"));
|
|
56
|
+
var NormalChoice = function (_a) {
|
|
57
|
+
var navigation = _a.navigation, question = _a.question;
|
|
58
|
+
var dispatch = (0, react_redux_1.useDispatch)();
|
|
59
|
+
var choices = question.choices, yearId = question.yearId, style = question.style;
|
|
60
|
+
var _b = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.option; }), isVertical = _b.isVertical, isDoublePress = _b.isDoublePress;
|
|
61
|
+
var mode = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.state; }).mode;
|
|
62
|
+
// 文字数を数えて、中央揃えか左揃えかを決める
|
|
63
|
+
var maxChoiceLength = choices.reduce(function (max, current) {
|
|
64
|
+
return Math.max(max, current.choice.length);
|
|
65
|
+
}, 0); // 初期値は0
|
|
66
|
+
// 答えの選択肢はいくつあるのかを数える
|
|
67
|
+
var _c = (0, react_1.useState)([]), selectedIndexes = _c[0], setSelectedIndexes = _c[1];
|
|
68
|
+
var correctCnt = choices.filter(function (choice) { return choice.isCorrect; }).length;
|
|
69
|
+
// 選択時の動作
|
|
70
|
+
var handleChoice = function (i) {
|
|
71
|
+
if (selectedIndexes.length >= correctCnt)
|
|
72
|
+
return;
|
|
73
|
+
var newSelectedIndexes = __spreadArray(__spreadArray([], selectedIndexes, true), [i], false);
|
|
74
|
+
setSelectedIndexes(newSelectedIndexes);
|
|
75
|
+
dispatch(stores_1.quizAction.changeMode("check"));
|
|
76
|
+
var isCorrected = newSelectedIndexes.every(function (i) { var _a; return (_a = choices[i]) === null || _a === void 0 ? void 0 : _a.isCorrect; });
|
|
77
|
+
if (isCorrected)
|
|
78
|
+
dispatch(stores_1.quizAction.addOnePoint());
|
|
79
|
+
};
|
|
80
|
+
return (<react_native_1.View style={styles.container}>
|
|
81
|
+
{choices.map(function (_a, i) {
|
|
82
|
+
var choice = _a.choice, isCorrect = _a.isCorrect;
|
|
83
|
+
var color = "ltBlack";
|
|
84
|
+
if (selectedIndexes.includes(i))
|
|
85
|
+
color = "yellow";
|
|
86
|
+
if (mode !== "quiz" && isCorrect)
|
|
87
|
+
color = "red";
|
|
88
|
+
return (<common_1.DoubleTapWrapper key={i} onPress={function () { return handleChoice(i); }} isDoublePress={isDoublePress}>
|
|
89
|
+
<react_native_1.View style={getChoiceStyle(isVertical, style, maxChoiceLength, color)}>
|
|
90
|
+
<RenderImgOrText_1.default word={choice} imgKey={"a" + yearId}/>
|
|
91
|
+
</react_native_1.View>
|
|
92
|
+
</common_1.DoubleTapWrapper>);
|
|
93
|
+
})}
|
|
94
|
+
</react_native_1.View>);
|
|
95
|
+
};
|
|
96
|
+
// スタイルの取得
|
|
97
|
+
var getChoiceStyle = function (isVertical, style, maxChoiceLength, color) {
|
|
98
|
+
return __assign(__assign({}, styles.choice), { width: isVertical || (style === null || style === void 0 ? void 0 : style.includes("vertical")) ? "100%" : "49.5%", justifyContent: maxChoiceLength < 15 ? "center" : "flex-start", borderColor: lib_1.colors[color] });
|
|
99
|
+
};
|
|
100
|
+
var styles = react_native_1.StyleSheet.create({
|
|
101
|
+
container: {
|
|
102
|
+
justifyContent: "space-between",
|
|
103
|
+
flexDirection: "row",
|
|
104
|
+
flexWrap: "wrap",
|
|
105
|
+
},
|
|
106
|
+
choice: {
|
|
107
|
+
backgroundColor: lib_1.colors.ltBeige,
|
|
108
|
+
flexDirection: "row",
|
|
109
|
+
marginBottom: 5,
|
|
110
|
+
borderRadius: 3,
|
|
111
|
+
borderWidth: 1,
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
exports.default = NormalChoice;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getChoiceStyle = void 0;
|
|
4
|
+
var lib_1 = require("@nakamura-123/lib");
|
|
5
|
+
var getChoiceStyle = function (isVertical, style, maxChoiceLength, color) {
|
|
6
|
+
return {
|
|
7
|
+
backgroundColor: lib_1.colors.ltBeige,
|
|
8
|
+
flexDirection: "row",
|
|
9
|
+
marginBottom: 5,
|
|
10
|
+
borderRadius: 3,
|
|
11
|
+
borderWidth: 1,
|
|
12
|
+
borderColor: lib_1.colors[color],
|
|
13
|
+
width: isVertical || (style === null || style === void 0 ? void 0 : style.includes("vertical")) ? "100%" : "49.5%",
|
|
14
|
+
justifyContent: maxChoiceLength < 15 ? "center" : "flex-start",
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
exports.getChoiceStyle = getChoiceStyle;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ViewStyle } from "react-native";
|
|
2
|
+
export type OutlineColor = "light" | "blue" | "yellow" | "red";
|
|
3
|
+
export declare const getChoiceStyle: (isVertical: boolean, maxChoiceLength: number, color: OutlineColor) => ViewStyle;
|
|
4
|
+
export declare const checkIsVertical: (quizStyles: string[], userSettingVertical: boolean) => boolean;
|
|
5
|
+
export declare const getChoiceOutlineColor: (selectedIndexes: number[], mode: string, isCorrect: boolean, i: number) => OutlineColor;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getChoiceOutlineColor = exports.checkIsVertical = exports.getChoiceStyle = void 0;
|
|
4
|
+
var lib_1 = require("@nakamura-123/lib");
|
|
5
|
+
var getChoiceStyle = function (isVertical, maxChoiceLength, color) {
|
|
6
|
+
return {
|
|
7
|
+
backgroundColor: lib_1.colors.ltBeige,
|
|
8
|
+
flexDirection: "row",
|
|
9
|
+
marginBottom: 5,
|
|
10
|
+
borderRadius: 3,
|
|
11
|
+
borderWidth: 1,
|
|
12
|
+
borderTopWidth: 6,
|
|
13
|
+
borderColor: lib_1.colors[color],
|
|
14
|
+
width: isVertical ? "100%" : "49.5%",
|
|
15
|
+
justifyContent: maxChoiceLength < 15 ? "center" : "flex-start",
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
exports.getChoiceStyle = getChoiceStyle;
|
|
19
|
+
var checkIsVertical = function (quizStyles, userSettingVertical) {
|
|
20
|
+
if (quizStyles.includes("vertical") || userSettingVertical)
|
|
21
|
+
return true;
|
|
22
|
+
return false;
|
|
23
|
+
};
|
|
24
|
+
exports.checkIsVertical = checkIsVertical;
|
|
25
|
+
var getChoiceOutlineColor = function (selectedIndexes, mode, isCorrect, i) {
|
|
26
|
+
if (mode === "quiz")
|
|
27
|
+
return selectedIndexes.includes(i) ? "yellow" : "light";
|
|
28
|
+
if (isCorrect)
|
|
29
|
+
return "red";
|
|
30
|
+
return selectedIndexes.includes(i) ? "blue" : "light";
|
|
31
|
+
};
|
|
32
|
+
exports.getChoiceOutlineColor = getChoiceOutlineColor;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calcMaxChoiceLength = void 0;
|
|
4
|
+
var calcMaxChoiceLength = function (choices) {
|
|
5
|
+
return choices.reduce(function (max, current) {
|
|
6
|
+
return Math.max(max, current.choice.length);
|
|
7
|
+
}, 0);
|
|
8
|
+
};
|
|
9
|
+
exports.calcMaxChoiceLength = calcMaxChoiceLength;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StackNavigationProp } from "@react-navigation/stack";
|
|
3
|
+
import { Nav } from "@nakamura-123/types";
|
|
4
|
+
interface CheckProps {
|
|
5
|
+
navigation: StackNavigationProp<Nav.RootStackParamList>;
|
|
6
|
+
}
|
|
7
|
+
declare const Check: React.FC<CheckProps>;
|
|
8
|
+
export default Check;
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var react_native_1 = require("react-native");
|
|
30
|
+
var react_1 = __importStar(require("react"));
|
|
31
|
+
var react_2 = require("@realm/react");
|
|
32
|
+
var react_redux_1 = require("react-redux");
|
|
33
|
+
var db_1 = require("@nakamura-123/db");
|
|
34
|
+
var SelectTag_1 = __importDefault(require("./SelectTag"));
|
|
35
|
+
var NextQuizBtn_1 = __importDefault(require("./NextQuizBtn"));
|
|
36
|
+
var quizHook_1 = require("../../hooks/quizHook");
|
|
37
|
+
var BadgeHook_1 = require("../../hooks/BadgeHook");
|
|
38
|
+
var Check = function (_a) {
|
|
39
|
+
var navigation = _a.navigation;
|
|
40
|
+
var dispatch = (0, react_redux_1.useDispatch)();
|
|
41
|
+
var realm = (0, react_2.useRealm)();
|
|
42
|
+
var isLastCheckTurn = (0, quizHook_1.useIsLastCheckTurn)();
|
|
43
|
+
var checkBadgeEligibility = (0, BadgeHook_1.useCheckBadgeEligibility)();
|
|
44
|
+
var type = (0, react_redux_1.useSelector)(function (state) { return state.quiz.selected.type; });
|
|
45
|
+
(0, react_1.useEffect)(function () {
|
|
46
|
+
if (!isLastCheckTurn)
|
|
47
|
+
return;
|
|
48
|
+
if (type === "test")
|
|
49
|
+
dispatch(db_1.TestModel.createTestLog(realm));
|
|
50
|
+
if (type === "miniTest")
|
|
51
|
+
dispatch(db_1.MinitestModel.createMiniTestLog(realm));
|
|
52
|
+
if (type === "boot")
|
|
53
|
+
dispatch(db_1.BootModel.createBootLog(realm));
|
|
54
|
+
// バッジの判定を行い、必要情報をオブジェクトにまとめる
|
|
55
|
+
// realmへ書き込み
|
|
56
|
+
checkBadgeEligibility();
|
|
57
|
+
}, []);
|
|
58
|
+
return (<react_native_1.View style={styles.container}>
|
|
59
|
+
<react_native_1.View style={styles.left}>
|
|
60
|
+
<SelectTag_1.default />
|
|
61
|
+
</react_native_1.View>
|
|
62
|
+
<react_native_1.View style={styles.right}>
|
|
63
|
+
<NextQuizBtn_1.default navigation={navigation}/>
|
|
64
|
+
</react_native_1.View>
|
|
65
|
+
</react_native_1.View>);
|
|
66
|
+
};
|
|
67
|
+
var styles = react_native_1.StyleSheet.create({
|
|
68
|
+
container: {
|
|
69
|
+
flexDirection: "row",
|
|
70
|
+
justifyContent: "space-between",
|
|
71
|
+
width: "100%",
|
|
72
|
+
alignItems: "flex-end",
|
|
73
|
+
},
|
|
74
|
+
left: {
|
|
75
|
+
width: "70%",
|
|
76
|
+
},
|
|
77
|
+
right: {
|
|
78
|
+
width: "20%",
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
exports.default = Check;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StackNavigationProp } from "@react-navigation/stack";
|
|
3
|
+
import { Nav } from "@nakamura-123/types";
|
|
4
|
+
interface NextQuizProps {
|
|
5
|
+
navigation: StackNavigationProp<Nav.RootStackParamList>;
|
|
6
|
+
}
|
|
7
|
+
declare const NextQuiz: React.FC<NextQuizProps>;
|
|
8
|
+
export default NextQuiz;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var react_native_1 = require("react-native");
|
|
8
|
+
var MaterialCommunityIcons_1 = __importDefault(require("react-native-vector-icons/MaterialCommunityIcons"));
|
|
9
|
+
var lib_1 = require("@nakamura-123/lib");
|
|
10
|
+
var common_1 = require("@nakamura-123/common");
|
|
11
|
+
var quizActionHook_1 = require("../../hooks/quizActionHook");
|
|
12
|
+
var NextQuiz = function (_a) {
|
|
13
|
+
var navigation = _a.navigation;
|
|
14
|
+
var nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
|
|
15
|
+
return (<react_native_1.Pressable onPress={function () { return nextQuizAction(navigation); }} style={styles.button}>
|
|
16
|
+
<react_native_1.View style={styles.iconContainer}>
|
|
17
|
+
<MaterialCommunityIcons_1.default name="gesture-swipe-left" size={25} color="white"/>
|
|
18
|
+
</react_native_1.View>
|
|
19
|
+
<common_1.MyText style={styles.text} fsize="sm">
|
|
20
|
+
次へ
|
|
21
|
+
</common_1.MyText>
|
|
22
|
+
</react_native_1.Pressable>);
|
|
23
|
+
};
|
|
24
|
+
var styles = react_native_1.StyleSheet.create({
|
|
25
|
+
button: {
|
|
26
|
+
justifyContent: "center",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
borderRadius: 50, // 丸い形にする
|
|
29
|
+
height: 60,
|
|
30
|
+
width: 60,
|
|
31
|
+
backgroundColor: lib_1.colors.gray,
|
|
32
|
+
},
|
|
33
|
+
iconContainer: {
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
},
|
|
37
|
+
text: {
|
|
38
|
+
marginTop: 3,
|
|
39
|
+
color: "white",
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
exports.default = NextQuiz;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StackNavigationProp } from "@react-navigation/stack";
|
|
3
|
+
import { Nav } from "@nakamura-123/types";
|
|
4
|
+
interface NextQuizProps {
|
|
5
|
+
navigation: StackNavigationProp<Nav.RootStackParamList>;
|
|
6
|
+
}
|
|
7
|
+
declare const NextQuiz: React.FC<NextQuizProps>;
|
|
8
|
+
export default NextQuiz;
|