From ef3277274e8dba3ec95604e3d5ef63fc7c0b8b5d Mon Sep 17 00:00:00 2001
From: jojohoch <joachim.hoch@iqb.hu-berlin.de>
Date: Thu, 15 Dec 2022 16:03:07 +0100
Subject: [PATCH] Change AnswerScheme for HotspotImageElement element

---
 .../elements/input-elements/hotspot-image.ts  | 20 ++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/projects/common/models/elements/input-elements/hotspot-image.ts b/projects/common/models/elements/input-elements/hotspot-image.ts
index 57cb50b53..606fd0e4a 100644
--- a/projects/common/models/elements/input-elements/hotspot-image.ts
+++ b/projects/common/models/elements/input-elements/hotspot-image.ts
@@ -35,15 +35,17 @@ export class HotspotImageElement extends InputElement implements PositionedUIEle
 
   private getAnswerSchemeValues(): AnswerSchemeValue[] {
     return this.value
-      .map((hotspot, index) => ({
-        value: (index + 1).toString(),
-        label: `top: ${hotspot.top},
-        left: ${hotspot.left},
-        height: ${hotspot.height},
-        width: ${hotspot.width},
-        shape: ${hotspot.shape},
-        value: ${hotspot.value}`
-      }));
+      .map(hotspot => (
+        [{
+          value: 'true',
+          // eslint-disable-next-line max-len
+          label: `Gefüllt top: ${hotspot.top}, left: ${hotspot.left}, height: ${hotspot.height}, width: ${hotspot.width}, shape: ${hotspot.shape}, value: ${hotspot.value}`
+        }, {
+          value: 'false',
+          // eslint-disable-next-line max-len
+          label: `Nicht gefüllt: top: ${hotspot.top}, left: ${hotspot.left}, height: ${hotspot.height}, width: ${hotspot.width}, shape: ${hotspot.shape}, value: ${hotspot.value}`
+        }
+        ])).flat();
   }
 
   getElementComponent(): Type<ElementComponent> {
-- 
GitLab