This commit is contained in:
orosmatthew 2023-09-10 14:17:54 -04:00
commit 3422727f32
17 changed files with 295 additions and 217 deletions

View File

@ -8,7 +8,7 @@
"name": "bwcontest",
"version": "0.0.1",
"dependencies": {
"@vscode/vsce": "^2.20.1",
"@vscode/vsce": "^2.21.0",
"axios": "^1.5.0",
"fs-extra": "^11.1.1",
"tree-kill": "^1.2.2"
@ -24,20 +24,20 @@
"@types/mocha": "^10.0.1",
"@types/node": "20.x",
"@types/vscode": "^1.81.0",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@vscode/test-electron": "^2.3.4",
"concurrently": "^8.2.1",
"esbuild": "^0.19.2",
"eslint": "^8.48.0",
"glob": "^10.3.3",
"glob": "^10.3.4",
"mocha": "^10.2.0",
"postcss": "^8.4.28",
"postcss": "^8.4.29",
"rollup-plugin-css-only": "^4.3.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-svelte": "^7.1.6",
"svelte": "^4.2.0",
"svelte-check": "^3.5.0",
"svelte-check": "^3.5.1",
"svelte-preprocess": "^5.0.4",
"typescript": "^5.2.2"
},
@ -990,9 +990,9 @@
"dev": true
},
"node_modules/@types/semver": {
"version": "7.5.0",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz",
"integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==",
"version": "7.5.1",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.1.tgz",
"integrity": "sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==",
"dev": true
},
"node_modules/@types/vscode": {
@ -1002,16 +1002,16 @@
"dev": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz",
"integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==",
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.6.0.tgz",
"integrity": "sha512-CW9YDGTQnNYMIo5lMeuiIG08p4E0cXrXTbcZ2saT/ETE7dWUrNxlijsQeU04qAAKkILiLzdQz+cGFxCJjaZUmA==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/type-utils": "6.4.1",
"@typescript-eslint/utils": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.1",
"@typescript-eslint/scope-manager": "6.6.0",
"@typescript-eslint/type-utils": "6.6.0",
"@typescript-eslint/utils": "6.6.0",
"@typescript-eslint/visitor-keys": "6.6.0",
"debug": "^4.3.4",
"graphemer": "^1.4.0",
"ignore": "^5.2.4",
@ -1037,15 +1037,15 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz",
"integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==",
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.6.0.tgz",
"integrity": "sha512-setq5aJgUwtzGrhW177/i+DMLqBaJbdwGj2CPIVFFLE0NCliy5ujIdLHd2D1ysmlmsjdL2GWW+hR85neEfc12w==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/types": "6.4.1",
"@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.1",
"@typescript-eslint/scope-manager": "6.6.0",
"@typescript-eslint/types": "6.6.0",
"@typescript-eslint/typescript-estree": "6.6.0",
"@typescript-eslint/visitor-keys": "6.6.0",
"debug": "^4.3.4"
},
"engines": {
@ -1065,13 +1065,13 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz",
"integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==",
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.6.0.tgz",
"integrity": "sha512-pT08u5W/GT4KjPUmEtc2kSYvrH8x89cVzkA0Sy2aaOUIw6YxOIjA8ilwLr/1fLjOedX1QAuBpG9XggWqIIfERw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.1"
"@typescript-eslint/types": "6.6.0",
"@typescript-eslint/visitor-keys": "6.6.0"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
@ -1082,13 +1082,13 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz",
"integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==",
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.6.0.tgz",
"integrity": "sha512-8m16fwAcEnQc69IpeDyokNO+D5spo0w1jepWWY2Q6y5ZKNuj5EhVQXjtVAeDDqvW6Yg7dhclbsz6rTtOvcwpHg==",
"dev": true,
"dependencies": {
"@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/utils": "6.4.1",
"@typescript-eslint/typescript-estree": "6.6.0",
"@typescript-eslint/utils": "6.6.0",
"debug": "^4.3.4",
"ts-api-utils": "^1.0.1"
},
@ -1109,9 +1109,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz",
"integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==",
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.6.0.tgz",
"integrity": "sha512-CB6QpJQ6BAHlJXdwUmiaXDBmTqIE2bzGTDLADgvqtHWuhfNP3rAOK7kAgRMAET5rDRr9Utt+qAzRBdu3AhR3sg==",
"dev": true,
"engines": {
"node": "^16.0.0 || >=18.0.0"
@ -1122,13 +1122,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz",
"integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==",
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.6.0.tgz",
"integrity": "sha512-hMcTQ6Al8MP2E6JKBAaSxSVw5bDhdmbCEhGW/V8QXkb9oNsFkA4SBuOMYVPxD3jbtQ4R/vSODBsr76R6fP3tbA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.1",
"@typescript-eslint/types": "6.6.0",
"@typescript-eslint/visitor-keys": "6.6.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@ -1149,17 +1149,17 @@
}
},
"node_modules/@typescript-eslint/utils": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz",
"integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==",
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.6.0.tgz",
"integrity": "sha512-mPHFoNa2bPIWWglWYdR0QfY9GN0CfvvXX1Sv6DlSTive3jlMTUy+an67//Gysc+0Me9pjitrq0LJp0nGtLgftw==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/types": "6.4.1",
"@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/scope-manager": "6.6.0",
"@typescript-eslint/types": "6.6.0",
"@typescript-eslint/typescript-estree": "6.6.0",
"semver": "^7.5.4"
},
"engines": {
@ -1174,12 +1174,12 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz",
"integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==",
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.6.0.tgz",
"integrity": "sha512-L61uJT26cMOfFQ+lMZKoJNbAEckLe539VhTxiGHrWl5XSKQgA0RTBZJW2HFPy5T0ZvPVSD93QsrTKDkfNwJGyQ==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "6.4.1",
"@typescript-eslint/types": "6.6.0",
"eslint-visitor-keys": "^3.4.1"
},
"engines": {
@ -1206,14 +1206,14 @@
}
},
"node_modules/@vscode/vsce": {
"version": "2.20.1",
"resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.20.1.tgz",
"integrity": "sha512-ilbvoqvR/1/zseRPBAzYR6aKqSJ+jvda4/BqIwOqTxajpvLtEpK3kMLs77+dJdrlygS+VrP7Yhad8j0ukyD96g==",
"version": "2.21.0",
"resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.21.0.tgz",
"integrity": "sha512-KuxYqScqUY/duJbkj9eE2tN2X/WJoGAy54hHtxT3ZBkM6IzrOg7H7CXGUPBxNlmqku2w/cAjOUSrgIHlzz0mbA==",
"dependencies": {
"azure-devops-node-api": "^11.0.1",
"chalk": "^2.4.2",
"cheerio": "^1.0.0-rc.9",
"commander": "^6.1.0",
"commander": "^6.2.1",
"glob": "^7.0.6",
"hosted-git-info": "^4.0.2",
"jsonc-parser": "^3.2.0",
@ -3027,9 +3027,9 @@
"optional": true
},
"node_modules/glob": {
"version": "10.3.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz",
"integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==",
"version": "10.3.4",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.4.tgz",
"integrity": "sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==",
"dev": true,
"dependencies": {
"foreground-child": "^3.1.0",
@ -4462,9 +4462,9 @@
}
},
"node_modules/postcss": {
"version": "8.4.28",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz",
"integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==",
"version": "8.4.29",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz",
"integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==",
"dev": true,
"funding": [
{
@ -5888,9 +5888,9 @@
}
},
"node_modules/svelte-check": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.5.0.tgz",
"integrity": "sha512-KHujbn4k17xKYLmtCwv0sKKM7uiHTYcQvXnvrCcNU6a7hcszh99zFTIoiu/Sp/ewAw5aJmillJ1Cs8gKLmcX4A==",
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.5.1.tgz",
"integrity": "sha512-+Zb4iHxAhdUtcUg/WJPRjlS1RJalIsWAe9Mz6G1zyznSs7dDkT7VUBdXc3q7Iwg49O/VrZgyJRvOJkjuBfKjFA==",
"dev": true,
"dependencies": {
"@jridgewell/trace-mapping": "^0.3.17",

View File

@ -88,25 +88,25 @@
"@types/mocha": "^10.0.1",
"@types/node": "20.x",
"@types/vscode": "^1.81.0",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@vscode/test-electron": "^2.3.4",
"concurrently": "^8.2.1",
"esbuild": "^0.19.2",
"eslint": "^8.48.0",
"glob": "^10.3.3",
"glob": "^10.3.4",
"mocha": "^10.2.0",
"postcss": "^8.4.28",
"postcss": "^8.4.29",
"rollup-plugin-css-only": "^4.3.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-svelte": "^7.1.6",
"svelte": "^4.2.0",
"svelte-check": "^3.5.0",
"svelte-check": "^3.5.1",
"svelte-preprocess": "^5.0.4",
"typescript": "^5.2.2"
},
"dependencies": {
"@vscode/vsce": "^2.20.1",
"@vscode/vsce": "^2.21.0",
"axios": "^1.5.0",
"fs-extra": "^11.1.1",
"tree-kill": "^1.2.2"

3
sandbox/.dockerignore Normal file
View File

@ -0,0 +1,3 @@
node_modules
build
.env

2
sandbox/.env.example Normal file
View File

@ -0,0 +1,2 @@
ADMIN_URL="http://localhost:5173"
REPO_URL="http://localhost:7006"

View File

@ -3,6 +3,6 @@ services:
sandbox:
build: .
environment:
- ADMIN_URL=http://localhost:5173
- REPO_URL=http://localhost:7006
- ADMIN_URL=${ADMIN_URL}
- REPO_URL=${REPO_URL}
network_mode: 'host'

View File

@ -6,7 +6,13 @@ RUN apt-get update
RUN apt-get install curl -y
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
ENV NODE_MAJOR=20
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update
RUN apt-get install nodejs -y
RUN apt-get install git -y

View File

@ -14,13 +14,36 @@
<a href="/admin/contests/create" class="btn btn-outline-success">Create</a>
</div>
<div class="mt-3 list-group">
{#each data.contests as contest}
<a
href={'/admin/contests/' + contest.id.toString()}
class={`list-group-item list-group-item-action ${
contest.activeTeams === 0 ? '' : ' list-group-item-success'
}`}>{contest.name}</a
>
{/each}
<div class="mt-3 table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{#each data.contests as contest}
<tr>
<td>{contest.id}</td>
<td>{contest.name}</td>
<td>
{#if contest.activeTeams === 0}
<span class="badge bg-secondary">Inactive</span>
{:else}
<span class="badge bg-success">Active</span>
{/if}
</td>
<td
><a
href={`/admin/contests/${contest.id.toString()}`}
class="btn btn-sm btn-outline-secondary">Details</a
></td
>
</tr>
{/each}
</tbody>
</table>
</div>

View File

@ -11,12 +11,12 @@
</script>
<svelte:head>
<title>{data.name}</title>
<title>Contest - {data.name}</title>
</svelte:head>
<ConfirmModal bind:this={confirmModal} />
<h1 style="text-align:center" class="mb-4">{data.name}</h1>
<h1 style="text-align:center" class="mb-4"><i class="bi bi-flag"></i> Contest - {data.name}</h1>
<FormAlert />

View File

@ -4,8 +4,12 @@
export let data: PageData;
</script>
<svelte:head>
<title>Printable Logins</title>
</svelte:head>
{#each data.teams as team}
<table class="table table-bordered table-striped">
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>

View File

@ -44,8 +44,6 @@
<FormAlert />
<a href="/admin/contests" class="mb-3 btn btn-outline-secondary">Cancel</a>
<form method="POST" action="?/create" use:enhance>
<h4>Name</h4>
<input name="name" class="form-control" />
@ -106,9 +104,8 @@
{/each}
</div>
</div>
<div class="row">
<div class="text-end">
<button type="submit" class="btn btn-success">Create</button>
</div>
<div class="d-flex flex-row justify-content-end gap-2">
<a href="/admin/contests" class="btn btn-outline-secondary">Cancel</a>
<button type="submit" class="btn btn-success">Create</button>
</div>
</form>

View File

@ -19,11 +19,29 @@
{#if data.problems.length === 0}
<div class="alert alert-warning">No problems</div>
{/if}
<div class="list-group">
{#each data.problems as problem}
<a
href={'/admin/problems/' + problem.id.toString()}
class="list-group-item list-group-item-action">{problem.friendlyName}</a
>
{/each}
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{#each data.problems as problem}
<tr>
<td>{problem.id}</td>
<td>{problem.friendlyName}</td>
<td
><a
href={`/admin/problems/${problem.id.toString()}`}
class="btn btn-sm btn-outline-secondary">Details</a
></td
>
</tr>
{/each}
</tbody>
</table>
</div>

View File

@ -28,6 +28,10 @@
let confirmModal: ConfirmModal;
</script>
<svelte:head>
<title>Problem - {data.problemData.friendlyName}</title>
</svelte:head>
<ConfirmModal bind:this={confirmModal} />
<h1 style="text-align:center" class="mb-1">

View File

@ -12,7 +12,6 @@ export const load = (async () => {
id: row.id,
createdAt: row.createdAt,
gradedAt: row.gradedAt,
message: row.message,
state: row.state,
problemName: problems.find((problem) => {
return problem.id == row.problemId;

View File

@ -1,6 +1,6 @@
<script lang="ts">
import type { PageData } from './$types';
import { goto, invalidateAll } from '$app/navigation';
import { invalidateAll } from '$app/navigation';
import { onDestroy, onMount } from 'svelte';
export let data: PageData;
@ -33,72 +33,69 @@
<h1 style="text-align:center" class="mb-4"><i class="bi bi-envelope-paper"></i> Submissions</h1>
<div class="row">
<div class="col-8">
<p>Rows are color coded: Red - Incorrect, Green - Correct, Yellow - In Review</p>
</div>
<div class="col-4 text-end">
{#if updating}
<div class="spinner-border spinner-border-sm text-secondary" />
{/if}
<strong>Last Updated: </strong>{data.timestamp.toLocaleTimeString()}
</div>
<div class="d-flex flex-row justify-content-end gap-2 align-items-center">
{#if updating}
<div class="spinner-border spinner-border-sm text-secondary" />
{/if}
<strong>Last Updated: </strong>{data.timestamp.toLocaleTimeString()}
</div>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Team</th>
<th>Problem</th>
<th>Submit Time</th>
<th>Graded Time</th>
<th>Message</th>
</tr>
</thead>
<tbody>
{#each data.submissions as submission}
<tr
on:click={() => {
goto('/admin/submissions/' + submission.id.toString());
}}
class={(submission.state == 'InReview'
? 'table-warning'
: submission.state == 'Correct'
? 'table-success'
: submission.state == 'Incorrect'
? 'table-danger'
: '') + ' submission-row'}
>
<td>
{#if submission.teamName}
{submission.teamName}
{/if}
</td>
<td>
{#if submission.problemName}
{submission.problemName}
{/if}
</td>
<td
>{submission.createdAt.toLocaleDateString() +
' ' +
submission.createdAt.toLocaleTimeString()}</td
>
<td>
{#if submission.gradedAt}
{submission.gradedAt.toLocaleDateString() +
' ' +
submission.gradedAt.toLocaleTimeString()}
{/if}
</td>
<td>{submission.message ? submission.message : ''}</td>
<div class="mt-3 table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Team</th>
<th>Problem</th>
<th>State</th>
<th>Submit Time</th>
<th>Graded Time</th>
<th>Actions</th>
</tr>
{/each}
</tbody>
</table>
<style>
.submission-row:hover {
cursor: pointer;
}
</style>
</thead>
<tbody>
{#each data.submissions as submission}
<tr>
<td>
{#if submission.teamName}
{submission.teamName}
{/if}
</td>
<td>
{#if submission.problemName}
{submission.problemName}
{/if}
</td>
<td>
{#if submission.state === 'Queued'}
<span class="badge bg-secondary">Queued</span>
{:else if submission.state === 'InReview'}
<span class="badge bg-warning">In Review</span>
{:else if submission.state === 'Correct'}
<span class="badge bg-success">Correct</span>
{:else if submission.state === 'Incorrect'}
<span class="badge bg-danger">Incorrect</span>
{/if}
</td>
<td
>{submission.createdAt.toLocaleDateString() +
' ' +
submission.createdAt.toLocaleTimeString()}</td
>
<td>
{#if submission.gradedAt}
{submission.gradedAt.toLocaleDateString() +
' ' +
submission.gradedAt.toLocaleTimeString()}
{/if}
</td>
<td>
<a
href={`/admin/submissions/${submission.id.toString()}`}
class="btn btn-sm btn-outline-secondary">Details</a
>
</td>
</tr>
{/each}
</tbody>
</table>
</div>

View File

@ -31,12 +31,14 @@
</script>
<svelte:head>
<title>Submission</title>
<title>Submission - {data.teamName} - {data.problemName}</title>
</svelte:head>
<ConfirmModal bind:this={confirmModal} />
<h1 style="text-align:center" class="mb-4">Submission</h1>
<h1 style="text-align:center" class="mb-4">
<i class="bi bi-envelope-paper"></i> Submission - {data.teamName} - {data.problemName}
</h1>
{#if form && !form.success}
<div class="alert alert-danger">Error</div>
@ -64,46 +66,52 @@
</div>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th>Team</th>
<th>Problem</th>
<th>Submit Time</th>
<th>Graded Time</th>
<th>Message</th>
</tr>
</thead>
<tbody>
<tr
class={(data.state == 'InReview'
? 'table-warning'
: data.state == 'Correct'
? 'table-success'
: data.state == 'Incorrect'
? 'table-danger'
: '') + ' submission-row'}
>
<td>
{#if data.teamName}
{data.teamName}
{/if}
</td>
<td>
{#if data.problemName}
{data.problemName}
{/if}
</td>
<td>{data.submitTime.toLocaleDateString() + ' ' + data.submitTime.toLocaleTimeString()}</td>
<td>
{#if data.gradedTime}
{data.gradedTime.toLocaleDateString() + ' ' + data.gradedTime.toLocaleTimeString()}
{/if}
</td>
<td>{data.message ? data.message : ''}</td>
</tr>
</tbody>
</table>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Team</th>
<th>Problem</th>
<th>Status</th>
<th>Submit Time</th>
<th>Graded Time</th>
<th>Message</th>
</tr>
</thead>
<tbody>
<tr>
<td>
{#if data.teamName}
{data.teamName}
{/if}
</td>
<td>
{#if data.problemName}
{data.problemName}
{/if}
</td>
<td>
{#if data.state === 'Queued'}
<span class="badge bg-secondary">Queued</span>
{:else if data.state === 'InReview'}
<span class="badge bg-warning">In Review</span>
{:else if data.state === 'Correct'}
<span class="badge bg-success">Correct</span>
{:else if data.state === 'Incorrect'}
<span class="badge bg-danger">Incorrect</span>
{/if}
</td>
<td>{data.submitTime.toLocaleDateString() + ' ' + data.submitTime.toLocaleTimeString()}</td>
<td>
{#if data.gradedTime}
{data.gradedTime.toLocaleDateString() + ' ' + data.gradedTime.toLocaleTimeString()}
{/if}
</td>
<td>{data.message ? data.message : ''}</td>
</tr>
</tbody>
</table>
</div>
{#if data.state == 'InReview'}
<div class="row">

View File

@ -55,10 +55,27 @@
</form>
{/if}
<div class="list-group">
{#each data.teams as team}
<a href={'/admin/teams/' + team.id.toString()} class="list-group-item list-group-item-action">
{team.name}
</a>
{/each}
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{#each data.teams as team}
<tr>
<td>{team.id}</td>
<td>{team.name}</td>
<td
><a href={`/admin/teams/${team.id.toString()}`} class="btn btn-sm btn-outline-secondary"
>Details</a
></td
>
</tr>
{/each}
</tbody>
</table>
</div>

View File

@ -22,12 +22,12 @@
</script>
<svelte:head>
<title>Team</title>
<title>Team - {data.team.name}</title>
</svelte:head>
<ConfirmModal bind:this={confirmModal} />
<h1 style="text-align:center" class="mb-4">{data.team.name}</h1>
<h1 style="text-align:center" class="mb-4"><i class="bi bi-people"></i> Team - {data.team.name}</h1>
<div class="row">
<div class="col-6">
@ -51,7 +51,7 @@
</div>
</div>
<table class="table table-bordered table-striped">
<table class="table table-bordered">
<thead>
<tr>
<th>Name</th>