Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#2 closed enhancement (fixed)

Add DownloadItem media type for downloadable files

Reported by: bazzuser Owned by: enno
Priority: minor Milestone:
Version: Keywords: DATAMANAGEMENT
Cc:

Description

Add DownloadItem media type for downloadable files

Type Feature
Priority Medium
Component Media / Rendering
Status new
Owner enno
Milestone Sprint 3
StoryID S14
Estimate 1h

Description

To support cases where reference material (e.g. PDFs, data sheets, or documents) should be downloaded or opened externally, a new media type DownloadItem will be introduced.

This class renders a simple HTML <a> element linking to the file. It avoids embedding and instead offers a flexible, user-friendly way to access additional resources in a standalone exam environment.

Implementation

  • Add DownloadItem(MediaItem) class
  • Constructor accepts src and optional label
  • render_html() outputs:
    <a href="{src}" download>{label}</a>
    

Acceptance Criteria

  • Questions can include DownloadItem in their media list
  • Link renders correctly in the browser
  • Works offline (file included in exam package)
  • No changes required in Jinja2 template
  • Respects polymorphic rendering pattern (render_html())

Notes

  • The label defaults to "Datei herunterladen" if not specified
  • Advanced behavior (e.g. target="_blank") can be added later
  • Keeps template logic clean and extensible

Change History (3)

comment:1 by enno, 4 months ago

Owner: changed from Enno to enno
Status: assignedaccepted

feature added

comment:2 by enno, 4 months ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.