fix: resolve initialization bugs breaking level indicator and expected preview

- Fix renderLesson to handle null inputEl (CodeMirror replaces textarea)
- Fix renderExpectedPreview to use 'solution' property instead of 'solutionCode'
- These fixes restore level indicator, expected preview, and auto-run functionality
This commit is contained in:
2025-12-22 10:04:41 +01:00
parent 0169c8c9a9
commit 8ee6f3dd0a
2 changed files with 6 additions and 5 deletions

View File

@@ -239,7 +239,8 @@ export class LessonEngine {
renderExpectedPreview() {
if (!this.currentLesson) return;
const solutionCode = this.currentLesson.solutionCode;
// Use 'solution' property from lesson JSON (not 'solutionCode')
const solutionCode = this.currentLesson.solution;
if (!solutionCode) {
// No solution code provided, hide the expected pane or show placeholder
const expectedContainer = document.getElementById("preview-expected");