diff --git a/client/src/components/content-blocks/ContentComponent.vue b/client/src/components/content-blocks/ContentComponent.vue index a48fdbdb..97dd967c 100644 --- a/client/src/components/content-blocks/ContentComponent.vue +++ b/client/src/components/content-blocks/ContentComponent.vue @@ -150,14 +150,14 @@ const componentClass = computed(() => { }); const childElements = computed(() => { + if (props.component.type === 'assignment') { + // we don't need the childElements for an assignment component for now + return []; + } if (contentComponentDiv.value) { // todo: this is almost the same as the one in Assignment.vue, refactor and make one function let highlightParentSelector; - if (props.component.type === 'assignment') { - highlightParentSelector = '.assignment-text'; - } else { - highlightParentSelector = '.content-component__content'; - } + highlightParentSelector = '.content-component__content'; const parent = contentComponentDiv.value.querySelector(highlightParentSelector); if (!parent) { console.warn('Parent does not exist, this should not be possible'); diff --git a/client/src/components/content-blocks/assignment/Assignment.vue b/client/src/components/content-blocks/assignment/Assignment.vue index fb1a7947..0b6d4208 100644 --- a/client/src/components/content-blocks/assignment/Assignment.vue +++ b/client/src/components/content-blocks/assignment/Assignment.vue @@ -214,7 +214,7 @@ const feedbackText = computed(() => { const containsParagraphs = (str: string) => { const parser = new DOMParser(); const doc = parser.parseFromString(str, 'text/html'); - return doc.querySelectorAll('p') > 0; + return doc.querySelectorAll('p').length > 0; }; const assignmentHtml = computed(() => { const assignmentText = assignment.value.assignment;