diff options
Diffstat (limited to 'questions')
-rw-r--r-- | questions/public/script.js | 4 | ||||
-rw-r--r-- | questions/public/style.css | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/questions/public/script.js b/questions/public/script.js index 2a04a02..a545a0d 100644 --- a/questions/public/script.js +++ b/questions/public/script.js @@ -23,13 +23,11 @@ fetch(`api/question/${qid}`) question_label.innerText = response["question"]; question_input.setAttribute("value", response["id"]); const div = document.getElementsByClassName("answer-buttons")[0]; - const prop = 100 / response.options.length; for (const option of response.options) { const btn = document.createElement("btn"); btn.classList.add("pure-button", "pure-button-primary", "answer-btn"); btn.dataset.value = `${option.id}`; btn.textContent = option.answer_option; - btn.style.width = `${prop}%`; div.append(btn); } addListeners(); @@ -88,4 +86,4 @@ function addListeners() { const res = await resp.json(); if (res.success) getNext(qid + 1); }); -}
\ No newline at end of file +} diff --git a/questions/public/style.css b/questions/public/style.css index 4c395e9..12b4721 100644 --- a/questions/public/style.css +++ b/questions/public/style.css @@ -63,9 +63,14 @@ div.bar div[data-current="true"] { background: #0078e7; } -.back-skip, .answer-buttons { +.back-skip, +.answer-buttons { display: flex; - flex-wrap: nowrap; + flex-wrap: wrap; +} + +.answer-btn { + width: 100%; } .back-skip button { |