From 89be6501695e6842b09bedf242cbefe2ce3b1996 Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Wed, 1 Nov 2023 14:34:48 +0200
Subject: [PATCH] start new service

---
 .../NumericalAnswerService/NumericalAnswerService.js   |  3 ++-
 .../DropDownComponent.js                               | 10 +++++-----
 .../QuestionsDropDown.js                               |  2 ++
 wax-questions-service/src/QuestionsService.js          |  2 ++
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/wax-questions-service/src/NumericalAnswerService/NumericalAnswerService.js b/wax-questions-service/src/NumericalAnswerService/NumericalAnswerService.js
index 2a55b85b7..690653168 100644
--- a/wax-questions-service/src/NumericalAnswerService/NumericalAnswerService.js
+++ b/wax-questions-service/src/NumericalAnswerService/NumericalAnswerService.js
@@ -1,11 +1,12 @@
 import { Service } from 'wax-prosemirror-core';
 import NumericalAnswerContainerNode from './schema/NumericalAnswerContainerNode';
+import NumericalAnswerQuestion from './NumericalAnswerQuestion';
 
 import './numericalAnswer.css';
 
 class NumericalAnswerService extends Service {
   register() {
-    this.container.bind('').to();
+    this.container.bind('NumericalAnswerQuestion').to(NumericalAnswerQuestion);
     const createNode = this.container.get('CreateNode');
     const addPortal = this.container.get('AddPortal');
 
diff --git a/wax-questions-service/src/QuestionsDropDownToolGroupService/DropDownComponent.js b/wax-questions-service/src/QuestionsDropDownToolGroupService/DropDownComponent.js
index eed85c98d..e67b0a92c 100644
--- a/wax-questions-service/src/QuestionsDropDownToolGroupService/DropDownComponent.js
+++ b/wax-questions-service/src/QuestionsDropDownToolGroupService/DropDownComponent.js
@@ -107,11 +107,11 @@ const DropDownComponent = ({ view, tools }) => {
       value: '7',
       item: tools[7],
     },
-    // {
-    //   label: 'Numerical answer',
-    //   value: '8',
-    //   item: tools[8],
-    // },
+    {
+      label: 'Numerical answer',
+      value: '8',
+      item: tools[8],
+    },
   ];
 
   const context = useContext(WaxContext);
diff --git a/wax-questions-service/src/QuestionsDropDownToolGroupService/QuestionsDropDown.js b/wax-questions-service/src/QuestionsDropDownToolGroupService/QuestionsDropDown.js
index 395c8bedb..94e612926 100644
--- a/wax-questions-service/src/QuestionsDropDownToolGroupService/QuestionsDropDown.js
+++ b/wax-questions-service/src/QuestionsDropDownToolGroupService/QuestionsDropDown.js
@@ -18,6 +18,7 @@ class QuestionsDropDown extends ToolGroup {
     @inject('EssayQuestion') essayQuestion,
     @inject('MultipleDropDownQuestion') MultipleDropDownQuestion,
     @inject('FillTheGapQuestion') FillTheGapQuestion,
+    @inject('NumericalAnswerQuestion') NumericalAnswerQuestion,
   ) {
     super();
     this.tools = [
@@ -29,6 +30,7 @@ class QuestionsDropDown extends ToolGroup {
       essayQuestion,
       MultipleDropDownQuestion,
       FillTheGapQuestion,
+      NumericalAnswerQuestion,
     ];
   }
 
diff --git a/wax-questions-service/src/QuestionsService.js b/wax-questions-service/src/QuestionsService.js
index 346fc5784..a8663f062 100644
--- a/wax-questions-service/src/QuestionsService.js
+++ b/wax-questions-service/src/QuestionsService.js
@@ -3,6 +3,7 @@ import EssayService from './EssayService/EssayService';
 import FillTheGapQuestionService from './FillTheGapQuestionService/FillTheGapQuestionService';
 import MatchingService from './MatchingService/MatchingService';
 import MultipleDropDownService from './MultipleDropDownService/MultipleDropDownService';
+import NumericalAnswerService from './NumericalAnswerService/NumericalAnswerService';
 import QuestionsDropDownToolGroupService from './QuestionsDropDownToolGroupService/QuestionsDropDownToolGroupService';
 import MultipleChoiceQuestionService from './MultipleChoiceQuestionService/MultipleChoiceQuestionService';
 
@@ -15,6 +16,7 @@ class QuestionsService extends Service {
     new FillTheGapQuestionService(),
     new MatchingService(),
     new MultipleDropDownService(),
+    new NumericalAnswerService(),
     new QuestionsDropDownToolGroupService(),
   ];
 }
-- 
GitLab