forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 4e0a32974a9a41dbdd67b88dda46c1f7ac3e22ffFiltered to src/api/exams/postExamAttemptAnswerImage.tsClear filter

2026-07-21

feat: 🎨 editable freehand drawings for notes and text examsAhmet Kaan Gümüş · 3758bf0
feat: 🎨 editable freehand drawings for notes and text exams

- add a canvas drawing pad (pen, eraser, 5 colors, 3 widths, undo, clear)
  that saves a PNG with its stroke JSON embedded in a tEXt chunk, so a
  saved drawing displays as a normal image and reopens for editing
- lib/png-meta embeds/extracts PNG text chunks (crc32); draw-stroke gains
  DrawScene + parseScene; drawing-file turns canvas+scene into a PNG File
  and parses stored bytes back to a scene (all pure, unit-tested)
- reopened drawings rescale to the current pad (aspect preserved); when
  editing you can clear a drawing and save the blank to erase it
- notes: draw new attachments and edit saved *.hzdraw.png ones in place
  (create-new-then-delete-old, no data loss); PNG/JPEG device export
- teacher exam questions: draw or re-edit the question illustration
- student text answers: draw the answer in the exam room, reopen to edit
  or remove; teacher sees it in the grading answer sheet
- answer-image api wrappers + question-image blob fetch, answer_image on
  AttemptAnswer/StudentAnswer, EN/TR i18n keys
- DrawCanvas is its own lazy chunk (~2.6KB gzip); main bundle unchanged