revdev 0.384.0 → 0.385.0

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 (58) hide show
  1. package/lib/back/common/request.d.ts +0 -8
  2. package/lib/back/exam/entity.d.ts +7 -0
  3. package/lib/back/exam/entity.js +2 -0
  4. package/lib/back/exam/index.d.ts +2 -0
  5. package/lib/back/exam/index.js +18 -0
  6. package/lib/back/exam/request.d.ts +9 -0
  7. package/lib/back/exam/request.js +2 -0
  8. package/lib/back/index.d.ts +1 -0
  9. package/lib/back/index.js +1 -0
  10. package/lib/back/item/entity.d.ts +1 -0
  11. package/lib/back/rule/request.d.ts +2 -1
  12. package/lib/back/tag/request.d.ts +2 -3
  13. package/lib/common/course.d.ts +1 -1
  14. package/lib/common/entity.d.ts +1 -1
  15. package/lib/common/{enums.d.ts → enum/index.d.ts} +10 -0
  16. package/lib/common/{enums.js → enum/index.js} +27 -1
  17. package/lib/common/enum/step.d.ts +7 -0
  18. package/lib/common/enum/step.js +11 -0
  19. package/lib/common/gen.d.ts +3 -0
  20. package/lib/common/index.d.ts +2 -1
  21. package/lib/common/index.js +2 -1
  22. package/lib/common/modifier.d.ts +1 -1
  23. package/lib/common/request.d.ts +1 -1
  24. package/lib/common/status.d.ts +8 -0
  25. package/lib/common/status.js +2 -0
  26. package/lib/front/exam/entity.d.ts +48 -0
  27. package/lib/front/exam/entity.js +2 -0
  28. package/lib/front/exam/index.d.ts +2 -0
  29. package/lib/front/exam/index.js +18 -0
  30. package/lib/front/exam/request.d.ts +18 -0
  31. package/lib/front/exam/request.js +2 -0
  32. package/lib/front/exercise/entity.d.ts +4 -1
  33. package/lib/front/general/entity.d.ts +2 -1
  34. package/lib/front/index.d.ts +1 -0
  35. package/lib/front/index.js +1 -0
  36. package/lib/front/item/entity.d.ts +24 -1
  37. package/lib/front/item/request.d.ts +9 -0
  38. package/lib/front/lang/entity.d.ts +0 -2
  39. package/lib/front/user/entity.d.ts +8 -10
  40. package/lib/shared/exam/entity.d.ts +58 -0
  41. package/lib/shared/exam/entity.js +2 -0
  42. package/lib/shared/exam/index.d.ts +2 -0
  43. package/lib/shared/exam/index.js +18 -0
  44. package/lib/shared/exam/request.d.ts +32 -0
  45. package/lib/shared/exam/request.js +2 -0
  46. package/lib/shared/exercise/regular.d.ts +1 -0
  47. package/lib/shared/index.d.ts +1 -0
  48. package/lib/shared/index.js +1 -0
  49. package/lib/shared/item/request.d.ts +11 -3
  50. package/lib/shared/topic/entity.d.ts +4 -1
  51. package/lib/tests/array.test.js +4 -0
  52. package/lib/utils/array.d.ts +1 -0
  53. package/lib/utils/array.js +3 -0
  54. package/lib/utils/exam.d.ts +13 -0
  55. package/lib/utils/exam.js +65 -0
  56. package/lib/utils/index.d.ts +1 -0
  57. package/lib/utils/index.js +1 -0
  58. package/package.json +1 -1
@@ -1,11 +1,3 @@
1
- import { EntryStatus } from "../../common";
2
- export interface BoEntryStatusUpdateRequest {
3
- id: string;
4
- status: EntryStatus;
5
- }
6
- export interface BoEntryStatusUpdateModifier extends BoEntryStatusUpdateRequest {
7
- active: boolean;
8
- }
9
1
  export interface BoEntryInitRateRequest {
10
2
  id: string;
11
3
  initRate: number;
@@ -0,0 +1,7 @@
1
+ import { DualContribGen } from "../../common";
2
+ import { ExamModifier } from "../../shared";
3
+ export interface BoExamRecord extends Pick<ExamModifier, "id" | "name" | "langCode" | "levelCode" | "itemTotal" | "answerTotal" | "duration" | "active" | "status" | "ruleTotal" | "topicTotal" | "exerciseTotal" | "creationStep" | "durationMode" | "isPrivate" | "showUserResult" | "passTotal" | "attemptLimit" | "isExample"> {
4
+ contrib: DualContribGen;
5
+ }
6
+ export interface BoExamModifier extends ExamModifier {
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./entity";
2
+ export * from "./request";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./entity"), exports);
18
+ __exportStar(require("./request"), exports);
@@ -0,0 +1,9 @@
1
+ import { ChangePositionRequest } from "../..";
2
+ import { LangFeedRequest } from "../../feed";
3
+ export interface BoExamFeedRequest extends LangFeedRequest {
4
+ levelCode?: string;
5
+ isExample?: boolean;
6
+ }
7
+ export interface BoExamChangePositionRequest extends ChangePositionRequest {
8
+ examId: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -25,4 +25,5 @@ export * from "./admin";
25
25
  export * from "./ai";
26
26
  export * from "./topic";
27
27
  export * from "./answer";
28
+ export * from "./exam";
28
29
  export * from "./complaint";
package/lib/back/index.js CHANGED
@@ -41,4 +41,5 @@ __exportStar(require("./admin"), exports);
41
41
  __exportStar(require("./ai"), exports);
42
42
  __exportStar(require("./topic"), exports);
43
43
  __exportStar(require("./answer"), exports);
44
+ __exportStar(require("./exam"), exports);
44
45
  __exportStar(require("./complaint"), exports);
@@ -26,4 +26,5 @@ export interface BoItemRecord {
26
26
  valid: boolean;
27
27
  errorText?: string;
28
28
  rule?: NameGen;
29
+ topic?: NameGen;
29
30
  }
@@ -27,7 +27,8 @@ export interface BoRuleModifier extends BoUpdateRuleRequest {
27
27
  }
28
28
  export interface BoRuleFeedRequest extends LangFeedRequest {
29
29
  hasLevel?: boolean;
30
- levelCode?: string;
30
+ hasCategory?: boolean;
31
+ levelCode?: string | string[];
31
32
  categoryId?: string;
32
33
  isRoot?: boolean;
33
34
  isCanon?: boolean;
@@ -1,6 +1,5 @@
1
- import { EntryStatus } from "../../common";
1
+ import { EntryStatus, EntryStatusUpdateRequest } from "../../common";
2
2
  import { FeedRequest } from "../../feed";
3
- import { BoEntryStatusUpdateRequest } from "../common";
4
3
  export interface BoTagFeedRequest extends FeedRequest {
5
4
  status?: EntryStatus;
6
5
  active?: boolean;
@@ -13,7 +12,7 @@ export interface BoUpdateTagRequest {
13
12
  active: boolean;
14
13
  status?: EntryStatus;
15
14
  }
16
- export interface BoUpdateTagStatusRequest extends BoEntryStatusUpdateRequest {
15
+ export interface BoUpdateTagStatusRequest extends EntryStatusUpdateRequest {
17
16
  code?: string;
18
17
  }
19
18
  export interface BoTagWordFeedRequest extends FeedRequest {
@@ -1,4 +1,4 @@
1
- import { PositionDirection } from "./enums";
1
+ import { PositionDirection } from "./enum";
2
2
  import { IdRequest } from "./request";
3
3
  export interface ChangePositionRequest extends IdRequest {
4
4
  position: PositionDirection;
@@ -1,4 +1,4 @@
1
- import { ContentType } from "./enums";
1
+ import { ContentType } from "./enum";
2
2
  export interface CreatedEntity {
3
3
  id: string;
4
4
  }
@@ -1,3 +1,4 @@
1
+ export * from "./step";
1
2
  export declare enum Knowing {
2
3
  Known = 1,
3
4
  Saved = 2,
@@ -69,6 +70,11 @@ export declare enum PassExerciseStatus {
69
70
  Completed = "completed",
70
71
  Result = "result"
71
72
  }
73
+ export declare enum PassExamStatus {
74
+ Progress = "progress",
75
+ Completed = "completed",
76
+ TimeExpired = "timeExpired"
77
+ }
72
78
  export declare enum PositionDirection {
73
79
  UP = "UP",
74
80
  DOWN = "DOWN"
@@ -145,3 +151,7 @@ export declare enum ExerciseKind {
145
151
  Match = "match",
146
152
  Correct = "correct"
147
153
  }
154
+ export declare enum ExamDurationTimeMode {
155
+ PerExercise = "perExercise",
156
+ Total = "total"
157
+ }
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExerciseKind = exports.TopicCategory = exports.AiPromptName = exports.PermissionName = exports.AudioSex = exports.ImageKind = exports.AudioKind = exports.PointerMode = exports.ContentType = exports.PositionDirection = exports.PassExerciseStatus = exports.PassEpisodeStatus = exports.PassStatus = exports.PostStatus = exports.SetType = exports.ItemType = exports.ExerciseMode = exports.ExerciseType = exports.SmmCampaignType = exports.SmmCampaignStatus = exports.SocialProvider = exports.EntryStatus = exports.QuizMode = exports.UserReaction = exports.WordMode = exports.Knowing = void 0;
17
+ exports.ExamDurationTimeMode = exports.ExerciseKind = exports.TopicCategory = exports.AiPromptName = exports.PermissionName = exports.AudioSex = exports.ImageKind = exports.AudioKind = exports.PointerMode = exports.ContentType = exports.PositionDirection = exports.PassExamStatus = exports.PassExerciseStatus = exports.PassEpisodeStatus = exports.PassStatus = exports.PostStatus = exports.SetType = exports.ItemType = exports.ExerciseMode = exports.ExerciseType = exports.SmmCampaignType = exports.SmmCampaignStatus = exports.SocialProvider = exports.EntryStatus = exports.QuizMode = exports.UserReaction = exports.WordMode = exports.Knowing = void 0;
18
+ __exportStar(require("./step"), exports);
4
19
  var Knowing;
5
20
  (function (Knowing) {
6
21
  Knowing[Knowing["Known"] = 1] = "Known";
@@ -90,6 +105,12 @@ var PassExerciseStatus;
90
105
  PassExerciseStatus["Completed"] = "completed";
91
106
  PassExerciseStatus["Result"] = "result";
92
107
  })(PassExerciseStatus || (exports.PassExerciseStatus = PassExerciseStatus = {}));
108
+ var PassExamStatus;
109
+ (function (PassExamStatus) {
110
+ PassExamStatus["Progress"] = "progress";
111
+ PassExamStatus["Completed"] = "completed";
112
+ PassExamStatus["TimeExpired"] = "timeExpired";
113
+ })(PassExamStatus || (exports.PassExamStatus = PassExamStatus = {}));
93
114
  var PositionDirection;
94
115
  (function (PositionDirection) {
95
116
  PositionDirection["UP"] = "UP";
@@ -180,3 +201,8 @@ var ExerciseKind;
180
201
  ExerciseKind["Match"] = "match";
181
202
  ExerciseKind["Correct"] = "correct";
182
203
  })(ExerciseKind || (exports.ExerciseKind = ExerciseKind = {}));
204
+ var ExamDurationTimeMode;
205
+ (function (ExamDurationTimeMode) {
206
+ ExamDurationTimeMode["PerExercise"] = "perExercise";
207
+ ExamDurationTimeMode["Total"] = "total";
208
+ })(ExamDurationTimeMode || (exports.ExamDurationTimeMode = ExamDurationTimeMode = {}));
@@ -0,0 +1,7 @@
1
+ export declare enum ExamCreationStep {
2
+ basic = "basic",
3
+ rule = "rule",
4
+ exercise = "exercise",
5
+ time = "time",
6
+ done = "done"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExamCreationStep = void 0;
4
+ var ExamCreationStep;
5
+ (function (ExamCreationStep) {
6
+ ExamCreationStep["basic"] = "basic";
7
+ ExamCreationStep["rule"] = "rule";
8
+ ExamCreationStep["exercise"] = "exercise";
9
+ ExamCreationStep["time"] = "time";
10
+ ExamCreationStep["done"] = "done";
11
+ })(ExamCreationStep || (exports.ExamCreationStep = ExamCreationStep = {}));
@@ -51,3 +51,6 @@ export interface LevelGen {
51
51
  code: string;
52
52
  rate: number;
53
53
  }
54
+ export type WithLevels<T extends object> = T & {
55
+ levels: LevelGen[];
56
+ };
@@ -1,6 +1,6 @@
1
1
  export * from "./api";
2
2
  export * from "./options";
3
- export * from "./enums";
3
+ export * from "./enum";
4
4
  export * from "./literals";
5
5
  export * from "./request";
6
6
  export * from "./entity";
@@ -11,3 +11,4 @@ export * from "./exception";
11
11
  export * from "./modifier";
12
12
  export * from "./image";
13
13
  export * from "./course";
14
+ export * from "./status";
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./api"), exports);
18
18
  __exportStar(require("./options"), exports);
19
- __exportStar(require("./enums"), exports);
19
+ __exportStar(require("./enum"), exports);
20
20
  __exportStar(require("./literals"), exports);
21
21
  __exportStar(require("./request"), exports);
22
22
  __exportStar(require("./entity"), exports);
@@ -27,3 +27,4 @@ __exportStar(require("./exception"), exports);
27
27
  __exportStar(require("./modifier"), exports);
28
28
  __exportStar(require("./image"), exports);
29
29
  __exportStar(require("./course"), exports);
30
+ __exportStar(require("./status"), exports);
@@ -1,4 +1,4 @@
1
- import { UserReaction } from "./enums";
1
+ import { UserReaction } from "./enum";
2
2
  export interface ReactionModifier {
3
3
  id: string;
4
4
  reaction?: UserReaction;
@@ -1,4 +1,4 @@
1
- import { PostStatus, UserReaction } from "./enums";
1
+ import { PostStatus, UserReaction } from "./enum";
2
2
  export interface SlugRequest {
3
3
  slug: string;
4
4
  }
@@ -0,0 +1,8 @@
1
+ import { EntryStatus } from "./enum";
2
+ export interface EntryStatusUpdateRequest {
3
+ id: string;
4
+ status: EntryStatus;
5
+ }
6
+ export interface EntryStatusUpdateModifier extends EntryStatusUpdateRequest {
7
+ active: boolean;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,48 @@
1
+ import { PassExamStatus, ExamDurationTimeMode, EntryStatus, ExamCreationStep } from "../../common";
2
+ import { ExamModifier, ExamRuleCategoryRecord, TopicRecord } from "../../shared";
3
+ import { FeExerciseChoiceCursor } from "../exercise";
4
+ export interface FeExamRecord {
5
+ id: string;
6
+ name: string;
7
+ description?: string;
8
+ langCode: string;
9
+ levelCode: string;
10
+ duration: number;
11
+ durationMode: ExamDurationTimeMode;
12
+ isPrivate: boolean;
13
+ active: boolean;
14
+ status?: EntryStatus;
15
+ creationStep?: ExamCreationStep;
16
+ created: string;
17
+ showUserResult: boolean;
18
+ passExamId?: string;
19
+ passStatus?: PassExamStatus;
20
+ grade?: number;
21
+ passTotal: number;
22
+ ruleTotal: number;
23
+ topicTotal: number;
24
+ exerciseTotal: number;
25
+ exerciseItemTotal: number;
26
+ attemptLimit: number;
27
+ }
28
+ export interface FeExamCursor {
29
+ examId: string;
30
+ passExamStatus: PassExamStatus;
31
+ grade: number;
32
+ created: string;
33
+ exerciseCursor?: FeExerciseChoiceCursor;
34
+ total: number;
35
+ passedTotal: number;
36
+ passExamId: string;
37
+ attemptsLeft: number;
38
+ }
39
+ export interface FeExamEntity extends Pick<ExamModifier, "id" | "name" | "description" | "langCode" | "levelCode" | "duration" | "durationMode" | "created" | "exerciseItemTotal" | "showUserResult"> {
40
+ cursor?: FeExamCursor;
41
+ rules: ExamRuleCategoryRecord[];
42
+ topics: TopicRecord[];
43
+ }
44
+ export interface FeExamExampleRecord {
45
+ id: string;
46
+ name: string;
47
+ levelCode: string;
48
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./entity";
2
+ export * from "./request";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./entity"), exports);
18
+ __exportStar(require("./request"), exports);
@@ -0,0 +1,18 @@
1
+ import { FeedRequest, LangFeedRequest } from "../../feed";
2
+ import { FeAnswerRequest } from "../exercise";
3
+ export interface FeExamFeedRequest extends LangFeedRequest {
4
+ levelCode?: string;
5
+ }
6
+ export interface FeExamAnswerRequest extends FeAnswerRequest {
7
+ examId: string;
8
+ }
9
+ export interface FePassExamFeedRequest extends LangFeedRequest {
10
+ examId: string;
11
+ }
12
+ export interface FeExamItemFeedRequest extends FeedRequest {
13
+ examId: string;
14
+ }
15
+ export interface FePassExamResultRequest {
16
+ examId?: string;
17
+ passExamId: string;
18
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  import { FeEntityPointer, FePassItemResult, WordUserGen } from "../..";
2
- import { ExerciseKind, ExerciseMode, ExerciseType, PassExerciseStatus, PassStatus, RuleGen } from "../../common";
2
+ import { ExerciseKind, ExerciseMode, ExerciseType, NameGen, PassExerciseStatus, PassStatus, RuleGen } from "../../common";
3
3
  export interface FeExerciseNavigator {
4
4
  id: string;
5
5
  name: string;
@@ -62,11 +62,13 @@ export interface FeExerciseRecord {
62
62
  grade?: number;
63
63
  passStatus?: PassStatus;
64
64
  rootRule?: RuleGen;
65
+ levelCode?: string;
65
66
  rules: RuleGen[];
66
67
  }
67
68
  export interface FeExerciseEntity {
68
69
  id: string;
69
70
  kind: ExerciseKind;
71
+ levelCode?: string;
70
72
  rules: RuleGen[];
71
73
  categoryRule?: RuleGen;
72
74
  cursor: FeExerciseCursor;
@@ -87,6 +89,7 @@ export interface FePassItemInfo {
87
89
  isCorrect: boolean;
88
90
  correctAnswer?: string;
89
91
  rule?: RuleGen;
92
+ topic?: NameGen;
90
93
  }
91
94
  export interface FeExerciseBaseCursor {
92
95
  exerciseId: string;
@@ -1,4 +1,4 @@
1
- import { IdCodeOption } from "../../common";
1
+ import { IdCodeOption, StringOption } from "../../common";
2
2
  import { AppSettings } from "../../shared";
3
3
  import { FeLangRecord } from "../lang";
4
4
  import { FeListRecord } from "../list";
@@ -10,6 +10,7 @@ export interface FeInitData {
10
10
  quizCodes: string[];
11
11
  localeCodes: string[];
12
12
  settings: AppSettings;
13
+ levelOptions: StringOption[];
13
14
  }
14
15
  export interface FeIntroductionData {
15
16
  langs: FeLangRecord[];
@@ -22,3 +22,4 @@ export * from "./exercise";
22
22
  export * from "./pass";
23
23
  export * from "./rule";
24
24
  export * from "./complaint";
25
+ export * from "./exam";
@@ -38,3 +38,4 @@ __exportStar(require("./exercise"), exports);
38
38
  __exportStar(require("./pass"), exports);
39
39
  __exportStar(require("./rule"), exports);
40
40
  __exportStar(require("./complaint"), exports);
41
+ __exportStar(require("./exam"), exports);
@@ -1,4 +1,4 @@
1
- import { ItemType } from "../../common";
1
+ import { ItemType, NameGen, RuleGen } from "../../common";
2
2
  export interface FeBasicItemPointer {
3
3
  id: string;
4
4
  type: ItemType;
@@ -31,3 +31,26 @@ export interface FePassItemResult {
31
31
  content?: string;
32
32
  answers: FePassAnswerResult[];
33
33
  }
34
+ export interface FeAnswerRecord {
35
+ id: string;
36
+ text: string;
37
+ isCorrect: boolean;
38
+ }
39
+ export interface FeItemRecord {
40
+ id: string;
41
+ content: string;
42
+ answers: FeAnswerRecord[];
43
+ valid: boolean;
44
+ errorText?: string;
45
+ exerciseId: string;
46
+ position: number;
47
+ rule?: RuleGen;
48
+ topic?: NameGen;
49
+ created: string;
50
+ }
51
+ export interface FeItemModifier {
52
+ id: string;
53
+ content: string;
54
+ answers: FeAnswerRecord[];
55
+ exerciseId: string;
56
+ }
@@ -3,3 +3,12 @@ export interface FeItemSetRequest {
3
3
  exerciseId: string;
4
4
  type: ItemType;
5
5
  }
6
+ export interface FeCreateItemRequest {
7
+ exerciseId: string;
8
+ answers: string[];
9
+ content: string;
10
+ correctAnswerIndex: number;
11
+ }
12
+ export interface FeUpdateItemRequest extends Omit<FeCreateItemRequest, "exerciseId"> {
13
+ id: string;
14
+ }
@@ -2,7 +2,6 @@ import { Feed } from "../../feed";
2
2
  import { FeListRecord } from "../list";
3
3
  import { FeTableRecord } from "../table";
4
4
  import { FeTagRecord } from "../tag";
5
- import { FeUserRelationMeta } from "../user";
6
5
  export interface FeLangRecord {
7
6
  code: string;
8
7
  wordTotal: number;
@@ -15,7 +14,6 @@ export interface FeLangEntity {
15
14
  code: string;
16
15
  nativeName: string;
17
16
  wordTotal: number;
18
- relation?: FeUserRelationMeta;
19
17
  listFeed: Feed<FeListRecord>;
20
18
  tagFeed: Feed<FeTagRecord>;
21
19
  tableFeed: Feed<FeTableRecord>;
@@ -1,15 +1,13 @@
1
- import { UserWordKnowing } from "../../shared";
2
- export interface FeUserRelationMeta {
3
- langCode?: string;
4
- listTotal: number;
5
- tableTotal: number;
6
- ruleTotal: number;
7
- knowing: UserWordKnowing;
8
- }
9
1
  export interface FeUserEntity {
10
2
  id: string;
11
3
  username: string;
12
4
  name: string;
13
- relation: FeUserRelationMeta;
14
- langRelations: FeUserRelationMeta[];
5
+ wordKnownTotal: number;
6
+ wordSavedTotal: number;
7
+ listTotal: number;
8
+ tableTotal: number;
9
+ ruleKnownTotal: number;
10
+ ruleSavedTotal: number;
11
+ examPassTotal: number;
12
+ examOwnTotal: number;
15
13
  }
@@ -0,0 +1,58 @@
1
+ import { EntryStatus, ExamCreationStep, ExamDurationTimeMode, LevelGen, NameGen, PassExamStatus, RuleGen } from "../../common";
2
+ export interface ExamModifier {
3
+ id: string;
4
+ name: string;
5
+ description?: string;
6
+ langCode: string;
7
+ levelCode: string;
8
+ itemTotal: number;
9
+ answerTotal: number;
10
+ duration?: number;
11
+ durationMode?: ExamDurationTimeMode;
12
+ isPrivate: boolean;
13
+ active: boolean;
14
+ status?: EntryStatus;
15
+ created: string;
16
+ creationStep: ExamCreationStep;
17
+ isExample?: boolean;
18
+ adminId?: string;
19
+ passTotal: number;
20
+ ruleTotal: number;
21
+ topicTotal: number;
22
+ exerciseTotal: number;
23
+ exerciseItemTotal: number;
24
+ showUserResult: boolean;
25
+ attemptLimit: number;
26
+ }
27
+ export interface ExamRuleRecord extends RuleGen {
28
+ levels: LevelGen[];
29
+ selected?: boolean;
30
+ }
31
+ export interface ExamRuleCategoryRecord {
32
+ rootRule?: ExamRuleRecord;
33
+ category?: NameGen;
34
+ rules: ExamRuleRecord[];
35
+ }
36
+ export interface ExamRuleModifier {
37
+ id: string;
38
+ rules: ExamRuleCategoryRecord[];
39
+ topicIds: string[];
40
+ }
41
+ export interface PassExamAttemptRecord {
42
+ passId: string;
43
+ grade: number;
44
+ status: PassExamStatus;
45
+ }
46
+ export interface PassExamRecord {
47
+ id: string;
48
+ status: PassExamStatus;
49
+ grade: number;
50
+ created: string;
51
+ examId: string;
52
+ name: string;
53
+ levelCode: string;
54
+ langCode: string;
55
+ userId: string;
56
+ username: string;
57
+ attempts: PassExamAttemptRecord[];
58
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./entity";
2
+ export * from "./request";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./entity"), exports);
18
+ __exportStar(require("./request"), exports);
@@ -0,0 +1,32 @@
1
+ import { ExamDurationTimeMode, IdRequest } from "../../common";
2
+ export interface CreateExamRequest {
3
+ name: string;
4
+ description?: string;
5
+ langCode: string;
6
+ levelCode: string;
7
+ itemTotal: number;
8
+ answerTotal: number;
9
+ duration?: number;
10
+ durationMode?: ExamDurationTimeMode;
11
+ isPrivate?: boolean;
12
+ showUserResult?: boolean;
13
+ attemptLimit?: number;
14
+ isExample?: boolean;
15
+ }
16
+ export interface UpdateExamRequest extends CreateExamRequest {
17
+ id: string;
18
+ }
19
+ export interface UpdateExamRuleRequest extends IdRequest {
20
+ ruleIds: string[];
21
+ topicIds: string[];
22
+ }
23
+ export interface UpdateExamTimeRequest extends IdRequest {
24
+ duration: number;
25
+ durationMode: ExamDurationTimeMode;
26
+ }
27
+ export interface ExamSetRulesRequest extends IdRequest {
28
+ ruleIds: string[];
29
+ }
30
+ export interface ExamSetTopicsRequest extends IdRequest {
31
+ topicIds: string[];
32
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,6 +2,7 @@ import { GenerateItemRequest } from "../..";
2
2
  import { EntryStatus, ExerciseKind } from "../../common";
3
3
  export interface CreateExerciseRequest {
4
4
  kind: ExerciseKind;
5
+ open?: boolean;
5
6
  levelCode?: string;
6
7
  }
7
8
  export interface ExerciseModifier extends CreateExerciseRequest {
@@ -14,3 +14,4 @@ export * from "./exercise";
14
14
  export * from "./item";
15
15
  export * from "./image";
16
16
  export * from "./topic";
17
+ export * from "./exam";
@@ -30,3 +30,4 @@ __exportStar(require("./exercise"), exports);
30
30
  __exportStar(require("./item"), exports);
31
31
  __exportStar(require("./image"), exports);
32
32
  __exportStar(require("./topic"), exports);
33
+ __exportStar(require("./exam"), exports);
@@ -38,12 +38,20 @@ export interface CreateItemSetRequest {
38
38
  correctAnswerIndex: number;
39
39
  tip?: string;
40
40
  ruleId?: string;
41
+ topicId?: string;
41
42
  }[];
42
43
  }
43
- export interface GenerateItemRequest {
44
+ export interface GenerateItemBaseRequest {
44
45
  exerciseId: string;
45
46
  levelCode?: string;
46
- itemCount: number;
47
- ruleIds: string[];
48
47
  answerTotal?: number;
49
48
  }
49
+ export interface GenerateItemRequest extends GenerateItemBaseRequest {
50
+ itemTotal: number;
51
+ ruleIds: string[];
52
+ }
53
+ export interface GenerateItemExamRequest extends GenerateItemBaseRequest {
54
+ ruleId: string;
55
+ otherRuleIds: string[];
56
+ topicIds: string[];
57
+ }
@@ -1,6 +1,9 @@
1
- import { TopicCategory } from "../../common";
1
+ import { TopicCategory, ValueOption } from "../../common";
2
2
  export interface TopicRecord {
3
3
  id: string;
4
4
  name: string;
5
5
  category: TopicCategory;
6
6
  }
7
+ export interface TopicOption extends ValueOption {
8
+ category: TopicCategory;
9
+ }
@@ -7,4 +7,8 @@ describe("ArrayUtil Test", function () {
7
7
  expect(utils_1.ArrayUtil.toArray(1)).toMatchObject([1]);
8
8
  expect(utils_1.ArrayUtil.toArray("text")).toMatchObject(["text"]);
9
9
  });
10
+ test("distinct", function () {
11
+ expect(utils_1.ArrayUtil.distinct([1, 1, 2, 2, 3, 1])).toMatchObject([1, 2, 3]);
12
+ expect(utils_1.ArrayUtil.distinct(["a", "b", "a", "c", "b"])).toMatchObject(["a", "b", "c"]);
13
+ });
10
14
  });
@@ -1,4 +1,5 @@
1
1
  export declare class ArrayUtil {
2
2
  static toArray<T>(item?: T | T[]): T[];
3
+ static distinct<T>(array: T[]): T[];
3
4
  static shuffle<T>(array: T[]): void;
4
5
  }
@@ -12,6 +12,9 @@ var ArrayUtil = /** @class */ (function () {
12
12
  return item !== undefined ? [item] : [];
13
13
  }
14
14
  };
15
+ ArrayUtil.distinct = function (array) {
16
+ return Array.from(new Set(array));
17
+ };
15
18
  ArrayUtil.shuffle = function (array) {
16
19
  var _a;
17
20
  var currentIndex = array.length;
@@ -0,0 +1,13 @@
1
+ import { ExamDurationTimeMode } from "../common";
2
+ export declare class ExamUtil {
3
+ static readonly hashIdSalt = "examHashId";
4
+ static readonly hashIdMinLength = 6;
5
+ static readonly maxAttempts = 5;
6
+ static get durationTotalValues(): number[];
7
+ static get durationPerExerciseValues(): number[];
8
+ static durationPerExercise(totalDuration: number, exerciseItemTotal: number): number;
9
+ static durationTotal(mode: ExamDurationTimeMode, totalDuration: number, perExerciseDuration: number, exerciseItemTotal: number): number;
10
+ static get itemTotalValues(): number[];
11
+ static get answerTotalValues(): number[];
12
+ static get attemptLimitValues(): number[];
13
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExamUtil = void 0;
4
+ var common_1 = require("../common");
5
+ var ExamUtil = /** @class */ (function () {
6
+ function ExamUtil() {
7
+ }
8
+ Object.defineProperty(ExamUtil, "durationTotalValues", {
9
+ get: function () {
10
+ return Array.from({ length: 24 }, function (_, i) {
11
+ var seconds = (i + 1) * 5 * 60;
12
+ return seconds;
13
+ });
14
+ },
15
+ enumerable: false,
16
+ configurable: true
17
+ });
18
+ Object.defineProperty(ExamUtil, "durationPerExerciseValues", {
19
+ get: function () {
20
+ return Array.from({ length: 17 }, function (_, i) {
21
+ var totalSeconds = 10 + i * 5;
22
+ return totalSeconds;
23
+ });
24
+ },
25
+ enumerable: false,
26
+ configurable: true
27
+ });
28
+ ExamUtil.durationPerExercise = function (totalDuration, exerciseItemTotal) {
29
+ return Math.ceil(totalDuration / (exerciseItemTotal || 1));
30
+ };
31
+ ExamUtil.durationTotal = function (mode, totalDuration, perExerciseDuration, exerciseItemTotal) {
32
+ if (mode === common_1.ExamDurationTimeMode.PerExercise) {
33
+ return perExerciseDuration * exerciseItemTotal;
34
+ }
35
+ else {
36
+ return totalDuration;
37
+ }
38
+ };
39
+ Object.defineProperty(ExamUtil, "itemTotalValues", {
40
+ get: function () {
41
+ return [1, 2, 3];
42
+ },
43
+ enumerable: false,
44
+ configurable: true
45
+ });
46
+ Object.defineProperty(ExamUtil, "answerTotalValues", {
47
+ get: function () {
48
+ return [2, 3, 4, 5, 6];
49
+ },
50
+ enumerable: false,
51
+ configurable: true
52
+ });
53
+ Object.defineProperty(ExamUtil, "attemptLimitValues", {
54
+ get: function () {
55
+ return [2, 3, 4, 5];
56
+ },
57
+ enumerable: false,
58
+ configurable: true
59
+ });
60
+ ExamUtil.hashIdSalt = "examHashId";
61
+ ExamUtil.hashIdMinLength = 6;
62
+ ExamUtil.maxAttempts = 5;
63
+ return ExamUtil;
64
+ }());
65
+ exports.ExamUtil = ExamUtil;
@@ -5,3 +5,4 @@ export * from "./regex";
5
5
  export * from "./array";
6
6
  export * from "./link";
7
7
  export * from "./fileName";
8
+ export * from "./exam";
@@ -21,3 +21,4 @@ __exportStar(require("./regex"), exports);
21
21
  __exportStar(require("./array"), exports);
22
22
  __exportStar(require("./link"), exports);
23
23
  __exportStar(require("./fileName"), exports);
24
+ __exportStar(require("./exam"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev",
3
- "version": "0.384.0",
3
+ "version": "0.385.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",