@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.
Files changed (168) hide show
  1. package/dist/component/Basic/Badge5s.js +18 -30
  2. package/dist/component/Basic/BasicContents.js +38 -39
  3. package/dist/component/Basic/BasicProgressBar.js +16 -17
  4. package/dist/component/Basic/BasicSetting.js +14 -15
  5. package/dist/component/Basic/MiniTestCard.js +32 -33
  6. package/dist/component/Basic/Paw5s.js +9 -13
  7. package/dist/component/Basic/SelectedExamCnt.js +14 -15
  8. package/dist/component/Basic/SubCategoryLeft.js +5 -6
  9. package/dist/component/Basic/SubCategoryList.js +49 -62
  10. package/dist/component/Boot/SelectRange.js +18 -21
  11. package/dist/component/Boot/ToggleRange.js +11 -14
  12. package/dist/component/Coin/AppReviews.js +9 -10
  13. package/dist/component/Coin/CatchCopy.js +6 -6
  14. package/dist/component/Coin/CoinCheck.js +18 -54
  15. package/dist/component/Coin/CoinFnc.js +210 -282
  16. package/dist/component/Coin/CoinPageComponent.d.ts +1 -0
  17. package/dist/component/Coin/CoinPageComponent.js +22 -22
  18. package/dist/component/Coin/ReceiptFnc.js +3 -3
  19. package/dist/component/Coin/Recommend.js +10 -10
  20. package/dist/component/Coin/WaitingPayBanner.js +8 -9
  21. package/dist/component/Discription.js +6 -7
  22. package/dist/component/Grade/AllTags.js +12 -12
  23. package/dist/component/Grade/BasicBadge.js +20 -32
  24. package/dist/component/Grade/GradeCard/ChangeWeeklyModal.js +8 -10
  25. package/dist/component/Grade/GradeCard/ChangeWeeklyTargetBtn.js +21 -22
  26. package/dist/component/Grade/GradeCard/DatePickerModal.js +17 -19
  27. package/dist/component/Grade/GradeCard/GradeCard.js +19 -20
  28. package/dist/component/Grade/GradeCard/Square3sGrade.js +16 -17
  29. package/dist/component/Grade/GradeCard/TargetDate.js +19 -20
  30. package/dist/component/Grade/GradeCard/WeeklyAchivedRate.js +7 -8
  31. package/dist/component/Grade/GradeCard/WeeklyProgress.js +19 -29
  32. package/dist/component/Grade/JAllTags.js +16 -16
  33. package/dist/component/Grade/QuizCntGraph.js +31 -45
  34. package/dist/component/Grade/ShareBtn.js +30 -68
  35. package/dist/component/Grade/Square4s.js +14 -15
  36. package/dist/component/Grade/UnitCircles.js +18 -23
  37. package/dist/component/Grade/YearCircles.js +17 -22
  38. package/dist/component/Guide.js +6 -7
  39. package/dist/component/Home/OpeningMsg.js +14 -14
  40. package/dist/component/OnlineInput/OnlineInputFnc.js +6 -6
  41. package/dist/component/OnlineInput/OnlineSaveBtn.js +7 -8
  42. package/dist/component/OnlineInput/OnlineSavedList.js +13 -14
  43. package/dist/component/OnlineInput/PasswardModal.js +64 -110
  44. package/dist/component/OnlineInput/PasswordIdModal.js +40 -80
  45. package/dist/component/QuizSet/QuizOptionDrill.js +29 -42
  46. package/dist/component/Result/AdCard.js +21 -16
  47. package/dist/component/Result/CharaCard.js +15 -16
  48. package/dist/component/Result/LessonTitle.js +10 -10
  49. package/dist/component/Result/QuizFlatList.js +26 -30
  50. package/dist/component/Result/ScoreCircle.js +8 -9
  51. package/dist/component/SelectRange/SelectYearRange.js +22 -34
  52. package/dist/component/SettingBtns/QuizOptionSelector.js +16 -17
  53. package/dist/component/SettingBtns/Range.js +9 -9
  54. package/dist/component/SettingBtns/TransBtn.js +17 -17
  55. package/dist/component/TabAnimeView.js +9 -10
  56. package/dist/component/Tag5s.js +10 -14
  57. package/dist/component/TagBadge5s.js +16 -17
  58. package/dist/component/TagBadge5sPress.js +14 -15
  59. package/dist/component/TestPage/AverageBar.js +12 -24
  60. package/dist/component/TestPage/BarChartContainer.js +30 -31
  61. package/dist/component/TestPage/ChartControl.js +5 -6
  62. package/dist/component/TestPage/Square3s.js +12 -13
  63. package/dist/functions/badgeBasicFnc.js +22 -42
  64. package/dist/functions/badgeDailyFnc.js +24 -35
  65. package/dist/functions/badgeFilter.js +16 -18
  66. package/dist/functions/badgeFnc.js +24 -33
  67. package/dist/functions/createQuizFncD.js +33 -33
  68. package/dist/functions/createQuizFncJ.js +27 -33
  69. package/dist/functions/gradeFnc.js +48 -87
  70. package/dist/functions/oldStorageFnc.js +77 -200
  71. package/dist/functions/questionFilterD.js +19 -28
  72. package/dist/functions/questionFilterJ.js +9 -9
  73. package/dist/functions/questionFormatD.js +34 -47
  74. package/dist/functions/questionFormatJ.js +30 -41
  75. package/dist/functions/tagFncD.js +37 -39
  76. package/dist/functions/tagFncJ.js +16 -19
  77. package/dist/functions/testFnc.js +6 -7
  78. package/dist/hooks/BadgeHook.js +24 -35
  79. package/dist/hooks/ExitQuizHook.js +21 -21
  80. package/dist/hooks/basicHook.js +12 -12
  81. package/dist/hooks/quizActionHook.js +44 -57
  82. package/dist/hooks/quizHook.d.ts +2 -1
  83. package/dist/hooks/quizHook.js +58 -48
  84. package/dist/index.js +25 -25
  85. package/dist/page/BadgePage.js +26 -29
  86. package/dist/page/BasicPage.js +23 -25
  87. package/dist/page/BootPage.js +48 -53
  88. package/dist/page/CoinPage.d.ts +1 -0
  89. package/dist/page/CoinPage.js +90 -144
  90. package/dist/page/FAQPage.js +23 -23
  91. package/dist/page/GetBadgePage.js +35 -71
  92. package/dist/page/GradePage.js +26 -27
  93. package/dist/page/GuidePage.js +28 -33
  94. package/dist/page/HistoryPage.js +25 -33
  95. package/dist/page/HomePage.d.ts +1 -0
  96. package/dist/page/HomePage.js +62 -108
  97. package/dist/page/ImgZoom.js +8 -9
  98. package/dist/page/InformationPage.js +15 -15
  99. package/dist/page/JDetailSettingPage.js +23 -25
  100. package/dist/page/OnlineInputPage.js +19 -20
  101. package/dist/page/QuizPage.js +25 -26
  102. package/dist/page/QuizSettingPage.js +19 -19
  103. package/dist/page/QuizSetupPage.js +40 -43
  104. package/dist/page/ReportPage.js +55 -94
  105. package/dist/page/ResultPage.js +55 -103
  106. package/dist/page/SettingPage.js +35 -40
  107. package/dist/page/TestPage.js +41 -44
  108. package/dist/quiz/QuizContentsDrill.js +17 -18
  109. package/dist/quiz/QuizContentsJLPT.js +8 -9
  110. package/dist/quiz/Title.js +22 -22
  111. package/dist/quiz/answer/Answer.js +20 -20
  112. package/dist/quiz/answer/BlangGuide.js +10 -10
  113. package/dist/quiz/answer/BlankAnswer.js +11 -12
  114. package/dist/quiz/answer/BlankBtn.js +10 -10
  115. package/dist/quiz/answer/CheckButton.js +6 -9
  116. package/dist/quiz/answer/ChoiceView.js +15 -30
  117. package/dist/quiz/answer/Input/CollapseExplain.js +10 -11
  118. package/dist/quiz/answer/Input/InputAnswerBtn.js +9 -9
  119. package/dist/quiz/answer/Input/InputBox.js +17 -18
  120. package/dist/quiz/answer/Input/InputCounter.js +6 -7
  121. package/dist/quiz/answer/Input/InputFnc.js +10 -19
  122. package/dist/quiz/answer/Input/InputSaveSelector.js +12 -13
  123. package/dist/quiz/answer/Input/InputTab.js +12 -13
  124. package/dist/quiz/answer/Input/InputWarnning.js +13 -14
  125. package/dist/quiz/answer/InputGuide.js +10 -10
  126. package/dist/quiz/answer/InputNav.js +38 -39
  127. package/dist/quiz/answer/MultiChoice.js +20 -22
  128. package/dist/quiz/answer/MultiGuide.js +10 -10
  129. package/dist/quiz/answer/MultiNextBtn.js +13 -14
  130. package/dist/quiz/answer/NormalChoice.js +29 -42
  131. package/dist/quiz/answer/NormalMultiGuide.js +11 -12
  132. package/dist/quiz/answer/styles/getChoiceStyle.js +4 -4
  133. package/dist/quiz/check/Check.js +17 -18
  134. package/dist/quiz/check/NextQuizBtn.js +18 -19
  135. package/dist/quiz/check/SelectTag.js +36 -51
  136. package/dist/quiz/common/MyTextqqyy.js +29 -47
  137. package/dist/quiz/common/PageContainerWrap.js +14 -15
  138. package/dist/quiz/common/RenderImgOrText.js +17 -18
  139. package/dist/quiz/common/RubyText.js +21 -35
  140. package/dist/quiz/common/ZoomableImage.js +6 -9
  141. package/dist/quiz/explain/CorrectedBar.js +13 -14
  142. package/dist/quiz/explain/Explain.js +9 -10
  143. package/dist/quiz/explain/ExplainLogic.js +17 -23
  144. package/dist/quiz/explain/MovieBtn.js +10 -11
  145. package/dist/quiz/explain/MultiExplain.js +12 -24
  146. package/dist/quiz/explain/NormalExplain.js +29 -30
  147. package/dist/quiz/function/choiceFnc.js +2 -2
  148. package/dist/quiz/jAnswer/JAnswer.js +24 -26
  149. package/dist/quiz/jAnswer/JAnswerContents.js +12 -27
  150. package/dist/quiz/jQuestion/JQuestion.js +12 -13
  151. package/dist/quiz/jQuestion/JQuestionBottomText.js +14 -15
  152. package/dist/quiz/jQuestion/JQuestionText.js +13 -14
  153. package/dist/quiz/jQuestion/QuizCnt.js +9 -9
  154. package/dist/quiz/jQuestion/TimeLimit.js +23 -25
  155. package/dist/quiz/question/FillDiagram.js +12 -13
  156. package/dist/quiz/question/Question.js +25 -26
  157. package/dist/quiz/question/QuestionFormats.js +29 -45
  158. package/dist/quiz/question/QuestionReference.js +7 -7
  159. package/dist/quiz/question/SearchYoutue.js +10 -11
  160. package/dist/quiz/save/QuizSaveData.js +18 -19
  161. package/dist/quiz/setting/Above3BtnJ.js +25 -30
  162. package/dist/quiz/setting/Bottom3Btn.js +25 -30
  163. package/dist/quiz/setting/GuideBtn.js +19 -22
  164. package/dist/quiz/setting/RepeatBtn.js +27 -34
  165. package/dist/quiz/setting/ReturnBtn.js +8 -20
  166. package/dist/quiz/setting/ReturnSaveBtn.js +21 -33
  167. package/dist/tsconfig.tsbuildinfo +1 -1
  168. 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
