From 51fac3f3b6f73b649ba8109b37d8ff311b905cd4 Mon Sep 17 00:00:00 2001 From: Daniel Hader Date: Tue, 2 Jun 2026 20:37:40 -0500 Subject: problem statement on submission page and submission logic tweaks --- static/submit.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'static/submit.js') diff --git a/static/submit.js b/static/submit.js index 03dfd69..9708e0c 100644 --- a/static/submit.js +++ b/static/submit.js @@ -25,6 +25,20 @@ async function submit() { console.log(result); } -function init() { +async function init() { + const url_params = new URLSearchParams(window.location.search); + const problem_id = url_params.get("problem_id"); + const response = await fetch(`/problem/${problem_id}`); + const problem = await response.json(); + + const problem_div = document.getElementById("submission-problem"); + + const title = document.createElement("h2"); + title.innerHTML = `Problem: ${problem.title}`; + problem_div.appendChild(title); + + const description = document.createElement("p"); + description.innerHTML = problem.description; + problem_div.appendChild(description); } -- cgit v1.2.3