{{ block "main" . }}{{ end }} diff --git a/layouts/test/single.html b/layouts/test/single.html index 849a158..8a76af1 100644 --- a/layouts/test/single.html +++ b/layouts/test/single.html @@ -2,345 +2,446 @@ {{ $title := .Title }} {{ $build := .Site.Params.build | default "development" }} - - + {{ if eq $build "development" }} - - -
-
-
- -
-

{{ $title }}

-

{{ .Content | default "Please answer the questions below to complete the test." }}

+
+
+
+

{{ $title }}

+

{{ .Content | default "Please answer the questions below to complete the test." }}

+
+ +
+
+ + + {{/* Embed quiz data as JSON for the local dev evaluator */}} + {{ if hugo.IsServer }} + + {{ end }} + + {{ range $index, $question := .Params.questions }} +
+
Question {{ add $index 1 }}
+
{{ $question.text }}
+ + {{ if $question.instructions }} +
{{ $question.instructions }}
+ {{ else }} + {{ if eq $question.type "multiple-answers" }} +
Select all that apply
+ {{ else if eq $question.type "single-answer" }} +
Select one answer
+ {{ else if eq $question.type "short-answer" }} +
Type your answer below
+ {{ end }} + {{ end }} + + {{ if or (eq $question.type "single-answer") (eq $question.type "multiple-answers") }} + {{ range $optIndex, $option := $question.options }} +
+ +
+ {{ end }} + {{ else if eq $question.type "short-answer" }} + + {{ end }} +
+ {{ end }} +
+
+
+{{ if hugo.IsServer }} +{{/* DEV MODE: Inject local JS evaluator — not used in production */}} +{{ $evaluator := resources.Get "js/local-quiz-evaluator.js" }} +{{ if $evaluator }} + +{{ end }} + +{{ end }} {{ else }}
-
-
-

Preparing your test...

+
+

Preparing your test...

{{ end }} @@ -349,40 +450,33 @@

{{ $title }}

{{ $tesAbsPath := .RelPermalink }} -{{ end }} +{{ end }} \ No newline at end of file