Converted to a Go app

This commit is contained in:
Leon Mika 2025-06-19 14:14:46 +02:00
parent 543c1790de
commit d4b3322077
28 changed files with 302 additions and 1 deletions

3
views/end.html Normal file
View file

@ -0,0 +1,3 @@
<h1>Well Done</h1>
<p>You reached the end</p>

5
views/index.html Normal file
View file

@ -0,0 +1,5 @@
<h1>Welcome</h1>
<p>Welcome to the quiz</p>
<a href="{{prefix}}/1">Lets go</a>

14
views/layout.html Normal file
View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
<link rel="stylesheet" href="{{prefix}}/assets/style.css">
<link rel="stylesheet" href="{{prefix}}/assets/fontello/css/fontello.css">
</head>
<body>
{{embed}}
</body>
</html>

31
views/question.html Normal file
View file

@ -0,0 +1,31 @@
<div class="offscreen">
<i class="icon-cancel"></i>
<i class="icon-ok"></i>
</div>
<div class="question" data-controller="picker" data-picker-answer-value="{{.q.RightChoice}}">
<p>{{.q.Question}}</p>
{{range .q.Choices}}
<label>
<input type="radio" name="ans" value="{{.ID}}" data-picker-target="radio">
{{if eq .ID $.q.RightChoice}}
<i class="icon-ok"></i>
{{else}}
<i class="icon-cancel"></i>
{{end}}
{{.Text}}
</label>
{{end}}
<button data-action="picker#submitAnswer">Submit</button>
<div data-picker-target="answerDetails" class="hidden">
<p>{{.q.Fact}}</p>
<div>
<a href="{{.nextURL}}">Next</a>
</div>
</div>
</div>
<script src="{{prefix}}/assets/scripts/main.js" type="module"></script>