# Quantity Scoring

## The Quantity Score

As the name indicates, the **Quantity Score** is based on the number of contributions by a user. Depending on the role of the user this has a slightly different meaning.&#x20;

* Contributors/Reviewers: number of reviewed contributions they were involved in&#x20;
* Clients: number of contributions they provided feedback for&#x20;

## Elapsed time as a metric

As we'll continuously want to keep track of a user's quantity score while users are contributing, the elapsed time between contributions is used as a metric. This elapsed time is the exact same metric as the number of contributions, but the lower its average value, the higher the quantity score should be.&#x20;

For the initial contribution, the maximum elapsed time Tmax is used to make sure a new user has to build up his reputation. Additionally, when the elapsed time exceeds Tmax, a timeout occurs and the counting starts from 0 again.&#x20;

$$
T\_0 = T\_{max} \\
0\<T\_i \leq T\_{max}
$$

Because the elapsed time between 2 contributions can vary significantly, we take the exponential moving average (EMA) of this value for new elapsedTime (Ti) values. The formula is given below where the value p determines the amount of history to take into account in the EMA.​

$$
k=\frac{2}{p+1} \\
EMA(T\_i) = kT\_{i}+(1-k)EMA(T\_{i-1})
$$

Before this value can be used as a reputation score we want it to be bound between 0 and 1. To achieve this we use the following formula:

$$
R\_n = 1 - \frac{EMA(T\_i)}{T\_{max}}
$$

This approach allows the quantity score to be updated in real-time on each contribution of a user.
