Rework cloze element data
- Now only has a variable 'document'. This holds the HTML representation in an object. This object is enriched with element models. - Because the the TextEditor extension can neither create multiple element instances nor use the IDService to generate their IDs, this has to be done afterwards. See ClozeParser. - The cloze element has rather extensive compatibility handling because cloze elements used to save an actual HTML representation. This has to be transformed to JSON/object. Therefore we replace the old backslash- markers with custom HTML tags. The editor object does this transformation. It needs some custom extensions to recognize (and don't remove) the HTML tags though. - Cloze now shows a placeholder text when empty - The cloze component needs a small pipe to extract text formatting options from the paragraph parts. - For getting the child elements for the player the models have to be extracted from the somewhat complex (JSON)document. - Added some rudimentary interfaces for the TextEditor document format. - Removed the old ClozePart interface. This is quasi part of the new interfaces.
Showing
- projects/common/models/uI-element.ts 19 additions, 7 deletionsprojects/common/models/uI-element.ts
- projects/common/shared.module.ts 8 additions, 2 deletionsprojects/common/shared.module.ts
- projects/common/ui-elements/cloze/cloze-element.ts 78 additions, 31 deletionsprojects/common/ui-elements/cloze/cloze-element.ts
- projects/common/ui-elements/cloze/cloze.component.ts 76 additions, 87 deletionsprojects/common/ui-elements/cloze/cloze.component.ts
- projects/common/ui-elements/cloze/mark.pipe.ts 15 additions, 0 deletionsprojects/common/ui-elements/cloze/mark.pipe.ts
- projects/common/ui-elements/cloze/tiptap-editor-extensions/drop-list.ts 25 additions, 0 deletions...n/ui-elements/cloze/tiptap-editor-extensions/drop-list.ts
- projects/common/ui-elements/cloze/tiptap-editor-extensions/text-field.ts 25 additions, 0 deletions.../ui-elements/cloze/tiptap-editor-extensions/text-field.ts
- projects/common/ui-elements/cloze/tiptap-editor-extensions/toggle-button.ts 25 additions, 0 deletions...-elements/cloze/tiptap-editor-extensions/toggle-button.ts
- projects/editor/src/app/services/unit.service.ts 11 additions, 5 deletionsprojects/editor/src/app/services/unit.service.ts
- projects/editor/src/app/util/cloze-parser.ts 13 additions, 90 deletionsprojects/editor/src/app/util/cloze-parser.ts
Loading
Please register or sign in to comment