Edu SDKEdu SDK
Core

createQuiz

Generate a multiple-choice quiz from educational content.

Generates a multiple-choice quiz from educational content.

Usage

import { createQuiz } from "edu-sdk";

const quiz = await createQuiz({
  model: "google/gemini-3.6-flash",
  content,
  count: 10,
  difficulty: "hard",
  numOfOptions: 4
});

Options

OptionTypeRequiredDefault
modelstring | LanguageModelYes
contentstringYes
countnumber (positive int)Yes
difficulty"easy" | "medium" | "hard"No"medium"
numOfOptionsnumber (min 2)No4

Returns

Promise<QuizQuestion[]>

Each question contains:

{
  question: string;
  options: string[];
  correctAnswer: number;
}

correctAnswer is zero-indexed.

Example

import { createQuiz } from "edu-sdk";

const quiz = await createQuiz({
  model: "google/gemini-3.6-flash",
  content: notes,
  count: 10,
  difficulty: "medium"
});

Render with <Quiz />.

On this page