2024-09-28 17:29:21 -04:00
|
|
|
import { ObjectId } from 'mongodb';
|
2024-09-30 11:49:15 -04:00
|
|
|
import { Folder } from './folder';
|
|
|
|
|
import { User } from './user';
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-09-28 17:29:21 -04:00
|
|
|
export class Quiz {
|
2024-09-30 11:49:15 -04:00
|
|
|
public created_at: Date;
|
|
|
|
|
public updated_at: Date;
|
|
|
|
|
|
|
|
|
|
constructor(public folder: Folder, public user: User, public title: string, public content: string, public _id?: ObjectId) {
|
|
|
|
|
this.folder = folder;
|
|
|
|
|
this.user = user;
|
2024-09-28 17:29:21 -04:00
|
|
|
this.title = title;
|
|
|
|
|
this.content = content;
|
|
|
|
|
this.created_at = new Date();
|
|
|
|
|
this.updated_at = new Date();
|
2024-03-29 20:08:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-09-30 11:49:15 -04:00
|
|
|
// async getOwner(quizId: string): Promise<string | null> {
|
|
|
|
|
// return await this.repository.getOwner(quizId);
|
|
|
|
|
// }
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-09-30 11:49:15 -04:00
|
|
|
// async getContent(quizId: string): Promise<string | null> {
|
|
|
|
|
// return await this.repository.getContent(quizId);
|
|
|
|
|
// }
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-09-30 11:49:15 -04:00
|
|
|
// async delete(quizId: string): Promise<boolean> {
|
|
|
|
|
// return await this.repository.delete(quizId);
|
|
|
|
|
// }
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-09-30 11:49:15 -04:00
|
|
|
// async deleteQuizzes(folderId: string): Promise<number> {
|
|
|
|
|
// return await this.repository.deleteQuizzes(folderId);
|
|
|
|
|
// }
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-09-30 11:49:15 -04:00
|
|
|
// async update(quizId: string, updateData: Partial<Quiz>): Promise<boolean> {
|
|
|
|
|
// return await this.repository.update(quizId, updateData);
|
|
|
|
|
// }
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-09-30 11:49:15 -04:00
|
|
|
// async move(quizId: string, newFolderId: string): Promise<boolean> {
|
|
|
|
|
// return await this.repository.move(quizId, newFolderId);
|
|
|
|
|
// }
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-09-30 11:49:15 -04:00
|
|
|
// async duplicate(quizId: string): Promise<ObjectId | null> {
|
|
|
|
|
// return await this.repository.duplicate(quizId);
|
|
|
|
|
// }
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-09-30 11:49:15 -04:00
|
|
|
// async quizExists(title: string, userId: string): Promise<boolean> {
|
|
|
|
|
// return await this.repository.quizExists(title, userId);
|
|
|
|
|
// }
|
2024-03-29 20:08:34 -04:00
|
|
|
}
|