From bdd588419178f632308f6f036d45b93e67cf11ec Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Thu, 22 Jun 2023 15:52:28 +0300
Subject: [PATCH] add answers

---
 .../components/EditorComponent.js                  | 14 ++++++++++----
 .../components/InputComponent.js                   |  2 +-
 .../DropDownComponent.js                           |  2 +-
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/wax-prosemirror-services/src/FillTheGapQuestionService/components/EditorComponent.js b/wax-prosemirror-services/src/FillTheGapQuestionService/components/EditorComponent.js
index 18ffbe72d..9ed73a364 100644
--- a/wax-prosemirror-services/src/FillTheGapQuestionService/components/EditorComponent.js
+++ b/wax-prosemirror-services/src/FillTheGapQuestionService/components/EditorComponent.js
@@ -42,9 +42,15 @@ const EditorWrapper = styled.span`
   }
 `;
 
-const StudentAnswer = styled.span``;
+const StudentAnswer = styled.span`
+  border-bottom: 1px solid black;
+  margin-right: 5px;
+`;
 
-const CorrectAnswers = styled.span``;
+const CorrectAnswers = styled.span`
+  border-bottom: 1px solid green;
+  margin-right: 5px;
+`;
 
 const EditorComponent = ({ node, view, getPos }) => {
   const editorRef = useRef();
@@ -175,8 +181,8 @@ const EditorComponent = ({ node, view, getPos }) => {
     )) ||
     (showFeedBack && !testMode && (
       <>
-        <StudentAnswer>Answer: {node.attrs.answer}</StudentAnswer>
-        <CorrectAnswers>Possible Answers : </CorrectAnswers>
+        <StudentAnswer>{node.attrs.answer}</StudentAnswer>
+        <CorrectAnswers>{`(Aceepted Answers : ${node.textContent.replaceAll(';', ' -')})`}</CorrectAnswers>
       </>
     )) || <InputComponent getPos={getPos} node={node} view={view} />
   );
diff --git a/wax-prosemirror-services/src/FillTheGapQuestionService/components/InputComponent.js b/wax-prosemirror-services/src/FillTheGapQuestionService/components/InputComponent.js
index b7a5db2fa..cbb19b23e 100644
--- a/wax-prosemirror-services/src/FillTheGapQuestionService/components/InputComponent.js
+++ b/wax-prosemirror-services/src/FillTheGapQuestionService/components/InputComponent.js
@@ -21,7 +21,7 @@ export default ({ node }) => {
     pmViews: { main },
   } = context;
 
-  const [answer, setAnswer] = useState(' ');
+  const [answer, setAnswer] = useState('');
   const answerRef = useRef(null);
 
   useEffect(() => {}, []);
diff --git a/wax-prosemirror-services/src/WaxToolGroups/QuestionsDropDownToolGroupService/DropDownComponent.js b/wax-prosemirror-services/src/WaxToolGroups/QuestionsDropDownToolGroupService/DropDownComponent.js
index 4f5e5c0ef..a7e7fd946 100644
--- a/wax-prosemirror-services/src/WaxToolGroups/QuestionsDropDownToolGroupService/DropDownComponent.js
+++ b/wax-prosemirror-services/src/WaxToolGroups/QuestionsDropDownToolGroupService/DropDownComponent.js
@@ -103,7 +103,7 @@ const DropDownComponent = ({ view, tools }) => {
       item: tools[6],
     },
     {
-      label: 'Fill The Gap',
+      label: 'Fill in the blank',
       value: '7',
       item: tools[7],
     },
-- 
GitLab