@neutron.co.id/pendidikan-operation 1.6.0-beta.1 → 1.6.1
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 +138 -0
- package/build/index.d.ts +46 -2
- package/build/index.mjs +136 -1
- package/package.json +29 -29
package/build/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const operation = require('@neon.id/operation');
|
|
|
5
5
|
const query = require('@neon.id/query');
|
|
6
6
|
const dayjs = require('dayjs');
|
|
7
7
|
const value = require('@neon.id/utils/value');
|
|
8
|
+
const nanoid = require('nanoid');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
10
11
|
|
|
@@ -1571,6 +1572,61 @@ const hasUnderstand = operation.Action.define({
|
|
|
1571
1572
|
}
|
|
1572
1573
|
});
|
|
1573
1574
|
|
|
1575
|
+
const getQuestionCount = operation.Action.define({
|
|
1576
|
+
key: "getQuestionCount",
|
|
1577
|
+
name: "Get QuestionCount",
|
|
1578
|
+
type: "command",
|
|
1579
|
+
category: "domain",
|
|
1580
|
+
execute: async (input, stream) => {
|
|
1581
|
+
const dbs = stream.core.dbs;
|
|
1582
|
+
const dbQuestion = dbs["neu-tanya"].models["neu:tanya:question"];
|
|
1583
|
+
const dbStudent = dbs["neu-akademik"].models["neu:akademik:student"];
|
|
1584
|
+
const findStudent = await dbStudent.findOne({
|
|
1585
|
+
userId: input.userId,
|
|
1586
|
+
deletedAt: null
|
|
1587
|
+
});
|
|
1588
|
+
const findQuestion = await dbQuestion.find({
|
|
1589
|
+
studentId: findStudent.id,
|
|
1590
|
+
deletedAt: null
|
|
1591
|
+
});
|
|
1592
|
+
return core.Result.ok({
|
|
1593
|
+
state: "QuestionCountGet",
|
|
1594
|
+
message: "QuestionCount has been get.",
|
|
1595
|
+
data: {
|
|
1596
|
+
questionCount: findQuestion.length
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
});
|
|
1601
|
+
|
|
1602
|
+
const getGradingCount = operation.Action.define({
|
|
1603
|
+
key: "getGradingCount",
|
|
1604
|
+
name: "Get GradingCount",
|
|
1605
|
+
type: "command",
|
|
1606
|
+
category: "domain",
|
|
1607
|
+
execute: async (input, stream) => {
|
|
1608
|
+
const dbs = stream.core.dbs;
|
|
1609
|
+
const dbGrading = dbs["neu-penilaian"].models["neu:penilaian:grading"];
|
|
1610
|
+
const dbStudent = dbs["neu-akademik"].models["neu:akademik:student"];
|
|
1611
|
+
const findStudent = await dbStudent.findOne({
|
|
1612
|
+
userId: input.userId,
|
|
1613
|
+
deletedAt: null
|
|
1614
|
+
});
|
|
1615
|
+
const findGrading = await dbGrading.find({
|
|
1616
|
+
studentId: findStudent.id,
|
|
1617
|
+
gradingTypeId: { $ne: "63ce5979e1166b8bb4bbc220" },
|
|
1618
|
+
deletedAt: null
|
|
1619
|
+
});
|
|
1620
|
+
return core.Result.ok({
|
|
1621
|
+
state: "GradingCountGet",
|
|
1622
|
+
message: "GradingCount has been get.",
|
|
1623
|
+
data: {
|
|
1624
|
+
gradingCount: findGrading.length
|
|
1625
|
+
}
|
|
1626
|
+
});
|
|
1627
|
+
}
|
|
1628
|
+
});
|
|
1629
|
+
|
|
1574
1630
|
const index = {
|
|
1575
1631
|
__proto__: null,
|
|
1576
1632
|
_calculateComparison: _calculateComparison,
|
|
@@ -1586,6 +1642,8 @@ const index = {
|
|
|
1586
1642
|
createManySession: createManySession,
|
|
1587
1643
|
editAnswer: editAnswer,
|
|
1588
1644
|
generateGrading: generateGrading,
|
|
1645
|
+
getGradingCount: getGradingCount,
|
|
1646
|
+
getQuestionCount: getQuestionCount,
|
|
1589
1647
|
getStaffId: getStaffId,
|
|
1590
1648
|
getStudentId: getStudentId,
|
|
1591
1649
|
hasUnderstand: hasUnderstand,
|
|
@@ -1603,6 +1661,83 @@ const index = {
|
|
|
1603
1661
|
userCountStats: userCountStats
|
|
1604
1662
|
};
|
|
1605
1663
|
|
|
1664
|
+
const alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
1665
|
+
const randomId = nanoid.customAlphabet(alphabet, 7);
|
|
1666
|
+
function getCode(prefix) {
|
|
1667
|
+
if (!prefix)
|
|
1668
|
+
return randomId(10);
|
|
1669
|
+
return `${prefix}${randomId()}`;
|
|
1670
|
+
}
|
|
1671
|
+
function registerOfficePendidikanHooks(hook) {
|
|
1672
|
+
hook.onExecute(
|
|
1673
|
+
"action:neu:penilaian:gradingInsert:createOne:after",
|
|
1674
|
+
async (payload, _meta, stream) => {
|
|
1675
|
+
console.log(
|
|
1676
|
+
"Grading insert created, creating grading and scores...",
|
|
1677
|
+
payload
|
|
1678
|
+
);
|
|
1679
|
+
return await createGradingAndScores.execute(
|
|
1680
|
+
{
|
|
1681
|
+
gradingTypeId: payload.input.data.gradingTypeId,
|
|
1682
|
+
studentId: payload.input.data.studentId,
|
|
1683
|
+
gradingInsertId: payload.output.id
|
|
1684
|
+
},
|
|
1685
|
+
stream
|
|
1686
|
+
);
|
|
1687
|
+
}
|
|
1688
|
+
);
|
|
1689
|
+
hook.onExecute(
|
|
1690
|
+
"action:neu:penilaian:gradingInsert:updateOne:after",
|
|
1691
|
+
async (payload, _meta, stream) => {
|
|
1692
|
+
console.log(
|
|
1693
|
+
"Grading insert updated, updating grading and scores...",
|
|
1694
|
+
payload
|
|
1695
|
+
);
|
|
1696
|
+
return await updateGradingAndScores.execute(
|
|
1697
|
+
{
|
|
1698
|
+
gradingInsertId: payload.output.id,
|
|
1699
|
+
gradingTypeId: payload.output.gradingTypeId,
|
|
1700
|
+
gradingId: payload.output.gradingId,
|
|
1701
|
+
studentId: payload.output.studentId,
|
|
1702
|
+
data: payload.output
|
|
1703
|
+
},
|
|
1704
|
+
stream
|
|
1705
|
+
);
|
|
1706
|
+
}
|
|
1707
|
+
);
|
|
1708
|
+
hook.onExecute(
|
|
1709
|
+
"action:neu:penilaian:gradingInsert:deleteOne:after",
|
|
1710
|
+
async (payload, meta, stream) => {
|
|
1711
|
+
console.log(
|
|
1712
|
+
"Grading insert deleted, deleting grading and scores...",
|
|
1713
|
+
payload,
|
|
1714
|
+
meta,
|
|
1715
|
+
stream
|
|
1716
|
+
);
|
|
1717
|
+
const result = await clearGrading.execute(
|
|
1718
|
+
{
|
|
1719
|
+
gradingInsertId: payload.output.id
|
|
1720
|
+
},
|
|
1721
|
+
stream
|
|
1722
|
+
);
|
|
1723
|
+
return result;
|
|
1724
|
+
}
|
|
1725
|
+
);
|
|
1726
|
+
hook.onExecute(
|
|
1727
|
+
"action:neu:tanya:question:createOne:before",
|
|
1728
|
+
async (payload) => {
|
|
1729
|
+
payload.input.data["code"] = getCode();
|
|
1730
|
+
payload.input.data["status"] = "draft";
|
|
1731
|
+
}
|
|
1732
|
+
);
|
|
1733
|
+
hook.onExecute(
|
|
1734
|
+
"action:neu:tanya:answer:createOne:before",
|
|
1735
|
+
async (payload) => {
|
|
1736
|
+
payload.input.data["code"] = getCode();
|
|
1737
|
+
}
|
|
1738
|
+
);
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1606
1741
|
exports._calculateComparison = _calculateComparison;
|
|
1607
1742
|
exports.acceptQuestion = acceptQuestion;
|
|
1608
1743
|
exports.actions = index;
|
|
@@ -1617,6 +1752,8 @@ exports.createGradingAndScores = createGradingAndScores;
|
|
|
1617
1752
|
exports.createManySession = createManySession;
|
|
1618
1753
|
exports.editAnswer = editAnswer;
|
|
1619
1754
|
exports.generateGrading = generateGrading;
|
|
1755
|
+
exports.getGradingCount = getGradingCount;
|
|
1756
|
+
exports.getQuestionCount = getQuestionCount;
|
|
1620
1757
|
exports.getStaffId = getStaffId;
|
|
1621
1758
|
exports.getStudentId = getStudentId;
|
|
1622
1759
|
exports.hasUnderstand = hasUnderstand;
|
|
@@ -1625,6 +1762,7 @@ exports.prepareConflict = prepareConflict;
|
|
|
1625
1762
|
exports.presenceSessionStudent = presenceSessionStudent;
|
|
1626
1763
|
exports.presenceSessionTeacher = presenceSessionTeacher;
|
|
1627
1764
|
exports.rasionalizeGrading = rasionalizeGrading;
|
|
1765
|
+
exports.registerOfficePendidikanHooks = registerOfficePendidikanHooks;
|
|
1628
1766
|
exports.sendAnswer = sendAnswer;
|
|
1629
1767
|
exports.sendQuestion = sendQuestion;
|
|
1630
1768
|
exports.setSomething = setSomething;
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Action } from '@neon.id/operation';
|
|
1
|
+
import { Action, Hook } from '@neon.id/operation';
|
|
2
2
|
|
|
3
3
|
interface SetSomethingInput {
|
|
4
4
|
}
|
|
@@ -344,6 +344,28 @@ interface HasUnderstandMeta {
|
|
|
344
344
|
declare const hasUnderstand: Action<"hasUnderstand", HasUnderstandInput, HasUnderstandOutput, HasUnderstandMeta>;
|
|
345
345
|
type HasUnderstandAction = typeof hasUnderstand;
|
|
346
346
|
|
|
347
|
+
interface GetQuestionCountInput {
|
|
348
|
+
userId: any;
|
|
349
|
+
}
|
|
350
|
+
interface GetQuestionCountOutput {
|
|
351
|
+
questionCount: any;
|
|
352
|
+
}
|
|
353
|
+
interface GetQuestionCountMeta {
|
|
354
|
+
}
|
|
355
|
+
declare const getQuestionCount: Action<"getQuestionCount", GetQuestionCountInput, GetQuestionCountOutput, GetQuestionCountMeta>;
|
|
356
|
+
type GetQuestionCountAction = typeof getQuestionCount;
|
|
357
|
+
|
|
358
|
+
interface GetGradingCountInput {
|
|
359
|
+
userId: any;
|
|
360
|
+
}
|
|
361
|
+
interface GetGradingCountOutput {
|
|
362
|
+
gradingCount: any;
|
|
363
|
+
}
|
|
364
|
+
interface GetGradingCountMeta {
|
|
365
|
+
}
|
|
366
|
+
declare const getGradingCount: Action<"getGradingCount", GetGradingCountInput, GetGradingCountOutput, GetGradingCountMeta>;
|
|
367
|
+
type GetGradingCountAction = typeof getGradingCount;
|
|
368
|
+
|
|
347
369
|
type index_AcceptQuestionAction = AcceptQuestionAction;
|
|
348
370
|
type index_AcceptQuestionInput = AcceptQuestionInput;
|
|
349
371
|
type index_AcceptQuestionMeta = AcceptQuestionMeta;
|
|
@@ -392,6 +414,14 @@ type index_GenerateGradingAction = GenerateGradingAction;
|
|
|
392
414
|
type index_GenerateGradingInput = GenerateGradingInput;
|
|
393
415
|
type index_GenerateGradingMeta = GenerateGradingMeta;
|
|
394
416
|
type index_GenerateGradingOutput = GenerateGradingOutput;
|
|
417
|
+
type index_GetGradingCountAction = GetGradingCountAction;
|
|
418
|
+
type index_GetGradingCountInput = GetGradingCountInput;
|
|
419
|
+
type index_GetGradingCountMeta = GetGradingCountMeta;
|
|
420
|
+
type index_GetGradingCountOutput = GetGradingCountOutput;
|
|
421
|
+
type index_GetQuestionCountAction = GetQuestionCountAction;
|
|
422
|
+
type index_GetQuestionCountInput = GetQuestionCountInput;
|
|
423
|
+
type index_GetQuestionCountMeta = GetQuestionCountMeta;
|
|
424
|
+
type index_GetQuestionCountOutput = GetQuestionCountOutput;
|
|
395
425
|
type index_GetStaffIdAction = GetStaffIdAction;
|
|
396
426
|
type index_GetStaffIdInput = GetStaffIdInput;
|
|
397
427
|
type index_GetStaffIdMeta = GetStaffIdMeta;
|
|
@@ -467,6 +497,8 @@ declare const index_createGradingAndScores: typeof createGradingAndScores;
|
|
|
467
497
|
declare const index_createManySession: typeof createManySession;
|
|
468
498
|
declare const index_editAnswer: typeof editAnswer;
|
|
469
499
|
declare const index_generateGrading: typeof generateGrading;
|
|
500
|
+
declare const index_getGradingCount: typeof getGradingCount;
|
|
501
|
+
declare const index_getQuestionCount: typeof getQuestionCount;
|
|
470
502
|
declare const index_getStaffId: typeof getStaffId;
|
|
471
503
|
declare const index_getStudentId: typeof getStudentId;
|
|
472
504
|
declare const index_hasUnderstand: typeof hasUnderstand;
|
|
@@ -532,6 +564,14 @@ declare namespace index {
|
|
|
532
564
|
index_GenerateGradingInput as GenerateGradingInput,
|
|
533
565
|
index_GenerateGradingMeta as GenerateGradingMeta,
|
|
534
566
|
index_GenerateGradingOutput as GenerateGradingOutput,
|
|
567
|
+
index_GetGradingCountAction as GetGradingCountAction,
|
|
568
|
+
index_GetGradingCountInput as GetGradingCountInput,
|
|
569
|
+
index_GetGradingCountMeta as GetGradingCountMeta,
|
|
570
|
+
index_GetGradingCountOutput as GetGradingCountOutput,
|
|
571
|
+
index_GetQuestionCountAction as GetQuestionCountAction,
|
|
572
|
+
index_GetQuestionCountInput as GetQuestionCountInput,
|
|
573
|
+
index_GetQuestionCountMeta as GetQuestionCountMeta,
|
|
574
|
+
index_GetQuestionCountOutput as GetQuestionCountOutput,
|
|
535
575
|
index_GetStaffIdAction as GetStaffIdAction,
|
|
536
576
|
index_GetStaffIdInput as GetStaffIdInput,
|
|
537
577
|
index_GetStaffIdMeta as GetStaffIdMeta,
|
|
@@ -607,6 +647,8 @@ declare namespace index {
|
|
|
607
647
|
index_createManySession as createManySession,
|
|
608
648
|
index_editAnswer as editAnswer,
|
|
609
649
|
index_generateGrading as generateGrading,
|
|
650
|
+
index_getGradingCount as getGradingCount,
|
|
651
|
+
index_getQuestionCount as getQuestionCount,
|
|
610
652
|
index_getStaffId as getStaffId,
|
|
611
653
|
index_getStudentId as getStudentId,
|
|
612
654
|
index_hasUnderstand as hasUnderstand,
|
|
@@ -625,4 +667,6 @@ declare namespace index {
|
|
|
625
667
|
};
|
|
626
668
|
}
|
|
627
669
|
|
|
628
|
-
|
|
670
|
+
declare function registerOfficePendidikanHooks(hook: Hook): void;
|
|
671
|
+
|
|
672
|
+
export { AcceptQuestionAction, AcceptQuestionInput, AcceptQuestionMeta, AcceptQuestionOutput, AddManyGradingComponentAction, AddManyGradingComponentInput, AddManyGradingComponentMeta, AddManyGradingComponentOutput, AllConflictAction, AllConflictInput, AllConflictMeta, AllConflictOutput, CalculateGradingAction, CalculateGradingInput, CalculateGradingMeta, CalculateGradingOutput, CalculateManyComparatorAction, CalculateManyComparatorInput, CalculateManyComparatorMeta, CalculateManyComparatorOutput, CalculateOneComparatorAction, CalculateOneComparatorInput, CalculateOneComparatorMeta, CalculateOneComparatorOutput, ClearAllOverridesAction, ClearAllOverridesInput, ClearAllOverridesMeta, ClearAllOverridesOutput, ClearGradingAction, ClearGradingInput, ClearGradingMeta, ClearGradingOutput, CreateGradingAndScoresAction, CreateGradingAndScoresInput, CreateGradingAndScoresMeta, CreateGradingAndScoresOutput, CreateManySessionAction, CreateManySessionInput, CreateManySessionMeta, CreateManySessionOutput, EditAnswerAction, EditAnswerInput, EditAnswerMeta, EditAnswerOutput, GenerateGradingAction, GenerateGradingInput, GenerateGradingMeta, GenerateGradingOutput, GetGradingCountAction, GetGradingCountInput, GetGradingCountMeta, GetGradingCountOutput, GetQuestionCountAction, GetQuestionCountInput, GetQuestionCountMeta, GetQuestionCountOutput, GetStaffIdAction, GetStaffIdInput, GetStaffIdMeta, GetStaffIdOutput, GetStudentIdAction, GetStudentIdInput, GetStudentIdMeta, GetStudentIdOutput, GradingComparator, GradingComparatorComparison, HasUnderstandAction, HasUnderstandInput, HasUnderstandMeta, HasUnderstandOutput, NotUnderstandAction, NotUnderstandInput, NotUnderstandMeta, NotUnderstandOutput, PrepareConflictAction, PrepareConflictInput, PrepareConflictMeta, PrepareConflictOutput, PresenceSessionStudentAction, PresenceSessionStudentInput, PresenceSessionStudentMeta, PresenceSessionStudentOutput, PresenceSessionTeacherAction, PresenceSessionTeacherInput, PresenceSessionTeacherMeta, PresenceSessionTeacherOutput, RasionalizeGradingAction, RasionalizeGradingInput, RasionalizeGradingMeta, RasionalizeGradingOutput, SendAnswerAction, SendAnswerInput, SendAnswerMeta, SendAnswerOutput, SendQuestionAction, SendQuestionInput, SendQuestionMeta, SendQuestionOutput, SetSomethingAction, SetSomethingInput, SetSomethingMeta, SetSomethingOutput, SyncCommitmentAction, SyncCommitmentInput, SyncCommitmentMeta, SyncCommitmentOutput, SyncStudentBranchAction, SyncStudentBranchInput, SyncStudentBranchMeta, SyncStudentBranchOutput, UpdateGradingAndScoresAction, UpdateGradingAndScoresInput, UpdateGradingAndScoresMeta, UpdateGradingAndScoresOutput, UserCountStatsAction, UserCountStatsInput, UserCountStatsMeta, UserCountStatsOutput, _calculateComparison, acceptQuestion, index as actions, addManyGradingComponent, allConflict, calculateGrading, calculateManyComparator, calculateOneComparator, clearAllOverrides, clearGrading, createGradingAndScores, createManySession, editAnswer, generateGrading, getGradingCount, getQuestionCount, getStaffId, getStudentId, hasUnderstand, notUnderstand, prepareConflict, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, registerOfficePendidikanHooks, sendAnswer, sendQuestion, setSomething, syncCommitment, syncStudentBranch, updateGradingAndScores, userCountStats };
|
package/build/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { Action } from '@neon.id/operation';
|
|
|
3
3
|
import { Query } from '@neon.id/query';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import { ValueUtil } from '@neon.id/utils/value';
|
|
6
|
+
import { customAlphabet } from 'nanoid';
|
|
6
7
|
|
|
7
8
|
const setSomething = Action.define({
|
|
8
9
|
key: "setSomething",
|
|
@@ -1565,6 +1566,61 @@ const hasUnderstand = Action.define({
|
|
|
1565
1566
|
}
|
|
1566
1567
|
});
|
|
1567
1568
|
|
|
1569
|
+
const getQuestionCount = Action.define({
|
|
1570
|
+
key: "getQuestionCount",
|
|
1571
|
+
name: "Get QuestionCount",
|
|
1572
|
+
type: "command",
|
|
1573
|
+
category: "domain",
|
|
1574
|
+
execute: async (input, stream) => {
|
|
1575
|
+
const dbs = stream.core.dbs;
|
|
1576
|
+
const dbQuestion = dbs["neu-tanya"].models["neu:tanya:question"];
|
|
1577
|
+
const dbStudent = dbs["neu-akademik"].models["neu:akademik:student"];
|
|
1578
|
+
const findStudent = await dbStudent.findOne({
|
|
1579
|
+
userId: input.userId,
|
|
1580
|
+
deletedAt: null
|
|
1581
|
+
});
|
|
1582
|
+
const findQuestion = await dbQuestion.find({
|
|
1583
|
+
studentId: findStudent.id,
|
|
1584
|
+
deletedAt: null
|
|
1585
|
+
});
|
|
1586
|
+
return Result.ok({
|
|
1587
|
+
state: "QuestionCountGet",
|
|
1588
|
+
message: "QuestionCount has been get.",
|
|
1589
|
+
data: {
|
|
1590
|
+
questionCount: findQuestion.length
|
|
1591
|
+
}
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
});
|
|
1595
|
+
|
|
1596
|
+
const getGradingCount = Action.define({
|
|
1597
|
+
key: "getGradingCount",
|
|
1598
|
+
name: "Get GradingCount",
|
|
1599
|
+
type: "command",
|
|
1600
|
+
category: "domain",
|
|
1601
|
+
execute: async (input, stream) => {
|
|
1602
|
+
const dbs = stream.core.dbs;
|
|
1603
|
+
const dbGrading = dbs["neu-penilaian"].models["neu:penilaian:grading"];
|
|
1604
|
+
const dbStudent = dbs["neu-akademik"].models["neu:akademik:student"];
|
|
1605
|
+
const findStudent = await dbStudent.findOne({
|
|
1606
|
+
userId: input.userId,
|
|
1607
|
+
deletedAt: null
|
|
1608
|
+
});
|
|
1609
|
+
const findGrading = await dbGrading.find({
|
|
1610
|
+
studentId: findStudent.id,
|
|
1611
|
+
gradingTypeId: { $ne: "63ce5979e1166b8bb4bbc220" },
|
|
1612
|
+
deletedAt: null
|
|
1613
|
+
});
|
|
1614
|
+
return Result.ok({
|
|
1615
|
+
state: "GradingCountGet",
|
|
1616
|
+
message: "GradingCount has been get.",
|
|
1617
|
+
data: {
|
|
1618
|
+
gradingCount: findGrading.length
|
|
1619
|
+
}
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
});
|
|
1623
|
+
|
|
1568
1624
|
const index = {
|
|
1569
1625
|
__proto__: null,
|
|
1570
1626
|
_calculateComparison: _calculateComparison,
|
|
@@ -1580,6 +1636,8 @@ const index = {
|
|
|
1580
1636
|
createManySession: createManySession,
|
|
1581
1637
|
editAnswer: editAnswer,
|
|
1582
1638
|
generateGrading: generateGrading,
|
|
1639
|
+
getGradingCount: getGradingCount,
|
|
1640
|
+
getQuestionCount: getQuestionCount,
|
|
1583
1641
|
getStaffId: getStaffId,
|
|
1584
1642
|
getStudentId: getStudentId,
|
|
1585
1643
|
hasUnderstand: hasUnderstand,
|
|
@@ -1597,4 +1655,81 @@ const index = {
|
|
|
1597
1655
|
userCountStats: userCountStats
|
|
1598
1656
|
};
|
|
1599
1657
|
|
|
1600
|
-
|
|
1658
|
+
const alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
1659
|
+
const randomId = customAlphabet(alphabet, 7);
|
|
1660
|
+
function getCode(prefix) {
|
|
1661
|
+
if (!prefix)
|
|
1662
|
+
return randomId(10);
|
|
1663
|
+
return `${prefix}${randomId()}`;
|
|
1664
|
+
}
|
|
1665
|
+
function registerOfficePendidikanHooks(hook) {
|
|
1666
|
+
hook.onExecute(
|
|
1667
|
+
"action:neu:penilaian:gradingInsert:createOne:after",
|
|
1668
|
+
async (payload, _meta, stream) => {
|
|
1669
|
+
console.log(
|
|
1670
|
+
"Grading insert created, creating grading and scores...",
|
|
1671
|
+
payload
|
|
1672
|
+
);
|
|
1673
|
+
return await createGradingAndScores.execute(
|
|
1674
|
+
{
|
|
1675
|
+
gradingTypeId: payload.input.data.gradingTypeId,
|
|
1676
|
+
studentId: payload.input.data.studentId,
|
|
1677
|
+
gradingInsertId: payload.output.id
|
|
1678
|
+
},
|
|
1679
|
+
stream
|
|
1680
|
+
);
|
|
1681
|
+
}
|
|
1682
|
+
);
|
|
1683
|
+
hook.onExecute(
|
|
1684
|
+
"action:neu:penilaian:gradingInsert:updateOne:after",
|
|
1685
|
+
async (payload, _meta, stream) => {
|
|
1686
|
+
console.log(
|
|
1687
|
+
"Grading insert updated, updating grading and scores...",
|
|
1688
|
+
payload
|
|
1689
|
+
);
|
|
1690
|
+
return await updateGradingAndScores.execute(
|
|
1691
|
+
{
|
|
1692
|
+
gradingInsertId: payload.output.id,
|
|
1693
|
+
gradingTypeId: payload.output.gradingTypeId,
|
|
1694
|
+
gradingId: payload.output.gradingId,
|
|
1695
|
+
studentId: payload.output.studentId,
|
|
1696
|
+
data: payload.output
|
|
1697
|
+
},
|
|
1698
|
+
stream
|
|
1699
|
+
);
|
|
1700
|
+
}
|
|
1701
|
+
);
|
|
1702
|
+
hook.onExecute(
|
|
1703
|
+
"action:neu:penilaian:gradingInsert:deleteOne:after",
|
|
1704
|
+
async (payload, meta, stream) => {
|
|
1705
|
+
console.log(
|
|
1706
|
+
"Grading insert deleted, deleting grading and scores...",
|
|
1707
|
+
payload,
|
|
1708
|
+
meta,
|
|
1709
|
+
stream
|
|
1710
|
+
);
|
|
1711
|
+
const result = await clearGrading.execute(
|
|
1712
|
+
{
|
|
1713
|
+
gradingInsertId: payload.output.id
|
|
1714
|
+
},
|
|
1715
|
+
stream
|
|
1716
|
+
);
|
|
1717
|
+
return result;
|
|
1718
|
+
}
|
|
1719
|
+
);
|
|
1720
|
+
hook.onExecute(
|
|
1721
|
+
"action:neu:tanya:question:createOne:before",
|
|
1722
|
+
async (payload) => {
|
|
1723
|
+
payload.input.data["code"] = getCode();
|
|
1724
|
+
payload.input.data["status"] = "draft";
|
|
1725
|
+
}
|
|
1726
|
+
);
|
|
1727
|
+
hook.onExecute(
|
|
1728
|
+
"action:neu:tanya:answer:createOne:before",
|
|
1729
|
+
async (payload) => {
|
|
1730
|
+
payload.input.data["code"] = getCode();
|
|
1731
|
+
}
|
|
1732
|
+
);
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
export { _calculateComparison, acceptQuestion, index as actions, addManyGradingComponent, allConflict, calculateGrading, calculateManyComparator, calculateOneComparator, clearAllOverrides, clearGrading, createGradingAndScores, createManySession, editAnswer, generateGrading, getGradingCount, getQuestionCount, getStaffId, getStudentId, hasUnderstand, notUnderstand, prepareConflict, presenceSessionStudent, presenceSessionTeacher, rasionalizeGrading, registerOfficePendidikanHooks, sendAnswer, sendQuestion, setSomething, syncCommitment, syncStudentBranch, updateGradingAndScores, userCountStats };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neutron.co.id/pendidikan-operation",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Operation package of Neutron Pendidikan.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"contributors": [
|
|
@@ -29,55 +29,55 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@bluelibs/nova": "1.4.2",
|
|
32
|
-
"@neon.id/core": "1.
|
|
32
|
+
"@neon.id/core": "1.30.0",
|
|
33
33
|
"@neon.id/gerbang-js": "1.3.0",
|
|
34
|
-
"@neon.id/model": "0.
|
|
35
|
-
"@neon.id/operation": "0.
|
|
36
|
-
"@neon.id/permit": "0.
|
|
37
|
-
"@neon.id/query": "0.
|
|
38
|
-
"@neon.id/types": "1.
|
|
39
|
-
"@neon.id/utils": "0.
|
|
40
|
-
"@neutron.co.id/akademik-models": "1.4.
|
|
41
|
-
"@neutron.co.id/jadwal-models": "1.4.
|
|
42
|
-
"@neutron.co.id/penilaian-models": "1.6.
|
|
34
|
+
"@neon.id/model": "0.64.0",
|
|
35
|
+
"@neon.id/operation": "0.44.0",
|
|
36
|
+
"@neon.id/permit": "0.19.0",
|
|
37
|
+
"@neon.id/query": "0.47.0",
|
|
38
|
+
"@neon.id/types": "1.43.0",
|
|
39
|
+
"@neon.id/utils": "0.41.0",
|
|
40
|
+
"@neutron.co.id/akademik-models": "1.4.1",
|
|
41
|
+
"@neutron.co.id/jadwal-models": "1.4.1",
|
|
42
|
+
"@neutron.co.id/penilaian-models": "1.6.1",
|
|
43
43
|
"@neutron.co.id/personalia-models": "1.4.4",
|
|
44
|
-
"@neutron.co.id/tanya-models": "1.3.
|
|
44
|
+
"@neutron.co.id/tanya-models": "1.3.1",
|
|
45
45
|
"dayjs": "1.11.7",
|
|
46
|
-
"mongoose": "6.10.
|
|
46
|
+
"mongoose": "6.10.5",
|
|
47
47
|
"nanoid": "4.0.2",
|
|
48
48
|
"ofetch": "1.0.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@types/node": "18.
|
|
51
|
+
"@types/node": "18.16.2",
|
|
52
52
|
"@vitest/coverage-c8": "0.30.1",
|
|
53
53
|
"@vitest/ui": "0.30.1",
|
|
54
54
|
"@vortex.so/eslint-plugin": "0.7.0",
|
|
55
55
|
"tsx": "3.12.6",
|
|
56
56
|
"typescript": "5.0.4",
|
|
57
57
|
"unbuild": "1.2.1",
|
|
58
|
-
"vite": "4.
|
|
58
|
+
"vite": "4.3.3",
|
|
59
59
|
"vitest": "0.30.1"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@bluelibs/nova": "1.4.2",
|
|
63
|
-
"@neon.id/core": "^1.
|
|
64
|
-
"@neon.id/gerbang-js": "^1.
|
|
65
|
-
"@neon.id/model": "^0.
|
|
66
|
-
"@neon.id/operation": "^0.
|
|
67
|
-
"@neon.id/permit": "^0.
|
|
68
|
-
"@neon.id/query": "^0.
|
|
69
|
-
"@neon.id/types": "^1.
|
|
70
|
-
"@neon.id/utils": "^0.
|
|
71
|
-
"@neutron.co.id/akademik-models": "^1.4.
|
|
72
|
-
"@neutron.co.id/jadwal-models": "^1.4.
|
|
73
|
-
"@neutron.co.id/penilaian-models": "^1.6.
|
|
74
|
-
"@neutron.co.id/tanya-models": "^1.3.
|
|
63
|
+
"@neon.id/core": "^1.30.0",
|
|
64
|
+
"@neon.id/gerbang-js": "^1.3.0",
|
|
65
|
+
"@neon.id/model": "^0.64.0",
|
|
66
|
+
"@neon.id/operation": "^0.44.0",
|
|
67
|
+
"@neon.id/permit": "^0.19.0",
|
|
68
|
+
"@neon.id/query": "^0.47.0",
|
|
69
|
+
"@neon.id/types": "^1.43.0",
|
|
70
|
+
"@neon.id/utils": "^0.41.0",
|
|
71
|
+
"@neutron.co.id/akademik-models": "^1.4.1",
|
|
72
|
+
"@neutron.co.id/jadwal-models": "^1.4.1",
|
|
73
|
+
"@neutron.co.id/penilaian-models": "^1.6.1",
|
|
74
|
+
"@neutron.co.id/tanya-models": "^1.3.1",
|
|
75
75
|
"dayjs": "1.11.7",
|
|
76
|
-
"mongoose": "^6.10.
|
|
76
|
+
"mongoose": "^6.10.5",
|
|
77
77
|
"ofetch": "^1.0.1"
|
|
78
78
|
},
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"build":
|
|
82
|
+
"build": 41
|
|
83
83
|
}
|