@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.
Files changed (167) hide show
  1. package/dist-client/bootstrap.d.ts +2 -0
  2. package/dist-client/bootstrap.js +4 -0
  3. package/dist-client/bootstrap.js.map +1 -0
  4. package/dist-client/components/learning-assign-form.d.ts +24 -0
  5. package/dist-client/components/learning-assign-form.js +77 -0
  6. package/dist-client/components/learning-assign-form.js.map +1 -0
  7. package/dist-client/components/learning-course-form.d.ts +29 -0
  8. package/dist-client/components/learning-course-form.js +104 -0
  9. package/dist-client/components/learning-course-form.js.map +1 -0
  10. package/dist-client/components/learning-material-form.d.ts +41 -0
  11. package/dist-client/components/learning-material-form.js +202 -0
  12. package/dist-client/components/learning-material-form.js.map +1 -0
  13. package/dist-client/components/learning-question-form.d.ts +33 -0
  14. package/dist-client/components/learning-question-form.js +142 -0
  15. package/dist-client/components/learning-question-form.js.map +1 -0
  16. package/dist-client/components/learning-todo.d.ts +12 -0
  17. package/dist-client/components/learning-todo.js +43 -0
  18. package/dist-client/components/learning-todo.js.map +1 -0
  19. package/dist-client/components/learning-unit-form.d.ts +44 -0
  20. package/dist-client/components/learning-unit-form.js +151 -0
  21. package/dist-client/components/learning-unit-form.js.map +1 -0
  22. package/dist-client/index.d.ts +2 -0
  23. package/dist-client/index.js +3 -0
  24. package/dist-client/index.js.map +1 -0
  25. package/dist-client/pages/learning-course-editor.d.ts +63 -0
  26. package/dist-client/pages/learning-course-editor.js +476 -0
  27. package/dist-client/pages/learning-course-editor.js.map +1 -0
  28. package/dist-client/pages/learning-course-list.d.ts +37 -0
  29. package/dist-client/pages/learning-course-list.js +92 -0
  30. package/dist-client/pages/learning-course-list.js.map +1 -0
  31. package/dist-client/pages/learning-enrollment-status.d.ts +65 -0
  32. package/dist-client/pages/learning-enrollment-status.js +211 -0
  33. package/dist-client/pages/learning-enrollment-status.js.map +1 -0
  34. package/dist-client/pages/learning-view.d.ts +63 -0
  35. package/dist-client/pages/learning-view.js +446 -0
  36. package/dist-client/pages/learning-view.js.map +1 -0
  37. package/dist-client/pages/my-learning.d.ts +22 -0
  38. package/dist-client/pages/my-learning.js +110 -0
  39. package/dist-client/pages/my-learning.js.map +1 -0
  40. package/dist-client/route.d.ts +1 -0
  41. package/dist-client/route.js +21 -0
  42. package/dist-client/route.js.map +1 -0
  43. package/dist-client/tsconfig.tsbuildinfo +1 -0
  44. package/dist-client/utils/learning-api.d.ts +61 -0
  45. package/dist-client/utils/learning-api.js +85 -0
  46. package/dist-client/utils/learning-api.js.map +1 -0
  47. package/dist-client/utils/learning-words.d.ts +20 -0
  48. package/dist-client/utils/learning-words.js +22 -0
  49. package/dist-client/utils/learning-words.js.map +1 -0
  50. package/dist-client/utils/material-source.d.ts +12 -0
  51. package/dist-client/utils/material-source.js +77 -0
  52. package/dist-client/utils/material-source.js.map +1 -0
  53. package/dist-server/activities.d.ts +38 -0
  54. package/dist-server/activities.js +42 -0
  55. package/dist-server/activities.js.map +1 -0
  56. package/dist-server/ai-reads.d.ts +9 -0
  57. package/dist-server/ai-reads.js +70 -0
  58. package/dist-server/ai-reads.js.map +1 -0
  59. package/dist-server/attachment-reader.d.ts +1 -0
  60. package/dist-server/attachment-reader.js +23 -0
  61. package/dist-server/attachment-reader.js.map +1 -0
  62. package/dist-server/index.d.ts +4 -0
  63. package/dist-server/index.js +33 -0
  64. package/dist-server/index.js.map +1 -0
  65. package/dist-server/learning-subjects.d.ts +10 -0
  66. package/dist-server/learning-subjects.js +31 -0
  67. package/dist-server/learning-subjects.js.map +1 -0
  68. package/dist-server/role-tasks.d.ts +2 -0
  69. package/dist-server/role-tasks.js +17 -0
  70. package/dist-server/role-tasks.js.map +1 -0
  71. package/dist-server/service/course/course-mutation.d.ts +19 -0
  72. package/dist-server/service/course/course-mutation.js +177 -0
  73. package/dist-server/service/course/course-mutation.js.map +1 -0
  74. package/dist-server/service/course/course-query.d.ts +27 -0
  75. package/dist-server/service/course/course-query.js +183 -0
  76. package/dist-server/service/course/course-query.js.map +1 -0
  77. package/dist-server/service/course/course-question.d.ts +41 -0
  78. package/dist-server/service/course/course-question.js +116 -0
  79. package/dist-server/service/course/course-question.js.map +1 -0
  80. package/dist-server/service/course/course-rules.d.ts +51 -0
  81. package/dist-server/service/course/course-rules.js +93 -0
  82. package/dist-server/service/course/course-rules.js.map +1 -0
  83. package/dist-server/service/course/course-service.d.ts +72 -0
  84. package/dist-server/service/course/course-service.js +398 -0
  85. package/dist-server/service/course/course-service.js.map +1 -0
  86. package/dist-server/service/course/course-type.d.ts +56 -0
  87. package/dist-server/service/course/course-type.js +202 -0
  88. package/dist-server/service/course/course-type.js.map +1 -0
  89. package/dist-server/service/course/course-unit.d.ts +37 -0
  90. package/dist-server/service/course/course-unit.js +128 -0
  91. package/dist-server/service/course/course-unit.js.map +1 -0
  92. package/dist-server/service/course/course-version.d.ts +45 -0
  93. package/dist-server/service/course/course-version.js +151 -0
  94. package/dist-server/service/course/course-version.js.map +1 -0
  95. package/dist-server/service/course/course.d.ts +23 -0
  96. package/dist-server/service/course/course.js +92 -0
  97. package/dist-server/service/course/course.js.map +1 -0
  98. package/dist-server/service/course/index.d.ts +15 -0
  99. package/dist-server/service/course/index.js +25 -0
  100. package/dist-server/service/course/index.js.map +1 -0
  101. package/dist-server/service/course/material-audio.d.ts +1 -0
  102. package/dist-server/service/course/material-audio.js +43 -0
  103. package/dist-server/service/course/material-audio.js.map +1 -0
  104. package/dist-server/service/course/material-draft-mutation.d.ts +13 -0
  105. package/dist-server/service/course/material-draft-mutation.js +55 -0
  106. package/dist-server/service/course/material-draft-mutation.js.map +1 -0
  107. package/dist-server/service/course/material-draft-rules.d.ts +38 -0
  108. package/dist-server/service/course/material-draft-rules.js +83 -0
  109. package/dist-server/service/course/material-draft-rules.js.map +1 -0
  110. package/dist-server/service/course/material-draft-service.d.ts +15 -0
  111. package/dist-server/service/course/material-draft-service.js +162 -0
  112. package/dist-server/service/course/material-draft-service.js.map +1 -0
  113. package/dist-server/service/enrollment/enrollment-mutation.d.ts +11 -0
  114. package/dist-server/service/enrollment/enrollment-mutation.js +124 -0
  115. package/dist-server/service/enrollment/enrollment-mutation.js.map +1 -0
  116. package/dist-server/service/enrollment/enrollment-query.d.ts +24 -0
  117. package/dist-server/service/enrollment/enrollment-query.js +236 -0
  118. package/dist-server/service/enrollment/enrollment-query.js.map +1 -0
  119. package/dist-server/service/enrollment/enrollment-remind.d.ts +1 -0
  120. package/dist-server/service/enrollment/enrollment-remind.js +45 -0
  121. package/dist-server/service/enrollment/enrollment-remind.js.map +1 -0
  122. package/dist-server/service/enrollment/enrollment-service.d.ts +110 -0
  123. package/dist-server/service/enrollment/enrollment-service.js +427 -0
  124. package/dist-server/service/enrollment/enrollment-service.js.map +1 -0
  125. package/dist-server/service/enrollment/enrollment-status.d.ts +53 -0
  126. package/dist-server/service/enrollment/enrollment-status.js +194 -0
  127. package/dist-server/service/enrollment/enrollment-status.js.map +1 -0
  128. package/dist-server/service/enrollment/enrollment-type.d.ts +82 -0
  129. package/dist-server/service/enrollment/enrollment-type.js +293 -0
  130. package/dist-server/service/enrollment/enrollment-type.js.map +1 -0
  131. package/dist-server/service/enrollment/enrollment.d.ts +53 -0
  132. package/dist-server/service/enrollment/enrollment.js +191 -0
  133. package/dist-server/service/enrollment/enrollment.js.map +1 -0
  134. package/dist-server/service/enrollment/index.d.ts +15 -0
  135. package/dist-server/service/enrollment/index.js +26 -0
  136. package/dist-server/service/enrollment/index.js.map +1 -0
  137. package/dist-server/service/enrollment/learning-ai.d.ts +45 -0
  138. package/dist-server/service/enrollment/learning-ai.js +93 -0
  139. package/dist-server/service/enrollment/learning-ai.js.map +1 -0
  140. package/dist-server/service/enrollment/learning-documents.d.ts +7 -0
  141. package/dist-server/service/enrollment/learning-documents.js +159 -0
  142. package/dist-server/service/enrollment/learning-documents.js.map +1 -0
  143. package/dist-server/service/enrollment/learning-outcome.d.ts +10 -0
  144. package/dist-server/service/enrollment/learning-outcome.js +16 -0
  145. package/dist-server/service/enrollment/learning-outcome.js.map +1 -0
  146. package/dist-server/service/enrollment/progress-rules.d.ts +119 -0
  147. package/dist-server/service/enrollment/progress-rules.js +132 -0
  148. package/dist-server/service/enrollment/progress-rules.js.map +1 -0
  149. package/dist-server/service/enrollment/quiz-attempt.d.ts +34 -0
  150. package/dist-server/service/enrollment/quiz-attempt.js +105 -0
  151. package/dist-server/service/enrollment/quiz-attempt.js.map +1 -0
  152. package/dist-server/service/enrollment/unit-progress.d.ts +34 -0
  153. package/dist-server/service/enrollment/unit-progress.js +134 -0
  154. package/dist-server/service/enrollment/unit-progress.js.map +1 -0
  155. package/dist-server/service/index.d.ts +14 -0
  156. package/dist-server/service/index.js +43 -0
  157. package/dist-server/service/index.js.map +1 -0
  158. package/dist-server/tsconfig.tsbuildinfo +1 -0
  159. package/package.json +57 -4
  160. package/things-factory.config.js +14 -0
  161. package/translations/en.json +278 -0
  162. package/translations/es.json +278 -0
  163. package/translations/ja.json +278 -0
  164. package/translations/ko.json +278 -0
  165. package/translations/ms.json +278 -0
  166. package/translations/zh.json +278 -0
  167. package/README.md +0 -3
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CourseList = exports.CourseChoiceKey = exports.CourseQuestionInput = exports.CourseChoiceInput = exports.CourseUnitInput = exports.CourseVersionPatch = exports.CoursePatch = exports.NewCourse = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const course_1 = require("./course");
7
+ const course_question_1 = require("./course-question");
8
+ const course_unit_1 = require("./course-unit");
9
+ const course_version_1 = require("./course-version");
10
+ let NewCourse = class NewCourse {
11
+ };
12
+ exports.NewCourse = NewCourse;
13
+ tslib_1.__decorate([
14
+ (0, type_graphql_1.Field)({ description: 'What it is called.' }),
15
+ tslib_1.__metadata("design:type", String)
16
+ ], NewCourse.prototype, "name", void 0);
17
+ tslib_1.__decorate([
18
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What it is about.' }),
19
+ tslib_1.__metadata("design:type", String)
20
+ ], NewCourse.prototype, "description", void 0);
21
+ tslib_1.__decorate([
22
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Its category.' }),
23
+ tslib_1.__metadata("design:type", String)
24
+ ], NewCourse.prototype, "category", void 0);
25
+ tslib_1.__decorate([
26
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The user who keeps it - the one making it when empty.' }),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], NewCourse.prototype, "managerId", void 0);
29
+ exports.NewCourse = NewCourse = tslib_1.__decorate([
30
+ (0, type_graphql_1.InputType)({ description: 'A course to make' })
31
+ ], NewCourse);
32
+ let CoursePatch = class CoursePatch {
33
+ };
34
+ exports.CoursePatch = CoursePatch;
35
+ tslib_1.__decorate([
36
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What it is called.' }),
37
+ tslib_1.__metadata("design:type", String)
38
+ ], CoursePatch.prototype, "name", void 0);
39
+ tslib_1.__decorate([
40
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What it is about.' }),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], CoursePatch.prototype, "description", void 0);
43
+ tslib_1.__decorate([
44
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Its category.' }),
45
+ tslib_1.__metadata("design:type", String)
46
+ ], CoursePatch.prototype, "category", void 0);
47
+ tslib_1.__decorate([
48
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The user who keeps it.' }),
49
+ tslib_1.__metadata("design:type", String)
50
+ ], CoursePatch.prototype, "managerId", void 0);
51
+ exports.CoursePatch = CoursePatch = tslib_1.__decorate([
52
+ (0, type_graphql_1.InputType)({ description: 'What a course says, changed' })
53
+ ], CoursePatch);
54
+ let CourseVersionPatch = class CourseVersionPatch {
55
+ };
56
+ exports.CourseVersionPatch = CourseVersionPatch;
57
+ tslib_1.__decorate([
58
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The least time in seconds.' }),
59
+ tslib_1.__metadata("design:type", Number)
60
+ ], CourseVersionPatch.prototype, "minSeconds", void 0);
61
+ tslib_1.__decorate([
62
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What the learner confirms - nothing asked when empty.' }),
63
+ tslib_1.__metadata("design:type", String)
64
+ ], CourseVersionPatch.prototype, "acknowledgement", void 0);
65
+ tslib_1.__decorate([
66
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The pass score out of 100 - no quiz when empty.' }),
67
+ tslib_1.__metadata("design:type", Number)
68
+ ], CourseVersionPatch.prototype, "passScore", void 0);
69
+ tslib_1.__decorate([
70
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'How many questions an attempt draws - all when empty.' }),
71
+ tslib_1.__metadata("design:type", Number)
72
+ ], CourseVersionPatch.prototype, "questionCount", void 0);
73
+ tslib_1.__decorate([
74
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'How many attempts a learner has - no limit when empty.' }),
75
+ tslib_1.__metadata("design:type", Number)
76
+ ], CourseVersionPatch.prototype, "attemptLimit", void 0);
77
+ tslib_1.__decorate([
78
+ (0, type_graphql_1.Field)(type => course_version_1.CourseSourceKind, { nullable: true, description: 'Where its material came from.' }),
79
+ tslib_1.__metadata("design:type", String)
80
+ ], CourseVersionPatch.prototype, "sourceKind", void 0);
81
+ tslib_1.__decorate([
82
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Who gave the material and on what terms.' }),
83
+ tslib_1.__metadata("design:type", String)
84
+ ], CourseVersionPatch.prototype, "sourceNote", void 0);
85
+ exports.CourseVersionPatch = CourseVersionPatch = tslib_1.__decorate([
86
+ (0, type_graphql_1.InputType)({ description: 'What a draft version says, changed' })
87
+ ], CourseVersionPatch);
88
+ let CourseUnitInput = class CourseUnitInput {
89
+ };
90
+ exports.CourseUnitInput = CourseUnitInput;
91
+ tslib_1.__decorate([
92
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The unit to change - a new one when empty.' }),
93
+ tslib_1.__metadata("design:type", String)
94
+ ], CourseUnitInput.prototype, "id", void 0);
95
+ tslib_1.__decorate([
96
+ (0, type_graphql_1.Field)(type => course_unit_1.CourseUnitKind, { description: 'What it is.' }),
97
+ tslib_1.__metadata("design:type", String)
98
+ ], CourseUnitInput.prototype, "kind", void 0);
99
+ tslib_1.__decorate([
100
+ (0, type_graphql_1.Field)({ description: 'What it is called.' }),
101
+ tslib_1.__metadata("design:type", String)
102
+ ], CourseUnitInput.prototype, "name", void 0);
103
+ tslib_1.__decorate([
104
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The text in markdown - a MARKDOWN unit.' }),
105
+ tslib_1.__metadata("design:type", String)
106
+ ], CourseUnitInput.prototype, "body", void 0);
107
+ tslib_1.__decorate([
108
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The address - a LINK unit.' }),
109
+ tslib_1.__metadata("design:type", String)
110
+ ], CourseUnitInput.prototype, "url", void 0);
111
+ tslib_1.__decorate([
112
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: "The video's length in seconds, read from the file." }),
113
+ tslib_1.__metadata("design:type", Number)
114
+ ], CourseUnitInput.prototype, "durationSeconds", void 0);
115
+ tslib_1.__decorate([
116
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: "A PDF's page count, read from the file." }),
117
+ tslib_1.__metadata("design:type", Number)
118
+ ], CourseUnitInput.prototype, "pageCount", void 0);
119
+ tslib_1.__decorate([
120
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Seconds a PDF or a text is looked at to be done - 60 when empty.' }),
121
+ tslib_1.__metadata("design:type", Number)
122
+ ], CourseUnitInput.prototype, "minSeconds", void 0);
123
+ exports.CourseUnitInput = CourseUnitInput = tslib_1.__decorate([
124
+ (0, type_graphql_1.InputType)({ description: 'A unit of a draft version, new (no id) or changed' })
125
+ ], CourseUnitInput);
126
+ let CourseChoiceInput = class CourseChoiceInput {
127
+ };
128
+ exports.CourseChoiceInput = CourseChoiceInput;
129
+ tslib_1.__decorate([
130
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The choice id - kept when the question is changed.' }),
131
+ tslib_1.__metadata("design:type", String)
132
+ ], CourseChoiceInput.prototype, "id", void 0);
133
+ tslib_1.__decorate([
134
+ (0, type_graphql_1.Field)({ description: 'What it says.' }),
135
+ tslib_1.__metadata("design:type", String)
136
+ ], CourseChoiceInput.prototype, "text", void 0);
137
+ tslib_1.__decorate([
138
+ (0, type_graphql_1.Field)({ description: 'Whether it is right.' }),
139
+ tslib_1.__metadata("design:type", Boolean)
140
+ ], CourseChoiceInput.prototype, "correct", void 0);
141
+ exports.CourseChoiceInput = CourseChoiceInput = tslib_1.__decorate([
142
+ (0, type_graphql_1.InputType)({ description: 'A choice of a question, with whether it is right' })
143
+ ], CourseChoiceInput);
144
+ let CourseQuestionInput = class CourseQuestionInput {
145
+ };
146
+ exports.CourseQuestionInput = CourseQuestionInput;
147
+ tslib_1.__decorate([
148
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The question to change - a new one when empty.' }),
149
+ tslib_1.__metadata("design:type", String)
150
+ ], CourseQuestionInput.prototype, "id", void 0);
151
+ tslib_1.__decorate([
152
+ (0, type_graphql_1.Field)(type => course_question_1.CourseQuestionKind, { description: 'How it is answered.' }),
153
+ tslib_1.__metadata("design:type", String)
154
+ ], CourseQuestionInput.prototype, "kind", void 0);
155
+ tslib_1.__decorate([
156
+ (0, type_graphql_1.Field)({ description: 'What it asks.' }),
157
+ tslib_1.__metadata("design:type", String)
158
+ ], CourseQuestionInput.prototype, "text", void 0);
159
+ tslib_1.__decorate([
160
+ (0, type_graphql_1.Field)(type => [CourseChoiceInput], { description: 'Its choices.' }),
161
+ tslib_1.__metadata("design:type", Array)
162
+ ], CourseQuestionInput.prototype, "choices", void 0);
163
+ tslib_1.__decorate([
164
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Why the answer is what it is.' }),
165
+ tslib_1.__metadata("design:type", String)
166
+ ], CourseQuestionInput.prototype, "explanation", void 0);
167
+ exports.CourseQuestionInput = CourseQuestionInput = tslib_1.__decorate([
168
+ (0, type_graphql_1.InputType)({ description: 'A question of a draft version, new (no id) or changed' })
169
+ ], CourseQuestionInput);
170
+ let CourseChoiceKey = class CourseChoiceKey {
171
+ };
172
+ exports.CourseChoiceKey = CourseChoiceKey;
173
+ tslib_1.__decorate([
174
+ (0, type_graphql_1.Field)({ description: 'The choice id.' }),
175
+ tslib_1.__metadata("design:type", String)
176
+ ], CourseChoiceKey.prototype, "id", void 0);
177
+ tslib_1.__decorate([
178
+ (0, type_graphql_1.Field)({ description: 'What it says.' }),
179
+ tslib_1.__metadata("design:type", String)
180
+ ], CourseChoiceKey.prototype, "text", void 0);
181
+ tslib_1.__decorate([
182
+ (0, type_graphql_1.Field)({ description: 'Whether it is right.' }),
183
+ tslib_1.__metadata("design:type", Boolean)
184
+ ], CourseChoiceKey.prototype, "correct", void 0);
185
+ exports.CourseChoiceKey = CourseChoiceKey = tslib_1.__decorate([
186
+ (0, type_graphql_1.ObjectType)({ description: 'A choice of a question as a manager reads it - with whether it is right' })
187
+ ], CourseChoiceKey);
188
+ let CourseList = class CourseList {
189
+ };
190
+ exports.CourseList = CourseList;
191
+ tslib_1.__decorate([
192
+ (0, type_graphql_1.Field)(type => [course_1.Course], { description: 'The courses.' }),
193
+ tslib_1.__metadata("design:type", Array)
194
+ ], CourseList.prototype, "items", void 0);
195
+ tslib_1.__decorate([
196
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How many there are.' }),
197
+ tslib_1.__metadata("design:type", Number)
198
+ ], CourseList.prototype, "total", void 0);
199
+ exports.CourseList = CourseList = tslib_1.__decorate([
200
+ (0, type_graphql_1.ObjectType)({ description: 'A page of courses' })
201
+ ], CourseList);
202
+ //# sourceMappingURL=course-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-type.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GAC1F,eAAe,CAS3B;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;AANY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,eAAM,CAAC,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;yCAC1C;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;yCAC9C;qBALF,UAAU;IADtB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;GACpC,UAAU,CAMtB","sourcesContent":["import { Field, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { Course } from './course'\nimport { CourseQuestionKind } from './course-question'\nimport { CourseUnitKind } from './course-unit'\nimport { CourseSourceKind } from './course-version'\n\n@InputType({ description: 'A course to make' })\nexport class NewCourse {\n @Field({ description: 'What it is called.' })\n name: string\n\n @Field({ nullable: true, description: 'What it is about.' })\n description?: string\n\n @Field({ nullable: true, description: 'Its category.' })\n category?: string\n\n @Field({ nullable: true, description: 'The user who keeps it - the one making it when empty.' })\n managerId?: string\n}\n\n@InputType({ description: 'What a course says, changed' })\nexport class CoursePatch {\n @Field({ nullable: true, description: 'What it is called.' })\n name?: string\n\n @Field({ nullable: true, description: 'What it is about.' })\n description?: string\n\n @Field({ nullable: true, description: 'Its category.' })\n category?: string\n\n @Field({ nullable: true, description: 'The user who keeps it.' })\n managerId?: string\n}\n\n@InputType({ description: 'What a draft version says, changed' })\nexport class CourseVersionPatch {\n @Field(type => Int, { nullable: true, description: 'The least time in seconds.' })\n minSeconds?: number\n\n @Field({ nullable: true, description: 'What the learner confirms - nothing asked when empty.' })\n acknowledgement?: string\n\n @Field(type => Int, { nullable: true, description: 'The pass score out of 100 - no quiz when empty.' })\n passScore?: number\n\n @Field(type => Int, { nullable: true, description: 'How many questions an attempt draws - all when empty.' })\n questionCount?: number\n\n @Field(type => Int, { nullable: true, description: 'How many attempts a learner has - no limit when empty.' })\n attemptLimit?: number\n\n @Field(type => CourseSourceKind, { nullable: true, description: 'Where its material came from.' })\n sourceKind?: CourseSourceKind\n\n @Field({ nullable: true, description: 'Who gave the material and on what terms.' })\n sourceNote?: string\n}\n\n@InputType({ description: 'A unit of a draft version, new (no id) or changed' })\nexport class CourseUnitInput {\n @Field({ nullable: true, description: 'The unit to change - a new one when empty.' })\n id?: string\n\n @Field(type => CourseUnitKind, { description: 'What it is.' })\n kind: CourseUnitKind\n\n @Field({ description: 'What it is called.' })\n name: string\n\n @Field({ nullable: true, description: 'The text in markdown - a MARKDOWN unit.' })\n body?: string\n\n @Field({ nullable: true, description: 'The address - a LINK unit.' })\n url?: string\n\n @Field(type => Int, { nullable: true, description: \"The video's length in seconds, read from the file.\" })\n durationSeconds?: number\n\n @Field(type => Int, { nullable: true, description: \"A PDF's page count, read from the file.\" })\n pageCount?: number\n\n @Field(type => Int, { nullable: true, description: 'Seconds a PDF or a text is looked at to be done - 60 when empty.' })\n minSeconds?: number\n}\n\n@InputType({ description: 'A choice of a question, with whether it is right' })\nexport class CourseChoiceInput {\n @Field({ nullable: true, description: 'The choice id - kept when the question is changed.' })\n id?: string\n\n @Field({ description: 'What it says.' })\n text: string\n\n @Field({ description: 'Whether it is right.' })\n correct: boolean\n}\n\n@InputType({ description: 'A question of a draft version, new (no id) or changed' })\nexport class CourseQuestionInput {\n @Field({ nullable: true, description: 'The question to change - a new one when empty.' })\n id?: string\n\n @Field(type => CourseQuestionKind, { description: 'How it is answered.' })\n kind: CourseQuestionKind\n\n @Field({ description: 'What it asks.' })\n text: string\n\n @Field(type => [CourseChoiceInput], { description: 'Its choices.' })\n choices: CourseChoiceInput[]\n\n @Field({ nullable: true, description: 'Why the answer is what it is.' })\n explanation?: string\n}\n\n@ObjectType({ description: 'A choice of a question as a manager reads it - with whether it is right' })\nexport class CourseChoiceKey {\n @Field({ description: 'The choice id.' })\n id: string\n\n @Field({ description: 'What it says.' })\n text: string\n\n @Field({ description: 'Whether it is right.' })\n correct: boolean\n}\n\n@ObjectType({ description: 'A page of courses' })\nexport class CourseList {\n @Field(type => [Course], { description: 'The courses.' })\n items: Course[]\n\n @Field(type => Int, { description: 'How many there are.' })\n total: number\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ import { CourseVersion } from './course-version';
4
+ /** What a unit is: a video, a PDF document, a text in markdown, or a link to elsewhere (not counted). */
5
+ export declare enum CourseUnitKind {
6
+ VIDEO = "VIDEO",
7
+ PDF = "PDF",
8
+ MARKDOWN = "MARKDOWN",
9
+ LINK = "LINK"
10
+ }
11
+ /**
12
+ * 단원 (ADR-0194 decision 3) - one part of a version, in order. A video is done played to its end, a PDF read to its
13
+ * last page and looked at for its time, a text looked at for its time (a minute when not set); a link is not counted - the server cannot know what was
14
+ * watched elsewhere. Its file hangs on it through attachment-base (`refType` `CourseUnit`).
15
+ */
16
+ export declare class CourseUnit {
17
+ readonly id: string;
18
+ domain?: Domain;
19
+ domainId?: string;
20
+ version?: CourseVersion;
21
+ versionId?: string;
22
+ seq: number;
23
+ kind: CourseUnitKind;
24
+ name: string;
25
+ body?: string;
26
+ url?: string;
27
+ durationSeconds?: number;
28
+ pageCount?: number;
29
+ minSeconds?: number;
30
+ createdAt?: Date;
31
+ updatedAt?: Date;
32
+ deletedAt?: Date;
33
+ creator?: User;
34
+ creatorId?: string;
35
+ updater?: User;
36
+ updaterId?: string;
37
+ }
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CourseUnit = exports.CourseUnitKind = 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_version_1 = require("./course-version");
10
+ /** What a unit is: a video, a PDF document, a text in markdown, or a link to elsewhere (not counted). */
11
+ var CourseUnitKind;
12
+ (function (CourseUnitKind) {
13
+ CourseUnitKind["VIDEO"] = "VIDEO";
14
+ CourseUnitKind["PDF"] = "PDF";
15
+ CourseUnitKind["MARKDOWN"] = "MARKDOWN";
16
+ CourseUnitKind["LINK"] = "LINK";
17
+ })(CourseUnitKind || (exports.CourseUnitKind = CourseUnitKind = {}));
18
+ (0, type_graphql_1.registerEnumType)(CourseUnitKind, { name: 'CourseUnitKind', description: 'VIDEO, PDF, MARKDOWN (a text) or LINK (a page elsewhere - its watching is not counted).' });
19
+ /**
20
+ * 단원 (ADR-0194 decision 3) - one part of a version, in order. A video is done played to its end, a PDF read to its
21
+ * last page and looked at for its time, a text looked at for its time (a minute when not set); a link is not counted - the server cannot know what was
22
+ * watched elsewhere. Its file hangs on it through attachment-base (`refType` `CourseUnit`).
23
+ */
24
+ let CourseUnit = class CourseUnit {
25
+ };
26
+ exports.CourseUnit = CourseUnit;
27
+ tslib_1.__decorate([
28
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
29
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unit id.' }),
30
+ tslib_1.__metadata("design:type", String)
31
+ ], CourseUnit.prototype, "id", void 0);
32
+ tslib_1.__decorate([
33
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
34
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain.' }),
35
+ tslib_1.__metadata("design:type", shell_1.Domain)
36
+ ], CourseUnit.prototype, "domain", void 0);
37
+ tslib_1.__decorate([
38
+ (0, typeorm_1.RelationId)((row) => row.domain),
39
+ tslib_1.__metadata("design:type", String)
40
+ ], CourseUnit.prototype, "domainId", void 0);
41
+ tslib_1.__decorate([
42
+ (0, typeorm_1.ManyToOne)(type => course_version_1.CourseVersion),
43
+ (0, type_graphql_1.Field)(type => course_version_1.CourseVersion, { nullable: true, description: 'The version it is part of.' }),
44
+ tslib_1.__metadata("design:type", course_version_1.CourseVersion)
45
+ ], CourseUnit.prototype, "version", void 0);
46
+ tslib_1.__decorate([
47
+ (0, typeorm_1.RelationId)((row) => row.version),
48
+ tslib_1.__metadata("design:type", String)
49
+ ], CourseUnit.prototype, "versionId", void 0);
50
+ tslib_1.__decorate([
51
+ (0, typeorm_1.Column)({ type: 'int' }),
52
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Its place in the version, from 1.' }),
53
+ tslib_1.__metadata("design:type", Number)
54
+ ], CourseUnit.prototype, "seq", void 0);
55
+ tslib_1.__decorate([
56
+ (0, typeorm_1.Column)(),
57
+ (0, type_graphql_1.Field)(type => CourseUnitKind, { description: 'What it is.' }),
58
+ tslib_1.__metadata("design:type", String)
59
+ ], CourseUnit.prototype, "kind", void 0);
60
+ tslib_1.__decorate([
61
+ (0, typeorm_1.Column)(),
62
+ (0, type_graphql_1.Field)({ description: 'What it is called.' }),
63
+ tslib_1.__metadata("design:type", String)
64
+ ], CourseUnit.prototype, "name", void 0);
65
+ tslib_1.__decorate([
66
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
67
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The text, in markdown - for a MARKDOWN unit.' }),
68
+ tslib_1.__metadata("design:type", String)
69
+ ], CourseUnit.prototype, "body", void 0);
70
+ tslib_1.__decorate([
71
+ (0, typeorm_1.Column)({ length: 2000, nullable: true }),
72
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The address - for a LINK unit.' }),
73
+ tslib_1.__metadata("design:type", String)
74
+ ], CourseUnit.prototype, "url", void 0);
75
+ tslib_1.__decorate([
76
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
77
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: "The video's length in seconds, read from the file when it was attached." }),
78
+ tslib_1.__metadata("design:type", Number)
79
+ ], CourseUnit.prototype, "durationSeconds", void 0);
80
+ tslib_1.__decorate([
81
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
82
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: "A PDF's page count, read from the file when it was attached - every page is to be read." }),
83
+ tslib_1.__metadata("design:type", Number)
84
+ ], CourseUnit.prototype, "pageCount", void 0);
85
+ tslib_1.__decorate([
86
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
87
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'How long a PDF or a text is looked at to be done, in seconds - 60 when empty.' }),
88
+ tslib_1.__metadata("design:type", Number)
89
+ ], CourseUnit.prototype, "minSeconds", void 0);
90
+ tslib_1.__decorate([
91
+ (0, typeorm_1.CreateDateColumn)(),
92
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Creation timestamp.' }),
93
+ tslib_1.__metadata("design:type", Date)
94
+ ], CourseUnit.prototype, "createdAt", void 0);
95
+ tslib_1.__decorate([
96
+ (0, typeorm_1.UpdateDateColumn)(),
97
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Last update timestamp.' }),
98
+ tslib_1.__metadata("design:type", Date)
99
+ ], CourseUnit.prototype, "updatedAt", void 0);
100
+ tslib_1.__decorate([
101
+ (0, typeorm_1.DeleteDateColumn)(),
102
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Soft delete timestamp.' }),
103
+ tslib_1.__metadata("design:type", Date)
104
+ ], CourseUnit.prototype, "deletedAt", void 0);
105
+ tslib_1.__decorate([
106
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
107
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who made it.' }),
108
+ tslib_1.__metadata("design:type", auth_base_1.User)
109
+ ], CourseUnit.prototype, "creator", void 0);
110
+ tslib_1.__decorate([
111
+ (0, typeorm_1.RelationId)((row) => row.creator),
112
+ tslib_1.__metadata("design:type", String)
113
+ ], CourseUnit.prototype, "creatorId", void 0);
114
+ tslib_1.__decorate([
115
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
116
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who changed it last.' }),
117
+ tslib_1.__metadata("design:type", auth_base_1.User)
118
+ ], CourseUnit.prototype, "updater", void 0);
119
+ tslib_1.__decorate([
120
+ (0, typeorm_1.RelationId)((row) => row.updater),
121
+ tslib_1.__metadata("design:type", String)
122
+ ], CourseUnit.prototype, "updaterId", void 0);
123
+ exports.CourseUnit = CourseUnit = tslib_1.__decorate([
124
+ (0, typeorm_1.Entity)({ name: 'learning_course_units' }),
125
+ (0, typeorm_1.Index)('ix_learning_course_unit_0', (row) => [row.domain, row.version, row.seq]),
126
+ (0, type_graphql_1.ObjectType)({ description: 'A unit of a course version - a video, a PDF, a text or a link, in order.' })
127
+ ], CourseUnit);
128
+ //# sourceMappingURL=course-unit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-unit.js","sourceRoot":"","sources":["../../../server/service/course/course-unit.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAC3E,qCAAoJ;AAEpJ,yDAAgD;AAChD,iDAA8C;AAE9C,qDAAgD;AAEhD,yGAAyG;AACzG,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,6BAAW,CAAA;IACX,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACf,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAED,IAAA,+BAAgB,EAAC,cAAc,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,yFAAyF,EAAE,CAAC,CAAA;AAEpK;;;;GAIG;AAII,IAAM,UAAU,GAAhB,MAAM,UAAU;CA4EtB,CAAA;AA5EY,gCAAU;AAGZ;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;;sCAC5B;AAInB;IAFC,IAAA,mBA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AAW,EAAE,wBAAwB,EAAE,CAAC;sCACrD,IAAI;6CAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;sCAC3D,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,GAAe,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC;;6CAC3B;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;sCACnE,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,GAAe,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC;;6CAC3B;qBA3EP,UAAU;IAHtB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;IACzC,IAAA,eAAK,EAAC,2BAA2B,EAAE,CAAC,GAAe,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3F,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0EAA0E,EAAE,CAAC;GAC3F,UAAU,CA4EtB","sourcesContent":["import { Field, ID, Int, ObjectType, registerEnumType } 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 { CourseVersion } from './course-version'\n\n/** What a unit is: a video, a PDF document, a text in markdown, or a link to elsewhere (not counted). */\nexport enum CourseUnitKind {\n VIDEO = 'VIDEO',\n PDF = 'PDF',\n MARKDOWN = 'MARKDOWN',\n LINK = 'LINK'\n}\n\nregisterEnumType(CourseUnitKind, { name: 'CourseUnitKind', description: 'VIDEO, PDF, MARKDOWN (a text) or LINK (a page elsewhere - its watching is not counted).' })\n\n/**\n * 단원 (ADR-0194 decision 3) - one part of a version, in order. A video is done played to its end, a PDF read to its\n * last page and looked at for its time, a text looked at for its time (a minute when not set); a link is not counted - the server cannot know what was\n * watched elsewhere. Its file hangs on it through attachment-base (`refType` `CourseUnit`).\n */\n@Entity({ name: 'learning_course_units' })\n@Index('ix_learning_course_unit_0', (row: CourseUnit) => [row.domain, row.version, row.seq])\n@ObjectType({ description: 'A unit of a course version - a video, a PDF, a text or a link, in order.' })\nexport class CourseUnit {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unit 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: CourseUnit) => row.domain)\n domainId?: string\n\n @ManyToOne(type => CourseVersion)\n @Field(type => CourseVersion, { nullable: true, description: 'The version it is part of.' })\n version?: CourseVersion\n\n @RelationId((row: CourseUnit) => row.version)\n versionId?: string\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Its place in the version, from 1.' })\n seq: number\n\n @Column()\n @Field(type => CourseUnitKind, { description: 'What it is.' })\n kind: CourseUnitKind\n\n @Column()\n @Field({ description: 'What it is called.' })\n name: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'The text, in markdown - for a MARKDOWN unit.' })\n body?: string\n\n @Column({ length: 2000, nullable: true })\n @Field({ nullable: true, description: 'The address - for a LINK unit.' })\n url?: string\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: \"The video's length in seconds, read from the file when it was attached.\" })\n durationSeconds?: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: \"A PDF's page count, read from the file when it was attached - every page is to be read.\" })\n pageCount?: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'How long a PDF or a text is looked at to be done, in seconds - 60 when empty.' })\n minSeconds?: number\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: CourseUnit) => 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: CourseUnit) => row.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,45 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ import { Course } from './course';
4
+ /** Where a version stands: written, published to learners, or closed. */
5
+ export declare enum CourseVersionStatus {
6
+ DRAFT = "DRAFT",
7
+ PUBLISHED = "PUBLISHED",
8
+ CLOSED = "CLOSED"
9
+ }
10
+ /** Where a version's material came from. */
11
+ export declare enum CourseSourceKind {
12
+ PUBLIC = "PUBLIC",
13
+ OWN = "OWN",
14
+ PURCHASED = "PURCHASED"
15
+ }
16
+ /**
17
+ * 개정본 (ADR-0194 decisions 2, 4) - what a course says at one time: its units, its quiz, the least time and what the
18
+ * learner confirms. **A published version never changes** - the records of those who took it point at what it said; a
19
+ * change is a new version, published while the one before is closed. An enrolment in progress ends on its own version.
20
+ */
21
+ export declare class CourseVersion {
22
+ readonly id: string;
23
+ domain?: Domain;
24
+ domainId?: string;
25
+ course?: Course;
26
+ courseId?: string;
27
+ number: number;
28
+ status: CourseVersionStatus;
29
+ minSeconds: number;
30
+ acknowledgement?: string;
31
+ passScore?: number;
32
+ questionCount?: number;
33
+ attemptLimit?: number;
34
+ sourceKind?: CourseSourceKind;
35
+ sourceNote?: string;
36
+ publishedAt?: Date;
37
+ closedAt?: Date;
38
+ createdAt?: Date;
39
+ updatedAt?: Date;
40
+ deletedAt?: Date;
41
+ creator?: User;
42
+ creatorId?: string;
43
+ updater?: User;
44
+ updaterId?: string;
45
+ }
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CourseVersion = exports.CourseSourceKind = exports.CourseVersionStatus = 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_1 = require("./course");
10
+ /** Where a version stands: written, published to learners, or closed. */
11
+ var CourseVersionStatus;
12
+ (function (CourseVersionStatus) {
13
+ CourseVersionStatus["DRAFT"] = "DRAFT";
14
+ CourseVersionStatus["PUBLISHED"] = "PUBLISHED";
15
+ CourseVersionStatus["CLOSED"] = "CLOSED";
16
+ })(CourseVersionStatus || (exports.CourseVersionStatus = CourseVersionStatus = {}));
17
+ (0, type_graphql_1.registerEnumType)(CourseVersionStatus, { name: 'CourseVersionStatus', description: 'DRAFT - being written; PUBLISHED - taken by learners, never changed; CLOSED - a later version replaced it.' });
18
+ /** Where a version's material came from. */
19
+ var CourseSourceKind;
20
+ (function (CourseSourceKind) {
21
+ CourseSourceKind["PUBLIC"] = "PUBLIC";
22
+ CourseSourceKind["OWN"] = "OWN";
23
+ CourseSourceKind["PURCHASED"] = "PURCHASED";
24
+ })(CourseSourceKind || (exports.CourseSourceKind = CourseSourceKind = {}));
25
+ (0, type_graphql_1.registerEnumType)(CourseSourceKind, { name: 'CourseSourceKind', description: 'PUBLIC - material of a public body; OWN - made by the company; PURCHASED - bought.' });
26
+ /**
27
+ * 개정본 (ADR-0194 decisions 2, 4) - what a course says at one time: its units, its quiz, the least time and what the
28
+ * learner confirms. **A published version never changes** - the records of those who took it point at what it said; a
29
+ * change is a new version, published while the one before is closed. An enrolment in progress ends on its own version.
30
+ */
31
+ let CourseVersion = class CourseVersion {
32
+ };
33
+ exports.CourseVersion = CourseVersion;
34
+ tslib_1.__decorate([
35
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
36
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Version id.' }),
37
+ tslib_1.__metadata("design:type", String)
38
+ ], CourseVersion.prototype, "id", void 0);
39
+ tslib_1.__decorate([
40
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
41
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain.' }),
42
+ tslib_1.__metadata("design:type", shell_1.Domain)
43
+ ], CourseVersion.prototype, "domain", void 0);
44
+ tslib_1.__decorate([
45
+ (0, typeorm_1.RelationId)((row) => row.domain),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], CourseVersion.prototype, "domainId", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.ManyToOne)(type => course_1.Course),
50
+ (0, type_graphql_1.Field)(type => course_1.Course, { nullable: true, description: 'The course.' }),
51
+ tslib_1.__metadata("design:type", course_1.Course)
52
+ ], CourseVersion.prototype, "course", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.RelationId)((row) => row.course),
55
+ tslib_1.__metadata("design:type", String)
56
+ ], CourseVersion.prototype, "courseId", void 0);
57
+ tslib_1.__decorate([
58
+ (0, typeorm_1.Column)({ type: 'int' }),
59
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: '1, 2, 3 ... in the order the versions were made.' }),
60
+ tslib_1.__metadata("design:type", Number)
61
+ ], CourseVersion.prototype, "number", void 0);
62
+ tslib_1.__decorate([
63
+ (0, typeorm_1.Column)({ default: CourseVersionStatus.DRAFT }),
64
+ (0, type_graphql_1.Field)(type => CourseVersionStatus, { description: 'Where it stands.' }),
65
+ tslib_1.__metadata("design:type", String)
66
+ ], CourseVersion.prototype, "status", void 0);
67
+ tslib_1.__decorate([
68
+ (0, typeorm_1.Column)({ type: 'int', default: 0 }),
69
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The least time, in seconds, a learner spends on its units to complete it.' }),
70
+ tslib_1.__metadata("design:type", Number)
71
+ ], CourseVersion.prototype, "minSeconds", void 0);
72
+ tslib_1.__decorate([
73
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
74
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What the learner confirms before completing - nothing asked when empty.' }),
75
+ tslib_1.__metadata("design:type", String)
76
+ ], CourseVersion.prototype, "acknowledgement", void 0);
77
+ tslib_1.__decorate([
78
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
79
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The score, out of 100, that passes its quiz - no quiz when empty.' }),
80
+ tslib_1.__metadata("design:type", Number)
81
+ ], CourseVersion.prototype, "passScore", void 0);
82
+ tslib_1.__decorate([
83
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
84
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'How many of its questions an attempt draws - all of them when empty.' }),
85
+ tslib_1.__metadata("design:type", Number)
86
+ ], CourseVersion.prototype, "questionCount", void 0);
87
+ tslib_1.__decorate([
88
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
89
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'How many attempts a learner has - no limit when empty.' }),
90
+ tslib_1.__metadata("design:type", Number)
91
+ ], CourseVersion.prototype, "attemptLimit", void 0);
92
+ tslib_1.__decorate([
93
+ (0, typeorm_1.Column)({ nullable: true }),
94
+ (0, type_graphql_1.Field)(type => CourseSourceKind, { nullable: true, description: 'Where its material came from.' }),
95
+ tslib_1.__metadata("design:type", String)
96
+ ], CourseVersion.prototype, "sourceKind", void 0);
97
+ tslib_1.__decorate([
98
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
99
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Who gave the material and on what terms it may be used.' }),
100
+ tslib_1.__metadata("design:type", String)
101
+ ], CourseVersion.prototype, "sourceNote", void 0);
102
+ tslib_1.__decorate([
103
+ (0, typeorm_1.Column)({ nullable: true }),
104
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it was published.' }),
105
+ tslib_1.__metadata("design:type", Date)
106
+ ], CourseVersion.prototype, "publishedAt", void 0);
107
+ tslib_1.__decorate([
108
+ (0, typeorm_1.Column)({ nullable: true }),
109
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When it was closed.' }),
110
+ tslib_1.__metadata("design:type", Date)
111
+ ], CourseVersion.prototype, "closedAt", void 0);
112
+ tslib_1.__decorate([
113
+ (0, typeorm_1.CreateDateColumn)(),
114
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Creation timestamp.' }),
115
+ tslib_1.__metadata("design:type", Date)
116
+ ], CourseVersion.prototype, "createdAt", void 0);
117
+ tslib_1.__decorate([
118
+ (0, typeorm_1.UpdateDateColumn)(),
119
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Last update timestamp.' }),
120
+ tslib_1.__metadata("design:type", Date)
121
+ ], CourseVersion.prototype, "updatedAt", void 0);
122
+ tslib_1.__decorate([
123
+ (0, typeorm_1.DeleteDateColumn)(),
124
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Soft delete timestamp.' }),
125
+ tslib_1.__metadata("design:type", Date)
126
+ ], CourseVersion.prototype, "deletedAt", void 0);
127
+ tslib_1.__decorate([
128
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
129
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who made it.' }),
130
+ tslib_1.__metadata("design:type", auth_base_1.User)
131
+ ], CourseVersion.prototype, "creator", void 0);
132
+ tslib_1.__decorate([
133
+ (0, typeorm_1.RelationId)((row) => row.creator),
134
+ tslib_1.__metadata("design:type", String)
135
+ ], CourseVersion.prototype, "creatorId", void 0);
136
+ tslib_1.__decorate([
137
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
138
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who changed it last.' }),
139
+ tslib_1.__metadata("design:type", auth_base_1.User)
140
+ ], CourseVersion.prototype, "updater", void 0);
141
+ tslib_1.__decorate([
142
+ (0, typeorm_1.RelationId)((row) => row.updater),
143
+ tslib_1.__metadata("design:type", String)
144
+ ], CourseVersion.prototype, "updaterId", void 0);
145
+ exports.CourseVersion = CourseVersion = tslib_1.__decorate([
146
+ (0, typeorm_1.Entity)({ name: 'learning_course_versions' }),
147
+ (0, typeorm_1.Index)('ix_learning_course_version_0', (row) => [row.domain, row.course, row.number], { unique: true, where: '"deleted_at" IS NULL' }),
148
+ (0, typeorm_1.Index)('ix_learning_course_version_1', (row) => [row.domain, row.status]),
149
+ (0, type_graphql_1.ObjectType)({ description: 'A version of a course - its units, quiz, least time and acknowledgement; never changed once published.' })
150
+ ], CourseVersion);
151
+ //# sourceMappingURL=course-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-version.js","sourceRoot":"","sources":["../../../server/service/course/course-version.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAC3E,qCAAoJ;AAEpJ,yDAAgD;AAChD,iDAA8C;AAE9C,qCAAiC;AAEjC,yEAAyE;AACzE,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,sCAAe,CAAA;IACf,8CAAuB,CAAA;IACvB,wCAAiB,CAAA;AACnB,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAED,IAAA,+BAAgB,EAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,qB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AAC,MAAM,CAAC,CAAC;IACvF,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wGAAwG,EAAE,CAAC;GACzH,aAAa,CAwFzB","sourcesContent":["import { Field, ID, Int, ObjectType, registerEnumType } 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 { Course } from './course'\n\n/** Where a version stands: written, published to learners, or closed. */\nexport enum CourseVersionStatus {\n DRAFT = 'DRAFT',\n PUBLISHED = 'PUBLISHED',\n CLOSED = 'CLOSED'\n}\n\nregisterEnumType(CourseVersionStatus, { name: 'CourseVersionStatus', description: 'DRAFT - being written; PUBLISHED - taken by learners, never changed; CLOSED - a later version replaced it.' })\n\n/** Where a version's material came from. */\nexport enum CourseSourceKind {\n PUBLIC = 'PUBLIC',\n OWN = 'OWN',\n PURCHASED = 'PURCHASED'\n}\n\nregisterEnumType(CourseSourceKind, { name: 'CourseSourceKind', description: 'PUBLIC - material of a public body; OWN - made by the company; PURCHASED - bought.' })\n\n/**\n * 개정본 (ADR-0194 decisions 2, 4) - what a course says at one time: its units, its quiz, the least time and what the\n * learner confirms. **A published version never changes** - the records of those who took it point at what it said; a\n * change is a new version, published while the one before is closed. An enrolment in progress ends on its own version.\n */\n@Entity({ name: 'learning_course_versions' })\n@Index('ix_learning_course_version_0', (row: CourseVersion) => [row.domain, row.course, row.number], { unique: true, where: '\"deleted_at\" IS NULL' })\n@Index('ix_learning_course_version_1', (row: CourseVersion) => [row.domain, row.status])\n@ObjectType({ description: 'A version of a course - its units, quiz, least time and acknowledgement; never changed once published.' })\nexport class CourseVersion {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Version 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: CourseVersion) => row.domain)\n domainId?: string\n\n @ManyToOne(type => Course)\n @Field(type => Course, { nullable: true, description: 'The course.' })\n course?: Course\n\n @RelationId((row: CourseVersion) => row.course)\n courseId?: string\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: '1, 2, 3 ... in the order the versions were made.' })\n number: number\n\n @Column({ default: CourseVersionStatus.DRAFT })\n @Field(type => CourseVersionStatus, { description: 'Where it stands.' })\n status: CourseVersionStatus\n\n @Column({ type: 'int', default: 0 })\n @Field(type => Int, { description: 'The least time, in seconds, a learner spends on its units to complete it.' })\n minSeconds: number\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What the learner confirms before completing - nothing asked when empty.' })\n acknowledgement?: string\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The score, out of 100, that passes its quiz - no quiz when empty.' })\n passScore?: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'How many of its questions an attempt draws - all of them when empty.' })\n questionCount?: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'How many attempts a learner has - no limit when empty.' })\n attemptLimit?: number\n\n @Column({ nullable: true })\n @Field(type => CourseSourceKind, { nullable: true, description: 'Where its material came from.' })\n sourceKind?: CourseSourceKind\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Who gave the material and on what terms it may be used.' })\n sourceNote?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When it was published.' })\n publishedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'When it was closed.' })\n closedAt?: 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: CourseVersion) => 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: CourseVersion) => row.updater)\n updaterId?: string\n}\n"]}