hide answer form if no question live

main
Bel LaPointe 2024-02-20 15:09:56 -07:00
parent 307e11d4c7
commit d4da09dc5a
1 changed files with 8 additions and 8 deletions

View File

@ -7,9 +7,10 @@
body {
font-size: 1.25rem;
}
:not(#answers-list[hidden]) + #question,
:not(#answers-list[hidden]) + #question + #answer-form,
:not(#question-options:empty) + #answers-freeform
:not(#answers-list[hidden]) + #question-text,
:not(#answers-list[hidden]) + #question-text + #answer-form,
:not(#question-options:empty) + #answers-freeform,
#question-text:empty + #answer-form
{
display: none;
}
@ -17,9 +18,7 @@
</header>
<body>
<div id="answers-list"></div>
<div id="question">
<h1><span id="question-text"></span></h1>
</div>
<div id="question-text"></div>
<form id="answer-form" action="#" onsubmit="submitAnswersForm(this); return false;">
<div id="question-options"></div>
<input id="answers-freeform" type="text" hidden/>
@ -55,8 +54,9 @@
<label for="${i}">${i}</label>
</div>`
options = `<fieldset>${options}</fieldset>`;
if (document.getElementById("question-text").innerHTML != g_live_question.Text) {
document.getElementById("question-text").innerHTML = g_live_question.Text;
if (document.getElementById("question-text").value != g_live_question.Text) {
document.getElementById("question-text").innerHTML = `<h1>${g_live_question.Text}</h1>`;
document.getElementById("question-text").value = g_live_question.Text;
document.getElementById("question-options").innerHTML = options;
}
} else {