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

fix read only mode

parent adf8ff2d
No related branches found
No related tags found
1 merge request!391Matching question
......@@ -36,7 +36,7 @@ export default ({ node, view, getPos }) => {
<span>Fill The Gap</span>
<FillTheGapContainer className="fill-the-gap">
<ContainerEditor getPos={getPos} node={node} view={view} />
{!(readOnly && !customProps.showFeedBack) && (
{!(readOnly && customProps && !customProps.showFeedBack) && (
<FeedbackComponent
getPos={getPos}
node={node}
......
......@@ -185,7 +185,7 @@ export default ({ node, view, getPos }) => {
<QuestionData>
<EditorComponent getPos={getPos} node={node} view={view} />
</QuestionData>
{!(readOnly && !customProps.showFeedBack) && (
{!(readOnly && customProps && !customProps.showFeedBack) && (
<FeedbackComponent
getPos={getPos}
node={node}
......
......@@ -184,7 +184,7 @@ export default ({ node, view, getPos }) => {
<QuestionData>
<EditorComponent getPos={getPos} node={node} view={view} />
</QuestionData>
{!(readOnly && !customProps.showFeedBack) && (
{!(readOnly && customProps && !customProps.showFeedBack) && (
<FeedbackComponent
getPos={getPos}
node={node}
......
......@@ -67,7 +67,7 @@ const TrueFalseSwitch = ({
checked,
checkedAnswerMode,
}) => {
if (customProps.showFeedBack) {
if (customProps && customProps.showFeedBack) {
const correct = node.attrs.correct ? 'TRUE' : 'FALSE';
const answer = node.attrs.answer ? 'TRUE' : 'FALSE';
const isCorrect = node.attrs.correct === node.attrs.answer;
......
......@@ -184,7 +184,7 @@ export default ({ node, view, getPos }) => {
<QuestionData>
<EditorComponent getPos={getPos} node={node} view={view} />
</QuestionData>
{!(readOnly && !customProps.showFeedBack) && (
{!(readOnly && customProps && !customProps.showFeedBack) && (
<FeedbackComponent
getPos={getPos}
node={node}
......
......@@ -184,7 +184,7 @@ export default ({ node, view, getPos }) => {
<QuestionData>
<EditorComponent getPos={getPos} node={node} view={view} />
</QuestionData>
{!(readOnly && !customProps.showFeedBack) && (
{!(readOnly && customProps && !customProps.showFeedBack) && (
<FeedbackComponent
getPos={getPos}
node={node}
......
......@@ -48,7 +48,7 @@ const YesNoSwitch = ({
checked,
checkedAnswerMode,
}) => {
if (customProps.showFeedBack) {
if (customProps && customProps.showFeedBack) {
const correct = node.attrs.correct ? 'YES' : 'NO';
const answer = node.attrs.answer ? 'YES' : 'NO';
const isCorrect = node.attrs.correct === node.attrs.answer;
......
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