CTFd / CTFd/CTFd

Incorrect fucntion name `logarithmic` in score decay algorithm

Open
#2,846 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.8k
Forks
2.8k
Avg merge
1d 6h
Merged PRs (30d)
5

Description

The function `logarithmic` does the following calculations to get a new score, however, though it's named `logarithmic`,
the actual algorithm is not. It's actually **parabola**.

The code is currently at https://github.com/CTFd/CTFd/blob/master/CTFd/plugins/dynamic_challenges/decay.py#L43

```py
value = (
((challenge.minimum - challenge.initial) / (challenge.decay ** 2))
* (solve_count ** 2)
) + challenge.initial
```

To illustrate that, here is a graph, drawing a typical PARABOLA in red, and a LOGARITHMIC CURVE in blue.

Image

I checked the document and it says:

> CTFd uses a parabolic function instead of a linear, exponential, or logarithmic decay function...

I would like to know should the function name be renamed? It's a bit cheating...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.