Repository navigation
feat: Enhance Dynamic Assess functionality and improve content handling - #7
Conversation
Deeksha1502
commented
Oct 23, 2026
- Introduced new endpoints and fields for Dynamic Course Assessment in ContentEditorService.
- Added logic to handle reading and refreshing content body specifically for Dynamic Assess.
- Implemented new utility functions for determining the deepest category code and handling skill pool counts.
- Enhanced taxonomy tests to cover new functionality.
- Updated mock services to simulate new Dynamic Assess behaviors.
- Expanded useEditor hook to manage Dynamic Assess state, including refresh polling and validation for skill and difficulty target.
- Added tests for Dynamic Assess content view gating, refresh body polling, and edge cases in generation.
- Introduced new endpoints and fields for Dynamic Course Assessment in ContentEditorService. - Added logic to handle reading and refreshing content body specifically for Dynamic Assess. - Implemented new utility functions for determining the deepest category code and handling skill pool counts. - Enhanced taxonomy tests to cover new functionality. - Updated mock services to simulate new Dynamic Assess behaviors. - Expanded useEditor hook to manage Dynamic Assess state, including refresh polling and validation for skill and difficulty target. - Added tests for Dynamic Assess content view gating, refresh body polling, and edge cases in generation.
There was a problem hiding this comment.
🟡 Changes recommended
Generation completion detection, framework-dependent state, and asynchronous interaction handling have unresolved correctness issues.
11 open issues
Disable background mutations throughout generation · New Keep Dynamic Assess skills disabled for empty framework selection · New Ignore stale framework responses from overlapping requests · New Avoid masking single-select values during taxonomy resets · New Send an explicit empty skill array when clearing Dynamic Assess · New Invalidate pending saves when the drawer closes or session changes · New Clear Dynamic Assess skills when their parent category resets · New Parse JSON-string dynamic assessment targets before staleness checks · New Invalidate generation when framework category identity changes · New Allow string difficulty targets in the public content type · New Avoid using post-completion reads as the generation baseline · New
What changed in this PR
Adds Dynamic Course Assessment support to the content editor, covering metadata configuration, question generation, learner-specific previews, and review/publish validation.
Changes:
- Adds generation endpoints, pool availability checks, and framework-based skill selection.
- Introduces generation polling, stale-settings checks, and assessment preview handling.
- Expands tests, interface states, and translations across six languages.
| File | Description |
|---|---|
| src/useEditor.ts | Coordinates generation, polling, and submission guards. |
| src/useEditor.test.ts | Tests generation lifecycle and review gating. |
| src/types.ts | Adds assessment metadata fields. |
| src/test/mockEd.ts | Extends framework and pool service mocks. |
| src/taxonomy.ts | Finds the deepest framework category. |
| src/taxonomy.test.ts | Tests deepest-category selection. |
| src/services/ContentEditorService.ts | Adds generation, pool search, and body-read support. |
| src/services/ContentEditorService.test.ts | Tests assessment API requests and responses. |
| src/poolPlan.ts | Calculates question-pool feasibility and allocation. |
| src/poolPlan.test.ts | Tests allocation constraints and shortfalls. |
| src/icons.tsx | Adds refresh and information icons. |
| src/i18n/translations.ta.ts | Adds Tamil assessment messages. |
| src/i18n/translations.pt.ts | Adds Portuguese assessment messages. |
| src/i18n/translations.hi.ts | Adds Hindi assessment messages. |
| src/i18n/translations.fr.ts | Adds French assessment messages. |
| src/i18n/translations.en.ts | Adds English assessment messages. |
| src/i18n/translations.ar.ts | Adds Arabic assessment messages. |
| src/i18n/i18n.test.ts | Checks translation coverage and placeholders. |
| src/editor.scss | Styles generation overlays, warnings, and hints. |
| src/dynamicAssessDraw.ts | Implements learner draws and generation-state comparisons. |
| src/dynamicAssessDraw.test.ts | Tests deterministic draws and stale settings. |
| src/difficultyTarget.ts | Parses and serializes difficulty targets. |
| src/ContentEditor.tsx | Displays empty, generating, and stale assessment states. |
| src/ContentEditor.test.tsx | Tests assessment interface states. |
| src/constants.ts | Defines pool multiplier and minimum contribution. |
| src/components/MetadataDrawer.tsx | Adds assessment fields and pool validation. |
| src/components/MetadataDrawer.test.tsx | Tests configuration, framework selection, and validation. |
| src/components/Header.tsx | Adds regeneration and assessment action gating. |
| src/components/Header.test.tsx | Tests regeneration controls and disabled hints. |
| src/components/EditorPreview.tsx | Passes learner-specific generated bodies to the renderer. |
| src/components/EditorPreview.test.tsx | Tests generated-body delivery and ordinary-content behavior. |
Review effort: Balanced
…pest category field [SBCOSS-1190]
…r and show the per-skill minimum [SBCOSS-1190]
…arget panel [SBCOSS-1190]
There was a problem hiding this comment.
Read through the whole diff (did not run the build or tests).
The non-Dynamic path is genuinely untouched, the refresh/body call sends the right envelope and is tested against the real wire format, and the polling loop already handles bounds, retry, cancel and unlock. All 43 new keys exist in all six locales.
One blocker: the draw is missing the multiplier cap, so an undersized pool gets shown whole. Same miss as the portal PR. Details inline.
One extra note that isn't on a changed line, so no inline comment: in MetadataDrawer.tsx around line 260, readFramework responses are applied with no sequence guard. loadedFw.current stops a repeat fetch for the same framework but not out-of-order replies on a quick A→B→A switch — and that response decides which field skills get written to. Pre-existing, worth a look sometime.
- Cap each level of the draw at generated / multiplier, using the content's own multiplier, so the pool is never shown - Detect generation by the generated body vs the pre-request one, guard overlapping polls, count hidden-tab ticks - Block saves, review, publish and collaborator writes while generation runs; require a user id before generating - Regenerate when only the framework changes (not for content saved without one) - Framework picker: placeholder keeps Skill disabled, only the latest framework read applies, reset only multiselect values on switch, clear skills when their parent category changes - Send [] when the last skill is removed; drop a generating save if the drawer closes during the pool check - Parse a JSON-string generated target; difficultyTarget type accepts the API's string form - Retry each pool count search once; memoise needsGeneration; Record<string, unknown> in the draw path - Tests use literal expected ids and cover an undersized pool
