@octo-cyber/quiz-engine 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controllers/attempt.controller.d.ts +3 -0
- package/dist/controllers/attempt.controller.d.ts.map +1 -0
- package/dist/controllers/attempt.controller.js +83 -0
- package/dist/controllers/attempt.controller.js.map +1 -0
- package/dist/controllers/category.controller.d.ts +3 -0
- package/dist/controllers/category.controller.d.ts.map +1 -0
- package/dist/controllers/category.controller.js +38 -0
- package/dist/controllers/category.controller.js.map +1 -0
- package/dist/controllers/exam.controller.d.ts +3 -0
- package/dist/controllers/exam.controller.d.ts.map +1 -0
- package/dist/controllers/exam.controller.js +48 -0
- package/dist/controllers/exam.controller.js.map +1 -0
- package/dist/controllers/index.d.ts +7 -0
- package/dist/controllers/index.d.ts.map +1 -0
- package/dist/controllers/index.js +16 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/controllers/paper.controller.d.ts +3 -0
- package/dist/controllers/paper.controller.d.ts.map +1 -0
- package/dist/controllers/paper.controller.js +70 -0
- package/dist/controllers/paper.controller.js.map +1 -0
- package/dist/controllers/question.controller.d.ts +3 -0
- package/dist/controllers/question.controller.d.ts.map +1 -0
- package/dist/controllers/question.controller.js +59 -0
- package/dist/controllers/question.controller.js.map +1 -0
- package/dist/controllers/statistics.controller.d.ts +3 -0
- package/dist/controllers/statistics.controller.d.ts.map +1 -0
- package/dist/controllers/statistics.controller.js +37 -0
- package/dist/controllers/statistics.controller.js.map +1 -0
- package/dist/entities/index.d.ts +24 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +43 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/quiz-answer.entity.d.ts +19 -0
- package/dist/entities/quiz-answer.entity.d.ts.map +1 -0
- package/dist/entities/quiz-answer.entity.js +81 -0
- package/dist/entities/quiz-answer.entity.js.map +1 -0
- package/dist/entities/quiz-attempt.entity.d.ts +17 -0
- package/dist/entities/quiz-attempt.entity.d.ts.map +1 -0
- package/dist/entities/quiz-attempt.entity.js +80 -0
- package/dist/entities/quiz-attempt.entity.js.map +1 -0
- package/dist/entities/quiz-category.entity.d.ts +10 -0
- package/dist/entities/quiz-category.entity.d.ts.map +1 -0
- package/dist/entities/quiz-category.entity.js +55 -0
- package/dist/entities/quiz-category.entity.js.map +1 -0
- package/dist/entities/quiz-exam.entity.d.ts +25 -0
- package/dist/entities/quiz-exam.entity.d.ts.map +1 -0
- package/dist/entities/quiz-exam.entity.js +99 -0
- package/dist/entities/quiz-exam.entity.js.map +1 -0
- package/dist/entities/quiz-paper-question.entity.d.ts +12 -0
- package/dist/entities/quiz-paper-question.entity.d.ts.map +1 -0
- package/dist/entities/quiz-paper-question.entity.js +58 -0
- package/dist/entities/quiz-paper-question.entity.js.map +1 -0
- package/dist/entities/quiz-paper.entity.d.ts +18 -0
- package/dist/entities/quiz-paper.entity.d.ts.map +1 -0
- package/dist/entities/quiz-paper.entity.js +75 -0
- package/dist/entities/quiz-paper.entity.js.map +1 -0
- package/dist/entities/quiz-question.entity.d.ts +28 -0
- package/dist/entities/quiz-question.entity.d.ts.map +1 -0
- package/dist/entities/quiz-question.entity.js +107 -0
- package/dist/entities/quiz-question.entity.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/quiz-engine.module.d.ts +8 -0
- package/dist/quiz-engine.module.d.ts.map +1 -0
- package/dist/quiz-engine.module.js +45 -0
- package/dist/quiz-engine.module.js.map +1 -0
- package/dist/schemas/attempt.schema.d.ts +47 -0
- package/dist/schemas/attempt.schema.d.ts.map +1 -0
- package/dist/schemas/attempt.schema.js +19 -0
- package/dist/schemas/attempt.schema.js.map +1 -0
- package/dist/schemas/category.schema.d.ts +36 -0
- package/dist/schemas/category.schema.d.ts.map +1 -0
- package/dist/schemas/category.schema.js +12 -0
- package/dist/schemas/category.schema.js.map +1 -0
- package/dist/schemas/exam.schema.d.ts +70 -0
- package/dist/schemas/exam.schema.d.ts.map +1 -0
- package/dist/schemas/exam.schema.js +20 -0
- package/dist/schemas/exam.schema.js.map +1 -0
- package/dist/schemas/paper.schema.d.ts +71 -0
- package/dist/schemas/paper.schema.d.ts.map +1 -0
- package/dist/schemas/paper.schema.js +26 -0
- package/dist/schemas/paper.schema.js.map +1 -0
- package/dist/schemas/question.schema.d.ts +147 -0
- package/dist/schemas/question.schema.d.ts.map +1 -0
- package/dist/schemas/question.schema.js +32 -0
- package/dist/schemas/question.schema.js.map +1 -0
- package/dist/services/attempt.service.d.ts +33 -0
- package/dist/services/attempt.service.d.ts.map +1 -0
- package/dist/services/attempt.service.js +197 -0
- package/dist/services/attempt.service.js.map +1 -0
- package/dist/services/category.service.d.ts +14 -0
- package/dist/services/category.service.d.ts.map +1 -0
- package/dist/services/category.service.js +74 -0
- package/dist/services/category.service.js.map +1 -0
- package/dist/services/exam.service.d.ts +17 -0
- package/dist/services/exam.service.d.ts.map +1 -0
- package/dist/services/exam.service.js +92 -0
- package/dist/services/exam.service.js.map +1 -0
- package/dist/services/grade.service.d.ts +16 -0
- package/dist/services/grade.service.d.ts.map +1 -0
- package/dist/services/grade.service.js +75 -0
- package/dist/services/grade.service.js.map +1 -0
- package/dist/services/index.d.ts +8 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +18 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/paper.service.d.ts +32 -0
- package/dist/services/paper.service.d.ts.map +1 -0
- package/dist/services/paper.service.js +157 -0
- package/dist/services/paper.service.js.map +1 -0
- package/dist/services/question.service.d.ts +30 -0
- package/dist/services/question.service.d.ts.map +1 -0
- package/dist/services/question.service.js +155 -0
- package/dist/services/question.service.js.map +1 -0
- package/dist/services/statistics.service.d.ts +43 -0
- package/dist/services/statistics.service.d.ts.map +1 -0
- package/dist/services/statistics.service.js +134 -0
- package/dist/services/statistics.service.js.map +1 -0
- package/package.json +85 -0
- package/web/index.ts +51 -0
- package/web/manifest.ts +36 -0
- package/web/messages/en-US.json +143 -0
- package/web/messages/zh-CN.json +143 -0
- package/web/pages/ExamRoomPage.tsx +289 -0
- package/web/pages/ExamsPage.tsx +248 -0
- package/web/pages/PapersPage.tsx +202 -0
- package/web/pages/QuestionBankPage.tsx +263 -0
- package/web/pages/StatisticsPage.tsx +178 -0
- package/web/services/attempt-service.ts +53 -0
- package/web/services/category-service.ts +26 -0
- package/web/services/exam-service.ts +31 -0
- package/web/services/paper-service.ts +50 -0
- package/web/services/question-service.ts +36 -0
- package/web/services/statistics-service.ts +28 -0
- package/web/stores/quiz-store.ts +31 -0
- package/web/types/quiz.ts +166 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.QuizQuestion = exports.DIFFICULTY_LEVELS = exports.QUESTION_TYPES = void 0;
|
|
13
|
+
const core_1 = require("@octo-cyber/core");
|
|
14
|
+
exports.QUESTION_TYPES = [
|
|
15
|
+
'SINGLE_CHOICE',
|
|
16
|
+
'MULTIPLE_CHOICE',
|
|
17
|
+
'TRUE_FALSE',
|
|
18
|
+
'FILL_BLANK',
|
|
19
|
+
'ESSAY',
|
|
20
|
+
];
|
|
21
|
+
exports.DIFFICULTY_LEVELS = [1, 2, 3, 4, 5];
|
|
22
|
+
let QuizQuestion = class QuizQuestion {
|
|
23
|
+
id;
|
|
24
|
+
categoryId;
|
|
25
|
+
type;
|
|
26
|
+
/** 题目正文,支持 Markdown */
|
|
27
|
+
content;
|
|
28
|
+
/** 选项列表 JSON: [{ key: 'A', text: '...' }] — 仅选择题使用 */
|
|
29
|
+
options;
|
|
30
|
+
/** 正确答案 JSON: string | string[] — 单选 'A',多选 ['A','C'],判断 'true'/'false' */
|
|
31
|
+
correctAnswer;
|
|
32
|
+
/** 解析说明 */
|
|
33
|
+
explanation;
|
|
34
|
+
/** 难度 1-5 */
|
|
35
|
+
difficulty;
|
|
36
|
+
/** 标签 JSON: string[] */
|
|
37
|
+
tags;
|
|
38
|
+
/** 该题默认分值 */
|
|
39
|
+
defaultScore;
|
|
40
|
+
useCount;
|
|
41
|
+
createdBy;
|
|
42
|
+
createdAt;
|
|
43
|
+
updatedAt;
|
|
44
|
+
};
|
|
45
|
+
exports.QuizQuestion = QuizQuestion;
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, core_1.PrimaryGeneratedColumn)('uuid'),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], QuizQuestion.prototype, "id", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, core_1.Index)(),
|
|
52
|
+
(0, core_1.Column)({ type: 'varchar', length: 36, nullable: true, name: 'category_id' }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], QuizQuestion.prototype, "categoryId", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, core_1.Index)(),
|
|
57
|
+
(0, core_1.Column)({ type: 'varchar', length: 20 }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], QuizQuestion.prototype, "type", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, core_1.Column)({ type: 'text' }),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], QuizQuestion.prototype, "content", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, core_1.Column)({ type: 'text', nullable: true }),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], QuizQuestion.prototype, "options", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, core_1.Column)({ type: 'text', nullable: true, name: 'correct_answer' }),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], QuizQuestion.prototype, "correctAnswer", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, core_1.Column)({ type: 'text', nullable: true }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], QuizQuestion.prototype, "explanation", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, core_1.Column)({ type: 'int', default: 3 }),
|
|
78
|
+
__metadata("design:type", Number)
|
|
79
|
+
], QuizQuestion.prototype, "difficulty", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, core_1.Column)({ type: 'text', nullable: true }),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], QuizQuestion.prototype, "tags", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, core_1.Column)({ type: 'float', default: 1, name: 'default_score' }),
|
|
86
|
+
__metadata("design:type", Number)
|
|
87
|
+
], QuizQuestion.prototype, "defaultScore", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, core_1.Column)({ type: 'int', default: 0, name: 'use_count' }),
|
|
90
|
+
__metadata("design:type", Number)
|
|
91
|
+
], QuizQuestion.prototype, "useCount", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, core_1.Column)({ type: 'varchar', length: 36, nullable: true, name: 'created_by' }),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], QuizQuestion.prototype, "createdBy", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, core_1.CreateDateColumn)({ name: 'created_at' }),
|
|
98
|
+
__metadata("design:type", Date)
|
|
99
|
+
], QuizQuestion.prototype, "createdAt", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, core_1.UpdateDateColumn)({ name: 'updated_at' }),
|
|
102
|
+
__metadata("design:type", Date)
|
|
103
|
+
], QuizQuestion.prototype, "updatedAt", void 0);
|
|
104
|
+
exports.QuizQuestion = QuizQuestion = __decorate([
|
|
105
|
+
(0, core_1.Entity)('quiz_question')
|
|
106
|
+
], QuizQuestion);
|
|
107
|
+
//# sourceMappingURL=quiz-question.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quiz-question.entity.js","sourceRoot":"","sources":["../../src/entities/quiz-question.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAO0B;AAEb,QAAA,cAAc,GAAG;IAC5B,eAAe;IACf,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ,OAAO;CACC,CAAC;AAGE,QAAA,iBAAiB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAU,CAAC;AAInD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEvB,EAAE,CAAU;IAIZ,UAAU,CAAiB;IAI3B,IAAI,CAAU;IAEd,uBAAuB;IAEvB,OAAO,CAAU;IAEjB,sDAAsD;IAEtD,OAAO,CAAiB;IAExB,2EAA2E;IAE3E,aAAa,CAAiB;IAE9B,WAAW;IAEX,WAAW,CAAiB;IAE5B,aAAa;IAEb,UAAU,CAAU;IAEpB,wBAAwB;IAExB,IAAI,CAAiB;IAErB,aAAa;IAEb,YAAY,CAAU;IAGtB,QAAQ,CAAU;IAGlB,SAAS,CAAiB;IAG1B,SAAS,CAAQ;IAGjB,SAAS,CAAQ;CAClB,CAAA;AAnDY,oCAAY;AAEvB;IADC,IAAA,6BAAsB,EAAC,MAAM,CAAC;;wCACnB;AAIZ;IAFC,IAAA,YAAK,GAAE;IACP,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;gDAClD;AAI3B;IAFC,IAAA,YAAK,GAAE;IACP,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;0CAC1B;AAId;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACR;AAIjB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACjB;AAIxB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;;mDACnC;AAI9B;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACb;AAI5B;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gDAChB;AAIpB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACpB;AAIrB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;;kDACvC;AAGtB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;;8CACrC;AAGlB;IADC,IAAA,aAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;;+CAClD;AAG1B;IADC,IAAA,uBAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC7B,IAAI;+CAAC;AAGjB;IADC,IAAA,uBAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC7B,IAAI;+CAAC;uBAlDN,YAAY;IADxB,IAAA,aAAM,EAAC,eAAe,CAAC;GACX,YAAY,CAmDxB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @octo-cyber/quiz-engine — In-house online exam & assessment engine.
|
|
3
|
+
*
|
|
4
|
+
* Provides question bank management, smart paper generation, online exam sessions,
|
|
5
|
+
* auto grading for objective questions, manual grading for subjective questions,
|
|
6
|
+
* and statistics/ranking.
|
|
7
|
+
*/
|
|
8
|
+
export declare const version = "0.1.0";
|
|
9
|
+
export { QuizEngineModule } from './quiz-engine.module.js';
|
|
10
|
+
export { QuizCategory, QuizQuestion, QUESTION_TYPES, DIFFICULTY_LEVELS, QuizPaper, PAPER_STATUSES, QuizPaperQuestion, QuizExam, EXAM_STATUSES, QuizAttempt, ATTEMPT_STATUSES, QuizAnswer, QUIZ_ENTITIES, } from './entities/index.js';
|
|
11
|
+
export type { QuestionType, DifficultyLevel, PaperStatus, ExamStatus, AttemptStatus, } from './entities/index.js';
|
|
12
|
+
export { CategoryService, QuestionService, PaperService, ExamService, AttemptService, GradeService, StatisticsService, } from './services/index.js';
|
|
13
|
+
export type { PaperWithQuestions } from './services/paper.service.js';
|
|
14
|
+
export type { AttemptDetail } from './services/attempt.service.js';
|
|
15
|
+
export type { ExamStats, UserStats } from './services/statistics.service.js';
|
|
16
|
+
export { registerCategoryRoutes, registerQuestionRoutes, registerPaperRoutes, registerExamRoutes, registerAttemptRoutes, registerStatisticsRoutes, } from './controllers/index.js';
|
|
17
|
+
export { CreateCategorySchema, UpdateCategorySchema } from './schemas/category.schema.js';
|
|
18
|
+
export { CreateQuestionSchema, UpdateQuestionSchema, SmartGenerateSchema } from './schemas/question.schema.js';
|
|
19
|
+
export { CreatePaperSchema, UpdatePaperSchema, AddQuestionSchema } from './schemas/paper.schema.js';
|
|
20
|
+
export { CreateExamSchema, UpdateExamSchema } from './schemas/exam.schema.js';
|
|
21
|
+
export { StartAttemptSchema, SubmitAnswersSchema, GradeAnswerSchema } from './schemas/attempt.schema.js';
|
|
22
|
+
export type { CreateCategoryDto, UpdateCategoryDto } from './schemas/category.schema.js';
|
|
23
|
+
export type { CreateQuestionDto, UpdateQuestionDto, SmartGenerateDto } from './schemas/question.schema.js';
|
|
24
|
+
export type { CreatePaperDto, UpdatePaperDto, AddQuestionDto } from './schemas/paper.schema.js';
|
|
25
|
+
export type { CreateExamDto, UpdateExamDto } from './schemas/exam.schema.js';
|
|
26
|
+
export type { StartAttemptDto, SubmitAnswersDto, GradeAnswerDto } from './schemas/attempt.schema.js';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,YAAY,EACZ,eAAe,EACf,WAAW,EACX,UAAU,EACV,aAAa,GACd,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EACf,eAAe,EACf,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACZ,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAG7E,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEzG,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACzF,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC3G,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChG,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @octo-cyber/quiz-engine — In-house online exam & assessment engine.
|
|
4
|
+
*
|
|
5
|
+
* Provides question bank management, smart paper generation, online exam sessions,
|
|
6
|
+
* auto grading for objective questions, manual grading for subjective questions,
|
|
7
|
+
* and statistics/ranking.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.GradeAnswerSchema = exports.SubmitAnswersSchema = exports.StartAttemptSchema = exports.UpdateExamSchema = exports.CreateExamSchema = exports.AddQuestionSchema = exports.UpdatePaperSchema = exports.CreatePaperSchema = exports.SmartGenerateSchema = exports.UpdateQuestionSchema = exports.CreateQuestionSchema = exports.UpdateCategorySchema = exports.CreateCategorySchema = exports.registerStatisticsRoutes = exports.registerAttemptRoutes = exports.registerExamRoutes = exports.registerPaperRoutes = exports.registerQuestionRoutes = exports.registerCategoryRoutes = exports.StatisticsService = exports.GradeService = exports.AttemptService = exports.ExamService = exports.PaperService = exports.QuestionService = exports.CategoryService = exports.QUIZ_ENTITIES = exports.QuizAnswer = exports.ATTEMPT_STATUSES = exports.QuizAttempt = exports.EXAM_STATUSES = exports.QuizExam = exports.QuizPaperQuestion = exports.PAPER_STATUSES = exports.QuizPaper = exports.DIFFICULTY_LEVELS = exports.QUESTION_TYPES = exports.QuizQuestion = exports.QuizCategory = exports.QuizEngineModule = exports.version = void 0;
|
|
11
|
+
exports.version = '0.1.0';
|
|
12
|
+
// -- Module --
|
|
13
|
+
var quiz_engine_module_js_1 = require("./quiz-engine.module.js");
|
|
14
|
+
Object.defineProperty(exports, "QuizEngineModule", { enumerable: true, get: function () { return quiz_engine_module_js_1.QuizEngineModule; } });
|
|
15
|
+
// -- Entities --
|
|
16
|
+
var index_js_1 = require("./entities/index.js");
|
|
17
|
+
Object.defineProperty(exports, "QuizCategory", { enumerable: true, get: function () { return index_js_1.QuizCategory; } });
|
|
18
|
+
Object.defineProperty(exports, "QuizQuestion", { enumerable: true, get: function () { return index_js_1.QuizQuestion; } });
|
|
19
|
+
Object.defineProperty(exports, "QUESTION_TYPES", { enumerable: true, get: function () { return index_js_1.QUESTION_TYPES; } });
|
|
20
|
+
Object.defineProperty(exports, "DIFFICULTY_LEVELS", { enumerable: true, get: function () { return index_js_1.DIFFICULTY_LEVELS; } });
|
|
21
|
+
Object.defineProperty(exports, "QuizPaper", { enumerable: true, get: function () { return index_js_1.QuizPaper; } });
|
|
22
|
+
Object.defineProperty(exports, "PAPER_STATUSES", { enumerable: true, get: function () { return index_js_1.PAPER_STATUSES; } });
|
|
23
|
+
Object.defineProperty(exports, "QuizPaperQuestion", { enumerable: true, get: function () { return index_js_1.QuizPaperQuestion; } });
|
|
24
|
+
Object.defineProperty(exports, "QuizExam", { enumerable: true, get: function () { return index_js_1.QuizExam; } });
|
|
25
|
+
Object.defineProperty(exports, "EXAM_STATUSES", { enumerable: true, get: function () { return index_js_1.EXAM_STATUSES; } });
|
|
26
|
+
Object.defineProperty(exports, "QuizAttempt", { enumerable: true, get: function () { return index_js_1.QuizAttempt; } });
|
|
27
|
+
Object.defineProperty(exports, "ATTEMPT_STATUSES", { enumerable: true, get: function () { return index_js_1.ATTEMPT_STATUSES; } });
|
|
28
|
+
Object.defineProperty(exports, "QuizAnswer", { enumerable: true, get: function () { return index_js_1.QuizAnswer; } });
|
|
29
|
+
Object.defineProperty(exports, "QUIZ_ENTITIES", { enumerable: true, get: function () { return index_js_1.QUIZ_ENTITIES; } });
|
|
30
|
+
// -- Services --
|
|
31
|
+
var index_js_2 = require("./services/index.js");
|
|
32
|
+
Object.defineProperty(exports, "CategoryService", { enumerable: true, get: function () { return index_js_2.CategoryService; } });
|
|
33
|
+
Object.defineProperty(exports, "QuestionService", { enumerable: true, get: function () { return index_js_2.QuestionService; } });
|
|
34
|
+
Object.defineProperty(exports, "PaperService", { enumerable: true, get: function () { return index_js_2.PaperService; } });
|
|
35
|
+
Object.defineProperty(exports, "ExamService", { enumerable: true, get: function () { return index_js_2.ExamService; } });
|
|
36
|
+
Object.defineProperty(exports, "AttemptService", { enumerable: true, get: function () { return index_js_2.AttemptService; } });
|
|
37
|
+
Object.defineProperty(exports, "GradeService", { enumerable: true, get: function () { return index_js_2.GradeService; } });
|
|
38
|
+
Object.defineProperty(exports, "StatisticsService", { enumerable: true, get: function () { return index_js_2.StatisticsService; } });
|
|
39
|
+
// -- Controllers --
|
|
40
|
+
var index_js_3 = require("./controllers/index.js");
|
|
41
|
+
Object.defineProperty(exports, "registerCategoryRoutes", { enumerable: true, get: function () { return index_js_3.registerCategoryRoutes; } });
|
|
42
|
+
Object.defineProperty(exports, "registerQuestionRoutes", { enumerable: true, get: function () { return index_js_3.registerQuestionRoutes; } });
|
|
43
|
+
Object.defineProperty(exports, "registerPaperRoutes", { enumerable: true, get: function () { return index_js_3.registerPaperRoutes; } });
|
|
44
|
+
Object.defineProperty(exports, "registerExamRoutes", { enumerable: true, get: function () { return index_js_3.registerExamRoutes; } });
|
|
45
|
+
Object.defineProperty(exports, "registerAttemptRoutes", { enumerable: true, get: function () { return index_js_3.registerAttemptRoutes; } });
|
|
46
|
+
Object.defineProperty(exports, "registerStatisticsRoutes", { enumerable: true, get: function () { return index_js_3.registerStatisticsRoutes; } });
|
|
47
|
+
// -- Schemas --
|
|
48
|
+
var category_schema_js_1 = require("./schemas/category.schema.js");
|
|
49
|
+
Object.defineProperty(exports, "CreateCategorySchema", { enumerable: true, get: function () { return category_schema_js_1.CreateCategorySchema; } });
|
|
50
|
+
Object.defineProperty(exports, "UpdateCategorySchema", { enumerable: true, get: function () { return category_schema_js_1.UpdateCategorySchema; } });
|
|
51
|
+
var question_schema_js_1 = require("./schemas/question.schema.js");
|
|
52
|
+
Object.defineProperty(exports, "CreateQuestionSchema", { enumerable: true, get: function () { return question_schema_js_1.CreateQuestionSchema; } });
|
|
53
|
+
Object.defineProperty(exports, "UpdateQuestionSchema", { enumerable: true, get: function () { return question_schema_js_1.UpdateQuestionSchema; } });
|
|
54
|
+
Object.defineProperty(exports, "SmartGenerateSchema", { enumerable: true, get: function () { return question_schema_js_1.SmartGenerateSchema; } });
|
|
55
|
+
var paper_schema_js_1 = require("./schemas/paper.schema.js");
|
|
56
|
+
Object.defineProperty(exports, "CreatePaperSchema", { enumerable: true, get: function () { return paper_schema_js_1.CreatePaperSchema; } });
|
|
57
|
+
Object.defineProperty(exports, "UpdatePaperSchema", { enumerable: true, get: function () { return paper_schema_js_1.UpdatePaperSchema; } });
|
|
58
|
+
Object.defineProperty(exports, "AddQuestionSchema", { enumerable: true, get: function () { return paper_schema_js_1.AddQuestionSchema; } });
|
|
59
|
+
var exam_schema_js_1 = require("./schemas/exam.schema.js");
|
|
60
|
+
Object.defineProperty(exports, "CreateExamSchema", { enumerable: true, get: function () { return exam_schema_js_1.CreateExamSchema; } });
|
|
61
|
+
Object.defineProperty(exports, "UpdateExamSchema", { enumerable: true, get: function () { return exam_schema_js_1.UpdateExamSchema; } });
|
|
62
|
+
var attempt_schema_js_1 = require("./schemas/attempt.schema.js");
|
|
63
|
+
Object.defineProperty(exports, "StartAttemptSchema", { enumerable: true, get: function () { return attempt_schema_js_1.StartAttemptSchema; } });
|
|
64
|
+
Object.defineProperty(exports, "SubmitAnswersSchema", { enumerable: true, get: function () { return attempt_schema_js_1.SubmitAnswersSchema; } });
|
|
65
|
+
Object.defineProperty(exports, "GradeAnswerSchema", { enumerable: true, get: function () { return attempt_schema_js_1.GradeAnswerSchema; } });
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEU,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B,eAAe;AACf,iEAA2D;AAAlD,yHAAA,gBAAgB,OAAA;AAEzB,iBAAiB;AACjB,gDAc6B;AAb3B,wGAAA,YAAY,OAAA;AACZ,wGAAA,YAAY,OAAA;AACZ,0GAAA,cAAc,OAAA;AACd,6GAAA,iBAAiB,OAAA;AACjB,qGAAA,SAAS,OAAA;AACT,0GAAA,cAAc,OAAA;AACd,6GAAA,iBAAiB,OAAA;AACjB,oGAAA,QAAQ,OAAA;AACR,yGAAA,aAAa,OAAA;AACb,uGAAA,WAAW,OAAA;AACX,4GAAA,gBAAgB,OAAA;AAChB,sGAAA,UAAU,OAAA;AACV,yGAAA,aAAa,OAAA;AAWf,iBAAiB;AACjB,gDAQ6B;AAP3B,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,uGAAA,WAAW,OAAA;AACX,0GAAA,cAAc,OAAA;AACd,wGAAA,YAAY,OAAA;AACZ,6GAAA,iBAAiB,OAAA;AAOnB,oBAAoB;AACpB,mDAOgC;AAN9B,kHAAA,sBAAsB,OAAA;AACtB,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AACnB,8GAAA,kBAAkB,OAAA;AAClB,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AAG1B,gBAAgB;AAChB,mEAA0F;AAAjF,0HAAA,oBAAoB,OAAA;AAAE,0HAAA,oBAAoB,OAAA;AACnD,mEAA+G;AAAtG,0HAAA,oBAAoB,OAAA;AAAE,0HAAA,oBAAoB,OAAA;AAAE,yHAAA,mBAAmB,OAAA;AACxE,6DAAoG;AAA3F,oHAAA,iBAAiB,OAAA;AAAE,oHAAA,iBAAiB,OAAA;AAAE,oHAAA,iBAAiB,OAAA;AAChE,2DAA8E;AAArE,kHAAA,gBAAgB,OAAA;AAAE,kHAAA,gBAAgB,OAAA;AAC3C,iEAAyG;AAAhG,uHAAA,kBAAkB,OAAA;AAAE,wHAAA,mBAAmB,OAAA;AAAE,sHAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IModule, IModuleContext, Express } from '@octo-cyber/core';
|
|
2
|
+
export declare class QuizEngineModule implements IModule {
|
|
3
|
+
readonly name = "quiz-engine";
|
|
4
|
+
readonly entities: (typeof import("./entities/quiz-category.entity.js").QuizCategory | typeof import("./entities/quiz-question.entity.js").QuizQuestion | typeof import("./entities/quiz-paper.entity.js").QuizPaper | typeof import("./entities/quiz-paper-question.entity.js").QuizPaperQuestion | typeof import("./entities/quiz-exam.entity.js").QuizExam | typeof import("./entities/quiz-attempt.entity.js").QuizAttempt | typeof import("./entities/quiz-answer.entity.js").QuizAnswer)[];
|
|
5
|
+
initialize(_context: IModuleContext): void;
|
|
6
|
+
registerRoutes(app: Express, _context: IModuleContext): void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=quiz-engine.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quiz-engine.module.d.ts","sourceRoot":"","sources":["../src/quiz-engine.module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAgBzE,qBAAa,gBAAiB,YAAW,OAAO;IAC9C,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,QAAQ,gdAAsB;IAEvC,UAAU,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAa1C,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI;CAW7D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuizEngineModule = void 0;
|
|
4
|
+
const core_1 = require("@octo-cyber/core");
|
|
5
|
+
const index_js_1 = require("./entities/index.js");
|
|
6
|
+
const category_service_js_1 = require("./services/category.service.js");
|
|
7
|
+
const question_service_js_1 = require("./services/question.service.js");
|
|
8
|
+
const paper_service_js_1 = require("./services/paper.service.js");
|
|
9
|
+
const exam_service_js_1 = require("./services/exam.service.js");
|
|
10
|
+
const attempt_service_js_1 = require("./services/attempt.service.js");
|
|
11
|
+
const grade_service_js_1 = require("./services/grade.service.js");
|
|
12
|
+
const statistics_service_js_1 = require("./services/statistics.service.js");
|
|
13
|
+
const category_controller_js_1 = require("./controllers/category.controller.js");
|
|
14
|
+
const question_controller_js_1 = require("./controllers/question.controller.js");
|
|
15
|
+
const paper_controller_js_1 = require("./controllers/paper.controller.js");
|
|
16
|
+
const exam_controller_js_1 = require("./controllers/exam.controller.js");
|
|
17
|
+
const attempt_controller_js_1 = require("./controllers/attempt.controller.js");
|
|
18
|
+
const statistics_controller_js_1 = require("./controllers/statistics.controller.js");
|
|
19
|
+
class QuizEngineModule {
|
|
20
|
+
name = 'quiz-engine';
|
|
21
|
+
entities = [...index_js_1.QUIZ_ENTITIES];
|
|
22
|
+
initialize(_context) {
|
|
23
|
+
core_1.Container.get(category_service_js_1.CategoryService).initialize();
|
|
24
|
+
core_1.Container.get(question_service_js_1.QuestionService).initialize();
|
|
25
|
+
core_1.Container.get(paper_service_js_1.PaperService).initialize();
|
|
26
|
+
core_1.Container.get(exam_service_js_1.ExamService).initialize();
|
|
27
|
+
core_1.Container.get(attempt_service_js_1.AttemptService).initialize();
|
|
28
|
+
core_1.Container.get(grade_service_js_1.GradeService).initialize();
|
|
29
|
+
core_1.Container.get(statistics_service_js_1.StatisticsService).initialize();
|
|
30
|
+
const logger = core_1.Container.get(core_1.LoggerService);
|
|
31
|
+
logger.info('[QuizEngineModule] initialized (7 entities, 7 services)');
|
|
32
|
+
}
|
|
33
|
+
registerRoutes(app, _context) {
|
|
34
|
+
(0, category_controller_js_1.registerCategoryRoutes)(app);
|
|
35
|
+
(0, question_controller_js_1.registerQuestionRoutes)(app);
|
|
36
|
+
(0, paper_controller_js_1.registerPaperRoutes)(app);
|
|
37
|
+
(0, exam_controller_js_1.registerExamRoutes)(app);
|
|
38
|
+
(0, attempt_controller_js_1.registerAttemptRoutes)(app);
|
|
39
|
+
(0, statistics_controller_js_1.registerStatisticsRoutes)(app);
|
|
40
|
+
const logger = core_1.Container.get(core_1.LoggerService);
|
|
41
|
+
logger.info('[QuizEngineModule] routes registered (6 controllers)');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.QuizEngineModule = QuizEngineModule;
|
|
45
|
+
//# sourceMappingURL=quiz-engine.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quiz-engine.module.js","sourceRoot":"","sources":["../src/quiz-engine.module.ts"],"names":[],"mappings":";;;AAAA,2CAA4D;AAE5D,kDAAoD;AACpD,wEAAiE;AACjE,wEAAiE;AACjE,kEAA2D;AAC3D,gEAAyD;AACzD,sEAA+D;AAC/D,kEAA2D;AAC3D,4EAAqE;AACrE,iFAA8E;AAC9E,iFAA8E;AAC9E,2EAAwE;AACxE,yEAAsE;AACtE,+EAA4E;AAC5E,qFAAkF;AAElF,MAAa,gBAAgB;IAClB,IAAI,GAAG,aAAa,CAAC;IACrB,QAAQ,GAAG,CAAC,GAAG,wBAAa,CAAC,CAAC;IAEvC,UAAU,CAAC,QAAwB;QACjC,gBAAS,CAAC,GAAG,CAAC,qCAAe,CAAC,CAAC,UAAU,EAAE,CAAC;QAC5C,gBAAS,CAAC,GAAG,CAAC,qCAAe,CAAC,CAAC,UAAU,EAAE,CAAC;QAC5C,gBAAS,CAAC,GAAG,CAAC,+BAAY,CAAC,CAAC,UAAU,EAAE,CAAC;QACzC,gBAAS,CAAC,GAAG,CAAC,6BAAW,CAAC,CAAC,UAAU,EAAE,CAAC;QACxC,gBAAS,CAAC,GAAG,CAAC,mCAAc,CAAC,CAAC,UAAU,EAAE,CAAC;QAC3C,gBAAS,CAAC,GAAG,CAAC,+BAAY,CAAC,CAAC,UAAU,EAAE,CAAC;QACzC,gBAAS,CAAC,GAAG,CAAC,yCAAiB,CAAC,CAAC,UAAU,EAAE,CAAC;QAE9C,MAAM,MAAM,GAAG,gBAAS,CAAC,GAAG,CAAC,oBAAa,CAAC,CAAC;QAC5C,MAAM,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;IACzE,CAAC;IAED,cAAc,CAAC,GAAY,EAAE,QAAwB;QACnD,IAAA,+CAAsB,EAAC,GAAG,CAAC,CAAC;QAC5B,IAAA,+CAAsB,EAAC,GAAG,CAAC,CAAC;QAC5B,IAAA,yCAAmB,EAAC,GAAG,CAAC,CAAC;QACzB,IAAA,uCAAkB,EAAC,GAAG,CAAC,CAAC;QACxB,IAAA,6CAAqB,EAAC,GAAG,CAAC,CAAC;QAC3B,IAAA,mDAAwB,EAAC,GAAG,CAAC,CAAC;QAE9B,MAAM,MAAM,GAAG,gBAAS,CAAC,GAAG,CAAC,oBAAa,CAAC,CAAC;QAC5C,MAAM,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;IACtE,CAAC;CACF;AA5BD,4CA4BC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const StartAttemptSchema: z.ZodObject<{
|
|
3
|
+
examId: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
examId?: string;
|
|
6
|
+
}, {
|
|
7
|
+
examId?: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const SubmitAnswersSchema: z.ZodObject<{
|
|
10
|
+
answers: z.ZodArray<z.ZodObject<{
|
|
11
|
+
questionId: z.ZodString;
|
|
12
|
+
userAnswer: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodNull]>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
questionId?: string;
|
|
15
|
+
userAnswer?: string | string[];
|
|
16
|
+
}, {
|
|
17
|
+
questionId?: string;
|
|
18
|
+
userAnswer?: string | string[];
|
|
19
|
+
}>, "many">;
|
|
20
|
+
timeUsedSeconds: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
timeUsedSeconds?: number;
|
|
23
|
+
answers?: {
|
|
24
|
+
questionId?: string;
|
|
25
|
+
userAnswer?: string | string[];
|
|
26
|
+
}[];
|
|
27
|
+
}, {
|
|
28
|
+
timeUsedSeconds?: number;
|
|
29
|
+
answers?: {
|
|
30
|
+
questionId?: string;
|
|
31
|
+
userAnswer?: string | string[];
|
|
32
|
+
}[];
|
|
33
|
+
}>;
|
|
34
|
+
export declare const GradeAnswerSchema: z.ZodObject<{
|
|
35
|
+
score: z.ZodNumber;
|
|
36
|
+
feedback: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
score?: number;
|
|
39
|
+
feedback?: string;
|
|
40
|
+
}, {
|
|
41
|
+
score?: number;
|
|
42
|
+
feedback?: string;
|
|
43
|
+
}>;
|
|
44
|
+
export type StartAttemptDto = z.infer<typeof StartAttemptSchema>;
|
|
45
|
+
export type SubmitAnswersDto = z.infer<typeof SubmitAnswersSchema>;
|
|
46
|
+
export type GradeAnswerDto = z.infer<typeof GradeAnswerSchema>;
|
|
47
|
+
//# sourceMappingURL=attempt.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attempt.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/attempt.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACjE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACnE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GradeAnswerSchema = exports.SubmitAnswersSchema = exports.StartAttemptSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.StartAttemptSchema = zod_1.z.object({
|
|
6
|
+
examId: zod_1.z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
exports.SubmitAnswersSchema = zod_1.z.object({
|
|
9
|
+
answers: zod_1.z.array(zod_1.z.object({
|
|
10
|
+
questionId: zod_1.z.string().uuid(),
|
|
11
|
+
userAnswer: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string()), zod_1.z.null()]),
|
|
12
|
+
})),
|
|
13
|
+
timeUsedSeconds: zod_1.z.number().int().min(0).optional(),
|
|
14
|
+
});
|
|
15
|
+
exports.GradeAnswerSchema = zod_1.z.object({
|
|
16
|
+
score: zod_1.z.number().min(0),
|
|
17
|
+
feedback: zod_1.z.string().nullable().optional(),
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=attempt.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attempt.schema.js","sourceRoot":"","sources":["../../src/schemas/attempt.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAC1B,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC;QACxB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;QAC7B,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,EAAE,OAAC,CAAC,IAAI,EAAE,CAAC,CAAC;KACjE,CAAC,CAAC;IACH,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CreateCategorySchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
name?: string;
|
|
9
|
+
parentId?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
sortOrder?: number;
|
|
12
|
+
}, {
|
|
13
|
+
name?: string;
|
|
14
|
+
parentId?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
sortOrder?: number;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const UpdateCategorySchema: z.ZodObject<{
|
|
19
|
+
name: z.ZodOptional<z.ZodString>;
|
|
20
|
+
parentId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
21
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
22
|
+
sortOrder: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
name?: string;
|
|
25
|
+
parentId?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
sortOrder?: number;
|
|
28
|
+
}, {
|
|
29
|
+
name?: string;
|
|
30
|
+
parentId?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
sortOrder?: number;
|
|
33
|
+
}>;
|
|
34
|
+
export type CreateCategoryDto = z.infer<typeof CreateCategorySchema>;
|
|
35
|
+
export type UpdateCategoryDto = z.infer<typeof UpdateCategorySchema>;
|
|
36
|
+
//# sourceMappingURL=category.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/category.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAAiC,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateCategorySchema = exports.CreateCategorySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.CreateCategorySchema = zod_1.z.object({
|
|
6
|
+
name: zod_1.z.string().min(1).max(128),
|
|
7
|
+
parentId: zod_1.z.string().uuid().nullable().optional(),
|
|
8
|
+
description: zod_1.z.string().max(1000).nullable().optional(),
|
|
9
|
+
sortOrder: zod_1.z.number().int().min(0).optional(),
|
|
10
|
+
});
|
|
11
|
+
exports.UpdateCategorySchema = exports.CreateCategorySchema.partial();
|
|
12
|
+
//# sourceMappingURL=category.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.schema.js","sourceRoot":"","sources":["../../src/schemas/category.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACjD,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACvD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,4BAAoB,CAAC,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CreateExamSchema: z.ZodObject<{
|
|
3
|
+
title: z.ZodString;
|
|
4
|
+
paperId: z.ZodString;
|
|
5
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
startTime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
endTime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
maxAttempts: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
shuffleQuestions: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
shuffleOptions: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
showAnswerAfterSubmit: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
description?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
paperId?: string;
|
|
16
|
+
startTime?: string;
|
|
17
|
+
endTime?: string;
|
|
18
|
+
maxAttempts?: number;
|
|
19
|
+
shuffleQuestions?: boolean;
|
|
20
|
+
shuffleOptions?: boolean;
|
|
21
|
+
showAnswerAfterSubmit?: boolean;
|
|
22
|
+
}, {
|
|
23
|
+
description?: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
paperId?: string;
|
|
26
|
+
startTime?: string;
|
|
27
|
+
endTime?: string;
|
|
28
|
+
maxAttempts?: number;
|
|
29
|
+
shuffleQuestions?: boolean;
|
|
30
|
+
shuffleOptions?: boolean;
|
|
31
|
+
showAnswerAfterSubmit?: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const UpdateExamSchema: z.ZodObject<{
|
|
34
|
+
title: z.ZodOptional<z.ZodString>;
|
|
35
|
+
paperId: z.ZodOptional<z.ZodString>;
|
|
36
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
37
|
+
startTime: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
38
|
+
endTime: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
39
|
+
maxAttempts: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
40
|
+
shuffleQuestions: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
41
|
+
shuffleOptions: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
42
|
+
showAnswerAfterSubmit: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
43
|
+
} & {
|
|
44
|
+
status: z.ZodOptional<z.ZodEnum<["DRAFT", "SCHEDULED", "ONGOING", "ENDED", "CANCELLED"]>>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
description?: string;
|
|
47
|
+
title?: string;
|
|
48
|
+
status?: "DRAFT" | "SCHEDULED" | "ONGOING" | "ENDED" | "CANCELLED";
|
|
49
|
+
paperId?: string;
|
|
50
|
+
startTime?: string;
|
|
51
|
+
endTime?: string;
|
|
52
|
+
maxAttempts?: number;
|
|
53
|
+
shuffleQuestions?: boolean;
|
|
54
|
+
shuffleOptions?: boolean;
|
|
55
|
+
showAnswerAfterSubmit?: boolean;
|
|
56
|
+
}, {
|
|
57
|
+
description?: string;
|
|
58
|
+
title?: string;
|
|
59
|
+
status?: "DRAFT" | "SCHEDULED" | "ONGOING" | "ENDED" | "CANCELLED";
|
|
60
|
+
paperId?: string;
|
|
61
|
+
startTime?: string;
|
|
62
|
+
endTime?: string;
|
|
63
|
+
maxAttempts?: number;
|
|
64
|
+
shuffleQuestions?: boolean;
|
|
65
|
+
shuffleOptions?: boolean;
|
|
66
|
+
showAnswerAfterSubmit?: boolean;
|
|
67
|
+
}>;
|
|
68
|
+
export type CreateExamDto = z.infer<typeof CreateExamSchema>;
|
|
69
|
+
export type UpdateExamDto = z.infer<typeof UpdateExamSchema>;
|
|
70
|
+
//# sourceMappingURL=exam.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exam.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/exam.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU3B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE3B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateExamSchema = exports.CreateExamSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const quiz_exam_entity_js_1 = require("../entities/quiz-exam.entity.js");
|
|
6
|
+
exports.CreateExamSchema = zod_1.z.object({
|
|
7
|
+
title: zod_1.z.string().min(1).max(256),
|
|
8
|
+
paperId: zod_1.z.string().uuid(),
|
|
9
|
+
description: zod_1.z.string().nullable().optional(),
|
|
10
|
+
startTime: zod_1.z.string().datetime().nullable().optional(),
|
|
11
|
+
endTime: zod_1.z.string().datetime().nullable().optional(),
|
|
12
|
+
maxAttempts: zod_1.z.number().int().min(0).default(1),
|
|
13
|
+
shuffleQuestions: zod_1.z.boolean().default(false),
|
|
14
|
+
shuffleOptions: zod_1.z.boolean().default(false),
|
|
15
|
+
showAnswerAfterSubmit: zod_1.z.boolean().default(false),
|
|
16
|
+
});
|
|
17
|
+
exports.UpdateExamSchema = exports.CreateExamSchema.partial().extend({
|
|
18
|
+
status: zod_1.z.enum(quiz_exam_entity_js_1.EXAM_STATUSES).optional(),
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=exam.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exam.schema.js","sourceRoot":"","sources":["../../src/schemas/exam.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,yEAAgE;AAEnD,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACjC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC1B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC7C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACtD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACpD,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,gBAAgB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC5C,cAAc,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC1C,qBAAqB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CAClD,CAAC,CAAC;AAEU,QAAA,gBAAgB,GAAG,wBAAgB,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC;IAChE,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,mCAAa,CAAC,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CreatePaperSchema: z.ZodObject<{
|
|
3
|
+
title: z.ZodString;
|
|
4
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
passingScore: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
timeLimit: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
description?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
passingScore?: number;
|
|
11
|
+
timeLimit?: number;
|
|
12
|
+
}, {
|
|
13
|
+
description?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
passingScore?: number;
|
|
16
|
+
timeLimit?: number;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const UpdatePaperSchema: z.ZodObject<{
|
|
19
|
+
title: z.ZodOptional<z.ZodString>;
|
|
20
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
21
|
+
passingScore: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
22
|
+
timeLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
23
|
+
} & {
|
|
24
|
+
status: z.ZodOptional<z.ZodEnum<["DRAFT", "PUBLISHED", "ARCHIVED"]>>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
description?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
passingScore?: number;
|
|
29
|
+
timeLimit?: number;
|
|
30
|
+
status?: "DRAFT" | "PUBLISHED" | "ARCHIVED";
|
|
31
|
+
}, {
|
|
32
|
+
description?: string;
|
|
33
|
+
title?: string;
|
|
34
|
+
passingScore?: number;
|
|
35
|
+
timeLimit?: number;
|
|
36
|
+
status?: "DRAFT" | "PUBLISHED" | "ARCHIVED";
|
|
37
|
+
}>;
|
|
38
|
+
export declare const AddQuestionSchema: z.ZodObject<{
|
|
39
|
+
questionId: z.ZodString;
|
|
40
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
sectionTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
sortOrder?: number;
|
|
45
|
+
questionId?: string;
|
|
46
|
+
score?: number;
|
|
47
|
+
sectionTitle?: string;
|
|
48
|
+
}, {
|
|
49
|
+
sortOrder?: number;
|
|
50
|
+
questionId?: string;
|
|
51
|
+
score?: number;
|
|
52
|
+
sectionTitle?: string;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const UpdatePaperQuestionSchema: z.ZodObject<{
|
|
55
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
sectionTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
sortOrder?: number;
|
|
60
|
+
score?: number;
|
|
61
|
+
sectionTitle?: string;
|
|
62
|
+
}, {
|
|
63
|
+
sortOrder?: number;
|
|
64
|
+
score?: number;
|
|
65
|
+
sectionTitle?: string;
|
|
66
|
+
}>;
|
|
67
|
+
export type CreatePaperDto = z.infer<typeof CreatePaperSchema>;
|
|
68
|
+
export type UpdatePaperDto = z.infer<typeof UpdatePaperSchema>;
|
|
69
|
+
export type AddQuestionDto = z.infer<typeof AddQuestionSchema>;
|
|
70
|
+
export type UpdatePaperQuestionDto = z.infer<typeof UpdatePaperQuestionSchema>;
|
|
71
|
+
//# sourceMappingURL=paper.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paper.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/paper.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;EAE5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAIpC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC/D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC/D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC/D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatePaperQuestionSchema = exports.AddQuestionSchema = exports.UpdatePaperSchema = exports.CreatePaperSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const quiz_paper_entity_js_1 = require("../entities/quiz-paper.entity.js");
|
|
6
|
+
exports.CreatePaperSchema = zod_1.z.object({
|
|
7
|
+
title: zod_1.z.string().min(1).max(256),
|
|
8
|
+
description: zod_1.z.string().nullable().optional(),
|
|
9
|
+
passingScore: zod_1.z.number().min(0).default(60),
|
|
10
|
+
timeLimit: zod_1.z.number().int().min(0).default(0),
|
|
11
|
+
});
|
|
12
|
+
exports.UpdatePaperSchema = exports.CreatePaperSchema.partial().extend({
|
|
13
|
+
status: zod_1.z.enum(quiz_paper_entity_js_1.PAPER_STATUSES).optional(),
|
|
14
|
+
});
|
|
15
|
+
exports.AddQuestionSchema = zod_1.z.object({
|
|
16
|
+
questionId: zod_1.z.string().uuid(),
|
|
17
|
+
score: zod_1.z.number().min(0).optional(),
|
|
18
|
+
sortOrder: zod_1.z.number().int().min(0).optional(),
|
|
19
|
+
sectionTitle: zod_1.z.string().max(128).nullable().optional(),
|
|
20
|
+
});
|
|
21
|
+
exports.UpdatePaperQuestionSchema = zod_1.z.object({
|
|
22
|
+
score: zod_1.z.number().min(0).optional(),
|
|
23
|
+
sortOrder: zod_1.z.number().int().min(0).optional(),
|
|
24
|
+
sectionTitle: zod_1.z.string().max(128).nullable().optional(),
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=paper.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paper.schema.js","sourceRoot":"","sources":["../../src/schemas/paper.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2EAAkE;AAErD,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACjC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC7C,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CAC9C,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,yBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC;IAClE,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,qCAAc,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC7B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACxD,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACxD,CAAC,CAAC"}
|