@project-sunbird/sunbird-questionset-editor-web-component-react 0.1.20 → 0.1.22-alpha
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.
- package/dist/api/competencyFramework.d.ts +15 -0
- package/dist/api/competencyFramework.test.d.ts +1 -0
- package/dist/api/content.d.ts +6 -0
- package/dist/api/dynamicAssessApi.test.d.ts +1 -0
- package/dist/api/hierarchy.d.ts +2 -0
- package/dist/api/urls.d.ts +5 -0
- package/dist/components/LibraryDock/SkillChips.d.ts +12 -0
- package/dist/components/SkillFrameworkFields/SkillFrameworkFields.d.ts +22 -0
- package/dist/components/SparkMetaForm/MinQuestionsPanel.d.ts +13 -0
- package/dist/components/SparkMetaForm/MinQuestionsPanel.test.d.ts +1 -0
- package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +13 -1
- package/dist/components/SparkMetaForm/SparkMetaForm.test.d.ts +1 -0
- package/dist/components/shared/GeneratingOverlay.d.ts +6 -0
- package/dist/components/shared/GeneratingOverlay.test.d.ts +1 -0
- package/dist/components/shared/RegenerateButton.d.ts +4 -0
- package/dist/components/shared/StaleSettingsBanner.d.ts +8 -0
- package/dist/hooks/checkPool.test.d.ts +1 -0
- package/dist/hooks/useDynamicSkillField.d.ts +2 -0
- package/dist/hooks/useFramework.d.ts +13 -0
- package/dist/hooks/useFramework.test.d.ts +1 -0
- package/dist/hooks/useIsDynamicAssess.d.ts +2 -0
- package/dist/hooks/useLibrary.d.ts +41 -1
- package/dist/hooks/useLibrary.test.d.ts +1 -0
- package/dist/hooks/useRefreshQuestionSetBody.d.ts +62 -0
- package/dist/hooks/useRefreshQuestionSetBody.flow.test.d.ts +1 -0
- package/dist/hooks/useRefreshQuestionSetBody.test.d.ts +1 -0
- package/dist/hooks/useSaveHierarchy.d.ts +5 -0
- package/dist/hooks/useSaveHierarchy.test.d.ts +1 -0
- package/dist/hooks/useSaveQuestion.d.ts +7 -0
- package/dist/hooks/useSaveQuestion.skillFramework.test.d.ts +1 -0
- package/dist/hooks/useSaveQuestion.test.d.ts +1 -0
- package/dist/hooks/useSkillFramework.d.ts +55 -0
- package/dist/hooks/useSkillFramework.test.d.ts +1 -0
- package/dist/index.js +8787 -7726
- package/dist/locales/label.config.ar.json.d.ts +61 -3
- package/dist/locales/label.config.fr.json.d.ts +61 -3
- package/dist/locales/label.config.hi.json.d.ts +66 -0
- package/dist/locales/label.config.json.d.ts +61 -3
- package/dist/locales/label.config.pt.json.d.ts +61 -3
- package/dist/store/library.store.d.ts +19 -0
- package/dist/store/library.store.test.d.ts +1 -0
- package/dist/store/question.store.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/types/content.d.ts +5 -0
- package/dist/types/editor.d.ts +3 -0
- package/dist/types/question.d.ts +2 -1
- package/dist/utils/competencyLeaves.d.ts +43 -0
- package/dist/utils/competencyLeaves.test.d.ts +1 -0
- package/dist/utils/context.d.ts +8 -0
- package/dist/utils/difficultyLevelField.d.ts +7 -0
- package/dist/utils/difficultyLevelField.test.d.ts +1 -0
- package/dist/utils/difficultyTarget.d.ts +8 -0
- package/dist/utils/dynamicAssessDraw.d.ts +19 -0
- package/dist/utils/dynamicAssessDraw.test.d.ts +1 -0
- package/dist/utils/dynamicAssessLabels.test.d.ts +1 -0
- package/dist/utils/poolPlan.d.ts +18 -0
- package/dist/utils/poolPlan.test.d.ts +1 -0
- package/dist/utils/skillChips.d.ts +20 -0
- package/dist/utils/skillChips.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CompetencyCategoryWire } from '../utils/competencyLeaves';
|
|
2
|
+
export interface ICompetencyFrameworkSummary {
|
|
3
|
+
identifier: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Live skill (competency) frameworks of the channel - `CompetencyFramework` objects, which never
|
|
8
|
+
* appear in the curriculum Framework list. Filtered by channel, as the course and content editors do:
|
|
9
|
+
* the X-Channel-Id header alone doesn't narrow the search, so other channels' frameworks would show.
|
|
10
|
+
*/
|
|
11
|
+
export declare function listCompetencyFrameworks(channel?: string): Promise<ICompetencyFrameworkSummary[]>;
|
|
12
|
+
/** A skill framework with its categories and terms. */
|
|
13
|
+
export declare function getCompetencyFramework(frameworkId: string): Promise<{
|
|
14
|
+
categories?: CompetencyCategoryWire[];
|
|
15
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/api/content.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IContent } from '../types/content';
|
|
2
|
+
/** Fields the library asks search for by default. */
|
|
3
|
+
export declare const DEFAULT_SEARCH_FIELDS: string[];
|
|
2
4
|
export declare function compositeSearch(params: {
|
|
3
5
|
filters?: Record<string, unknown>;
|
|
4
6
|
query?: string;
|
|
@@ -11,3 +13,7 @@ export declare function compositeSearch(params: {
|
|
|
11
13
|
content: IContent[];
|
|
12
14
|
count: number;
|
|
13
15
|
}>;
|
|
16
|
+
/** Live Question counts per skill x difficultyLevel, the availability the job allocates from (same channel + category filters, no visibility filter). */
|
|
17
|
+
export declare function questionBucketCounts(categoryField: string, skills: string[], channel?: string): Promise<Record<string, Record<'E' | 'M' | 'D', number>>>;
|
|
18
|
+
/** Live Question counts per skill, with the same filters knowlg-service uses to reject a refresh (no channel, any level). */
|
|
19
|
+
export declare function questionSkillCounts(categoryField: string, skills: string[]): Promise<Record<string, number>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/api/hierarchy.d.ts
CHANGED
|
@@ -30,5 +30,7 @@ export declare function addQuestionsToSet(rootId: string, collectionId: string |
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function removeQuestionsFromSet(rootId: string, collectionId: string | null, children: string[]): Promise<void>;
|
|
32
32
|
export declare function publishContent(contentId: string, lastPublishedBy?: string): Promise<void>;
|
|
33
|
+
/** POST questionset/v5/refresh/body/:id: queues pool-based question selection; a pool rejection throws like any other call. */
|
|
34
|
+
export declare function refreshQuestionSetBody(contentId: string): Promise<void>;
|
|
33
35
|
export declare function sendForReview(contentId: string): Promise<void>;
|
|
34
36
|
export declare function rejectContent(contentId: string, comment: string): Promise<void>;
|
package/dist/api/urls.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare const URLS: {
|
|
|
19
19
|
readonly reject: "questionset/v2/reject";
|
|
20
20
|
readonly publish: "questionset/v2/publish";
|
|
21
21
|
readonly systemUpdate: "questionset/v5/system/update";
|
|
22
|
+
readonly refreshBody: "questionset/v5/refresh/body";
|
|
22
23
|
readonly commentRead: "questionset/v2/comment/read";
|
|
23
24
|
readonly commentUpdate: "questionset/v2/comment/update";
|
|
24
25
|
/** Extra read fields absent from the hierarchy response. */
|
|
@@ -38,6 +39,10 @@ export declare const URLS: {
|
|
|
38
39
|
readonly composite: {
|
|
39
40
|
readonly search: "composite/v3/search";
|
|
40
41
|
};
|
|
42
|
+
/** Skill (competency) frameworks: `CompetencyFramework` objects, which `framework/v1/read` 404s on. */
|
|
43
|
+
readonly competencyFramework: {
|
|
44
|
+
readonly read: "competency-framework/v3/read";
|
|
45
|
+
};
|
|
41
46
|
readonly framework: {
|
|
42
47
|
readonly read: "framework/v1/read";
|
|
43
48
|
readonly termRead: "framework/v1/term/read";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IContent } from '../../types/content';
|
|
3
|
+
/**
|
|
4
|
+
* A library question's skills under the set's skill framework, the set's own skills first and
|
|
5
|
+
* highlighted. Renders nothing when the question carries none of that framework's skills.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SkillChips: React.FC<{
|
|
8
|
+
item: IContent;
|
|
9
|
+
cap?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
}>;
|
|
12
|
+
export default SkillChips;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SkillFrameworkFieldsProps {
|
|
3
|
+
/** The chosen skill framework id (`competencyFramework`). */
|
|
4
|
+
frameworkId: string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Called with the new framework id. Omit it to show the framework read-only - a question follows
|
|
7
|
+
* its question set's skill framework.
|
|
8
|
+
*/
|
|
9
|
+
onFrameworkChange?: (frameworkId: string) => void;
|
|
10
|
+
/** Metadata of the node being edited, to read its current skills from the framework's field. */
|
|
11
|
+
values: Record<string, unknown>;
|
|
12
|
+
/** Called with the framework's skill field (`skill`, `cuisine`, ...) and the picked skill codes. */
|
|
13
|
+
onSkillsChange: (skillField: string, codes: string[]) => void;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
idPrefix: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* "Skill framework" + "Skills": tags a question set or question with a skill framework's skills,
|
|
19
|
+
* saved as codes under that framework's own field (its last category's code), as lern reads them.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SkillFrameworkFields: React.FC<SkillFrameworkFieldsProps>;
|
|
22
|
+
export default SkillFrameworkFields;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DifficultyTarget } from '../../utils/difficultyTarget';
|
|
2
|
+
type Label = (key: string, fallback: string) => string;
|
|
3
|
+
/** The fixed example under "See an example": 2 skills and the set's own minCriteria per level, independent of what the creator entered. */
|
|
4
|
+
export declare function exampleLines(minCriteria: number, L: Label): {
|
|
5
|
+
intro: string;
|
|
6
|
+
points: string[];
|
|
7
|
+
};
|
|
8
|
+
/** Dynamic Assess: the set's own per-skill minimum against the live Difficulty Target, once a skill is selected; Save is still blocked by the pool check. */
|
|
9
|
+
export declare function MinQuestionsPanel({ values, target }: {
|
|
10
|
+
values: Record<string, unknown>;
|
|
11
|
+
target: DifficultyTarget;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ICategoryField } from '../../api/categoryDefinition';
|
|
3
|
+
import { toDifficultyTarget, DifficultyTarget } from '../../utils/difficultyTarget';
|
|
3
4
|
/** Shape of a single framework term entry. */
|
|
4
5
|
export interface FrameworkTerm {
|
|
5
6
|
name: string;
|
|
@@ -58,6 +59,7 @@ export interface SparkMetaFormProps {
|
|
|
58
59
|
*/
|
|
59
60
|
isRoot?: boolean;
|
|
60
61
|
}
|
|
62
|
+
export { toDifficultyTarget, type DifficultyTarget };
|
|
61
63
|
/** Exported so callers (e.g. ContextualEditor's tab bar) can check whether a
|
|
62
64
|
* given tab's section has any required field, using the exact same
|
|
63
65
|
* matching rule the tab's own <SparkMetaForm section="..."/> render uses.
|
|
@@ -71,7 +73,17 @@ export interface SelectOption {
|
|
|
71
73
|
value: string;
|
|
72
74
|
label: string;
|
|
73
75
|
}
|
|
74
|
-
export declare function adaptFieldsForFramework(fields: ICategoryField[], frameworkTerms: Map<string, FrameworkTerm[]> | undefined, categoryOrder: string[] | undefined, isRoot: boolean): ICategoryField[];
|
|
76
|
+
export declare function adaptFieldsForFramework(fields: ICategoryField[], frameworkTerms: Map<string, FrameworkTerm[]> | undefined, categoryOrder: string[] | undefined, isRoot: boolean, isDynamicAssess: boolean): ICategoryField[];
|
|
77
|
+
interface MultiSelectSearchProps {
|
|
78
|
+
fieldId: string;
|
|
79
|
+
value: string[];
|
|
80
|
+
options: SelectOption[];
|
|
81
|
+
onChange: (v: string[]) => void;
|
|
82
|
+
readOnly?: boolean;
|
|
83
|
+
placeholder?: string;
|
|
84
|
+
hasError?: boolean;
|
|
85
|
+
}
|
|
86
|
+
export declare const MultiSelectSearch: React.FC<MultiSelectSearchProps>;
|
|
75
87
|
export interface SingleSelectDropdownProps {
|
|
76
88
|
fieldId: string;
|
|
77
89
|
value: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Blocking loader shown while Dynamic Assess questions generate, so a stale tree can't be edited and saved over the job's result. */
|
|
3
|
+
export declare function GeneratingOverlay({ open }: {
|
|
4
|
+
open: boolean;
|
|
5
|
+
}): React.JSX.Element | null;
|
|
6
|
+
export default GeneratingOverlay;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Explains why review is blocked when the saved Skill/Difficulty Target don't match the questions (e.g. a failed or older generation); Save & Generate is the fix. */
|
|
3
|
+
export declare function StaleSettingsBanner({ open, canRegenerate, pending }: {
|
|
4
|
+
open: boolean;
|
|
5
|
+
canRegenerate: boolean;
|
|
6
|
+
pending?: boolean;
|
|
7
|
+
}): React.JSX.Element | null;
|
|
8
|
+
export default StaleSettingsBanner;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { IFramework, ITerm } from '../types/framework';
|
|
2
|
+
import { IEditorConfig } from '../types/editor';
|
|
3
|
+
/** The backend's skill category rule (knowlg-service and the knowlg-publish job): highest `index`, a missing index counts as 0, the first wins on ties. */
|
|
4
|
+
export declare function highestIndexCategoryCode(categories: Array<{
|
|
5
|
+
code: string;
|
|
6
|
+
index?: number;
|
|
7
|
+
}>): string | undefined;
|
|
8
|
+
/** Category codes by ascending `index`, missing last; for Dynamic Assess the backend's skill category is moved last, since Skill binds to the last entry. */
|
|
9
|
+
export declare function orderCategoryCodes(categories: Array<{
|
|
10
|
+
code: string;
|
|
11
|
+
index?: number;
|
|
12
|
+
}>, isDynamicAssess: boolean): string[];
|
|
13
|
+
/** The set's framework id with useFramework's precedence: a live pick, then the set's own, then the host's context/config; shared so Dynamic Assess reads the same framework the form shows. */
|
|
14
|
+
export declare function resolveFrameworkId(config: IEditorConfig | null | undefined, rootFramework: unknown, liveFramework?: string | null): string;
|
|
2
15
|
/**
|
|
3
16
|
* @param overrideFrameworkId - Resolves categories against this framework
|
|
4
17
|
* instead of the root/live one, fully locally to the caller — e.g. a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
import { LibraryFilters } from '../store/library.store';
|
|
2
|
+
import { IContent } from '../types/content';
|
|
3
|
+
/**
|
|
4
|
+
* Filters for the questions that teach the set's skills: the set's skill framework, and at least
|
|
5
|
+
* one of its skills under the framework's own field (a list means "any of").
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildSetLibraryFilters(frameworkId: string, skillField: string, skills: string[]): Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* The "Other questions" list: everything the plain browse found except what carries one of the
|
|
10
|
+
* set's skills, which is exactly what the matching list shows.
|
|
11
|
+
*/
|
|
12
|
+
export declare function selectOtherQuestions(others: IContent[], frameworkId: string, skillField: string, skills: string[]): IContent[];
|
|
13
|
+
/**
|
|
14
|
+
* How many "Other questions" there are: the plain browse's count less the matching ones, which the
|
|
15
|
+
* plain browse also finds (it is the same search without the skill filter).
|
|
16
|
+
*
|
|
17
|
+
* Not done server-side: composite search can exclude the skill codes (`{ [skillField]: { '!=': codes } }`),
|
|
18
|
+
* but not "this framework AND these codes" together, and the skill field (`skill`) is shared with
|
|
19
|
+
* curriculum frameworks, so another framework's question carrying the same code would vanish too.
|
|
20
|
+
*/
|
|
21
|
+
export declare function otherQuestionsTotal(otherCount: number, matchedCount: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* Fields each library search asks for: the defaults plus the skill framework and its skill field
|
|
24
|
+
* once the set's framework is known, so rows can show their skills and "Other questions" can drop
|
|
25
|
+
* the matching ones.
|
|
26
|
+
*/
|
|
27
|
+
export declare function librarySearchFields(skillField: string | undefined): string[] | undefined;
|
|
28
|
+
/** The hint above the library: ask for the set's skills when it has none yet and the channel offers frameworks. */
|
|
29
|
+
export declare function setLibraryHint(opts: {
|
|
30
|
+
ready: boolean;
|
|
31
|
+
hasFrameworks: boolean;
|
|
32
|
+
}): 'pickSkills' | null;
|
|
2
33
|
/**
|
|
3
34
|
* Re-run the library search with whatever query/filter is currently active —
|
|
4
35
|
* e.g. after a new standalone question is created, so it shows up without
|
|
@@ -7,7 +38,16 @@ import { LibraryFilters } from '../store/library.store';
|
|
|
7
38
|
*/
|
|
8
39
|
export declare function refreshLibrary(): void;
|
|
9
40
|
export declare function useLibrary(): {
|
|
10
|
-
content:
|
|
41
|
+
content: IContent[];
|
|
42
|
+
/** The main list holds the questions tagged with the set's skills. */
|
|
43
|
+
skillMatched: boolean;
|
|
44
|
+
otherContent: IContent[];
|
|
45
|
+
/** All "Other questions", not just the loaded ones. */
|
|
46
|
+
otherTotal: number;
|
|
47
|
+
hasMoreOther: boolean;
|
|
48
|
+
otherLoading: boolean;
|
|
49
|
+
loadMoreOther: () => void;
|
|
50
|
+
hint: "pickSkills" | null;
|
|
11
51
|
isLoading: boolean;
|
|
12
52
|
totalCount: number;
|
|
13
53
|
activeFilter: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { SaveOutcome } from './useSaveHierarchy';
|
|
2
|
+
import { DifficultyTarget } from '../utils/difficultyTarget';
|
|
3
|
+
import { DynamicAssessSettings } from '../utils/dynamicAssessDraw';
|
|
4
|
+
import { INode } from '../types/editor';
|
|
5
|
+
import { IFramework } from '../types/framework';
|
|
6
|
+
type Buckets = Record<string, Record<'E' | 'M' | 'D', number>>;
|
|
7
|
+
/** Why the job couldn't generate these settings (it mirrors the job's own allocation, with the set's own minCriteria/multiplier), plus knowlg-service's per-skill floor; empty when generation can go ahead. */
|
|
8
|
+
export declare function poolProblems(skills: string[], target: DifficultyTarget, buckets: Buckets, skillTotals: Record<string, number>, settings?: DynamicAssessSettings): string[];
|
|
9
|
+
/** The minimum-questions panel's rule (each selected skill gets at least minCriteria), checked without a search; the message when the target is below it, else null. */
|
|
10
|
+
export declare function belowSkillMinimum(skillCount: number, target: DifficultyTarget, settings: DynamicAssessSettings): string | null;
|
|
11
|
+
/** Skills below the minCriteria x multiplier Live questions knowlg-service requires before it accepts a refresh. */
|
|
12
|
+
export declare function skillShortfalls(skills: string[], counts: Record<string, number>, settings?: DynamicAssessSettings): string[];
|
|
13
|
+
/** Translates knowlg-service's per-skill rejection, whose message is English-only ("Fewer than 6 Live questions found for skill(s): A, B"). */
|
|
14
|
+
export declare function skillPoolErrorMessage(err: unknown): string | null;
|
|
15
|
+
/** The field the job's pool query filters on: the framework's highest-index category, else "skill". */
|
|
16
|
+
export declare function deepestCategoryCode(framework: IFramework | undefined): string;
|
|
17
|
+
export declare const GENERATE_POLL_MS = 3000;
|
|
18
|
+
export declare const GENERATE_POLL_MAX_ATTEMPTS = 40;
|
|
19
|
+
export type GenerateResult = 'generated' | 'pending' | 'failed' | 'cancelled';
|
|
20
|
+
export interface GenerateDeps {
|
|
21
|
+
contentId: string;
|
|
22
|
+
save: () => Promise<SaveOutcome>;
|
|
23
|
+
refresh: (contentId: string) => Promise<void>;
|
|
24
|
+
read: (contentId: string) => Promise<{
|
|
25
|
+
rootNode: INode;
|
|
26
|
+
}>;
|
|
27
|
+
sleep?: (ms: number) => Promise<void>;
|
|
28
|
+
pollMs?: number;
|
|
29
|
+
maxAttempts?: number;
|
|
30
|
+
/** True once the editor that started this generation has closed or reloaded; the wait then stops without touching the shared stores. */
|
|
31
|
+
isCancelled?: () => boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Bumped whenever an editor opens or closes; the stores are shared, so a generation from an earlier session must not write into the current one. */
|
|
34
|
+
export declare function startEditorSession(): void;
|
|
35
|
+
/** Cancellation check for a generation started now: true once another session has begun. */
|
|
36
|
+
export declare function sessionCancelledCheck(): () => boolean;
|
|
37
|
+
export declare function generationPendingMessage(): string;
|
|
38
|
+
/** Whether a timed-out generation must pause saving, given the tree the editor would save: only children it could write back over the job's result need it. */
|
|
39
|
+
export declare function shouldPauseAfterPending(editorRoot: INode | undefined): boolean;
|
|
40
|
+
/** The framework through the shared query cache (same key and staleTime as useFramework), fetched if not loaded yet; undefined without an id. */
|
|
41
|
+
export declare function fetchFramework(frameworkId: string): Promise<IFramework | undefined>;
|
|
42
|
+
/** The job's allocation check plus knowlg-service's per-skill floor, against live counts and the set's own settings; throws if the searches fail. */
|
|
43
|
+
export declare function checkPool(skills: string[], target: DifficultyTarget, framework: IFramework | undefined, channel: string | undefined, settings: DynamicAssessSettings): Promise<string[]>;
|
|
44
|
+
/** Live counts the pool checks read: per skill x level (job allocation) and per skill (knowlg-service floor); throws if the searches fail. */
|
|
45
|
+
export declare function poolCounts(categoryField: string, skills: string[], channel?: string): Promise<[Record<string, Record<"E" | "M" | "D", number>>, Record<string, number>]>;
|
|
46
|
+
/** Refresh-body, then poll until the job has finished both its /add and /remove; stopping at the first change could keep the old children and a later save would re-attach them. */
|
|
47
|
+
export declare function generateAndWait(deps: Omit<GenerateDeps, 'save'>, baselineRoot: INode | undefined): Promise<{
|
|
48
|
+
result: GenerateResult;
|
|
49
|
+
rootNode?: INode;
|
|
50
|
+
}>;
|
|
51
|
+
/** Save, then generate: inputs only exist in treeCache until saved. */
|
|
52
|
+
export declare function saveThenGenerate(deps: GenerateDeps): Promise<{
|
|
53
|
+
result: GenerateResult;
|
|
54
|
+
rootNode?: INode;
|
|
55
|
+
}>;
|
|
56
|
+
/** Dynamic Assess generation (Save & Generate, Regenerate): failures toast and return false; a failed save has already toasted and reverted. */
|
|
57
|
+
export declare function useRefreshQuestionSetBody(): {
|
|
58
|
+
refresh: (opts?: {
|
|
59
|
+
saveIfBlocked?: boolean;
|
|
60
|
+
}) => Promise<boolean>;
|
|
61
|
+
};
|
|
62
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { INode } from '../types/editor';
|
|
2
|
+
export declare function buildSavePayload(nodes: INode[], treeCache: Record<string, Record<string, unknown>>, channel: string, rootPrimaryCategory: string): {
|
|
3
|
+
nodesModified: Record<string, unknown>;
|
|
4
|
+
hierarchy: Record<string, unknown>;
|
|
5
|
+
};
|
|
1
6
|
/**
|
|
2
7
|
* Outcome of a hierarchy save, for callers that need to tell the three cases
|
|
3
8
|
* apart rather than collapsing them into a boolean:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A category value as the question API stores it. Categories are lists, except `board`: the
|
|
3
|
+
* Question schema keeps it as one string, and a non-empty list there makes question/v2/create and
|
|
4
|
+
* update hang until the gateway times out (a 500 after 30s, with no error from the service). An
|
|
5
|
+
* empty list still clears it, so a stale board is cleared the same way as the other categories.
|
|
6
|
+
*/
|
|
7
|
+
export declare function toQuestionCategoryValue(field: string, v: unknown): unknown;
|
|
1
8
|
export declare function buildLiveQuestionMeta(): {
|
|
2
9
|
questionName: string;
|
|
3
10
|
questionMeta: Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ICompetencyFrameworkSummary } from '../api/competencyFramework';
|
|
2
|
+
import { CompetencySkill } from '../utils/competencyLeaves';
|
|
3
|
+
/** The metadata field a question set / question names its skill framework in (as lern reads it). */
|
|
4
|
+
export declare const SKILL_FRAMEWORK_FIELD = "competencyFramework";
|
|
5
|
+
/** The channel's Live skill frameworks - options for "Skill framework". */
|
|
6
|
+
export declare function useSkillFrameworkOptions(): ICompetencyFrameworkSummary[];
|
|
7
|
+
/**
|
|
8
|
+
* One skill framework's skills (its last category's terms) and `skillField`, the field they are
|
|
9
|
+
* saved in (that category's code: `skill`, `cuisine`, ...) - the rule lern reads them by.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useSkillFrameworkSkills(frameworkId: string | undefined): {
|
|
12
|
+
skills: CompetencySkill[];
|
|
13
|
+
skillField: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The skill field of a skill framework already in the query cache. The cache drops a framework no
|
|
17
|
+
* component has used for a while, so code that writes data calls `loadSkillFramework` first.
|
|
18
|
+
*/
|
|
19
|
+
export declare function cachedSkillField(frameworkId: string | undefined): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Loads a skill framework into the query cache if it isn't there, so `cachedSkillField` can answer.
|
|
22
|
+
* Resolves false when it can't be read; callers then leave the skill field alone rather than guess.
|
|
23
|
+
*/
|
|
24
|
+
export declare function loadSkillFramework(frameworkId: string | undefined): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Editor-only key on a question's unsaved metadata: the skill framework it was re-tagged away from, so the save can
|
|
27
|
+
* clear that framework's skills. Never sent to the server (the question payload only takes known fields).
|
|
28
|
+
*/
|
|
29
|
+
export declare const MOVED_FROM_SKILL_FRAMEWORK = "_movedFromSkillFramework";
|
|
30
|
+
/** A stored skill value as a list of codes (a field may hold one code or a list). */
|
|
31
|
+
export declare const asCodes: (v: unknown) => string[];
|
|
32
|
+
type RootNode = {
|
|
33
|
+
identifier: string;
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
};
|
|
36
|
+
/** The question set's skill framework; every question follows it. */
|
|
37
|
+
export declare function useSetSkillFramework(): string | undefined;
|
|
38
|
+
/** The question set's skill framework, its skill field and the skills chosen on it. */
|
|
39
|
+
export interface SetSkills {
|
|
40
|
+
frameworkId?: string;
|
|
41
|
+
skillField?: string;
|
|
42
|
+
skills: string[];
|
|
43
|
+
/** A framework whose skills have loaded, and at least one skill chosen: the library can match on it. */
|
|
44
|
+
ready: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The set's skills from its root node, edits first then saved metadata. `skillFieldOf` gives a
|
|
48
|
+
* framework's skill field, undefined until the framework loads.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveSetSkills(root: RootNode | undefined, treeCache: Record<string, Record<string, unknown> | undefined>, skillFieldOf: (frameworkId: string) => string | undefined): SetSkills;
|
|
51
|
+
/** The set's skills right now, for code outside React (the library search). */
|
|
52
|
+
export declare function currentSetSkills(): SetSkills;
|
|
53
|
+
/** The set's skills, kept current; also loads the set's framework so its skill field is known. */
|
|
54
|
+
export declare function useSetSkills(): SetSkills;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|