very bad thing

This commit is contained in:
2025-07-01 19:29:38 +02:00
parent ee0b1731e8
commit e566f14cd8
4 changed files with 133 additions and 104 deletions

25
html/monscript.js Normal file
View File

@@ -0,0 +1,25 @@
document.getElementById("");
// src="data:audio/ogg;base64,BASE64CODE"
function updateAudios(response) {
document.getElementById("one").src = "data:audio/ogg;base64," + response.dataOne;
document.getElementById("two").src = "data:audio/ogg;base64," + response.dataTwo;
document.getElementById("three").src = "data:audio/ogg;base64," + response.dataThree;
document.getElementById("four").src = "data:audio/ogg;base64," + response.dataFour;
document.getElementById("answer").innerText = "Réponse : " + response.answer;
const select = document.createElement("select");
response.answers.forEach(element => {
const option = document.createElement("option");
option.innerText = element;
select.append(option);
});
document.getElementById("content").append(select);
}
fetch("/newchallenge", {
method: "POST",
})
.then((response) => response.json())
.then((json) => updateAudios(json));