summaryrefslogtreecommitdiff
path: root/static/submit.js
diff options
context:
space:
mode:
authorDaniel Hader <[email protected]>2026-06-02 20:37:40 -0500
committerDaniel Hader <[email protected]>2026-06-02 20:37:40 -0500
commit51fac3f3b6f73b649ba8109b37d8ff311b905cd4 (patch)
tree4a2eb771842bf65ccb6e95c6c1d59ef65cbd2a7d /static/submit.js
parent14a4d586b7c7abc86674724153757f15faf7262c (diff)
problem statement on submission page and submission logic tweaks
Diffstat (limited to 'static/submit.js')
-rw-r--r--static/submit.js16
1 files changed, 15 insertions, 1 deletions
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);
}