ngx-edyta-entity 0.1.3
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/README.md +63 -0
- package/fesm2022/ngx-edyta-entity.mjs +1795 -0
- package/fesm2022/ngx-edyta-entity.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/canvas.component.d.ts +30 -0
- package/lib/canvas.module.d.ts +34 -0
- package/lib/entity/entity-bottom-pane/entity-bottom-pane.component.d.ts +18 -0
- package/lib/form/form-type/form-type-checkbox/form-type-checkbox.component.d.ts +11 -0
- package/lib/form/form-type/form-type-date/form-type-date.component.d.ts +11 -0
- package/lib/form/form-type/form-type-input/form-type-input.component.d.ts +11 -0
- package/lib/form/form-type/form-type-item/form-type-item.component.d.ts +15 -0
- package/lib/form/form-type/form-type-radio/form-type-radio.component.d.ts +11 -0
- package/lib/form/form-type/form-type-select/form-type-select.component.d.ts +11 -0
- package/lib/form/form-type/form-type-text/form-type-text.component.d.ts +5 -0
- package/lib/form/form-type/form-type-ukulele-chords/form-type-ukulele-chords.component.d.ts +8 -0
- package/lib/form/form.component.d.ts +20 -0
- package/lib/grammar/grammar.component.d.ts +10 -0
- package/lib/grammar/item/grammar-item.component.d.ts +10 -0
- package/lib/model/learning-entity/central-service.d.ts +19 -0
- package/lib/model/learning-entity/convertors/form-learning-entity-content-convertor.d.ts +5 -0
- package/lib/model/learning-entity/convertors/grammar-learning-entity-content-convertor.d.ts +5 -0
- package/lib/model/learning-entity/convertors/learning-entity-content-convertor.d.ts +4 -0
- package/lib/model/learning-entity/convertors/learning-entity-convertor-factory.d.ts +4 -0
- package/lib/model/learning-entity/convertors/puzzle-learning-entity-content-convertor.d.ts +7 -0
- package/lib/model/learning-entity/convertors/riddle-learning-entity-content-convertor.d.ts +5 -0
- package/lib/model/learning-entity/convertors/vocabulary-learning-entity-content-convertor.d.ts +8 -0
- package/lib/model/learning-entity/convertors/yes-no-learning-entity-content-convertor.d.ts +5 -0
- package/lib/model/learning-entity/form-learning-entity.d.ts +11 -0
- package/lib/model/learning-entity/form-learning-entity.type.d.ts +77 -0
- package/lib/model/learning-entity/grammar-learning-entity.d.ts +8 -0
- package/lib/model/learning-entity/grammar-learning-entity.type.d.ts +32 -0
- package/lib/model/learning-entity/interactive-learning-entity.d.ts +14 -0
- package/lib/model/learning-entity/learning-entity-factory.d.ts +12 -0
- package/lib/model/learning-entity/learning-entity-progress-service.d.ts +6 -0
- package/lib/model/learning-entity/learning-entity-service.d.ts +39 -0
- package/lib/model/learning-entity/learning-entity.d.ts +70 -0
- package/lib/model/learning-entity/puzzle-learning-entity.d.ts +11 -0
- package/lib/model/learning-entity/puzzle-learning-entity.type.d.ts +77 -0
- package/lib/model/learning-entity/riddle-learning-entity.d.ts +11 -0
- package/lib/model/learning-entity/riddle-learning-entity.type.d.ts +45 -0
- package/lib/model/learning-entity/vocabulary-learning-entity.d.ts +18 -0
- package/lib/model/learning-entity/vocabulary-learning-entity.type.d.ts +42 -0
- package/lib/model/learning-entity/yes-no-learning-entity.d.ts +11 -0
- package/lib/model/learning-entity/yes-no-learning-entity.type.d.ts +30 -0
- package/lib/puzzle/puzzle-base.component.d.ts +22 -0
- package/lib/puzzle/puzzle-drop-target.component.d.ts +30 -0
- package/lib/puzzle/puzzle-fact/puzzle-fact.component.d.ts +35 -0
- package/lib/puzzle/puzzle-option/puzzle-option-dialog/puzzle-option-dialog.component.d.ts +26 -0
- package/lib/puzzle/puzzle-option/puzzle-option.component.d.ts +27 -0
- package/lib/puzzle/puzzle-option-dialog-base.component.d.ts +16 -0
- package/lib/puzzle/puzzle-target/puzzle-target.component.d.ts +31 -0
- package/lib/puzzle/puzzle.component.d.ts +44 -0
- package/lib/riddle/convertors/riddle-input-convertor.d.ts +4 -0
- package/lib/riddle/riddle.component.d.ts +29 -0
- package/lib/vocabulary/vocabulary-card-base.component.d.ts +22 -0
- package/lib/vocabulary/vocabulary-card-flip/vocabulary-card-flip.component.d.ts +10 -0
- package/lib/vocabulary/vocabulary-card-standard/vocabulary-card-standard.component.d.ts +6 -0
- package/lib/vocabulary/vocabulary.component.d.ts +25 -0
- package/lib/yesno/yes-no.component.d.ts +17 -0
- package/package.json +23 -0
- package/public-api.d.ts +18 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Form } from '../../../model/learning-entity/form-learning-entity.type';
|
|
2
|
+
import { CanvasComponent } from '../../../canvas.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class FormTypeUkuleleChordsComponent extends CanvasComponent {
|
|
5
|
+
content: Form.UkuleleChord;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormTypeUkuleleChordsComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormTypeUkuleleChordsComponent, "edyta-form-type-ukulele-chords", never, { "content": { "alias": "content"; "required": true; }; }, {}, never, never, false, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CanvasComponent } from '../canvas.component';
|
|
2
|
+
import { FormLearningEntity } from '../model/learning-entity/form-learning-entity';
|
|
3
|
+
import { Form } from '../model/learning-entity/form-learning-entity.type';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class FormComponent extends CanvasComponent {
|
|
6
|
+
private _entity;
|
|
7
|
+
private _formItems;
|
|
8
|
+
constructor();
|
|
9
|
+
get entity(): FormLearningEntity;
|
|
10
|
+
set entity(entity: FormLearningEntity);
|
|
11
|
+
get formItems(): Form.Items;
|
|
12
|
+
set formItems(form: Form.Items);
|
|
13
|
+
onChange(): void;
|
|
14
|
+
private _process;
|
|
15
|
+
private _prepareState;
|
|
16
|
+
private _buildProgressSnapshot;
|
|
17
|
+
private _applyProgress2State;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormComponent, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "edyta-form", never, { "entity": { "alias": "entity"; "required": true; }; }, {}, never, never, false, never>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GrammarLearningEntity } from '../model/learning-entity/grammar-learning-entity';
|
|
2
|
+
import { CanvasComponent } from '../canvas.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class GrammarComponent extends CanvasComponent {
|
|
5
|
+
private _entity;
|
|
6
|
+
get entity(): GrammarLearningEntity;
|
|
7
|
+
set entity(entity: GrammarLearningEntity);
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GrammarComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GrammarComponent, "edyta-grammar", never, { "entity": { "alias": "entity"; "required": true; }; }, {}, never, never, false, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Grammar } from '../../model/learning-entity/grammar-learning-entity.type';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class GrammarItemComponent {
|
|
4
|
+
content: Grammar.Item;
|
|
5
|
+
showMedia(): boolean;
|
|
6
|
+
showPictureOnLeft(): boolean;
|
|
7
|
+
showPictureOnRight(): boolean;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GrammarItemComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GrammarItemComponent, "edyta-grammar-item", never, { "content": { "alias": "content"; "required": false; }; }, {}, never, never, false, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
2
|
+
export interface LanguageService {
|
|
3
|
+
getDefault(): string;
|
|
4
|
+
get(): string;
|
|
5
|
+
set(language: string): void;
|
|
6
|
+
remove(): void;
|
|
7
|
+
supportedLanguages(): string[];
|
|
8
|
+
}
|
|
9
|
+
export interface NotificationService {
|
|
10
|
+
info(message: string): void;
|
|
11
|
+
success(message: string): void;
|
|
12
|
+
warning(message: string): void;
|
|
13
|
+
error(message: string): void;
|
|
14
|
+
}
|
|
15
|
+
export interface CentralService {
|
|
16
|
+
getLanguageService(): LanguageService;
|
|
17
|
+
getNotificationService(): NotificationService;
|
|
18
|
+
getTranslateService(): TranslateService;
|
|
19
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Form } from '../form-learning-entity.type';
|
|
2
|
+
import { LearningEntityContentConvertor } from './learning-entity-content-convertor';
|
|
3
|
+
export declare class FormLearningEntityContentConvertor implements LearningEntityContentConvertor {
|
|
4
|
+
toInternal(entity: Form.Set): Form.Items;
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Grammar } from '../grammar-learning-entity.type';
|
|
2
|
+
import { LearningEntityContentConvertor } from './learning-entity-content-convertor';
|
|
3
|
+
export declare class GrammarLearningEntityContentConvertor implements LearningEntityContentConvertor {
|
|
4
|
+
toInternal(entity: Grammar.Set): Grammar.Items;
|
|
5
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Original as PuzzleOriginal, Puzzle } from '../puzzle-learning-entity.type';
|
|
2
|
+
import { LearningEntityContentConvertor } from './learning-entity-content-convertor';
|
|
3
|
+
export declare class PuzzleLearningEntityContentConvertor implements LearningEntityContentConvertor {
|
|
4
|
+
toInternal(entity: PuzzleOriginal.Puzzle.Set): Puzzle.Set;
|
|
5
|
+
private _shuffle;
|
|
6
|
+
private _calculateColor;
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Riddle } from '../riddle-learning-entity.type';
|
|
2
|
+
import { LearningEntityContentConvertor } from './learning-entity-content-convertor';
|
|
3
|
+
export declare class RiddleLearningEntityContentConvertor implements LearningEntityContentConvertor {
|
|
4
|
+
toInternal(entity: Riddle.Set): Riddle.Content;
|
|
5
|
+
}
|
package/lib/model/learning-entity/convertors/vocabulary-learning-entity-content-convertor.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Vocabulary } from '../vocabulary-learning-entity.type';
|
|
2
|
+
import { LearningEntityContentConvertor } from './learning-entity-content-convertor';
|
|
3
|
+
import { CentralService } from '../central-service';
|
|
4
|
+
export declare class VocabularyLearningEntityContentConvertor implements LearningEntityContentConvertor {
|
|
5
|
+
toInternal(entity: Vocabulary.Set, centralService: CentralService): Vocabulary.TransformedItems;
|
|
6
|
+
private _deriveMeaningByLanguage;
|
|
7
|
+
private _deriveDescriptionByLanguage;
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Riddle } from '../riddle-learning-entity.type';
|
|
2
|
+
import { LearningEntityContentConvertor } from './learning-entity-content-convertor';
|
|
3
|
+
export declare class YesNoLearningEntityContentConvertor implements LearningEntityContentConvertor {
|
|
4
|
+
toInternal(entity: Riddle.Set): Riddle.Content;
|
|
5
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Form } from './form-learning-entity.type';
|
|
2
|
+
import { InteractiveLearningEntityBase } from './interactive-learning-entity';
|
|
3
|
+
export declare class FormLearningEntity extends InteractiveLearningEntityBase {
|
|
4
|
+
private _content;
|
|
5
|
+
private _progress;
|
|
6
|
+
isCheckable(): boolean;
|
|
7
|
+
get progress(): Form.Progress;
|
|
8
|
+
set progress(progress: Form.Progress);
|
|
9
|
+
get content(): Form.Items;
|
|
10
|
+
protected _init(entity: Form.Set): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ChordKey } from 'ngx-edyta-chords';
|
|
2
|
+
import { LearningEntityCommon } from './learning-entity';
|
|
3
|
+
export declare namespace Form {
|
|
4
|
+
type Option = {
|
|
5
|
+
id: string;
|
|
6
|
+
text: string;
|
|
7
|
+
};
|
|
8
|
+
type Media = {
|
|
9
|
+
url: string;
|
|
10
|
+
mimeType: string;
|
|
11
|
+
};
|
|
12
|
+
type Picture = {
|
|
13
|
+
url: string;
|
|
14
|
+
alwaysVisible?: boolean;
|
|
15
|
+
};
|
|
16
|
+
type GenericInput = {
|
|
17
|
+
key: string;
|
|
18
|
+
type: string;
|
|
19
|
+
text: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
divider?: boolean;
|
|
22
|
+
media?: Media;
|
|
23
|
+
picture?: Picture | string;
|
|
24
|
+
color?: {
|
|
25
|
+
background?: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
};
|
|
28
|
+
options?: Option[];
|
|
29
|
+
mandatory?: boolean;
|
|
30
|
+
};
|
|
31
|
+
type Text = GenericInput;
|
|
32
|
+
type Input = Text & {
|
|
33
|
+
state: string;
|
|
34
|
+
};
|
|
35
|
+
type Date = Input;
|
|
36
|
+
type Select = Input & {
|
|
37
|
+
options: Option[];
|
|
38
|
+
};
|
|
39
|
+
type Radio = Select;
|
|
40
|
+
type CheckboxOption = Option & {
|
|
41
|
+
checked: boolean;
|
|
42
|
+
};
|
|
43
|
+
type Checkbox = GenericInput & {
|
|
44
|
+
options: CheckboxOption[];
|
|
45
|
+
};
|
|
46
|
+
type UkuleleChord = Text & {
|
|
47
|
+
ukuleleChords: ChordKey[];
|
|
48
|
+
};
|
|
49
|
+
type CheckboxProgressStateItem = {
|
|
50
|
+
id: string;
|
|
51
|
+
checked: boolean;
|
|
52
|
+
};
|
|
53
|
+
type CheckboxProgressStateItems = CheckboxProgressStateItem[];
|
|
54
|
+
type ProgressItem = {
|
|
55
|
+
key: string;
|
|
56
|
+
state: string | CheckboxProgressStateItems;
|
|
57
|
+
};
|
|
58
|
+
type Progress = ProgressItem[] | null | undefined;
|
|
59
|
+
type Item = (Text | Date | Checkbox | Radio | Select | Input);
|
|
60
|
+
type Items = Item[];
|
|
61
|
+
type Content = {
|
|
62
|
+
type: string;
|
|
63
|
+
title: string;
|
|
64
|
+
lang: string;
|
|
65
|
+
input: Items;
|
|
66
|
+
};
|
|
67
|
+
type Set = LearningEntityCommon & {
|
|
68
|
+
content: Content;
|
|
69
|
+
progress: Progress;
|
|
70
|
+
};
|
|
71
|
+
type ResultItem = {
|
|
72
|
+
key: string;
|
|
73
|
+
correct: string[] | string;
|
|
74
|
+
optional?: string[] | string;
|
|
75
|
+
};
|
|
76
|
+
type Result = ResultItem[];
|
|
77
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Grammar } from './grammar-learning-entity.type';
|
|
2
|
+
import { LearningEntityBase } from './learning-entity';
|
|
3
|
+
export declare class GrammarLearningEntity extends LearningEntityBase {
|
|
4
|
+
private _grammars;
|
|
5
|
+
isCheckable(): boolean;
|
|
6
|
+
get content(): Grammar.Items;
|
|
7
|
+
protected _init(entity: Grammar.Set): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LearningEntityCommon } from './learning-entity';
|
|
2
|
+
export declare namespace Grammar {
|
|
3
|
+
enum PicturePosition {
|
|
4
|
+
Left = "left",
|
|
5
|
+
Right = "right"
|
|
6
|
+
}
|
|
7
|
+
type Media = {
|
|
8
|
+
url: string;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
};
|
|
11
|
+
type Item = {
|
|
12
|
+
key: string;
|
|
13
|
+
color?: {
|
|
14
|
+
background?: string;
|
|
15
|
+
text?: string;
|
|
16
|
+
};
|
|
17
|
+
picture?: {
|
|
18
|
+
url: string;
|
|
19
|
+
position?: PicturePosition;
|
|
20
|
+
};
|
|
21
|
+
media?: Media;
|
|
22
|
+
innerHTML: string;
|
|
23
|
+
};
|
|
24
|
+
type Items = Item[];
|
|
25
|
+
type Content = {
|
|
26
|
+
lang: string;
|
|
27
|
+
input: Item[];
|
|
28
|
+
};
|
|
29
|
+
type Set = LearningEntityCommon & {
|
|
30
|
+
content: Content;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { LearningEntity, LearningEntityBase } from './learning-entity';
|
|
3
|
+
export interface InteractiveLearningEntity extends LearningEntity {
|
|
4
|
+
get progress(): unknown;
|
|
5
|
+
set progress(progress: unknown);
|
|
6
|
+
updateProgress(): Observable<unknown>;
|
|
7
|
+
deleteProgress(): Observable<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class InteractiveLearningEntityBase extends LearningEntityBase implements InteractiveLearningEntity {
|
|
10
|
+
abstract get progress(): unknown;
|
|
11
|
+
abstract set progress(progress: unknown);
|
|
12
|
+
updateProgress(): Observable<unknown>;
|
|
13
|
+
deleteProgress(): Observable<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CentralService } from './central-service';
|
|
2
|
+
import { FormLearningEntity } from './form-learning-entity';
|
|
3
|
+
import { GrammarLearningEntity } from './grammar-learning-entity';
|
|
4
|
+
import { LearningEntityCommon } from './learning-entity';
|
|
5
|
+
import { LearningEntityService } from './learning-entity-service';
|
|
6
|
+
import { PuzzleLearningEntity } from './puzzle-learning-entity';
|
|
7
|
+
import { RiddleLearningEntity } from './riddle-learning-entity';
|
|
8
|
+
import { VocabularyLearningEntity } from './vocabulary-learning-entity';
|
|
9
|
+
import { YesNoLearningEntity } from './yes-no-learning-entity';
|
|
10
|
+
export declare class LearningEntityFactory {
|
|
11
|
+
static create(entity: LearningEntityCommon, centralService: CentralService, learningEntityService: LearningEntityService): PuzzleLearningEntity | GrammarLearningEntity | VocabularyLearningEntity | FormLearningEntity | RiddleLearningEntity | YesNoLearningEntity;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { InteractiveLearningEntity } from './interactive-learning-entity';
|
|
3
|
+
export interface LearningEntityProgressService {
|
|
4
|
+
update(entity: InteractiveLearningEntity): Observable<unknown>;
|
|
5
|
+
delete(entity: InteractiveLearningEntity): Observable<void>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { LearningEntityProgressService } from './learning-entity-progress-service';
|
|
3
|
+
import { LearningEntity } from './learning-entity';
|
|
4
|
+
import { InteractiveLearningEntity } from './interactive-learning-entity';
|
|
5
|
+
export type Entity = {
|
|
6
|
+
id: number;
|
|
7
|
+
title: string;
|
|
8
|
+
type: {
|
|
9
|
+
id: number;
|
|
10
|
+
key: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string | null;
|
|
13
|
+
};
|
|
14
|
+
version?: {
|
|
15
|
+
id: number;
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
};
|
|
18
|
+
organization?: {
|
|
19
|
+
id: number;
|
|
20
|
+
key: string;
|
|
21
|
+
};
|
|
22
|
+
level: {
|
|
23
|
+
id: number;
|
|
24
|
+
};
|
|
25
|
+
picture: string | null;
|
|
26
|
+
content?: unknown;
|
|
27
|
+
result?: unknown | null;
|
|
28
|
+
progress?: unknown | null;
|
|
29
|
+
};
|
|
30
|
+
export type Evaluation = {
|
|
31
|
+
correct: boolean;
|
|
32
|
+
};
|
|
33
|
+
export interface LearningEntityService {
|
|
34
|
+
get(organizationKey: string, levelId: number, id: number): Observable<LearningEntity>;
|
|
35
|
+
getAll(organizationKey: string, levelId: number): Observable<LearningEntity[]>;
|
|
36
|
+
evaluate(entity: InteractiveLearningEntity): Observable<Evaluation>;
|
|
37
|
+
getProgressService(): LearningEntityProgressService;
|
|
38
|
+
setProgressService(service: LearningEntityProgressService): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CentralService } from './central-service';
|
|
2
|
+
import { LearningEntityService } from './learning-entity-service';
|
|
3
|
+
export type LearningEntityAssignment = {
|
|
4
|
+
readonly organizationKey: string;
|
|
5
|
+
readonly levelId: number;
|
|
6
|
+
};
|
|
7
|
+
export type LearningEntityCommon = {
|
|
8
|
+
id: number;
|
|
9
|
+
title: string;
|
|
10
|
+
type: {
|
|
11
|
+
id: number;
|
|
12
|
+
key: string;
|
|
13
|
+
};
|
|
14
|
+
organization: {
|
|
15
|
+
key: string;
|
|
16
|
+
};
|
|
17
|
+
level: {
|
|
18
|
+
id: number;
|
|
19
|
+
};
|
|
20
|
+
picture: string | null;
|
|
21
|
+
previous: number | null;
|
|
22
|
+
next: number | null;
|
|
23
|
+
};
|
|
24
|
+
export interface LearningEntity {
|
|
25
|
+
get id(): number;
|
|
26
|
+
get title(): string;
|
|
27
|
+
get type(): string;
|
|
28
|
+
get levelId(): number;
|
|
29
|
+
get organizationKey(): string;
|
|
30
|
+
get assignment(): LearningEntityAssignment;
|
|
31
|
+
get picture(): string | null;
|
|
32
|
+
get previousEntityId(): number | null;
|
|
33
|
+
get nextEntityId(): number | null;
|
|
34
|
+
getCentralService(): CentralService;
|
|
35
|
+
setCentralService(service: CentralService): void;
|
|
36
|
+
getLearningEntityService(): LearningEntityService;
|
|
37
|
+
setLearningEntityService(service: LearningEntityService): void;
|
|
38
|
+
get content(): unknown;
|
|
39
|
+
isCheckable(): boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare abstract class LearningEntityBase implements LearningEntity {
|
|
42
|
+
private _id;
|
|
43
|
+
private _title;
|
|
44
|
+
private _type;
|
|
45
|
+
private _levelId;
|
|
46
|
+
private _organizationKey;
|
|
47
|
+
private _picture;
|
|
48
|
+
private _assignment;
|
|
49
|
+
private _previousEntityId;
|
|
50
|
+
private _nextEntityId;
|
|
51
|
+
private _centralService;
|
|
52
|
+
private _learningEntityService;
|
|
53
|
+
constructor(entity: LearningEntityCommon, centralService: CentralService, learningEntityService: LearningEntityService);
|
|
54
|
+
get id(): number;
|
|
55
|
+
get title(): string;
|
|
56
|
+
get type(): string;
|
|
57
|
+
get levelId(): number;
|
|
58
|
+
get organizationKey(): string;
|
|
59
|
+
get assignment(): LearningEntityAssignment;
|
|
60
|
+
get picture(): string | null;
|
|
61
|
+
get previousEntityId(): number | null;
|
|
62
|
+
get nextEntityId(): number | null;
|
|
63
|
+
getCentralService(): CentralService;
|
|
64
|
+
setCentralService(service: CentralService): void;
|
|
65
|
+
getLearningEntityService(): LearningEntityService;
|
|
66
|
+
setLearningEntityService(service: LearningEntityService): void;
|
|
67
|
+
abstract isCheckable(): boolean;
|
|
68
|
+
abstract get content(): unknown;
|
|
69
|
+
protected abstract _init(entity: LearningEntityCommon): void;
|
|
70
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InteractiveLearningEntityBase } from './interactive-learning-entity';
|
|
2
|
+
import { Original as PuzzleOriginal, Puzzle } from './puzzle-learning-entity.type';
|
|
3
|
+
export declare class PuzzleLearningEntity extends InteractiveLearningEntityBase {
|
|
4
|
+
private _content;
|
|
5
|
+
private _progress;
|
|
6
|
+
isCheckable(): boolean;
|
|
7
|
+
get progress(): PuzzleOriginal.Puzzle.Progress;
|
|
8
|
+
set progress(progress: PuzzleOriginal.Puzzle.Progress);
|
|
9
|
+
get content(): Puzzle.Set;
|
|
10
|
+
protected _init(entity: PuzzleOriginal.Puzzle.Set): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { LearningEntityCommon } from '../../model/learning-entity/learning-entity';
|
|
2
|
+
type StateItem = {
|
|
3
|
+
factId: string;
|
|
4
|
+
optionId: string;
|
|
5
|
+
};
|
|
6
|
+
export declare namespace Puzzle {
|
|
7
|
+
type Color = {
|
|
8
|
+
requested: {
|
|
9
|
+
background: boolean;
|
|
10
|
+
text: boolean;
|
|
11
|
+
};
|
|
12
|
+
background: string;
|
|
13
|
+
text: string;
|
|
14
|
+
};
|
|
15
|
+
type Item = {
|
|
16
|
+
text: string;
|
|
17
|
+
id: string;
|
|
18
|
+
color: Color;
|
|
19
|
+
};
|
|
20
|
+
type FactItem = Item & {
|
|
21
|
+
assignedOptions: Item[];
|
|
22
|
+
};
|
|
23
|
+
type Set = {
|
|
24
|
+
description?: string;
|
|
25
|
+
facts: FactItem[];
|
|
26
|
+
options: Item[];
|
|
27
|
+
};
|
|
28
|
+
type State = StateItem;
|
|
29
|
+
type ValidationRule = State & {
|
|
30
|
+
mandatory: boolean;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export declare namespace Original {
|
|
34
|
+
namespace Puzzle {
|
|
35
|
+
export type Color = {
|
|
36
|
+
requested: {
|
|
37
|
+
background: boolean;
|
|
38
|
+
text: boolean;
|
|
39
|
+
};
|
|
40
|
+
background: string;
|
|
41
|
+
text: string;
|
|
42
|
+
};
|
|
43
|
+
type Item = {
|
|
44
|
+
id: string;
|
|
45
|
+
text: string;
|
|
46
|
+
color?: Color;
|
|
47
|
+
};
|
|
48
|
+
type ResultItem = {
|
|
49
|
+
front: string;
|
|
50
|
+
back: string;
|
|
51
|
+
};
|
|
52
|
+
export type Result = {
|
|
53
|
+
correct: ResultItem[];
|
|
54
|
+
optional: ResultItem[];
|
|
55
|
+
} | null;
|
|
56
|
+
export type Content = {
|
|
57
|
+
type: string;
|
|
58
|
+
title: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
lang: string;
|
|
61
|
+
shuffle?: boolean;
|
|
62
|
+
shuffleAll?: boolean;
|
|
63
|
+
input: {
|
|
64
|
+
front: Item[];
|
|
65
|
+
back: Item[];
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export type ProgressItem = StateItem;
|
|
69
|
+
export type Progress = ProgressItem[] | null | undefined;
|
|
70
|
+
export type Set = LearningEntityCommon & {
|
|
71
|
+
content: Content;
|
|
72
|
+
progress: Progress;
|
|
73
|
+
};
|
|
74
|
+
export {};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InteractiveLearningEntityBase } from './interactive-learning-entity';
|
|
2
|
+
import { Riddle } from './riddle-learning-entity.type';
|
|
3
|
+
export declare class RiddleLearningEntity extends InteractiveLearningEntityBase {
|
|
4
|
+
private _content;
|
|
5
|
+
private _progress;
|
|
6
|
+
isCheckable(): boolean;
|
|
7
|
+
get progress(): Riddle.Progress;
|
|
8
|
+
set progress(progress: Riddle.Progress);
|
|
9
|
+
get content(): Riddle.Content;
|
|
10
|
+
protected _init(entity: Riddle.Set): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { LearningEntityCommon } from './learning-entity';
|
|
2
|
+
export declare namespace Riddle {
|
|
3
|
+
type Media = {
|
|
4
|
+
url: string;
|
|
5
|
+
mimeType: string;
|
|
6
|
+
};
|
|
7
|
+
type Option = {
|
|
8
|
+
id: string;
|
|
9
|
+
text: string;
|
|
10
|
+
};
|
|
11
|
+
type GenericInput = {
|
|
12
|
+
key: string;
|
|
13
|
+
type: string;
|
|
14
|
+
options?: Option[];
|
|
15
|
+
};
|
|
16
|
+
type Input = GenericInput & {
|
|
17
|
+
state: string;
|
|
18
|
+
};
|
|
19
|
+
type Select = Input & {
|
|
20
|
+
options: Option[];
|
|
21
|
+
};
|
|
22
|
+
type ResultItem = {
|
|
23
|
+
key: string;
|
|
24
|
+
correct: string[] | string;
|
|
25
|
+
};
|
|
26
|
+
type Result = ResultItem[];
|
|
27
|
+
type ProgressItem = {
|
|
28
|
+
key: string;
|
|
29
|
+
state: string;
|
|
30
|
+
};
|
|
31
|
+
type Progress = ProgressItem[] | null | undefined;
|
|
32
|
+
type Items = (Input | Select)[];
|
|
33
|
+
type Content = {
|
|
34
|
+
type: string;
|
|
35
|
+
title: string;
|
|
36
|
+
innerHTML: string;
|
|
37
|
+
media: Media;
|
|
38
|
+
lang: string;
|
|
39
|
+
input: Items;
|
|
40
|
+
};
|
|
41
|
+
type Set = LearningEntityCommon & {
|
|
42
|
+
content: Content;
|
|
43
|
+
progress: Progress;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LearningEntityBase } from './learning-entity';
|
|
2
|
+
import { Vocabulary } from './vocabulary-learning-entity.type';
|
|
3
|
+
export declare class VocabularyLearningEntity extends LearningEntityBase {
|
|
4
|
+
private _vocabularies;
|
|
5
|
+
private _shuffleActivated;
|
|
6
|
+
private _shuffleButtonEnabled;
|
|
7
|
+
private _frontCardTitleVisibilityMode;
|
|
8
|
+
isCheckable(): boolean;
|
|
9
|
+
get shuffleActivated(): boolean;
|
|
10
|
+
set shuffleActivated(activated: boolean);
|
|
11
|
+
get shuffleButtonEnabled(): boolean;
|
|
12
|
+
set shuffleButtonEnabled(enabled: boolean);
|
|
13
|
+
get frontCardTitleVisibilityMode(): Vocabulary.FrontCardTitleVisibilityMode;
|
|
14
|
+
set frontCardTitleVisibilityMode(mode: Vocabulary.FrontCardTitleVisibilityMode);
|
|
15
|
+
get content(): Vocabulary.TransformedItems;
|
|
16
|
+
onShuffle(): void;
|
|
17
|
+
protected _init(entity: Vocabulary.Set): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LearningEntityCommon } from './learning-entity';
|
|
2
|
+
export declare namespace Vocabulary {
|
|
3
|
+
export enum FrontCardTitleVisibilityMode {
|
|
4
|
+
Visible = "visible",
|
|
5
|
+
Blurred = "blurred",
|
|
6
|
+
Invisible = "invisible"
|
|
7
|
+
}
|
|
8
|
+
type Meaning = {
|
|
9
|
+
lang: string;
|
|
10
|
+
text: string;
|
|
11
|
+
};
|
|
12
|
+
type Description = {
|
|
13
|
+
lang: string;
|
|
14
|
+
text: string;
|
|
15
|
+
};
|
|
16
|
+
export type Item = {
|
|
17
|
+
key: string;
|
|
18
|
+
meaning: Meaning[];
|
|
19
|
+
flip?: boolean;
|
|
20
|
+
description: Description[];
|
|
21
|
+
picture?: string;
|
|
22
|
+
};
|
|
23
|
+
export type Content = {
|
|
24
|
+
lang: string;
|
|
25
|
+
shuffle?: boolean;
|
|
26
|
+
shuffleButtonVisible?: boolean;
|
|
27
|
+
frontCardTitleVisibilityMode?: FrontCardTitleVisibilityMode;
|
|
28
|
+
input: Item[];
|
|
29
|
+
};
|
|
30
|
+
export type Set = LearningEntityCommon & {
|
|
31
|
+
content: Content;
|
|
32
|
+
};
|
|
33
|
+
export type TransformedItem = {
|
|
34
|
+
key: string;
|
|
35
|
+
meaning?: string;
|
|
36
|
+
flip?: boolean;
|
|
37
|
+
description?: string;
|
|
38
|
+
picture?: string;
|
|
39
|
+
};
|
|
40
|
+
export type TransformedItems = TransformedItem[];
|
|
41
|
+
export {};
|
|
42
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InteractiveLearningEntityBase } from './interactive-learning-entity';
|
|
2
|
+
import { YesNo } from './yes-no-learning-entity.type';
|
|
3
|
+
export declare class YesNoLearningEntity extends InteractiveLearningEntityBase {
|
|
4
|
+
private _content;
|
|
5
|
+
private _progress;
|
|
6
|
+
isCheckable(): boolean;
|
|
7
|
+
get progress(): YesNo.Progress;
|
|
8
|
+
set progress(progress: YesNo.Progress);
|
|
9
|
+
get content(): YesNo.Content;
|
|
10
|
+
protected _init(entity: YesNo.Set): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LearningEntityCommon } from './learning-entity';
|
|
2
|
+
export declare namespace YesNo {
|
|
3
|
+
type Media = {
|
|
4
|
+
url: string;
|
|
5
|
+
mimeType: string;
|
|
6
|
+
};
|
|
7
|
+
type ResultItem = {
|
|
8
|
+
key: string;
|
|
9
|
+
question: string;
|
|
10
|
+
answer: string;
|
|
11
|
+
};
|
|
12
|
+
type ProgressItem = {
|
|
13
|
+
key: string;
|
|
14
|
+
answer: boolean | undefined;
|
|
15
|
+
};
|
|
16
|
+
type Progress = ProgressItem[] | null | undefined;
|
|
17
|
+
type ResultItems = ResultItem[];
|
|
18
|
+
type Content = {
|
|
19
|
+
type: string;
|
|
20
|
+
title: string;
|
|
21
|
+
innerHTML: string;
|
|
22
|
+
media?: Media;
|
|
23
|
+
lang: string;
|
|
24
|
+
input: ResultItems;
|
|
25
|
+
};
|
|
26
|
+
type Set = LearningEntityCommon & {
|
|
27
|
+
content: Content;
|
|
28
|
+
progress: Progress;
|
|
29
|
+
};
|
|
30
|
+
}
|