Skip to content
Snippets Groups Projects
Commit cf695227 authored by chris's avatar chris
Browse files

add delete

parent 35709f1a
No related branches found
No related tags found
No related merge requests found
...@@ -192,7 +192,10 @@ const EditorComponent = ({ node, view, getPos }) => { ...@@ -192,7 +192,10 @@ const EditorComponent = ({ node, view, getPos }) => {
(showFeedBack && !testMode && ( (showFeedBack && !testMode && (
<> <>
<StudentAnswer isCorrect={isCorrect}>{node.attrs.answer}</StudentAnswer> <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} /> )) || <InputComponent getPos={getPos} node={node} view={view} />
); );
......
...@@ -14,6 +14,11 @@ const MatchingWrapper = styled.div` ...@@ -14,6 +14,11 @@ const MatchingWrapper = styled.div`
margin-top: 10px; margin-top: 10px;
`; `;
const MatchingContainerTool = styled.div`
border: 3px solid #f5f5f7;
border-bottom: none;
`;
const MatchingContainer = styled.div` const MatchingContainer = styled.div`
border: 3px solid #f5f5f7; border: 3px solid #f5f5f7;
margin-bottom: 30px; margin-bottom: 30px;
...@@ -113,6 +118,22 @@ const AddOption = styled.div` ...@@ -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 }) => { export default ({ node, view, getPos }) => {
const context = useContext(WaxContext); const context = useContext(WaxContext);
const { const {
...@@ -243,9 +264,22 @@ export default ({ node, view, getPos }) => { ...@@ -243,9 +264,22 @@ export default ({ node, view, getPos }) => {
const { testMode } = customProps; const { testMode } = customProps;
const { feedback } = node.attrs; const { feedback } = node.attrs;
const removeQuestion = () => {};
return ( return (
<MatchingWrapper> <MatchingWrapper>
{/* <span>Matching</span> */} {/* <span>Matching</span> */}
{!testMode && !readOnly && (
<MatchingContainerTool>
<RemoveQuestionButton
aria-label="delete this question"
onClick={removeQuestion}
type="button"
>
<StyledIconActionRemove name="deleteOutlinedQuestion" />
</RemoveQuestionButton>
</MatchingContainerTool>
)}
<MatchingContainer className="matching"> <MatchingContainer className="matching">
<QuestionWrapper> <QuestionWrapper>
<ContainerEditor getPos={getPos} node={node} view={view} /> <ContainerEditor getPos={getPos} node={node} view={view} />
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment