summaryrefslogtreecommitdiff
path: root/components/index.html
diff options
context:
space:
mode:
authorGrail Finder (aider) <wohilas@gmail.com>2025-04-05 16:52:02 +0300
committerGrail Finder (aider) <wohilas@gmail.com>2025-04-05 16:52:02 +0300
commitb5f3dd055ecc25120df65f6655808d8a8897f1a3 (patch)
tree797efcf2bd68d93272f287ee77ad04bba11b1a64 /components/index.html
parent3374cb0fb2ce024eb5da78dc63c7313db8ec4c95 (diff)
feat: extract feedback into template partial and add Correct field
Diffstat (limited to 'components/index.html')
-rw-r--r--components/index.html10
1 files changed, 3 insertions, 7 deletions
diff --git a/components/index.html b/components/index.html
index f0f18f0..9c43a50 100644
--- a/components/index.html
+++ b/components/index.html
@@ -13,13 +13,8 @@
<div class="question-text" data-testid="question">
{{.Text}}
</div>
- <div id="feedback" data-testid="feedback" class="{{if .Correct}}correct-feedback{{else}}error-feedback{{end}}">
- {{if .Correct}}
- <div class="correct-answer">Correct!</div>
- {{else}}
- <div class="wrong-answer">Try Again</div>
- {{end}}
- <div class="explanation">{{.Explanation}}</div>
+ <div id="feedback" data-testid="feedback">
+ {{template "feedback" .}}
{{if .ShowNext}}
<button
hx-get="/next-question?current_id={{.ID}}"
@@ -31,6 +26,7 @@
</button>
{{end}}
</div>
+ {{template "feedback" .}}
<div id="options">
<button
data-testid="option1"