From 51d981b118d6c9839419e07b87b0719948dd0667 Mon Sep 17 00:00:00 2001 From: jojohoch <joachim.hoch@iqb.hu-berlin.de> Date: Fri, 14 Oct 2022 09:13:33 +0200 Subject: [PATCH] [player] Use 'null' as initialization value of cloze child button --- .../compound-group-element.component.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/projects/player/src/app/components/elements/compound-group-element/compound-group-element.component.ts b/projects/player/src/app/components/elements/compound-group-element/compound-group-element.component.ts index c0175de49..4a9404373 100644 --- a/projects/player/src/app/components/elements/compound-group-element/compound-group-element.component.ts +++ b/projects/player/src/app/components/elements/compound-group-element/compound-group-element.component.ts @@ -9,7 +9,7 @@ import { } from 'common/components/compound-elements/cloze/cloze-child-elements/text-field-simple.component'; import { ClozeElement } from 'common/models/elements/compound-elements/cloze/cloze'; import { LikertElement } from 'common/models/elements/compound-elements/likert/likert'; -import { CompoundElement, InputElement } from 'common/models/elements/element'; +import { CompoundElement, InputElement, InputElementValue } from 'common/models/elements/element'; import { ButtonComponent } from 'common/components/button/button.component'; import { VeronaPostService } from 'player/modules/verona/services/verona-post.service'; import { NavigationService } from 'player/src/app/services/navigation.service'; @@ -56,11 +56,10 @@ export class CompoundGroupElementComponent extends ElementFormGroupDirective imp registerCompoundChildren(children: ElementComponent[]): void { children.forEach(child => { const childModel = child.elementModel as InputElement; - this.registerAtUnitStateService( - childModel.id, - this.elementModelElementCodeMappingService.mapToElementCodeValue(childModel.value, childModel.type), - child, - this.pageIndex); + const initialValue: InputElementValue = childModel.type === 'button' ? + null : + this.elementModelElementCodeMappingService.mapToElementCodeValue(childModel.value, childModel.type); + this.registerAtUnitStateService(childModel.id, initialValue, child, this.pageIndex); if (childModel.type === 'text-field-simple') { this.manageKeyInputToggling(child as TextFieldSimpleComponent, childModel); this.manageHardwareKeyBoardDetection(child as TextFieldSimpleComponent); -- GitLab