diff --git a/src/routes/dashboard/(draft)/ranks/+page.server.js b/src/routes/dashboard/(draft)/ranks/+page.server.js index 36584e3..6c34b42 100644 --- a/src/routes/dashboard/(draft)/ranks/+page.server.js +++ b/src/routes/dashboard/(draft)/ranks/+page.server.js @@ -23,7 +23,7 @@ export const actions = { const maxRounds = await db.getMaxRoundInDraft(draft); if (maxRounds === null) error(404); - if (labs.length !== maxRounds) error(400); + if (labs.length > maxRounds) error(400); if (await db.insertStudentRanking(draft, user.email, labs)) return; return fail(403); diff --git a/src/routes/dashboard/(draft)/ranks/SubmitRankings.svelte b/src/routes/dashboard/(draft)/ranks/SubmitRankings.svelte index d7eb763..662824a 100644 --- a/src/routes/dashboard/(draft)/ranks/SubmitRankings.svelte +++ b/src/routes/dashboard/(draft)/ranks/SubmitRankings.svelte @@ -70,7 +70,11 @@
{ + use:enhance={({ submitter, cancel }) => { + if (!confirm(`Are you sure you want to select ${selectedLabs.length} labs?`)) { + cancel(); + return; + } assert(submitter !== null); assert(submitter instanceof HTMLButtonElement); submitter.disabled = true; @@ -106,9 +110,7 @@ You may no longer select any more labs. {/if}

- +
{#each selectedLabs as { lab_id, lab_name }, idx (lab_id)}