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
|
// Audit log
|
||||||
await auditService.logSync({
|
await auditService.logSync({
|
||||||
userId: decoded.id,
|
userId: decoded.id,
|
||||||
action: isRecommended ? AuditAction.UPDATE_COURSE : AuditAction.UPDATE_COURSE,
|
action: AuditAction.UPDATE,
|
||||||
entityType: 'Course',
|
entityType: 'Course',
|
||||||
entityId: courseId,
|
entityId: courseId,
|
||||||
oldValue: { is_recommended: course.is_recommended },
|
oldValue: { is_recommended: course.is_recommended },
|
||||||
|
|
|
||||||
|
|
@ -154,12 +154,20 @@ export interface LessonContentData {
|
||||||
title: MultiLangText;
|
title: MultiLangText;
|
||||||
description: MultiLangText | null;
|
description: MultiLangText | null;
|
||||||
passing_score: number;
|
passing_score: number;
|
||||||
time_limit: number | null;
|
time_limit?: number | null;
|
||||||
shuffle_questions: boolean;
|
shuffle_questions?: boolean;
|
||||||
shuffle_choices: boolean;
|
shuffle_choices?: boolean;
|
||||||
is_skippable: boolean;
|
is_skippable?: boolean;
|
||||||
show_answers_after_completion: boolean;
|
show_answers_after_completion?: boolean;
|
||||||
questions: {
|
allow_multiple_attempts?: boolean;
|
||||||
|
latest_attempt?: {
|
||||||
|
score: number;
|
||||||
|
is_passed: boolean;
|
||||||
|
attempt_number: number;
|
||||||
|
started_at: Date;
|
||||||
|
completed_at: Date | null;
|
||||||
|
};
|
||||||
|
questions?: {
|
||||||
id: number;
|
id: number;
|
||||||
question: MultiLangText;
|
question: MultiLangText;
|
||||||
question_type: 'MULTIPLE_CHOICE' | 'TRUE_FALSE' | 'SHORT_ANSWER';
|
question_type: 'MULTIPLE_CHOICE' | 'TRUE_FALSE' | 'SHORT_ANSWER';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue