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

multiple cohice container components

parent 0a552c15
No related branches found
No related tags found
1 merge request!526new wrapper component
......@@ -19,7 +19,7 @@ export default class MultipleChoiceSingleCorrectContainerNodeView extends Questi
}
static name() {
return 'multiple_choice_container';
return 'multiple_choice_single_correct_container';
}
stopEvent(event) {
......
......@@ -4,8 +4,9 @@ import multipleChoiceSingleCorrectNode from './schema/multipleChoiceSingleCorrec
import multipleChoiceSingleCorrectContainerNode from './schema/multipleChoiceSingleCorrectContainerNode';
import questionSingleNode from './schema/questionSingleNode';
import AnswerComponent from './components/AnswerComponent';
import MultipleChoiceSingleCorrectContainerNodeView from './MultipleChoiceSingleCorrectContainerNodeView';
import MultipleChoiceContainerComponent from '../components/MultipleChoiceContainerComponent';
import MultipleChoiceSingleCorrectNodeView from './MultipleChoiceSingleCorrectNodeView';
import MultipleChoiceSingleCorrectContainerNodeView from './MultipleChoiceSingleCorrectContainerNodeView';
import QuestionMultipleSingleNodeView from './QuestionMultipleSingleNodeView';
import QuestionComponent from '../components/QuestionComponent';
......@@ -29,11 +30,11 @@ class MultipleChoiceSingleCorrectQuestionService extends Service {
question_node_multiple_single: questionSingleNode,
});
// addPortal({
// nodeView: MultipleChoiceSingleCorrectContainerNodeView,
// component: QuestionComponent,
// context: this.app,
// });
addPortal({
nodeView: MultipleChoiceSingleCorrectContainerNodeView,
component: MultipleChoiceContainerComponent,
context: this.app,
});
addPortal({
nodeView: QuestionMultipleSingleNodeView,
......
import React, { useContext } from 'react';
import { WaxContext, DocumentHelpers, Icon } from 'wax-prosemirror-core';
import styled from 'styled-components';
import ContainerEditor from '../../FillTheGapQuestionService/components/ContainerEditor';
const MultipleChoiceQuestionWrapper = styled.div`
border: 3px solid #f5f5f7;
margin: 0px 38px 15px 38px;
margin-top: 10px;
`;
const MultipleChoiceContainerTool = styled.div`
border: 3px solid #f5f5f7;
border-bottom: none;
border-bottom: 3px solid #f5f5f7;
height: 32px;
span:first-of-type {
position: relative;
top: 3px;
}
`;
const ActionButton = styled.button`
......@@ -101,7 +96,10 @@ const getNodes = view => {
const allNodes = DocumentHelpers.findBlockNodes(view.state.doc);
const fillTheGapContainerNodes = [];
allNodes.forEach(node => {
if (node.node.type.name === 'multiple_choice_container') {
if (
node.node.type.name === 'multiple_choice_container' ||
node.node.type.name === 'multiple_choice_single_correct_container'
) {
fillTheGapContainerNodes.push(node);
}
});
......
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