Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
akashrchandran committed May 11, 2024
1 parent 9138332 commit 3a2e4af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/app/api/questions/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function POST(req: Request, res: Response) {
const { count, context, type, model } = quizFormSchema.parse(body);
let questions: any;
let topic: any;
if (type === "fib" && model === "prepportal") {
if (type === "fib" && model === "MMQG-T") {
const response = await axios.post(
`${process.env.BACKEND_URL as string}/generate`,
{
Expand All @@ -45,7 +45,7 @@ export async function POST(req: Request, res: Response) {
}
);
topic = questions[0].topic;
} else if (type === "mcq" && model === "prepportal") {
} else if (type === "mcq" && model === "MMQG-T") {
const response = await axios.post(
`${process.env.BACKEND_URL as string}/generate`,
{
Expand Down Expand Up @@ -73,7 +73,7 @@ export async function POST(req: Request, res: Response) {
}
);
topic = questions[0].topic;
} else if (type === "truefalse" && model === "prepportal") {
} else if (type === "truefalse" && model === "MMQG-T") {
const response = await axios.post(
`${process.env.BACKEND_URL as string}/generate`,
{
Expand Down
8 changes: 4 additions & 4 deletions src/components/forms/QuizCreation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const QuizCreation = (props: Props) => {
context: "",
count: 3,
type: "mcq",
model: "prepportal",
model: "MMQG-T",
},
});
const { setValue } = form;
Expand Down Expand Up @@ -195,17 +195,17 @@ const QuizCreation = (props: Props) => {
<div className="flex justify-between">
<Button
variant={
form.getValues("model") === "prepportal"
form.getValues("model") === "MMQG-T"
? "default"
: "secondary"
}
className="w-1/2 rounded-none rounded-l-lg"
onClick={() => {
form.setValue("model", "prepportal");
form.setValue("model", "MMQG-T");
}}
type="button"
>
<Zap className="w-4 h-4 mr-2" /> Prepportal
<Zap className="w-4 h-4 mr-2" /> MMQG-T
</Button>
<Separator orientation="vertical" />
<Button
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/form/quiz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const quizFormSchema = z.object({
context: z.string().min(150, {message: "Context must be atleast 150 characters long.",}),
//ye to topic k liye ho gaya
//ab question kis type ka hoga
model: z.enum(['prepportal', 'gpt']),
model: z.enum(['MMQG-T', 'gpt']),

type : z.enum(['mcq', 'fib', 'truefalse']),

Expand Down

0 comments on commit 3a2e4af

Please sign in to comment.