Skip to content

feat: Enhance Dynamic Assess functionality and improve content handling - #7

Merged
pallakartheekreddy merged 7 commits into
Sunbird-Knowlg:v1.1.2from
Deeksha1502:feat/dynamic-assess
Nov 3, 2026
Merged

pallakartheekreddy merged 7 commits into
Sunbird-Knowlg:v1.1.2from
Deeksha1502:feat/dynamic-assess

Conversation

@Deeksha1502

Copy link
Copy Markdown
Collaborator
  • 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.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 10:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Generation completion detection, framework-dependent state, and asynchronous interaction handling have unresolved correctness issues.

11 open issues
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

Comment thread src/ContentEditor.tsx Resolved
Comment thread src/components/MetadataDrawer.tsx Resolved
Comment thread src/components/MetadataDrawer.tsx Resolved
Comment thread src/components/MetadataDrawer.tsx Resolved
Comment thread src/components/MetadataDrawer.tsx Resolved
Comment thread src/components/MetadataDrawer.tsx Resolved
Comment thread src/dynamicAssessDraw.ts Resolved
Comment thread src/dynamicAssessDraw.ts Resolved
Comment thread src/types.ts Resolved
Comment thread src/useEditor.ts Resolved
@Deeksha1502
Deeksha1502 changed the base branch from main to v1.1.2 November 2, 2026 06:46

@pallakartheekreddy pallakartheekreddy left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/dynamicAssessDraw.ts Resolved
Comment thread src/dynamicAssessDraw.test.ts Resolved
Comment thread src/useEditor.ts Resolved
Comment thread src/components/MetadataDrawer.tsx Resolved
Comment thread src/services/ContentEditorService.ts Resolved
Comment thread src/useEditor.ts Resolved
Comment thread src/useEditor.ts Resolved
Comment thread src/useEditor.ts Resolved
Comment thread src/components/MetadataDrawer.tsx Resolved
Comment thread src/dynamicAssessDraw.ts Resolved
- 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
@pallakartheekreddy
pallakartheekreddy merged commit a6ba003 into Sunbird-Knowlg:v1.1.2 Nov 3, 2026
1 check passed
@Deeksha1502 Deeksha1502 mentioned this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants