From f5bd9f27ceed0915d72105d3423d59ad54e6583a Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:26:52 -0700 Subject: [PATCH] workin on drawing --- cmd/server/internal/public/index.html | 26 ++++++++++++++++++++++++-- cmd/server/main.go | 20 +++++++++++++++++--- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/cmd/server/internal/public/index.html b/cmd/server/internal/public/index.html index c797860..494035e 100644 --- a/cmd/server/internal/public/index.html +++ b/cmd/server/internal/public/index.html @@ -23,8 +23,10 @@ function pollState() { http("GET", "/api/v1/questions", (body) => { + if (!body) + return; g_questions = JSON.parse(body); - console.log("polled state:", body); + console.log("TODO polled state:", body); pollLiveAnswer(); pollLiveQuestion(); }); @@ -35,12 +37,28 @@ if (live_questions) { g_live_question = live_questions[0]; } + if (g_live_question) { + document.getElementById("question-text").innerHTML = g_live_question.Text; + let options = ""; + for (let i of g_live_question.Options) + options += `