File tree Expand file tree Collapse file tree 3 files changed +447
-172
lines changed Expand file tree Collapse file tree 3 files changed +447
-172
lines changed Original file line number Diff line number Diff line change 1+ {{- $p := .Params -}}
2+ {{- $prerequisites := partial "test/collect-prerequisites.html" . -}}
3+ {{- $ctx := partial "resolve-tenant.html" . -}}
4+ {{- $orgId := $ctx.uuid -}}
5+
6+ {{- $total := 0 -}}
7+ {{- range $p.questions }}
8+ {{- $total = add $total (or .marks 0) }}
9+ {{- end }}
10+
11+ {{- $parent := (cond (ne .Parent nil) (dict
12+ "id" (partial "id.html" .Parent)
13+ "title" .Parent.Title
14+ "relPermalink" .Parent.RelPermalink
15+ "type" .Parent.Type
16+ ) nil) -}}
17+
18+ {{- return (dict
19+ "id" (partial "id.html" .)
20+ "title" .Title
21+ "org_id" $orgId
22+ "final" (partial "test/is-final.html" .)
23+ "description" (.Content | safeHTML)
24+ "slug" .Slug
25+ "relPermalink" .RelPermalink
26+ "permalink" .Permalink
27+ "type" .Type
28+ "section" .Section
29+ "layout" .Layout
30+ "date" (.Date | time.Format "2006-01-02")
31+ "lastmod" (.Lastmod | time.Format "2006-01-02")
32+ "draft" .Draft
33+ "file_path" .File.Path
34+ "pass_percentage" (or $p.pass_percentage 70)
35+ "time_limit" (or $p.time_limit "infinite")
36+ "questions" $p.questions
37+ "total_questions" (len $p.questions)
38+ "prerequisites" $prerequisites
39+ "total_marks" $total
40+ "parent" $parent
41+ ) -}}
You can’t perform that action at this time.
0 commit comments