Commit 1f2f7df6 authored by Yechang's avatar Yechang
Browse files

fix(submission): invalid status doesnt render correctly

parent bc7877f6
Loading
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
<script lang="ts" context="module">
	import { AnsiUp } from 'ansi_up';
	const ansi_up = new AnsiUp();

	const invalidStatus = ['JudgementFailed', 'ConfigurationError', 'SystemError', 'FileError', 'CompilationError']
</script>

<script lang="ts">
@@ -15,6 +17,7 @@
	import { contentSchema } from '$lib/shared/feedback';
	import MyAlert from '$lib/components/Alert.svelte';
	import Card from '$lib/components/user/card.svelte';
	import { stat } from 'fs';
	export let data: PageData;

	const { submission } = data;
@@ -82,10 +85,10 @@
					<div>Score: {item.value}</div>
				{:else if item.type === 'status'}
					<div>Status: {item.value}</div>
					{#if item.value in ['JudgementFailed', 'ConfigurationError', 'SystemError', 'FileError', 'CompilationError']}
					{#if _.findIndex(invalidStatus, item.value) > -1}
						<MyAlert color="blue">
							<div>
								This submission with {item.value} will not count towards the number of attempts.
								This submission will not count towards the number of attempts (if there is any penalty).
							</div>
						</MyAlert>
					{/if}