- var toolkit_1 = require("@reduxjs/toolkit");
41
- var db_1 = require("@nakamura-123/db");
42
- var stores_1 = require("@nakamura-123/stores");
43
- var lib_1 = require("@nakamura-123/lib");
44
- var CoinFnc_1 = require("../component/Coin/CoinFnc");
45
- var react_native_1 = require("react-native");
46
- var loadOldData = stores_1.oldStorage.loadOldData;
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
- var handleOldData = function (realm, oldInfo, dispatch, t, msg) { return __awaiter(void 0, void 0, void 0, function () {
49
- var ALART_MSG;
50
- return __generator(this, function (_a) {
51
- ALART_MSG = msg || t("setting.oldSystem.question");
52
- lib_1.utilFnc.showConfirmationAlert(ALART_MSG, function () { return __awaiter(void 0, void 0, void 0, function () {
53
- return __generator(this, function (_a) {
54
- switch (_a.label) {
55
- case 0:
56
- dispatch(stores_1.settingStorage.saveSetting());
57
- if (!oldInfo) return [3 /*break*/, 4];
58
- return [4 /*yield*/, loadingAllOldData(realm, oldInfo)];
59
- case 1:
60
- _a.sent();
61
- return [4 /*yield*/, dispatch(loadOldInputId())];
62
- case 2:
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
- var loadingAllOldData = function (realm, oldInfo) { return __awaiter(void 0, void 0, void 0, function () {
84
- return __generator(this, function (_a) {
85
- switch (_a.label) {
86
- case 0: return [4 /*yield*/, addOldTestData(realm, oldInfo.testInfo)];
87
- case 1:
88
- _a.sent();
89
- return [4 /*yield*/, addOldBootData(realm)];
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
- var addOldTestData = function (realm, typeInfos) { return __awaiter(void 0, void 0, void 0, function () {
107
- var testData, realmInfos;
108
- return __generator(this, function (_a) {
109
- switch (_a.label) {
110
- case 0: return [4 /*yield*/, loadOldData("test")];
111
- case 1:
112
- testData = _a.sent();
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
- var addOldBootData = function (realm) { return __awaiter(void 0, void 0, void 0, function () {
127
- var bootData, realmInfos;
128
- return __generator(this, function (_a) {
129
- switch (_a.label) {
130
- case 0: return [4 /*yield*/, loadOldData("focus")];
131
- case 1:
132
- bootData = _a.sent();
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
- var replaceOldTagData = function (realm, yearIdTrans) { return __awaiter(void 0, void 0, void 0, function () {
145
- var markData, realmInfos;
146
- return __generator(this, function (_a) {
147
- switch (_a.label) {
148
- case 0:
149
- if (!yearIdTrans)
150
- return [2 /*return*/];
151
- return [4 /*yield*/, loadOldData("mark")];
152
- case 1:
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
- var addOldDailyLogData = function (realm) { return __awaiter(void 0, void 0, void 0, function () {
164
- var dailyLogData, realmInfo;
165
- return __generator(this, function (_a) {
166
- switch (_a.label) {
167
- case 0: return [4 /*yield*/, loadOldData("grade")];
168
- case 1:
169
- dailyLogData = _a.sent();
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
- var replaceOldInputData = function (realm) { return __awaiter(void 0, void 0, void 0, function () {
180
- var inputDatas, inputIdAndSaves;
181
- return __generator(this, function (_a) {
182
- switch (_a.label) {
183
- case 0: return [4 /*yield*/, loadOldData("saveTxts")];
184
- case 1:
185
- inputDatas = _a.sent();
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
- var loadOldInputId = (0, toolkit_1.createAsyncThunk)("old/loadOldInputId", function (_1, _a) { return __awaiter(void 0, [_1, _a], void 0, function (_, _b) {
198
- var id;
199
- var dispatch = _b.dispatch;
200
- return __generator(this, function (_c) {
201
- switch (_c.label) {
202
- case 0: return [4 /*yield*/, loadOldData("id")];
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
- var existOldData = function () { return __awaiter(void 0, void 0, void 0, function () {
214
- var markData;
215
- return __generator(this, function (_a) {
216
- switch (_a.label) {
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
- var lib_1 = require("@nakamura-123/lib");
14
- var filters = {
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
- var getUnitQuestions = function (questions, unitId) {
12
+ const getUnitQuestions = (questions, unitId) => {
22
13
  return questions.filtered(filters.unitTop, unitId);
23
14
  };
24
15
  exports.getUnitQuestions = getUnitQuestions;
25
16
  // 02_単元別(小単元)の抽出
26
- var getSubUnitQuestions = function (questions, unitId, subUnitId) {
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
- var getYearQuestions = function (questions, year) {
22
+ const getYearQuestions = (questions, year) => {
32
23
  return questions.filtered(filters.yearTop, year);
33
24
  };
34
25
  exports.getYearQuestions = getYearQuestions;
35
26
  // 04_年度別(小単元)の抽出
36
- var getSubYearQuestions = function (questions, year, key) {
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
- var filterByOutOfYearRange = function (questions, outOfYearRange) {
32
+ const filterByOutOfYearRange = (questions, outOfYearRange) => {
42
33
  if (outOfYearRange.length === 0)
43
34
  return questions;
44
- var condition = outOfYearRange
45
- .map(function (_, index) { return "yearId != $".concat(index); })
35
+ const condition = outOfYearRange
36
+ .map((_, index) => `yearId != $${index}`)
46
37
  .join(" AND ");
47
- var filteredQuestions = questions.filtered.apply(questions, __spreadArray([condition], outOfYearRange, false));
38
+ const filteredQuestions = questions.filtered(condition, ...outOfYearRange);
48
39
  return filteredQuestions;
49
40
  };
50
41
  exports.filterByOutOfYearRange = filterByOutOfYearRange;
51
42
  // 06_単元範囲外の問題を除外(unit)
52
- var filterByOutOfUnitRange = function (questions, outOfUnitRange) {
43
+ const filterByOutOfUnitRange = (questions, outOfUnitRange) => {
53
44
  if (outOfUnitRange.length === 0)
54
45
  return questions;
55
- var condition = outOfUnitRange
56
- .map(function (_, index) { return "unitId != $".concat(index); })
46
+ const condition = outOfUnitRange
47
+ .map((_, index) => `unitId != $${index}`)
57
48
  .join(" AND ");
58
- var filteredQuestions = questions.filtered.apply(questions, __spreadArray([condition], outOfUnitRange, false));
49
+ const filteredQuestions = questions.filtered(condition, ...outOfUnitRange);
59
50
  return filteredQuestions;
60
51
  };
61
52
  exports.filterByOutOfUnitRange = filterByOutOfUnitRange;
62
53
  // 11_タグによる絞り込み
63
- var filterByTags = function (questions, startCfg) {
64
- var selectedTags = startCfg.tags;
65
- var filterByTags = questions.filtered("tag.level IN $0", selectedTags);
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
- var commonFilter = function (questions, quizCnt, isShuffle) {
62
+ const commonFilter = (questions, quizCnt, isShuffle) => {
72
63
  // 12_シャッフル
73
- var returnList = questions;
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
- var lib_1 = require("@nakamura-123/lib");
5
- var FILTERS = {
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
- var getUnitQuestionsJ = function (questions, unitId) {
10
+ const getUnitQuestionsJ = (questions, unitId) => {
11
11
  return questions.filtered(FILTERS.unitTop, unitId);
12
12
  };
13
13
  exports.getUnitQuestionsJ = getUnitQuestionsJ;
14
14
  // 02_単元別(小単元)の抽出
15
- var getSubUnitQuestionsJ = function (questions, unitId, subUnitId) {
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
- var filterByTagsJ = function (questions, startCfg, tagName) {
21
- var selectedTags = startCfg.tags;
22
- var filterByTags = questions.filtered("".concat(tagName, ".level IN $0"), selectedTags);
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
- var commonFilterJ = function (questions, quizCnt, isShuffle) {
28
+ const commonFilterJ = (questions, quizCnt, isShuffle) => {
29
29
  // 12_シャッフル
30
- var returnList = questions;
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
- var lib_1 = require("@nakamura-123/lib");
4
+ const lib_1 = require("@nakamura-123/lib");
16
5
  // OO_メインの出力
17
- var formatQuestions = function (questions) {
18
- var formattedQuestions = questions.map(function (question) {
19
- var jsonQuestion = question.toJSON();
20
- var form = jsonQuestion.form;
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
- var formatCommon = function (Q) { return ({
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
- var formatNormal = function (Q) {
49
- return __assign(__assign({}, formatCommon(Q)), { choices: getNormalChoice(Q.choices, Q.ans), form: undefined, ans: Q.ans, selectedIndexes: [] });
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
- var formatMulti = function (Q) {
53
- return __assign(__assign({}, formatCommon(Q)), { form: "multi", multiSel: getMultiChoice(Q.multiChoicesJson), selectedIndexes: [] });
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
- var formatBlank = function (Q) {
57
- return __assign(__assign({}, formatCommon(Q)), { form: "blank", blankAns: Q.blankAns });
46
+ const formatBlank = (Q) => {
47
+ return Object.assign(Object.assign({}, formatCommon(Q)), { form: "blank", blankAns: Q.blankAns });
58
48
  };
59
49
  // 14_記述形式のフォーマット
60
- var formatInput = function (Q) {
61
- return __assign(__assign({}, formatCommon(Q)), { form: "input", inputId: Q.input.inputId });
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
- var getNormalChoice = function (choices, ans) {
54
+ const getNormalChoice = (choices, ans) => {
65
55
  if (!choices)
66
56
  return [];
67
- var choicesObj = choices.map(function (choice, index) { return ({
68
- choice: choice,
57
+ const choicesObj = choices.map((choice, index) => ({
58
+ choice,
69
59
  num: index + 1,
70
60
  isCorrect: ans.includes(index + 1),
71
- }); });
72
- var shuffledChoices = lib_1.utilFnc.shuffleList(choicesObj);
61
+ }));
62
+ const shuffledChoices = lib_1.utilFnc.shuffleList(choicesObj);
73
63
  return shuffledChoices;
74
64
  };
75
- var getMultiChoice = function (choices) {
65
+ const getMultiChoice = (choices) => {
76
66
  // json形式をオブジェクトに変換
77
- var choicesObj = JSON.parse(choices);
78
- var formattedChoices = choicesObj.map(function (array) {
79
- return array.map(function (choice, index) { return ({
80
- choice: choice,
81
- num: index + 1,
82
- isCorrect: index === 0,
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
- var shuffledChoices = formattedChoices.map(function (array) {
87
- var _a;
88
- var _b, _c, _d, _e, _f, _g;
89
- var isMaruBatsu = (((_c = (_b = array[0]) === null || _b === void 0 ? void 0 : _b.choice) === null || _c === void 0 ? void 0 : _c.startsWith("○")) ||
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 ((_g = (_f = array[0]) === null || _f === void 0 ? void 0 : _f.choice) === null || _g === void 0 ? void 0 : _g.startsWith("×")) {
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
- _a = [array[1], array[0]], array[0] = _a[0], array[1] = _a[1];
83
+ [array[0], array[1]] = [array[1], array[0]];
97
84
  }
98
85
  return array;
99
86
  }