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
| Key | Part |
|---|---|
root | Root container |
progress | Problem index |
problem | Current problem |
question | Question text |
actions | Reveal buttons |
hintButton | Hint button |
answerButton | Answer button |
solutionButton | Solution button |
hint | Hint panel |
answer | Answer panel |
solution | Solution panel |
controls | Previous / next row |
previousButton | Previous button |
nextButton | Next button |
Example
<PracticeProblems
problems={problems}
className="my-problems"
classNames={{
question: "my-question",
hint: "my-hint"
}}
/>See Styling for styles.css and CSS variables.