We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f381c55 commit c93e239Copy full SHA for c93e239
1 file changed
frontend/src/pages/Lesson.vue
@@ -784,11 +784,17 @@ onBeforeUnmount(() => {
784
785
const checkIfDiscussionsAllowed = () => {
786
hasQuiz.value = false
787
- JSON.parse(lesson.data?.content)?.blocks?.forEach((block) => {
788
- if (block.type === 'quiz') {
789
- hasQuiz.value = true
+ if (lesson.data?.content) {
+ try {
+ JSON.parse(lesson.data.content)?.blocks?.forEach((block) => {
790
+ if (block.type === 'quiz') {
791
+ hasQuiz.value = true
792
+ }
793
+ })
794
+ } catch {
795
+ // legacy markdown lessons
796
}
- })
797
798
799
if (
800
!hasQuiz.value &&
0 commit comments