Implement switching to next question

This commit is contained in:
Vojtěch Káně
2021-02-06 21:17:31 +01:00
parent de49bcd4b5
commit fdc080a250
7 changed files with 130 additions and 13 deletions

View File

@@ -45,10 +45,7 @@
document.addEventListener("DOMContentLoaded", () => {
const next = document.querySelector('#controls .next');
next.addEventListener("click", () => {
let url = window.location.path + '/rpc/next';
if (questionSection.dataset.id) {
url += '?current=' + encodeURIComponent(questionSection.dataset.id);
}
let url = window.location.pathname + '/rpc/next';
fetch(url, {method: "POST"})
.catch(() => {
console.warn("Setting next question failed")