package component import ( "fmt" common "forge.cadoles.com/wpetit/kouiz/internal/http/handler/webui/common/component" "forge.cadoles.com/wpetit/kouiz/internal/store" "strconv" ) type ResultPageVModel struct { Player *store.Player PlayerRank int Entry *store.QuizEntry Won bool } templ ResultPage(vmodel ResultPageVModel) { @common.AppPage(common.WithPageOptions( common.WithTitle("Quiz"), )) {
if vmodel.Won {

Bien joué !

} else {

Dommage !

}

La réponse attendue à la question
"{ vmodel.Entry.Question }" était "{ vmodel.Entry.Answer }".

if vmodel.Won {

Vous avez gagné { strconv.FormatInt(int64((vmodel.Entry.Level+1)*2), 10) } points !

}

Vous avez actuellement { strconv.FormatInt(int64((vmodel.Player.Score)), 10) } points, ce qui vous place en position #{ strconv.FormatInt(int64(vmodel.PlayerRank), 10) } du classement.

Le saviez vous ?
{ vmodel.Entry.Anecdote }
} }