Skip to content

Commit 60a70b6

Browse files
committed
ajusta erro de lint
1 parent 9653ffa commit 60a70b6

File tree

2 files changed

+38
-30
lines changed

2 files changed

+38
-30
lines changed

frontend/src/app/(home)/create/page.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export interface QuestionData {
3333
correct: boolean;
3434
explanation: string;
3535
}[];
36+
theme_id: string;
37+
sub_topic_id: string;
3638
}
3739

3840
type Step = "setup" | "questions";
@@ -77,6 +79,8 @@ export default function CreateQuiz() {
7779
correct: alt.correta,
7880
explanation: alt.explicacao,
7981
})),
82+
theme_id: pergunta.theme_id,
83+
sub_topic_id: pergunta.sub_topic_id,
8084
}));
8185
};
8286

@@ -135,24 +139,24 @@ export default function CreateQuiz() {
135139
text: automaticData.text,
136140
num_questions: automaticData.num_questions,
137141
num_alternatives: automaticData.num_alternatives,
138-
theme_id: themeId,
139-
sub_topic_id: subTopicId
142+
theme_id: themeId!,
143+
sub_topic_id: subTopicId!
140144
});
141145
} else if (automaticData.mode === "audio" && automaticData.file) {
142146
response = await createQuizFromAudio({
143147
file: automaticData.file,
144148
num_questions: automaticData.num_questions,
145149
num_alternatives: automaticData.num_alternatives,
146-
theme_id: themeId,
147-
sub_topic_id: subTopicId
150+
theme_id: themeId!,
151+
sub_topic_id: subTopicId!
148152
});
149153
} else if (automaticData.mode === "document" && automaticData.file) {
150154
response = await createQuizFromDocument({
151155
file: automaticData.file,
152156
num_questions: automaticData.num_questions,
153157
num_alternatives: automaticData.num_alternatives,
154-
theme_id: themeId,
155-
sub_topic_id: subTopicId
158+
theme_id: themeId!,
159+
sub_topic_id: subTopicId!
156160
});
157161
}
158162

frontend/src/util/types/quiz.ts

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
export interface QuizAlternativa {
2-
letra: string;
3-
texto: string;
4-
correta: boolean;
5-
explicacao: string;
2+
letra: string;
3+
texto: string;
4+
correta: boolean;
5+
explicacao: string;
66
}
77

88
export interface QuizPergunta {
9-
pergunta: string;
10-
alternativas: QuizAlternativa[];
9+
pergunta: string;
10+
alternativas: QuizAlternativa[];
11+
theme_id: string;
12+
sub_topic_id: string;
1113
}
1214

1315
export interface QuizResponse {
14-
perguntas: QuizPergunta[];
16+
perguntas: QuizPergunta[];
1517
}
1618

1719
export interface CreateQuizTextRequest {
18-
text: string;
19-
theme_id: string;
20-
sub_topic_id: string;
21-
num_questions?: number;
22-
num_alternatives?: number;
20+
text: string;
21+
theme_id: string;
22+
sub_topic_id: string;
23+
num_questions?: number;
24+
num_alternatives?: number;
2325
}
2426

2527
export interface CreateQuizFileRequest {
26-
file: File;
27-
theme_id: string;
28-
sub_topic_id: string;
29-
num_questions?: number;
30-
num_alternatives?: number;
28+
file: File;
29+
theme_id: string;
30+
sub_topic_id: string;
31+
num_questions?: number;
32+
num_alternatives?: number;
3133
}
3234

3335
export interface UseQuizReturn {
34-
loading: boolean;
35-
error: string | null;
36-
createQuizFromText: (data: CreateQuizTextRequest) => Promise<QuizResponse>;
37-
createQuizFromDocument: (data: CreateQuizFileRequest) => Promise<QuizResponse>;
38-
createQuizFromAudio: (data: CreateQuizFileRequest) => Promise<QuizResponse>;
39-
clearError: () => void;
40-
}
36+
loading: boolean;
37+
error: string | null;
38+
createQuizFromText: (data: CreateQuizTextRequest) => Promise<QuizResponse>;
39+
createQuizFromDocument: (
40+
data: CreateQuizFileRequest
41+
) => Promise<QuizResponse>;
42+
createQuizFromAudio: (data: CreateQuizFileRequest) => Promise<QuizResponse>;
43+
clearError: () => void;
44+
}

0 commit comments

Comments
 (0)