@project-sunbird/collection-editor-react 1.0.14 → 1.0.16-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 +32 -0
- package/dist/api/content.d.ts +1 -1
- package/dist/api/content.test.d.ts +1 -0
- package/dist/collection-editor.umd.js +112 -112
- package/dist/components/SparkMetaForm/fields/OptionSearch.d.ts +20 -0
- package/dist/components/SparkMetaForm/fields/OptionSearch.test.d.ts +1 -0
- package/dist/components/SparkMetaForm/hooks/useFieldPrepare.competency.test.d.ts +1 -0
- package/dist/components/SparkMetaForm/hooks/useFieldPrepare.d.ts +34 -1
- package/dist/components/SparkMetaForm/hooks/useFieldPrepare.skill.test.d.ts +1 -0
- package/dist/components/UnitContentList/LevelCourseItem.d.ts +2 -0
- package/dist/hooks/useCompetencyFrameworks.d.ts +27 -0
- package/dist/hooks/useCourseCompetency.d.ts +31 -0
- package/dist/hooks/useCourseCompetency.test.d.ts +1 -0
- package/dist/hooks/useLibrary.d.ts +88 -18
- package/dist/hooks/useLpCompetency.d.ts +13 -0
- package/dist/hooks/useSkillCategory.d.ts +15 -1
- package/dist/hooks/useSkillScope.d.ts +4 -3
- package/dist/hooks/useSkillsCoveredSync.d.ts +10 -0
- package/dist/hooks/useSkillsCoveredSync.test.d.ts +1 -0
- package/dist/i18n/locales/ar.json.d.ts +46 -28
- package/dist/i18n/locales/en.json.d.ts +46 -28
- package/dist/i18n/locales/fr.json.d.ts +46 -28
- package/dist/i18n/locales/pt.json.d.ts +46 -28
- package/dist/index.cjs +109 -109
- package/dist/index.js +9572 -9004
- package/dist/store/tree.store.d.ts +4 -1
- package/dist/store/tree.store.dirty.test.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types/content.d.ts +3 -1
- package/dist/types/content.test.d.ts +1 -0
- package/dist/types/editor.d.ts +1 -1
- package/dist/types/framework.d.ts +27 -0
- package/dist/utils/competencyLeaves.d.ts +44 -0
- package/dist/utils/competencyLeaves.test.d.ts +1 -0
- package/dist/utils/libraryCardMeta.d.ts +33 -0
- package/dist/utils/libraryCardMeta.test.d.ts +1 -0
- package/dist/utils/lpCompetency.d.ts +32 -0
- package/dist/utils/lpCompetency.test.d.ts +1 -0
- package/dist/utils/lpStructure.d.ts +21 -16
- package/dist/utils/skillTerms.d.ts +22 -0
- package/dist/utils/skillTerms.test.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/UnitContentList/SkillPicker.d.ts +0 -19
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** A short list is quicker to scan than to search, so the box shows only above this many options. */
|
|
3
|
+
export declare const SEARCH_MIN_OPTIONS = 7;
|
|
4
|
+
export declare function filterOptions<T extends {
|
|
5
|
+
label: string;
|
|
6
|
+
}>(options: T[], query: string): T[];
|
|
7
|
+
/** Filters dropdown options by label as the user types. Clear `query` when the dropdown closes. */
|
|
8
|
+
export declare function useOptionSearch<T extends {
|
|
9
|
+
label: string;
|
|
10
|
+
}>(options: T[]): {
|
|
11
|
+
query: string;
|
|
12
|
+
setQuery: React.Dispatch<React.SetStateAction<string>>;
|
|
13
|
+
filtered: T[];
|
|
14
|
+
searchable: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare const OptionSearchInput: React.FC<{
|
|
17
|
+
value: string;
|
|
18
|
+
onChange: (v: string) => void;
|
|
19
|
+
placeholder: string;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IFrameworkDetails } from '../../../types/framework';
|
|
1
|
+
import { ICompetencyTagging, IFrameworkDetails } from '../../../types/framework';
|
|
2
2
|
import { IEditorProfile } from '../../../types/profile';
|
|
3
3
|
export declare const POLICY_OPTIONS: Array<{
|
|
4
4
|
label: string;
|
|
@@ -33,6 +33,8 @@ export interface PreparedField {
|
|
|
33
33
|
sourceCategory?: string;
|
|
34
34
|
defaultValue?: unknown;
|
|
35
35
|
currentValue?: unknown;
|
|
36
|
+
/** The framework's skill category field — values are term codes. */
|
|
37
|
+
isSkillField?: boolean;
|
|
36
38
|
}
|
|
37
39
|
export declare const SECTION_DISPLAY: Record<string, {
|
|
38
40
|
title: string;
|
|
@@ -77,8 +79,39 @@ export interface IPrepareContext {
|
|
|
77
79
|
* (e.g. the LP root's `policy` field) when no category-definition form
|
|
78
80
|
* config is available yet. */
|
|
79
81
|
profile?: IEditorProfile;
|
|
82
|
+
/** Labels for the skill framework, skills and target role fields; English when absent. */
|
|
83
|
+
competencyLabels?: ICompetencyFieldLabels;
|
|
84
|
+
}
|
|
85
|
+
export interface ICompetencyFieldLabels {
|
|
86
|
+
skillFramework: string;
|
|
87
|
+
selectSkillFramework: string;
|
|
88
|
+
skills: string;
|
|
89
|
+
selectSkills: string;
|
|
90
|
+
targetRole: string;
|
|
91
|
+
noTargetRole: string;
|
|
80
92
|
}
|
|
81
93
|
export declare function useFieldPrepare(formConfig: Array<Record<string, unknown>>, nodeMetadata: Record<string, unknown>, frameworkDetails: IFrameworkDetails, isRoot: boolean, ctx?: IPrepareContext): PreparedField[];
|
|
94
|
+
/**
|
|
95
|
+
* Course skill tagging against a competency framework. lern credits a course's skills from two
|
|
96
|
+
* fields: `competencyFramework` (the CompetencyFramework id) and the framework's skill field — its
|
|
97
|
+
* last category code (`competency.skillField`: `skill`, `cuisine`, ...), holding the skill codes.
|
|
98
|
+
* Neither is the curriculum `framework` (Course Type), so the author picks the skill framework
|
|
99
|
+
* separately.
|
|
100
|
+
*
|
|
101
|
+
* - Adds a "Skill framework" select when the channel has any competency framework.
|
|
102
|
+
* - Once one is picked, its skill field becomes a multiselect of that framework's skills,
|
|
103
|
+
* replacing any curriculum-framework field of the same code (e.g. USF's `skill`), since both
|
|
104
|
+
* would write the same field.
|
|
105
|
+
* With no skill framework picked, the curriculum framework's skill field behaves as before.
|
|
106
|
+
*/
|
|
107
|
+
export declare function adaptCompetencyFields(fields: PreparedField[], competency: ICompetencyTagging, meta: Record<string, unknown>, ctx: IPrepareContext): PreparedField[];
|
|
108
|
+
/**
|
|
109
|
+
* Learning Path root: "Skill framework" (`competencyFramework`) and an optional "Target role"
|
|
110
|
+
* (`targetRole`, a lern role code) — the two fields lern reads for skill coverage. The role's
|
|
111
|
+
* skills then scope every Level (useSkillScope). Once a skill framework is picked it scopes the
|
|
112
|
+
* Library instead of the Curriculum, so the Curriculum fields stop being required.
|
|
113
|
+
*/
|
|
114
|
+
export declare function adaptLpCompetencyFields(fields: PreparedField[], competency: ICompetencyTagging, meta: Record<string, unknown>, ctx: IPrepareContext): PreparedField[];
|
|
82
115
|
export declare function __computeFieldOptionsForTest(field: Record<string, unknown>, fw: IFrameworkDetails, nodeMetadata: Record<string, unknown>, siblingFields?: Array<Record<string, unknown>>): Array<{
|
|
83
116
|
label: string;
|
|
84
117
|
value: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,6 +4,8 @@ interface LevelCourseItemProps {
|
|
|
4
4
|
item: INode;
|
|
5
5
|
onRemove: (id: string) => void;
|
|
6
6
|
isEditable: boolean;
|
|
7
|
+
/** Target role set and this course teaches a skill outside it — kept, but flagged. */
|
|
8
|
+
notTeachingRole?: boolean;
|
|
7
9
|
}
|
|
8
10
|
export declare const LevelCourseItem: React.FC<LevelCourseItemProps>;
|
|
9
11
|
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ICompetencyFrameworkSummary, ICompetencyRole } from '../api/competencyFramework';
|
|
2
|
+
import { CompetencySkill } from '../utils/competencyLeaves';
|
|
3
|
+
import { ITerm } from '../types/framework';
|
|
4
|
+
/** How long a competency framework or its role list is reused before it is read again. */
|
|
5
|
+
export declare const COMPETENCY_STALE_MS: number;
|
|
6
|
+
/** The channel's Live competency frameworks — options for the "Skill framework" field. */
|
|
7
|
+
export declare function useCompetencyFrameworks(channel: string | undefined, enabled?: boolean): {
|
|
8
|
+
frameworks: ICompetencyFrameworkSummary[];
|
|
9
|
+
isLoaded: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Skills of one competency framework — options for the Skills field — as terms too, and
|
|
13
|
+
* `skillField`, the content field they are stored in (the framework's last category code; see
|
|
14
|
+
* competencyLeaves). `usableFrameworkId` is the id once it has loaded with at least one skill: a
|
|
15
|
+
* stored id that isn't a competency framework (old content defaults to `NCF`) never becomes usable.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useCompetencySkills(frameworkId: string | undefined): {
|
|
18
|
+
skills: CompetencySkill[];
|
|
19
|
+
skillField: string | undefined;
|
|
20
|
+
terms: ITerm[];
|
|
21
|
+
isLoaded: boolean;
|
|
22
|
+
usableFrameworkId: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
/** Live roles of one competency framework, each with its required skill codes. */
|
|
25
|
+
export declare function useCompetencyRoles(frameworkId: string | undefined): {
|
|
26
|
+
roles: ICompetencyRole[];
|
|
27
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ITerm } from '../types/framework';
|
|
2
|
+
export interface ICourseCompetency {
|
|
3
|
+
/** The tree being edited is a Course (not a Learning Path, Evaluation Course or other collection). */
|
|
4
|
+
isCourse: boolean;
|
|
5
|
+
/** The course's skill framework, once it has read as one (a stored `NCF` never does). */
|
|
6
|
+
frameworkId: string | undefined;
|
|
7
|
+
/** The content field skill tags live in for this framework (its last category code). */
|
|
8
|
+
skillField: string | undefined;
|
|
9
|
+
/** The skill codes chosen on the course. */
|
|
10
|
+
skills: string[];
|
|
11
|
+
/** Its leaf skills as framework terms (code + name), to match legacy name tags too. */
|
|
12
|
+
terms: ITerm[];
|
|
13
|
+
/** A skill framework and at least one skill: the Library can show matching content. */
|
|
14
|
+
ready: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Whether the tree being edited is a Course — not a Learning Path, an Evaluation Course or any
|
|
18
|
+
* other collection. Only a Course narrows its Library to the content that teaches its skills.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isPlainCourseRoot(profileKey: string, rootMeta: Record<string, unknown>, configPrimaryCategory: string | undefined): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* A course's skill framework and chosen skills, from its root metadata and the framework as
|
|
23
|
+
* loaded. Pure, so it can be tested without the stores.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveCourseCompetency(isCourse: boolean, rootMeta: Record<string, unknown>, loaded: {
|
|
26
|
+
usableFrameworkId: string | undefined;
|
|
27
|
+
skillField: string | undefined;
|
|
28
|
+
terms: ITerm[];
|
|
29
|
+
}): ICourseCompetency;
|
|
30
|
+
/** Course skill framework + chosen skills. Inert (all empty, not ready) for anything but a Course. */
|
|
31
|
+
export declare function useCourseCompetency(): ICourseCompetency;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,53 @@
|
|
|
1
|
+
import { ISkillScope } from './useSkillScope';
|
|
2
|
+
import { IContent } from '../types/content';
|
|
1
3
|
import { LibraryFilters } from '../components/LibraryDock/LibraryFilterPanel';
|
|
4
|
+
import { ITerm } from '../types/framework';
|
|
5
|
+
/**
|
|
6
|
+
* Course profile, "Teaches this course's skills" section: content in the course's own skill
|
|
7
|
+
* framework whose skills ALL lie within the course's (Knowlg's `subsetOf`, as for a Learning Path
|
|
8
|
+
* Level). Content that also teaches a skill outside the course would carry that skill into it
|
|
9
|
+
* unasked, so it isn't offered. Skill codes only mean something inside their own framework, hence
|
|
10
|
+
* the framework filter. Names ride along with codes so content tagged with legacy names matches too.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildCourseLibraryFilters(frameworkId: string, skillField: string, skills: string[], terms: ITerm[] | undefined): Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Course profile: whether a search result is one the "Teaches this course's skills" section holds
|
|
15
|
+
* (the client-side twin of buildCourseLibraryFilters). "Other content" runs the same browse without
|
|
16
|
+
* the skill filter and drops these, so it shows everything else, content that also teaches other
|
|
17
|
+
* skills included. Knowlg has no "not subsetOf", hence the filtering here rather than in the search.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isCourseSkillMatch(item: Record<string, unknown>, frameworkId: string, skillField: string, matchValues: string[]): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Course profile: whether "Other content" has another page. Compare the server's offset with the
|
|
22
|
+
* server's own total; `otherTotal` has the main list's matches taken off, so it would stop early.
|
|
23
|
+
*/
|
|
24
|
+
export declare function otherHasMorePages(offset: number, rawTotal: number): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Course profile: the hint above the Library. A Course with no skill framework or no skills yet
|
|
27
|
+
* gets a nudge to pick them, since that's what sorts the matching content first.
|
|
28
|
+
*/
|
|
29
|
+
export declare function courseLibraryHint(course: {
|
|
30
|
+
isCourse: boolean;
|
|
31
|
+
ready: boolean;
|
|
32
|
+
}): 'pickSkills' | null;
|
|
2
33
|
/**
|
|
3
34
|
* LP profile library filters: search is strictly constrained to Courses, or
|
|
4
35
|
* to Evaluation Course specifically while picking the Prior/Outcome slot or
|
|
5
36
|
* a Level Exam course (isPickingEvaluationCourse) — a course can only ever
|
|
6
37
|
* fill those roles by being authored under that category (see
|
|
7
|
-
* isEvaluationCourse).
|
|
8
|
-
* no
|
|
9
|
-
* so it can't be filtered by it)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
38
|
+
* isEvaluationCourse). Without a target role, filling the pre/post assessment
|
|
39
|
+
* slot has no skill constraint (the prior assessment *defines* the skill
|
|
40
|
+
* scope, so it can't be filtered by it); with one, it must test the role's
|
|
41
|
+
* skills. Any other pick, a Level Exam course included, is narrowed to the
|
|
42
|
+
* path's skill scope (`browseSkillValues`) once there is one.
|
|
43
|
+
*
|
|
44
|
+
* `browseSkillValues` and `competency.roleSkillValues` are search values:
|
|
45
|
+
* term codes plus their names, so courses tagged with legacy names match.
|
|
13
46
|
*/
|
|
14
|
-
export declare function buildLpLibraryFilters(activeAssessmentSlot: 'pre' | 'post' | null, isPickingEvaluationCourse: boolean,
|
|
47
|
+
export declare function buildLpLibraryFilters(activeAssessmentSlot: 'pre' | 'post' | null, isPickingEvaluationCourse: boolean, browseSkillValues: string[], skillCategoryCode: string | undefined, frameworkId?: string, competency?: {
|
|
48
|
+
frameworkId: string;
|
|
49
|
+
roleSkillValues: string[];
|
|
50
|
+
}): Record<string, unknown>;
|
|
15
51
|
/**
|
|
16
52
|
* LP profile search fields: append the resolved skill-category code so each
|
|
17
53
|
* returned course carries its own skill tags in `metadata` — Skills
|
|
@@ -20,21 +56,48 @@ export declare function buildLpLibraryFilters(activeAssessmentSlot: 'pre' | 'pos
|
|
|
20
56
|
* absent from the default search field set (Collection profile leaves the
|
|
21
57
|
* default fields untouched).
|
|
22
58
|
*/
|
|
23
|
-
export declare function buildSearchFields(competencyScoped: boolean, skillCategoryCode: string | undefined): string[] | undefined;
|
|
59
|
+
export declare function buildSearchFields(competencyScoped: boolean, skillCategoryCode: string | undefined, courseSkillField?: string): string[] | undefined;
|
|
24
60
|
/**
|
|
25
61
|
* Why the Library is (or would be) empty for the LP profile, so the dock can
|
|
26
62
|
* show a guiding message instead of the generic "no results" empty state —
|
|
27
|
-
* mandatory per learning_path_plan.md §3 item 3: with
|
|
28
|
-
* there's no framework to scope search by,
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* Level, or while picking an Evaluation Course for the Prior/Outcome
|
|
63
|
+
* mandatory per learning_path_plan.md §3 item 3: with neither a Curriculum nor
|
|
64
|
+
* a skill framework chosen there's no framework to scope search by, so
|
|
65
|
+
* browsing must show nothing rather than every course. Doesn't apply to
|
|
66
|
+
* Collection, or while picking an Evaluation Course for the Prior/Outcome
|
|
32
67
|
* Assessment slot or a Level Exam — that course *defines* the skill scope
|
|
33
|
-
* (and isn't required to belong to any particular Curriculum), so
|
|
34
|
-
*
|
|
68
|
+
* (and isn't required to belong to any particular Curriculum), so the gate
|
|
69
|
+
* doesn't apply while filling it. isPickingEvaluationCourse mirrors
|
|
35
70
|
* useLibrary's own activeAssessmentSlot-or-activeLevelExamTarget check.
|
|
36
71
|
*/
|
|
37
|
-
export declare function computeLibraryEmptyReason(competencyScoped: boolean, frameworkId: string | undefined,
|
|
72
|
+
export declare function computeLibraryEmptyReason(competencyScoped: boolean, frameworkId: string | undefined, isPickingEvaluationCourse?: boolean): 'noCurriculum' | null;
|
|
73
|
+
/**
|
|
74
|
+
* Skills the LP Library browses for: the path's skill scope (useSkillScope) — the target role's
|
|
75
|
+
* skills, else the Prior Assessment's. A Level's skills are worked out from its courses, so they
|
|
76
|
+
* never narrow the Library. With no role and no Prior Assessment nothing narrows it (`manual`).
|
|
77
|
+
*/
|
|
78
|
+
export declare function resolveBrowseSkills(scope: ISkillScope): string[];
|
|
79
|
+
/**
|
|
80
|
+
* LP profile: the competency scope of the search, with the role's skills as search values (codes
|
|
81
|
+
* and names) so courses tagged with legacy names match. None without a usable skill framework.
|
|
82
|
+
*/
|
|
83
|
+
export declare function lpCompetencyScope(frameworkId: string | undefined, roleSkills: string[], terms: ITerm[] | undefined): {
|
|
84
|
+
frameworkId: string;
|
|
85
|
+
roleSkillValues: string[];
|
|
86
|
+
} | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Adds a page of "Other content" to what is shown. The next page starts after what the server
|
|
89
|
+
* returned, not after what is shown, so an item dropped as already shown doesn't shift it.
|
|
90
|
+
*/
|
|
91
|
+
export declare function appendOtherPage(shown: IContent[], page: IContent[], offset: number): {
|
|
92
|
+
content: IContent[];
|
|
93
|
+
nextOffset: number;
|
|
94
|
+
};
|
|
95
|
+
/** Hands out a token per request; only the newest one may apply its response. */
|
|
96
|
+
export declare function latestRequestGuard(): {
|
|
97
|
+
next: () => number;
|
|
98
|
+
isLatest: (token: number) => boolean;
|
|
99
|
+
invalidate: () => void;
|
|
100
|
+
};
|
|
38
101
|
/**
|
|
39
102
|
* Returns allowed primaryCategory values for the currently selected unit,
|
|
40
103
|
* driven by editorConfig.config.hierarchy.levelN.children.Content.
|
|
@@ -46,7 +109,7 @@ export declare function computeLibraryEmptyReason(competencyScoped: boolean, fra
|
|
|
46
109
|
*/
|
|
47
110
|
export declare function useAllowedCategories(): string[];
|
|
48
111
|
export declare function useLibrary(): {
|
|
49
|
-
content:
|
|
112
|
+
content: IContent[];
|
|
50
113
|
isLoading: boolean;
|
|
51
114
|
totalCount: number;
|
|
52
115
|
activeFilter: string;
|
|
@@ -61,5 +124,12 @@ export declare function useLibrary(): {
|
|
|
61
124
|
loadMore: () => void;
|
|
62
125
|
refetch: () => Promise<void>;
|
|
63
126
|
activeAssessmentSlot: "pre" | "post" | null;
|
|
64
|
-
emptyReason: "noCurriculum" |
|
|
127
|
+
emptyReason: "noCurriculum" | null;
|
|
128
|
+
skillMatched: boolean;
|
|
129
|
+
otherContent: IContent[];
|
|
130
|
+
otherTotal: number;
|
|
131
|
+
otherLoading: boolean;
|
|
132
|
+
otherHasMore: boolean;
|
|
133
|
+
loadMoreOther: () => void;
|
|
134
|
+
courseHint: "pickSkills" | null;
|
|
65
135
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ITerm } from '../types/framework';
|
|
2
|
+
export interface ILpCompetency {
|
|
3
|
+
/** The LP's competency framework, once it has read as one (a stored `NCF` never does). */
|
|
4
|
+
frameworkId: string | undefined;
|
|
5
|
+
/** Its leaf skills as framework terms (code + name). */
|
|
6
|
+
terms: ITerm[];
|
|
7
|
+
/** The content field skill tags live in for this framework (its last category code). */
|
|
8
|
+
skillField: string | undefined;
|
|
9
|
+
/** The chosen target role's skill codes; empty with no role, or before roles load. */
|
|
10
|
+
roleSkills: string[];
|
|
11
|
+
}
|
|
12
|
+
/** Learning Path skill framework + target role. Inert (all empty) outside the LP profile. */
|
|
13
|
+
export declare function useLpCompetency(): ILpCompetency;
|
|
@@ -13,7 +13,9 @@ export interface ISkillCategory {
|
|
|
13
13
|
* skill-equivalent (USF's `skill` category also has the highest index, so
|
|
14
14
|
* one rule covers both — see learning_path_plan.md §3 item 0). Categories
|
|
15
15
|
* missing `index` are treated as lower priority than any category that
|
|
16
|
-
* declares one, rather than crashing the comparison.
|
|
16
|
+
* declares one, rather than crashing the comparison. A category literally
|
|
17
|
+
* coded `skill` always wins — that's the field lern-service reads to credit
|
|
18
|
+
* skills on completion, even if a framework omits/misorders `index`.
|
|
17
19
|
*/
|
|
18
20
|
export declare function resolveSkillCategory(categories: ICategory[] | undefined): ISkillCategory | null;
|
|
19
21
|
/** The prior-assessment course's own framework, when one is linked. Its skill
|
|
@@ -21,4 +23,16 @@ export declare function resolveSkillCategory(categories: ICategory[] | undefined
|
|
|
21
23
|
* framework is a fallback (e.g. context default) must not resolve the skill
|
|
22
24
|
* field against the wrong taxonomy. */
|
|
23
25
|
export declare function resolvePriorCourseFramework(rootNode: INode | undefined): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Which skill category an LP uses. Its competency framework's, once that has loaded with skills;
|
|
28
|
+
* none while a stored competency framework is still loading or failed to load, so nothing reads or
|
|
29
|
+
* writes skills under a guessed field; the curriculum's otherwise (no competency framework stored,
|
|
30
|
+
* or a stored id that isn't one of the channel's competency frameworks, such as a legacy `NCF`).
|
|
31
|
+
*/
|
|
32
|
+
export declare function pickSkillCategory(args: {
|
|
33
|
+
competency: ISkillCategory | null;
|
|
34
|
+
storedFramework: string | undefined;
|
|
35
|
+
channelFrameworks: string[] | undefined;
|
|
36
|
+
curriculum: ISkillCategory | null;
|
|
37
|
+
}): ISkillCategory | null;
|
|
24
38
|
export declare function useSkillCategory(): ISkillCategory | null;
|
|
@@ -2,13 +2,14 @@ import { ISkillCategory } from './useSkillCategory';
|
|
|
2
2
|
import { INode } from '../types/editor';
|
|
3
3
|
export interface ISkillScope {
|
|
4
4
|
scope: string[];
|
|
5
|
-
source: 'prior' | 'manual';
|
|
5
|
+
source: 'role' | 'prior' | 'manual';
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* LP skill scope, sole source of truth: the
|
|
8
|
+
* LP skill scope, sole source of truth: the target role's skills when one is
|
|
9
|
+
* chosen; else the prior assessment's skill-category
|
|
9
10
|
* tags when one is linked; otherwise every Level falls back to manual
|
|
10
11
|
* selection from the framework's full skill catalog. Never derived from
|
|
11
12
|
* linked courses or their content (learning_path_plan.md §3 item 1).
|
|
12
13
|
*/
|
|
13
|
-
export declare function resolveSkillScope(rootNode: INode | undefined, skillCategory: ISkillCategory | null, treeCache: Record<string, Record<string, unknown
|
|
14
|
+
export declare function resolveSkillScope(rootNode: INode | undefined, skillCategory: ISkillCategory | null, treeCache: Record<string, Record<string, unknown>>, roleSkills?: string[]): ISkillScope;
|
|
14
15
|
export declare function useSkillScope(): ISkillScope;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { INode } from '../types/editor';
|
|
2
|
+
import { ITerm } from '../types/framework';
|
|
3
|
+
/**
|
|
4
|
+
* Level id -> the skills its courses teach, for every content Level whose stored skills differ.
|
|
5
|
+
* Pre/post assessment slots are left alone.
|
|
6
|
+
*/
|
|
7
|
+
export declare function levelSkillPatches(levels: INode[], skillCategoryCode: string, treeCache: Record<string, Record<string, unknown>>, terms?: ITerm[]): Array<{
|
|
8
|
+
id: string;
|
|
9
|
+
skills: string[];
|
|
10
|
+
}>;
|
|
1
11
|
/**
|
|
2
12
|
* Keeps the LP root's own skill-category metadata field in sync with the
|
|
3
13
|
* derived "Skills covered" union (Prior Assessment + every Level's own
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -106,7 +106,13 @@ declare const _default: {
|
|
|
106
106
|
},
|
|
107
107
|
"sparkMetaForm": {
|
|
108
108
|
"shuffleEnabledMessage": "تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",
|
|
109
|
-
"noFieldsMessage": "لا توجد حقول مُهيَّأة لهذا التبويب."
|
|
109
|
+
"noFieldsMessage": "لا توجد حقول مُهيَّأة لهذا التبويب.",
|
|
110
|
+
"skillFramework": "إطار المهارات",
|
|
111
|
+
"selectSkillFramework": "اختر إطار مهارات",
|
|
112
|
+
"skills": "المهارات",
|
|
113
|
+
"selectSkills": "اختر المهارات",
|
|
114
|
+
"targetRole": "الدور المستهدف (اختياري)",
|
|
115
|
+
"noTargetRole": "بدون دور مستهدف"
|
|
110
116
|
},
|
|
111
117
|
"appIconField": {
|
|
112
118
|
"requiredError": "{field} مطلوب",
|
|
@@ -169,7 +175,9 @@ declare const _default: {
|
|
|
169
175
|
"requiredError": "{field} مطلوب",
|
|
170
176
|
"selectedCountSuffix": "محدد",
|
|
171
177
|
"selectPlaceholder": "اختر…",
|
|
172
|
-
"noOptionsMessage": "لا توجد خيارات"
|
|
178
|
+
"noOptionsMessage": "لا توجد خيارات",
|
|
179
|
+
"searchPlaceholder": "بحث…",
|
|
180
|
+
"noMatchesMessage": "لا توجد نتائج"
|
|
173
181
|
},
|
|
174
182
|
"nestedSelectField": {
|
|
175
183
|
"requiredError": "{field} مطلوب",
|
|
@@ -181,7 +189,9 @@ declare const _default: {
|
|
|
181
189
|
"selectField": {
|
|
182
190
|
"requiredError": "{field} مطلوب",
|
|
183
191
|
"selectPlaceholder": "اختر…",
|
|
184
|
-
"noOptionsMessage": "لا توجد خيارات"
|
|
192
|
+
"noOptionsMessage": "لا توجد خيارات",
|
|
193
|
+
"searchPlaceholder": "بحث…",
|
|
194
|
+
"noMatchesMessage": "لا توجد نتائج"
|
|
185
195
|
},
|
|
186
196
|
"textField": {
|
|
187
197
|
"requiredError": "{field} مطلوب",
|
|
@@ -229,6 +239,7 @@ declare const _default: {
|
|
|
229
239
|
"closeAriaLabel": "إغلاق",
|
|
230
240
|
"confirmPublishPrefix": "هل أنت متأكد من رغبتك في نشر هذا",
|
|
231
241
|
"checklistInstructions": "يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",
|
|
242
|
+
"selectAllLabel": "تحديد الكل",
|
|
232
243
|
"noButton": "لا",
|
|
233
244
|
"yesButton": "نعم"
|
|
234
245
|
},
|
|
@@ -266,7 +277,8 @@ declare const _default: {
|
|
|
266
277
|
"addItemAriaLabel": "إضافة {name} إلى الوحدة",
|
|
267
278
|
"addToUnitTitle": "إضافة إلى الوحدة",
|
|
268
279
|
"selectUnitToAddTitle": "اختر وحدة للإضافة إليها",
|
|
269
|
-
"draftOnlyTitle": "يمكن إضافة المحتوى المسودة فقط"
|
|
280
|
+
"draftOnlyTitle": "يمكن إضافة المحتوى المسودة فقط",
|
|
281
|
+
"moreSkills": "+{count} أخرى"
|
|
270
282
|
},
|
|
271
283
|
"libraryDock": {
|
|
272
284
|
"selectUnitFirstToast": "اختر وحدة أولاً",
|
|
@@ -290,7 +302,13 @@ declare const _default: {
|
|
|
290
302
|
"loadingText": "جارٍ التحميل…",
|
|
291
303
|
"loadMoreText": "تحميل المزيد",
|
|
292
304
|
"noContentFound": "لم يتم العثور على محتوى",
|
|
293
|
-
"tryDifferentSearch": "جرّب بحثًا أو مرشحًا مختلفًا"
|
|
305
|
+
"tryDifferentSearch": "جرّب بحثًا أو مرشحًا مختلفًا",
|
|
306
|
+
"noSkillMatchTitle": "لا يوجد محتوى يُدرّس مهارات هذه الدورة بعد",
|
|
307
|
+
"noSkillMatchHint": "يظهر المحتوى هنا عندما يُوسم بمهارات هذه الدورة فقط. وكل ما عدا ذلك موجود ضمن محتوى آخر.",
|
|
308
|
+
"matchingHeading": "يُدرّس مهارات هذه الدورة",
|
|
309
|
+
"otherContentHeading": "محتوى آخر ({count})",
|
|
310
|
+
"otherContentHint": "هذا المحتوى يُدرّس مهارات خارج هذه الدورة، أو لا يُدرّس أي مهارة. لا يزال بإمكانك إضافته.",
|
|
311
|
+
"pickSkillsHint": "اختر مهارات هذه الدورة لترى أولًا المحتوى الذي يُدرّسها."
|
|
294
312
|
},
|
|
295
313
|
"libraryFilterPanel": {
|
|
296
314
|
"boardLabel": "المجلس التعليمي",
|
|
@@ -470,7 +488,7 @@ declare const _default: {
|
|
|
470
488
|
"outcomeCheckBadge": "فحص النتيجة",
|
|
471
489
|
"assessmentCourseMeta": "مقرر · بنك أسئلة فقط",
|
|
472
490
|
"addAssessmentSlotButton": "إضافة {label} — مقرر يحتوي على بنك أسئلة فقط",
|
|
473
|
-
"addCourseToLevelButton": "
|
|
491
|
+
"addCourseToLevelButton": "أضف دورة من المكتبة",
|
|
474
492
|
"addLevelExamButton": "إضافة اختبار المستوى — مقرر يحتوي على بنك أسئلة فقط",
|
|
475
493
|
"levelExamMeta": "اختبار المستوى · بنك أسئلة فقط",
|
|
476
494
|
"requiredSlotBadge": "مطلوب",
|
|
@@ -486,20 +504,10 @@ declare const _default: {
|
|
|
486
504
|
"bothSlotsFilledToast": "تم تعبئة تقييمي المسبق والنتائج بالفعل.",
|
|
487
505
|
"levelExamAlreadyFilledToast": "يحتوي هذا المستوى بالفعل على مقرر اختبار المستوى — أزِله قبل إضافة مقرر آخر.",
|
|
488
506
|
"assessmentCheckFailedToast": "تعذر التحقق من هذا المقرر. حاول مرة أخرى.",
|
|
489
|
-
"skillsHeading": "المهارات",
|
|
490
|
-
"
|
|
491
|
-
"
|
|
492
|
-
"
|
|
493
|
-
"searchSkillsPlaceholder": "البحث عن المهارات",
|
|
494
|
-
"noSkillsAvailable": "لا توجد مهارات متاحة حتى الآن",
|
|
495
|
-
"noMatchingSkills": "لا توجد مهارات مطابقة",
|
|
496
|
-
"noSkillsSelectedYet": "لم يتم تحديد مهارات",
|
|
497
|
-
"removeSkillAriaLabel": "إزالة {skill}",
|
|
498
|
-
"skillScopeFromPriorNote": "اختر المهارات — من التقييم المسبق — التي يبنيها هذا المستوى. تُصفّي المكتبة المقررات وفق هذه المهارات.",
|
|
499
|
-
"skillScopeManualNote": "لا يوجد تقييم مسبق حتى الآن، فاختر من كتالوج المهارات العام. تُصفّي المكتبة المقررات وفق هذه المهارات.",
|
|
500
|
-
"skillsCoveredHeading": "المهارات المشمولة",
|
|
501
|
-
"skillsCoveredDescription": "جميع المهارات الموسومة عبر التقييم المسبق والمستويات وتقييم النتائج لهذا المسار.",
|
|
502
|
-
"noSkillsYet": "لا توجد مهارات بعد — أضف مقررات لرؤية المهارات هنا.",
|
|
507
|
+
"skillsHeading": "المهارات التي يبنيها هذا المستوى",
|
|
508
|
+
"skillsCoveredHeading": "المهارات التي يكتسبها المتعلمون من هذا المسار",
|
|
509
|
+
"skillsCoveredDescription": "يحصل المتعلمون على هذه المهارات عند إنهاء المسار. وتتكون من المهارات التي تُدرّسها الدورات في كل مستوى، إضافة إلى التقييم القبلي والتقييم الختامي.",
|
|
510
|
+
"noSkillsYet": "لا توجد مهارات بعد — أضف إلى المستويات دورات موسومة بمهارات لتظهر هنا.",
|
|
503
511
|
"levelCountLabel": "{count} مستوى",
|
|
504
512
|
"levelCountLabelPlural": "{count} مستويات",
|
|
505
513
|
"courseCountLabel": "{count} مقرر",
|
|
@@ -549,11 +557,9 @@ declare const _default: {
|
|
|
549
557
|
"policyPriorLearningDescription": "يمكن أن يستند التخطي أيضًا إلى مهارات يمتلكها المتعلم بالفعل — شهادة موثقة أو مقرر سابق — لا التقييم وحده.",
|
|
550
558
|
"selectLevelFirstToast": "اختر مستوى أولاً",
|
|
551
559
|
"selectLevelFromOutlineToast": "افتح مستوى في هيكل المسار لإضافة المقررات — لا يمكن إضافة المقررات إلى المسار نفسه أو داخل مقرر آخر.",
|
|
552
|
-
"selectCurriculumFirstToast": "حدد المنهج (Curriculum) لهذا المسار قبل إضافة المقررات.",
|
|
553
|
-
"noCurriculumEmptyTitle": "لم يتم تحديد منهج",
|
|
554
|
-
"noCurriculumEmptyHint": "حدد
|
|
555
|
-
"noSkillsEmptyTitle": "لم يتم تحديد مهارات",
|
|
556
|
-
"noSkillsEmptyHint": "حدد مهارات لهذا المستوى لرؤية المقررات المطابقة.",
|
|
560
|
+
"selectCurriculumFirstToast": "حدد المنهج (Curriculum) أو إطار المهارات لهذا المسار قبل إضافة المقررات.",
|
|
561
|
+
"noCurriculumEmptyTitle": "لم يتم تحديد منهج أو إطار مهارات",
|
|
562
|
+
"noCurriculumEmptyHint": "حدد المنهج (Curriculum) أو إطار المهارات لهذا المسار لاستعراض المقررات.",
|
|
557
563
|
"itemAlreadyInPathToast": "\"{name}\" موجود بالفعل في مسار التعلم هذا",
|
|
558
564
|
"addedToLevelSuccess": "تمت إضافة \"{name}\" إلى المستوى",
|
|
559
565
|
"dropOntoLevelError": "أفلِت على مستوى لإضافة مقرر",
|
|
@@ -566,10 +572,22 @@ declare const _default: {
|
|
|
566
572
|
"levelSkillsResetFrameworkChangeToast": "تم مسح المهارات المختارة في {count} من المستويات — فهي لا تنطبق على المنهج الجديد.",
|
|
567
573
|
"priorAssessmentNarrowedScopeToast": "أدى التقييم المسبق إلى تضييق نطاق المهارات — أصبح لدى {count} من المستويات مهارات خارج هذا النطاق.",
|
|
568
574
|
"coursesCardHeading": "المقررات",
|
|
569
|
-
"coursesCardDescription": "
|
|
570
|
-
"coursesEmptyHint": "
|
|
575
|
+
"coursesCardDescription": "الدورات التي يُكملها المتعلم لاجتياز هذا المستوى. اسحب المقبض لإعادة الترتيب، واستخدم القائمة للإزالة.",
|
|
576
|
+
"coursesEmptyHint": "لا توجد دورات بعد.",
|
|
571
577
|
"courseMetaLabel": "مقرر",
|
|
572
|
-
"removeFromLevelMenuItem": "إزالة من المستوى"
|
|
578
|
+
"removeFromLevelMenuItem": "إزالة من المستوى",
|
|
579
|
+
"courseNotTeachingRoleBadge": "تُدرّس مهارات خارج هذا الدور",
|
|
580
|
+
"roleChangedCoursesFlaggedToast": "{count} دورة تُدرّس مهارات خارج الدور الجديد. تم الاحتفاظ بها ووضع علامة عليها — أزلها قبل الإرسال للمراجعة.",
|
|
581
|
+
"priorAssessmentMissingRoleSkills": "التقييم المسبق لا يختبر مهارات الدور هذه: {skills}",
|
|
582
|
+
"skillFrameworkChangedToast": "تم تغيير إطار المهارات: تم مسح الدور المستهدف ومهارات المسار.",
|
|
583
|
+
"roleSkillsCoveredDescription": "مهارات الدور المستهدف. يحصل عليها المتعلمون عند إنهاء المسار. يجب أن تُدرَّس كل مهارة منها في دورة قبل إرسال المسار للمراجعة.",
|
|
584
|
+
"roleSkillNotTaughtSuffix": "لم تُدرَّس بعد",
|
|
585
|
+
"roleSkillTaughtSuffix": "✓",
|
|
586
|
+
"roleSkillNotTaughtTitle": "لا توجد دورة في هذا المسار تُدرّس هذه المهارة بعد",
|
|
587
|
+
"roleSkillTaughtTitle": "توجد دورة في هذا المسار تُدرّس هذه المهارة",
|
|
588
|
+
"levelSkillsFromCoursesNote": "مستخرجة من الدورات في هذا المستوى. أضف دورات أو أزلها لتغييرها.",
|
|
589
|
+
"levelSkillsEmpty": "لا توجد مهارات بعد — أضف دورة إلى هذا المستوى.",
|
|
590
|
+
"levelSkillsOutsidePrior": "هذه المهارات لا يقيّمها التقييم القبلي: {skills}. أزل الدورة التي تُدرّسها."
|
|
573
591
|
}
|
|
574
592
|
}
|
|
575
593
|
;
|