From cf695227bf7227ce1e89e6cc8f97c03080e80730 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Mon, 26 Jun 2023 22:00:57 +0300 Subject: [PATCH] add delete --- .../components/EditorComponent.js | 5 ++- .../components/MatchingContainerComponent.js | 34 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/wax-prosemirror-services/src/FillTheGapQuestionService/components/EditorComponent.js b/wax-prosemirror-services/src/FillTheGapQuestionService/components/EditorComponent.js index 4cf2038ef..4f5827246 100644 --- a/wax-prosemirror-services/src/FillTheGapQuestionService/components/EditorComponent.js +++ b/wax-prosemirror-services/src/FillTheGapQuestionService/components/EditorComponent.js @@ -192,7 +192,10 @@ const EditorComponent = ({ node, view, getPos }) => { (showFeedBack && !testMode && ( <> <StudentAnswer isCorrect={isCorrect}>{node.attrs.answer}</StudentAnswer> - <CorrectAnswers>{`(Aceepted Answers : ${node.textContent.replaceAll(';', ' -')})`}</CorrectAnswers> + <CorrectAnswers>{`(Accepted Answers : ${node.textContent.replaceAll( + ';', + ' -', + )})`}</CorrectAnswers> </> )) || <InputComponent getPos={getPos} node={node} view={view} /> ); diff --git a/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js b/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js index 77c41edfe..c1ea11dc9 100644 --- a/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js +++ b/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js @@ -14,6 +14,11 @@ const MatchingWrapper = styled.div` margin-top: 10px; `; +const MatchingContainerTool = styled.div` + border: 3px solid #f5f5f7; + border-bottom: none; +`; + const MatchingContainer = styled.div` border: 3px solid #f5f5f7; margin-bottom: 30px; @@ -113,6 +118,22 @@ const AddOption = styled.div` } `; +const RemoveQuestionButton = styled.button` + background: transparent; + cursor: pointer; + margin-top: 6px; + border: none; + position: relative; + bottom: 2px; + left: -11px; + float: right; +`; + +const StyledIconActionRemove = styled(Icon)` + height: 24px; + width: 24px; +`; + export default ({ node, view, getPos }) => { const context = useContext(WaxContext); const { @@ -243,9 +264,22 @@ export default ({ node, view, getPos }) => { const { testMode } = customProps; const { feedback } = node.attrs; + const removeQuestion = () => {}; + return ( <MatchingWrapper> {/* <span>Matching</span> */} + {!testMode && !readOnly && ( + <MatchingContainerTool> + <RemoveQuestionButton + aria-label="delete this question" + onClick={removeQuestion} + type="button" + > + <StyledIconActionRemove name="deleteOutlinedQuestion" /> + </RemoveQuestionButton> + </MatchingContainerTool> + )} <MatchingContainer className="matching"> <QuestionWrapper> <ContainerEditor getPos={getPos} node={node} view={view} /> -- GitLab