﻿id	summary	reporter	owner	description	type	status	priority	milestone	version	resolution	keywords	cc
1	Refactor render logic	bazzuser	enno	"**Description:**
The current HTML/Jinja2 template uses multiple nested if/elif blocks to render different question types (text, radio, checkbox, candidate_id) and media (image, audio, video). This approach goes against our goal of a clean, object-oriented architecture and results in a template that is difficult to maintain.

**Refactoring Goal:**
Move the rendering logic out of the template and into the respective Python classes. Both Question subclasses and MediaItem subclasses should implement a to_html() method that is directly invoked from the template.

**Example Jinja2 usage after refactoring:**

{{ question.to_html() | safe }}


**Acceptance Criteria:**

- The template file (exam.html) no longer contains any if q.type or if m.type logic.

- All supported question types are rendered via their respective to_html() methods.

- Optional media items are rendered via to_media_html().

- The visual output is semantically identical to the current implementation.

- All to_html() methods follow a consistent interface and can be tested individually.

**Notes:**

- to_html() returns HTML strings (not Jinja snippets).

- If a NullMediaItem is used, to_media_html() simply returns an empty string.

- The goal is a ""Smalltalk-inspired"" design: objects are fully responsible for their own rendering."	task	closed	minor			fixed	UX	
