New setting: introduce a decote/discount to exercice's gain

This commit is contained in:
nemunaire 2023-04-01 17:11:40 +02:00
commit 4451e41285
11 changed files with 123 additions and 24 deletions

View file

@ -61,16 +61,31 @@
<Row class="level" cols={{xs:2, md:3, xl:4}}>
<Col>
<div class="level-item">
<div class="heading">
Gain
</div>
{#if $settings.discountedFactor > 0 && $my && $my.exercices[$current_exercice.id]}
<div class="heading">
Cote
</div>
{:else}
<div class="heading">
Gain
</div>
{/if}
<div class="value">
{$current_exercice.gain} {$current_exercice.gain==1?"point":"points"}
{#if $settings.discountedFactor && $current_exercice.solved}
<!-- This display the number of points gained by the team if it validates the exercice (current teams have more points than that) -->
{Math.trunc($current_exercice.gain * (1-$settings.discountedFactor*$current_exercice.solved)*10)/10} {$current_exercice.gain==1?"point":"points"}
{:else}
{$current_exercice.gain} {$current_exercice.gain==1?"point":"points"}
{/if}
</div>
{#if $settings.firstBlood && $current_exercice.solved < 1}
<div class="text-muted">
<em>+{$settings.firstBlood * 100}% (prem's)</em>
</div>
{:else if $settings.discountedFactor > 0 && $my && $my.exercices[$current_exercice.id]}
<div class="text-muted">
<em>initialement {$current_exercice.gain} {$current_exercice.gain==1?"point":"points"}</em>
</div>
{/if}
{#if $current_exercice.curcoeff != 1.0 || $settings.exerciceCurrentCoefficient != 1.0}
<div class="text-muted">