diff --git a/apps/web/src/components/tutorial/PracticeStepEditor.tsx b/apps/web/src/components/tutorial/PracticeStepEditor.tsx index 20ee36c4..16f962c8 100644 --- a/apps/web/src/components/tutorial/PracticeStepEditor.tsx +++ b/apps/web/src/components/tutorial/PracticeStepEditor.tsx @@ -5,9 +5,8 @@ import { css } from '../../../styled-system/css' import { vstack, hstack } from '../../../styled-system/patterns' import { PracticeStep, createBasicSkillSet } from '../../types/tutorial' import { SkillSelector, SkillConfiguration } from './SkillSelector' -import { validatePracticeStepConfiguration, generateSingleProblem } from '../../utils/problemGenerator' +import { validatePracticeStepConfiguration } from '../../utils/problemGenerator' import { createBasicAllowedConfiguration, skillConfigurationToSkillSets } from '../../utils/skillConfiguration' -import type { GeneratedProblem } from '../../utils/problemGenerator' interface PracticeStepEditorProps { step: PracticeStep @@ -23,7 +22,6 @@ export function PracticeStepEditor({ className }: PracticeStepEditorProps) { const [showAdvanced, setShowAdvanced] = useState(false) - const [sampleProblems, setSampleProblems] = useState([]) const [validationResult, setValidationResult] = useState | null>(null) const [skillConfig, setSkillConfig] = useState(() => { // Initialize with a basic configuration for new steps or convert from existing @@ -76,34 +74,6 @@ export function PracticeStepEditor({ setValidationResult(result) }, [step]) - // Generate sample problems - const generateSampleProblems = useCallback(() => { - const samples: GeneratedProblem[] = [] - const maxSamples = Math.min(3, step.problemCount) // Show up to 3 samples - const { required, target, forbidden } = skillConfigurationToSkillSets(skillConfig) - - for (let i = 0; i < maxSamples; i++) { - const problem = generateSingleProblem( - { - numberRange: step.numberRange || { min: 1, max: 9 }, - maxSum: step.sumConstraints?.maxSum, - minSum: step.sumConstraints?.minSum, - maxTerms: step.maxTerms, - problemCount: step.problemCount - }, - required, - target, - forbidden, - 50 // More attempts for samples - ) - - if (problem) { - samples.push(problem) - } - } - - setSampleProblems(samples) - }, [step, skillConfig]) const presetConfigurations = [ { @@ -287,6 +257,7 @@ export function PracticeStepEditor({ })} /> + @@ -544,137 +515,20 @@ export function PracticeStepEditor({ )} - {/* Sample Problems Preview */} + {/* Note about preview */}
-
-
- Sample Problems Preview -
- -
- - {sampleProblems.length > 0 ? ( -
- {sampleProblems.map((problem, index) => ( -
- {/* Compact vertical problem display */} -
- {problem.terms.map((term, termIndex) => ( -
- {term} -
- ))} -
- {problem.answer} -
-
- - {/* Difficulty badge below */} - - {problem.difficulty} - -
- ))} -
- ) : ( -
- Click "Generate" to see sample problems -
- )} - - {/* Skills summary below problems */} - {sampleProblems.length > 0 && ( -
- Skills used: {[...new Set(sampleProblems.flatMap(p => p.requiredSkills))].join(', ')} -
- )} - - {/* Configuration Summary */}
-

Problems: {step.problemCount} problems, {step.maxTerms} terms max

-

Numbers: {step.numberRange?.min || 1} to {step.numberRange?.max || 9}

-

Sum limit: {step.sumConstraints?.maxSum || 9}

-

Skills required: { - Object.entries(step.requiredSkills.basic).filter(([, enabled]) => enabled).length + - Object.entries(step.requiredSkills.fiveComplements).filter(([, enabled]) => enabled).length + - Object.entries(step.requiredSkills.tenComplements).filter(([, enabled]) => enabled).length - } skills enabled

+ 💡 Tip: Check the preview panel on the right to see generated sample problems based on your configuration.