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 +0,0 @@
|
|
|
1
|
-
export { ProgressTracker } from './ProgressTracker';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { TableCompletion, TableState } from "../../../types/Tables";
|
|
2
|
-
import { GradingResult } from "../../../types/Grading";
|
|
3
|
-
import { CellGradingState } from "../../../types/Tables";
|
|
4
|
-
export declare function naryTableGrader(answerKey: Map<string, string[]>, userData: TableCompletion, rows: string[]): GradingResult;
|
|
5
|
-
export declare function lookupTableGrader(answerKey: TableState, userData: TableCompletion, rows: string[], cols: string[]): GradingResult;
|
|
6
|
-
export declare function classificationTableGrader(answerKey: Map<string, string[]>, userData: TableCompletion, rows: string[], cols: string[]): GradingResult;
|
|
7
|
-
export declare function adjacencyTableGrader(answerKey: TableState, userData: TableCompletion, rows: string[]): GradingResult;
|
|
8
|
-
/**
|
|
9
|
-
* Generate per-cell grading state for adjacency tables
|
|
10
|
-
*/
|
|
11
|
-
export declare function getAdjacencyCellGrading(answerKey: TableState, userData: TableCompletion, rows: string[]): CellGradingState;
|
|
12
|
-
/**
|
|
13
|
-
* Generate per-cell grading state for lookup tables
|
|
14
|
-
*/
|
|
15
|
-
export declare function getLookupCellGrading(answerKey: TableState, userData: TableCompletion, rows: string[], cols: string[]): CellGradingState;
|
|
16
|
-
/**
|
|
17
|
-
* Generate per-cell grading state for classification tables
|
|
18
|
-
*/
|
|
19
|
-
export declare function getClassificationCellGrading(answerKey: Map<string, string[]>, userData: TableCompletion, rows: string[], cols: string[]): CellGradingState;
|
|
20
|
-
/**
|
|
21
|
-
* Generate per-cell grading state for n-ary tables
|
|
22
|
-
*/
|
|
23
|
-
export declare function getNaryCellGrading(answerKey: Map<string, string[]>, userData: TableCompletion, rows: string[]): CellGradingState;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { BaseTableData, ValueTableData } from "../../../types/Tables";
|
|
2
|
-
type ParseResult = {
|
|
3
|
-
data: BaseTableData;
|
|
4
|
-
errors?: Record<string, string>;
|
|
5
|
-
};
|
|
6
|
-
type ValueTableParseResult = {
|
|
7
|
-
data: ValueTableData;
|
|
8
|
-
errors?: Record<string, string>;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* The classification table presents a default configuration where we have non-equal rows and columns and
|
|
12
|
-
* participant is presented with check boxes on each cell to add 'attributes' to each row item.
|
|
13
|
-
*
|
|
14
|
-
* The n-ary table is just a superset or the former, with the discrepancies being using radio buttons instead
|
|
15
|
-
* (single selection) and not allowing row items to be in more than one category (this is handled in the
|
|
16
|
-
* n-ary table validator).
|
|
17
|
-
*
|
|
18
|
-
* For grading, we take the row item and the checked columns. Using the answerKey, we check if those columns
|
|
19
|
-
* that were selected contain the row item; correct if yes, wrong otherwise. If there are mixed correct/wrong,
|
|
20
|
-
* we just fractionate the grading n/100, where n = correct items.
|
|
21
|
-
*
|
|
22
|
-
* Classification Example - Notice repetitions
|
|
23
|
-
*
|
|
24
|
-
* WORK = Talk with my colleagues | Eat | Report Attendance;
|
|
25
|
-
* SCHOOL = Eat | Complete my examns | Play in the basketball club;
|
|
26
|
-
* HOME = Eat | Talk with my colleagues | Sleep;
|
|
27
|
-
*
|
|
28
|
-
* N-ARY example
|
|
29
|
-
*
|
|
30
|
-
* TRUE = Water is Blue | An active volcano is hot;
|
|
31
|
-
* FALSE = MJ was a piano player | Africa is above Europe | A chef is someone who writes poems
|
|
32
|
-
*/
|
|
33
|
-
export declare function basicTableDataParser(code: string): ParseResult;
|
|
34
|
-
export declare function adjacencyTableDataParser(code: string): ValueTableParseResult;
|
|
35
|
-
export declare function lookupTableDataParser(code: string): ValueTableParseResult;
|
|
36
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseTableData, ValueTableData } from "../../../types/Tables";
|
|
2
|
-
type ValidationResult = {
|
|
3
|
-
ok: boolean;
|
|
4
|
-
errors?: Record<string, string>;
|
|
5
|
-
};
|
|
6
|
-
export declare function basicTableDataValidator(data: BaseTableData, preset?: 'classification' | 'n-ary'): ValidationResult;
|
|
7
|
-
export declare function adjacencyTableDataValidator(data: ValueTableData): ValidationResult;
|
|
8
|
-
export declare function lookupTableDataValidator(data: ValueTableData): ValidationResult;
|
|
9
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { TableConfiguration, TableState, CellGradingState, TableCompletion } from "../../types/Tables";
|
|
2
|
-
type EduTableElement = HTMLElement & {
|
|
3
|
-
config: TableConfiguration;
|
|
4
|
-
getValue(): TableState;
|
|
5
|
-
setValue(next: TableState): void;
|
|
6
|
-
getState(): TableCompletion;
|
|
7
|
-
reset(): void;
|
|
8
|
-
};
|
|
9
|
-
export declare class EduTable extends HTMLElement implements EduTableElement {
|
|
10
|
-
private _config;
|
|
11
|
-
private _state;
|
|
12
|
-
private _mounted;
|
|
13
|
-
static get observedAttributes(): string[];
|
|
14
|
-
private $wrapEl;
|
|
15
|
-
constructor();
|
|
16
|
-
connectedCallback(): void;
|
|
17
|
-
disconnectedCallback(): void;
|
|
18
|
-
set config(v: TableConfiguration);
|
|
19
|
-
get config(): TableConfiguration;
|
|
20
|
-
get value(): TableState;
|
|
21
|
-
set value(v: TableState);
|
|
22
|
-
getValue(): TableState;
|
|
23
|
-
setValue(next: TableState): void;
|
|
24
|
-
getState(): TableCompletion;
|
|
25
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
26
|
-
private initState;
|
|
27
|
-
private render;
|
|
28
|
-
private renderCell;
|
|
29
|
-
reset(): void;
|
|
30
|
-
setGradingState(gradingState: CellGradingState): void;
|
|
31
|
-
clearGradingState(): void;
|
|
32
|
-
private onChange;
|
|
33
|
-
private onInput;
|
|
34
|
-
private applyCellValue;
|
|
35
|
-
private emitChange;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { TextEngineBaseData, TextEngineBlanksData, TextEngineClassificationData } from "../../../types/Text";
|
|
2
|
-
import { GradingResult, GradingState } from "../../../types/Grading";
|
|
3
|
-
/**
|
|
4
|
-
* User data for base interactions (highlight, DND, transformation)
|
|
5
|
-
*/
|
|
6
|
-
export type TextEngineBaseUserData = {
|
|
7
|
-
selectedIndices?: number[];
|
|
8
|
-
placedIndices?: number[];
|
|
9
|
-
dndPlacements?: Record<number, string>;
|
|
10
|
-
transformations?: Record<number, string[]>;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* User data for blanks interactions (fill-in-the-blanks)
|
|
14
|
-
*/
|
|
15
|
-
export type TextEngineBlanksUserData = {
|
|
16
|
-
inputValues: Record<string, any>;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* User data for classification interactions
|
|
20
|
-
*/
|
|
21
|
-
export type TextEngineClassificationUserData = {
|
|
22
|
-
wordCategories: Record<number, string>;
|
|
23
|
-
};
|
|
24
|
-
export type TextEngineBaseGradingState = Record<number, GradingState>;
|
|
25
|
-
export type TextEngineBlanksGradingState = Record<string, GradingState>;
|
|
26
|
-
export type TextEngineClassificationGradingState = Record<number, GradingState>;
|
|
27
|
-
/**
|
|
28
|
-
* Grade highlight interaction
|
|
29
|
-
* User must select all and only the target words
|
|
30
|
-
*/
|
|
31
|
-
export declare function textEngineHighlightGrader(data: TextEngineBaseData, userData: TextEngineBaseUserData): GradingResult;
|
|
32
|
-
/**
|
|
33
|
-
* Grade DND (drag and drop) interaction
|
|
34
|
-
* User must place target words in correct positions
|
|
35
|
-
*/
|
|
36
|
-
export declare function textEngineDNDGrader(data: TextEngineBaseData, userData: TextEngineBaseUserData): GradingResult;
|
|
37
|
-
export declare function getDNDGradingState(data: TextEngineBaseData, userData: TextEngineBaseUserData): TextEngineBaseGradingState;
|
|
38
|
-
/**
|
|
39
|
-
* Grade transformation interaction
|
|
40
|
-
* User must transform target text correctly
|
|
41
|
-
* Comparison is case-insensitive and trimmed
|
|
42
|
-
*/
|
|
43
|
-
export declare function textEngineTransformationGrader(data: TextEngineBaseData, userData: TextEngineBaseUserData, expectedTransformations: Record<number, string[]>): GradingResult;
|
|
44
|
-
/**
|
|
45
|
-
* Generate per-target grading state for transformation interaction
|
|
46
|
-
*/
|
|
47
|
-
export declare function getTransformationGradingState(data: TextEngineBaseData, userData: TextEngineBaseUserData, expectedTransformations: Record<number, string[]>): TextEngineBaseGradingState;
|
|
48
|
-
/**
|
|
49
|
-
* Generate per-target grading state for highlight interaction
|
|
50
|
-
*/
|
|
51
|
-
export declare function getHighlightGradingState(data: TextEngineBaseData, userData: TextEngineBaseUserData): TextEngineBaseGradingState;
|
|
52
|
-
/**
|
|
53
|
-
* Grade fill-in-the-blanks interaction
|
|
54
|
-
* Compares user input values against expected values for each input element
|
|
55
|
-
*/
|
|
56
|
-
export declare function textEngineBlanksGrader(data: TextEngineBlanksData, userData: TextEngineBlanksUserData): GradingResult;
|
|
57
|
-
/**
|
|
58
|
-
* Generate per-input grading state for blanks interaction
|
|
59
|
-
*/
|
|
60
|
-
export declare function getBlanksGradingState(data: TextEngineBlanksData, userData: TextEngineBlanksUserData): TextEngineBlanksGradingState;
|
|
61
|
-
/**
|
|
62
|
-
* Grade classification interaction
|
|
63
|
-
* User must assign each target word to the correct category
|
|
64
|
-
*/
|
|
65
|
-
export declare function textEngineClassificationGrader(data: TextEngineClassificationData, userData: TextEngineClassificationUserData): GradingResult;
|
|
66
|
-
/**
|
|
67
|
-
* Generate per-word grading state for classification interaction
|
|
68
|
-
*/
|
|
69
|
-
export declare function getClassificationGradingState(data: TextEngineClassificationData, userData: TextEngineClassificationUserData): TextEngineClassificationGradingState;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { textEngineBaseGrammarParser, textEngineBlanksGrammarParser, textEngineClassificationGrammarParser, parseTextEngineSequential } from './parsers';
|
|
2
|
-
export { textEngineBaseDataValidator, textEngineBlanksDataValidator, textEngineClassificationDataValidator, textEngineDataValidator } from './validators';
|
|
3
|
-
export { type TextEngineBaseUserData, type TextEngineBlanksUserData, type TextEngineClassificationUserData, type TextEngineBaseGradingState, type TextEngineBlanksGradingState, type TextEngineClassificationGradingState, textEngineHighlightGrader, textEngineDNDGrader, textEngineTransformationGrader, getHighlightGradingState, getDNDGradingState, getTransformationGradingState, textEngineBlanksGrader, getBlanksGradingState, textEngineClassificationGrader, getClassificationGradingState } from './graders';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TextEngineDataUnion, TextEngineModality, TextEngineBaseData, TextEngineBlanksData, TextEngineClassificationData, TextEngineSequentialInteractionData } from "../../../types/Text";
|
|
2
|
-
import { GrammarParser, GrammarParseResult } from "../../../types/Global";
|
|
3
|
-
export declare const textEngineBaseGrammarParser: GrammarParser<TextEngineBaseData>;
|
|
4
|
-
export declare const textEngineBlanksGrammarParser: GrammarParser<TextEngineBlanksData>;
|
|
5
|
-
export declare const textEngineClassificationGrammarParser: GrammarParser<TextEngineClassificationData>;
|
|
6
|
-
/**
|
|
7
|
-
* Just a bulk caller to the guys who do the real job.
|
|
8
|
-
*/
|
|
9
|
-
export declare function parseTextEngineSequential<T extends TextEngineDataUnion>(code: string, modality: TextEngineModality): GrammarParseResult<TextEngineSequentialInteractionData>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { TextEngineBaseData, TextEngineBlanksData, TextEngineClassificationData, TextEngineDataUnion } from "../../../types/Text";
|
|
2
|
-
import { ValidationResult } from "../../../types/Global";
|
|
3
|
-
/**
|
|
4
|
-
* Validates TextEngineBaseData for highlight/DND/transformation interactions
|
|
5
|
-
*
|
|
6
|
-
* Checks:
|
|
7
|
-
* - Parts array is not empty
|
|
8
|
-
* - Targets array is not empty
|
|
9
|
-
* - Each target has valid words, startPos, endPos
|
|
10
|
-
* - Target positions are within bounds of parts array
|
|
11
|
-
* - Target words match parts at specified positions
|
|
12
|
-
* - Distractors (if present) are non-empty and unique
|
|
13
|
-
*/
|
|
14
|
-
export declare function textEngineBaseDataValidator(data: TextEngineBaseData): ValidationResult;
|
|
15
|
-
/**
|
|
16
|
-
* Validates TextEngineBlanksData for fill-in-the-blanks interactions
|
|
17
|
-
*
|
|
18
|
-
* Checks:
|
|
19
|
-
* - Parts array is not empty
|
|
20
|
-
* - Targets array is not empty
|
|
21
|
-
* - Each target has valid id and expectedValue
|
|
22
|
-
* - Expected values have proper structure (InputElementData)
|
|
23
|
-
* - No duplicate target IDs
|
|
24
|
-
*/
|
|
25
|
-
export declare function textEngineBlanksDataValidator(data: TextEngineBlanksData): ValidationResult;
|
|
26
|
-
/**
|
|
27
|
-
* Validates TextEngineClassificationData
|
|
28
|
-
*
|
|
29
|
-
* Checks:
|
|
30
|
-
* - Parts array is not empty
|
|
31
|
-
* - Targets array is not empty (at least one category)
|
|
32
|
-
* - Each category target has valid category name and targets array
|
|
33
|
-
* - Category names are unique
|
|
34
|
-
* - Each category has at least one target
|
|
35
|
-
* - Target positions are valid and within bounds
|
|
36
|
-
*/
|
|
37
|
-
export declare function textEngineClassificationDataValidator(data: TextEngineClassificationData): ValidationResult;
|
|
38
|
-
/**
|
|
39
|
-
* Unified validator that routes to the appropriate validator based on data type
|
|
40
|
-
*/
|
|
41
|
-
export declare function textEngineDataValidator(data: TextEngineDataUnion): ValidationResult;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { TextEngineConfiguration, TextEngineState, TextEngineGradingState } from "../../types/Text";
|
|
2
|
-
type EduTextElement = HTMLElement & {
|
|
3
|
-
config: TextEngineConfiguration;
|
|
4
|
-
getValue(): any;
|
|
5
|
-
getState(): TextEngineState;
|
|
6
|
-
setState(next: Partial<TextEngineState>): void;
|
|
7
|
-
reset(): void;
|
|
8
|
-
setGradingState(state: TextEngineGradingState): void;
|
|
9
|
-
clearGradingState(): void;
|
|
10
|
-
};
|
|
11
|
-
export declare class EduText extends HTMLElement implements EduTextElement {
|
|
12
|
-
private _config;
|
|
13
|
-
private _state;
|
|
14
|
-
private _mounted;
|
|
15
|
-
static get observedAttributes(): string[];
|
|
16
|
-
private $wrapEl;
|
|
17
|
-
constructor();
|
|
18
|
-
connectedCallback(): void;
|
|
19
|
-
disconnectedCallback(): void;
|
|
20
|
-
set config(v: TextEngineConfiguration);
|
|
21
|
-
get config(): TextEngineConfiguration;
|
|
22
|
-
getValue(): any;
|
|
23
|
-
getState(): TextEngineState;
|
|
24
|
-
setState(next: Partial<TextEngineState>): void;
|
|
25
|
-
reset(): void;
|
|
26
|
-
setGradingState(state: TextEngineGradingState): void;
|
|
27
|
-
clearGradingState(): void;
|
|
28
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
29
|
-
private upsertHtmlAttribute;
|
|
30
|
-
private removeHtmlAttribute;
|
|
31
|
-
private upsertHtmlClass;
|
|
32
|
-
private removeHtmlClassPrefix;
|
|
33
|
-
private initState;
|
|
34
|
-
private render;
|
|
35
|
-
private renderHighlight;
|
|
36
|
-
private renderBlanks;
|
|
37
|
-
private renderClassification;
|
|
38
|
-
private renderDND;
|
|
39
|
-
private renderTransformation;
|
|
40
|
-
private onClick;
|
|
41
|
-
private onChange;
|
|
42
|
-
private onInput;
|
|
43
|
-
private onDragStart;
|
|
44
|
-
private onDragOver;
|
|
45
|
-
private onDrop;
|
|
46
|
-
private _activeCategory;
|
|
47
|
-
private toggleWordSelection;
|
|
48
|
-
private setActiveCategory;
|
|
49
|
-
private assignWordToCategory;
|
|
50
|
-
private updateInputValue;
|
|
51
|
-
private updateTransformation;
|
|
52
|
-
private placeWordInDropzone;
|
|
53
|
-
private clearDropzone;
|
|
54
|
-
private emitChange;
|
|
55
|
-
}
|
|
56
|
-
export {};
|
|
@@ -1,33 +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 declare class SequentialCategorizeTheWords extends BaseInteraction<TextEngineSequentialInteractionData> {
|
|
7
|
-
interactionMechanic: InteractionMechanic;
|
|
8
|
-
private _slides;
|
|
9
|
-
private _currentStep;
|
|
10
|
-
private _textConfig;
|
|
11
|
-
private _$text;
|
|
12
|
-
private _responses;
|
|
13
|
-
private _gradingByStep;
|
|
14
|
-
private _isGraded;
|
|
15
|
-
get slidesCount(): number;
|
|
16
|
-
constructor(data: TextEngineSequentialInteractionData, config: InteractionConfig);
|
|
17
|
-
protected initialize(): void;
|
|
18
|
-
protected cleanup(): void;
|
|
19
|
-
onVariantChange(newVariant: Variant): void;
|
|
20
|
-
setSteps(stepIndex: number): void;
|
|
21
|
-
render(): void;
|
|
22
|
-
private getTargetIndices;
|
|
23
|
-
private getTotalTargetCount;
|
|
24
|
-
private saveCurrentStepResponse;
|
|
25
|
-
private getResponseForStep;
|
|
26
|
-
private updateProgressAcrossSteps;
|
|
27
|
-
getCurrentState(): any;
|
|
28
|
-
isInteractionComplete(): boolean;
|
|
29
|
-
onHint(): void;
|
|
30
|
-
grade(): GradingResult;
|
|
31
|
-
submit(): void;
|
|
32
|
-
reset(): void;
|
|
33
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { BaseInteraction } from "../../core/BaseInteraction";
|
|
2
|
-
import { Variant } from "../../shared/types";
|
|
3
|
-
import { InteractionConfig, InteractionMechanic } from "../../types/Interactions";
|
|
4
|
-
import { TextEngineClassificationData } from "../../types/Text";
|
|
5
|
-
import { type TextEngineClassificationUserData } from "../../engines/text";
|
|
6
|
-
export declare class CategorizeTheWords extends BaseInteraction<TextEngineClassificationData> {
|
|
7
|
-
interactionMechanic: InteractionMechanic;
|
|
8
|
-
private _textConfig;
|
|
9
|
-
private _$text;
|
|
10
|
-
constructor(data: TextEngineClassificationData, config: InteractionConfig);
|
|
11
|
-
protected initialize(): void;
|
|
12
|
-
protected cleanup(): void;
|
|
13
|
-
onVariantChange(newVariant: Variant): void;
|
|
14
|
-
render(): void;
|
|
15
|
-
private getTargetIndices;
|
|
16
|
-
getCurrentState(): TextEngineClassificationUserData;
|
|
17
|
-
isInteractionComplete(): boolean;
|
|
18
|
-
onHint(): void;
|
|
19
|
-
grade(): import("../..").GradingResult;
|
|
20
|
-
submit(): void;
|
|
21
|
-
reset(): void;
|
|
22
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BaseInteraction } from "../../core/BaseInteraction";
|
|
2
|
-
import { Variant } from "../../shared/types";
|
|
3
|
-
import { InteractionConfig, InteractionMechanic } from "../../types/Interactions";
|
|
4
|
-
import { TextEngineSequentialInteractionData } from "../../types/Text";
|
|
5
|
-
import { GradingResult } from "../../types/Grading";
|
|
6
|
-
export declare class SequentialFillBlanks extends BaseInteraction<TextEngineSequentialInteractionData> {
|
|
7
|
-
interactionMechanic: InteractionMechanic;
|
|
8
|
-
private _slides;
|
|
9
|
-
private _currentStep;
|
|
10
|
-
private _textConfig;
|
|
11
|
-
private _$text;
|
|
12
|
-
private _responses;
|
|
13
|
-
private _gradingByStep;
|
|
14
|
-
private _isGraded;
|
|
15
|
-
get slidesCount(): number;
|
|
16
|
-
constructor(data: TextEngineSequentialInteractionData, config: InteractionConfig);
|
|
17
|
-
protected initialize(): void;
|
|
18
|
-
protected cleanup(): void;
|
|
19
|
-
onVariantChange(newVariant: Variant): void;
|
|
20
|
-
setSteps(stepIndex: number): void;
|
|
21
|
-
render(): void;
|
|
22
|
-
private getTotalTargetCount;
|
|
23
|
-
private saveCurrentStepResponse;
|
|
24
|
-
private getResponseForStep;
|
|
25
|
-
private updateProgressAcrossSteps;
|
|
26
|
-
getCurrentState(): any;
|
|
27
|
-
isInteractionComplete(): boolean;
|
|
28
|
-
onHint(): void;
|
|
29
|
-
grade(): GradingResult;
|
|
30
|
-
submit(): void;
|
|
31
|
-
reset(): void;
|
|
32
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BaseInteraction } from "../../core/BaseInteraction";
|
|
2
|
-
import { Variant } from "../../shared/types";
|
|
3
|
-
import { InteractionConfig, InteractionMechanic } from "../../types/Interactions";
|
|
4
|
-
import { TextEngineBlanksData } from "../../types/Text";
|
|
5
|
-
import { type TextEngineBlanksUserData } from "../../engines/text";
|
|
6
|
-
export declare class FillBlanks extends BaseInteraction<TextEngineBlanksData> {
|
|
7
|
-
interactionMechanic: InteractionMechanic;
|
|
8
|
-
private _textConfig;
|
|
9
|
-
private _$text;
|
|
10
|
-
constructor(data: TextEngineBlanksData, config: InteractionConfig);
|
|
11
|
-
protected initialize(): void;
|
|
12
|
-
protected cleanup(): void;
|
|
13
|
-
onVariantChange(newVariant: Variant): void;
|
|
14
|
-
render(): void;
|
|
15
|
-
getCurrentState(): TextEngineBlanksUserData;
|
|
16
|
-
private updateProgressBasedOnInputs;
|
|
17
|
-
isInteractionComplete(): boolean;
|
|
18
|
-
onHint(): void;
|
|
19
|
-
private getHintText;
|
|
20
|
-
grade(): import("../..").GradingResult;
|
|
21
|
-
submit(): void;
|
|
22
|
-
reset(): void;
|
|
23
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { BaseInteraction } from "../../core/BaseInteraction";
|
|
2
|
-
import { Variant } from "../../shared/types";
|
|
3
|
-
import { InteractionConfig, InteractionMechanic } from "../../types/Interactions";
|
|
4
|
-
import { FreeRecallData } from "../../types/Data";
|
|
5
|
-
export declare class ListRecall extends BaseInteraction<FreeRecallData> {
|
|
6
|
-
interactionMechanic: InteractionMechanic;
|
|
7
|
-
private _$chipsContainer;
|
|
8
|
-
private _$textInput;
|
|
9
|
-
private _$addButton;
|
|
10
|
-
private _recalledItems;
|
|
11
|
-
constructor(data: FreeRecallData, config: InteractionConfig);
|
|
12
|
-
protected initialize(): void;
|
|
13
|
-
protected cleanup(): void;
|
|
14
|
-
onVariantChange(newVariant: Variant): void;
|
|
15
|
-
render(): void;
|
|
16
|
-
private handleAddItem;
|
|
17
|
-
private addChip;
|
|
18
|
-
getCurrentState(): string[];
|
|
19
|
-
isInteractionComplete(): boolean;
|
|
20
|
-
onHint(): void;
|
|
21
|
-
submit(): void;
|
|
22
|
-
private gradeRecall;
|
|
23
|
-
private applyGradingFeedback;
|
|
24
|
-
reset(): void;
|
|
25
|
-
}
|
|
@@ -1,34 +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 declare class SequentialMarkTheWords extends BaseInteraction<TextEngineSequentialInteractionData> {
|
|
7
|
-
interactionMechanic: InteractionMechanic;
|
|
8
|
-
private _slides;
|
|
9
|
-
private _currentStep;
|
|
10
|
-
private _textConfig;
|
|
11
|
-
private _$text;
|
|
12
|
-
private _responses;
|
|
13
|
-
private _gradingByStep;
|
|
14
|
-
private _isGraded;
|
|
15
|
-
get slidesCount(): number;
|
|
16
|
-
constructor(data: TextEngineSequentialInteractionData, config: InteractionConfig);
|
|
17
|
-
protected initialize(): void;
|
|
18
|
-
protected cleanup(): void;
|
|
19
|
-
onVariantChange(newVariant: Variant): void;
|
|
20
|
-
setSteps(stepIndex: number): void;
|
|
21
|
-
render(): void;
|
|
22
|
-
private getTargetCountForSlide;
|
|
23
|
-
private getTotalTargetCount;
|
|
24
|
-
private saveCurrentStepResponse;
|
|
25
|
-
private getResponseForStep;
|
|
26
|
-
private getTargetIndices;
|
|
27
|
-
private updateProgressAcrossSteps;
|
|
28
|
-
getCurrentState(): any;
|
|
29
|
-
isInteractionComplete(): boolean;
|
|
30
|
-
onHint(): void;
|
|
31
|
-
grade(): GradingResult;
|
|
32
|
-
submit(): void;
|
|
33
|
-
reset(): void;
|
|
34
|
-
}
|
|
@@ -1,40 +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
|
-
* Mark The Words - Text Highlight Interaction
|
|
8
|
-
*
|
|
9
|
-
* Users click to select/highlight target words in a passage of text.
|
|
10
|
-
* Based on the TextEngineBaseData with highlight mode.
|
|
11
|
-
*
|
|
12
|
-
* Example data:
|
|
13
|
-
* ```
|
|
14
|
-
* {
|
|
15
|
-
* type: 'base',
|
|
16
|
-
* parts: ['The', 'cat', 'sat', 'on', 'the', 'mat'],
|
|
17
|
-
* targets: [
|
|
18
|
-
* { words: ['cat'], startPos: 1, endPos: 1 },
|
|
19
|
-
* { words: ['mat'], startPos: 5, endPos: 5 }
|
|
20
|
-
* ]
|
|
21
|
-
* }
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare class MarkTheWords extends BaseInteraction<TextEngineBaseData> {
|
|
25
|
-
interactionMechanic: InteractionMechanic;
|
|
26
|
-
private _textConfig;
|
|
27
|
-
private _$text;
|
|
28
|
-
constructor(data: TextEngineBaseData, config: InteractionConfig);
|
|
29
|
-
protected initialize(): void;
|
|
30
|
-
protected cleanup(): void;
|
|
31
|
-
onVariantChange(newVariant: Variant): void;
|
|
32
|
-
render(): void;
|
|
33
|
-
getCurrentState(): TextEngineBaseUserData;
|
|
34
|
-
isInteractionComplete(): boolean;
|
|
35
|
-
onHint(): void;
|
|
36
|
-
getUserData(): TextEngineBaseUserData;
|
|
37
|
-
submit(): void;
|
|
38
|
-
grade(): import("../..").GradingResult;
|
|
39
|
-
reset(): void;
|
|
40
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { GradingResult } from "../../../types/Grading";
|
|
2
|
-
import { RecognitionData } from "../../../types/Data";
|
|
3
|
-
/**
|
|
4
|
-
* User's answers for MCQ/MRQ
|
|
5
|
-
* Format: { "question text": ["selected option 1", "selected option 2", ...] }
|
|
6
|
-
*/
|
|
7
|
-
export type RecognitionAnswers = Record<string, string[]>;
|
|
8
|
-
/**
|
|
9
|
-
* Grader for MCQ/MRQ interactions
|
|
10
|
-
*
|
|
11
|
-
* Grading logic per question:
|
|
12
|
-
* - Each correct option selected: +1 point
|
|
13
|
-
* - Each incorrect option selected: -1 point (penalty)
|
|
14
|
-
* - Each correct option NOT selected (missed): -1 point (penalty)
|
|
15
|
-
* - Score is (correct selections - wrong selections - missed) / total correct options
|
|
16
|
-
* - Rounded to whole number percentage
|
|
17
|
-
*
|
|
18
|
-
* Overall score: average of all question scores
|
|
19
|
-
*/
|
|
20
|
-
export declare function recognitionGrader(data: RecognitionData, userAnswers: RecognitionAnswers): GradingResult;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { RecognitionData } from "../../../types/Data";
|
|
2
|
-
type ParseResult = {
|
|
3
|
-
data: RecognitionData;
|
|
4
|
-
errors?: Record<string, string>;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Parser for MCQ/MRQ grammar
|
|
8
|
-
*
|
|
9
|
-
* Grammar:
|
|
10
|
-
* # question
|
|
11
|
-
* [correct1 | correct2] | incorrect1 | incorrect2;
|
|
12
|
-
*
|
|
13
|
-
* Rules:
|
|
14
|
-
* - '#' indicates a question
|
|
15
|
-
* - '[...]' contains correct options separated by '|'
|
|
16
|
-
* - Options outside brackets are incorrect
|
|
17
|
-
* - Lines must end with ';'
|
|
18
|
-
* - '@:assetName' for asset references (preserved as-is)
|
|
19
|
-
*/
|
|
20
|
-
export declare function recognitionParser(code: string): ParseResult;
|
|
21
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { RecognitionData } from "../../../types/Data";
|
|
2
|
-
type ValidationResult = {
|
|
3
|
-
ok: boolean;
|
|
4
|
-
errors?: Record<string, string>;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Validator for MCQ/MRQ recognition data
|
|
8
|
-
*
|
|
9
|
-
* Validates:
|
|
10
|
-
* - At least one question exists
|
|
11
|
-
* - Each question has at least one correct answer
|
|
12
|
-
* - Each question has at least two total options
|
|
13
|
-
* - No duplicate options within a question
|
|
14
|
-
* - Question text is not empty
|
|
15
|
-
*/
|
|
16
|
-
export declare function recognitionValidator(data: RecognitionData): ValidationResult;
|
|
17
|
-
export {};
|
|
@@ -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 { NormalizedAssets } from "../../types/Assets";
|
|
5
|
-
import { RecognitionData } from "../../types/Data";
|
|
6
|
-
import { RecognitionAnswers } from "./implementation/grader";
|
|
7
|
-
export declare class MCQ extends BaseInteraction<RecognitionData> {
|
|
8
|
-
interactionMechanic: InteractionMechanic;
|
|
9
|
-
private currentQuestionIndex;
|
|
10
|
-
private userAnswers;
|
|
11
|
-
private shuffledOptions;
|
|
12
|
-
private isGraded;
|
|
13
|
-
private $questionBlock;
|
|
14
|
-
private $questionText;
|
|
15
|
-
private $optionsContainer;
|
|
16
|
-
private $modeLabel;
|
|
17
|
-
private variant;
|
|
18
|
-
get slidesCount(): number;
|
|
19
|
-
constructor(data: RecognitionData, config: InteractionConfig, assets: NormalizedAssets | null);
|
|
20
|
-
protected initialize(): void;
|
|
21
|
-
protected cleanup(): void;
|
|
22
|
-
onVariantChange(newVariant: Variant): void;
|
|
23
|
-
/**
|
|
24
|
-
* Called by shell when radio navigation changes
|
|
25
|
-
* @param stepIndex 1-based index from shell
|
|
26
|
-
*/
|
|
27
|
-
setSteps(stepIndex: number): void;
|
|
28
|
-
render(): void;
|
|
29
|
-
private renderCurrentQuestion;
|
|
30
|
-
private handleOptionClick;
|
|
31
|
-
private updateProgress;
|
|
32
|
-
getCurrentState(): RecognitionAnswers;
|
|
33
|
-
isInteractionComplete(): boolean;
|
|
34
|
-
onHint(): void;
|
|
35
|
-
submit(): void;
|
|
36
|
-
reset(): void;
|
|
37
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SeriationData } from "../../../types/Data";
|
|
2
|
-
import { GradingResult } from "../../../types/Grading";
|
|
3
|
-
/**
|
|
4
|
-
* Grades a seriation/sequencing interaction with partial credit
|
|
5
|
-
*
|
|
6
|
-
* Scoring approach:
|
|
7
|
-
* - Correct position: 100% for that item
|
|
8
|
-
* - Adjacent position (±1): 50% for that item
|
|
9
|
-
* - Further away: 0% for that item
|
|
10
|
-
*
|
|
11
|
-
* @param correctOrder - The correct sequence of items
|
|
12
|
-
* @param userOrder - The user's submitted sequence
|
|
13
|
-
* @param parent - Parent element containing chips (for visual feedback)
|
|
14
|
-
*/
|
|
15
|
-
export declare function seriationGrader(correctOrder: SeriationData["items"], userOrder: string[], parent: HTMLElement): GradingResult;
|