diff --git a/brythonRunner/javascript/palindrome.js b/brythonRunner/javascript/palindrome.js index a46544fe..3751b973 100644 --- a/brythonRunner/javascript/palindrome.js +++ b/brythonRunner/javascript/palindrome.js @@ -65,13 +65,20 @@ function exec(code, id) { const runner = new BrythonRunner({ stdout: { write(content) { - retour.textContent = content; - }, + if (id == "code"){ + retourCode = content; + } + if (id == "solution"){ + retourSolution = content; + } + }, flush() {} }, stderr: { write(content) { - retour.textContent = "ERROR"; + if (id == "solution"){ + retourSolution = "ERROR"; + } terminal.innerHTML += content; terminal.scrollTop = terminal.scrollHeight; }, @@ -93,8 +100,9 @@ function exec(code, id) { //~ Function that check if the code in the editor as the same result as the solution. function check(){ - const retourCode = document.getElementById("code").textContent; - const retourSolution = document.getElementById("solution").textContent; + console.log(retourSolution) + console.log(retourCode) + console.log(retourSolution == retourCode) if (retourSolution == "ERROR") { result.innerHTML = "Il semblerait qu'il y a une erreur dans ton code :/"; result.classList.remove('hidden'); diff --git a/brythonRunner/page/palindrome.html b/brythonRunner/page/palindrome.html index 40df6921..176bdf47 100644 --- a/brythonRunner/page/palindrome.html +++ b/brythonRunner/page/palindrome.html @@ -32,9 +32,6 @@ -
code
-solution
-