add changes
This commit is contained in:
@@ -61,7 +61,7 @@ export interface QuestionPreview {
|
||||
/**
|
||||
* Question Types
|
||||
*/
|
||||
export type QuestionType = 'multiple_choice' | 'true_false' | 'written';
|
||||
export type QuestionType = 'multiple' | 'trueFalse' | 'written';
|
||||
|
||||
/**
|
||||
* Difficulty Levels
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { User } from './user.model';
|
||||
import { QuizSession } from './quiz.model';
|
||||
import { QuizSession, QuizSessionHistory } from './quiz.model';
|
||||
|
||||
/**
|
||||
* User Dashboard Response
|
||||
@@ -33,8 +33,20 @@ export interface CategoryPerformance {
|
||||
*/
|
||||
export interface QuizHistoryResponse {
|
||||
success: boolean;
|
||||
sessions: QuizSession[];
|
||||
pagination: PaginationInfo;
|
||||
data: {
|
||||
sessions: QuizSessionHistory[];
|
||||
pagination: PaginationInfo;
|
||||
filters: {
|
||||
"category": null,
|
||||
"status": null,
|
||||
"startDate": null,
|
||||
"endDate": null
|
||||
}
|
||||
"sorting": {
|
||||
"sortBy": string
|
||||
"sortOrder": string
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,7 +19,7 @@ export interface Question {
|
||||
color?: string;
|
||||
guestAccessible?: boolean;
|
||||
};
|
||||
options?: string[]; // For multiple choice
|
||||
options?: string[] | { id: string; text: string }[]; // For multiple choice
|
||||
correctAnswer: string | string[];
|
||||
explanation: string;
|
||||
points: number;
|
||||
|
||||
@@ -1,5 +1,42 @@
|
||||
import { Category } from './category.model';
|
||||
import { Question } from './question.model';
|
||||
|
||||
export interface QuizSessionHistory {
|
||||
|
||||
"time": {
|
||||
"spent": number,
|
||||
"limit": number | null,
|
||||
"percentage": number
|
||||
},
|
||||
"createdAt": "2025-12-19T18:49:58.000Z"
|
||||
id: string;
|
||||
|
||||
category?: {
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
icon: string;
|
||||
color: string;
|
||||
};
|
||||
quizType: QuizType;
|
||||
difficulty: string;
|
||||
questions: {
|
||||
answered: number,
|
||||
total: number,
|
||||
correct: number,
|
||||
accuracy: number
|
||||
};
|
||||
score: {
|
||||
earned: number
|
||||
total: number
|
||||
percentage: number
|
||||
};
|
||||
|
||||
status: QuizStatus;
|
||||
startedAt: string;
|
||||
completedAt?: string;
|
||||
isPassed?: boolean;
|
||||
}
|
||||
/**
|
||||
* Quiz Session Interface
|
||||
* Represents an active or completed quiz session
|
||||
@@ -40,6 +77,16 @@ export type QuizStatus = 'in_progress' | 'completed' | 'abandoned';
|
||||
* Quiz Start Request
|
||||
*/
|
||||
export interface QuizStartRequest {
|
||||
success: true;
|
||||
data: {
|
||||
categoryId: string;
|
||||
questionCount: number;
|
||||
difficulty?: string; // 'easy', 'medium', 'hard', 'mixed'
|
||||
quizType?: QuizType;
|
||||
};
|
||||
}
|
||||
export interface QuizStartFormRequest {
|
||||
|
||||
categoryId: string;
|
||||
questionCount: number;
|
||||
difficulty?: string; // 'easy', 'medium', 'hard', 'mixed'
|
||||
@@ -51,10 +98,12 @@ export interface QuizStartRequest {
|
||||
*/
|
||||
export interface QuizStartResponse {
|
||||
success: boolean;
|
||||
sessionId: string;
|
||||
questions: Question[];
|
||||
totalQuestions: number;
|
||||
message?: string;
|
||||
data: {
|
||||
sessionId: string;
|
||||
questions: Question[];
|
||||
totalQuestions: number;
|
||||
message?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user