@nakamura-123/pages 0.1.31 → 0.1.32
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/Coin/CoinCheck.d.ts +1 -1
- package/dist/component/Coin/CoinCheck.js +21 -19
- package/dist/component/Coin/CoinFnc.d.ts +1 -1
- package/dist/component/Coin/CoinFnc.js +2 -2
- package/dist/component/Grade/ShareBtn.js +2 -2
- package/dist/component/OnlineInput/PasswardModal.js +38 -7
- package/dist/component/OnlineInput/PasswordIdModal.js +2 -2
- package/dist/functions/createQuizFncD.d.ts +11 -4
- package/dist/functions/gradeFnc.js +2 -2
- package/dist/functions/oldStorageFnc.js +17 -15
- package/dist/functions/questionFilterD.d.ts +5 -4
- package/dist/functions/questionFilterJ.d.ts +5 -4
- package/dist/functions/tagFncD.js +8 -8
- package/dist/functions/tagFncJ.js +3 -3
- package/dist/functions/testFnc.js +4 -3
- package/dist/page/CoinPage.js +2 -2
- package/dist/page/GetBadgePage.js +2 -2
- package/dist/page/HomePage.js +2 -2
- package/dist/page/ReportPage.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Storage } from "@nakamura-123/types";
|
|
2
2
|
export declare const coinCheckFnc: import("@reduxjs/toolkit").AsyncThunk<void, string, {
|
|
3
3
|
state?: unknown;
|
|
4
|
-
dispatch?: import("redux").Dispatch;
|
|
4
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
5
5
|
extra?: unknown;
|
|
6
6
|
rejectValue?: unknown;
|
|
7
7
|
serializedErrorType?: unknown;
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
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
|
|
13
|
-
return g
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -42,24 +42,26 @@ var toolkit_1 = require("@reduxjs/toolkit");
|
|
|
42
42
|
var CoinFnc_1 = require("./CoinFnc");
|
|
43
43
|
var stores_1 = require("@nakamura-123/stores");
|
|
44
44
|
// 00.メイン関数
|
|
45
|
-
exports.coinCheckFnc = (0, toolkit_1.createAsyncThunk)("coin/check", function (
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
exports.coinCheckFnc = (0, toolkit_1.createAsyncThunk)("coin/check", function (allFreeId, _a) {
|
|
46
|
+
var dispatch = _a.dispatch;
|
|
47
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
48
|
+
var receipts, isExistedId;
|
|
49
|
+
return __generator(this, function (_b) {
|
|
50
|
+
switch (_b.label) {
|
|
51
|
+
case 0: return [4 /*yield*/, (0, CoinFnc_1.restorePurchases)(dispatch, false)];
|
|
52
|
+
case 1:
|
|
53
|
+
receipts = _b.sent();
|
|
54
|
+
isExistedId = hasPurchasedItems(receipts, allFreeId);
|
|
55
|
+
if (!isExistedId) {
|
|
56
|
+
// 返金などをされていて、flaseの場合、このIDのアイテムを削除し、store更新
|
|
57
|
+
stores_1.coinStorage.removePurchasedItem(allFreeId);
|
|
58
|
+
dispatch({ type: "setting/updateAllFreeState", payload: "none" });
|
|
59
|
+
}
|
|
60
|
+
return [2 /*return*/];
|
|
61
|
+
}
|
|
62
|
+
});
|
|
61
63
|
});
|
|
62
|
-
});
|
|
64
|
+
});
|
|
63
65
|
// 91. 復元を行い、チェックが必要か判定
|
|
64
66
|
var isCheckRequired = function (allFreeState, lastCheckedDate, isCompoleteFree) {
|
|
65
67
|
if (isCompoleteFree)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import RNIap, { ProductPurchase } from "react-native-iap";
|
|
1
|
+
import RNIap, { Product, ProductPurchase } from "react-native-iap";
|
|
2
2
|
import { Storage } from "@nakamura-123/types";
|
|
3
3
|
export declare const initializeIAP: (paymentItems: string[] | undefined, setProducts: (products: RNIap.Product[]) => void, setLoading: (loading: boolean) => void) => Promise<void>;
|
|
4
4
|
export declare const handlePurchase: (productId: string, dispatch: (action: any) => void) => Promise<ProductPurchase | null>;
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
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
|
|
13
|
-
return g
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
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
|
|
13
|
-
return g
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -32,8 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
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
|
|
36
|
-
return g
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -58,6 +58,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
58
58
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
62
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
63
|
+
if (ar || !(i in from)) {
|
|
64
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
65
|
+
ar[i] = from[i];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
69
|
+
};
|
|
61
70
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
71
|
var react_1 = __importStar(require("react"));
|
|
63
72
|
var react_native_1 = require("react-native");
|
|
@@ -75,23 +84,31 @@ var PasswordModal = function (_a) {
|
|
|
75
84
|
var saveUrl = (0, react_redux_1.useSelector)(function (state) { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.api.inputSave; }) || "";
|
|
76
85
|
var appKey = (0, react_redux_1.useSelector)(function (state) { return state.app.appSetting.quizName.appKey; }) ||
|
|
77
86
|
"";
|
|
87
|
+
var datas = (0, react_redux_1.useSelector)(function (state) { return state.setting.input.onlineSave; });
|
|
78
88
|
var _b = (0, react_1.useState)(""), password = _b[0], setPassword = _b[1];
|
|
79
89
|
var _c = (0, react_1.useState)(false), loading = _c[0], setLoading = _c[1];
|
|
80
90
|
// セーブ時の動作
|
|
81
91
|
var handleSave = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
|
-
var isChecked, inputSaveData, sendData, res, date, error_1;
|
|
92
|
+
var isChecked, oldIds, inputSaveData, sendData, res, date, error_1;
|
|
83
93
|
return __generator(this, function (_a) {
|
|
84
94
|
switch (_a.label) {
|
|
85
95
|
case 0:
|
|
86
96
|
isChecked = (0, OnlineInputFnc_1.checkPassword)(password);
|
|
87
97
|
if (!isChecked)
|
|
88
98
|
return [2 /*return*/];
|
|
99
|
+
oldIds = getOldIds(datas);
|
|
89
100
|
setLoading(true);
|
|
101
|
+
console.log("oldIds", oldIds);
|
|
90
102
|
_a.label = 1;
|
|
91
103
|
case 1:
|
|
92
104
|
_a.trys.push([1, 3, 4, 5]);
|
|
93
105
|
inputSaveData = db_1.InputModel.getAllInput(realm);
|
|
94
|
-
sendData = {
|
|
106
|
+
sendData = {
|
|
107
|
+
appKey: appKey,
|
|
108
|
+
password: password,
|
|
109
|
+
saveData: inputSaveData,
|
|
110
|
+
deleteIds: oldIds,
|
|
111
|
+
};
|
|
95
112
|
return [4 /*yield*/, stores_1.inputApi.inputSaveApi(sendData, saveUrl)];
|
|
96
113
|
case 2:
|
|
97
114
|
res = _a.sent();
|
|
@@ -100,6 +117,11 @@ var PasswordModal = function (_a) {
|
|
|
100
117
|
type: "setting/addOnlineSave",
|
|
101
118
|
payload: { date: date, id: res.id },
|
|
102
119
|
});
|
|
120
|
+
// 古いデータを削除
|
|
121
|
+
dispatch({
|
|
122
|
+
type: "setting/deleteOnlineSave",
|
|
123
|
+
payload: res.deleteIds || [],
|
|
124
|
+
});
|
|
103
125
|
(0, OnlineInputFnc_1.correctAlart)();
|
|
104
126
|
dispatch(stores_1.settingStorage.saveSetting());
|
|
105
127
|
return [3 /*break*/, 5];
|
|
@@ -121,8 +143,12 @@ var PasswordModal = function (_a) {
|
|
|
121
143
|
return (<common_1.BaseModal isVisible={isVisible} onClose={onClose}>
|
|
122
144
|
<common_1.Spinner loading={loading}/>
|
|
123
145
|
<react_native_1.View style={styles.msgBox}>
|
|
124
|
-
<common_1.MyText
|
|
125
|
-
|
|
146
|
+
<common_1.MyText fsize="lg" style={{ alignSelf: "center", marginBottom: 10 }}>
|
|
147
|
+
パスワードを入力してください
|
|
148
|
+
</common_1.MyText>
|
|
149
|
+
<common_1.MyText>・4文字以上の半角英数</common_1.MyText>
|
|
150
|
+
<common_1.MyText>・保存期間は6ヶ月</common_1.MyText>
|
|
151
|
+
<common_1.MyText>・保存上限は3スロット。それ以上は古いデータから削除。</common_1.MyText>
|
|
126
152
|
</react_native_1.View>
|
|
127
153
|
<react_native_1.View style={styles.inputBox}>
|
|
128
154
|
<react_native_1.TextInput style={styles.input} placeholder="pass123" value={password} onChangeText={function (text) { return setPassword(text); }}/>
|
|
@@ -133,9 +159,14 @@ var PasswordModal = function (_a) {
|
|
|
133
159
|
</react_native_1.View>
|
|
134
160
|
</common_1.BaseModal>);
|
|
135
161
|
};
|
|
162
|
+
function getOldIds(dataList) {
|
|
163
|
+
return __spreadArray([], dataList, true).sort(function (a, b) { return new Date(b.date).getTime() - new Date(a.date).getTime(); })
|
|
164
|
+
.slice(2)
|
|
165
|
+
.map(function (item) { return item.id; });
|
|
166
|
+
}
|
|
136
167
|
var styles = react_native_1.StyleSheet.create({
|
|
137
168
|
msgBox: {
|
|
138
|
-
alignItems: "
|
|
169
|
+
alignItems: "flex-start",
|
|
139
170
|
},
|
|
140
171
|
inputBox: {
|
|
141
172
|
padding: 20,
|
|
@@ -32,8 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
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
|
|
36
|
-
return g
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QuizInitial } from "@nakamura-123/stores";
|
|
2
2
|
import { Store } from "@nakamura-123/types";
|
|
3
3
|
import { QRD } from "../types/filterType";
|
|
4
|
-
type startCfg = CfgInitial["startCfg"];
|
|
5
4
|
type Selected = QuizInitial["selected"];
|
|
6
|
-
export declare const getBasicQuizList: (QuestionDB: QRD, startCfg:
|
|
5
|
+
export declare const getBasicQuizList: (QuestionDB: QRD, startCfg: {
|
|
6
|
+
tags: import("@nakamura-123/types/dist/types/libType").LevelNames[];
|
|
7
|
+
option: import("@nakamura-123/lib/dist/config/startOption").StoreStartOptions;
|
|
8
|
+
outOfYearRange: number[];
|
|
9
|
+
}, selected: Selected) => Store.DQInStore[];
|
|
7
10
|
export declare const getMiniTestQuestions: (QuestionDB: QRD, subjectType: "unit" | "year", key: number, cnt: number, outOfYearRange: number[]) => Store.DQInStore[];
|
|
8
11
|
export declare const getTestQuestions: (QuestionDB: QRD, cnt: number) => Store.DQInStore[];
|
|
9
12
|
export declare const getTestQuestionsByUnit: (QuestionDB: QRD, cnt: number, unit: number[]) => Store.DQInStore[];
|
|
10
|
-
export declare const getBootQuestions: (QuestionDB: QRD, startCfg:
|
|
13
|
+
export declare const getBootQuestions: (QuestionDB: QRD, startCfg: {
|
|
14
|
+
tags: import("@nakamura-123/types/dist/types/libType").LevelNames[];
|
|
15
|
+
option: import("@nakamura-123/lib/dist/config/startOption").StoreStartOptions;
|
|
16
|
+
outOfYearRange: number[];
|
|
17
|
+
}, outOfUnitRange: number[], outOfYearRange: number[]) => Store.DQInStore[];
|
|
11
18
|
export {};
|
|
@@ -32,8 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
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
|
|
36
|
-
return g
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
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
|
|
13
|
-
return g
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -194,21 +194,23 @@ var replaceOldInputData = function (realm) { return __awaiter(void 0, void 0, vo
|
|
|
194
194
|
});
|
|
195
195
|
}); };
|
|
196
196
|
// 60. inputIdの読み込み(reduxThunk)
|
|
197
|
-
var loadOldInputId = (0, toolkit_1.createAsyncThunk)("old/loadOldInputId", function (
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
197
|
+
var loadOldInputId = (0, toolkit_1.createAsyncThunk)("old/loadOldInputId", function (_, _a) {
|
|
198
|
+
var dispatch = _a.dispatch;
|
|
199
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
200
|
+
var id;
|
|
201
|
+
return __generator(this, function (_b) {
|
|
202
|
+
switch (_b.label) {
|
|
203
|
+
case 0: return [4 /*yield*/, loadOldData("id")];
|
|
204
|
+
case 1:
|
|
205
|
+
id = _b.sent();
|
|
206
|
+
if (!id)
|
|
207
|
+
return [2 /*return*/];
|
|
208
|
+
dispatch({ type: "setting/updateOldId", payload: id[0] });
|
|
206
209
|
return [2 /*return*/];
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
210
212
|
});
|
|
211
|
-
});
|
|
213
|
+
});
|
|
212
214
|
// 90. 旧データの存在をMarkデータから確認
|
|
213
215
|
var existOldData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
214
216
|
var markData;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { CfgInitial } from "@nakamura-123/stores";
|
|
2
1
|
import { Store } from "@nakamura-123/types";
|
|
3
2
|
import { QRD } from "../types/filterType";
|
|
4
|
-
type startCfg = CfgInitial["startCfg"];
|
|
5
3
|
export declare const getUnitQuestions: (questions: QRD, unitId: number) => QRD;
|
|
6
4
|
export declare const getSubUnitQuestions: (questions: QRD, unitId: number, subUnitId: number) => QRD;
|
|
7
5
|
export declare const getYearQuestions: (questions: QRD, year: number) => QRD;
|
|
8
6
|
export declare const getSubYearQuestions: (questions: QRD, year: number, key: number) => QRD;
|
|
9
7
|
export declare const filterByOutOfYearRange: (questions: QRD, outOfYearRange: number[]) => QRD;
|
|
10
8
|
export declare const filterByOutOfUnitRange: (questions: QRD, outOfUnitRange: number[]) => QRD;
|
|
11
|
-
export declare const filterByTags: (questions: QRD, startCfg:
|
|
9
|
+
export declare const filterByTags: (questions: QRD, startCfg: {
|
|
10
|
+
tags: import("@nakamura-123/types/dist/types/libType").LevelNames[];
|
|
11
|
+
option: import("@nakamura-123/lib/dist/config/startOption").StoreStartOptions;
|
|
12
|
+
outOfYearRange: number[];
|
|
13
|
+
}) => QRD;
|
|
12
14
|
export declare const commonFilter: (questions: Store.DQInStore[], quizCnt: number, isShuffle: boolean) => Store.DQInStore[];
|
|
13
|
-
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { QRJ } from "../types/filterType";
|
|
2
2
|
import { Db, JStore } from "@nakamura-123/types";
|
|
3
|
-
import { CfgInitial } from "@nakamura-123/stores";
|
|
4
|
-
type startCfg = CfgInitial["startCfg"];
|
|
5
3
|
export declare const getUnitQuestionsJ: (questions: QRJ, unitId: number) => QRJ;
|
|
6
4
|
export declare const getSubUnitQuestionsJ: (questions: QRJ, unitId: number, subUnitId: number) => QRJ;
|
|
7
|
-
export declare const filterByTagsJ: (questions: QRJ, startCfg:
|
|
5
|
+
export declare const filterByTagsJ: (questions: QRJ, startCfg: {
|
|
6
|
+
tags: import("@nakamura-123/types/dist/types/libType").LevelNames[];
|
|
7
|
+
option: import("@nakamura-123/lib/dist/config/startOption").StoreStartOptions;
|
|
8
|
+
outOfYearRange: number[];
|
|
9
|
+
}, tagName: Db.SubjectTag) => QRJ;
|
|
8
10
|
export declare const commonFilterJ: (questions: JStore.JQInStore[], quizCnt: number, isShuffle: boolean) => JStore.JQInStore[];
|
|
9
|
-
export {};
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// helpers.ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getBootTagLevelCnts = exports.getSubTagLevelCnts = void 0;
|
|
5
|
-
exports.getCategoryTagLevelCntsD = getCategoryTagLevelCntsD;
|
|
6
|
-
exports.getUnitSubTagLevelCnts = getUnitSubTagLevelCnts;
|
|
7
|
-
exports.getYearSubTagLevelCnts = getYearSubTagLevelCnts;
|
|
8
|
-
exports.getCompletedTagRate = getCompletedTagRate;
|
|
9
|
-
exports.countTagsByLevel = countTagsByLevel;
|
|
10
|
-
exports.getCategoryRate = getCategoryRate;
|
|
11
|
-
exports.countTagsByLevelSelected = countTagsByLevelSelected;
|
|
4
|
+
exports.countTagsByLevelSelected = exports.getCategoryRate = exports.countTagsByLevel = exports.getCompletedTagRate = exports.getBootTagLevelCnts = exports.getSubTagLevelCnts = exports.getYearSubTagLevelCnts = exports.getUnitSubTagLevelCnts = exports.getCategoryTagLevelCntsD = void 0;
|
|
12
5
|
var lib_1 = require("@nakamura-123/lib");
|
|
13
6
|
var questionFilterD_1 = require("./questionFilterD");
|
|
14
7
|
// 01_大単元のTagのレベルを取得
|
|
@@ -23,6 +16,7 @@ function getCategoryTagLevelCntsD(QuestionDB, category, type, outOfYearRange) {
|
|
|
23
16
|
: (0, questionFilterD_1.getYearQuestions)(returnQuestions, category);
|
|
24
17
|
return returnQuestions.map(function (question) { return question.tag.level; });
|
|
25
18
|
}
|
|
19
|
+
exports.getCategoryTagLevelCntsD = getCategoryTagLevelCntsD;
|
|
26
20
|
// 02_Unitの小単元のTagのレベルを取得
|
|
27
21
|
function getUnitSubTagLevelCnts(QuestionDB, unitId, subUnitId, outOfYearRange) {
|
|
28
22
|
var returnQuestions = QuestionDB;
|
|
@@ -32,10 +26,12 @@ function getUnitSubTagLevelCnts(QuestionDB, unitId, subUnitId, outOfYearRange) {
|
|
|
32
26
|
returnQuestions = (0, questionFilterD_1.getSubUnitQuestions)(returnQuestions, unitId, subUnitId);
|
|
33
27
|
return returnQuestions.map(function (question) { return question.tag.level; });
|
|
34
28
|
}
|
|
29
|
+
exports.getUnitSubTagLevelCnts = getUnitSubTagLevelCnts;
|
|
35
30
|
// 03_Yearの小単元のTagのレベルを取得
|
|
36
31
|
function getYearSubTagLevelCnts(QuestionDB, year, key) {
|
|
37
32
|
return (0, questionFilterD_1.getSubYearQuestions)(QuestionDB, year, key).map(function (question) { return question.tag.level; });
|
|
38
33
|
}
|
|
34
|
+
exports.getYearSubTagLevelCnts = getYearSubTagLevelCnts;
|
|
39
35
|
// 11_5Tagのレベルを取得。Unit(大・小単元) 、Year(大・小単元) どちらでも可。
|
|
40
36
|
var getSubTagLevelCnts = function (QuestionDB, selected, outOfYearRange) {
|
|
41
37
|
// QuestionDB をフィルタリング(共通処理)
|
|
@@ -82,6 +78,7 @@ function getCompletedTagRate(tags, onlyCnt) {
|
|
|
82
78
|
var completedTagRate = Math.round((completedTagCnt / tags.length) * 100);
|
|
83
79
|
return completedTagRate;
|
|
84
80
|
}
|
|
81
|
+
exports.getCompletedTagRate = getCompletedTagRate;
|
|
85
82
|
// 22_タグをレベル別に集計し、色と数を返す
|
|
86
83
|
function countTagsByLevel(tags) {
|
|
87
84
|
var tagInfos = lib_1.tagLevels.map(function (_a) {
|
|
@@ -91,6 +88,7 @@ function countTagsByLevel(tags) {
|
|
|
91
88
|
});
|
|
92
89
|
return tagInfos;
|
|
93
90
|
}
|
|
91
|
+
exports.countTagsByLevel = countTagsByLevel;
|
|
94
92
|
// 23_タグをレベルごとに点数化し、到達度を%で返す
|
|
95
93
|
function getCategoryRate(tags) {
|
|
96
94
|
var tagCnt = tags.length;
|
|
@@ -98,6 +96,7 @@ function getCategoryRate(tags) {
|
|
|
98
96
|
var tagPoint = tags.reduce(function (acc, tag) { return acc + POINT_LIST[tag]; }, 0);
|
|
99
97
|
return (tagPoint / (tagCnt * 5)) * 100;
|
|
100
98
|
}
|
|
99
|
+
exports.getCategoryRate = getCategoryRate;
|
|
101
100
|
// タグをレベル別に集計し、色と数を返す。また、選択すると色が変わる
|
|
102
101
|
function countTagsByLevelSelected(tags, tagActives) {
|
|
103
102
|
var tagInfos = lib_1.tagLevels.map(function (_a) {
|
|
@@ -112,3 +111,4 @@ function countTagsByLevelSelected(tags, tagActives) {
|
|
|
112
111
|
});
|
|
113
112
|
return tagInfos;
|
|
114
113
|
}
|
|
114
|
+
exports.countTagsByLevelSelected = countTagsByLevelSelected;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTagNameFilterJ = exports.getSubTagLevelCntsJ = void 0;
|
|
4
|
-
exports.getCategoryTagLevelCntsJ = getCategoryTagLevelCntsJ;
|
|
5
|
-
exports.getUnitSubTagLevelCntsJ = getUnitSubTagLevelCntsJ;
|
|
3
|
+
exports.getTagNameFilterJ = exports.getSubTagLevelCntsJ = exports.getUnitSubTagLevelCntsJ = exports.getCategoryTagLevelCntsJ = void 0;
|
|
6
4
|
var questionFilterJ_1 = require("./questionFilterJ");
|
|
7
5
|
// 01_大単元のTagのレベルを取得
|
|
8
6
|
function getCategoryTagLevelCntsJ(QuestionDB, category, tag) {
|
|
@@ -10,6 +8,7 @@ function getCategoryTagLevelCntsJ(QuestionDB, category, tag) {
|
|
|
10
8
|
var returnQuestions = (0, questionFilterJ_1.getUnitQuestionsJ)(QuestionDB, category);
|
|
11
9
|
return returnQuestions.map(function (question) { return question[tag].level; });
|
|
12
10
|
}
|
|
11
|
+
exports.getCategoryTagLevelCntsJ = getCategoryTagLevelCntsJ;
|
|
13
12
|
// 02_Unitの小単元のTagのレベルを取得
|
|
14
13
|
function getUnitSubTagLevelCntsJ(QuestionDB, unitId, subUnitId, tag) {
|
|
15
14
|
if (tag === void 0) { tag = "basicTag"; }
|
|
@@ -17,6 +16,7 @@ function getUnitSubTagLevelCntsJ(QuestionDB, unitId, subUnitId, tag) {
|
|
|
17
16
|
returnQuestions = (0, questionFilterJ_1.getSubUnitQuestionsJ)(returnQuestions, unitId, subUnitId);
|
|
18
17
|
return returnQuestions.map(function (question) { return question[tag].level; });
|
|
19
18
|
}
|
|
19
|
+
exports.getUnitSubTagLevelCntsJ = getUnitSubTagLevelCntsJ;
|
|
20
20
|
// 11_5Tagのレベルを取得。Unit(大・小単元) 、Year(大・小単元) どちらでも可。
|
|
21
21
|
var getSubTagLevelCntsJ = function (QuestionDB, selected) {
|
|
22
22
|
// QuestionDB をフィルタリング(共通処理)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMiniTestLevelCnts =
|
|
4
|
-
exports.getTestLevelCnts = getTestLevelCnts;
|
|
5
|
-
exports.countByLevel = countByLevel;
|
|
3
|
+
exports.countByLevel = exports.getTestLevelCnts = exports.getMiniTestLevelCnts = void 0;
|
|
6
4
|
var lib_1 = require("@nakamura-123/lib");
|
|
7
5
|
function getMiniTestLevelCnts(MiniTestDB, subject, key) {
|
|
8
6
|
return MiniTestDB.filtered("subject == $0 && categoryKey == $1", subject, String(key)).map(function (item) { return item.level; });
|
|
9
7
|
}
|
|
8
|
+
exports.getMiniTestLevelCnts = getMiniTestLevelCnts;
|
|
10
9
|
function getTestLevelCnts(TestDB, subject) {
|
|
11
10
|
return TestDB.filtered("subject == $0", subject).map(function (item) { return item.level; });
|
|
12
11
|
}
|
|
12
|
+
exports.getTestLevelCnts = getTestLevelCnts;
|
|
13
13
|
// タグをレベル別に集計し、色と数を返す
|
|
14
14
|
function countByLevel(levels) {
|
|
15
15
|
var levelInfos = lib_1.scoreLevels.map(function (_a) {
|
|
@@ -19,3 +19,4 @@ function countByLevel(levels) {
|
|
|
19
19
|
});
|
|
20
20
|
return levelInfos;
|
|
21
21
|
}
|
|
22
|
+
exports.countByLevel = countByLevel;
|
package/dist/page/CoinPage.js
CHANGED
|
@@ -32,8 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
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
|
|
36
|
-
return g
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -32,8 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
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
|
|
36
|
-
return g
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
package/dist/page/HomePage.js
CHANGED
|
@@ -32,8 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
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
|
|
36
|
-
return g
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|
package/dist/page/ReportPage.js
CHANGED
|
@@ -32,8 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
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
|
|
36
|
-
return g
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
37
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
38
|
function step(op) {
|
|
39
39
|
if (f) throw new TypeError("Generator is already executing.");
|