Files
RuvdsTest/src/Client/Features/Quizzes/ViewResult/View.fs
danamir 942dfc9c1a Initial commit: standalone quiz-testing system
Full-stack F# (Domain/Server/Client via Fable+Elmish+Feliz), PostgreSQL
persistence via Dapper, Docker Compose deployment. Student quiz-taking flow
with time-limit enforcement and focus-loss tracking, Teacher question bank
and quiz builder with results analytics, Admin user management.
2026-08-06 12:36:16 +03:00

25 lines
1.0 KiB
Forth
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module Client.Features.Quizzes.ViewResult.View
open Feliz
open Domain.Contracts
open Client.Shared
/// Small enough that it doesn't need its own Types/State it only ever
/// dispatches the parent's "go back to the quiz list" message.
let view (result: AttemptResult) (onBackToQuizList: unit -> unit) =
Html.div [
prop.className "result-page"
prop.children [
Html.h2 "Результат"
match result.Passed with
| Some true -> Html.div [ prop.className "grade-stamp passed"; prop.text "Тест пройден" ]
| Some false -> Html.div [ prop.className "grade-stamp failed"; prop.text "Тест не пройден" ]
| None -> Html.none
Html.span [
prop.className "score-value"
prop.text (sprintf "%s / %s" (Format.points result.Score) (Format.points result.MaxScore))
]
Html.button [ prop.onClick (fun _ -> onBackToQuizList ()); prop.text "К списку тестов" ]
]
]