Skip to content

add solution to spec explicitly - #199

Merged
ColdHeat merged 2 commits into
CTFd:solutions-writeupfrom
vellvoid:solutions-writeup
Feb 19, 2026
Merged

ColdHeat merged 2 commits into
CTFd:solutions-writeupfrom
vellvoid:solutions-writeup

Conversation

@vellvoid

@vellvoid vellvoid commented Feb 12, 2026 •

Copy link
Copy Markdown
Collaborator

This builds on #198 by adding solution to the challenge spec.

Solution can either be a string (path to the file), or an object specifying path, as well as state (or visibility, both work - ctfd uses state, but i feel visibility is more user friendly). It will upload images as before, and render snippets. HTML style image includes are ignored on purpose - but that can be changed.

Also correctly syncs the solutions with a patch instead of a post.

Closes: #198

@ColdHeat ColdHeat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code as well should prioritize state as the main field and visibility as an alias

Comment on lines +56 to +58
# path: writeup/WRITEUP.md
# visibility: solved # hidden | visible | solved
solution: writeup/WRITEUP.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should prioritize state over visibility. The name is a bit incorrect but state is also used for challenges. We have to reasonably map to the models imo.

@vellvoid
vellvoid requested a review from ColdHeat February 19, 2026 07:05
@ColdHeat
ColdHeat merged commit fe3a7d9 into CTFd:solutions-writeup Feb 19, 2026
6 checks passed
ColdHeat added a commit that referenced this pull request Feb 26, 2026
* Add support for solutions based on writeups

* add solution to spec explicitly (#199)

* add solution to spec explicitly

* remove visibility alias

* Remove visibility references

---------

Co-authored-by: Miłosz <milosz.skaza@ctfd.io>
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.

2 participants