// Copyright John Salguero All rights Reserved //const socket = new WebSocket("ws://localhost:8000/ws"); const socket = new WebSocket("ws://10.0.0.50:8000/ws"); let problemData = null; let stepIndex = 0; socket.onopen = () => { console.log("Connected to server"); socket.send(JSON.stringify({ type: "query_problem" })); }; socket.onmessage = (event) => { const msg = JSON.parse(event.data); console.log("Received problem:", msg); if (msg.type === "generated_problem") { problemData = msg.data; stepIndex = 0; showProblem(); startTimer(msg.time); // Debug show problem timing //startTimer(1); } }; function requestNextProblem() { socket.send(JSON.stringify({ type: "query_problem" })); }