Documentation ¶
Index ¶
Constants ¶
View Source
const (
// SessionKeyUser is the session state key where the user reference is held.
SessionKeyUser = "User"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HomeViewModel ¶
type HomeViewModel struct { TotalQuizzes int TotalQuizResults int TotalQuizResultsCorrect int TotalQuizDuration time.Duration Quizzes []*types.Quiz }
HomeViewModel is the viewmodel for the home page.
func CreateHomeViewModel ¶
func CreateHomeViewModel(all []*types.Quiz) (hvm HomeViewModel)
CreateHomeViewModel creates a home view model.
func (HomeViewModel) TotalQuizCorrectPct ¶
func (hvm HomeViewModel) TotalQuizCorrectPct() float64
TotalQuizCorrectPct returns the percentage of results correct.
Click to show internal directories.
Click to hide internal directories.