Edu SDKEdu SDK
React

PracticeProblems

Render practice problems generated by createPracticeProblems.

Renders practice problems from createPracticeProblems(). Students can reveal hint, answer, and solution.

Usage

import { PracticeProblems } from "@edu-sdk/react";
import "@edu-sdk/react/styles.css";

<PracticeProblems problems={problems} />

Props

type PracticeProblemsProps = {
  problems: PracticeProblem[];
  className?: string;
  classNames?: PracticeProblemsClassNames;
};

classNames

KeyPart
rootRoot container
progressProblem index
problemCurrent problem
questionQuestion text
actionsReveal buttons
hintButtonHint button
answerButtonAnswer button
solutionButtonSolution button
hintHint panel
answerAnswer panel
solutionSolution panel
controlsPrevious / next row
previousButtonPrevious button
nextButtonNext button

Example

<PracticeProblems
  problems={problems}
  className="my-problems"
  classNames={{
    question: "my-question",
    hint: "my-hint"
  }}
/>

See Styling for styles.css and CSS variables.

On this page