@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
|
@@ -8,217 +8,94 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
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);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
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;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
12
|
exports.existOldData = exports.handleOldData = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
13
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
14
|
+
const db_1 = require("@nakamura-123/db");
|
|
15
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
16
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
17
|
+
const CoinFnc_1 = require("../component/Coin/CoinFnc");
|
|
18
|
+
const react_native_1 = require("react-native");
|
|
19
|
+
const { loadOldData } = stores_1.oldStorage;
|
|
47
20
|
// 00. プログラムの総まとめ
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
_a.sent();
|
|
64
|
-
return [4 /*yield*/, (0, CoinFnc_1.restorePurchases)(dispatch)];
|
|
65
|
-
case 3:
|
|
66
|
-
_a.sent();
|
|
67
|
-
react_native_1.Alert.alert(t("setting.oldSystem.complete"), t("setting.oldSystem.completeMsg"));
|
|
68
|
-
return [3 /*break*/, 5];
|
|
69
|
-
case 4:
|
|
70
|
-
react_native_1.Alert.alert(t("setting.oldSystem.error"), t("setting.oldSystem.errorMsg2"));
|
|
71
|
-
_a.label = 5;
|
|
72
|
-
case 5: return [2 /*return*/];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}); }, t("setting.alert.title"), t("setting.alert.cancel"), t("setting.oldSystem.btn"), function () {
|
|
76
|
-
console.log("キャンセル");
|
|
77
|
-
});
|
|
78
|
-
return [2 /*return*/];
|
|
21
|
+
const handleOldData = (realm, oldInfo, dispatch, t, msg) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
const ALART_MSG = msg || t("setting.oldSystem.question");
|
|
23
|
+
lib_1.utilFnc.showConfirmationAlert(ALART_MSG, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
dispatch(stores_1.settingStorage.saveSetting());
|
|
25
|
+
if (oldInfo) {
|
|
26
|
+
yield loadingAllOldData(realm, oldInfo);
|
|
27
|
+
yield dispatch(loadOldInputId());
|
|
28
|
+
yield (0, CoinFnc_1.restorePurchases)(dispatch);
|
|
29
|
+
react_native_1.Alert.alert(t("setting.oldSystem.complete"), t("setting.oldSystem.completeMsg"));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
react_native_1.Alert.alert(t("setting.oldSystem.error"), t("setting.oldSystem.errorMsg2"));
|
|
33
|
+
}
|
|
34
|
+
}), t("setting.alert.title"), t("setting.alert.cancel"), t("setting.oldSystem.btn"), () => {
|
|
35
|
+
console.log("キャンセル");
|
|
79
36
|
});
|
|
80
|
-
});
|
|
37
|
+
});
|
|
81
38
|
exports.handleOldData = handleOldData;
|
|
82
39
|
// 01. すべてのデータをまとめる
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
case 2:
|
|
91
|
-
_a.sent();
|
|
92
|
-
return [4 /*yield*/, replaceOldTagData(realm, oldInfo.yearIdTrans)];
|
|
93
|
-
case 3:
|
|
94
|
-
_a.sent();
|
|
95
|
-
return [4 /*yield*/, addOldDailyLogData(realm)];
|
|
96
|
-
case 4:
|
|
97
|
-
_a.sent();
|
|
98
|
-
return [4 /*yield*/, replaceOldInputData(realm)];
|
|
99
|
-
case 5:
|
|
100
|
-
_a.sent();
|
|
101
|
-
return [2 /*return*/];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}); };
|
|
40
|
+
const loadingAllOldData = (realm, oldInfo) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
yield addOldTestData(realm, oldInfo.testInfo);
|
|
42
|
+
yield addOldBootData(realm);
|
|
43
|
+
yield replaceOldTagData(realm, oldInfo.yearIdTrans);
|
|
44
|
+
yield addOldDailyLogData(realm);
|
|
45
|
+
yield replaceOldInputData(realm);
|
|
46
|
+
});
|
|
105
47
|
// 10. テストデータの読み込み
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (!testData)
|
|
114
|
-
return [2 /*return*/];
|
|
115
|
-
realmInfos = testData.map(function (data) {
|
|
116
|
-
return stores_1.oldStorage.formatOldTestData(data, typeInfos);
|
|
117
|
-
});
|
|
118
|
-
return [4 /*yield*/, db_1.TestModel.createOldTests(realm, realmInfos)];
|
|
119
|
-
case 2:
|
|
120
|
-
_a.sent();
|
|
121
|
-
return [2 /*return*/];
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}); };
|
|
48
|
+
const addOldTestData = (realm, typeInfos) => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
const testData = yield loadOldData("test");
|
|
50
|
+
if (!testData)
|
|
51
|
+
return;
|
|
52
|
+
const realmInfos = testData.map((data) => stores_1.oldStorage.formatOldTestData(data, typeInfos));
|
|
53
|
+
yield db_1.TestModel.createOldTests(realm, realmInfos);
|
|
54
|
+
});
|
|
125
55
|
// 20. 集中特訓データの読み込み
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (!bootData)
|
|
134
|
-
return [2 /*return*/];
|
|
135
|
-
realmInfos = bootData.map(function (data) { return stores_1.oldStorage.formatOldBootData(data); });
|
|
136
|
-
return [4 /*yield*/, db_1.BootModel.createOldBoots(realm, realmInfos)];
|
|
137
|
-
case 2:
|
|
138
|
-
_a.sent();
|
|
139
|
-
return [2 /*return*/];
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}); };
|
|
56
|
+
const addOldBootData = (realm) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
+
const bootData = yield loadOldData("focus");
|
|
58
|
+
if (!bootData)
|
|
59
|
+
return;
|
|
60
|
+
const realmInfos = bootData.map((data) => stores_1.oldStorage.formatOldBootData(data));
|
|
61
|
+
yield db_1.BootModel.createOldBoots(realm, realmInfos);
|
|
62
|
+
});
|
|
143
63
|
// 30. タグデータの読み込み
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
markData = _a.sent();
|
|
154
|
-
if (!markData)
|
|
155
|
-
return [2 /*return*/];
|
|
156
|
-
realmInfos = stores_1.oldStorage.formatOldMarkData(markData, yearIdTrans);
|
|
157
|
-
db_1.TagModel.updateOldTags(realm, realmInfos);
|
|
158
|
-
return [2 /*return*/];
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
}); };
|
|
64
|
+
const replaceOldTagData = (realm, yearIdTrans) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
+
if (!yearIdTrans)
|
|
66
|
+
return;
|
|
67
|
+
const markData = yield loadOldData("mark");
|
|
68
|
+
if (!markData)
|
|
69
|
+
return;
|
|
70
|
+
const realmInfos = stores_1.oldStorage.formatOldMarkData(markData, yearIdTrans);
|
|
71
|
+
db_1.TagModel.updateOldTags(realm, realmInfos);
|
|
72
|
+
});
|
|
162
73
|
// 40. DailyLogデータの読み込み
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if (!dailyLogData)
|
|
171
|
-
return [2 /*return*/];
|
|
172
|
-
realmInfo = stores_1.oldStorage.formatOldGradeData(dailyLogData);
|
|
173
|
-
db_1.DailyLogModel.createDailyLogs(realm, realmInfo);
|
|
174
|
-
return [2 /*return*/];
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
}); };
|
|
74
|
+
const addOldDailyLogData = (realm) => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
+
const dailyLogData = yield loadOldData("grade");
|
|
76
|
+
if (!dailyLogData)
|
|
77
|
+
return;
|
|
78
|
+
const realmInfo = stores_1.oldStorage.formatOldGradeData(dailyLogData);
|
|
79
|
+
db_1.DailyLogModel.createDailyLogs(realm, realmInfo);
|
|
80
|
+
});
|
|
178
81
|
// 50. inputデータの読み込み
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (!inputDatas)
|
|
187
|
-
return [2 /*return*/];
|
|
188
|
-
inputIdAndSaves = inputDatas.map(function (data) {
|
|
189
|
-
return stores_1.oldStorage.formatOldInputData(data);
|
|
190
|
-
});
|
|
191
|
-
db_1.InputModel.updateSaveText(realm, inputIdAndSaves);
|
|
192
|
-
return [2 /*return*/];
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
}); };
|
|
82
|
+
const replaceOldInputData = (realm) => __awaiter(void 0, void 0, void 0, function* () {
|
|
83
|
+
const inputDatas = yield loadOldData("saveTxts");
|
|
84
|
+
if (!inputDatas)
|
|
85
|
+
return;
|
|
86
|
+
const inputIdAndSaves = inputDatas.map((data) => stores_1.oldStorage.formatOldInputData(data));
|
|
87
|
+
db_1.InputModel.updateSaveText(realm, inputIdAndSaves);
|
|
88
|
+
});
|
|
196
89
|
// 60. inputIdの読み込み(reduxThunk)
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
case 1:
|
|
204
|
-
id = _c.sent();
|
|
205
|
-
if (!id)
|
|
206
|
-
return [2 /*return*/];
|
|
207
|
-
dispatch({ type: "setting/updateOldId", payload: id[0] });
|
|
208
|
-
return [2 /*return*/];
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
}); });
|
|
90
|
+
const loadOldInputId = (0, toolkit_1.createAsyncThunk)("old/loadOldInputId", (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { dispatch }) {
|
|
91
|
+
const id = yield loadOldData("id");
|
|
92
|
+
if (!id)
|
|
93
|
+
return;
|
|
94
|
+
dispatch({ type: "setting/updateOldId", payload: id[0] });
|
|
95
|
+
}));
|
|
212
96
|
// 90. 旧データの存在をMarkデータから確認
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
return
|
|
216
|
-
|
|
217
|
-
case 0: return [4 /*yield*/, loadOldData("mark")];
|
|
218
|
-
case 1:
|
|
219
|
-
markData = _a.sent();
|
|
220
|
-
return [2 /*return*/, markData !== null]; // null チェックを簡潔に
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
}); };
|
|
97
|
+
const existOldData = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
98
|
+
const markData = yield loadOldData("mark");
|
|
99
|
+
return markData !== null; // null チェックを簡潔に
|
|
100
|
+
});
|
|
224
101
|
exports.existOldData = existOldData;
|
|
@@ -1,76 +1,67 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.commonFilter = exports.filterByTags = exports.filterByOutOfUnitRange = exports.filterByOutOfYearRange = exports.getSubYearQuestions = exports.getYearQuestions = exports.getSubUnitQuestions = exports.getUnitQuestions = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
5
|
+
const filters = {
|
|
15
6
|
unit: "unitId == $0 && subUnitId == $1",
|
|
16
7
|
unitTop: "unitId == $0",
|
|
17
8
|
year: "yearId == $0 && subYearId == $1",
|
|
18
9
|
yearTop: "yearId == $0",
|
|
19
10
|
};
|
|
20
11
|
// 01_単元別(大単元)の抽出
|
|
21
|
-
|
|
12
|
+
const getUnitQuestions = (questions, unitId) => {
|
|
22
13
|
return questions.filtered(filters.unitTop, unitId);
|
|
23
14
|
};
|
|
24
15
|
exports.getUnitQuestions = getUnitQuestions;
|
|
25
16
|
// 02_単元別(小単元)の抽出
|
|
26
|
-
|
|
17
|
+
const getSubUnitQuestions = (questions, unitId, subUnitId) => {
|
|
27
18
|
return questions.filtered(filters.unit, unitId, subUnitId);
|
|
28
19
|
};
|
|
29
20
|
exports.getSubUnitQuestions = getSubUnitQuestions;
|
|
30
21
|
// 03_年度別(大単元)の抽出
|
|
31
|
-
|
|
22
|
+
const getYearQuestions = (questions, year) => {
|
|
32
23
|
return questions.filtered(filters.yearTop, year);
|
|
33
24
|
};
|
|
34
25
|
exports.getYearQuestions = getYearQuestions;
|
|
35
26
|
// 04_年度別(小単元)の抽出
|
|
36
|
-
|
|
27
|
+
const getSubYearQuestions = (questions, year, key) => {
|
|
37
28
|
return questions.filtered(filters.year, year, key);
|
|
38
29
|
};
|
|
39
30
|
exports.getSubYearQuestions = getSubYearQuestions;
|
|
40
31
|
// 05_試験範囲外の問題を除外(year)
|
|
41
|
-
|
|
32
|
+
const filterByOutOfYearRange = (questions, outOfYearRange) => {
|
|
42
33
|
if (outOfYearRange.length === 0)
|
|
43
34
|
return questions;
|
|
44
|
-
|
|
45
|
-
.map(
|
|
35
|
+
const condition = outOfYearRange
|
|
36
|
+
.map((_, index) => `yearId != $${index}`)
|
|
46
37
|
.join(" AND ");
|
|
47
|
-
|
|
38
|
+
const filteredQuestions = questions.filtered(condition, ...outOfYearRange);
|
|
48
39
|
return filteredQuestions;
|
|
49
40
|
};
|
|
50
41
|
exports.filterByOutOfYearRange = filterByOutOfYearRange;
|
|
51
42
|
// 06_単元範囲外の問題を除外(unit)
|
|
52
|
-
|
|
43
|
+
const filterByOutOfUnitRange = (questions, outOfUnitRange) => {
|
|
53
44
|
if (outOfUnitRange.length === 0)
|
|
54
45
|
return questions;
|
|
55
|
-
|
|
56
|
-
.map(
|
|
46
|
+
const condition = outOfUnitRange
|
|
47
|
+
.map((_, index) => `unitId != $${index}`)
|
|
57
48
|
.join(" AND ");
|
|
58
|
-
|
|
49
|
+
const filteredQuestions = questions.filtered(condition, ...outOfUnitRange);
|
|
59
50
|
return filteredQuestions;
|
|
60
51
|
};
|
|
61
52
|
exports.filterByOutOfUnitRange = filterByOutOfUnitRange;
|
|
62
53
|
// 11_タグによる絞り込み
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
const filterByTags = (questions, startCfg) => {
|
|
55
|
+
const selectedTags = startCfg.tags;
|
|
56
|
+
const filterByTags = questions.filtered("tag.level IN $0", selectedTags);
|
|
66
57
|
return filterByTags;
|
|
67
58
|
};
|
|
68
59
|
exports.filterByTags = filterByTags;
|
|
69
60
|
// 12_シャッフル
|
|
70
61
|
// 13_問題数の設定
|
|
71
|
-
|
|
62
|
+
const commonFilter = (questions, quizCnt, isShuffle) => {
|
|
72
63
|
// 12_シャッフル
|
|
73
|
-
|
|
64
|
+
let returnList = questions;
|
|
74
65
|
if (isShuffle)
|
|
75
66
|
returnList = lib_1.utilFnc.shuffleList(questions);
|
|
76
67
|
// 13_問題数の設定
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.commonFilterJ = exports.filterByTagsJ = exports.getSubUnitQuestionsJ = exports.getUnitQuestionsJ = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
5
|
+
const FILTERS = {
|
|
6
6
|
unitTop: "unitId == $0",
|
|
7
7
|
unit: "unitId == $0 && subUnitId == $1",
|
|
8
8
|
};
|
|
9
9
|
// 01_単元別(大単元)の抽出
|
|
10
|
-
|
|
10
|
+
const getUnitQuestionsJ = (questions, unitId) => {
|
|
11
11
|
return questions.filtered(FILTERS.unitTop, unitId);
|
|
12
12
|
};
|
|
13
13
|
exports.getUnitQuestionsJ = getUnitQuestionsJ;
|
|
14
14
|
// 02_単元別(小単元)の抽出
|
|
15
|
-
|
|
15
|
+
const getSubUnitQuestionsJ = (questions, unitId, subUnitId) => {
|
|
16
16
|
return questions.filtered(FILTERS.unit, unitId, subUnitId);
|
|
17
17
|
};
|
|
18
18
|
exports.getSubUnitQuestionsJ = getSubUnitQuestionsJ;
|
|
19
19
|
// 11_タグによる絞り込み
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const filterByTagsJ = (questions, startCfg, tagName) => {
|
|
21
|
+
const selectedTags = startCfg.tags;
|
|
22
|
+
const filterByTags = questions.filtered(`${tagName}.level IN $0`, selectedTags);
|
|
23
23
|
return filterByTags;
|
|
24
24
|
};
|
|
25
25
|
exports.filterByTagsJ = filterByTagsJ;
|
|
26
26
|
// 12_シャッフル
|
|
27
27
|
// 13_問題数の設定
|
|
28
|
-
|
|
28
|
+
const commonFilterJ = (questions, quizCnt, isShuffle) => {
|
|
29
29
|
// 12_シャッフル
|
|
30
|
-
|
|
30
|
+
let returnList = questions;
|
|
31
31
|
if (isShuffle)
|
|
32
32
|
returnList = lib_1.utilFnc.shuffleList(questions);
|
|
33
33
|
// 13_問題数の設定
|
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.formatQuestions = void 0;
|
|
15
|
-
|
|
4
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
16
5
|
// OO_メインの出力
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
const formatQuestions = (questions) => {
|
|
7
|
+
const formattedQuestions = questions.map((question) => {
|
|
8
|
+
const jsonQuestion = question.toJSON();
|
|
9
|
+
const { form } = jsonQuestion;
|
|
21
10
|
switch (form) {
|
|
22
11
|
case "multi":
|
|
23
12
|
return formatMulti(jsonQuestion);
|
|
@@ -33,67 +22,65 @@ var formatQuestions = function (questions) {
|
|
|
33
22
|
};
|
|
34
23
|
exports.formatQuestions = formatQuestions;
|
|
35
24
|
// 10_共通部分を抽出するヘルパー関数
|
|
36
|
-
|
|
25
|
+
const formatCommon = (Q) => ({
|
|
37
26
|
system: "drill",
|
|
38
27
|
yearId: Q.yearId,
|
|
39
28
|
num: Q.num,
|
|
29
|
+
tagObjectId: Q.tag._id.toHexString(),
|
|
40
30
|
question: Q.question,
|
|
41
31
|
title: Q.title,
|
|
42
32
|
tag: Q.tag.level,
|
|
43
33
|
style: Q.style,
|
|
44
34
|
explain: Q.explain.explain,
|
|
45
35
|
isCorrected: undefined,
|
|
46
|
-
});
|
|
36
|
+
});
|
|
47
37
|
// 11_通常形式のフォーマット
|
|
48
|
-
|
|
49
|
-
return
|
|
38
|
+
const formatNormal = (Q) => {
|
|
39
|
+
return Object.assign(Object.assign({}, formatCommon(Q)), { choices: getNormalChoice(Q.choices, Q.ans), form: undefined, ans: Q.ans, selectedIndexes: [] });
|
|
50
40
|
};
|
|
51
41
|
// 12_multi形式のフォーマット
|
|
52
|
-
|
|
53
|
-
return
|
|
42
|
+
const formatMulti = (Q) => {
|
|
43
|
+
return Object.assign(Object.assign({}, formatCommon(Q)), { form: "multi", multiSel: getMultiChoice(Q.multiChoicesJson), selectedIndexes: [] });
|
|
54
44
|
};
|
|
55
45
|
// 13_穴埋め形式のフォーマット
|
|
56
|
-
|
|
57
|
-
return
|
|
46
|
+
const formatBlank = (Q) => {
|
|
47
|
+
return Object.assign(Object.assign({}, formatCommon(Q)), { form: "blank", blankAns: Q.blankAns });
|
|
58
48
|
};
|
|
59
49
|
// 14_記述形式のフォーマット
|
|
60
|
-
|
|
61
|
-
return
|
|
50
|
+
const formatInput = (Q) => {
|
|
51
|
+
return Object.assign(Object.assign({}, formatCommon(Q)), { form: "input", inputId: Q.input.inputId });
|
|
62
52
|
};
|
|
63
53
|
// 21_(01)選択肢をオブジェクト化しシャッフルする
|
|
64
|
-
|
|
54
|
+
const getNormalChoice = (choices, ans) => {
|
|
65
55
|
if (!choices)
|
|
66
56
|
return [];
|
|
67
|
-
|
|
68
|
-
choice
|
|
57
|
+
const choicesObj = choices.map((choice, index) => ({
|
|
58
|
+
choice,
|
|
69
59
|
num: index + 1,
|
|
70
60
|
isCorrect: ans.includes(index + 1),
|
|
71
|
-
})
|
|
72
|
-
|
|
61
|
+
}));
|
|
62
|
+
const shuffledChoices = lib_1.utilFnc.shuffleList(choicesObj);
|
|
73
63
|
return shuffledChoices;
|
|
74
64
|
};
|
|
75
|
-
|
|
65
|
+
const getMultiChoice = (choices) => {
|
|
76
66
|
// json形式をオブジェクトに変換
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}); });
|
|
84
|
-
});
|
|
67
|
+
const choicesObj = JSON.parse(choices);
|
|
68
|
+
const formattedChoices = choicesObj.map((array) => array.map((choice, index) => ({
|
|
69
|
+
choice,
|
|
70
|
+
num: index + 1,
|
|
71
|
+
isCorrect: index === 0,
|
|
72
|
+
})));
|
|
85
73
|
// 選択肢をシャッフル
|
|
86
|
-
|
|
87
|
-
var _a;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
((_e = (_d = array[0]) === null || _d === void 0 ? void 0 : _d.choice) === null || _e === void 0 ? void 0 : _e.startsWith("×"))) &&
|
|
74
|
+
const shuffledChoices = formattedChoices.map((array) => {
|
|
75
|
+
var _a, _b, _c, _d, _e, _f;
|
|
76
|
+
const isMaruBatsu = (((_b = (_a = array[0]) === null || _a === void 0 ? void 0 : _a.choice) === null || _b === void 0 ? void 0 : _b.startsWith("○")) ||
|
|
77
|
+
((_d = (_c = array[0]) === null || _c === void 0 ? void 0 : _c.choice) === null || _d === void 0 ? void 0 : _d.startsWith("×"))) &&
|
|
91
78
|
array.length === 2;
|
|
92
79
|
if (isMaruBatsu) {
|
|
93
80
|
// isMaruBatsuがtrueの場合
|
|
94
|
-
if ((
|
|
81
|
+
if ((_f = (_e = array[0]) === null || _e === void 0 ? void 0 : _e.choice) === null || _f === void 0 ? void 0 : _f.startsWith("×")) {
|
|
95
82
|
// choiceが○以外なら入れ替える
|
|
96
|
-
|
|
83
|
+
[array[0], array[1]] = [array[1], array[0]];
|
|
97
84
|
}
|
|
98
85
|
return array;
|
|
99
86
|
}
|