@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
|
@@ -3,32 +3,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var subject = _a.subject, index = _a.index;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const react_redux_1 = require("react-redux");
|
|
9
|
+
const common_1 = require("@nakamura-123/common");
|
|
10
|
+
const tagFncD_1 = require("../functions/tagFncD");
|
|
11
|
+
const basicHook_1 = require("../hooks/basicHook");
|
|
12
|
+
const tagFncJ_1 = require("../functions/tagFncJ");
|
|
13
|
+
const TagBadge5s = ({ subject, index }) => {
|
|
15
14
|
// Redux 状態を取得
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const selectKey = (0, react_redux_1.useSelector)((state) => state.app[subject.list][index].key);
|
|
16
|
+
const outOfYearRangeStore = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.outOfYearRange);
|
|
17
|
+
const outOfYearRange = subject.type === "unit" ? outOfYearRangeStore : undefined;
|
|
19
18
|
// Realm データベースクエリ
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
const QuestionDBInfo = (0, basicHook_1.useGetQuestionQuery)();
|
|
20
|
+
const tagInfos = () => {
|
|
21
|
+
const getCategoryTags = QuestionDBInfo.system === "JLPT"
|
|
23
22
|
? (0, tagFncJ_1.getCategoryTagLevelCntsJ)(QuestionDBInfo.query, selectKey, subject.tag)
|
|
24
23
|
: (0, tagFncD_1.getCategoryTagLevelCntsD)(QuestionDBInfo.query, selectKey, subject.type, outOfYearRange);
|
|
25
24
|
return (0, tagFncD_1.countTagsByLevel)(getCategoryTags);
|
|
26
25
|
};
|
|
27
26
|
return (<react_native_1.View style={styles.container}>
|
|
28
|
-
{tagInfos().map(
|
|
27
|
+
{tagInfos().map((tag, i) => (<common_1.Badge key={i} name={String(tag.cnt)} icon={"tag"} circleColor={tag.color} style={styles.badge}/>))}
|
|
29
28
|
</react_native_1.View>);
|
|
30
29
|
};
|
|
31
|
-
|
|
30
|
+
const styles = react_native_1.StyleSheet.create({
|
|
32
31
|
container: {
|
|
33
32
|
flexDirection: "row",
|
|
34
33
|
justifyContent: "space-between",
|
|
@@ -3,27 +3,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var tagInfos = (0, tagFncD_1.countTagsByLevelSelected)(categoryTags, tagActives);
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const react_redux_1 = require("react-redux");
|
|
9
|
+
const common_1 = require("@nakamura-123/common");
|
|
10
|
+
const tagFncD_1 = require("../functions/tagFncD");
|
|
11
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
12
|
+
const TagBadge5sPress = ({ categoryTags }) => {
|
|
13
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
14
|
+
const tagActives = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.tags);
|
|
15
|
+
const tagInfos = (0, tagFncD_1.countTagsByLevelSelected)(categoryTags, tagActives);
|
|
17
16
|
return (<react_native_1.View style={styles.container}>
|
|
18
|
-
{tagInfos.map(
|
|
19
|
-
<common_1.Badge name={String(tag.cnt)} icon={"tag"} circleColor={tag.circle} badgeColor={tag.badge} iconColor={tag.icon} onPress={
|
|
17
|
+
{tagInfos.map((tag, i) => (<react_native_1.View key={i} style={{ alignItems: "center" }}>
|
|
18
|
+
<common_1.Badge name={String(tag.cnt)} icon={"tag"} circleColor={tag.circle} badgeColor={tag.badge} iconColor={tag.icon} onPress={() => dispatch(stores_1.cfgAction.changeTagActive(tag.level))}/>
|
|
20
19
|
<common_1.MyText fsize="xs" style={styles.txt}>
|
|
21
20
|
{tag.circle === "white" ? "OFF" : "ON"}
|
|
22
21
|
</common_1.MyText>
|
|
23
|
-
</react_native_1.View>)
|
|
22
|
+
</react_native_1.View>))}
|
|
24
23
|
</react_native_1.View>);
|
|
25
24
|
};
|
|
26
|
-
|
|
25
|
+
const styles = react_native_1.StyleSheet.create({
|
|
27
26
|
container: {
|
|
28
27
|
flexDirection: "row",
|
|
29
28
|
justifyContent: "space-between",
|
|
@@ -1,37 +1,25 @@
|
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var cStyle = {
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
9
|
+
const common_1 = require("@nakamura-123/common");
|
|
10
|
+
const AverageBar = ({ percent, label, icon = "star", iconColor = "ltBlack", isLight, }) => {
|
|
11
|
+
const progressColor = lib_1.utilFnc.getScoreColor(percent);
|
|
12
|
+
const cStyle = {
|
|
25
13
|
backgroundColor: isLight ? "transparent" : lib_1.colors.bkBeige,
|
|
26
14
|
borderColor: isLight ? "transparent" : lib_1.colors.ltBlack,
|
|
27
15
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return (<react_native_1.View style={
|
|
16
|
+
const bColor = isLight ? "transparent" : "bkBeige";
|
|
17
|
+
const percentTxt = Math.round(percent);
|
|
18
|
+
return (<react_native_1.View style={Object.assign(Object.assign({}, styles.container), cStyle)}>
|
|
31
19
|
{/* ヘッダー部分 */}
|
|
32
20
|
<react_native_1.View style={styles.header}>
|
|
33
21
|
<react_native_1.View style={styles.percentageContainer}>
|
|
34
|
-
<common_1.MyText style={styles.percentageText}>{
|
|
22
|
+
<common_1.MyText style={styles.percentageText}>{`${percentTxt}%`}</common_1.MyText>
|
|
35
23
|
<common_1.MyText fsize="sm" style={styles.label}>
|
|
36
24
|
{label}
|
|
37
25
|
</common_1.MyText>
|
|
@@ -43,7 +31,7 @@ var AverageBar = function (_a) {
|
|
|
43
31
|
<common_1.ProgressBar progress={percent} barColor={progressColor} backgroundColor={bColor}/>
|
|
44
32
|
</react_native_1.View>);
|
|
45
33
|
};
|
|
46
|
-
|
|
34
|
+
const styles = react_native_1.StyleSheet.create({
|
|
47
35
|
container: {
|
|
48
36
|
padding: 10,
|
|
49
37
|
borderRadius: 12,
|
|
@@ -26,46 +26,45 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var filteredDB = (0, react_1.useMemo)(function () {
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_native_1 = require("react-native");
|
|
31
|
+
const react_redux_1 = require("react-redux");
|
|
32
|
+
const common_1 = require("@nakamura-123/common");
|
|
33
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
34
|
+
const ChartControl_1 = __importDefault(require("./ChartControl"));
|
|
35
|
+
const BarChartContainer = ({ subjectName, TestDB, }) => {
|
|
36
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
37
|
+
const [currentPageIndex, setCurrentPageIndex] = (0, react_1.useState)(0);
|
|
38
|
+
const filteredDB = (0, react_1.useMemo)(() => {
|
|
40
39
|
return TestDB.filtered("subject = $0", subjectName);
|
|
41
40
|
}, [subjectName]);
|
|
42
|
-
|
|
43
|
-
(0, react_1.useEffect)(
|
|
41
|
+
const cnt = filteredDB.length;
|
|
42
|
+
(0, react_1.useEffect)(() => {
|
|
44
43
|
setCurrentPageIndex(cnt > 0 ? Math.floor((cnt - 1) / 5) : 0);
|
|
45
44
|
}, []);
|
|
46
|
-
|
|
45
|
+
const sortedTestDB = (0, react_1.useMemo)(() => {
|
|
47
46
|
return filteredDB.sorted("createdAt", false); // 降順 (新しい日付が先)
|
|
48
47
|
}, [filteredDB]);
|
|
49
|
-
|
|
48
|
+
const fullData = sortedTestDB.map((item, i) => ({
|
|
50
49
|
label: String(i + 1),
|
|
51
50
|
value: item.percent,
|
|
52
51
|
color: lib_1.utilFnc.getLevelColor(item.level),
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
(0, react_1.useEffect)(
|
|
57
|
-
|
|
58
|
-
.filter(
|
|
59
|
-
.map(
|
|
60
|
-
|
|
52
|
+
}));
|
|
53
|
+
const adjusted = adjustToMultipleOfFive(fullData, cnt); // 5の倍数に調整
|
|
54
|
+
const adjustedData = lib_1.utilFnc.getElementsFromIndex(adjusted, currentPageIndex, 5); // 5つの要素を取得
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
56
|
+
const filteredValues = adjustedData
|
|
57
|
+
.filter((item) => item.color !== "transparent") // 透明な色を除外
|
|
58
|
+
.map((item) => item.value); // 値だけを取得
|
|
59
|
+
const average = lib_1.utilFnc.getAverage(filteredValues) || 0;
|
|
61
60
|
dispatch({ type: "score/setTestAverage", payload: average });
|
|
62
61
|
}, [adjustedData, dispatch]);
|
|
63
62
|
if (cnt === 0)
|
|
64
63
|
return null;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
const maxValue = 100;
|
|
65
|
+
const barWidth = adjustedData.length > 6 ? 35 : 40;
|
|
66
|
+
const handleLeft = () => setCurrentPageIndex(currentPageIndex - 1);
|
|
67
|
+
const handleRight = () => setCurrentPageIndex(currentPageIndex + 1);
|
|
69
68
|
return (<react_native_1.View style={styles.container}>
|
|
70
69
|
<ChartControl_1.default onPressLeft={handleLeft} onPressRight={handleRight} title="模擬試験記録" showLeft={currentPageIndex > 0} showRight={currentPageIndex < cnt / 5 - 1}/>
|
|
71
70
|
{/* BarChart を使用 */}
|
|
@@ -73,10 +72,10 @@ var BarChartContainer = function (_a) {
|
|
|
73
72
|
</react_native_1.View>);
|
|
74
73
|
};
|
|
75
74
|
function adjustToMultipleOfFive(data, cnt) {
|
|
76
|
-
|
|
75
|
+
const remainder = cnt % 5; // 余りを計算
|
|
77
76
|
if (remainder !== 0) {
|
|
78
|
-
|
|
79
|
-
for (
|
|
77
|
+
const itemsToAdd = 5 - remainder; // 追加する要素数
|
|
78
|
+
for (let i = cnt; i < cnt + itemsToAdd; i++) {
|
|
80
79
|
data.push({
|
|
81
80
|
label: String(i + 1),
|
|
82
81
|
value: 0,
|
|
@@ -86,7 +85,7 @@ function adjustToMultipleOfFive(data, cnt) {
|
|
|
86
85
|
}
|
|
87
86
|
return data;
|
|
88
87
|
}
|
|
89
|
-
|
|
88
|
+
const styles = react_native_1.StyleSheet.create({
|
|
90
89
|
container: {
|
|
91
90
|
padding: 16,
|
|
92
91
|
backgroundColor: lib_1.colors.bkBeige,
|
|
@@ -3,11 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var title = _a.title, onPressLeft = _a.onPressLeft, onPressRight = _a.onPressRight, _b = _a.showLeft, showLeft = _b === void 0 ? true : _b, _c = _a.showRight, showRight = _c === void 0 ? true : _c;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const common_1 = require("@nakamura-123/common");
|
|
9
|
+
const ChartControl = ({ title, onPressLeft, onPressRight, showLeft = true, showRight = true, }) => {
|
|
11
10
|
return (<react_native_1.View style={styles.container}>
|
|
12
11
|
{/* 左矢印 */}
|
|
13
12
|
<react_native_1.View style={styles.iconContainer}>
|
|
@@ -23,7 +22,7 @@ var ChartControl = function (_a) {
|
|
|
23
22
|
</react_native_1.View>
|
|
24
23
|
</react_native_1.View>);
|
|
25
24
|
};
|
|
26
|
-
|
|
25
|
+
const styles = react_native_1.StyleSheet.create({
|
|
27
26
|
container: {
|
|
28
27
|
flexDirection: "row",
|
|
29
28
|
alignItems: "center",
|
|
@@ -3,29 +3,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var t = (0, common_1.useDrillTranslation)().t;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const common_1 = require("@nakamura-123/common");
|
|
9
|
+
const Square3s = ({ subjectName, TestDB }) => {
|
|
10
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
12
11
|
// 回数を数える
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const ThisTestDB = TestDB.filtered("subject == $0", subjectName);
|
|
13
|
+
const challengeCnt = ThisTestDB.length;
|
|
14
|
+
const successCnt = ThisTestDB.filtered("isSuccess == true").length;
|
|
15
|
+
const perfectCnt = ThisTestDB.filtered("isPerfect == true").length;
|
|
16
|
+
const info = [
|
|
18
17
|
{ cnt: challengeCnt, label: t("test.square3.exam"), icon: "clipboard" },
|
|
19
18
|
{ cnt: successCnt, label: t("test.square3.success"), icon: "check-circle" },
|
|
20
19
|
{ cnt: perfectCnt, label: t("test.square3.perfect"), icon: "paw" },
|
|
21
20
|
];
|
|
22
21
|
return (<react_native_1.View style={styles.container}>
|
|
23
|
-
{info.map(
|
|
22
|
+
{info.map((item, index) => {
|
|
24
23
|
return (<common_1.SquareIcon key={index} cnt={item.cnt} cntText="回" label={item.label} icon={item.icon}/>);
|
|
25
24
|
})}
|
|
26
25
|
</react_native_1.View>);
|
|
27
26
|
};
|
|
28
|
-
|
|
27
|
+
const styles = react_native_1.StyleSheet.create({
|
|
29
28
|
container: {
|
|
30
29
|
flexDirection: "row",
|
|
31
30
|
justifyContent: "space-between",
|
|
@@ -1,57 +1,37 @@
|
|
|
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
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
-
if (ar || !(i in from)) {
|
|
16
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
-
ar[i] = from[i];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
-
};
|
|
22
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
3
|
exports.addBadgeTitleInfo = exports.checkTest = exports.getMissingDailyBadgeInfos = exports.getMissingBadgeInfos = void 0;
|
|
24
|
-
|
|
4
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
25
5
|
// 獲得できていないバッジ情報を取得
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
const getMissingBadgeInfos = (BadgeDB, type) => {
|
|
7
|
+
const selectedBadgeSet = lib_1.badgeSet.badge5Sets[type];
|
|
8
|
+
const collectedIds = BadgeDB.map((badge) => badge.badgeId);
|
|
9
|
+
const missingBadgeInfo = selectedBadgeSet.filter((badgeInfo) => !collectedIds.includes(badgeInfo.id));
|
|
30
10
|
return missingBadgeInfo;
|
|
31
11
|
};
|
|
32
12
|
exports.getMissingBadgeInfos = getMissingBadgeInfos;
|
|
33
13
|
// デイリーバッジの未獲得情報を取得
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
KEYS.forEach(
|
|
38
|
-
|
|
39
|
-
missingBadgeInfo =
|
|
14
|
+
const getMissingDailyBadgeInfos = (BadgeDB) => {
|
|
15
|
+
const KEYS = ["day", "week", "total", "continue"];
|
|
16
|
+
let missingBadgeInfo = [];
|
|
17
|
+
KEYS.forEach((key) => {
|
|
18
|
+
const missingBadges = getMissingDailyBadge(BadgeDB, key);
|
|
19
|
+
missingBadgeInfo = [...missingBadgeInfo, ...missingBadges];
|
|
40
20
|
});
|
|
41
21
|
return missingBadgeInfo;
|
|
42
22
|
};
|
|
43
23
|
exports.getMissingDailyBadgeInfos = getMissingDailyBadgeInfos;
|
|
44
24
|
// ## デイリーバッジの未獲得情報を取得
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
const getMissingDailyBadge = (BadgeDB, type) => {
|
|
26
|
+
const selectedBadgeSet = lib_1.badgeSet.badge5Sets[type];
|
|
27
|
+
const collectedIds = BadgeDB.filtered("category == $0", type).map((badge) => badge.badgeId);
|
|
28
|
+
const missingBadgeInfo = selectedBadgeSet.filter((badgeInfo) => !collectedIds.includes(badgeInfo.id));
|
|
49
29
|
return missingBadgeInfo;
|
|
50
30
|
};
|
|
51
31
|
// テストの合格回数と満点回数から、バッジの取得を判定
|
|
52
32
|
// 一瞬前にテストデータを保存しているため、ここでscoreを取得する必要はない
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
const checkTest = (testData, fnc) => {
|
|
34
|
+
const { successCnt, perfectCnt } = testData;
|
|
55
35
|
if (fnc === "success1" && successCnt >= 1)
|
|
56
36
|
return true;
|
|
57
37
|
if (fnc === "success2" && successCnt >= 2)
|
|
@@ -66,10 +46,10 @@ var checkTest = function (testData, fnc) {
|
|
|
66
46
|
};
|
|
67
47
|
exports.checkTest = checkTest;
|
|
68
48
|
// バッジに必要な情報(タイトル、カテゴリー、科目)を追加
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return
|
|
49
|
+
const addBadgeTitleInfo = (badge, selected) => {
|
|
50
|
+
const title = selected.lesson.title;
|
|
51
|
+
const subject = selected.subject;
|
|
52
|
+
const category = selected.category.toString();
|
|
53
|
+
return Object.assign(Object.assign({}, badge), { title, subject, category });
|
|
74
54
|
};
|
|
75
55
|
exports.addBadgeTitleInfo = addBadgeTitleInfo;
|
|
@@ -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.getBestDailyLogData = exports.getDailyLogData = exports.addDailyBadgeTitleInfo = exports.checkDaily = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
5
|
+
const gradeFnc_1 = require("./gradeFnc");
|
|
17
6
|
// デイリーバッジの取得条件を確認
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
const checkDaily = (dailyData, info) => {
|
|
8
|
+
const { today, weekly, total, consecutive } = dailyData;
|
|
9
|
+
const { id, fnc } = info;
|
|
21
10
|
switch (fnc) {
|
|
22
11
|
case "day":
|
|
23
12
|
return today >= id * 10;
|
|
@@ -33,25 +22,25 @@ var checkDaily = function (dailyData, info) {
|
|
|
33
22
|
};
|
|
34
23
|
exports.checkDaily = checkDaily;
|
|
35
24
|
// デイリーバッジ保存や表示に必要な情報を追加
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return
|
|
25
|
+
const addDailyBadgeTitleInfo = (badge, t) => {
|
|
26
|
+
const { fnc } = badge;
|
|
27
|
+
const title = t(`grade.dailyBadge.${fnc}`);
|
|
28
|
+
return Object.assign(Object.assign({}, badge), { title, subject: "daily", category: fnc });
|
|
40
29
|
};
|
|
41
30
|
exports.addDailyBadgeTitleInfo = addDailyBadgeTitleInfo;
|
|
42
31
|
// # 今日時点のデイリーログの情報を取得
|
|
43
|
-
|
|
32
|
+
const getDailyLogData = (DailyDB) => {
|
|
44
33
|
// 今日の問題数取得
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
const today = lib_1.timeFnc.getToday();
|
|
35
|
+
const todayLog = DailyDB.filtered("date == $0", today)[0];
|
|
36
|
+
const quizCnt = todayLog ? (0, gradeFnc_1.formatTodayLog)(todayLog).quizCnt : 0;
|
|
48
37
|
// 今週の問題数取得
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
const weeklyDays = lib_1.timeFnc.getThisWeek(today);
|
|
39
|
+
const weeklyCntArr = (0, gradeFnc_1.getWeeklyCnts)(DailyDB, weeklyDays);
|
|
40
|
+
const weeklyCnt = weeklyCntArr.reduce((sum, cnt) => sum + cnt, 0);
|
|
52
41
|
// その他の取得
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
const totalQuizCnt = (0, gradeFnc_1.getTotalQuizCnt)(DailyDB);
|
|
43
|
+
const consecutiveDays = (0, gradeFnc_1.getConsecutiveStudyDays)(DailyDB);
|
|
55
44
|
// 結果をまとめて返す
|
|
56
45
|
return {
|
|
57
46
|
today: quizCnt,
|
|
@@ -62,16 +51,16 @@ var getDailyLogData = function (DailyDB) {
|
|
|
62
51
|
};
|
|
63
52
|
exports.getDailyLogData = getDailyLogData;
|
|
64
53
|
// # 過去も含めてすべてのデイリーログ情報からベストデータを取得
|
|
65
|
-
|
|
54
|
+
const getBestDailyLogData = (DailyDB) => {
|
|
66
55
|
// rd 1. 1日の最高問題数
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
const maxQuizCntLog = (0, gradeFnc_1.findMaxQuizCntLog)(DailyDB);
|
|
57
|
+
const maxQuizCnt = maxQuizCntLog ? maxQuizCntLog.quizCnt : 0;
|
|
69
58
|
// rd 2. 週間の最高問題数
|
|
70
|
-
|
|
59
|
+
const weeklyMaxQuizCnt = (0, gradeFnc_1.getMaxWeeklyQuizCnt)(DailyDB);
|
|
71
60
|
// rd 3. 通算問題数を取得
|
|
72
|
-
|
|
61
|
+
const totalCnt = (0, gradeFnc_1.getTotalQuizCnt)(DailyDB);
|
|
73
62
|
// rd 4. 通算学習日数を取得
|
|
74
|
-
|
|
63
|
+
const longestConsecutiveDays = (0, gradeFnc_1.getLongestConsecutiveStudyDays)(DailyDB);
|
|
75
64
|
return {
|
|
76
65
|
today: maxQuizCnt,
|
|
77
66
|
weekly: weeklyMaxQuizCnt,
|
|
@@ -2,32 +2,30 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.filterDailyLogBadge = exports.filterTest = exports.filterMiniTest = exports.filterBasicBadge = void 0;
|
|
4
4
|
// 01.ベーシックの指定カテゴリーののバッジを取得
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const filterBasicBadge = (BadgeDB, selected) => {
|
|
6
|
+
const { subject, category } = selected;
|
|
7
|
+
const filteredBadges = BadgeDB.filtered("subject == $0 && category == $1", subject, category.toString());
|
|
8
8
|
return filteredBadges;
|
|
9
9
|
};
|
|
10
10
|
exports.filterBasicBadge = filterBasicBadge;
|
|
11
11
|
// 02.ミニテストの合格回数と満点回数を取得
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return { successCnt
|
|
12
|
+
const filterMiniTest = (MiniTestDB, selected) => {
|
|
13
|
+
const { subject, category } = selected;
|
|
14
|
+
const filteredTest = MiniTestDB.filtered("subject == $0 && categoryKey == $1 && percent > $2", subject, category, 85);
|
|
15
|
+
const successCnt = filteredTest.length;
|
|
16
|
+
const perfectCnt = filteredTest.filtered("percent == $0", 100).length;
|
|
17
|
+
return { successCnt, perfectCnt };
|
|
18
18
|
};
|
|
19
19
|
exports.filterMiniTest = filterMiniTest;
|
|
20
20
|
// 03.模擬試験の合格回数と満点回数を取得
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return { successCnt
|
|
21
|
+
const filterTest = (TestDB, selected) => {
|
|
22
|
+
const { subject } = selected;
|
|
23
|
+
const filteredTest = TestDB.filtered("subject == $0 && percent > $1", subject, 85);
|
|
24
|
+
const successCnt = filteredTest.length;
|
|
25
|
+
const perfectCnt = filteredTest.filtered("percent == $0", 100).length;
|
|
26
|
+
return { successCnt, perfectCnt };
|
|
27
27
|
};
|
|
28
28
|
exports.filterTest = filterTest;
|
|
29
29
|
// 04.DailyLogの情報を取得
|
|
30
|
-
|
|
31
|
-
return BadgeDB.filtered("subject == $0", "daily");
|
|
32
|
-
};
|
|
30
|
+
const filterDailyLogBadge = (BadgeDB) => BadgeDB.filtered("subject == $0", "daily");
|
|
33
31
|
exports.filterDailyLogBadge = filterDailyLogBadge;
|