fix: update types for quiz attempts in lesson content
- 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:
parent
df750723af
commit
4ca5692e6f
2 changed files with 15 additions and 7 deletions
|
|
@ -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 },
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue