backend: Display a message when the exercice is disabled
This commit is contained in:
parent
089e604679
commit
d8462cf58e
4 changed files with 37 additions and 1 deletions
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
export let exercice = { };
|
||||
export let flags = [];
|
||||
export let readonly = false;
|
||||
|
||||
function waitDiff(i) {
|
||||
my.refresh((my) => {
|
||||
|
|
@ -224,7 +225,7 @@
|
|||
type="submit"
|
||||
color="danger"
|
||||
id="submission-{exercice.id}"
|
||||
disabled={submitInProgress || $settings.disablesubmitbutton}
|
||||
disabled={submitInProgress || $settings.disablesubmitbutton || readonly}
|
||||
>
|
||||
{#if submitInProgress}
|
||||
<Spinner size="sm" class="me-2" />
|
||||
|
|
@ -233,6 +234,8 @@
|
|||
</Button>
|
||||
{#if $settings.disablesubmitbutton}
|
||||
<span class="text-muted">{$settings.disablesubmitbutton}</span>
|
||||
{:else if readonly}
|
||||
<span class="text-muted">Ce défi est désactivé</span>
|
||||
{/if}
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@
|
|||
exercice={$my.exercices[$current_exercice.id]}
|
||||
bind:forcesolved={solved[$current_exercice.id]}
|
||||
flags={$my.exercices[$current_exercice.id].flags}
|
||||
readonly={$current_exercice.disabled}
|
||||
/>
|
||||
{/if}
|
||||
{/if}
|
||||
|
|
|
|||
Reference in a new issue