@project-sunbird/collection-editor-react 0.1.18 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,8 @@ interface ContentPlayerProps {
5
5
  node: INode;
6
6
  editorMode: EditorMode;
7
7
  type: 'content' | 'quml';
8
+ /** For type='quml': render a single question rather than the whole set. */
9
+ singleQuestion?: boolean;
8
10
  }
9
11
  export declare const ContentPlayer: React.FC<ContentPlayerProps>;
10
12
  export {};
@@ -0,0 +1,23 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+
3
+ interface UseQumlContentOptions {
4
+ enabled?: boolean;
5
+ }
6
+ /**
7
+ * Builds a single-question questionset hierarchy from an enriched base set,
8
+ * mirroring Angular's qumlplayer-page.component.initQumlPlayer(): keep the
9
+ * questionset shell but expose only the selected question, so the player
10
+ * renders exactly one question.
11
+ */
12
+ export declare function buildSingleQuestionHierarchy(base: Record<string, unknown>, questionId: string): Record<string, unknown> | null;
13
+ /**
14
+ * Fetches and assembles the QuestionSet metadata a QuML player needs.
15
+ * - reads the questionset hierarchy
16
+ * - collects all question identifiers from the tree
17
+ * - fetches full question bodies via /question/v2/list
18
+ * - replaces question stubs in the hierarchy with the full data
19
+ * - backfills outcomeDeclaration.maxScore where missing
20
+ * The result is passed straight to <sunbird-quml-player> as `metadata`.
21
+ */
22
+ export declare function useQumlContent(questionSetId: string, options?: UseQumlContentOptions): UseQueryResult<Record<string, unknown>, Error>;
23
+ export {};