revdev 0.369.0 → 0.372.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.
@@ -1,4 +1,4 @@
1
- import { DualContribGen, ItemType } from "../../common";
1
+ import { DualContribGen, ItemType, NameGen } from "../../common";
2
2
  export interface BoItemTipRecord {
3
3
  id: string;
4
4
  text: string;
@@ -25,4 +25,5 @@ export interface BoItemRecord {
25
25
  position: number;
26
26
  valid: boolean;
27
27
  errorText?: string;
28
+ rule?: NameGen;
28
29
  }
@@ -1,26 +1,14 @@
1
+ import { ExerciseKind } from "../../common";
1
2
  import { FeedRequest } from "../../feed";
2
3
  export interface BoItemFeedRequest extends FeedRequest {
3
4
  exerciseId?: string;
4
5
  }
5
- export interface BoGenerateItemChoiceRequest {
6
- count: number;
7
- exerciseId: string;
8
- altRuleIds: string[];
9
- answerTotal?: number;
10
- }
11
- export interface BoCreateItemChoiceSetRequest {
12
- exerciseId: string;
13
- items: {
14
- content: string;
15
- answers: string[];
16
- correctAnswerIndex: number;
17
- ruleId?: string;
18
- }[];
19
- }
20
6
  export interface BoUpdateItemRegularRequest {
21
7
  id: string;
22
8
  content: string;
9
+ tip: string;
23
10
  }
24
11
  export interface BoItemRegularModifier extends BoUpdateItemRegularRequest {
25
12
  answerTotal: number;
13
+ exerciseKind: ExerciseKind;
26
14
  }
@@ -1,4 +1,4 @@
1
- import { EntryStatus, LevelGen, NameGen, SelectOption } from "../../common";
1
+ import { EntryStatus, ExerciseKind, LevelGen, NameGen, SelectOption } from "../../common";
2
2
  export interface BoRuleRecord {
3
3
  id: string;
4
4
  langCode: string;
@@ -20,4 +20,5 @@ export interface BoRuleExerciseGenerator {
20
20
  category?: NameGen;
21
21
  ignoreRuleIds: string[];
22
22
  altRuleOptions: SelectOption[];
23
+ allowedKinds: ExerciseKind[];
23
24
  }
@@ -3,6 +3,7 @@ export interface BoRuleCategoryRecord {
3
3
  id: string;
4
4
  langCode: string;
5
5
  name: string;
6
+ hasAnswerTransformation?: boolean;
6
7
  rootRule?: NameGen;
7
8
  ruleTotal: number;
8
9
  }
@@ -3,6 +3,7 @@ export interface BoCreateRuleCategoryRequest {
3
3
  langCode: string;
4
4
  name: string;
5
5
  rootRuleId?: string;
6
+ hasAnswerTransformation?: boolean;
6
7
  }
7
8
  export interface BoUpdateRuleCategoryRequest extends BoCreateRuleCategoryRequest {
8
9
  id: string;
@@ -123,6 +123,7 @@ export declare enum AiPromptName {
123
123
  WordTranscription = "wordTranscription",
124
124
  ExerciseItemChoice = "exerciseItemChoice",
125
125
  RuleItemChoice = "ruleItemChoice",
126
+ RuleItemMatch = "ruleItemMatch",
126
127
  WordLevel = "wordLevel",
127
128
  RuleLevel = "ruleLevel"
128
129
  }
@@ -155,6 +155,7 @@ var AiPromptName;
155
155
  AiPromptName["WordTranscription"] = "wordTranscription";
156
156
  AiPromptName["ExerciseItemChoice"] = "exerciseItemChoice";
157
157
  AiPromptName["RuleItemChoice"] = "ruleItemChoice";
158
+ AiPromptName["RuleItemMatch"] = "ruleItemMatch";
158
159
  AiPromptName["WordLevel"] = "wordLevel";
159
160
  AiPromptName["RuleLevel"] = "ruleLevel";
160
161
  })(AiPromptName || (exports.AiPromptName = AiPromptName = {}));
@@ -175,6 +176,7 @@ var TopicCategory;
175
176
  var ExerciseKind;
176
177
  (function (ExerciseKind) {
177
178
  ExerciseKind["Choice"] = "choice";
179
+ // Answer transformation
178
180
  ExerciseKind["Match"] = "match";
179
181
  ExerciseKind["Correct"] = "correct";
180
182
  })(ExerciseKind || (exports.ExerciseKind = ExerciseKind = {}));
@@ -30,6 +30,10 @@ export interface NameGen {
30
30
  id: string;
31
31
  name: string;
32
32
  }
33
+ export interface RuleGen extends NameGen {
34
+ slug: string;
35
+ langCode: string;
36
+ }
33
37
  export interface UserInfoGen {
34
38
  id: string;
35
39
  username: string;
@@ -18,6 +18,10 @@ export interface IdCodeOption {
18
18
  id: string;
19
19
  code: string;
20
20
  }
21
+ export interface IdOption {
22
+ id: string;
23
+ value: string;
24
+ }
21
25
  export interface SelectOption<TValue = string> extends ValueOption<TValue> {
22
26
  disabled?: boolean;
23
27
  }
@@ -1,5 +1,5 @@
1
1
  import { FeEntityPointer, FePassItemResult, WordUserGen } from "../..";
2
- import { ExerciseKind, ExerciseMode, ExerciseType, PassExerciseStatus, PassStatus } from "../../common";
2
+ import { ExerciseKind, ExerciseMode, ExerciseType, PassExerciseStatus, PassStatus, RuleGen } from "../../common";
3
3
  export interface FeExerciseNavigator {
4
4
  id: string;
5
5
  name: string;
@@ -79,23 +79,51 @@ export interface FeItemCursor {
79
79
  content: string;
80
80
  answers: string[];
81
81
  }
82
+ export interface FeMatchItemCursor {
83
+ id: string;
84
+ content: string;
85
+ }
82
86
  export interface FePassItemInfo {
83
87
  itemId: string;
84
88
  content: string;
85
89
  answer: string;
86
90
  isCorrect: boolean;
87
91
  correctAnswer?: string;
92
+ rule?: RuleGen;
88
93
  }
89
- export interface FeExerciseCursor {
90
- id: string;
91
- kind: ExerciseKind;
94
+ export interface FeExerciseBaseCursor {
95
+ exerciseId: string;
92
96
  ruleId: string;
93
- passId?: string;
94
- passStatus?: PassStatus;
95
- grade?: number;
96
- item?: FeItemCursor;
97
+ kind: ExerciseKind;
98
+ passStatus: PassStatus;
99
+ }
100
+ export interface FeExerciseChoiceCursor extends FeExerciseBaseCursor {
101
+ kind: ExerciseKind.Choice;
102
+ passStatus: PassStatus.Progress;
103
+ item: FeItemCursor;
104
+ itemTotal: number;
105
+ passedItemTotal: number;
106
+ }
107
+ export interface FeExerciseMatchCursor extends FeExerciseBaseCursor {
108
+ kind: ExerciseKind.Match;
109
+ passStatus: PassStatus.Progress;
110
+ matchItems: FeMatchItemCursor[];
111
+ matchAnswers: {
112
+ answers: string[];
113
+ tips: string[];
114
+ }[];
115
+ }
116
+ export interface FeExerciseResultCursor extends FeExerciseBaseCursor {
117
+ passId: string;
118
+ passStatus: PassStatus.Completed;
119
+ grade: number;
120
+ passedItems: FePassItemInfo[];
121
+ nextExerciseId: string;
122
+ }
123
+ export type FeExerciseCursor = FeExerciseChoiceCursor | FeExerciseMatchCursor | FeExerciseResultCursor;
124
+ export interface FeExerciseInfoForCursor extends FeExerciseBaseCursor {
125
+ passId: string;
126
+ grade: number;
97
127
  itemTotal: number;
98
128
  passedItemTotal: number;
99
- passedItems?: FePassItemInfo[];
100
- nextExerciseId?: string;
101
129
  }
@@ -7,3 +7,11 @@ export interface FeAnswerRequest {
7
7
  itemId: string;
8
8
  answer: string;
9
9
  }
10
+ export interface FeMatchAnswerPair {
11
+ itemId: string;
12
+ answer: string;
13
+ }
14
+ export interface FeMatchAnswerRequest {
15
+ exerciseId: string;
16
+ pairs: FeMatchAnswerPair[];
17
+ }
@@ -2,6 +2,7 @@ import { EntryStatus, ExerciseKind } from "../../common";
2
2
  export interface CreateExerciseRequest {
3
3
  ruleId: string;
4
4
  kind: ExerciseKind;
5
+ episodeId?: string;
5
6
  }
6
7
  export interface UpdateExerciseRequest extends Pick<CreateExerciseRequest, "kind"> {
7
8
  id: string;
@@ -30,3 +30,19 @@ export interface ItemImageModifier extends BaseItemModifier {
30
30
  imagePrompt?: string;
31
31
  }
32
32
  export type ItemModifier = ItemRegularModifier | ItemImageModifier;
33
+ export interface CreateItemSetRequest {
34
+ exerciseId: string;
35
+ items: {
36
+ content: string;
37
+ answers: string[];
38
+ correctAnswerIndex: number;
39
+ tip?: string;
40
+ ruleId?: string;
41
+ }[];
42
+ }
43
+ export interface GenerateItemRequest {
44
+ count: number;
45
+ exerciseId: string;
46
+ altRuleIds: string[];
47
+ answerTotal?: number;
48
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev",
3
- "version": "0.369.0",
3
+ "version": "0.372.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",