@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
|
@@ -26,56 +26,55 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var _b, _c
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var mode = (0, quizHook_1.useGetMode)();
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_native_1 = require("react-native");
|
|
31
|
+
const react_2 = require("@realm/react");
|
|
32
|
+
const react_redux_1 = require("react-redux");
|
|
33
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
34
|
+
const db_1 = require("@nakamura-123/db");
|
|
35
|
+
const InputFnc_1 = require("./Input/InputFnc");
|
|
36
|
+
const InputBox_1 = __importDefault(require("./Input/InputBox"));
|
|
37
|
+
const InputTab_1 = __importDefault(require("./Input/InputTab"));
|
|
38
|
+
const InputSaveSelector_1 = __importDefault(require("./Input/InputSaveSelector"));
|
|
39
|
+
const InputCounter_1 = __importDefault(require("./Input/InputCounter"));
|
|
40
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
41
|
+
const InputAnswerBtn_1 = __importDefault(require("./Input/InputAnswerBtn"));
|
|
42
|
+
const InputWarnning_1 = __importDefault(require("./Input/InputWarnning"));
|
|
43
|
+
const InputNav = ({ question }) => {
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
46
|
+
const [index, setIndex] = react_1.default.useState(0);
|
|
47
|
+
const inputId = question.inputId;
|
|
48
|
+
const InputDB = (0, react_2.useQuery)(db_1.InputSchema);
|
|
49
|
+
const realm = (0, react_2.useRealm)();
|
|
50
|
+
const Input = InputDB.find((data) => data.inputId === inputId);
|
|
51
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
53
52
|
// storeのセーブデータを取得
|
|
54
|
-
|
|
53
|
+
const saveDatas = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.input);
|
|
55
54
|
// カウンターの情報を取得
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(0, react_1.useEffect)(
|
|
55
|
+
const inputSize = (Input === null || Input === void 0 ? void 0 : Input.size) || "lg";
|
|
56
|
+
const limitCnt = lib_1.maxTextLimitInfo[inputSize];
|
|
57
|
+
const currentCnt = ((_a = saveDatas[index]) === null || _a === void 0 ? void 0 : _a.saveText.length) || 0;
|
|
58
|
+
const baseText = Input ? (0, InputFnc_1.createBaseText)(Input.baseText) : "";
|
|
59
|
+
(0, react_1.useEffect)(() => {
|
|
61
60
|
if (Input) {
|
|
62
|
-
|
|
61
|
+
const firstText = (0, InputFnc_1.createBaseText)(Input.baseText);
|
|
63
62
|
dispatch({ type: "quiz/setFirstInput", payload: firstText });
|
|
64
63
|
}
|
|
65
|
-
return
|
|
66
|
-
dispatch(db_1.InputModel.saveStoreInput({ realm
|
|
64
|
+
return () => {
|
|
65
|
+
dispatch(db_1.InputModel.saveStoreInput({ realm, inputId }));
|
|
67
66
|
};
|
|
68
67
|
}, []);
|
|
69
|
-
(0, react_1.useEffect)(
|
|
68
|
+
(0, react_1.useEffect)(() => {
|
|
70
69
|
if (mode === "quiz")
|
|
71
70
|
return;
|
|
72
|
-
Input === null || Input === void 0 ? void 0 : Input.saveInputs.forEach(
|
|
71
|
+
Input === null || Input === void 0 ? void 0 : Input.saveInputs.forEach((data) => {
|
|
73
72
|
dispatch({ type: "quiz/addInput", payload: data });
|
|
74
73
|
});
|
|
75
74
|
}, [mode]);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
const text = ((_b = saveDatas[index]) === null || _b === void 0 ? void 0 : _b.saveText) || "";
|
|
76
|
+
const isSave = ((_c = saveDatas[index]) === null || _c === void 0 ? void 0 : _c.isSave) || false;
|
|
77
|
+
const isCloseSelect = index === saveDatas.length;
|
|
79
78
|
return (<react_native_1.View style={styles.container}>
|
|
80
79
|
<InputWarnning_1.default saveDatas={saveDatas}/>
|
|
81
80
|
<InputTab_1.default selectedIndex={index} setIndex={setIndex}/>
|
|
@@ -89,7 +88,7 @@ var InputNav = function (_a) {
|
|
|
89
88
|
{mode === "quiz" && <InputAnswerBtn_1.default />}
|
|
90
89
|
</react_native_1.View>);
|
|
91
90
|
};
|
|
92
|
-
|
|
91
|
+
const styles = react_native_1.StyleSheet.create({
|
|
93
92
|
container: { flex: 1 },
|
|
94
93
|
bottomBox: {
|
|
95
94
|
flexDirection: "row",
|
|
@@ -3,35 +3,33 @@ 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 choices = multiSel[mTurn];
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_redux_1 = require("react-redux");
|
|
8
|
+
const ChoiceView_1 = __importDefault(require("./ChoiceView"));
|
|
9
|
+
const choiceFnc_1 = require("../function/choiceFnc");
|
|
10
|
+
const getChoiceStyle_1 = require("./styles/getChoiceStyle");
|
|
11
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
12
|
+
const quizActionHook_1 = require("../../hooks/quizActionHook");
|
|
13
|
+
const MultiChoice = ({ question }) => {
|
|
14
|
+
const nextMultiQuizAtion = (0, quizActionHook_1.useNextMultiQuisAction)(question);
|
|
15
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
16
|
+
const { style: quizStyles, yearId, multiSel, selectedIndexes } = question;
|
|
17
|
+
const { isVertical: isUserVertical, isDoublePress } = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption);
|
|
18
|
+
const { turn: mTurn, mode: mMode, isCorrects: mCorrects, } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.multi);
|
|
19
|
+
const choices = multiSel[mTurn];
|
|
21
20
|
// 選択肢を選んだ時の処理
|
|
22
|
-
|
|
21
|
+
const handleChoice = (i) => nextMultiQuizAtion(i);
|
|
23
22
|
// ChoiceViewに必要なロジックを作成(normalとほぼ共通)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var turnSelectedIndex = selectedIndexes[mTurn];
|
|
23
|
+
const wordAndColors = choices.map(({ choice, isCorrect }, i) => {
|
|
24
|
+
const turnSelectedIndex = selectedIndexes[mTurn];
|
|
27
25
|
return {
|
|
28
26
|
word: choice,
|
|
29
27
|
color: (0, getChoiceStyle_1.getChoiceOutlineColor)([turnSelectedIndex], mMode, isCorrect, i),
|
|
30
28
|
};
|
|
31
29
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
const maxChoiceLength = (0, choiceFnc_1.calcMaxChoiceLength)(choices);
|
|
31
|
+
const imgKey = `a${yearId}`;
|
|
32
|
+
const isVertical = (0, getChoiceStyle_1.checkIsVertical)(quizStyles, isUserVertical);
|
|
35
33
|
return (<ChoiceView_1.default wordAndColors={wordAndColors} isDoublePress={isDoublePress} handleChoice={handleChoice} maxChoiceLength={maxChoiceLength} imgKey={imgKey} isVertical={isVertical} isNotSearch={mode === "quiz"} isCorrected={mCorrects[mTurn]}/>);
|
|
36
34
|
};
|
|
37
35
|
exports.default = MultiChoice;
|
|
@@ -3,22 +3,22 @@ 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
|
-
|
|
6
|
+
const common_1 = require("@nakamura-123/common");
|
|
7
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_native_1 = require("react-native");
|
|
10
|
+
const react_redux_1 = require("react-redux");
|
|
11
|
+
const MultiGuide = () => {
|
|
12
|
+
const viewHeight = 20;
|
|
13
|
+
const { turn: mTurn, mode: mMode } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.multi);
|
|
14
|
+
const shouldShow = mMode === "quiz" && mTurn === 0;
|
|
15
15
|
return (<common_1.CollopseView height={viewHeight} visible={shouldShow} style={styles.container}>
|
|
16
16
|
<common_1.MyText fsize="sm" color="red">
|
|
17
17
|
上の赤い□に当てはまるものを選べ
|
|
18
18
|
</common_1.MyText>
|
|
19
19
|
</common_1.CollopseView>);
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
const styles = react_native_1.StyleSheet.create({
|
|
22
22
|
container: {
|
|
23
23
|
justifyContent: "center",
|
|
24
24
|
alignItems: "center",
|
|
@@ -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 onPress = function () {
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const common_1 = require("@nakamura-123/common");
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const react_redux_1 = require("react-redux");
|
|
10
|
+
const MultiNextBtn = ({ question }) => {
|
|
11
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
12
|
+
const { multiSel } = question;
|
|
13
|
+
const { turn: mTurn, mode: mMode } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.multi);
|
|
14
|
+
const isLastCheck = isLastTurn(mTurn, multiSel) && mMode === "check";
|
|
15
|
+
const shouldShow = mMode !== "quiz" && !isLastCheck;
|
|
16
|
+
const onPress = () => {
|
|
18
17
|
dispatch({ type: "quiz/nextTurnMulti" });
|
|
19
18
|
dispatch({ type: "quiz/changeModeMulti", payload: "quiz" });
|
|
20
19
|
};
|
|
@@ -22,10 +21,10 @@ var MultiNextBtn = function (_a) {
|
|
|
22
21
|
<common_1.MiniIconBtn icon="arrow-right" onPress={onPress} title=" 次の選択へ" color="blue" width="49%"/>
|
|
23
22
|
</common_1.CollopseView>);
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
const isLastTurn = (turn, multiSel) => {
|
|
26
25
|
return turn === multiSel.length - 1;
|
|
27
26
|
};
|
|
28
|
-
|
|
27
|
+
const styles = react_native_1.StyleSheet.create({
|
|
29
28
|
container: {
|
|
30
29
|
width: "100%",
|
|
31
30
|
flexDirection: "row",
|
|
@@ -1,65 +1,52 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_redux_1 = require("react-redux");
|
|
8
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
9
|
+
const ChoiceView_1 = __importDefault(require("./ChoiceView"));
|
|
10
|
+
const choiceFnc_1 = require("../function/choiceFnc");
|
|
11
|
+
const getChoiceStyle_1 = require("./styles/getChoiceStyle");
|
|
12
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
13
|
+
const quizActionHook_1 = require("../../hooks/quizActionHook");
|
|
23
14
|
// ここには独自のロジックを書く
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var mode = (0, quizHook_1.useGetMode)();
|
|
15
|
+
const NormalChoice = ({ question }) => {
|
|
16
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
17
|
+
const useHandleCheck = (0, quizActionHook_1.useChangeModeToCheck)();
|
|
18
|
+
const { choices, style: quizStyles, yearId, selectedIndexes } = question;
|
|
19
|
+
const { isVertical: isUserVertical, isDoublePress } = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption);
|
|
20
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
31
21
|
// 選択肢を選んだ時の処理
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
const correctCnt = choices.filter((choice) => choice.isCorrect).length;
|
|
23
|
+
const isCorrected = (question === null || question === void 0 ? void 0 : question.isCorrected) === false ? false : (question === null || question === void 0 ? void 0 : question.isCorrected) || null;
|
|
24
|
+
const handleChoice = (i) => {
|
|
35
25
|
if (mode !== "quiz")
|
|
36
26
|
return;
|
|
37
|
-
|
|
38
|
-
? selectedIndexes.filter(
|
|
39
|
-
:
|
|
27
|
+
const newSelectedIndexes = selectedIndexes.includes(i)
|
|
28
|
+
? selectedIndexes.filter((index) => index !== i)
|
|
29
|
+
: [...selectedIndexes, i];
|
|
40
30
|
dispatch(stores_1.quizAction.replaceSelectedIndex(newSelectedIndexes));
|
|
41
|
-
|
|
31
|
+
const isFinished = newSelectedIndexes.length >= correctCnt;
|
|
42
32
|
if (!isFinished)
|
|
43
33
|
return;
|
|
44
34
|
// 選択肢を選択(複数答えがあるときは全て)選んだ場合、checkモードへ移行する際の処理
|
|
45
|
-
|
|
35
|
+
const isCorrect = newSelectedIndexes.every((index) => { var _a; return (_a = choices[index]) === null || _a === void 0 ? void 0 : _a.isCorrect; });
|
|
46
36
|
// 共通処理
|
|
47
37
|
useHandleCheck && useHandleCheck(isCorrect);
|
|
48
38
|
};
|
|
49
39
|
// 選択肢のアウトラインの色を決める
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
color: (0, getChoiceStyle_1.getChoiceOutlineColor)(selectedIndexes, mode, isCorrect, i),
|
|
55
|
-
});
|
|
56
|
-
});
|
|
40
|
+
const wordAndColors = choices.map(({ choice, isCorrect }, i) => ({
|
|
41
|
+
word: choice,
|
|
42
|
+
color: (0, getChoiceStyle_1.getChoiceOutlineColor)(selectedIndexes, mode, isCorrect, i),
|
|
43
|
+
}));
|
|
57
44
|
// 最大文字数を計算
|
|
58
|
-
|
|
45
|
+
const maxChoiceLength = (0, choiceFnc_1.calcMaxChoiceLength)(choices);
|
|
59
46
|
// imgだった場合、表示させるためのTopKey
|
|
60
|
-
|
|
47
|
+
const imgKey = `a${yearId}`;
|
|
61
48
|
// 縦に4つ並べるか横に2つ並べるかを決める
|
|
62
|
-
|
|
49
|
+
const isVertical = (0, getChoiceStyle_1.checkIsVertical)(quizStyles, isUserVertical);
|
|
63
50
|
return (<ChoiceView_1.default wordAndColors={wordAndColors} isDoublePress={isDoublePress} handleChoice={handleChoice} maxChoiceLength={maxChoiceLength} imgKey={imgKey} isVertical={isVertical} isNotSearch={mode === "quiz"} isCorrected={isCorrected}/>);
|
|
64
51
|
};
|
|
65
52
|
exports.default = NormalChoice;
|
|
@@ -3,24 +3,23 @@ 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
|
-
var number = question === null || question === void 0 ? void 0 : question.ans.length;
|
|
6
|
+
const common_1 = require("@nakamura-123/common");
|
|
7
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_native_1 = require("react-native");
|
|
10
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
11
|
+
const NormalMultiGuide = ({ question }) => {
|
|
12
|
+
const viewHeight = 20;
|
|
13
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
14
|
+
const shouldShow = mode === "quiz" && (question === null || question === void 0 ? void 0 : question.ans.length) > 1;
|
|
15
|
+
const number = question === null || question === void 0 ? void 0 : question.ans.length;
|
|
17
16
|
return (<common_1.CollopseView height={viewHeight} visible={shouldShow} style={styles.container}>
|
|
18
17
|
<common_1.MyText fsize="sm" color="red">
|
|
19
18
|
答えを{number}つ選んでください
|
|
20
19
|
</common_1.MyText>
|
|
21
20
|
</common_1.CollopseView>);
|
|
22
21
|
};
|
|
23
|
-
|
|
22
|
+
const styles = react_native_1.StyleSheet.create({
|
|
24
23
|
container: {
|
|
25
24
|
justifyContent: "center",
|
|
26
25
|
alignItems: "center",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getChoiceOutlineColor = exports.checkIsVertical = exports.getChoiceStyle = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
5
|
+
const getChoiceStyle = (isVertical, maxChoiceLength, color) => {
|
|
6
6
|
return {
|
|
7
7
|
backgroundColor: lib_1.colors.ltBeige,
|
|
8
8
|
flexDirection: "row",
|
|
@@ -16,13 +16,13 @@ var getChoiceStyle = function (isVertical, maxChoiceLength, color) {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
exports.getChoiceStyle = getChoiceStyle;
|
|
19
|
-
|
|
19
|
+
const checkIsVertical = (quizStyles, userSettingVertical) => {
|
|
20
20
|
if (quizStyles.includes("vertical") || userSettingVertical)
|
|
21
21
|
return true;
|
|
22
22
|
return false;
|
|
23
23
|
};
|
|
24
24
|
exports.checkIsVertical = checkIsVertical;
|
|
25
|
-
|
|
25
|
+
const getChoiceOutlineColor = (selectedIndexes, mode, isCorrect, i) => {
|
|
26
26
|
if (__DEV__ && mode === "quiz" && isCorrect)
|
|
27
27
|
return "green"; //これはテスト用です
|
|
28
28
|
if (mode === "quiz")
|
package/dist/quiz/check/Check.js
CHANGED
|
@@ -26,23 +26,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
(0, react_1.useEffect)(function () {
|
|
29
|
+
const react_native_1 = require("react-native");
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const react_2 = require("@realm/react");
|
|
32
|
+
const react_redux_1 = require("react-redux");
|
|
33
|
+
const db_1 = require("@nakamura-123/db");
|
|
34
|
+
const SelectTag_1 = __importDefault(require("./SelectTag"));
|
|
35
|
+
const NextQuizBtn_1 = __importDefault(require("./NextQuizBtn"));
|
|
36
|
+
const quizHook_1 = require("../../hooks/quizHook");
|
|
37
|
+
const BadgeHook_1 = require("../../hooks/BadgeHook");
|
|
38
|
+
const Check = ({ navigation }) => {
|
|
39
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
40
|
+
const realm = (0, react_2.useRealm)();
|
|
41
|
+
const isLastCheckTurn = (0, quizHook_1.useIsLastCheckTurn)();
|
|
42
|
+
const checkBadgeEligibility = (0, BadgeHook_1.useCheckBadgeEligibility)();
|
|
43
|
+
const type = (0, react_redux_1.useSelector)((state) => state.quiz.selected.type);
|
|
44
|
+
(0, react_1.useEffect)(() => {
|
|
46
45
|
if (!isLastCheckTurn)
|
|
47
46
|
return;
|
|
48
47
|
if (type === "test")
|
|
@@ -64,7 +63,7 @@ var Check = function (_a) {
|
|
|
64
63
|
</react_native_1.View>
|
|
65
64
|
</react_native_1.View>);
|
|
66
65
|
};
|
|
67
|
-
|
|
66
|
+
const styles = react_native_1.StyleSheet.create({
|
|
68
67
|
container: {
|
|
69
68
|
flexDirection: "row",
|
|
70
69
|
justifyContent: "space-between",
|
|
@@ -3,30 +3,29 @@ 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 isActiveTurn = turn === activeTurn;
|
|
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 MaterialCommunityIcons_1 = __importDefault(require("@expo/vector-icons/MaterialCommunityIcons"));
|
|
10
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
11
|
+
const common_1 = require("@nakamura-123/common");
|
|
12
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
13
|
+
const quizActionHook_1 = require("../../hooks/quizActionHook");
|
|
14
|
+
const NextQuiz = ({ navigation }) => {
|
|
15
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
16
|
+
const nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
|
|
17
|
+
const { turn, activeTurn, mode } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
|
|
18
|
+
const isResult = mode === "result";
|
|
19
|
+
const isActiveTurn = turn === activeTurn;
|
|
21
20
|
// 画面遷移のための関数を定義
|
|
22
21
|
// 2つのボタンを定義
|
|
23
|
-
|
|
22
|
+
const btnInfo = {
|
|
24
23
|
next: { icon: "gesture-swipe-left", text: "Next" },
|
|
25
24
|
return: { icon: "reply", text: "Return" },
|
|
26
25
|
};
|
|
27
26
|
// ボタンの表示を切り替え
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const btn = isActiveTurn || isResult ? btnInfo.next : btnInfo.return;
|
|
28
|
+
const onPress = () => {
|
|
30
29
|
if (!isActiveTurn && !isResult)
|
|
31
30
|
dispatch(stores_1.quizAction.returnToActiveTurn());
|
|
32
31
|
else if (isResult)
|
|
@@ -43,7 +42,7 @@ var NextQuiz = function (_a) {
|
|
|
43
42
|
</common_1.MyText>
|
|
44
43
|
</react_native_1.Pressable>);
|
|
45
44
|
};
|
|
46
|
-
|
|
45
|
+
const styles = react_native_1.StyleSheet.create({
|
|
47
46
|
button: {
|
|
48
47
|
justifyContent: "center",
|
|
49
48
|
alignItems: "center",
|