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

fix matching into dropdown

parent facf6357
No related branches found
No related tags found
1 merge request!426Questions ToolGroup
......@@ -13,12 +13,14 @@ class MatchingQuestion extends Tools {
name = 'Matching';
get run() {
return (state, dispatch, view) => {
helpers.checkifEmpty(view);
return main => {
const { dispatch } = main;
const { state } = main;
helpers.checkifEmpty(main);
/* Create Wrapping */
const { $from, $to } = view.state.selection;
const { $from, $to } = main.state.selection;
const range = $from.blockRange($to);
const { tr } = view.state;
const { tr } = main.state;
const wrapping =
range &&
......@@ -42,6 +44,7 @@ class MatchingQuestion extends Tools {
tr.replaceSelectionWith(option);
dispatch(tr);
return true;
};
}
......
......@@ -51,7 +51,7 @@ const DropDownComponent = ({ title, view, tools }) => {
const isEditable = main.props.editable(editable => {
return editable;
});
console.log(tools);
const dropDownOptions = [
{
label: 'Multiple Choice',
......@@ -81,7 +81,7 @@ const DropDownComponent = ({ title, view, tools }) => {
];
useEffect(() => {
setLabel('Multiple Question Types');
setLabel('Question Types');
dropDownOptions.forEach((option, i) => {
if (option.item.active(main.state)) {
setTimeout(() => {
......@@ -105,7 +105,7 @@ const DropDownComponent = ({ title, view, tools }) => {
key={uuidv4()}
onChange={option => onChange(option)}
options={dropDownOptions}
placeholder="Multiple Question Types"
placeholder="Question Types"
select={isDisabled}
value={label}
/>
......
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