Skip to content

Fix the learning log render loop in the instructor preview - #244

Merged
AQIB-NAWAB merged 1 commit into
mainfrom
fix/reader-project-box-and-learning-log
Nov 18, 2026
Merged

AQIB-NAWAB merged 1 commit into
mainfrom
fix/reader-project-box-and-learning-log

Conversation

@AQIB-NAWAB

Copy link
Copy Markdown
Collaborator

Two small reader fixes found while reviewing courses in the instructor preview.

1. Learning log failed on every checklist

LearningLog defaults initialAnswers to a new {} on every render, and then compares that prop with the previous value during render. With no saved answers (the instructor preview has none), it re-rendered until React stopped it, and each checklist showed "This block could not be displayed (LearningLog). Too many re-renders."

The default is now one shared constant. When saved answers are passed (a learner's own session), nothing changes.

2. Project goal in the instructor preview

The instructor preview showed the course project goal in an always-open box above every lesson. The learner reader already folds it into a collapsed "Project overview". The preview now matches the reader.

Checked

  • Reproduced in Chrome in a local build: every checklist lesson showed the error before the fix and rendered normally after it (49 lessons checked).
  • No automated test: the loop only happens when the component renders in the browser, and the frontend test setup has no DOM environment, so a server render test passes with or without the fix.

LearningLog defaulted initialAnswers to a new {} on every render, and it
compares that prop with the previous value during render. With no saved
answers (the instructor preview has none) it re-rendered until React gave
up, so every checklist showed 'This block could not be displayed'. The
default is now one shared object.

The instructor preview showed the course project goal in an open box above
every lesson. It is now the same collapsed 'Project overview' that the
learner reader uses.
@AQIB-NAWAB
AQIB-NAWAB merged commit c77a4bf into main Nov 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant