{{ if .Record.Title }}{{.Record.Title}}{{ else }}答题详情{{ end }}

{{ if .User.Name }}{{.User.Name}}{{ else }}{{.User.Username}}{{ end }} 的答题记录

答题时间

{{.Record.CreatedAt}}

得分

{{.Record.Score}}

正确率

{{.Record.CorrectCount}}/{{.Record.TotalCount}} 题

{{ range $index, $q := .Questions }}
{{ add $index 1 }}
{{ if eq $q.Type "mcq" }}选择题{{ end }} {{ if eq $q.Type "fill" }}填空题{{ end }} {{ if eq $q.Type "sa" }}简答题{{ end }} {{ if eq $q.Type "algo" }}算法题{{ end }} {{ if $q.Difficulty }} {{ $q.Difficulty }} {{ end }} {{ if $q.Category }}{{$q.Category}}{{ end }}
{{ if index $.Correct $index }}回答正确{{ else }}回答错误{{ end }}

{{ $q.Text }}

{{ if $q.Options }}
{{ range $optIndex, $opt := $q.Options }} {{ $letter := printf "%c" (index "ABCDE" $optIndex) }} {{ $isCorrect := eq $letter $q.Answer }} {{ $userAnswer := index $.UserAnswers $index }} {{ $isUserAns := eq $letter $userAnswer }}
{{ $letter }} {{ $opt }} {{ if $isCorrect }}{{ end }} {{ if and $isUserAns (not $isCorrect) }}{{ end }}
{{ end }}
{{ end }}
正确答案: {{ $q.Answer }}
{{ with index $.UserAnswers $index }}
你的答案: {{ . }}
{{ end }}
{{ if $q.Analysis }}
答案解析
{{ $q.Analysis }}
{{ end }}
{{ end }}