괄호 안의 항을 2, 3, 4 항으로 설정하는 기능 추가
This commit is contained in:
@@ -23,10 +23,11 @@ export default function FeedbackPanel({
|
||||
onNext,
|
||||
}: FeedbackPanelProps) {
|
||||
const nextButtonRef = useRef<HTMLButtonElement>(null);
|
||||
const signedTerms = [
|
||||
problem.a,
|
||||
problem.operator === "-" ? -problem.b : problem.b,
|
||||
] as const;
|
||||
const signedTerms = problem.terms.map((term, index) => {
|
||||
if (index === 0) return term;
|
||||
|
||||
return problem.operators[index - 1] === "-" ? -term : term;
|
||||
});
|
||||
const feedbackItems = signedTerms.map((term, index) => ({
|
||||
formulaLatex: `${formatSignedNumber(
|
||||
problem.multiplier,
|
||||
|
||||
Reference in New Issue
Block a user