@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
package/dist/page/ResultPage.js
CHANGED
|
@@ -31,123 +31,75 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
36
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
34
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
36
|
};
|
|
64
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
_b.sent(); // 少し待つ
|
|
113
|
-
// 4) チェック本体(復元や検証)
|
|
114
|
-
return [4 /*yield*/, dispatch((0, CoinCheck_1.coinCheckFnc)(allFreeId))];
|
|
115
|
-
case 4:
|
|
116
|
-
// 4) チェック本体(復元や検証)
|
|
117
|
-
_b.sent();
|
|
118
|
-
return [3 /*break*/, 10];
|
|
119
|
-
case 5:
|
|
120
|
-
e_1 = _b.sent();
|
|
121
|
-
console.warn("IAP check failed:", e_1);
|
|
122
|
-
return [3 /*break*/, 10];
|
|
123
|
-
case 6:
|
|
124
|
-
_b.trys.push([6, 8, , 9]);
|
|
125
|
-
return [4 /*yield*/, (0, expo_iap_1.endConnection)()];
|
|
126
|
-
case 7:
|
|
127
|
-
_b.sent();
|
|
128
|
-
return [3 /*break*/, 9];
|
|
129
|
-
case 8:
|
|
130
|
-
_a = _b.sent();
|
|
131
|
-
return [3 /*break*/, 9];
|
|
132
|
-
case 9: return [7 /*endfinally*/];
|
|
133
|
-
case 10: return [2 /*return*/];
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const expo_iap_1 = require("expo-iap");
|
|
41
|
+
const common_1 = require("@nakamura-123/common");
|
|
42
|
+
const CharaCard_1 = __importDefault(require("../component/Result/CharaCard"));
|
|
43
|
+
const LessonTitle_1 = __importDefault(require("../component/Result/LessonTitle"));
|
|
44
|
+
const quizHook_1 = require("../hooks/quizHook");
|
|
45
|
+
const ScoreCircle_1 = __importDefault(require("../component/Result/ScoreCircle"));
|
|
46
|
+
const QuizFlatList_1 = __importDefault(require("../component/Result/QuizFlatList"));
|
|
47
|
+
const react_redux_1 = require("react-redux");
|
|
48
|
+
const CoinCheck_1 = require("../component/Coin/CoinCheck");
|
|
49
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
50
|
+
const AdCard_1 = __importDefault(require("../component/Result/AdCard"));
|
|
51
|
+
const CoinFnc_1 = require("../component/Coin/CoinFnc");
|
|
52
|
+
const ResultPage = ({ navigation }) => {
|
|
53
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
54
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
55
|
+
const allFreeId = (0, react_redux_1.useSelector)((state) => { var _a; return ((_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.payment.items.allFreeId) || ""; });
|
|
56
|
+
const { allFreeState, lastCheckedDate } = (0, react_redux_1.useSelector)((state) => state.setting.payment);
|
|
57
|
+
const isJLPT = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.appSystem) === "JLPT";
|
|
58
|
+
const isCompletelyFree = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.payment.isCompletelyFree; }) || false;
|
|
59
|
+
const items = allFreeId ? [allFreeId] : [];
|
|
60
|
+
(0, react_1.useEffect)(() => {
|
|
61
|
+
let cancelled = false;
|
|
62
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
+
// 1) チェック要否判定(3日に1回など)
|
|
64
|
+
const need = (0, CoinCheck_1.isCheckRequired)(allFreeState, lastCheckedDate, isCompletelyFree);
|
|
65
|
+
if (!need)
|
|
66
|
+
return;
|
|
67
|
+
try {
|
|
68
|
+
// 2) ここで「実行した」という事実を記録(3日間の再実行防止)
|
|
69
|
+
const todayStr = lib_1.timeFnc.getTodayString();
|
|
70
|
+
dispatch({ type: "setting/updateLastCheckedDate", payload: todayStr });
|
|
71
|
+
// 3) 接続
|
|
72
|
+
// --- expo-iap ---
|
|
73
|
+
yield (0, CoinFnc_1.initializeIAP)(items);
|
|
74
|
+
yield new Promise((r) => setTimeout(r, 5000)); // 少し待つ
|
|
75
|
+
// 4) チェック本体(復元や検証)
|
|
76
|
+
yield dispatch((0, CoinCheck_1.coinCheckFnc)(allFreeId));
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
console.warn("IAP check failed:", e);
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
// 5) 必ず切断(成功・失敗問わず)
|
|
83
|
+
try {
|
|
84
|
+
yield (0, expo_iap_1.endConnection)();
|
|
134
85
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
86
|
+
catch (_a) { }
|
|
87
|
+
}
|
|
88
|
+
}))();
|
|
89
|
+
return () => {
|
|
138
90
|
cancelled = true;
|
|
139
91
|
};
|
|
140
92
|
// 依存は必要最小限。チェック条件が変わった時だけ再評価されるように。
|
|
141
93
|
}, []);
|
|
142
|
-
|
|
94
|
+
const scoreInfo = (0, quizHook_1.useScoreInfo)();
|
|
143
95
|
return (<react_native_1.View style={styles.page}>
|
|
144
96
|
{!isJLPT && <AdCard_1.default />}
|
|
145
97
|
<CharaCard_1.default scoreInfo={scoreInfo}/>
|
|
146
98
|
<LessonTitle_1.default />
|
|
147
99
|
<ScoreCircle_1.default scoreInfo={scoreInfo}/>
|
|
148
100
|
<react_native_1.View style={styles.btnBox}>
|
|
149
|
-
<common_1.MiniIconBtn onPress={
|
|
150
|
-
<common_1.MiniIconBtn onPress={
|
|
101
|
+
<common_1.MiniIconBtn onPress={() => navigation.navigate("Grade")} icon="chart-line" title={t("quiz.resultBtn.grade")} color="green" outerStyle={styles.miniBtnOuter}/>
|
|
102
|
+
<common_1.MiniIconBtn onPress={() => navigation.goBack()} icon="arrow-left" title={t("quiz.resultBtn.back")} color="blue" outerStyle={styles.miniBtnOuter}/>
|
|
151
103
|
</react_native_1.View>
|
|
152
104
|
<QuizFlatList_1.default navigation={navigation}/>
|
|
153
105
|
{/* <Button
|
|
@@ -159,7 +111,7 @@ var ResultPage = function (_a) {
|
|
|
159
111
|
/> */}
|
|
160
112
|
</react_native_1.View>);
|
|
161
113
|
};
|
|
162
|
-
|
|
114
|
+
const styles = react_native_1.StyleSheet.create({
|
|
163
115
|
page: {
|
|
164
116
|
flex: 1,
|
|
165
117
|
justifyContent: "center",
|
package/dist/page/SettingPage.js
CHANGED
|
@@ -3,59 +3,54 @@ 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 oldInfo = (0, react_redux_1.useSelector)(function (state) { return state.app.appSetting.oldInfo; });
|
|
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 react_2 = require("@realm/react");
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
12
|
+
const db_1 = require("@nakamura-123/db");
|
|
13
|
+
const oldStorageFnc_1 = require("../functions/oldStorageFnc");
|
|
14
|
+
const SettingPage = ({ navigation }) => {
|
|
15
|
+
const realm = (0, react_2.useRealm)();
|
|
16
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
17
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
18
|
+
const existInputQuiz = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.existInputQuiz; });
|
|
19
|
+
const oldInfo = (0, react_redux_1.useSelector)((state) => state.app.appSetting.oldInfo);
|
|
21
20
|
// 古いデータの移行ボタンを表示するかどうかの判定
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const displayOldSystemBtn = Array.isArray(oldInfo === null || oldInfo === void 0 ? void 0 : oldInfo.testInfo) && oldInfo.testInfo.length > 0;
|
|
22
|
+
const isJLPT = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.appSystem) === "JLPT";
|
|
23
|
+
let settingInfo = [
|
|
25
24
|
{
|
|
26
25
|
title: t("setting.tag.title"),
|
|
27
26
|
note: t("setting.tag.note"),
|
|
28
27
|
icon: "tag",
|
|
29
28
|
color: "green",
|
|
30
|
-
handlePress:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, t("setting.alert.title"), t("setting.alert.cancel"), t("setting.alert.delete"));
|
|
35
|
-
},
|
|
29
|
+
handlePress: () => lib_1.utilFnc.showConfirmationAlert(t("setting.tag.question"), () => {
|
|
30
|
+
db_1.TagModel.toL1AllTags(realm);
|
|
31
|
+
react_native_1.Alert.alert(t("setting.tag.complete"), t("setting.tag.completeMsg"));
|
|
32
|
+
}, t("setting.alert.title"), t("setting.alert.cancel"), t("setting.alert.delete")),
|
|
36
33
|
},
|
|
37
34
|
{
|
|
38
35
|
title: t("setting.deleteAll.title"),
|
|
39
36
|
note: t("setting.deleteAll.note"),
|
|
40
37
|
icon: "trash",
|
|
41
38
|
color: "green",
|
|
42
|
-
handlePress:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, t("setting.alert.title"), t("setting.alert.cancel"), t("setting.alert.delete"));
|
|
51
|
-
},
|
|
39
|
+
handlePress: () => lib_1.utilFnc.showConfirmationAlert(t("setting.deleteAll.question"), () => {
|
|
40
|
+
db_1.MinitestModel.deleteMiniTest(realm);
|
|
41
|
+
db_1.TestModel.deleteTest(realm);
|
|
42
|
+
db_1.BootModel.deleteBoot(realm);
|
|
43
|
+
db_1.BadgeModel.handleDeleteBadge(realm);
|
|
44
|
+
db_1.DailyLogModel.deleteAllDailyLogs(realm);
|
|
45
|
+
react_native_1.Alert.alert(t("setting.deleteAll.complete"), t("setting.deleteAll.completeMsg"));
|
|
46
|
+
}, t("setting.alert.title"), t("setting.alert.cancel"), t("setting.alert.delete")),
|
|
52
47
|
},
|
|
53
48
|
{
|
|
54
49
|
title: t("setting.oldSystem.title"),
|
|
55
50
|
note: t("setting.oldSystem.note"),
|
|
56
51
|
icon: "exchange-alt",
|
|
57
52
|
color: "yellow",
|
|
58
|
-
handlePress:
|
|
53
|
+
handlePress: () => {
|
|
59
54
|
if (!oldInfo || !oldInfo.testInfo || oldInfo.testInfo.length < 1)
|
|
60
55
|
react_native_1.Alert.alert(t("setting.oldSystem.error"), t("setting.oldSystem.errorMsg"));
|
|
61
56
|
else
|
|
@@ -65,25 +60,25 @@ var SettingPage = function (_a) {
|
|
|
65
60
|
];
|
|
66
61
|
// JLPTの場合、古いデータを移行するボタンを削除
|
|
67
62
|
if (isJLPT)
|
|
68
|
-
settingInfo = settingInfo.filter(
|
|
63
|
+
settingInfo = settingInfo.filter((info) => info.title !== t("setting.oldSystem.title"));
|
|
69
64
|
if (!displayOldSystemBtn)
|
|
70
|
-
settingInfo = settingInfo.filter(
|
|
65
|
+
settingInfo = settingInfo.filter((info) => info.title !== t("setting.oldSystem.title"));
|
|
71
66
|
if (existInputQuiz)
|
|
72
67
|
settingInfo.push({
|
|
73
68
|
title: t("setting.saveInput.title"),
|
|
74
69
|
note: t("setting.saveInput.note"),
|
|
75
70
|
icon: "cloud-upload-alt",
|
|
76
71
|
color: "blue",
|
|
77
|
-
handlePress:
|
|
72
|
+
handlePress: () => navigation.navigate("OnlineInput"),
|
|
78
73
|
});
|
|
79
74
|
return (<react_native_1.View style={styles.container}>
|
|
80
75
|
{/* データ消去 */}
|
|
81
|
-
{settingInfo.map(
|
|
76
|
+
{settingInfo.map((info) => (<common_1.RectangleCard key={info.title} title={info.title} note={info.note} left={<common_1.IconInCircle name={info.icon} size={25}/>} onPress={info.handlePress} color={info.color} outerStyle={{ marginBottom: 20 }}/>))}
|
|
82
77
|
{/* 音量調節 */}
|
|
83
78
|
{/* <QuizOptionSelector type="soundVolume" /> */}
|
|
84
79
|
</react_native_1.View>);
|
|
85
80
|
};
|
|
86
|
-
|
|
81
|
+
const styles = react_native_1.StyleSheet.create({
|
|
87
82
|
container: {
|
|
88
83
|
flex: 1,
|
|
89
84
|
padding: 20,
|
package/dist/page/TestPage.js
CHANGED
|
@@ -3,45 +3,44 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var QuestionInfo = (0, basicHook_1.useGetQuestionQuery)();
|
|
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 react_2 = require("@realm/react");
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const db_1 = require("@nakamura-123/db");
|
|
12
|
+
const Badge5s_1 = __importDefault(require("../component/Basic/Badge5s"));
|
|
13
|
+
const Square3s_1 = __importDefault(require("../component/TestPage/Square3s"));
|
|
14
|
+
const AverageBar_1 = __importDefault(require("../component/TestPage/AverageBar"));
|
|
15
|
+
const Paw5s_1 = __importDefault(require("../component/Basic/Paw5s"));
|
|
16
|
+
const testFnc_1 = require("../functions/testFnc");
|
|
17
|
+
const createQuizFncD_1 = require("../functions/createQuizFncD");
|
|
18
|
+
const QuizSaveData_1 = __importDefault(require("../quiz/save/QuizSaveData"));
|
|
19
|
+
const BarChartContainer_1 = __importDefault(require("../component/TestPage/BarChartContainer"));
|
|
20
|
+
const quizActionHook_1 = require("../hooks/quizActionHook");
|
|
21
|
+
const Discription_1 = __importDefault(require("../component/Discription"));
|
|
22
|
+
const basicHook_1 = require("../hooks/basicHook");
|
|
23
|
+
const createQuizFncJ_1 = require("../functions/createQuizFncJ");
|
|
24
|
+
const TestPage = react_1.default.memo(({ navigation, subject }) => {
|
|
25
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
26
|
+
const useStartQuiz = (0, quizActionHook_1.useStartQuizAction)();
|
|
27
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
28
|
+
const TestDB = (0, react_2.useQuery)(db_1.TestSchema);
|
|
29
|
+
const QuestionInfo = (0, basicHook_1.useGetQuestionQuery)();
|
|
31
30
|
// const QuestionDB = useQuery(DQuestionSchema);
|
|
32
|
-
|
|
31
|
+
const isExistedSaveData = (0, react_redux_1.useSelector)((state) => state.score.isSave[subject.name]);
|
|
33
32
|
// Reduxから必要なデータを一括取得
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const quizCnt = subject.cnt;
|
|
34
|
+
const title = subject.title;
|
|
35
|
+
const isUnitType = "unit" in subject;
|
|
37
36
|
// アベレージバーのデータ生成
|
|
38
|
-
|
|
37
|
+
const average = (0, react_redux_1.useSelector)((state) => state.score.test.average);
|
|
39
38
|
// 課金ロック
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const isLocked = common_1.commonHook.useIsLocked("test");
|
|
40
|
+
const iconName = isLocked ? "lock" : "clipboard";
|
|
42
41
|
// スタートボタンの設定
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const cntByLevels = (0, testFnc_1.getTestLevelCnts)(TestDB, subject.name);
|
|
43
|
+
const handleStart = () => {
|
|
45
44
|
if (isLocked) {
|
|
46
45
|
navigation.navigate("Coin");
|
|
47
46
|
return;
|
|
@@ -52,13 +51,13 @@ var TestPage = react_1.default.memo(function (_a) {
|
|
|
52
51
|
subject: subject.name,
|
|
53
52
|
type: "test",
|
|
54
53
|
category: quizCnt, //これはいらないけど入れておく
|
|
55
|
-
lesson: { title
|
|
54
|
+
lesson: { title, key: quizCnt },
|
|
56
55
|
},
|
|
57
56
|
});
|
|
58
57
|
// クイズ作成
|
|
59
|
-
|
|
58
|
+
let quizList = [];
|
|
60
59
|
if (QuestionInfo.system === "JLPT") {
|
|
61
|
-
|
|
60
|
+
const tagName = subject.tagName || "basicTag";
|
|
62
61
|
quizList = (0, createQuizFncJ_1.getTestQuestionsJ)(QuestionInfo.query, quizCnt, tagName);
|
|
63
62
|
}
|
|
64
63
|
else {
|
|
@@ -66,13 +65,13 @@ var TestPage = react_1.default.memo(function (_a) {
|
|
|
66
65
|
? (0, createQuizFncD_1.getTestQuestionsByUnit)(QuestionInfo.query, quizCnt, subject.unit)
|
|
67
66
|
: (0, createQuizFncD_1.getTestQuestions)(QuestionInfo.query, quizCnt);
|
|
68
67
|
}
|
|
69
|
-
|
|
68
|
+
const isExistQuiz = useStartQuiz(subject.name, quizList);
|
|
70
69
|
if (!isExistQuiz)
|
|
71
70
|
return;
|
|
72
71
|
navigation.navigate("Quiz");
|
|
73
72
|
};
|
|
74
73
|
// ヒストリーParams
|
|
75
|
-
|
|
74
|
+
const historyParams = {
|
|
76
75
|
subject: subject.name,
|
|
77
76
|
db: "test",
|
|
78
77
|
};
|
|
@@ -84,11 +83,9 @@ var TestPage = react_1.default.memo(function (_a) {
|
|
|
84
83
|
<AverageBar_1.default percent={average} label={t("test.barLabel")}/>
|
|
85
84
|
<BarChartContainer_1.default subjectName={subject.name} TestDB={TestDB}/>
|
|
86
85
|
<react_native_1.View style={styles.test}>
|
|
87
|
-
<common_1.RectangleCard title={title} color="red" left={<common_1.IconInCircle name={iconName} circleColor="ltRed" size={25}/>} bottom={<Paw5s_1.default levels={cntByLevels} quizCnt={quizCnt + "問"}/>} onPress={
|
|
86
|
+
<common_1.RectangleCard title={title} color="red" left={<common_1.IconInCircle name={iconName} circleColor="ltRed" size={25}/>} bottom={<Paw5s_1.default levels={cntByLevels} quizCnt={quizCnt + "問"}/>} onPress={() => handleStart()}/>
|
|
88
87
|
</react_native_1.View>
|
|
89
|
-
<common_1.RoundRectangleIcon title={t("test.showHistory")} onPress={
|
|
90
|
-
return navigation.navigate("History", { info: historyParams });
|
|
91
|
-
}} icon="history"/>
|
|
88
|
+
<common_1.RoundRectangleIcon title={t("test.showHistory")} onPress={() => navigation.navigate("History", { info: historyParams })} icon="history"/>
|
|
92
89
|
|
|
93
90
|
<react_native_1.View style={{ height: 50 }}/>
|
|
94
91
|
{isExistedSaveData && <react_native_1.View style={{ height: 100 }}/>}
|
|
@@ -98,7 +95,7 @@ var TestPage = react_1.default.memo(function (_a) {
|
|
|
98
95
|
</react_native_1.View>
|
|
99
96
|
</react_native_1.SafeAreaView>);
|
|
100
97
|
});
|
|
101
|
-
|
|
98
|
+
const styles = react_native_1.StyleSheet.create({
|
|
102
99
|
container: {
|
|
103
100
|
padding: 20,
|
|
104
101
|
marginTop: 20,
|
|
@@ -26,24 +26,23 @@ 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 scrollRef = (0, react_1.useRef)(null);
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_native_1 = require("react-native");
|
|
31
|
+
const Title_1 = __importDefault(require("./Title"));
|
|
32
|
+
const Question_1 = __importDefault(require("./question/Question"));
|
|
33
|
+
const Answer_1 = __importDefault(require("./answer/Answer"));
|
|
34
|
+
const CorrectedBar_1 = __importDefault(require("./explain/CorrectedBar"));
|
|
35
|
+
const Explain_1 = __importDefault(require("./explain/Explain"));
|
|
36
|
+
const CollapseExplain_1 = __importDefault(require("./answer/Input/CollapseExplain"));
|
|
37
|
+
const Guide_1 = __importDefault(require("../component/Guide"));
|
|
38
|
+
const common_1 = require("@nakamura-123/common");
|
|
39
|
+
const Bottom3Btn_1 = __importDefault(require("./setting/Bottom3Btn"));
|
|
40
|
+
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
41
|
+
const PageContainerWrap_1 = __importDefault(require("./common/PageContainerWrap"));
|
|
42
|
+
const QuizContentDrill = ({ navigation, guideName, showSwipe1Guide, showSwipe2Guide, isCheck, isResult, isNotInput, isNotQuiz, isInputQuizMode, turn, }) => {
|
|
43
|
+
const scrollRef = (0, react_1.useRef)(null);
|
|
45
44
|
// ターン変更時にスクロール位置をリセット
|
|
46
|
-
(0, react_1.useEffect)(
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
47
46
|
var _a;
|
|
48
47
|
(_a = scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({ y: 0, animated: true });
|
|
49
48
|
}, [turn]);
|
|
@@ -64,7 +63,7 @@ var QuizContentDrill = function (_a) {
|
|
|
64
63
|
</PageContainerWrap_1.default>
|
|
65
64
|
</react_native_gesture_handler_1.ScrollView>);
|
|
66
65
|
};
|
|
67
|
-
|
|
66
|
+
const styles = react_native_1.StyleSheet.create({
|
|
68
67
|
container: { paddingTop: 20 },
|
|
69
68
|
});
|
|
70
69
|
exports.default = QuizContentDrill;
|
|
@@ -3,14 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var navigation = _a.navigation, guideName = _a.guideName, showSwipe1Guide = _a.showSwipe1Guide, showSwipe2Guide = _a.showSwipe2Guide;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const Guide_1 = __importDefault(require("../component/Guide"));
|
|
9
|
+
const PageContainerWrap_1 = __importDefault(require("./common/PageContainerWrap"));
|
|
10
|
+
const JQuestion_1 = __importDefault(require("./jQuestion/JQuestion"));
|
|
11
|
+
const JAnswer_1 = __importDefault(require("./jAnswer/JAnswer"));
|
|
12
|
+
const QuizContentDrill = ({ navigation, guideName, showSwipe1Guide, showSwipe2Guide, }) => {
|
|
14
13
|
return (<PageContainerWrap_1.default scrollViewRef={null} navigation={navigation}>
|
|
15
14
|
<Guide_1.default name={guideName} isVisible={showSwipe1Guide || showSwipe2Guide}>
|
|
16
15
|
<react_native_1.View></react_native_1.View>
|
|
@@ -22,7 +21,7 @@ var QuizContentDrill = function (_a) {
|
|
|
22
21
|
<></>
|
|
23
22
|
</PageContainerWrap_1.default>);
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
const styles = react_native_1.StyleSheet.create({
|
|
26
25
|
container: {
|
|
27
26
|
flex: 1,
|
|
28
27
|
justifyContent: "space-between",
|
package/dist/quiz/Title.js
CHANGED
|
@@ -3,33 +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
|
-
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const react_redux_1 = require("react-redux");
|
|
9
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const quizHook_1 = require("../hooks/quizHook");
|
|
12
|
+
const QuizTitle = () => {
|
|
13
13
|
var _a;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const { turn, score, activeTurn, mode: activeMode, } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
|
|
15
|
+
const mode = (0, quizHook_1.useGetMode)();
|
|
16
|
+
const question = (0, quizHook_1.useQuestionDataD)();
|
|
17
|
+
const allQuizCnt = (0, react_redux_1.useSelector)((state) => state.quiz.quizList.length);
|
|
18
|
+
const isShowTag = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption.isShowTag);
|
|
19
19
|
if (!question)
|
|
20
20
|
return null;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const title = question.title;
|
|
22
|
+
const tagColor = ((_a = lib_1.tagLevels.find((tag) => tag.level === question.tag)) === null || _a === void 0 ? void 0 : _a.color) || "ltBlack";
|
|
23
|
+
const isActiveTurn = activeTurn === turn;
|
|
24
24
|
// 0 を有効値として扱うため nullish 合体を使用
|
|
25
|
-
|
|
25
|
+
const base = activeTurn !== null && activeTurn !== void 0 ? activeTurn : 1;
|
|
26
26
|
// 非 quiz かつ(同一ターン or activeMode が quiz 以外)なら +1
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const shouldIncrement = mode !== "quiz" && (isActiveTurn || activeMode !== "quiz");
|
|
28
|
+
const rateCnt = base + (shouldIncrement ? 1 : 0);
|
|
29
|
+
const rate = Math.round((score / rateCnt) * 100).toString();
|
|
30
30
|
// 文章
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const cntText = `${turn + 1}/${allQuizCnt}問目`;
|
|
32
|
+
const correctText = ` ${score}問正解(${rate}%)`;
|
|
33
33
|
return (<react_native_1.View style={styles.container}>
|
|
34
34
|
<react_native_1.View style={{ flexDirection: "row", alignItems: "center" }}>
|
|
35
35
|
{isShowTag && <common_1.Icon5 name="tag" size={15} color={tagColor}/>}
|
|
@@ -47,7 +47,7 @@ var QuizTitle = function () {
|
|
|
47
47
|
</react_native_1.View>
|
|
48
48
|
</react_native_1.View>);
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
const styles = react_native_1.StyleSheet.create({
|
|
51
51
|
container: {
|
|
52
52
|
flexDirection: "column",
|
|
53
53
|
justifyContent: "center",
|