Skip to content

Commit

Permalink
Make TSG CTF decay function selectable from frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
hakatashi committed Oct 23, 2023
1 parent e498d99 commit dcafe30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CTFd/plugins/dynamic_challenges/assets/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
<ul>
<li>Linear: Calculated as <code>Initial - (Decay * SolveCount)</code></li>
<li>Logarithmic: Calculated as <code>(((Minimum - Initial) / (Decay^2)) * (SolveCount^2)) + Initial</code></li>
<li>TSG CTF: Developed by naan112358</li>
</ul>
</small>
</label>
<select name="function" class="custom-select">
<option value="linear">Linear</option>
<option value="logarithmic">Logarithmic</option>
<option value="tsgctf" selected>TSG CTF</option>
</select>
</div>

Expand Down
1 change: 1 addition & 0 deletions CTFd/plugins/dynamic_challenges/decay.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ def tsgctf(challenge):
DECAY_FUNCTIONS = {
"linear": linear,
"logarithmic": logarithmic,
"tsgctf": tsgctf,
}

0 comments on commit dcafe30

Please sign in to comment.