cognikit 1.0.2 → 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/dist/builders/classification/index.d.ts +24 -0
- package/dist/builders/fill-blanks/index.d.ts +48 -0
- package/dist/client.js +2574 -2666
- package/dist/client.js.map +4 -4
- package/dist/core/builders/index.d.ts +48 -0
- package/dist/core/index.d.ts +2 -1
- package/dist/core/{BaseInteraction.d.ts → interactions/index.d.ts} +11 -12
- package/dist/engines/index.d.ts +0 -1
- package/dist/engines/tables/index.d.ts +40 -2
- package/dist/engines/tables/{implementation/utils.d.ts → utils.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2570 -2662
- package/dist/index.js.map +4 -4
- package/dist/interactions/adjacency-table/index.d.ts +6 -7
- package/dist/interactions/classification-matrix/index.d.ts +7 -6
- package/dist/interactions/fill-blanks/index.d.ts +36 -2
- package/dist/interactions/index.d.ts +0 -2
- package/dist/interactions/list-recall/index.d.ts +27 -1
- package/dist/interactions/lookup-table/index.d.ts +6 -7
- package/dist/interactions/mark-the-words/index.d.ts +34 -2
- package/dist/interactions/mcq-mrq/index.d.ts +37 -2
- package/dist/interactions/nary-choice-table/index.d.ts +7 -13
- package/dist/interactions/open-classification/index.d.ts +9 -6
- package/dist/interactions/rank-order/index.d.ts +49 -2
- package/dist/interactions/registry.d.ts +5 -5
- package/dist/interactions/sequential-classification/index.d.ts +8 -6
- package/dist/interactions/simultaneous-association/index.d.ts +7 -12
- package/dist/{shared/managers → managers}/AnimationsManager.d.ts +6 -1
- package/dist/managers/DragAndDropManager.d.ts +37 -0
- package/dist/{core/utilities/ProgressTracker.d.ts → managers/ProgressManager.d.ts} +8 -8
- package/dist/managers/ScoringManager.d.ts +73 -0
- package/dist/managers/index.d.ts +4 -0
- package/dist/shared/config.d.ts +1 -1
- package/dist/shared/index.d.ts +0 -2
- package/dist/shared/utils.d.ts +2 -1
- package/dist/shell/builders/index.d.ts +29 -0
- package/dist/shell/index.d.ts +2 -1
- package/dist/shell/{simple-shell/script.d.ts → interactions/index.d.ts} +8 -7
- package/dist/types/Builders.d.ts +17 -0
- package/dist/types/Data.d.ts +49 -9
- package/dist/types/Global.d.ts +2 -23
- package/dist/types/Grading.d.ts +2 -0
- package/dist/types/Input.d.ts +12 -16
- package/dist/types/Interactions.d.ts +10 -14
- package/dist/types/Tables.d.ts +2 -2
- package/dist/ui/{misc/block.d.ts → block/index.d.ts} +1 -1
- package/dist/ui/{misc/chip/chip.d.ts → chip/index.d.ts} +8 -4
- package/dist/ui/{misc/dialog.d.ts → dialog/index.d.ts} +0 -1
- package/dist/ui/index.d.ts +4 -1
- package/dist/ui/input/index.d.ts +22 -1
- package/dist/ui/{misc/media.d.ts → media/index.d.ts} +1 -1
- package/package.json +1 -1
- package/public/app.js +5874 -8649
- package/public/app.js.map +4 -4
- package/public/assets/images/landscape.jpg +0 -0
- package/public/assets/images/mountains.jpg +0 -0
- package/public/builders.html +87 -0
- package/public/examples/data.ts +167 -0
- package/public/index.html +1008 -779
- package/dist/core/utilities/index.d.ts +0 -1
- package/dist/engines/tables/implementation/graders.d.ts +0 -23
- package/dist/engines/tables/implementation/index.d.ts +0 -4
- package/dist/engines/tables/implementation/parsers.d.ts +0 -36
- package/dist/engines/tables/implementation/validators.d.ts +0 -9
- package/dist/engines/tables/script.d.ts +0 -37
- package/dist/engines/text/implementation/graders.d.ts +0 -69
- package/dist/engines/text/implementation/index.d.ts +0 -3
- package/dist/engines/text/implementation/parsers.d.ts +0 -9
- package/dist/engines/text/implementation/validators.d.ts +0 -41
- package/dist/engines/text/index.d.ts +0 -2
- package/dist/engines/text/script.d.ts +0 -56
- package/dist/interactions/categorize-the-words/index.d.ts +0 -2
- package/dist/interactions/categorize-the-words/sequential.d.ts +0 -33
- package/dist/interactions/categorize-the-words/static.d.ts +0 -22
- package/dist/interactions/fill-blanks/sequential.d.ts +0 -32
- package/dist/interactions/fill-blanks/static.d.ts +0 -23
- package/dist/interactions/list-recall/script.d.ts +0 -25
- package/dist/interactions/mark-the-words/sequential.d.ts +0 -34
- package/dist/interactions/mark-the-words/static.d.ts +0 -40
- package/dist/interactions/mcq-mrq/implementation/grader.d.ts +0 -20
- package/dist/interactions/mcq-mrq/implementation/index.d.ts +0 -3
- package/dist/interactions/mcq-mrq/implementation/parser.d.ts +0 -21
- package/dist/interactions/mcq-mrq/implementation/validator.d.ts +0 -17
- package/dist/interactions/mcq-mrq/script.d.ts +0 -37
- package/dist/interactions/rank-order/implementation/grader.d.ts +0 -15
- package/dist/interactions/rank-order/implementation/index.d.ts +0 -3
- package/dist/interactions/rank-order/implementation/parser.d.ts +0 -25
- package/dist/interactions/rank-order/implementation/validator.d.ts +0 -3
- package/dist/interactions/rank-order/script.d.ts +0 -39
- package/dist/interactions/shared/association-implementation/grader.d.ts +0 -3
- package/dist/interactions/shared/association-implementation/index.d.ts +0 -1
- package/dist/interactions/shared/association-implementation/validator.d.ts +0 -0
- package/dist/interactions/shared/classification-implementation/grader.d.ts +0 -3
- package/dist/interactions/shared/classification-implementation/index.d.ts +0 -1
- package/dist/interactions/shared/classification-implementation/parser.d.ts +0 -11
- package/dist/interactions/shared/classification-implementation/validator.d.ts +0 -3
- package/dist/interactions/text-transformation/index.d.ts +0 -2
- package/dist/interactions/text-transformation/sequential.d.ts +0 -37
- package/dist/interactions/text-transformation/static.d.ts +0 -47
- package/dist/shared/dsl.d.ts +0 -9
- package/dist/shared/managers/index.d.ts +0 -3
- package/dist/shared/types.d.ts +0 -25
- package/dist/shell/simple-shell/index.d.ts +0 -1
- package/dist/types/Text.d.ts +0 -125
- package/dist/ui/input/input/index.d.ts +0 -1
- package/dist/ui/input/input/input.d.ts +0 -22
- package/dist/ui/misc/chip/index.d.ts +0 -1
- package/dist/ui/misc/index.d.ts +0 -4
- package/public/assets/images/pointing-hand.svg +0 -1
- package/public/examples/chip.html +0 -495
- package/public/scalable-bare.html +0 -432
- package/public/tables-demo.html +0 -534
- package/public/text-interactions-demo.html +0 -604
- /package/dist/{interactions/list-recall/implementation → builders/list}/index.d.ts +0 -0
- /package/dist/{core/utilities/ScoringTracker.d.ts → builders/matching/inde.d.ts} +0 -0
- /package/dist/{ui/input/color → builders/ordering}/index.d.ts +0 -0
- /package/dist/{ui/input/letter → builders/tables}/index.d.ts +0 -0
- /package/dist/{interactions/list-recall/implementation/grader.d.ts → builders/text/index.d.ts} +0 -0
- /package/dist/interactions/{list-recall/implementation/parser.d.ts → exp/CategorizeTheWords.d.ts} +0 -0
- /package/dist/interactions/{list-recall/implementation/validator.d.ts → exp/DndFillBlanks.d.ts} +0 -0
- /package/dist/interactions/{shared/association-implementation/parser.d.ts → exp/TextTransformation.d.ts} +0 -0
- /package/dist/{shared/managers → managers}/SoundManager.d.ts +0 -0
- /package/dist/ui/{input/color/color-picker.d.ts → exp/color/index.d.ts} +0 -0
- /package/dist/ui/{input/letter/letter-picker.d.ts → exp/letter/index.d.ts} +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ParsingResult } from "../../../shared";
|
|
2
|
-
/**
|
|
3
|
-
* Parses a simple DSL for seriation data
|
|
4
|
-
*
|
|
5
|
-
* Format: Items separated by pipes (|) or newlines
|
|
6
|
-
*
|
|
7
|
-
* Example 1 (pipe-separated):
|
|
8
|
-
* ```
|
|
9
|
-
* Egg | Caterpillar | Chrysalis | Butterfly
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
* Example 2 (numbered):
|
|
13
|
-
* ```
|
|
14
|
-
* 1. American Revolution
|
|
15
|
-
* 2. French Revolution
|
|
16
|
-
* 3. Industrial Revolution
|
|
17
|
-
* 4. World War I
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* Example 3 (with assets):
|
|
21
|
-
* ```
|
|
22
|
-
* @:step1 | @:step2 | @:step3 | Final Product
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export declare function seriationParser(code: string): ParsingResult;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { BaseInteraction } from "../../core/BaseInteraction";
|
|
2
|
-
import { Variant } from "../../shared/types";
|
|
3
|
-
import { InteractionConfig, InteractionMechanic } from "../../types/Interactions";
|
|
4
|
-
import { NormalizedAssets } from "../../types/Assets";
|
|
5
|
-
import { SeriationData } from "../../types/Data";
|
|
6
|
-
export declare class RankOrder extends BaseInteraction<SeriationData> {
|
|
7
|
-
interactionMechanic: InteractionMechanic;
|
|
8
|
-
private currentOrder;
|
|
9
|
-
private isGraded;
|
|
10
|
-
private $container;
|
|
11
|
-
private $rowsContainer;
|
|
12
|
-
private draggedRowIndex;
|
|
13
|
-
private dragOverRowIndex;
|
|
14
|
-
private isDragging;
|
|
15
|
-
private draggedRow;
|
|
16
|
-
private dragOffsetY;
|
|
17
|
-
private boundPointerMove;
|
|
18
|
-
private boundPointerUp;
|
|
19
|
-
private variant;
|
|
20
|
-
private readonly MAX_ITEMS;
|
|
21
|
-
private readonly MIN_ITEM_HEIGHT;
|
|
22
|
-
constructor(data: SeriationData, config: InteractionConfig, assets: NormalizedAssets | null);
|
|
23
|
-
protected initialize(): void;
|
|
24
|
-
protected cleanup(): void;
|
|
25
|
-
onVariantChange(newVariant: Variant): void;
|
|
26
|
-
render(): void;
|
|
27
|
-
private renderRows;
|
|
28
|
-
private createButton;
|
|
29
|
-
private swapItems;
|
|
30
|
-
private handlePointerDown;
|
|
31
|
-
private handlePointerMove;
|
|
32
|
-
private handlePointerUp;
|
|
33
|
-
private getRowIndexAtY;
|
|
34
|
-
getCurrentState(): any;
|
|
35
|
-
isInteractionComplete(): boolean;
|
|
36
|
-
onHint(): void;
|
|
37
|
-
submit(): void;
|
|
38
|
-
reset(): void;
|
|
39
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./grader";
|
|
File without changes
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ClassificationData } from "../../../types/Data";
|
|
2
|
-
import { GradingResult } from "../../../types/Grading";
|
|
3
|
-
export declare function classificationGrader(correctData: ClassificationData["categories"], userData: Map<string, string>, els: any, distractors?: string[]): GradingResult;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { classificationGrader } from "./grader";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ParsingResult } from "../../../shared";
|
|
2
|
-
/**
|
|
3
|
-
* Example
|
|
4
|
-
* ---
|
|
5
|
-
* RED FRUITS = apple | strawberry | cherry;
|
|
6
|
-
* Yellow Fruits = banana | pineapple | mango;
|
|
7
|
-
* Green Fruits = watermelon | avocado;
|
|
8
|
-
* = coconut | eggplant;
|
|
9
|
-
* ---
|
|
10
|
-
*/
|
|
11
|
-
export declare function classificationParser(code: string): ParsingResult;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { BaseInteraction } from "../../core/BaseInteraction";
|
|
2
|
-
import { Variant } from "../../shared/types";
|
|
3
|
-
import { InteractionConfig, InteractionMechanic } from "../../types/Interactions";
|
|
4
|
-
import { GradingResult } from "../../types/Grading";
|
|
5
|
-
import { TextEngineSequentialInteractionData } from "../../types/Text";
|
|
6
|
-
export type SequentialTransformationExpectations = Record<number, Record<number, string[]>>;
|
|
7
|
-
export declare class SequentialTextTransformation extends BaseInteraction<TextEngineSequentialInteractionData> {
|
|
8
|
-
interactionMechanic: InteractionMechanic;
|
|
9
|
-
private _slides;
|
|
10
|
-
private _currentStep;
|
|
11
|
-
private _textConfig;
|
|
12
|
-
private _$text;
|
|
13
|
-
private _responses;
|
|
14
|
-
private _gradingByStep;
|
|
15
|
-
private _isGraded;
|
|
16
|
-
private _expectedByStep;
|
|
17
|
-
get slidesCount(): number;
|
|
18
|
-
constructor(data: TextEngineSequentialInteractionData, config: InteractionConfig, expectedByStep?: SequentialTransformationExpectations);
|
|
19
|
-
protected initialize(): void;
|
|
20
|
-
protected cleanup(): void;
|
|
21
|
-
onVariantChange(newVariant: Variant): void;
|
|
22
|
-
setSteps(stepIndex: number): void;
|
|
23
|
-
render(): void;
|
|
24
|
-
private getTotalTargetCount;
|
|
25
|
-
private buildDefaultExpectations;
|
|
26
|
-
private getExpectedForStep;
|
|
27
|
-
private saveCurrentStepResponse;
|
|
28
|
-
private getResponseForStep;
|
|
29
|
-
private updateProgressAcrossSteps;
|
|
30
|
-
getCurrentState(): any;
|
|
31
|
-
isInteractionComplete(): boolean;
|
|
32
|
-
onHint(): void;
|
|
33
|
-
grade(): GradingResult;
|
|
34
|
-
submit(): void;
|
|
35
|
-
reset(): void;
|
|
36
|
-
setExpectedTransformationsByStep(expectedByStep: SequentialTransformationExpectations): void;
|
|
37
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { BaseInteraction } from "../../core/BaseInteraction";
|
|
2
|
-
import { Variant } from "../../shared/types";
|
|
3
|
-
import { InteractionConfig, InteractionMechanic } from "../../types/Interactions";
|
|
4
|
-
import { TextEngineBaseData } from "../../types/Text";
|
|
5
|
-
import { type TextEngineBaseUserData } from "../../engines/text";
|
|
6
|
-
/**
|
|
7
|
-
* Text Transformation Interaction
|
|
8
|
-
*
|
|
9
|
-
* Users edit highlighted text segments to transform them according to instructions.
|
|
10
|
-
* For example: convert present tense to past tense, singular to plural, etc.
|
|
11
|
-
*
|
|
12
|
-
* Example data:
|
|
13
|
-
* ```
|
|
14
|
-
* {
|
|
15
|
-
* type: 'base',
|
|
16
|
-
* parts: ['I', 'drink', 'water', 'every', 'day'],
|
|
17
|
-
* targets: [
|
|
18
|
-
* { words: ['drink'], startPos: 1, endPos: 1 }
|
|
19
|
-
* ]
|
|
20
|
-
* }
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* Expected transformations would be provided separately in config or instructions.
|
|
24
|
-
*/
|
|
25
|
-
export declare class TextTransformation extends BaseInteraction<TextEngineBaseData> {
|
|
26
|
-
interactionMechanic: InteractionMechanic;
|
|
27
|
-
private _textConfig;
|
|
28
|
-
private _$text;
|
|
29
|
-
private _expectedTransformations;
|
|
30
|
-
constructor(data: TextEngineBaseData, config: InteractionConfig, expectedTransformations?: Record<number, string[]>);
|
|
31
|
-
protected initialize(): void;
|
|
32
|
-
protected cleanup(): void;
|
|
33
|
-
onVariantChange(newVariant: Variant): void;
|
|
34
|
-
render(): void;
|
|
35
|
-
getCurrentState(): TextEngineBaseUserData;
|
|
36
|
-
isInteractionComplete(): boolean;
|
|
37
|
-
onHint(): void;
|
|
38
|
-
getUserData(): TextEngineBaseUserData;
|
|
39
|
-
submit(): void;
|
|
40
|
-
grade(): import("../..").GradingResult;
|
|
41
|
-
reset(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Set the expected transformations after construction
|
|
44
|
-
* Useful for dynamic configuration
|
|
45
|
-
*/
|
|
46
|
-
setExpectedTransformations(transformations: Record<number, string[]>): void;
|
|
47
|
-
}
|
package/dist/shared/dsl.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GrammarParser } from "../types/Global";
|
|
2
|
-
import { TextData, NumberData, SelectData, DateData, TimeData } from "../types/Input";
|
|
3
|
-
export declare const parseTX: GrammarParser<TextData>;
|
|
4
|
-
export declare const parseSL: GrammarParser<SelectData>;
|
|
5
|
-
export declare const parseNM: GrammarParser<NumberData>;
|
|
6
|
-
export declare const parseDT: GrammarParser<DateData>;
|
|
7
|
-
export declare const parseTM: GrammarParser<TimeData>;
|
|
8
|
-
export declare function isInteractionSequential(s: string): boolean;
|
|
9
|
-
export declare function splitByDoubleSemiColon(s: string): string[];
|
package/dist/shared/types.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { InteractionData } from "../types/Data";
|
|
2
|
-
export type Variant = 'elegant' | 'playful' | 'outline' | 'letter' | 'sign' | 'minimal' | 'glass' | 'empty';
|
|
3
|
-
export type CognitiveOp = 'discrimination' | 'classification' | 'freerecall' | 'production' | 'association' | 'comparisson' | 'transformation' | 'seriation' | 'recognition' | 'cuedrecall' | 'evaluation';
|
|
4
|
-
export interface Module {
|
|
5
|
-
id: string;
|
|
6
|
-
process: CognitiveOp;
|
|
7
|
-
implementation: {
|
|
8
|
-
parser(code: string): ParsingResult;
|
|
9
|
-
validator(data: InteractionData): ValidationResult;
|
|
10
|
-
interactions: Record<string, any>;
|
|
11
|
-
};
|
|
12
|
-
help: string;
|
|
13
|
-
}
|
|
14
|
-
export type ParsingResult = {
|
|
15
|
-
ok: boolean;
|
|
16
|
-
data?: InteractionData | null;
|
|
17
|
-
errors?: Record<string, string> | null;
|
|
18
|
-
};
|
|
19
|
-
export type ValidationResult = {
|
|
20
|
-
ok: boolean;
|
|
21
|
-
errors: Record<string, string> | null;
|
|
22
|
-
};
|
|
23
|
-
export type GrammarParser = (code: string) => GrammarParseResult;
|
|
24
|
-
export type GrammarParseResult = ParsingResult;
|
|
25
|
-
export type SimpleErrorObject = Record<string, string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { InteractionsBaseShell } from "./script";
|
package/dist/types/Text.d.ts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { InputElementData } from "./Input";
|
|
2
|
-
import { Variant } from "../shared/types";
|
|
3
|
-
import { GradingState } from "./Grading";
|
|
4
|
-
export type TextEngineRenderMode = 'highlight' | 'dnd' | 'blanks' | 'transformation' | 'classification';
|
|
5
|
-
export type TextEngineModality = 'base' | 'blanks' | 'classification';
|
|
6
|
-
export type TextEngineDataUnion = TextEngineBaseData | TextEngineBlanksData | TextEngineClassificationData;
|
|
7
|
-
export type TextEngineBaseDataTarget = {
|
|
8
|
-
words: string[];
|
|
9
|
-
startPos: number;
|
|
10
|
-
endPos: number;
|
|
11
|
-
};
|
|
12
|
-
export type TextEngineBlanksDataTarget = {
|
|
13
|
-
id: string;
|
|
14
|
-
expectedValue: InputElementData;
|
|
15
|
-
};
|
|
16
|
-
export type TextEngineClassificationDataTarget = {
|
|
17
|
-
category: string;
|
|
18
|
-
targets: TextEngineBaseDataTarget[];
|
|
19
|
-
};
|
|
20
|
-
interface TextEngineData {
|
|
21
|
-
type: TextEngineModality;
|
|
22
|
-
parts: string[];
|
|
23
|
-
targets: TextEngineBaseDataTarget[] | TextEngineBlanksDataTarget[] | TextEngineClassificationDataTarget[];
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Words for HIGHLIGHT, DND Blanks and Transformation
|
|
27
|
-
*
|
|
28
|
-
* Example:
|
|
29
|
-
*
|
|
30
|
-
* The family will always [think] there's someone [destroying] their plans.
|
|
31
|
-
*
|
|
32
|
-
* { words: ["think"], startPos: 4, endPos: 4 },
|
|
33
|
-
* { words: ["destroying"], startPost: 7, endPos: 7 }
|
|
34
|
-
*
|
|
35
|
-
* if distractors, they are defined like "= [... | ...];"
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
export interface TextEngineBaseData extends TextEngineData {
|
|
39
|
-
type: 'base';
|
|
40
|
-
targets: TextEngineBaseDataTarget[];
|
|
41
|
-
distractors?: string[];
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Fill Blanks Only - variations with [text, number, data, time, select, ..., mixed] input elements
|
|
45
|
-
*
|
|
46
|
-
* Example:
|
|
47
|
-
*
|
|
48
|
-
* I @tx(am) someone who doesn't like people who @tx(is) arrogant. I have told you that @nm(3) times already.
|
|
49
|
-
*
|
|
50
|
-
* { id: "generatedIdInParser', expectedValue: { value: ["am"] } },
|
|
51
|
-
* { id: "...". expectedValue: { value: ["is"] } },
|
|
52
|
-
* ...
|
|
53
|
-
*
|
|
54
|
-
* The elements will be a generated string. That is, the parser would take '@tx(...)', and create '<edu-input as="text" id="...'>...'.
|
|
55
|
-
* Then it would add the id (possibly using the hash helper function) and store the expectedValue object which would be the result of
|
|
56
|
-
* the parseText(code: string) helper function, passing the content taken from '@tx(...)' as a parameter.
|
|
57
|
-
*
|
|
58
|
-
*/
|
|
59
|
-
export interface TextEngineBlanksData extends TextEngineData {
|
|
60
|
-
type: 'blanks';
|
|
61
|
-
targets: TextEngineBlanksDataTarget[];
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Classification Only -- extension of base highlight variation
|
|
65
|
-
* Example:
|
|
66
|
-
*
|
|
67
|
-
* I am @cat(adjectives, tired) of @cat(verbs, seeing) everybody @cat(verbs, dance) @cat(adverbs, happily) while
|
|
68
|
-
* we are here all @cat(adjectives, sad)!
|
|
69
|
-
*
|
|
70
|
-
* { category: adjectives; targets: [ { words: ["tired"], startPos: 2, endPos: 2 }, { words: ["sad"], startPos: 13, endPos: 13 }] },
|
|
71
|
-
* ...
|
|
72
|
-
*
|
|
73
|
-
*/
|
|
74
|
-
export interface TextEngineClassificationData extends TextEngineData {
|
|
75
|
-
type: 'classification';
|
|
76
|
-
targets: TextEngineClassificationDataTarget[];
|
|
77
|
-
}
|
|
78
|
-
export type TextEngineSequentialInteractionData = TextEngineDataUnion[];
|
|
79
|
-
/**
|
|
80
|
-
* Rendering mode for text engine
|
|
81
|
-
* - highlight: Click words to select/highlight
|
|
82
|
-
* - dnd: Drag and drop words/chips
|
|
83
|
-
* - blanks: Fill in input elements
|
|
84
|
-
* - transformation: Edit text in contenteditable areas
|
|
85
|
-
* - classification: Assign words to categories
|
|
86
|
-
*/
|
|
87
|
-
/**
|
|
88
|
-
* Grading state for parts (word indices) or inputs (IDs)
|
|
89
|
-
*/
|
|
90
|
-
export type TextEngineGradingState = Record<number | string, GradingState>;
|
|
91
|
-
/**
|
|
92
|
-
* Configuration for the EduText custom element
|
|
93
|
-
*/
|
|
94
|
-
export interface TextEngineConfiguration {
|
|
95
|
-
data: TextEngineDataUnion;
|
|
96
|
-
mode: TextEngineRenderMode;
|
|
97
|
-
variant?: Variant;
|
|
98
|
-
gradingState?: TextEngineGradingState;
|
|
99
|
-
categories?: string[];
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Change event detail for EduText element
|
|
103
|
-
*/
|
|
104
|
-
export interface EduTextChangeDetail {
|
|
105
|
-
/** Current user data state */
|
|
106
|
-
userState: any;
|
|
107
|
-
/** Type of data (base/blanks/classification) */
|
|
108
|
-
dataType: TextEngineModality;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* State tracking for EduText element
|
|
112
|
-
*/
|
|
113
|
-
export interface TextEngineState {
|
|
114
|
-
/** For highlight: selected word indices */
|
|
115
|
-
selectedIndices?: Set<number>;
|
|
116
|
-
/** For DND: target index -> placed word */
|
|
117
|
-
dndPlacements?: Record<number, string>;
|
|
118
|
-
/** For blanks: input values by ID */
|
|
119
|
-
inputValues?: Record<string, any>;
|
|
120
|
-
/** For classification: word index -> category name */
|
|
121
|
-
wordCategories?: Record<number, string>;
|
|
122
|
-
/** For transformation: target index -> transformed words */
|
|
123
|
-
transformations?: Record<number, string[]>;
|
|
124
|
-
}
|
|
125
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { EduInput } from "./input";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Variant } from "../../../shared/types";
|
|
2
|
-
export declare class EduInput extends HTMLElement {
|
|
3
|
-
static get observedAttributes(): string[];
|
|
4
|
-
private $slot;
|
|
5
|
-
private controlEl;
|
|
6
|
-
private currentTag;
|
|
7
|
-
constructor();
|
|
8
|
-
connectedCallback(): void;
|
|
9
|
-
disconnectedCallback(): void;
|
|
10
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
11
|
-
private handleSlotChange;
|
|
12
|
-
private getTag;
|
|
13
|
-
private render;
|
|
14
|
-
private applyAttr;
|
|
15
|
-
private applyBoolAttr;
|
|
16
|
-
private syncAttributes;
|
|
17
|
-
private syncContent;
|
|
18
|
-
get variant(): Variant;
|
|
19
|
-
set variant(v: Variant);
|
|
20
|
-
get value(): string;
|
|
21
|
-
set value(v: string);
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./chip";
|
package/dist/ui/misc/index.d.ts
DELETED