fix: update types for quiz attempts in lesson content
All checks were successful
Build and Deploy Backend / Build Backend Docker Image (push) Successful in 27s
Build and Deploy Backend / Deploy E-learning Backend to Dev Server (push) Successful in 4s
Build and Deploy Backend / Notify Deployment Status (push) Successful in 1s

- Add allow_multiple_attempts and latest_attempt to quiz type
- Make quiz fields optional to support conditional return
- Fix AuditAction enum usage in RecommendedCourses service
This commit is contained in:
JakkrapartXD 2026-02-11 14:44:56 +07:00
parent df750723af
commit 4ca5692e6f
2 changed files with 15 additions and 7 deletions

View file

@ -211,7 +211,7 @@ export class RecommendedCoursesService {
// Audit log
await auditService.logSync({
userId: decoded.id,
action: isRecommended ? AuditAction.UPDATE_COURSE : AuditAction.UPDATE_COURSE,
action: AuditAction.UPDATE,
entityType: 'Course',
entityId: courseId,
oldValue: { is_recommended: course.is_recommended },

View file

@ -154,12 +154,20 @@ export interface LessonContentData {
title: MultiLangText;
description: MultiLangText | null;
passing_score: number;
time_limit: number | null;
shuffle_questions: boolean;
shuffle_choices: boolean;
is_skippable: boolean;
show_answers_after_completion: boolean;
questions: {
time_limit?: number | null;
shuffle_questions?: boolean;
shuffle_choices?: boolean;
is_skippable?: boolean;
show_answers_after_completion?: boolean;
allow_multiple_attempts?: boolean;
latest_attempt?: {
score: number;
is_passed: boolean;
attempt_number: number;
started_at: Date;
completed_at: Date | null;
};
questions?: {
id: number;
question: MultiLangText;
question_type: 'MULTIPLE_CHOICE' | 'TRUE_FALSE' | 'SHORT_ANSWER';