diff options
Diffstat (limited to 'static')
| -rw-r--r-- | static/submit.html | 7 | ||||
| -rw-r--r-- | static/submit.js | 16 |
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); } |
