@hed-hog/lms 0.0.304 → 0.0.306
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/README.md +413 -401
- package/dist/certificate/certificate.controller.d.ts +90 -0
- package/dist/certificate/certificate.controller.d.ts.map +1 -0
- package/dist/certificate/certificate.controller.js +121 -0
- package/dist/certificate/certificate.controller.js.map +1 -0
- package/dist/certificate/certificate.module.d.ts +3 -0
- package/dist/certificate/certificate.module.d.ts.map +1 -0
- package/dist/certificate/certificate.module.js +26 -0
- package/dist/certificate/certificate.module.js.map +1 -0
- package/dist/certificate/certificate.service.d.ts +115 -0
- package/dist/certificate/certificate.service.d.ts.map +1 -0
- package/dist/certificate/certificate.service.js +343 -0
- package/dist/certificate/certificate.service.js.map +1 -0
- package/dist/certificate/dto/create-certificate-template.dto.d.ts +8 -0
- package/dist/certificate/dto/create-certificate-template.dto.d.ts.map +1 -0
- package/dist/certificate/dto/create-certificate-template.dto.js +44 -0
- package/dist/certificate/dto/create-certificate-template.dto.js.map +1 -0
- package/dist/certificate/dto/update-certificate-template.dto.d.ts +6 -0
- package/dist/certificate/dto/update-certificate-template.dto.d.ts.map +1 -0
- package/dist/certificate/dto/update-certificate-template.dto.js +9 -0
- package/dist/certificate/dto/update-certificate-template.dto.js.map +1 -0
- package/dist/class-group/class-group.controller.d.ts +305 -0
- package/dist/class-group/class-group.controller.d.ts.map +1 -0
- package/dist/class-group/class-group.controller.js +257 -0
- package/dist/class-group/class-group.controller.js.map +1 -0
- package/dist/class-group/class-group.module.d.ts +3 -0
- package/dist/class-group/class-group.module.d.ts.map +1 -0
- package/dist/class-group/class-group.module.js +25 -0
- package/dist/class-group/class-group.module.js.map +1 -0
- package/dist/class-group/class-group.service.d.ts +354 -0
- package/dist/class-group/class-group.service.d.ts.map +1 -0
- package/dist/class-group/class-group.service.js +1356 -0
- package/dist/class-group/class-group.service.js.map +1 -0
- package/dist/class-group/dto/create-class-group.dto.d.ts +33 -0
- package/dist/class-group/dto/create-class-group.dto.d.ts.map +1 -0
- package/dist/class-group/dto/create-class-group.dto.js +165 -0
- package/dist/class-group/dto/create-class-group.dto.js.map +1 -0
- package/dist/class-group/dto/create-session.dto.d.ts +22 -0
- package/dist/class-group/dto/create-session.dto.d.ts.map +1 -0
- package/dist/class-group/dto/create-session.dto.js +117 -0
- package/dist/class-group/dto/create-session.dto.js.map +1 -0
- package/dist/class-group/dto/enrollment.dto.d.ts +22 -0
- package/dist/class-group/dto/enrollment.dto.d.ts.map +1 -0
- package/dist/class-group/dto/enrollment.dto.js +89 -0
- package/dist/class-group/dto/enrollment.dto.js.map +1 -0
- package/dist/class-group/dto/update-class-group.dto.d.ts +6 -0
- package/dist/class-group/dto/update-class-group.dto.d.ts.map +1 -0
- package/dist/class-group/dto/update-class-group.dto.js +9 -0
- package/dist/class-group/dto/update-class-group.dto.js.map +1 -0
- package/dist/class-group/dto/update-session.dto.d.ts +7 -0
- package/dist/class-group/dto/update-session.dto.d.ts.map +1 -0
- package/dist/class-group/dto/update-session.dto.js +24 -0
- package/dist/class-group/dto/update-session.dto.js.map +1 -0
- package/dist/course/course-structure.controller.d.ts +127 -0
- package/dist/course/course-structure.controller.d.ts.map +1 -0
- package/dist/course/course-structure.controller.js +115 -0
- package/dist/course/course-structure.controller.js.map +1 -0
- package/dist/course/course-structure.service.d.ts +142 -0
- package/dist/course/course-structure.service.d.ts.map +1 -0
- package/dist/course/course-structure.service.js +445 -0
- package/dist/course/course-structure.service.js.map +1 -0
- package/dist/course/course.controller.d.ts +195 -0
- package/dist/course/course.controller.d.ts.map +1 -0
- package/dist/course/course.controller.js +104 -0
- package/dist/course/course.controller.js.map +1 -0
- package/dist/course/course.module.d.ts +3 -0
- package/dist/course/course.module.d.ts.map +1 -0
- package/dist/course/course.module.js +28 -0
- package/dist/course/course.module.js.map +1 -0
- package/dist/course/course.service.d.ts +215 -0
- package/dist/course/course.service.d.ts.map +1 -0
- package/dist/course/course.service.js +743 -0
- package/dist/course/course.service.js.map +1 -0
- package/dist/course/dto/create-course-structure-lesson.dto.d.ts +24 -0
- package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -0
- package/dist/course/dto/create-course-structure-lesson.dto.js +118 -0
- package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -0
- package/dist/course/dto/create-course-structure-session.dto.d.ts +7 -0
- package/dist/course/dto/create-course-structure-session.dto.d.ts.map +1 -0
- package/dist/course/dto/create-course-structure-session.dto.js +40 -0
- package/dist/course/dto/create-course-structure-session.dto.js.map +1 -0
- package/dist/course/dto/create-course.dto.d.ts +26 -0
- package/dist/course/dto/create-course.dto.d.ts.map +1 -0
- package/dist/course/dto/create-course.dto.js +138 -0
- package/dist/course/dto/create-course.dto.js.map +1 -0
- package/dist/course/dto/update-course-structure-lesson.dto.d.ts +6 -0
- package/dist/course/dto/update-course-structure-lesson.dto.d.ts.map +1 -0
- package/dist/course/dto/update-course-structure-lesson.dto.js +9 -0
- package/dist/course/dto/update-course-structure-lesson.dto.js.map +1 -0
- package/dist/course/dto/update-course-structure-session.dto.d.ts +6 -0
- package/dist/course/dto/update-course-structure-session.dto.d.ts.map +1 -0
- package/dist/course/dto/update-course-structure-session.dto.js +9 -0
- package/dist/course/dto/update-course-structure-session.dto.js.map +1 -0
- package/dist/course/dto/update-course.dto.d.ts +6 -0
- package/dist/course/dto/update-course.dto.d.ts.map +1 -0
- package/dist/course/dto/update-course.dto.js +9 -0
- package/dist/course/dto/update-course.dto.js.map +1 -0
- package/dist/dashboard/dashboard.controller.d.ts +101 -0
- package/dist/dashboard/dashboard.controller.d.ts.map +1 -0
- package/dist/dashboard/dashboard.controller.js +40 -0
- package/dist/dashboard/dashboard.controller.js.map +1 -0
- package/dist/dashboard/dashboard.module.d.ts +3 -0
- package/dist/dashboard/dashboard.module.d.ts.map +1 -0
- package/dist/dashboard/dashboard.module.js +25 -0
- package/dist/dashboard/dashboard.module.js.map +1 -0
- package/dist/dashboard/dashboard.service.d.ts +130 -0
- package/dist/dashboard/dashboard.service.d.ts.map +1 -0
- package/dist/dashboard/dashboard.service.js +626 -0
- package/dist/dashboard/dashboard.service.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.d.ts +4 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.js +22 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.d.ts +5 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.js +27 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.d.ts +5 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.js +27 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.d.ts +7 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.js +36 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.js.map +1 -0
- package/dist/enterprise/dto/create-enterprise.dto.d.ts +10 -0
- package/dist/enterprise/dto/create-enterprise.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/create-enterprise.dto.js +54 -0
- package/dist/enterprise/dto/create-enterprise.dto.js.map +1 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.d.ts +4 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.js +22 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.js.map +1 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.d.ts +5 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.js +27 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.js.map +1 -0
- package/dist/enterprise/dto/update-enterprise.dto.d.ts +6 -0
- package/dist/enterprise/dto/update-enterprise.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/update-enterprise.dto.js +9 -0
- package/dist/enterprise/dto/update-enterprise.dto.js.map +1 -0
- package/dist/enterprise/enterprise.controller.d.ts +269 -0
- package/dist/enterprise/enterprise.controller.d.ts.map +1 -0
- package/dist/enterprise/enterprise.controller.js +311 -0
- package/dist/enterprise/enterprise.controller.js.map +1 -0
- package/dist/enterprise/enterprise.module.d.ts +3 -0
- package/dist/enterprise/enterprise.module.d.ts.map +1 -0
- package/dist/enterprise/enterprise.module.js +25 -0
- package/dist/enterprise/enterprise.module.js.map +1 -0
- package/dist/enterprise/enterprise.service.d.ts +282 -0
- package/dist/enterprise/enterprise.service.d.ts.map +1 -0
- package/dist/enterprise/enterprise.service.js +627 -0
- package/dist/enterprise/enterprise.service.js.map +1 -0
- package/dist/evaluation/evaluation.controller.d.ts +56 -0
- package/dist/evaluation/evaluation.controller.d.ts.map +1 -0
- package/dist/evaluation/evaluation.controller.js +76 -0
- package/dist/evaluation/evaluation.controller.js.map +1 -0
- package/dist/evaluation/evaluation.module.d.ts +3 -0
- package/dist/evaluation/evaluation.module.d.ts.map +1 -0
- package/dist/evaluation/evaluation.module.js +25 -0
- package/dist/evaluation/evaluation.module.js.map +1 -0
- package/dist/evaluation/evaluation.service.d.ts +67 -0
- package/dist/evaluation/evaluation.service.d.ts.map +1 -0
- package/dist/evaluation/evaluation.service.js +378 -0
- package/dist/evaluation/evaluation.service.js.map +1 -0
- package/dist/exam/dto/create-exam-question.dto.d.ts +25 -0
- package/dist/exam/dto/create-exam-question.dto.d.ts.map +1 -0
- package/dist/exam/dto/create-exam-question.dto.js +117 -0
- package/dist/exam/dto/create-exam-question.dto.js.map +1 -0
- package/dist/exam/dto/create-exam.dto.d.ts +11 -0
- package/dist/exam/dto/create-exam.dto.d.ts.map +1 -0
- package/dist/exam/dto/create-exam.dto.js +63 -0
- package/dist/exam/dto/create-exam.dto.js.map +1 -0
- package/dist/exam/dto/reorder-exam-questions.dto.d.ts +4 -0
- package/dist/exam/dto/reorder-exam-questions.dto.d.ts.map +1 -0
- package/dist/exam/dto/reorder-exam-questions.dto.js +23 -0
- package/dist/exam/dto/reorder-exam-questions.dto.js.map +1 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.d.ts +14 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.d.ts.map +1 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.js +68 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.js.map +1 -0
- package/dist/exam/dto/start-exam-attempt.dto.d.ts +4 -0
- package/dist/exam/dto/start-exam-attempt.dto.d.ts.map +1 -0
- package/dist/exam/dto/start-exam-attempt.dto.js +23 -0
- package/dist/exam/dto/start-exam-attempt.dto.js.map +1 -0
- package/dist/exam/dto/submit-exam-attempt.dto.d.ts +5 -0
- package/dist/exam/dto/submit-exam-attempt.dto.d.ts.map +1 -0
- package/dist/exam/dto/submit-exam-attempt.dto.js +23 -0
- package/dist/exam/dto/submit-exam-attempt.dto.js.map +1 -0
- package/dist/exam/dto/update-exam-question.dto.d.ts +6 -0
- package/dist/exam/dto/update-exam-question.dto.d.ts.map +1 -0
- package/dist/exam/dto/update-exam-question.dto.js +9 -0
- package/dist/exam/dto/update-exam-question.dto.js.map +1 -0
- package/dist/exam/dto/update-exam.dto.d.ts +6 -0
- package/dist/exam/dto/update-exam.dto.d.ts.map +1 -0
- package/dist/exam/dto/update-exam.dto.js +9 -0
- package/dist/exam/dto/update-exam.dto.js.map +1 -0
- package/dist/exam/exam-attempt.controller.d.ts +273 -0
- package/dist/exam/exam-attempt.controller.d.ts.map +1 -0
- package/dist/exam/exam-attempt.controller.js +84 -0
- package/dist/exam/exam-attempt.controller.js.map +1 -0
- package/dist/exam/exam-attempt.service.d.ts +302 -0
- package/dist/exam/exam-attempt.service.d.ts.map +1 -0
- package/dist/exam/exam-attempt.service.js +776 -0
- package/dist/exam/exam-attempt.service.js.map +1 -0
- package/dist/exam/exam.controller.d.ts +162 -0
- package/dist/exam/exam.controller.d.ts.map +1 -0
- package/dist/exam/exam.controller.js +158 -0
- package/dist/exam/exam.controller.js.map +1 -0
- package/dist/exam/exam.module.d.ts +3 -0
- package/dist/exam/exam.module.d.ts.map +1 -0
- package/dist/exam/exam.module.js +27 -0
- package/dist/exam/exam.module.js.map +1 -0
- package/dist/exam/exam.service.d.ts +179 -0
- package/dist/exam/exam.service.d.ts.map +1 -0
- package/dist/exam/exam.service.js +597 -0
- package/dist/exam/exam.service.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/instructor/dto/create-instructor.dto.d.ts +10 -0
- package/dist/instructor/dto/create-instructor.dto.d.ts.map +1 -0
- package/dist/instructor/dto/create-instructor.dto.js +55 -0
- package/dist/instructor/dto/create-instructor.dto.js.map +1 -0
- package/dist/instructor/dto/update-instructor.dto.d.ts +9 -0
- package/dist/instructor/dto/update-instructor.dto.d.ts.map +1 -0
- package/dist/instructor/dto/update-instructor.dto.js +51 -0
- package/dist/instructor/dto/update-instructor.dto.js.map +1 -0
- package/dist/instructor/instructor.controller.d.ts +52 -0
- package/dist/instructor/instructor.controller.d.ts.map +1 -0
- package/dist/instructor/instructor.controller.js +98 -0
- package/dist/instructor/instructor.controller.js.map +1 -0
- package/dist/instructor/instructor.module.d.ts +3 -0
- package/dist/instructor/instructor.module.d.ts.map +1 -0
- package/dist/instructor/instructor.module.js +25 -0
- package/dist/instructor/instructor.module.js.map +1 -0
- package/dist/instructor/instructor.service.d.ts +79 -0
- package/dist/instructor/instructor.service.d.ts.map +1 -0
- package/dist/instructor/instructor.service.js +528 -0
- package/dist/instructor/instructor.service.js.map +1 -0
- package/dist/lms.module.d.ts.map +1 -1
- package/dist/lms.module.js +36 -4
- package/dist/lms.module.js.map +1 -1
- package/dist/reports/reports.controller.d.ts +69 -0
- package/dist/reports/reports.controller.d.ts.map +1 -0
- package/dist/reports/reports.controller.js +40 -0
- package/dist/reports/reports.controller.js.map +1 -0
- package/dist/reports/reports.module.d.ts +3 -0
- package/dist/reports/reports.module.d.ts.map +1 -0
- package/dist/reports/reports.module.js +25 -0
- package/dist/reports/reports.module.js.map +1 -0
- package/dist/reports/reports.service.d.ts +80 -0
- package/dist/reports/reports.service.d.ts.map +1 -0
- package/dist/reports/reports.service.js +366 -0
- package/dist/reports/reports.service.js.map +1 -0
- package/dist/training/dto/create-training.dto.d.ts +19 -0
- package/dist/training/dto/create-training.dto.d.ts.map +1 -0
- package/dist/training/dto/create-training.dto.js +98 -0
- package/dist/training/dto/create-training.dto.js.map +1 -0
- package/dist/training/dto/update-training.dto.d.ts +6 -0
- package/dist/training/dto/update-training.dto.d.ts.map +1 -0
- package/dist/training/dto/update-training.dto.js +9 -0
- package/dist/training/dto/update-training.dto.js.map +1 -0
- package/dist/training/training.controller.d.ts +195 -0
- package/dist/training/training.controller.d.ts.map +1 -0
- package/dist/training/training.controller.js +104 -0
- package/dist/training/training.controller.js.map +1 -0
- package/dist/training/training.module.d.ts +3 -0
- package/dist/training/training.module.d.ts.map +1 -0
- package/dist/training/training.module.js +25 -0
- package/dist/training/training.module.js.map +1 -0
- package/dist/training/training.service.d.ts +213 -0
- package/dist/training/training.service.d.ts.map +1 -0
- package/dist/training/training.service.js +497 -0
- package/dist/training/training.service.js.map +1 -0
- package/hedhog/data/dashboard.yaml +6 -0
- package/hedhog/data/dashboard_component.yaml +153 -0
- package/hedhog/data/dashboard_component_role.yaml +97 -0
- package/hedhog/data/dashboard_item.yaml +167 -0
- package/hedhog/data/dashboard_role.yaml +6 -0
- package/hedhog/data/instructor_qualification.yaml +16 -0
- package/hedhog/data/menu.yaml +129 -19
- package/hedhog/data/role.yaml +25 -1
- package/hedhog/data/route.yaml +867 -0
- package/hedhog/frontend/app/_components/class-form-sheet.tsx.ejs +1992 -0
- package/hedhog/frontend/app/_components/course-form-sheet.tsx.ejs +480 -0
- package/hedhog/frontend/app/_components/create-lms-instructor-sheet.tsx.ejs +591 -0
- package/hedhog/frontend/app/_components/create-lms-person-sheet.tsx.ejs +164 -0
- package/hedhog/frontend/app/_components/create-lms-student-person-sheet.tsx.ejs +120 -0
- package/hedhog/frontend/app/_components/lms-class-calendar.tsx.ejs +272 -0
- package/hedhog/frontend/app/_components/mobile-calendar.tsx.ejs +277 -0
- package/hedhog/frontend/app/_lib/editor/canvasInstance.ts.ejs +48 -0
- package/hedhog/frontend/app/_lib/editor/pctHelpers.ts.ejs +50 -0
- package/hedhog/frontend/app/_lib/editor/templateSerializer.ts.ejs +268 -0
- package/hedhog/frontend/app/_lib/editor/types.ts.ejs +94 -0
- package/hedhog/frontend/app/_lib/store/useTemplateStore.ts.ejs +284 -0
- package/hedhog/frontend/app/certificates/issued/page.tsx.ejs +638 -0
- package/hedhog/frontend/app/certificates/models/CanvasStage.tsx.ejs +916 -0
- package/hedhog/frontend/app/certificates/models/LeftPanel.tsx.ejs +200 -0
- package/hedhog/frontend/app/certificates/models/RightPanel.tsx.ejs +769 -0
- package/hedhog/frontend/app/certificates/models/TemplateEditorPage.tsx.ejs +104 -0
- package/hedhog/frontend/app/certificates/models/TopBar.tsx.ejs +354 -0
- package/hedhog/frontend/app/certificates/models/editor/page.tsx.ejs +5 -0
- package/hedhog/frontend/app/certificates/models/page.tsx.ejs +883 -0
- package/hedhog/frontend/app/classes/[id]/_components/event-summary-popover.tsx.ejs +279 -0
- package/hedhog/frontend/app/classes/[id]/_components/quick-create-session-popover.tsx.ejs +1027 -0
- package/hedhog/frontend/app/classes/[id]/page.tsx.ejs +3130 -993
- package/hedhog/frontend/app/classes/page.tsx.ejs +2731 -759
- package/hedhog/frontend/app/courses/[id]/_components/CourseCertificateCard.tsx.ejs +80 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseClassificationCard.tsx.ejs +226 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseContentCard.tsx.ejs +71 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseDangerZoneCard.tsx.ejs +42 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseFlagsCard.tsx.ejs +111 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseMainInfoCard.tsx.ejs +113 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseMediaCard.tsx.ejs +215 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseMultiEntityPicker.tsx.ejs +236 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseRelationsCard.tsx.ejs +141 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseSectionCard.tsx.ejs +57 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseSummaryCard.tsx.ejs +60 -0
- package/hedhog/frontend/app/courses/[id]/_components/course-edit-types.ts.ejs +33 -0
- package/hedhog/frontend/app/courses/[id]/page.tsx.ejs +933 -1103
- package/hedhog/frontend/app/courses/[id]/structure/page.tsx.ejs +699 -117
- package/hedhog/frontend/app/courses/page.tsx.ejs +1018 -1042
- package/hedhog/frontend/app/enterprise/[id]/page.tsx.ejs +317 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-activity-panel.tsx.ejs +88 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-admin-create-sheet.tsx.ejs +318 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-administrators-tab.tsx.ejs +332 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-class-create-sheet.tsx.ejs +58 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-classes-tab.tsx.ejs +390 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-company-identity-card.tsx.ejs +112 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-course-create-sheet.tsx.ejs +183 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-courses-tab.tsx.ejs +363 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-detail-constants.ts.ejs +88 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-detail-sheet.tsx.ejs +548 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-detail-utils.ts.ejs +33 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-mocks.ts.ejs +277 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-person-picker.ts.ejs +31 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-progress-bar.tsx.ejs +21 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-related-tab.tsx.ejs +224 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-sheet.tsx.ejs +397 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-student-create-sheet.tsx.ejs +167 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-students-tab.tsx.ejs +267 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-system-user-picker.ts.ejs +42 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-types.ts.ejs +96 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-user-create-sheet.tsx.ejs +207 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-user-distribution-chart.tsx.ejs +149 -0
- package/hedhog/frontend/app/enterprise/page.tsx.ejs +596 -0
- package/hedhog/frontend/app/evaluations/page.tsx.ejs +1250 -0
- package/hedhog/frontend/app/exams/[id]/attempt/page.tsx.ejs +642 -196
- package/hedhog/frontend/app/exams/[id]/page.tsx.ejs +11 -0
- package/hedhog/frontend/app/exams/[id]/questions/page.tsx.ejs +1316 -436
- package/hedhog/frontend/app/exams/page.tsx.ejs +799 -546
- package/hedhog/frontend/app/layout.tsx.ejs +5 -0
- package/hedhog/frontend/app/page.tsx.ejs +3 -1220
- package/hedhog/frontend/app/reports/courses/page.tsx.ejs +843 -0
- package/hedhog/frontend/app/reports/dashboard/page.tsx.ejs +890 -0
- package/hedhog/frontend/app/reports/page.tsx.ejs +802 -808
- package/hedhog/frontend/app/reports/students/page.tsx.ejs +772 -0
- package/hedhog/frontend/app/training/page.tsx.ejs +1873 -628
- package/hedhog/frontend/messages/en.json +1606 -111
- package/hedhog/frontend/messages/pt.json +1636 -134
- package/hedhog/frontend/widgets/active-classes-kpi.tsx.ejs +74 -0
- package/hedhog/frontend/widgets/active-courses-kpi.tsx.ejs +74 -0
- package/hedhog/frontend/widgets/approval-rate-kpi.tsx.ejs +81 -0
- package/hedhog/frontend/widgets/category-distribution-chart.tsx.ejs +119 -0
- package/hedhog/frontend/widgets/class-calendar.tsx.ejs +440 -0
- package/hedhog/frontend/widgets/completion-rate-kpi.tsx.ejs +81 -0
- package/hedhog/frontend/widgets/engagement-chart.tsx.ejs +120 -0
- package/hedhog/frontend/widgets/footer-summary.tsx.ejs +80 -0
- package/hedhog/frontend/widgets/issued-certificates-kpi.tsx.ejs +74 -0
- package/hedhog/frontend/widgets/latest-enrollments.tsx.ejs +166 -0
- package/hedhog/frontend/widgets/student-growth-chart.tsx.ejs +89 -0
- package/hedhog/frontend/widgets/top-courses-chart.tsx.ejs +104 -0
- package/hedhog/frontend/widgets/total-students-kpi.tsx.ejs +78 -0
- package/hedhog/frontend/widgets/upcoming-classes.tsx.ejs +152 -0
- package/hedhog/table/course.yaml +19 -1
- package/hedhog/table/course_class_group.yaml +8 -0
- package/hedhog/table/course_class_session.yaml +33 -0
- package/hedhog/table/course_instructor.yaml +27 -0
- package/hedhog/table/enterprise.yaml +29 -0
- package/hedhog/table/enterprise_class_group.yaml +20 -0
- package/hedhog/table/enterprise_course.yaml +23 -0
- package/hedhog/table/enterprise_student.yaml +24 -0
- package/hedhog/table/enterprise_user.yaml +35 -0
- package/hedhog/table/instructor_qualification.yaml +26 -0
- package/hedhog/table/instructor_qualification_assignment.yaml +22 -0
- package/hedhog/table/question.yaml +6 -0
- package/package.json +6 -6
- package/src/certificate/certificate.controller.ts +83 -0
- package/src/certificate/certificate.module.ts +13 -0
- package/src/certificate/certificate.service.ts +413 -0
- package/src/certificate/dto/create-certificate-template.dto.ts +25 -0
- package/src/certificate/dto/update-certificate-template.dto.ts +6 -0
- package/src/class-group/class-group.controller.ts +189 -0
- package/src/class-group/class-group.module.ts +12 -0
- package/src/class-group/class-group.service.ts +1802 -0
- package/src/class-group/dto/create-class-group.dto.ts +139 -0
- package/src/class-group/dto/create-session.dto.ts +102 -0
- package/src/class-group/dto/enrollment.dto.ts +70 -0
- package/src/class-group/dto/update-class-group.dto.ts +4 -0
- package/src/class-group/dto/update-session.dto.ts +9 -0
- package/src/course/course-structure.controller.ts +85 -0
- package/src/course/course-structure.service.ts +525 -0
- package/src/course/course.controller.ts +69 -0
- package/src/course/course.module.ts +15 -0
- package/src/course/course.service.ts +920 -0
- package/src/course/dto/create-course-structure-lesson.dto.ts +97 -0
- package/src/course/dto/create-course-structure-session.dto.ts +22 -0
- package/src/course/dto/create-course.dto.ts +111 -0
- package/src/course/dto/update-course-structure-lesson.dto.ts +6 -0
- package/src/course/dto/update-course-structure-session.dto.ts +6 -0
- package/src/course/dto/update-course.dto.ts +4 -0
- package/src/dashboard/dashboard.controller.ts +14 -0
- package/src/dashboard/dashboard.module.ts +12 -0
- package/src/dashboard/dashboard.service.ts +726 -0
- package/src/enterprise/dto/add-enterprise-class-group.dto.ts +7 -0
- package/src/enterprise/dto/add-enterprise-course.dto.ts +11 -0
- package/src/enterprise/dto/add-enterprise-student.dto.ts +16 -0
- package/src/enterprise/dto/add-enterprise-user.dto.ts +23 -0
- package/src/enterprise/dto/create-enterprise.dto.ts +41 -0
- package/src/enterprise/dto/update-enterprise-student.dto.ts +7 -0
- package/src/enterprise/dto/update-enterprise-user.dto.ts +11 -0
- package/src/enterprise/dto/update-enterprise.dto.ts +4 -0
- package/src/enterprise/enterprise.controller.ts +233 -0
- package/src/enterprise/enterprise.module.ts +12 -0
- package/src/enterprise/enterprise.service.ts +712 -0
- package/src/evaluation/evaluation.controller.ts +44 -0
- package/src/evaluation/evaluation.module.ts +12 -0
- package/src/evaluation/evaluation.service.ts +394 -0
- package/src/exam/dto/create-exam-question.dto.ts +103 -0
- package/src/exam/dto/create-exam.dto.ts +41 -0
- package/src/exam/dto/reorder-exam-questions.dto.ts +8 -0
- package/src/exam/dto/save-exam-attempt-answers.dto.ts +55 -0
- package/src/exam/dto/start-exam-attempt.dto.ts +8 -0
- package/src/exam/dto/submit-exam-attempt.dto.ts +8 -0
- package/src/exam/dto/update-exam-question.dto.ts +4 -0
- package/src/exam/dto/update-exam.dto.ts +4 -0
- package/src/exam/exam-attempt.controller.ts +65 -0
- package/src/exam/exam-attempt.service.ts +1008 -0
- package/src/exam/exam.controller.ts +102 -0
- package/src/exam/exam.module.ts +14 -0
- package/src/exam/exam.service.ts +784 -0
- package/src/index.ts +29 -0
- package/src/instructor/dto/create-instructor.dto.ts +43 -0
- package/src/instructor/dto/update-instructor.dto.ts +38 -0
- package/src/instructor/instructor.controller.ts +73 -0
- package/src/instructor/instructor.module.ts +12 -0
- package/src/instructor/instructor.service.ts +646 -0
- package/src/lms.module.ts +36 -4
- package/src/reports/reports.controller.ts +14 -0
- package/src/reports/reports.module.ts +12 -0
- package/src/reports/reports.service.ts +485 -0
- package/src/training/dto/create-training.dto.ts +81 -0
- package/src/training/dto/update-training.dto.ts +4 -0
- package/src/training/training.controller.ts +68 -0
- package/src/training/training.module.ts +12 -0
- package/src/training/training.service.ts +574 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Role } from '@hed-hog/api';
|
|
2
|
+
import { Controller, Get, Query } from '@nestjs/common';
|
|
3
|
+
import { EvaluationService } from './evaluation.service';
|
|
4
|
+
|
|
5
|
+
@Role()
|
|
6
|
+
@Controller('lms/evaluations')
|
|
7
|
+
export class EvaluationController {
|
|
8
|
+
constructor(private readonly evaluationService: EvaluationService) {}
|
|
9
|
+
|
|
10
|
+
@Get('stats')
|
|
11
|
+
stats() {
|
|
12
|
+
return this.evaluationService.stats();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Get('filter-options')
|
|
16
|
+
filterOptions() {
|
|
17
|
+
return this.evaluationService.filterOptions();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Get()
|
|
21
|
+
list(
|
|
22
|
+
@Query('page') page?: string,
|
|
23
|
+
@Query('pageSize') pageSize?: string,
|
|
24
|
+
@Query('search') search?: string,
|
|
25
|
+
@Query('courseId') courseId?: string,
|
|
26
|
+
@Query('classId') classId?: string,
|
|
27
|
+
@Query('instructorId') instructorId?: string,
|
|
28
|
+
@Query('evaluatorId') evaluatorId?: string,
|
|
29
|
+
@Query('dateFrom') dateFrom?: string,
|
|
30
|
+
@Query('dateTo') dateTo?: string,
|
|
31
|
+
) {
|
|
32
|
+
return this.evaluationService.list({
|
|
33
|
+
page: page ? Number(page) : 1,
|
|
34
|
+
pageSize: pageSize ? Number(pageSize) : 12,
|
|
35
|
+
search,
|
|
36
|
+
courseId: courseId ? Number(courseId) : undefined,
|
|
37
|
+
classId: classId ? Number(classId) : undefined,
|
|
38
|
+
instructorId: instructorId ? Number(instructorId) : undefined,
|
|
39
|
+
evaluatorId: evaluatorId ? Number(evaluatorId) : undefined,
|
|
40
|
+
dateFrom,
|
|
41
|
+
dateTo,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PrismaModule } from '@hed-hog/api-prisma';
|
|
2
|
+
import { forwardRef, Module } from '@nestjs/common';
|
|
3
|
+
import { EvaluationController } from './evaluation.controller';
|
|
4
|
+
import { EvaluationService } from './evaluation.service';
|
|
5
|
+
|
|
6
|
+
@Module({
|
|
7
|
+
imports: [forwardRef(() => PrismaModule)],
|
|
8
|
+
controllers: [EvaluationController],
|
|
9
|
+
providers: [EvaluationService],
|
|
10
|
+
exports: [forwardRef(() => EvaluationService)],
|
|
11
|
+
})
|
|
12
|
+
export class EvaluationModule {}
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import { PrismaService } from '@hed-hog/api-prisma';
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
|
|
4
|
+
@Injectable()
|
|
5
|
+
export class EvaluationService {
|
|
6
|
+
constructor(private readonly prisma: PrismaService) {}
|
|
7
|
+
|
|
8
|
+
async list(params: {
|
|
9
|
+
page?: number;
|
|
10
|
+
pageSize?: number;
|
|
11
|
+
search?: string;
|
|
12
|
+
courseId?: number;
|
|
13
|
+
classId?: number;
|
|
14
|
+
instructorId?: number;
|
|
15
|
+
evaluatorId?: number;
|
|
16
|
+
dateFrom?: string;
|
|
17
|
+
dateTo?: string;
|
|
18
|
+
}) {
|
|
19
|
+
const page = Math.max(Number(params.page) || 1, 1);
|
|
20
|
+
const pageSize = Math.max(Number(params.pageSize) || 12, 1);
|
|
21
|
+
const skip = (page - 1) * pageSize;
|
|
22
|
+
|
|
23
|
+
const where: any = {};
|
|
24
|
+
|
|
25
|
+
if (params.evaluatorId) {
|
|
26
|
+
where.evaluator_id = params.evaluatorId;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (params.dateFrom || params.dateTo) {
|
|
30
|
+
where.created_at = {};
|
|
31
|
+
if (params.dateFrom) {
|
|
32
|
+
where.created_at.gte = new Date(params.dateFrom);
|
|
33
|
+
}
|
|
34
|
+
if (params.dateTo) {
|
|
35
|
+
const to = new Date(params.dateTo);
|
|
36
|
+
to.setHours(23, 59, 59, 999);
|
|
37
|
+
where.created_at.lte = to;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (params.search) {
|
|
42
|
+
where.OR = [
|
|
43
|
+
{ comment: { contains: params.search, mode: 'insensitive' } },
|
|
44
|
+
{
|
|
45
|
+
evaluation_topic: {
|
|
46
|
+
name: { contains: params.search, mode: 'insensitive' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
evaluation_topic: {
|
|
51
|
+
course: { title: { contains: params.search, mode: 'insensitive' } },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
evaluation_topic: {
|
|
56
|
+
course_lesson: {
|
|
57
|
+
title: { contains: params.search, mode: 'insensitive' },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
evaluation_topic: {
|
|
63
|
+
course_class_session: {
|
|
64
|
+
title: { contains: params.search, mode: 'insensitive' },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
evaluation_topic: {
|
|
70
|
+
exam: { title: { contains: params.search, mode: 'insensitive' } },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
evaluation_topic: {
|
|
75
|
+
question: {
|
|
76
|
+
statement: { contains: params.search, mode: 'insensitive' },
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Build evaluation_topic nested filter
|
|
84
|
+
const topicWhere: Record<string, any> = {};
|
|
85
|
+
|
|
86
|
+
if (params.courseId) {
|
|
87
|
+
topicWhere.OR = [
|
|
88
|
+
{ course_id: params.courseId },
|
|
89
|
+
{
|
|
90
|
+
course_lesson: {
|
|
91
|
+
course_module: { course_id: params.courseId },
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
course_class_session: {
|
|
96
|
+
course_class_group: { course_id: params.courseId },
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{ exam: { course_id: params.courseId } },
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const sessionWhere: Record<string, any> = {};
|
|
104
|
+
if (params.classId) {
|
|
105
|
+
sessionWhere.course_class_group_id = params.classId;
|
|
106
|
+
}
|
|
107
|
+
if (params.instructorId) {
|
|
108
|
+
sessionWhere.course_class_group = { instructor_id: params.instructorId };
|
|
109
|
+
}
|
|
110
|
+
if (Object.keys(sessionWhere).length > 0) {
|
|
111
|
+
topicWhere.course_class_session = sessionWhere;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (Object.keys(topicWhere).length > 0) {
|
|
115
|
+
where.evaluation_topic = topicWhere;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const include = {
|
|
119
|
+
evaluation_topic: {
|
|
120
|
+
include: {
|
|
121
|
+
course: { select: { id: true, title: true } },
|
|
122
|
+
course_lesson: {
|
|
123
|
+
select: {
|
|
124
|
+
id: true,
|
|
125
|
+
title: true,
|
|
126
|
+
course_module: {
|
|
127
|
+
select: {
|
|
128
|
+
course: { select: { id: true, title: true } },
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
course_class_session: {
|
|
134
|
+
select: {
|
|
135
|
+
id: true,
|
|
136
|
+
title: true,
|
|
137
|
+
course_class_group: {
|
|
138
|
+
select: {
|
|
139
|
+
id: true,
|
|
140
|
+
title: true,
|
|
141
|
+
course: { select: { id: true, title: true } },
|
|
142
|
+
instructor: {
|
|
143
|
+
select: {
|
|
144
|
+
id: true,
|
|
145
|
+
person: { select: { id: true, name: true } },
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
question: { select: { id: true, statement: true } },
|
|
153
|
+
exam: {
|
|
154
|
+
select: {
|
|
155
|
+
id: true,
|
|
156
|
+
title: true,
|
|
157
|
+
course: { select: { id: true, title: true } },
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
person: { select: { id: true, name: true } },
|
|
163
|
+
} as const;
|
|
164
|
+
|
|
165
|
+
const [ratings, total] = await Promise.all([
|
|
166
|
+
this.prisma.evaluation_rating.findMany({
|
|
167
|
+
where,
|
|
168
|
+
skip,
|
|
169
|
+
take: pageSize,
|
|
170
|
+
orderBy: { created_at: 'desc' },
|
|
171
|
+
include,
|
|
172
|
+
}),
|
|
173
|
+
this.prisma.evaluation_rating.count({ where }),
|
|
174
|
+
]);
|
|
175
|
+
|
|
176
|
+
// Compute per-topic aggregates for comparison bars in the detail sheet
|
|
177
|
+
const topicIds = [...new Set(ratings.map((r) => r.evaluation_topic_id))];
|
|
178
|
+
const topicAggregates =
|
|
179
|
+
topicIds.length > 0
|
|
180
|
+
? await this.prisma.evaluation_rating.groupBy({
|
|
181
|
+
by: ['evaluation_topic_id'],
|
|
182
|
+
where: { evaluation_topic_id: { in: topicIds } },
|
|
183
|
+
_avg: { score: true },
|
|
184
|
+
_count: { id: true },
|
|
185
|
+
})
|
|
186
|
+
: [];
|
|
187
|
+
|
|
188
|
+
const aggregateMap = new Map(
|
|
189
|
+
topicAggregates.map((a) => [
|
|
190
|
+
a.evaluation_topic_id,
|
|
191
|
+
{
|
|
192
|
+
avg: Math.round(Number(a._avg.score ?? 0) * 10) / 10,
|
|
193
|
+
count: a._count.id,
|
|
194
|
+
},
|
|
195
|
+
]),
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
total,
|
|
200
|
+
page,
|
|
201
|
+
pageSize,
|
|
202
|
+
lastPage: Math.max(1, Math.ceil(total / pageSize)),
|
|
203
|
+
data: ratings.map((r) => this.mapRating(r, aggregateMap.get(r.evaluation_topic_id))),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
private mapRating(r: any, topicAggregate?: { avg: number; count: number }) {
|
|
208
|
+
const topic = r.evaluation_topic;
|
|
209
|
+
const targetType: string = topic.target_type;
|
|
210
|
+
|
|
211
|
+
let targetName = '';
|
|
212
|
+
let courseName: string | null = null;
|
|
213
|
+
let courseId: number | null = null;
|
|
214
|
+
let className: string | null = null;
|
|
215
|
+
let classId: number | null = null;
|
|
216
|
+
let instructorName: string | null = null;
|
|
217
|
+
let instructorId: number | null = null;
|
|
218
|
+
|
|
219
|
+
if (targetType === 'course' && topic.course) {
|
|
220
|
+
targetName = topic.course.title;
|
|
221
|
+
courseName = topic.course.title;
|
|
222
|
+
courseId = topic.course.id;
|
|
223
|
+
} else if (targetType === 'course_lesson' && topic.course_lesson) {
|
|
224
|
+
targetName = topic.course_lesson.title;
|
|
225
|
+
const c = topic.course_lesson.course_module?.course;
|
|
226
|
+
if (c) {
|
|
227
|
+
courseName = c.title;
|
|
228
|
+
courseId = c.id;
|
|
229
|
+
}
|
|
230
|
+
} else if (
|
|
231
|
+
targetType === 'course_class_session' &&
|
|
232
|
+
topic.course_class_session
|
|
233
|
+
) {
|
|
234
|
+
const session = topic.course_class_session;
|
|
235
|
+
targetName = session.title;
|
|
236
|
+
const group = session.course_class_group;
|
|
237
|
+
if (group) {
|
|
238
|
+
className = group.title;
|
|
239
|
+
classId = group.id;
|
|
240
|
+
if (group.course) {
|
|
241
|
+
courseName = group.course.title;
|
|
242
|
+
courseId = group.course.id;
|
|
243
|
+
}
|
|
244
|
+
if (group.instructor?.person) {
|
|
245
|
+
instructorName = group.instructor.person.name;
|
|
246
|
+
instructorId = group.instructor.person.id;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
} else if (targetType === 'question' && topic.question) {
|
|
250
|
+
targetName = topic.question.statement;
|
|
251
|
+
} else if (targetType === 'exam' && topic.exam) {
|
|
252
|
+
targetName = topic.exam.title;
|
|
253
|
+
if (topic.exam.course) {
|
|
254
|
+
courseName = topic.exam.course.title;
|
|
255
|
+
courseId = topic.exam.course.id;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const score = Number(r.score);
|
|
260
|
+
|
|
261
|
+
return {
|
|
262
|
+
id: r.id,
|
|
263
|
+
topicName: topic.name,
|
|
264
|
+
topicDescription: topic.description ?? null,
|
|
265
|
+
targetType,
|
|
266
|
+
targetName,
|
|
267
|
+
score,
|
|
268
|
+
comment: r.comment ?? null,
|
|
269
|
+
evaluatorName: r.person?.name ?? null,
|
|
270
|
+
evaluatorId: r.evaluator_id ?? null,
|
|
271
|
+
courseName,
|
|
272
|
+
courseId,
|
|
273
|
+
className,
|
|
274
|
+
classId,
|
|
275
|
+
instructorName,
|
|
276
|
+
instructorId,
|
|
277
|
+
createdAt: r.created_at,
|
|
278
|
+
topicAvgScore: topicAggregate?.avg ?? score,
|
|
279
|
+
topicRatingCount: topicAggregate?.count ?? 1,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
async stats() {
|
|
284
|
+
const [totalEvaluations, avgResult, topicsEvaluated, evaluatorGroups] =
|
|
285
|
+
await Promise.all([
|
|
286
|
+
this.prisma.evaluation_rating.count(),
|
|
287
|
+
this.prisma.evaluation_rating.aggregate({ _avg: { score: true } }),
|
|
288
|
+
this.prisma.evaluation_topic.count({
|
|
289
|
+
where: { evaluation_rating: { some: {} } },
|
|
290
|
+
}),
|
|
291
|
+
this.prisma.evaluation_rating.groupBy({
|
|
292
|
+
by: ['evaluator_id'],
|
|
293
|
+
where: { evaluator_id: { not: null } },
|
|
294
|
+
}),
|
|
295
|
+
]);
|
|
296
|
+
|
|
297
|
+
return {
|
|
298
|
+
totalEvaluations,
|
|
299
|
+
averageScore: Math.round(Number(avgResult._avg.score ?? 0) * 10) / 10,
|
|
300
|
+
topicsEvaluated,
|
|
301
|
+
totalEvaluators: evaluatorGroups.length,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
async filterOptions() {
|
|
306
|
+
const topics = await this.prisma.evaluation_topic.findMany({
|
|
307
|
+
where: { evaluation_rating: { some: {} } },
|
|
308
|
+
select: {
|
|
309
|
+
course: { select: { id: true, title: true } },
|
|
310
|
+
course_lesson: {
|
|
311
|
+
select: {
|
|
312
|
+
course_module: {
|
|
313
|
+
select: {
|
|
314
|
+
course: { select: { id: true, title: true } },
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
course_class_session: {
|
|
320
|
+
select: {
|
|
321
|
+
course_class_group: {
|
|
322
|
+
select: {
|
|
323
|
+
id: true,
|
|
324
|
+
title: true,
|
|
325
|
+
course: { select: { id: true, title: true } },
|
|
326
|
+
instructor: {
|
|
327
|
+
select: {
|
|
328
|
+
id: true,
|
|
329
|
+
person: { select: { id: true, name: true } },
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
exam: {
|
|
337
|
+
select: { course: { select: { id: true, title: true } } },
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
const coursesMap = new Map<number, string>();
|
|
343
|
+
const classesMap = new Map<number, string>();
|
|
344
|
+
const instructorsMap = new Map<number, string>(); // key = instructor.id
|
|
345
|
+
|
|
346
|
+
for (const topic of topics) {
|
|
347
|
+
if (topic.course) {
|
|
348
|
+
coursesMap.set(topic.course.id, topic.course.title);
|
|
349
|
+
}
|
|
350
|
+
const lessonCourse = topic.course_lesson?.course_module?.course;
|
|
351
|
+
if (lessonCourse) {
|
|
352
|
+
coursesMap.set(lessonCourse.id, lessonCourse.title);
|
|
353
|
+
}
|
|
354
|
+
const group = topic.course_class_session?.course_class_group;
|
|
355
|
+
if (group) {
|
|
356
|
+
classesMap.set(group.id, group.title);
|
|
357
|
+
if (group.course) {
|
|
358
|
+
coursesMap.set(group.course.id, group.course.title);
|
|
359
|
+
}
|
|
360
|
+
if (group.instructor?.person) {
|
|
361
|
+
instructorsMap.set(group.instructor.id, group.instructor.person.name);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
const examCourse = topic.exam?.course;
|
|
365
|
+
if (examCourse) {
|
|
366
|
+
coursesMap.set(examCourse.id, examCourse.title);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const evaluatorRatings = await this.prisma.evaluation_rating.findMany({
|
|
371
|
+
where: { evaluator_id: { not: null } },
|
|
372
|
+
select: { person: { select: { id: true, name: true } } },
|
|
373
|
+
distinct: ['evaluator_id'],
|
|
374
|
+
orderBy: { evaluator_id: 'asc' },
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
return {
|
|
378
|
+
courses: Array.from(coursesMap.entries()).map(([id, label]) => ({
|
|
379
|
+
id,
|
|
380
|
+
label,
|
|
381
|
+
})),
|
|
382
|
+
classes: Array.from(classesMap.entries()).map(([id, label]) => ({
|
|
383
|
+
id,
|
|
384
|
+
label,
|
|
385
|
+
})),
|
|
386
|
+
instructors: Array.from(instructorsMap.entries()).map(
|
|
387
|
+
([id, label]) => ({ id, label }),
|
|
388
|
+
),
|
|
389
|
+
evaluators: evaluatorRatings
|
|
390
|
+
.filter((r) => r.person)
|
|
391
|
+
.map((r) => ({ id: r.person!.id, label: r.person!.name })),
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
ArrayMinSize,
|
|
4
|
+
IsArray,
|
|
5
|
+
IsBoolean,
|
|
6
|
+
IsIn,
|
|
7
|
+
IsInt,
|
|
8
|
+
IsNotEmpty,
|
|
9
|
+
IsOptional,
|
|
10
|
+
IsString,
|
|
11
|
+
MaxLength,
|
|
12
|
+
Min,
|
|
13
|
+
ValidateNested,
|
|
14
|
+
} from 'class-validator';
|
|
15
|
+
|
|
16
|
+
export const EXAM_QUESTION_TYPES = [
|
|
17
|
+
'multiple_choice',
|
|
18
|
+
'true_false',
|
|
19
|
+
'essay',
|
|
20
|
+
'fill_blank',
|
|
21
|
+
'matching',
|
|
22
|
+
] as const;
|
|
23
|
+
|
|
24
|
+
export type ExamQuestionType = (typeof EXAM_QUESTION_TYPES)[number];
|
|
25
|
+
|
|
26
|
+
export const OBJECTIVE_EXAM_QUESTION_TYPES: ExamQuestionType[] = [
|
|
27
|
+
'multiple_choice',
|
|
28
|
+
'true_false',
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export class ExamQuestionAlternativeDto {
|
|
32
|
+
@IsString()
|
|
33
|
+
@IsNotEmpty()
|
|
34
|
+
@MaxLength(2000)
|
|
35
|
+
text: string;
|
|
36
|
+
|
|
37
|
+
@IsBoolean()
|
|
38
|
+
isCorrect: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class FillBlankAnswerDto {
|
|
42
|
+
@IsString()
|
|
43
|
+
@IsNotEmpty()
|
|
44
|
+
@MaxLength(2000)
|
|
45
|
+
answer: string;
|
|
46
|
+
|
|
47
|
+
@IsArray()
|
|
48
|
+
@IsString({ each: true })
|
|
49
|
+
@IsOptional()
|
|
50
|
+
alternatives?: string[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class MatchingPairDto {
|
|
54
|
+
@IsString()
|
|
55
|
+
@IsNotEmpty()
|
|
56
|
+
@MaxLength(100)
|
|
57
|
+
id: string;
|
|
58
|
+
|
|
59
|
+
@IsString()
|
|
60
|
+
@IsNotEmpty()
|
|
61
|
+
@MaxLength(2000)
|
|
62
|
+
leftText: string;
|
|
63
|
+
|
|
64
|
+
@IsString()
|
|
65
|
+
@IsNotEmpty()
|
|
66
|
+
@MaxLength(2000)
|
|
67
|
+
rightText: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export class CreateExamQuestionDto {
|
|
71
|
+
@IsString()
|
|
72
|
+
@IsNotEmpty()
|
|
73
|
+
statement: string;
|
|
74
|
+
|
|
75
|
+
@IsString()
|
|
76
|
+
@IsIn(EXAM_QUESTION_TYPES)
|
|
77
|
+
@IsOptional()
|
|
78
|
+
questionType?: ExamQuestionType;
|
|
79
|
+
|
|
80
|
+
@IsInt()
|
|
81
|
+
@Min(1)
|
|
82
|
+
points: number;
|
|
83
|
+
|
|
84
|
+
@IsArray()
|
|
85
|
+
@ValidateNested({ each: true })
|
|
86
|
+
@Type(() => ExamQuestionAlternativeDto)
|
|
87
|
+
@IsOptional()
|
|
88
|
+
alternatives?: ExamQuestionAlternativeDto[];
|
|
89
|
+
|
|
90
|
+
@IsArray()
|
|
91
|
+
@ArrayMinSize(1)
|
|
92
|
+
@ValidateNested({ each: true })
|
|
93
|
+
@Type(() => FillBlankAnswerDto)
|
|
94
|
+
@IsOptional()
|
|
95
|
+
fillBlankAnswers?: FillBlankAnswerDto[];
|
|
96
|
+
|
|
97
|
+
@IsArray()
|
|
98
|
+
@ArrayMinSize(2)
|
|
99
|
+
@ValidateNested({ each: true })
|
|
100
|
+
@Type(() => MatchingPairDto)
|
|
101
|
+
@IsOptional()
|
|
102
|
+
matchingPairs?: MatchingPairDto[];
|
|
103
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IsBoolean, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString, MaxLength, Min } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
export class CreateExamDto {
|
|
4
|
+
@IsString()
|
|
5
|
+
@IsOptional()
|
|
6
|
+
@MaxLength(32)
|
|
7
|
+
code?: string;
|
|
8
|
+
|
|
9
|
+
@IsString()
|
|
10
|
+
@IsNotEmpty()
|
|
11
|
+
@MaxLength(255)
|
|
12
|
+
title: string;
|
|
13
|
+
|
|
14
|
+
@IsNumber()
|
|
15
|
+
@Min(0)
|
|
16
|
+
@IsOptional()
|
|
17
|
+
minScore?: number;
|
|
18
|
+
|
|
19
|
+
@IsNumber()
|
|
20
|
+
@Min(1)
|
|
21
|
+
@IsOptional()
|
|
22
|
+
timeLimit?: number;
|
|
23
|
+
|
|
24
|
+
@IsBoolean()
|
|
25
|
+
@IsOptional()
|
|
26
|
+
shuffle?: boolean;
|
|
27
|
+
|
|
28
|
+
@IsEnum(['draft', 'published', 'closed', 'archived'])
|
|
29
|
+
@IsOptional()
|
|
30
|
+
status?: 'draft' | 'published' | 'closed' | 'archived';
|
|
31
|
+
|
|
32
|
+
@IsString()
|
|
33
|
+
@IsOptional()
|
|
34
|
+
@MaxLength(32)
|
|
35
|
+
primaryColor?: string;
|
|
36
|
+
|
|
37
|
+
@IsString()
|
|
38
|
+
@IsOptional()
|
|
39
|
+
@MaxLength(32)
|
|
40
|
+
secondaryColor?: string;
|
|
41
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
ArrayMinSize,
|
|
4
|
+
IsArray,
|
|
5
|
+
IsInt,
|
|
6
|
+
IsNotEmpty,
|
|
7
|
+
IsOptional,
|
|
8
|
+
IsString,
|
|
9
|
+
MaxLength,
|
|
10
|
+
Min,
|
|
11
|
+
ValidateNested,
|
|
12
|
+
} from 'class-validator';
|
|
13
|
+
|
|
14
|
+
export class SaveExamAttemptMatchingPairDto {
|
|
15
|
+
@IsString()
|
|
16
|
+
@IsNotEmpty()
|
|
17
|
+
@MaxLength(100)
|
|
18
|
+
leftId: string;
|
|
19
|
+
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
@MaxLength(100)
|
|
23
|
+
rightId: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class SaveExamAttemptAnswerDto {
|
|
27
|
+
@IsInt()
|
|
28
|
+
@Min(1)
|
|
29
|
+
questionId: number;
|
|
30
|
+
|
|
31
|
+
@IsInt()
|
|
32
|
+
@Min(1)
|
|
33
|
+
@IsOptional()
|
|
34
|
+
examOptionId?: number | null;
|
|
35
|
+
|
|
36
|
+
@IsString()
|
|
37
|
+
@MaxLength(10000)
|
|
38
|
+
@IsOptional()
|
|
39
|
+
answerText?: string | null;
|
|
40
|
+
|
|
41
|
+
@IsArray()
|
|
42
|
+
@ArrayMinSize(0)
|
|
43
|
+
@ValidateNested({ each: true })
|
|
44
|
+
@Type(() => SaveExamAttemptMatchingPairDto)
|
|
45
|
+
@IsOptional()
|
|
46
|
+
matchingPairs?: SaveExamAttemptMatchingPairDto[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class SaveExamAttemptAnswersDto {
|
|
50
|
+
@IsArray()
|
|
51
|
+
@ArrayMinSize(0)
|
|
52
|
+
@ValidateNested({ each: true })
|
|
53
|
+
@Type(() => SaveExamAttemptAnswerDto)
|
|
54
|
+
answers: SaveExamAttemptAnswerDto[];
|
|
55
|
+
}
|