@neutron.co.id/pendidikan-operation 1.3.0-beta.3 → 1.3.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.
- package/build/index.cjs +22 -17
- package/build/index.d.ts +40 -18
- package/build/index.mjs +22 -17
- package/package.json +4 -4
package/build/index.cjs
CHANGED
|
@@ -136,26 +136,15 @@ const syncCommitment = operation.Action.define({
|
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
-
const
|
|
140
|
-
key: "
|
|
139
|
+
const calculateManyComparator = operation.Action.define({
|
|
140
|
+
key: "calculateManyComparator",
|
|
141
141
|
name: "Create Penilaian dan Score",
|
|
142
142
|
type: "command",
|
|
143
143
|
category: "domain",
|
|
144
144
|
execute: async ({ gradingComparatorId }, stream) => {
|
|
145
145
|
console.log("id", gradingComparatorId);
|
|
146
|
-
console.time("\u23F1\uFE0F emptyComparison");
|
|
147
|
-
await stream.actions.data.updateMany.execute(
|
|
148
|
-
{
|
|
149
|
-
model: "neu:penilaian:gradingComparator",
|
|
150
|
-
// id: gradingComparatorId,
|
|
151
|
-
data: { comparison: {} },
|
|
152
|
-
query: query.Query.define({})
|
|
153
|
-
},
|
|
154
|
-
stream
|
|
155
|
-
);
|
|
156
|
-
console.timeEnd("\u23F1\uFE0F emptyComparison");
|
|
157
146
|
console.time("\u23F1\uFE0F syncGradingComparator");
|
|
158
|
-
await stream.actions.data.syncMany.execute(
|
|
147
|
+
const result = await stream.actions.data.syncMany.execute(
|
|
159
148
|
{
|
|
160
149
|
model: "neu:penilaian:gradingComparator",
|
|
161
150
|
useDry: false,
|
|
@@ -165,6 +154,7 @@ const calculateComparator = operation.Action.define({
|
|
|
165
154
|
},
|
|
166
155
|
stream
|
|
167
156
|
);
|
|
157
|
+
console.log(result);
|
|
168
158
|
console.timeEnd("\u23F1\uFE0F syncGradingComparator");
|
|
169
159
|
return core.Result.ok({
|
|
170
160
|
state: "ComparatorCalculated",
|
|
@@ -542,7 +532,7 @@ const updateGradingAndScores = operation.Action.define({
|
|
|
542
532
|
name: "Update Penilaian dan Score",
|
|
543
533
|
type: "command",
|
|
544
534
|
category: "domain",
|
|
545
|
-
execute: async ({ gradingTypeId, gradingId, studentId, data }, stream) => {
|
|
535
|
+
execute: async ({ gradingInsertId, gradingTypeId, gradingId, studentId, data }, stream) => {
|
|
546
536
|
console.time("\u23F1\uFE0F updateGrading");
|
|
547
537
|
await _updateGrading(stream, { gradingId, studentId });
|
|
548
538
|
console.timeEnd("\u23F1\uFE0F updateGrading");
|
|
@@ -552,6 +542,21 @@ const updateGradingAndScores = operation.Action.define({
|
|
|
552
542
|
console.time("\u23F1\uFE0F updateScores");
|
|
553
543
|
await _updateScores(stream, gradingId, gradingComponents, data);
|
|
554
544
|
console.timeEnd("\u23F1\uFE0F updateScores");
|
|
545
|
+
console.time(`\u23F1\uFE0F syncModel:gradingRasionalization`);
|
|
546
|
+
await stream.actions.data.syncMany.execute(
|
|
547
|
+
{
|
|
548
|
+
model: "neu:penilaian:gradingRasionalization",
|
|
549
|
+
useDry: false,
|
|
550
|
+
query: query.Query.define({
|
|
551
|
+
filter: {
|
|
552
|
+
gradingInsertId
|
|
553
|
+
},
|
|
554
|
+
limit: 1e5
|
|
555
|
+
})
|
|
556
|
+
},
|
|
557
|
+
stream
|
|
558
|
+
);
|
|
559
|
+
console.timeEnd(`\u23F1\uFE0F syncModel:gradingRasionalization`);
|
|
555
560
|
return core.Result.ok({
|
|
556
561
|
state: "allUpdated",
|
|
557
562
|
message: "All Penilaian have been updated.",
|
|
@@ -823,8 +828,8 @@ const sendAnswer = operation.Action.define({
|
|
|
823
828
|
const index = {
|
|
824
829
|
__proto__: null,
|
|
825
830
|
acceptQuestion: acceptQuestion,
|
|
826
|
-
calculateComparator: calculateComparator,
|
|
827
831
|
calculateGrading: calculateGrading,
|
|
832
|
+
calculateManyComparator: calculateManyComparator,
|
|
828
833
|
clearGrading: clearGrading,
|
|
829
834
|
createGradingAndScores: createGradingAndScores,
|
|
830
835
|
editAnswer: editAnswer,
|
|
@@ -840,8 +845,8 @@ const index = {
|
|
|
840
845
|
|
|
841
846
|
exports.acceptQuestion = acceptQuestion;
|
|
842
847
|
exports.actions = index;
|
|
843
|
-
exports.calculateComparator = calculateComparator;
|
|
844
848
|
exports.calculateGrading = calculateGrading;
|
|
849
|
+
exports.calculateManyComparator = calculateManyComparator;
|
|
845
850
|
exports.clearGrading = clearGrading;
|
|
846
851
|
exports.createGradingAndScores = createGradingAndScores;
|
|
847
852
|
exports.editAnswer = editAnswer;
|
package/build/index.d.ts
CHANGED
|
@@ -43,15 +43,32 @@ interface SyncCommitmentMeta {
|
|
|
43
43
|
declare const syncCommitment: Action<"syncCommitment", SyncCommitmentInput, SyncCommitmentOutput, SyncCommitmentMeta>;
|
|
44
44
|
type SyncCommitmentAction = typeof syncCommitment;
|
|
45
45
|
|
|
46
|
-
interface
|
|
46
|
+
interface CalculateManyComparatorInput {
|
|
47
47
|
gradingComparatorId: string;
|
|
48
48
|
}
|
|
49
|
-
interface
|
|
50
|
-
}
|
|
51
|
-
interface
|
|
52
|
-
}
|
|
53
|
-
declare const
|
|
54
|
-
|
|
49
|
+
interface CalculateManyComparatorOutput {
|
|
50
|
+
}
|
|
51
|
+
interface CalculateManyComparatorMeta {
|
|
52
|
+
}
|
|
53
|
+
declare const calculateManyComparator: Action<"calculateManyComparator", CalculateManyComparatorInput, CalculateManyComparatorOutput, CalculateManyComparatorMeta>;
|
|
54
|
+
interface GradingComparatorComparison {
|
|
55
|
+
[key: string]: {
|
|
56
|
+
total: number;
|
|
57
|
+
count: number;
|
|
58
|
+
average: number;
|
|
59
|
+
max: number;
|
|
60
|
+
min: number;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
interface GradingComparator {
|
|
64
|
+
gradingRasionalizations?: {
|
|
65
|
+
scores?: Record<string, number>;
|
|
66
|
+
}[];
|
|
67
|
+
comparison?: GradingComparatorComparison;
|
|
68
|
+
derivativeComparison?: GradingComparatorComparison;
|
|
69
|
+
overrideComparison?: GradingComparatorComparison;
|
|
70
|
+
}
|
|
71
|
+
type CalculateManyComparatorAction = typeof calculateManyComparator;
|
|
55
72
|
|
|
56
73
|
interface CalculateGradingInput {
|
|
57
74
|
gradingInsertId: string;
|
|
@@ -109,6 +126,7 @@ declare const rasionalizeGrading: Action<"rasionalizeGrading", RasionalizeGradin
|
|
|
109
126
|
type RasionalizeGradingAction = typeof rasionalizeGrading;
|
|
110
127
|
|
|
111
128
|
interface UpdateGradingAndScoresInput {
|
|
129
|
+
gradingInsertId: string;
|
|
112
130
|
gradingTypeId: string;
|
|
113
131
|
gradingId: string;
|
|
114
132
|
studentId: string;
|
|
@@ -158,14 +176,14 @@ type index_AcceptQuestionAction = AcceptQuestionAction;
|
|
|
158
176
|
type index_AcceptQuestionInput = AcceptQuestionInput;
|
|
159
177
|
type index_AcceptQuestionMeta = AcceptQuestionMeta;
|
|
160
178
|
type index_AcceptQuestionOutput = AcceptQuestionOutput;
|
|
161
|
-
type index_CalculateComparatorAction = CalculateComparatorAction;
|
|
162
|
-
type index_CalculateComparatorInput = CalculateComparatorInput;
|
|
163
|
-
type index_CalculateComparatorMeta = CalculateComparatorMeta;
|
|
164
|
-
type index_CalculateComparatorOutput = CalculateComparatorOutput;
|
|
165
179
|
type index_CalculateGradingAction = CalculateGradingAction;
|
|
166
180
|
type index_CalculateGradingInput = CalculateGradingInput;
|
|
167
181
|
type index_CalculateGradingMeta = CalculateGradingMeta;
|
|
168
182
|
type index_CalculateGradingOutput = CalculateGradingOutput;
|
|
183
|
+
type index_CalculateManyComparatorAction = CalculateManyComparatorAction;
|
|
184
|
+
type index_CalculateManyComparatorInput = CalculateManyComparatorInput;
|
|
185
|
+
type index_CalculateManyComparatorMeta = CalculateManyComparatorMeta;
|
|
186
|
+
type index_CalculateManyComparatorOutput = CalculateManyComparatorOutput;
|
|
169
187
|
type index_ClearGradingAction = ClearGradingAction;
|
|
170
188
|
type index_ClearGradingInput = ClearGradingInput;
|
|
171
189
|
type index_ClearGradingMeta = ClearGradingMeta;
|
|
@@ -182,6 +200,8 @@ type index_GenerateGradingAction = GenerateGradingAction;
|
|
|
182
200
|
type index_GenerateGradingInput = GenerateGradingInput;
|
|
183
201
|
type index_GenerateGradingMeta = GenerateGradingMeta;
|
|
184
202
|
type index_GenerateGradingOutput = GenerateGradingOutput;
|
|
203
|
+
type index_GradingComparator = GradingComparator;
|
|
204
|
+
type index_GradingComparatorComparison = GradingComparatorComparison;
|
|
185
205
|
type index_PresenceSessionStudentAction = PresenceSessionStudentAction;
|
|
186
206
|
type index_PresenceSessionStudentInput = PresenceSessionStudentInput;
|
|
187
207
|
type index_PresenceSessionStudentMeta = PresenceSessionStudentMeta;
|
|
@@ -211,8 +231,8 @@ type index_UpdateGradingAndScoresInput = UpdateGradingAndScoresInput;
|
|
|
211
231
|
type index_UpdateGradingAndScoresMeta = UpdateGradingAndScoresMeta;
|
|
212
232
|
type index_UpdateGradingAndScoresOutput = UpdateGradingAndScoresOutput;
|
|
213
233
|
declare const index_acceptQuestion: typeof acceptQuestion;
|
|
214
|
-
declare const index_calculateComparator: typeof calculateComparator;
|
|
215
234
|
declare const index_calculateGrading: typeof calculateGrading;
|
|
235
|
+
declare const index_calculateManyComparator: typeof calculateManyComparator;
|
|
216
236
|
declare const index_clearGrading: typeof clearGrading;
|
|
217
237
|
declare const index_createGradingAndScores: typeof createGradingAndScores;
|
|
218
238
|
declare const index_editAnswer: typeof editAnswer;
|
|
@@ -230,14 +250,14 @@ declare namespace index {
|
|
|
230
250
|
index_AcceptQuestionInput as AcceptQuestionInput,
|
|
231
251
|
index_AcceptQuestionMeta as AcceptQuestionMeta,
|
|
232
252
|
index_AcceptQuestionOutput as AcceptQuestionOutput,
|
|
233
|
-
index_CalculateComparatorAction as CalculateComparatorAction,
|
|
234
|
-
index_CalculateComparatorInput as CalculateComparatorInput,
|
|
235
|
-
index_CalculateComparatorMeta as CalculateComparatorMeta,
|
|
236
|
-
index_CalculateComparatorOutput as CalculateComparatorOutput,
|
|
237
253
|
index_CalculateGradingAction as CalculateGradingAction,
|
|
238
254
|
index_CalculateGradingInput as CalculateGradingInput,
|
|
239
255
|
index_CalculateGradingMeta as CalculateGradingMeta,
|
|
240
256
|
index_CalculateGradingOutput as CalculateGradingOutput,
|
|
257
|
+
index_CalculateManyComparatorAction as CalculateManyComparatorAction,
|
|
258
|
+
index_CalculateManyComparatorInput as CalculateManyComparatorInput,
|
|
259
|
+
index_CalculateManyComparatorMeta as CalculateManyComparatorMeta,
|
|
260
|
+
index_CalculateManyComparatorOutput as CalculateManyComparatorOutput,
|
|
241
261
|
index_ClearGradingAction as ClearGradingAction,
|
|
242
262
|
index_ClearGradingInput as ClearGradingInput,
|
|
243
263
|
index_ClearGradingMeta as ClearGradingMeta,
|
|
@@ -254,6 +274,8 @@ declare namespace index {
|
|
|
254
274
|
index_GenerateGradingInput as GenerateGradingInput,
|
|
255
275
|
index_GenerateGradingMeta as GenerateGradingMeta,
|
|
256
276
|
index_GenerateGradingOutput as GenerateGradingOutput,
|
|
277
|
+
index_GradingComparator as GradingComparator,
|
|
278
|
+
index_GradingComparatorComparison as GradingComparatorComparison,
|
|
257
279
|
index_PresenceSessionStudentAction as PresenceSessionStudentAction,
|
|
258
280
|
index_PresenceSessionStudentInput as PresenceSessionStudentInput,
|
|
259
281
|
index_PresenceSessionStudentMeta as PresenceSessionStudentMeta,
|
|
@@ -283,8 +305,8 @@ declare namespace index {
|
|
|
283
305
|
index_UpdateGradingAndScoresMeta as UpdateGradingAndScoresMeta,
|
|
284
306
|
index_UpdateGradingAndScoresOutput as UpdateGradingAndScoresOutput,
|
|
285
307
|
index_acceptQuestion as acceptQuestion,
|
|
286
|
-
index_calculateComparator as calculateComparator,
|
|
287
308
|
index_calculateGrading as calculateGrading,
|
|
309
|
+
index_calculateManyComparator as calculateManyComparator,
|
|
288
310
|
index_clearGrading as clearGrading,
|
|
289
311
|
index_createGradingAndScores as createGradingAndScores,
|
|
290
312
|
index_editAnswer as editAnswer,
|
|
@@ -299,4 +321,4 @@ declare namespace index {
|
|
|
299
321
|
};
|
|
300
322
|
}
|
|
301
323
|
|
|
302
|
-
export { AcceptQuestionAction, AcceptQuestionInput, AcceptQuestionMeta, AcceptQuestionOutput,
|
|
324
|
+
export { AcceptQuestionAction, AcceptQuestionInput, AcceptQuestionMeta, AcceptQuestionOutput, CalculateGradingAction, CalculateGradingInput, CalculateGradingMeta, CalculateGradingOutput, CalculateManyComparatorAction, CalculateManyComparatorInput, CalculateManyComparatorMeta, CalculateManyComparatorOutput, ClearGradingAction, ClearGradingInput, ClearGradingMeta, ClearGradingOutput, CreateGradingAndScoresAction, CreateGradingAndScoresInput, CreateGradingAndScoresMeta, CreateGradingAndScoresOutput, EditAnswerAction, EditAnswerInput, EditAnswerMeta, EditAnswerOutput, GenerateGradingAction, GenerateGradingInput, GenerateGradingMeta, GenerateGradingOutput, GradingComparator, GradingComparatorComparison, PresenceSessionStudentAction, PresenceSessionStudentInput, PresenceSessionStudentMeta, PresenceSessionStudentOutput, PresenceSessionTeacherAction, PresenceSessionTeacherInput, PresenceSessionTeacherMeta, PresenceSessionTeacherOutput, RasionalizeGradingAction, RasionalizeGradingInput, RasionalizeGradingMeta, RasionalizeGradingOutput, SendAnswerAction, SendAnswerInput, SendAnswerMeta, SendAnswerOutput, SetSomethingAction, SetSomethingInput, SetSomethingMeta, SetSomethingOutput, SyncCommitmentAction, SyncCommitmentInput, SyncCommitmentMeta, SyncCommitmentOutput, UpdateGradingAndScoresAction, UpdateGradingAndScoresInput, UpdateGradingAndScoresMeta, UpdateGradingAndScoresOutput, acceptQuestion, index as actions, calculateGrading, calculateManyComparator, clearGrading, createGradingAndScores, editAnswer, generateGrading, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, sendAnswer, setSomething, syncCommitment, updateGradingAndScores };
|
package/build/index.mjs
CHANGED
|
@@ -134,26 +134,15 @@ const syncCommitment = Action.define({
|
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
-
const
|
|
138
|
-
key: "
|
|
137
|
+
const calculateManyComparator = Action.define({
|
|
138
|
+
key: "calculateManyComparator",
|
|
139
139
|
name: "Create Penilaian dan Score",
|
|
140
140
|
type: "command",
|
|
141
141
|
category: "domain",
|
|
142
142
|
execute: async ({ gradingComparatorId }, stream) => {
|
|
143
143
|
console.log("id", gradingComparatorId);
|
|
144
|
-
console.time("\u23F1\uFE0F emptyComparison");
|
|
145
|
-
await stream.actions.data.updateMany.execute(
|
|
146
|
-
{
|
|
147
|
-
model: "neu:penilaian:gradingComparator",
|
|
148
|
-
// id: gradingComparatorId,
|
|
149
|
-
data: { comparison: {} },
|
|
150
|
-
query: Query.define({})
|
|
151
|
-
},
|
|
152
|
-
stream
|
|
153
|
-
);
|
|
154
|
-
console.timeEnd("\u23F1\uFE0F emptyComparison");
|
|
155
144
|
console.time("\u23F1\uFE0F syncGradingComparator");
|
|
156
|
-
await stream.actions.data.syncMany.execute(
|
|
145
|
+
const result = await stream.actions.data.syncMany.execute(
|
|
157
146
|
{
|
|
158
147
|
model: "neu:penilaian:gradingComparator",
|
|
159
148
|
useDry: false,
|
|
@@ -163,6 +152,7 @@ const calculateComparator = Action.define({
|
|
|
163
152
|
},
|
|
164
153
|
stream
|
|
165
154
|
);
|
|
155
|
+
console.log(result);
|
|
166
156
|
console.timeEnd("\u23F1\uFE0F syncGradingComparator");
|
|
167
157
|
return Result.ok({
|
|
168
158
|
state: "ComparatorCalculated",
|
|
@@ -540,7 +530,7 @@ const updateGradingAndScores = Action.define({
|
|
|
540
530
|
name: "Update Penilaian dan Score",
|
|
541
531
|
type: "command",
|
|
542
532
|
category: "domain",
|
|
543
|
-
execute: async ({ gradingTypeId, gradingId, studentId, data }, stream) => {
|
|
533
|
+
execute: async ({ gradingInsertId, gradingTypeId, gradingId, studentId, data }, stream) => {
|
|
544
534
|
console.time("\u23F1\uFE0F updateGrading");
|
|
545
535
|
await _updateGrading(stream, { gradingId, studentId });
|
|
546
536
|
console.timeEnd("\u23F1\uFE0F updateGrading");
|
|
@@ -550,6 +540,21 @@ const updateGradingAndScores = Action.define({
|
|
|
550
540
|
console.time("\u23F1\uFE0F updateScores");
|
|
551
541
|
await _updateScores(stream, gradingId, gradingComponents, data);
|
|
552
542
|
console.timeEnd("\u23F1\uFE0F updateScores");
|
|
543
|
+
console.time(`\u23F1\uFE0F syncModel:gradingRasionalization`);
|
|
544
|
+
await stream.actions.data.syncMany.execute(
|
|
545
|
+
{
|
|
546
|
+
model: "neu:penilaian:gradingRasionalization",
|
|
547
|
+
useDry: false,
|
|
548
|
+
query: Query.define({
|
|
549
|
+
filter: {
|
|
550
|
+
gradingInsertId
|
|
551
|
+
},
|
|
552
|
+
limit: 1e5
|
|
553
|
+
})
|
|
554
|
+
},
|
|
555
|
+
stream
|
|
556
|
+
);
|
|
557
|
+
console.timeEnd(`\u23F1\uFE0F syncModel:gradingRasionalization`);
|
|
553
558
|
return Result.ok({
|
|
554
559
|
state: "allUpdated",
|
|
555
560
|
message: "All Penilaian have been updated.",
|
|
@@ -821,8 +826,8 @@ const sendAnswer = Action.define({
|
|
|
821
826
|
const index = {
|
|
822
827
|
__proto__: null,
|
|
823
828
|
acceptQuestion: acceptQuestion,
|
|
824
|
-
calculateComparator: calculateComparator,
|
|
825
829
|
calculateGrading: calculateGrading,
|
|
830
|
+
calculateManyComparator: calculateManyComparator,
|
|
826
831
|
clearGrading: clearGrading,
|
|
827
832
|
createGradingAndScores: createGradingAndScores,
|
|
828
833
|
editAnswer: editAnswer,
|
|
@@ -836,4 +841,4 @@ const index = {
|
|
|
836
841
|
updateGradingAndScores: updateGradingAndScores
|
|
837
842
|
};
|
|
838
843
|
|
|
839
|
-
export { acceptQuestion, index as actions,
|
|
844
|
+
export { acceptQuestion, index as actions, calculateGrading, calculateManyComparator, clearGrading, createGradingAndScores, editAnswer, generateGrading, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, sendAnswer, setSomething, syncCommitment, updateGradingAndScores };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neutron.co.id/pendidikan-operation",
|
|
3
|
-
"version": "1.3.0
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Operation package of Neutron Pendidikan.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"contributors": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@neon.id/utils": "0.33.5",
|
|
40
40
|
"@neutron.co.id/akademik-models": "1.2.0",
|
|
41
41
|
"@neutron.co.id/jadwal-models": "1.2.0",
|
|
42
|
-
"@neutron.co.id/penilaian-models": "1.3.0
|
|
42
|
+
"@neutron.co.id/penilaian-models": "1.3.0",
|
|
43
43
|
"@neutron.co.id/tanya-models": "1.1.0",
|
|
44
44
|
"mongoose": "6.9.1",
|
|
45
45
|
"nanoid": "4.0.1",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@neon.id/utils": "^0.33.5",
|
|
69
69
|
"@neutron.co.id/akademik-models": "^1.2.0",
|
|
70
70
|
"@neutron.co.id/jadwal-models": "^1.2.0",
|
|
71
|
-
"@neutron.co.id/penilaian-models": "^1.3.0
|
|
71
|
+
"@neutron.co.id/penilaian-models": "^1.3.0",
|
|
72
72
|
"@neutron.co.id/tanya-models": "^1.1.0",
|
|
73
73
|
"mongoose": "^6.9.1",
|
|
74
74
|
"ofetch": "^1.0.0"
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
|
-
"build":
|
|
79
|
+
"build": 15
|
|
80
80
|
}
|