summaryrefslogtreecommitdiff
path: root/static
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
parent14a4d586b7c7abc86674724153757f15faf7262c (diff)
problem statement on submission page and submission logic tweaks
Diffstat (limited to 'static')
-rw-r--r--static/submit.html7
-rw-r--r--static/submit.js16
2 files changed, 19 insertions, 4 deletions
diff --git a/static/submit.html b/static/submit.html
index 393b2e2..9cab87b 100644
--- a/static/submit.html
+++ b/static/submit.html
@@ -37,12 +37,13 @@
<option value="other">Other (specify below)</option>
</select>
<br><br>
- <p>If your code requires any special instructions or additional details, provide them below. Languages not listed above can be specified here too. If you would like a language added to the list above, reach out to Daniel.</p><br>
- <label for="submission-details">Additional Details</label><br>
- <textarea id="submission-details" rows="4" cols="87"></textarea><br><br>
<label for="submission-code">Code</label><br>
<textarea id="submission-code" rows="16" cols="87"></textarea>
<br><br>
+ <p>If your code requires any special instructions or additional details, provide them below. Languages not listed above can be specified here too. If you would like a language added to the list above, reach out to Daniel.</p><br>
+ <label for="submission-details">Additional Details</label><br>
+ <textarea id="submission-details" rows="4" cols="87"></textarea>
+ <br><br>
<button id="submission-button" onclick="submit()">Submit</button>
<br><br>
</div>
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);
}