fix(worksheets): align makeEasier fallback with spec priorities

Fix makeEasier fallback to match spec (line 866):
"makeEasier: Add support first (scaffolding), then reduce complexity (regrouping)"

Previous implementation tried regrouping first, which was backwards.

Pedagogical rationale: Give more help first while problems stay same
difficulty, then simplify problems once they have support structures
in place.

This creates intentionally different but pedagogically sound paths for
harder vs easier navigation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock
2025-11-07 13:54:08 -06:00
parent a170209b2f
commit 3e56e1d6b6

View File

@@ -1041,22 +1041,20 @@ export function makeEasier(
}
// Fallback: If we couldn't move toward preset, try any valid easier move
// Per spec: makeEasier should add support (scaffolding) first, then reduce complexity (regrouping)
if (!moved) {
// Try decreasing regrouping first
if (newRegroupingIdx > 0) {
// Try decreasing scaffolding (adding help) first
if (newScaffoldingIdx > 0 && isValidCombination(newRegroupingIdx, newScaffoldingIdx - 1)) {
newScaffoldingIdx--
moved = true
}
// Otherwise try decreasing regrouping (reducing complexity)
else if (newRegroupingIdx > 0) {
const testRegroupingIdx = newRegroupingIdx - 1
newRegroupingIdx = testRegroupingIdx
newScaffoldingIdx = clampScaffoldingToValidRange(testRegroupingIdx, newScaffoldingIdx)
moved = true
}
// Otherwise try decreasing scaffolding (adding help)
else if (
newScaffoldingIdx > 0 &&
isValidCombination(newRegroupingIdx, newScaffoldingIdx - 1)
) {
newScaffoldingIdx--
moved = true
}
}
}