@things-factory/learning 0.0.0-stage → 10.1.261
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-client/bootstrap.d.ts +2 -0
- package/dist-client/bootstrap.js +4 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/components/learning-assign-form.d.ts +24 -0
- package/dist-client/components/learning-assign-form.js +77 -0
- package/dist-client/components/learning-assign-form.js.map +1 -0
- package/dist-client/components/learning-course-form.d.ts +29 -0
- package/dist-client/components/learning-course-form.js +104 -0
- package/dist-client/components/learning-course-form.js.map +1 -0
- package/dist-client/components/learning-material-form.d.ts +41 -0
- package/dist-client/components/learning-material-form.js +202 -0
- package/dist-client/components/learning-material-form.js.map +1 -0
- package/dist-client/components/learning-question-form.d.ts +33 -0
- package/dist-client/components/learning-question-form.js +142 -0
- package/dist-client/components/learning-question-form.js.map +1 -0
- package/dist-client/components/learning-todo.d.ts +12 -0
- package/dist-client/components/learning-todo.js +43 -0
- package/dist-client/components/learning-todo.js.map +1 -0
- package/dist-client/components/learning-unit-form.d.ts +44 -0
- package/dist-client/components/learning-unit-form.js +151 -0
- package/dist-client/components/learning-unit-form.js.map +1 -0
- package/dist-client/index.d.ts +2 -0
- package/dist-client/index.js +3 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/learning-course-editor.d.ts +63 -0
- package/dist-client/pages/learning-course-editor.js +476 -0
- package/dist-client/pages/learning-course-editor.js.map +1 -0
- package/dist-client/pages/learning-course-list.d.ts +37 -0
- package/dist-client/pages/learning-course-list.js +92 -0
- package/dist-client/pages/learning-course-list.js.map +1 -0
- package/dist-client/pages/learning-enrollment-status.d.ts +65 -0
- package/dist-client/pages/learning-enrollment-status.js +211 -0
- package/dist-client/pages/learning-enrollment-status.js.map +1 -0
- package/dist-client/pages/learning-view.d.ts +63 -0
- package/dist-client/pages/learning-view.js +446 -0
- package/dist-client/pages/learning-view.js.map +1 -0
- package/dist-client/pages/my-learning.d.ts +22 -0
- package/dist-client/pages/my-learning.js +110 -0
- package/dist-client/pages/my-learning.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +21 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/utils/learning-api.d.ts +61 -0
- package/dist-client/utils/learning-api.js +85 -0
- package/dist-client/utils/learning-api.js.map +1 -0
- package/dist-client/utils/learning-words.d.ts +20 -0
- package/dist-client/utils/learning-words.js +22 -0
- package/dist-client/utils/learning-words.js.map +1 -0
- package/dist-client/utils/material-source.d.ts +12 -0
- package/dist-client/utils/material-source.js +77 -0
- package/dist-client/utils/material-source.js.map +1 -0
- package/dist-server/activities.d.ts +38 -0
- package/dist-server/activities.js +42 -0
- package/dist-server/activities.js.map +1 -0
- package/dist-server/ai-reads.d.ts +9 -0
- package/dist-server/ai-reads.js +70 -0
- package/dist-server/ai-reads.js.map +1 -0
- package/dist-server/attachment-reader.d.ts +1 -0
- package/dist-server/attachment-reader.js +23 -0
- package/dist-server/attachment-reader.js.map +1 -0
- package/dist-server/index.d.ts +4 -0
- package/dist-server/index.js +33 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/learning-subjects.d.ts +10 -0
- package/dist-server/learning-subjects.js +31 -0
- package/dist-server/learning-subjects.js.map +1 -0
- package/dist-server/role-tasks.d.ts +2 -0
- package/dist-server/role-tasks.js +17 -0
- package/dist-server/role-tasks.js.map +1 -0
- package/dist-server/service/course/course-mutation.d.ts +19 -0
- package/dist-server/service/course/course-mutation.js +177 -0
- package/dist-server/service/course/course-mutation.js.map +1 -0
- package/dist-server/service/course/course-query.d.ts +27 -0
- package/dist-server/service/course/course-query.js +183 -0
- package/dist-server/service/course/course-query.js.map +1 -0
- package/dist-server/service/course/course-question.d.ts +41 -0
- package/dist-server/service/course/course-question.js +116 -0
- package/dist-server/service/course/course-question.js.map +1 -0
- package/dist-server/service/course/course-rules.d.ts +51 -0
- package/dist-server/service/course/course-rules.js +93 -0
- package/dist-server/service/course/course-rules.js.map +1 -0
- package/dist-server/service/course/course-service.d.ts +72 -0
- package/dist-server/service/course/course-service.js +398 -0
- package/dist-server/service/course/course-service.js.map +1 -0
- package/dist-server/service/course/course-type.d.ts +56 -0
- package/dist-server/service/course/course-type.js +202 -0
- package/dist-server/service/course/course-type.js.map +1 -0
- package/dist-server/service/course/course-unit.d.ts +37 -0
- package/dist-server/service/course/course-unit.js +128 -0
- package/dist-server/service/course/course-unit.js.map +1 -0
- package/dist-server/service/course/course-version.d.ts +45 -0
- package/dist-server/service/course/course-version.js +151 -0
- package/dist-server/service/course/course-version.js.map +1 -0
- package/dist-server/service/course/course.d.ts +23 -0
- package/dist-server/service/course/course.js +92 -0
- package/dist-server/service/course/course.js.map +1 -0
- package/dist-server/service/course/index.d.ts +15 -0
- package/dist-server/service/course/index.js +25 -0
- package/dist-server/service/course/index.js.map +1 -0
- package/dist-server/service/course/material-audio.d.ts +1 -0
- package/dist-server/service/course/material-audio.js +43 -0
- package/dist-server/service/course/material-audio.js.map +1 -0
- package/dist-server/service/course/material-draft-mutation.d.ts +13 -0
- package/dist-server/service/course/material-draft-mutation.js +55 -0
- package/dist-server/service/course/material-draft-mutation.js.map +1 -0
- package/dist-server/service/course/material-draft-rules.d.ts +38 -0
- package/dist-server/service/course/material-draft-rules.js +83 -0
- package/dist-server/service/course/material-draft-rules.js.map +1 -0
- package/dist-server/service/course/material-draft-service.d.ts +15 -0
- package/dist-server/service/course/material-draft-service.js +162 -0
- package/dist-server/service/course/material-draft-service.js.map +1 -0
- package/dist-server/service/enrollment/enrollment-mutation.d.ts +11 -0
- package/dist-server/service/enrollment/enrollment-mutation.js +124 -0
- package/dist-server/service/enrollment/enrollment-mutation.js.map +1 -0
- package/dist-server/service/enrollment/enrollment-query.d.ts +24 -0
- package/dist-server/service/enrollment/enrollment-query.js +236 -0
- package/dist-server/service/enrollment/enrollment-query.js.map +1 -0
- package/dist-server/service/enrollment/enrollment-remind.d.ts +1 -0
- package/dist-server/service/enrollment/enrollment-remind.js +45 -0
- package/dist-server/service/enrollment/enrollment-remind.js.map +1 -0
- package/dist-server/service/enrollment/enrollment-service.d.ts +110 -0
- package/dist-server/service/enrollment/enrollment-service.js +427 -0
- package/dist-server/service/enrollment/enrollment-service.js.map +1 -0
- package/dist-server/service/enrollment/enrollment-status.d.ts +53 -0
- package/dist-server/service/enrollment/enrollment-status.js +194 -0
- package/dist-server/service/enrollment/enrollment-status.js.map +1 -0
- package/dist-server/service/enrollment/enrollment-type.d.ts +82 -0
- package/dist-server/service/enrollment/enrollment-type.js +293 -0
- package/dist-server/service/enrollment/enrollment-type.js.map +1 -0
- package/dist-server/service/enrollment/enrollment.d.ts +53 -0
- package/dist-server/service/enrollment/enrollment.js +191 -0
- package/dist-server/service/enrollment/enrollment.js.map +1 -0
- package/dist-server/service/enrollment/index.d.ts +15 -0
- package/dist-server/service/enrollment/index.js +26 -0
- package/dist-server/service/enrollment/index.js.map +1 -0
- package/dist-server/service/enrollment/learning-ai.d.ts +45 -0
- package/dist-server/service/enrollment/learning-ai.js +93 -0
- package/dist-server/service/enrollment/learning-ai.js.map +1 -0
- package/dist-server/service/enrollment/learning-documents.d.ts +7 -0
- package/dist-server/service/enrollment/learning-documents.js +159 -0
- package/dist-server/service/enrollment/learning-documents.js.map +1 -0
- package/dist-server/service/enrollment/learning-outcome.d.ts +10 -0
- package/dist-server/service/enrollment/learning-outcome.js +16 -0
- package/dist-server/service/enrollment/learning-outcome.js.map +1 -0
- package/dist-server/service/enrollment/progress-rules.d.ts +119 -0
- package/dist-server/service/enrollment/progress-rules.js +132 -0
- package/dist-server/service/enrollment/progress-rules.js.map +1 -0
- package/dist-server/service/enrollment/quiz-attempt.d.ts +34 -0
- package/dist-server/service/enrollment/quiz-attempt.js +105 -0
- package/dist-server/service/enrollment/quiz-attempt.js.map +1 -0
- package/dist-server/service/enrollment/unit-progress.d.ts +34 -0
- package/dist-server/service/enrollment/unit-progress.js +134 -0
- package/dist-server/service/enrollment/unit-progress.js.map +1 -0
- package/dist-server/service/index.d.ts +14 -0
- package/dist-server/service/index.js +43 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +57 -4
- package/things-factory.config.js +14 -0
- package/translations/en.json +278 -0
- package/translations/es.json +278 -0
- package/translations/ja.json +278 -0
- package/translations/ko.json +278 -0
- package/translations/ms.json +278 -0
- package/translations/zh.json +278 -0
- package/README.md +0 -3
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuizAttempt = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
+
const shell_1 = require("@things-factory/shell");
|
|
9
|
+
const enrollment_1 = require("./enrollment");
|
|
10
|
+
/**
|
|
11
|
+
* 응시 (ADR-0194 decision 4) - one attempt at a version's quiz: the questions it drew and their choices in shuffled
|
|
12
|
+
* order, and once sent, the answers and the score the server gave. The drawn questions are kept so the answers are
|
|
13
|
+
* scored against what was shown.
|
|
14
|
+
*/
|
|
15
|
+
let QuizAttempt = class QuizAttempt {
|
|
16
|
+
};
|
|
17
|
+
exports.QuizAttempt = QuizAttempt;
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Attempt id.' }),
|
|
21
|
+
tslib_1.__metadata("design:type", String)
|
|
22
|
+
], QuizAttempt.prototype, "id", void 0);
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
25
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain.' }),
|
|
26
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
27
|
+
], QuizAttempt.prototype, "domain", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, typeorm_1.RelationId)((row) => row.domain),
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
31
|
+
], QuizAttempt.prototype, "domainId", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.ManyToOne)(type => enrollment_1.Enrollment),
|
|
34
|
+
(0, type_graphql_1.Field)(type => enrollment_1.Enrollment, { nullable: true, description: 'The enrolment.' }),
|
|
35
|
+
tslib_1.__metadata("design:type", enrollment_1.Enrollment)
|
|
36
|
+
], QuizAttempt.prototype, "enrollment", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.RelationId)((row) => row.enrollment),
|
|
39
|
+
tslib_1.__metadata("design:type", String)
|
|
40
|
+
], QuizAttempt.prototype, "enrollmentId", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'simple-json' }),
|
|
43
|
+
tslib_1.__metadata("design:type", Array)
|
|
44
|
+
], QuizAttempt.prototype, "drawn", void 0);
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
47
|
+
tslib_1.__metadata("design:type", Object)
|
|
48
|
+
], QuizAttempt.prototype, "answers", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the answers were sent.' }),
|
|
52
|
+
tslib_1.__metadata("design:type", Date)
|
|
53
|
+
], QuizAttempt.prototype, "submittedAt", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
56
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The score, out of 100.' }),
|
|
57
|
+
tslib_1.__metadata("design:type", Number)
|
|
58
|
+
], QuizAttempt.prototype, "score", void 0);
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
61
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Whether it passed.' }),
|
|
62
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
63
|
+
], QuizAttempt.prototype, "passed", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
66
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Creation timestamp.' }),
|
|
67
|
+
tslib_1.__metadata("design:type", Date)
|
|
68
|
+
], QuizAttempt.prototype, "createdAt", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
71
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Last update timestamp.' }),
|
|
72
|
+
tslib_1.__metadata("design:type", Date)
|
|
73
|
+
], QuizAttempt.prototype, "updatedAt", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
76
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Soft delete timestamp.' }),
|
|
77
|
+
tslib_1.__metadata("design:type", Date)
|
|
78
|
+
], QuizAttempt.prototype, "deletedAt", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
81
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who made it.' }),
|
|
82
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
83
|
+
], QuizAttempt.prototype, "creator", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, typeorm_1.RelationId)((row) => row.creator),
|
|
86
|
+
tslib_1.__metadata("design:type", String)
|
|
87
|
+
], QuizAttempt.prototype, "creatorId", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
90
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who changed it last.' }),
|
|
91
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
92
|
+
], QuizAttempt.prototype, "updater", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.RelationId)((row) => row.updater),
|
|
95
|
+
tslib_1.__metadata("design:type", String)
|
|
96
|
+
], QuizAttempt.prototype, "updaterId", void 0);
|
|
97
|
+
exports.QuizAttempt = QuizAttempt = tslib_1.__decorate([
|
|
98
|
+
(0, typeorm_1.Entity)({ name: 'learning_quiz_attempts' }),
|
|
99
|
+
(0, typeorm_1.Index)('ix_learning_quiz_attempt_0', (row) => [row.domain, row.enrollment, row.createdAt])
|
|
100
|
+
/* One unsent attempt per enrolment - the table holds it too, whatever two requests do at once. */
|
|
101
|
+
,
|
|
102
|
+
(0, typeorm_1.Index)('ix_learning_quiz_attempt_1', (row) => [row.domain, row.enrollment], { unique: true, where: '"deleted_at" IS NULL AND "submitted_at" IS NULL' }),
|
|
103
|
+
(0, type_graphql_1.ObjectType)({ description: 'One attempt at a quiz - the questions drawn, the answers sent and the score the server gave.' })
|
|
104
|
+
], QuizAttempt);
|
|
105
|
+
//# sourceMappingURL=quiz-attempt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quiz-attempt.js","sourceRoot":"","sources":["../../../server/service/enrollment/quiz-attempt.ts"],"names":[],"mappings":";;;;AAAA,+CAAyD;AACzD,qCAAoJ;AAEpJ,yDAAgD;AAChD,iDAA8C;AAE9C,6CAAyC;AAQzC;;;;GAIG;AAMI,IAAM,WAAW,GAAjB,MAAM,WAAW;CAgEvB,CAAA;AAhEY,kCAAW;AAGb;IAFR,IAAA,gCAA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,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;sCACnE,gBAAI;4CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,GAAgB,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC;;8CAC5B;sBA/DP,WAAW;IALvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC;IAC1C,IAAA,eAAK,EAAC,4BAA4B,EAAE,CAAC,GAAgB,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IACvG,kGAAkG;;IACjG,IAAA,eAAK,EAAC,4BAA4B,EAAE,CAAC,GAAgB,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,iDAAiD,EAAE,CAAC;IACnK,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,8FAA8F,EAAE,CAAC;GAC/G,WAAW,CAgEvB","sourcesContent":["import { Field, ID, Int, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { Enrollment } from './enrollment'\n\n/** One question as an attempt drew it - its choices in the order shown. */\nexport interface DrawnQuestion {\n questionId: string\n choiceIds: string[]\n}\n\n/**\n * 응시 (ADR-0194 decision 4) - one attempt at a version's quiz: the questions it drew and their choices in shuffled\n * order, and once sent, the answers and the score the server gave. The drawn questions are kept so the answers are\n * scored against what was shown.\n */\n@Entity({ name: 'learning_quiz_attempts' })\n@Index('ix_learning_quiz_attempt_0', (row: QuizAttempt) => [row.domain, row.enrollment, row.createdAt])\n/* One unsent attempt per enrolment - the table holds it too, whatever two requests do at once. */\n@Index('ix_learning_quiz_attempt_1', (row: QuizAttempt) => [row.domain, row.enrollment], { unique: true, where: '\"deleted_at\" IS NULL AND \"submitted_at\" IS NULL' })\n@ObjectType({ description: 'One attempt at a quiz - the questions drawn, the answers sent and the score the server gave.' })\nexport class QuizAttempt {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Attempt id.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain.' })\n domain?: Domain\n\n @RelationId((row: QuizAttempt) => row.domain)\n domainId?: string\n\n @ManyToOne(type => Enrollment)\n @Field(type => Enrollment, { nullable: true, description: 'The enrolment.' })\n enrollment?: Enrollment\n\n @RelationId((row: QuizAttempt) => row.enrollment)\n enrollmentId?: string\n\n /** The questions drawn, in order, with their choices in the order shown - not a field. */\n @Column({ type: 'simple-json' })\n drawn: DrawnQuestion[]\n\n /** The choices picked for each question - not a field. */\n @Column({ type: 'simple-json', nullable: true })\n answers?: Record<string, string[]>\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When the answers were sent.' })\n submittedAt?: Date\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The score, out of 100.' })\n score?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Whether it passed.' })\n passed?: boolean\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Creation timestamp.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Last update timestamp.' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'Soft delete timestamp.' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who made it.' })\n creator?: User\n\n @RelationId((row: QuizAttempt) => row.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who changed it last.' })\n updater?: User\n\n @RelationId((row: QuizAttempt) => row.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
import { CourseUnit } from '../course/course-unit';
|
|
4
|
+
import { Enrollment } from './enrollment';
|
|
5
|
+
/**
|
|
6
|
+
* 진도 (ADR-0194 decision 6) - how far one enrolment went through one unit: the seconds the server counted, how far the
|
|
7
|
+
* video was watched, and whether it is done. Never deleted - another device carries on from it. The time is counted from
|
|
8
|
+
* the gap since the last tick, at most 15 seconds each - never a sum the screen sends.
|
|
9
|
+
*/
|
|
10
|
+
export declare class UnitProgress {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
domain?: Domain;
|
|
13
|
+
domainId?: string;
|
|
14
|
+
enrollment?: Enrollment;
|
|
15
|
+
enrollmentId?: string;
|
|
16
|
+
unit?: CourseUnit;
|
|
17
|
+
unitId?: string;
|
|
18
|
+
learnedSeconds: number;
|
|
19
|
+
watchedSeconds: number;
|
|
20
|
+
positionSeconds: number;
|
|
21
|
+
pagesSeen: number;
|
|
22
|
+
pagesRead: number;
|
|
23
|
+
pageSeconds: number;
|
|
24
|
+
pageAt: number;
|
|
25
|
+
lastTickAt?: Date;
|
|
26
|
+
doneAt?: Date;
|
|
27
|
+
createdAt?: Date;
|
|
28
|
+
updatedAt?: Date;
|
|
29
|
+
deletedAt?: Date;
|
|
30
|
+
creator?: User;
|
|
31
|
+
creatorId?: string;
|
|
32
|
+
updater?: User;
|
|
33
|
+
updaterId?: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnitProgress = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
+
const shell_1 = require("@things-factory/shell");
|
|
9
|
+
const course_unit_1 = require("../course/course-unit");
|
|
10
|
+
const enrollment_1 = require("./enrollment");
|
|
11
|
+
/**
|
|
12
|
+
* 진도 (ADR-0194 decision 6) - how far one enrolment went through one unit: the seconds the server counted, how far the
|
|
13
|
+
* video was watched, and whether it is done. Never deleted - another device carries on from it. The time is counted from
|
|
14
|
+
* the gap since the last tick, at most 15 seconds each - never a sum the screen sends.
|
|
15
|
+
*/
|
|
16
|
+
let UnitProgress = class UnitProgress {
|
|
17
|
+
};
|
|
18
|
+
exports.UnitProgress = UnitProgress;
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Progress id.' }),
|
|
22
|
+
tslib_1.__metadata("design:type", String)
|
|
23
|
+
], UnitProgress.prototype, "id", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
26
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain.' }),
|
|
27
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
28
|
+
], UnitProgress.prototype, "domain", void 0);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, typeorm_1.RelationId)((row) => row.domain),
|
|
31
|
+
tslib_1.__metadata("design:type", String)
|
|
32
|
+
], UnitProgress.prototype, "domainId", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(type => enrollment_1.Enrollment),
|
|
35
|
+
(0, type_graphql_1.Field)(type => enrollment_1.Enrollment, { nullable: true, description: 'The enrolment.' }),
|
|
36
|
+
tslib_1.__metadata("design:type", enrollment_1.Enrollment)
|
|
37
|
+
], UnitProgress.prototype, "enrollment", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, typeorm_1.RelationId)((row) => row.enrollment),
|
|
40
|
+
tslib_1.__metadata("design:type", String)
|
|
41
|
+
], UnitProgress.prototype, "enrollmentId", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.ManyToOne)(type => course_unit_1.CourseUnit),
|
|
44
|
+
(0, type_graphql_1.Field)(type => course_unit_1.CourseUnit, { nullable: true, description: 'The unit.' }),
|
|
45
|
+
tslib_1.__metadata("design:type", course_unit_1.CourseUnit)
|
|
46
|
+
], UnitProgress.prototype, "unit", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, typeorm_1.RelationId)((row) => row.unit),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], UnitProgress.prototype, "unitId", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
53
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The seconds the server counted on it.' }),
|
|
54
|
+
tslib_1.__metadata("design:type", Number)
|
|
55
|
+
], UnitProgress.prototype, "learnedSeconds", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
58
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How far the video was watched, in seconds - it cannot be moved past it.' }),
|
|
59
|
+
tslib_1.__metadata("design:type", Number)
|
|
60
|
+
], UnitProgress.prototype, "watchedSeconds", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
63
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Where the video was left, in seconds.' }),
|
|
64
|
+
tslib_1.__metadata("design:type", Number)
|
|
65
|
+
], UnitProgress.prototype, "positionSeconds", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
68
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The furthest page of a PDF arrived at.' }),
|
|
69
|
+
tslib_1.__metadata("design:type", Number)
|
|
70
|
+
], UnitProgress.prototype, "pagesSeen", void 0);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
73
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The furthest page of a PDF read through - looked at for its seconds; the next page is the furthest it may turn to.' }),
|
|
74
|
+
tslib_1.__metadata("design:type", Number)
|
|
75
|
+
], UnitProgress.prototype, "pagesRead", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
78
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The seconds looked at on the furthest page arrived at, so far.' }),
|
|
79
|
+
tslib_1.__metadata("design:type", Number)
|
|
80
|
+
], UnitProgress.prototype, "pageSeconds", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
83
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The page of a PDF it was left at.' }),
|
|
84
|
+
tslib_1.__metadata("design:type", Number)
|
|
85
|
+
], UnitProgress.prototype, "pageAt", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
88
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the last tick came - the next one is counted from it.' }),
|
|
89
|
+
tslib_1.__metadata("design:type", Date)
|
|
90
|
+
], UnitProgress.prototype, "lastTickAt", void 0);
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was done.' }),
|
|
94
|
+
tslib_1.__metadata("design:type", Date)
|
|
95
|
+
], UnitProgress.prototype, "doneAt", void 0);
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
98
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Creation timestamp.' }),
|
|
99
|
+
tslib_1.__metadata("design:type", Date)
|
|
100
|
+
], UnitProgress.prototype, "createdAt", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
103
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Last update timestamp.' }),
|
|
104
|
+
tslib_1.__metadata("design:type", Date)
|
|
105
|
+
], UnitProgress.prototype, "updatedAt", void 0);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
108
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Soft delete timestamp.' }),
|
|
109
|
+
tslib_1.__metadata("design:type", Date)
|
|
110
|
+
], UnitProgress.prototype, "deletedAt", void 0);
|
|
111
|
+
tslib_1.__decorate([
|
|
112
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
113
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who made it.' }),
|
|
114
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
115
|
+
], UnitProgress.prototype, "creator", void 0);
|
|
116
|
+
tslib_1.__decorate([
|
|
117
|
+
(0, typeorm_1.RelationId)((row) => row.creator),
|
|
118
|
+
tslib_1.__metadata("design:type", String)
|
|
119
|
+
], UnitProgress.prototype, "creatorId", void 0);
|
|
120
|
+
tslib_1.__decorate([
|
|
121
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
122
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who changed it last.' }),
|
|
123
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
124
|
+
], UnitProgress.prototype, "updater", void 0);
|
|
125
|
+
tslib_1.__decorate([
|
|
126
|
+
(0, typeorm_1.RelationId)((row) => row.updater),
|
|
127
|
+
tslib_1.__metadata("design:type", String)
|
|
128
|
+
], UnitProgress.prototype, "updaterId", void 0);
|
|
129
|
+
exports.UnitProgress = UnitProgress = tslib_1.__decorate([
|
|
130
|
+
(0, typeorm_1.Entity)({ name: 'learning_unit_progresses' }),
|
|
131
|
+
(0, typeorm_1.Index)('ix_learning_unit_progress_0', (row) => [row.domain, row.enrollment, row.unit], { unique: true, where: '"deleted_at" IS NULL' }),
|
|
132
|
+
(0, type_graphql_1.ObjectType)({ description: 'How far one enrolment went through one unit - the time the server counted, how far the video was watched, done or not.' })
|
|
133
|
+
], UnitProgress);
|
|
134
|
+
//# sourceMappingURL=unit-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-progress.js","sourceRoot":"","sources":["../../../server/service/enrollment/unit-progress.ts"],"names":[],"mappings":";;;;AAAA,+CAAyD;AACzD,qCAAoJ;AAEpJ,yDAAgD;AAChD,iDAA8C;AAE9C,uDAAkD;AAClD,6CAAyC;AAEzC;;;;GAIG;AAII,IAAM,YAAY,GAAlB,MAAM,YAAY;CAuFxB,CAAA;AAvFY,oCAAY;AAGd;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;wCAChC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;sCAC7D,cAAM;4CAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,GAAiB,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;;8CAC7B;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,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IACpJ,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wHAAwH,EAAE,CAAC;GACzI,YAAY,CAuFxB","sourcesContent":["import { Field, ID, Int, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { CourseUnit } from '../course/course-unit'\nimport { Enrollment } from './enrollment'\n\n/**\n * 진도 (ADR-0194 decision 6) - how far one enrolment went through one unit: the seconds the server counted, how far the\n * video was watched, and whether it is done. Never deleted - another device carries on from it. The time is counted from\n * the gap since the last tick, at most 15 seconds each - never a sum the screen sends.\n */\n@Entity({ name: 'learning_unit_progresses' })\n@Index('ix_learning_unit_progress_0', (row: UnitProgress) => [row.domain, row.enrollment, row.unit], { unique: true, where: '\"deleted_at\" IS NULL' })\n@ObjectType({ description: 'How far one enrolment went through one unit - the time the server counted, how far the video was watched, done or not.' })\nexport class UnitProgress {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Progress id.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain.' })\n domain?: Domain\n\n @RelationId((row: UnitProgress) => row.domain)\n domainId?: string\n\n @ManyToOne(type => Enrollment)\n @Field(type => Enrollment, { nullable: true, description: 'The enrolment.' })\n enrollment?: Enrollment\n\n @RelationId((row: UnitProgress) => row.enrollment)\n enrollmentId?: string\n\n @ManyToOne(type => CourseUnit)\n @Field(type => CourseUnit, { nullable: true, description: 'The unit.' })\n unit?: CourseUnit\n\n @RelationId((row: UnitProgress) => row.unit)\n unitId?: string\n\n @Column({ type: 'int', default: 0 })\n @Field(type => Int, { description: 'The seconds the server counted on it.' })\n learnedSeconds: number\n\n @Column({ type: 'int', default: 0 })\n @Field(type => Int, { description: 'How far the video was watched, in seconds - it cannot be moved past it.' })\n watchedSeconds: number\n\n @Column({ type: 'int', default: 0 })\n @Field(type => Int, { description: 'Where the video was left, in seconds.' })\n positionSeconds: number\n\n @Column({ type: 'int', default: 0 })\n @Field(type => Int, { description: 'The furthest page of a PDF arrived at.' })\n pagesSeen: number\n\n @Column({ type: 'int', default: 0 })\n @Field(type => Int, { description: 'The furthest page of a PDF read through - looked at for its seconds; the next page is the furthest it may turn to.' })\n pagesRead: number\n\n @Column({ type: 'int', default: 0 })\n @Field(type => Int, { description: 'The seconds looked at on the furthest page arrived at, so far.' })\n pageSeconds: number\n\n @Column({ type: 'int', default: 0 })\n @Field(type => Int, { description: 'The page of a PDF it was left at.' })\n pageAt: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When the last tick came - the next one is counted from it.' })\n lastTickAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When it was done.' })\n doneAt?: Date\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Creation timestamp.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Last update timestamp.' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'Soft delete timestamp.' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who made it.' })\n creator?: User\n\n @RelationId((row: UnitProgress) => row.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who changed it last.' })\n updater?: User\n\n @RelationId((row: UnitProgress) => row.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './course/course';
|
|
2
|
+
export * from './course/course-question';
|
|
3
|
+
export * from './course/course-unit';
|
|
4
|
+
export * from './course/course-version';
|
|
5
|
+
export { COURSE_UNIT_REF_TYPE, publishedVersionOf, unitsOf, questionsOf, addDraftedQuestions } from './course';
|
|
6
|
+
export * from './enrollment/enrollment';
|
|
7
|
+
export * from './enrollment/quiz-attempt';
|
|
8
|
+
export * from './enrollment/unit-progress';
|
|
9
|
+
export * from './enrollment/learning-outcome';
|
|
10
|
+
export { cancelEnrollment, DIRECT_SOURCE_KIND, enroll, learningAddressOf, withdraw, type LearningSource, LEARNING_CERTIFICATE_KIND, LEARNING_REGISTER_KIND } from './enrollment';
|
|
11
|
+
export declare const entities: (typeof import("./course").Course | typeof import("./course").CourseVersion | typeof import("./course").CourseUnit | typeof import("./course").CourseQuestion | typeof import("./enrollment").Enrollment | typeof import("./enrollment").QuizAttempt | typeof import("./enrollment").UnitProgress)[];
|
|
12
|
+
export declare const schema: {
|
|
13
|
+
resolverClasses: (typeof import("./course/material-draft-mutation").MaterialDraftMutation | typeof import("./course/course-mutation").CourseMutation | typeof import("./course/course-query").CourseQuery | typeof import("./course/course-query").CourseVersionFields | typeof import("./course/course-query").CourseUnitFields | typeof import("./course/course-query").CourseQuestionFields | typeof import("./enrollment/enrollment-mutation").EnrollmentMutation | typeof import("./enrollment/enrollment-query").EnrollmentQuery)[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.schema = exports.entities = exports.LEARNING_REGISTER_KIND = exports.LEARNING_CERTIFICATE_KIND = exports.withdraw = exports.learningAddressOf = exports.enroll = exports.DIRECT_SOURCE_KIND = exports.cancelEnrollment = exports.addDraftedQuestions = exports.questionsOf = exports.unitsOf = exports.publishedVersionOf = exports.COURSE_UNIT_REF_TYPE = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/* EXPORT ENTITY TYPES */
|
|
6
|
+
tslib_1.__exportStar(require("./course/course"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./course/course-question"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./course/course-unit"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./course/course-version"), exports);
|
|
10
|
+
var course_1 = require("./course");
|
|
11
|
+
Object.defineProperty(exports, "COURSE_UNIT_REF_TYPE", { enumerable: true, get: function () { return course_1.COURSE_UNIT_REF_TYPE; } });
|
|
12
|
+
Object.defineProperty(exports, "publishedVersionOf", { enumerable: true, get: function () { return course_1.publishedVersionOf; } });
|
|
13
|
+
Object.defineProperty(exports, "unitsOf", { enumerable: true, get: function () { return course_1.unitsOf; } });
|
|
14
|
+
Object.defineProperty(exports, "questionsOf", { enumerable: true, get: function () { return course_1.questionsOf; } });
|
|
15
|
+
Object.defineProperty(exports, "addDraftedQuestions", { enumerable: true, get: function () { return course_1.addDraftedQuestions; } });
|
|
16
|
+
tslib_1.__exportStar(require("./enrollment/enrollment"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./enrollment/quiz-attempt"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./enrollment/unit-progress"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./enrollment/learning-outcome"), exports);
|
|
20
|
+
var enrollment_1 = require("./enrollment");
|
|
21
|
+
Object.defineProperty(exports, "cancelEnrollment", { enumerable: true, get: function () { return enrollment_1.cancelEnrollment; } });
|
|
22
|
+
Object.defineProperty(exports, "DIRECT_SOURCE_KIND", { enumerable: true, get: function () { return enrollment_1.DIRECT_SOURCE_KIND; } });
|
|
23
|
+
Object.defineProperty(exports, "enroll", { enumerable: true, get: function () { return enrollment_1.enroll; } });
|
|
24
|
+
Object.defineProperty(exports, "learningAddressOf", { enumerable: true, get: function () { return enrollment_1.learningAddressOf; } });
|
|
25
|
+
Object.defineProperty(exports, "withdraw", { enumerable: true, get: function () { return enrollment_1.withdraw; } });
|
|
26
|
+
Object.defineProperty(exports, "LEARNING_CERTIFICATE_KIND", { enumerable: true, get: function () { return enrollment_1.LEARNING_CERTIFICATE_KIND; } });
|
|
27
|
+
Object.defineProperty(exports, "LEARNING_REGISTER_KIND", { enumerable: true, get: function () { return enrollment_1.LEARNING_REGISTER_KIND; } });
|
|
28
|
+
/* IMPORT ENTITIES AND RESOLVERS */
|
|
29
|
+
const course_2 = require("./course");
|
|
30
|
+
const enrollment_2 = require("./enrollment");
|
|
31
|
+
exports.entities = [
|
|
32
|
+
/* ENTITIES */
|
|
33
|
+
...course_2.entities,
|
|
34
|
+
...enrollment_2.entities
|
|
35
|
+
];
|
|
36
|
+
exports.schema = {
|
|
37
|
+
resolverClasses: [
|
|
38
|
+
/* RESOLVER CLASSES */
|
|
39
|
+
...course_2.resolvers,
|
|
40
|
+
...enrollment_2.resolvers
|
|
41
|
+
]
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,0DAA+B;AAC/B,mEAAwC;AACxC,+DAAoC;AACpC,kEAAuC;AACvC,mCAA8G;AAArG,8GAAA,oBAAoB,OAAA;AAAE,4GAAA,kBAAkB,OAAA;AAAE,iGAAA,OAAO,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,6GAAA,mBAAmB,OAAA;AAC5F,kEAAuC;AACvC,oEAAyC;AACzC,qEAA0C;AAC1C,wEAA6C;AAC7C,2CAAgL;AAAvK,8GAAA,gBAAgB,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AAAE,oGAAA,MAAM,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAuB,uHAAA,yBAAyB,OAAA;AAAE,oHAAA,sBAAsB,OAAA;AAE1J,mCAAmC;AACnC,qCAAmF;AACnF,6CAA+F;AAElF,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,iBAAc;IACjB,GAAG,qBAAkB;CACtB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,kBAAe;QAClB,GAAG,sBAAmB;KACvB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './course/course'\nexport * from './course/course-question'\nexport * from './course/course-unit'\nexport * from './course/course-version'\nexport { COURSE_UNIT_REF_TYPE, publishedVersionOf, unitsOf, questionsOf, addDraftedQuestions } from './course'\nexport * from './enrollment/enrollment'\nexport * from './enrollment/quiz-attempt'\nexport * from './enrollment/unit-progress'\nexport * from './enrollment/learning-outcome'\nexport { cancelEnrollment, DIRECT_SOURCE_KIND, enroll, learningAddressOf, withdraw, type LearningSource, LEARNING_CERTIFICATE_KIND, LEARNING_REGISTER_KIND } from './enrollment'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as CourseEntities, resolvers as CourseResolvers } from './course'\nimport { entities as EnrollmentEntities, resolvers as EnrollmentResolvers } from './enrollment'\n\nexport const entities = [\n /* ENTITIES */\n ...CourseEntities,\n ...EnrollmentEntities\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...CourseResolvers,\n ...EnrollmentResolvers\n ]\n}\n"]}
|