@lessonkit/react 1.0.1 → 1.1.0
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/block-catalog.v2.json +770 -0
- package/block-contract.v2.json +104 -0
- package/dist/index.cjs +1282 -109
- package/dist/index.d.cts +122 -11
- package/dist/index.d.ts +122 -11
- package/dist/index.js +1263 -100
- package/package.json +13 -9
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import * as _lessonkit_core from '@lessonkit/core';
|
|
4
|
-
import { CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, BlockId, CheckId } from '@lessonkit/core';
|
|
5
|
-
export { AssessmentScoreInput, AssessmentScoreResult, InteractionBlockRegistration, LessonkitPlugin, LessonkitPluginContext, LessonkitPluginKind, PluginHost, PluginRegistry, TelemetryPipelineSink, buildTelemetryEvent, createLessonkitRuntime, createPluginRegistry, createTelemetryPipeline, defineAssessmentPlugin, defineLifecyclePlugin, defineTelemetryPlugin } from '@lessonkit/core';
|
|
6
|
-
import {
|
|
4
|
+
import { CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, BlockId, AssessmentHandle, AssessmentBaseProps, AssessmentBehaviour, AssessmentAnsweredData, AssessmentCompletedData, CheckId } from '@lessonkit/core';
|
|
5
|
+
export { AssessmentAnsweredData, AssessmentBaseProps, AssessmentBehaviour, AssessmentCompletedData, AssessmentHandle, AssessmentInteractionType, AssessmentScoreInput, AssessmentScoreResult, AssessmentXAPIData, InteractionBlockRegistration, LessonkitPlugin, LessonkitPluginContext, LessonkitPluginKind, PluginHost, PluginRegistry, TelemetryPipelineSink, buildTelemetryEvent, createLessonkitRuntime, createPluginRegistry, createTelemetryPipeline, defineAssessmentPlugin, defineLifecyclePlugin, defineTelemetryPlugin } from '@lessonkit/core';
|
|
6
|
+
import { McqAssessmentDescriptor } from '@lessonkit/lxpack';
|
|
7
7
|
import { XAPITransport, XAPIClient } from '@lessonkit/xapi';
|
|
8
8
|
import { LxpackBridgeMode } from '@lessonkit/lxpack/bridge';
|
|
9
9
|
import { LessonkitThemeV1, ThemePresetName, PartialLessonkitThemeV1 } from '@lessonkit/themes';
|
|
@@ -58,7 +58,9 @@ type LessonkitRuntime = {
|
|
|
58
58
|
user?: TelemetryUser;
|
|
59
59
|
};
|
|
60
60
|
setActiveLesson: (lessonId: LessonId) => void;
|
|
61
|
-
completeLesson: (lessonId: LessonId
|
|
61
|
+
completeLesson: (lessonId: LessonId, opts?: {
|
|
62
|
+
courseId?: CourseId;
|
|
63
|
+
}) => void;
|
|
62
64
|
completeCourse: () => void;
|
|
63
65
|
track: <N extends TelemetryEventName>(name: N, data?: TelemetryDataFor<N>, opts?: {
|
|
64
66
|
lessonId?: LessonId;
|
|
@@ -94,8 +96,8 @@ type ReflectionProps = {
|
|
|
94
96
|
onChange?: (value: string) => void;
|
|
95
97
|
children?: React.ReactNode;
|
|
96
98
|
};
|
|
97
|
-
type QuizProps =
|
|
98
|
-
type KnowledgeCheckProps =
|
|
99
|
+
type QuizProps = McqAssessmentDescriptor;
|
|
100
|
+
type KnowledgeCheckProps = McqAssessmentDescriptor;
|
|
99
101
|
type ProgressTrackerProps = {
|
|
100
102
|
totalLessons?: number;
|
|
101
103
|
};
|
|
@@ -107,6 +109,99 @@ declare function KnowledgeCheck(props: KnowledgeCheckProps): react_jsx_runtime.J
|
|
|
107
109
|
declare function Quiz(props: QuizProps): react_jsx_runtime.JSX.Element;
|
|
108
110
|
declare function ProgressTracker(props: ProgressTrackerProps): react_jsx_runtime.JSX.Element;
|
|
109
111
|
|
|
112
|
+
type TrueFalseProps = AssessmentBaseProps & {
|
|
113
|
+
question: string;
|
|
114
|
+
answer: boolean;
|
|
115
|
+
};
|
|
116
|
+
declare const TrueFalse: React.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
117
|
+
checkId: _lessonkit_core.CheckId;
|
|
118
|
+
passingScore?: number;
|
|
119
|
+
} & {
|
|
120
|
+
question: string;
|
|
121
|
+
answer: boolean;
|
|
122
|
+
} & React.RefAttributes<AssessmentHandle>>;
|
|
123
|
+
|
|
124
|
+
type MarkTheWordsProps = AssessmentBaseProps & {
|
|
125
|
+
/** Plain text; words listed in `correctWords` are selectable targets. */
|
|
126
|
+
text: string;
|
|
127
|
+
correctWords: string[];
|
|
128
|
+
};
|
|
129
|
+
declare const MarkTheWords: React.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
130
|
+
checkId: _lessonkit_core.CheckId;
|
|
131
|
+
passingScore?: number;
|
|
132
|
+
} & {
|
|
133
|
+
/** Plain text; words listed in `correctWords` are selectable targets. */
|
|
134
|
+
text: string;
|
|
135
|
+
correctWords: string[];
|
|
136
|
+
} & React.RefAttributes<AssessmentHandle>>;
|
|
137
|
+
|
|
138
|
+
type FillInBlankSpec = {
|
|
139
|
+
id: string;
|
|
140
|
+
answer: string;
|
|
141
|
+
};
|
|
142
|
+
type FillInTheBlanksProps = AssessmentBaseProps & {
|
|
143
|
+
/** Text with `*` wrapping each blank answer, e.g. "The *capital* of France is *Paris*." */
|
|
144
|
+
template: string;
|
|
145
|
+
/** Optional explicit blanks (overrides parsing from template). */
|
|
146
|
+
blanks?: FillInBlankSpec[];
|
|
147
|
+
};
|
|
148
|
+
declare const FillInTheBlanks: React.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
149
|
+
checkId: _lessonkit_core.CheckId;
|
|
150
|
+
passingScore?: number;
|
|
151
|
+
} & {
|
|
152
|
+
/** Text with `*` wrapping each blank answer, e.g. "The *capital* of France is *Paris*." */
|
|
153
|
+
template: string;
|
|
154
|
+
/** Optional explicit blanks (overrides parsing from template). */
|
|
155
|
+
blanks?: FillInBlankSpec[];
|
|
156
|
+
} & React.RefAttributes<AssessmentHandle>>;
|
|
157
|
+
|
|
158
|
+
type DragTheWordsProps = AssessmentBaseProps & {
|
|
159
|
+
/** Sentence with `*` around drop zones; `words` are draggable options. */
|
|
160
|
+
template: string;
|
|
161
|
+
words: string[];
|
|
162
|
+
};
|
|
163
|
+
declare const DragTheWords: React.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
164
|
+
checkId: _lessonkit_core.CheckId;
|
|
165
|
+
passingScore?: number;
|
|
166
|
+
} & {
|
|
167
|
+
/** Sentence with `*` around drop zones; `words` are draggable options. */
|
|
168
|
+
template: string;
|
|
169
|
+
words: string[];
|
|
170
|
+
} & React.RefAttributes<AssessmentHandle>>;
|
|
171
|
+
|
|
172
|
+
type DragItem = {
|
|
173
|
+
id: string;
|
|
174
|
+
label: string;
|
|
175
|
+
};
|
|
176
|
+
type DropTarget = {
|
|
177
|
+
id: string;
|
|
178
|
+
label: string;
|
|
179
|
+
accepts: string;
|
|
180
|
+
};
|
|
181
|
+
type DragAndDropProps = AssessmentBaseProps & {
|
|
182
|
+
items: DragItem[];
|
|
183
|
+
targets: DropTarget[];
|
|
184
|
+
};
|
|
185
|
+
declare const DragAndDrop: React.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
186
|
+
checkId: _lessonkit_core.CheckId;
|
|
187
|
+
passingScore?: number;
|
|
188
|
+
} & {
|
|
189
|
+
items: DragItem[];
|
|
190
|
+
targets: DropTarget[];
|
|
191
|
+
} & React.RefAttributes<AssessmentHandle>>;
|
|
192
|
+
|
|
193
|
+
type AssessmentSequenceProps = AssessmentBehaviour & {
|
|
194
|
+
children: React.ReactNode;
|
|
195
|
+
/** Show one child assessment at a time (Question Set). */
|
|
196
|
+
sequential?: boolean;
|
|
197
|
+
};
|
|
198
|
+
declare function AssessmentSequence(props: AssessmentSequenceProps): react_jsx_runtime.JSX.Element;
|
|
199
|
+
|
|
200
|
+
declare function useAssessmentState(enclosingLessonId?: LessonId): {
|
|
201
|
+
answer: (data: AssessmentAnsweredData) => void;
|
|
202
|
+
complete: (data: AssessmentCompletedData) => void;
|
|
203
|
+
};
|
|
204
|
+
|
|
110
205
|
declare function useLessonkit(): LessonkitRuntime;
|
|
111
206
|
declare function useProgress(): _lessonkit_core.ProgressState;
|
|
112
207
|
declare function useTracking(): {
|
|
@@ -115,9 +210,12 @@ declare function useTracking(): {
|
|
|
115
210
|
}) => void;
|
|
116
211
|
};
|
|
117
212
|
declare function useCompletion(): {
|
|
118
|
-
completeLesson: (lessonId: LessonId
|
|
213
|
+
completeLesson: (lessonId: LessonId, opts?: {
|
|
214
|
+
courseId?: _lessonkit_core.CourseId;
|
|
215
|
+
}) => void;
|
|
119
216
|
completeCourse: () => void;
|
|
120
217
|
};
|
|
218
|
+
|
|
121
219
|
declare function useQuizState(enclosingLessonId?: LessonId): {
|
|
122
220
|
answer: (opts: {
|
|
123
221
|
checkId: CheckId;
|
|
@@ -133,6 +231,8 @@ declare function useQuizState(enclosingLessonId?: LessonId): {
|
|
|
133
231
|
}) => void;
|
|
134
232
|
};
|
|
135
233
|
|
|
234
|
+
declare function resetAssessmentWarningsForTests(): void;
|
|
235
|
+
|
|
136
236
|
type ThemeMode = "light" | "dark" | "system";
|
|
137
237
|
type ThemeResolvedMode = "light" | "dark";
|
|
138
238
|
type ThemeProviderProps = {
|
|
@@ -154,13 +254,14 @@ declare function ThemeProvider(props: ThemeProviderProps): react_jsx_runtime.JSX
|
|
|
154
254
|
declare function useTheme(): ThemeContextValue;
|
|
155
255
|
|
|
156
256
|
declare const blockCatalogVersion: 1;
|
|
257
|
+
declare const blockCatalogV2Version: 2;
|
|
157
258
|
type BlockPropSpec = {
|
|
158
259
|
name: string;
|
|
159
260
|
type: string;
|
|
160
261
|
required: boolean;
|
|
161
262
|
description: string;
|
|
162
263
|
};
|
|
163
|
-
type
|
|
264
|
+
type BlockCatalogEntryBase = {
|
|
164
265
|
type: string;
|
|
165
266
|
aliases?: string[];
|
|
166
267
|
category: "container" | "content" | "assessment" | "chrome";
|
|
@@ -187,6 +288,12 @@ type BlockCatalogEntry = {
|
|
|
187
288
|
manualTracking?: string;
|
|
188
289
|
};
|
|
189
290
|
};
|
|
291
|
+
type BlockCatalogEntry = BlockCatalogEntryBase;
|
|
292
|
+
type BlockCatalogEntryV2 = BlockCatalogEntryBase & {
|
|
293
|
+
assessmentContract?: true;
|
|
294
|
+
h5pMachineName?: string;
|
|
295
|
+
h5pAlias?: string;
|
|
296
|
+
};
|
|
190
297
|
declare const BLOCK_CATALOG: ({
|
|
191
298
|
type: string;
|
|
192
299
|
category: "container";
|
|
@@ -394,7 +501,11 @@ declare const BLOCK_CATALOG: ({
|
|
|
394
501
|
optionalIds?: undefined;
|
|
395
502
|
aliases?: undefined;
|
|
396
503
|
})[];
|
|
397
|
-
declare
|
|
398
|
-
|
|
504
|
+
declare const BLOCK_CATALOG_V2: BlockCatalogEntryV2[];
|
|
505
|
+
type BuildBlockCatalogOptions = {
|
|
506
|
+
version?: 1 | 2;
|
|
507
|
+
};
|
|
508
|
+
declare function buildBlockCatalog(opts?: BuildBlockCatalogOptions): BlockCatalogEntry[] | BlockCatalogEntryV2[];
|
|
509
|
+
declare function getBlockCatalogEntry(type: string, opts?: BuildBlockCatalogOptions): BlockCatalogEntry | BlockCatalogEntryV2 | undefined;
|
|
399
510
|
|
|
400
|
-
export { BLOCK_CATALOG, type BlockCatalogEntry, type BlockPropSpec, Course, type CourseProps, KnowledgeCheck, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, ProgressTracker, type ProgressTrackerProps, Quiz, type QuizProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetQuizWarningsForTests, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
|
|
511
|
+
export { AssessmentSequence, type AssessmentSequenceProps, BLOCK_CATALOG, BLOCK_CATALOG_V2, type BlockCatalogEntry, type BlockCatalogEntryV2, type BlockPropSpec, Course, type CourseProps, DragAndDrop, type DragAndDropProps, type DragItem, DragTheWords, type DragTheWordsProps, type DropTarget, type FillInBlankSpec, FillInTheBlanks, type FillInTheBlanksProps, KnowledgeCheck, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, MarkTheWords, type MarkTheWordsProps, ProgressTracker, type ProgressTrackerProps, Quiz, type QuizProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, TrueFalse, type TrueFalseProps, blockCatalogV2Version, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetAssessmentWarningsForTests, resetQuizWarningsForTests, useAssessmentState, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import * as _lessonkit_core from '@lessonkit/core';
|
|
4
|
-
import { CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, BlockId, CheckId } from '@lessonkit/core';
|
|
5
|
-
export { AssessmentScoreInput, AssessmentScoreResult, InteractionBlockRegistration, LessonkitPlugin, LessonkitPluginContext, LessonkitPluginKind, PluginHost, PluginRegistry, TelemetryPipelineSink, buildTelemetryEvent, createLessonkitRuntime, createPluginRegistry, createTelemetryPipeline, defineAssessmentPlugin, defineLifecyclePlugin, defineTelemetryPlugin } from '@lessonkit/core';
|
|
6
|
-
import {
|
|
4
|
+
import { CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, BlockId, AssessmentHandle, AssessmentBaseProps, AssessmentBehaviour, AssessmentAnsweredData, AssessmentCompletedData, CheckId } from '@lessonkit/core';
|
|
5
|
+
export { AssessmentAnsweredData, AssessmentBaseProps, AssessmentBehaviour, AssessmentCompletedData, AssessmentHandle, AssessmentInteractionType, AssessmentScoreInput, AssessmentScoreResult, AssessmentXAPIData, InteractionBlockRegistration, LessonkitPlugin, LessonkitPluginContext, LessonkitPluginKind, PluginHost, PluginRegistry, TelemetryPipelineSink, buildTelemetryEvent, createLessonkitRuntime, createPluginRegistry, createTelemetryPipeline, defineAssessmentPlugin, defineLifecyclePlugin, defineTelemetryPlugin } from '@lessonkit/core';
|
|
6
|
+
import { McqAssessmentDescriptor } from '@lessonkit/lxpack';
|
|
7
7
|
import { XAPITransport, XAPIClient } from '@lessonkit/xapi';
|
|
8
8
|
import { LxpackBridgeMode } from '@lessonkit/lxpack/bridge';
|
|
9
9
|
import { LessonkitThemeV1, ThemePresetName, PartialLessonkitThemeV1 } from '@lessonkit/themes';
|
|
@@ -58,7 +58,9 @@ type LessonkitRuntime = {
|
|
|
58
58
|
user?: TelemetryUser;
|
|
59
59
|
};
|
|
60
60
|
setActiveLesson: (lessonId: LessonId) => void;
|
|
61
|
-
completeLesson: (lessonId: LessonId
|
|
61
|
+
completeLesson: (lessonId: LessonId, opts?: {
|
|
62
|
+
courseId?: CourseId;
|
|
63
|
+
}) => void;
|
|
62
64
|
completeCourse: () => void;
|
|
63
65
|
track: <N extends TelemetryEventName>(name: N, data?: TelemetryDataFor<N>, opts?: {
|
|
64
66
|
lessonId?: LessonId;
|
|
@@ -94,8 +96,8 @@ type ReflectionProps = {
|
|
|
94
96
|
onChange?: (value: string) => void;
|
|
95
97
|
children?: React.ReactNode;
|
|
96
98
|
};
|
|
97
|
-
type QuizProps =
|
|
98
|
-
type KnowledgeCheckProps =
|
|
99
|
+
type QuizProps = McqAssessmentDescriptor;
|
|
100
|
+
type KnowledgeCheckProps = McqAssessmentDescriptor;
|
|
99
101
|
type ProgressTrackerProps = {
|
|
100
102
|
totalLessons?: number;
|
|
101
103
|
};
|
|
@@ -107,6 +109,99 @@ declare function KnowledgeCheck(props: KnowledgeCheckProps): react_jsx_runtime.J
|
|
|
107
109
|
declare function Quiz(props: QuizProps): react_jsx_runtime.JSX.Element;
|
|
108
110
|
declare function ProgressTracker(props: ProgressTrackerProps): react_jsx_runtime.JSX.Element;
|
|
109
111
|
|
|
112
|
+
type TrueFalseProps = AssessmentBaseProps & {
|
|
113
|
+
question: string;
|
|
114
|
+
answer: boolean;
|
|
115
|
+
};
|
|
116
|
+
declare const TrueFalse: React.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
117
|
+
checkId: _lessonkit_core.CheckId;
|
|
118
|
+
passingScore?: number;
|
|
119
|
+
} & {
|
|
120
|
+
question: string;
|
|
121
|
+
answer: boolean;
|
|
122
|
+
} & React.RefAttributes<AssessmentHandle>>;
|
|
123
|
+
|
|
124
|
+
type MarkTheWordsProps = AssessmentBaseProps & {
|
|
125
|
+
/** Plain text; words listed in `correctWords` are selectable targets. */
|
|
126
|
+
text: string;
|
|
127
|
+
correctWords: string[];
|
|
128
|
+
};
|
|
129
|
+
declare const MarkTheWords: React.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
130
|
+
checkId: _lessonkit_core.CheckId;
|
|
131
|
+
passingScore?: number;
|
|
132
|
+
} & {
|
|
133
|
+
/** Plain text; words listed in `correctWords` are selectable targets. */
|
|
134
|
+
text: string;
|
|
135
|
+
correctWords: string[];
|
|
136
|
+
} & React.RefAttributes<AssessmentHandle>>;
|
|
137
|
+
|
|
138
|
+
type FillInBlankSpec = {
|
|
139
|
+
id: string;
|
|
140
|
+
answer: string;
|
|
141
|
+
};
|
|
142
|
+
type FillInTheBlanksProps = AssessmentBaseProps & {
|
|
143
|
+
/** Text with `*` wrapping each blank answer, e.g. "The *capital* of France is *Paris*." */
|
|
144
|
+
template: string;
|
|
145
|
+
/** Optional explicit blanks (overrides parsing from template). */
|
|
146
|
+
blanks?: FillInBlankSpec[];
|
|
147
|
+
};
|
|
148
|
+
declare const FillInTheBlanks: React.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
149
|
+
checkId: _lessonkit_core.CheckId;
|
|
150
|
+
passingScore?: number;
|
|
151
|
+
} & {
|
|
152
|
+
/** Text with `*` wrapping each blank answer, e.g. "The *capital* of France is *Paris*." */
|
|
153
|
+
template: string;
|
|
154
|
+
/** Optional explicit blanks (overrides parsing from template). */
|
|
155
|
+
blanks?: FillInBlankSpec[];
|
|
156
|
+
} & React.RefAttributes<AssessmentHandle>>;
|
|
157
|
+
|
|
158
|
+
type DragTheWordsProps = AssessmentBaseProps & {
|
|
159
|
+
/** Sentence with `*` around drop zones; `words` are draggable options. */
|
|
160
|
+
template: string;
|
|
161
|
+
words: string[];
|
|
162
|
+
};
|
|
163
|
+
declare const DragTheWords: React.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
164
|
+
checkId: _lessonkit_core.CheckId;
|
|
165
|
+
passingScore?: number;
|
|
166
|
+
} & {
|
|
167
|
+
/** Sentence with `*` around drop zones; `words` are draggable options. */
|
|
168
|
+
template: string;
|
|
169
|
+
words: string[];
|
|
170
|
+
} & React.RefAttributes<AssessmentHandle>>;
|
|
171
|
+
|
|
172
|
+
type DragItem = {
|
|
173
|
+
id: string;
|
|
174
|
+
label: string;
|
|
175
|
+
};
|
|
176
|
+
type DropTarget = {
|
|
177
|
+
id: string;
|
|
178
|
+
label: string;
|
|
179
|
+
accepts: string;
|
|
180
|
+
};
|
|
181
|
+
type DragAndDropProps = AssessmentBaseProps & {
|
|
182
|
+
items: DragItem[];
|
|
183
|
+
targets: DropTarget[];
|
|
184
|
+
};
|
|
185
|
+
declare const DragAndDrop: React.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
186
|
+
checkId: _lessonkit_core.CheckId;
|
|
187
|
+
passingScore?: number;
|
|
188
|
+
} & {
|
|
189
|
+
items: DragItem[];
|
|
190
|
+
targets: DropTarget[];
|
|
191
|
+
} & React.RefAttributes<AssessmentHandle>>;
|
|
192
|
+
|
|
193
|
+
type AssessmentSequenceProps = AssessmentBehaviour & {
|
|
194
|
+
children: React.ReactNode;
|
|
195
|
+
/** Show one child assessment at a time (Question Set). */
|
|
196
|
+
sequential?: boolean;
|
|
197
|
+
};
|
|
198
|
+
declare function AssessmentSequence(props: AssessmentSequenceProps): react_jsx_runtime.JSX.Element;
|
|
199
|
+
|
|
200
|
+
declare function useAssessmentState(enclosingLessonId?: LessonId): {
|
|
201
|
+
answer: (data: AssessmentAnsweredData) => void;
|
|
202
|
+
complete: (data: AssessmentCompletedData) => void;
|
|
203
|
+
};
|
|
204
|
+
|
|
110
205
|
declare function useLessonkit(): LessonkitRuntime;
|
|
111
206
|
declare function useProgress(): _lessonkit_core.ProgressState;
|
|
112
207
|
declare function useTracking(): {
|
|
@@ -115,9 +210,12 @@ declare function useTracking(): {
|
|
|
115
210
|
}) => void;
|
|
116
211
|
};
|
|
117
212
|
declare function useCompletion(): {
|
|
118
|
-
completeLesson: (lessonId: LessonId
|
|
213
|
+
completeLesson: (lessonId: LessonId, opts?: {
|
|
214
|
+
courseId?: _lessonkit_core.CourseId;
|
|
215
|
+
}) => void;
|
|
119
216
|
completeCourse: () => void;
|
|
120
217
|
};
|
|
218
|
+
|
|
121
219
|
declare function useQuizState(enclosingLessonId?: LessonId): {
|
|
122
220
|
answer: (opts: {
|
|
123
221
|
checkId: CheckId;
|
|
@@ -133,6 +231,8 @@ declare function useQuizState(enclosingLessonId?: LessonId): {
|
|
|
133
231
|
}) => void;
|
|
134
232
|
};
|
|
135
233
|
|
|
234
|
+
declare function resetAssessmentWarningsForTests(): void;
|
|
235
|
+
|
|
136
236
|
type ThemeMode = "light" | "dark" | "system";
|
|
137
237
|
type ThemeResolvedMode = "light" | "dark";
|
|
138
238
|
type ThemeProviderProps = {
|
|
@@ -154,13 +254,14 @@ declare function ThemeProvider(props: ThemeProviderProps): react_jsx_runtime.JSX
|
|
|
154
254
|
declare function useTheme(): ThemeContextValue;
|
|
155
255
|
|
|
156
256
|
declare const blockCatalogVersion: 1;
|
|
257
|
+
declare const blockCatalogV2Version: 2;
|
|
157
258
|
type BlockPropSpec = {
|
|
158
259
|
name: string;
|
|
159
260
|
type: string;
|
|
160
261
|
required: boolean;
|
|
161
262
|
description: string;
|
|
162
263
|
};
|
|
163
|
-
type
|
|
264
|
+
type BlockCatalogEntryBase = {
|
|
164
265
|
type: string;
|
|
165
266
|
aliases?: string[];
|
|
166
267
|
category: "container" | "content" | "assessment" | "chrome";
|
|
@@ -187,6 +288,12 @@ type BlockCatalogEntry = {
|
|
|
187
288
|
manualTracking?: string;
|
|
188
289
|
};
|
|
189
290
|
};
|
|
291
|
+
type BlockCatalogEntry = BlockCatalogEntryBase;
|
|
292
|
+
type BlockCatalogEntryV2 = BlockCatalogEntryBase & {
|
|
293
|
+
assessmentContract?: true;
|
|
294
|
+
h5pMachineName?: string;
|
|
295
|
+
h5pAlias?: string;
|
|
296
|
+
};
|
|
190
297
|
declare const BLOCK_CATALOG: ({
|
|
191
298
|
type: string;
|
|
192
299
|
category: "container";
|
|
@@ -394,7 +501,11 @@ declare const BLOCK_CATALOG: ({
|
|
|
394
501
|
optionalIds?: undefined;
|
|
395
502
|
aliases?: undefined;
|
|
396
503
|
})[];
|
|
397
|
-
declare
|
|
398
|
-
|
|
504
|
+
declare const BLOCK_CATALOG_V2: BlockCatalogEntryV2[];
|
|
505
|
+
type BuildBlockCatalogOptions = {
|
|
506
|
+
version?: 1 | 2;
|
|
507
|
+
};
|
|
508
|
+
declare function buildBlockCatalog(opts?: BuildBlockCatalogOptions): BlockCatalogEntry[] | BlockCatalogEntryV2[];
|
|
509
|
+
declare function getBlockCatalogEntry(type: string, opts?: BuildBlockCatalogOptions): BlockCatalogEntry | BlockCatalogEntryV2 | undefined;
|
|
399
510
|
|
|
400
|
-
export { BLOCK_CATALOG, type BlockCatalogEntry, type BlockPropSpec, Course, type CourseProps, KnowledgeCheck, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, ProgressTracker, type ProgressTrackerProps, Quiz, type QuizProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetQuizWarningsForTests, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
|
|
511
|
+
export { AssessmentSequence, type AssessmentSequenceProps, BLOCK_CATALOG, BLOCK_CATALOG_V2, type BlockCatalogEntry, type BlockCatalogEntryV2, type BlockPropSpec, Course, type CourseProps, DragAndDrop, type DragAndDropProps, type DragItem, DragTheWords, type DragTheWordsProps, type DropTarget, type FillInBlankSpec, FillInTheBlanks, type FillInTheBlanksProps, KnowledgeCheck, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, MarkTheWords, type MarkTheWordsProps, ProgressTracker, type ProgressTrackerProps, Quiz, type QuizProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, TrueFalse, type TrueFalseProps, blockCatalogV2Version, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetAssessmentWarningsForTests, resetQuizWarningsForTests, useAssessmentState, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
|