Documentation
¶
Index ¶
- func GetSessionsText(db *sql.DB, sessionID int) (string, error)
- func GetSessionsYoutube(db *sql.DB, sessionID int) (string, string, error)
- func ModulePage(w http.ResponseWriter, r *http.Request)
- func Page(w http.ResponseWriter, r *http.Request)
- func SessionAnswer(w http.ResponseWriter, r *http.Request)
- func SessionPage(w http.ResponseWriter, r *http.Request)
- type Course
- type Module
- type ModulePageData
- type MultipleChoiceData
- type Option
- type PageData
- type Question
- type Session
- type TextData
- type YoutubeData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSessionsText ¶
GetSessionsText gets the session text for the session id. Should only ever be one possible value unless there's a bug or someone does a manual insert.
func GetSessionsYoutube ¶
GetSessionsYoutube gets the data for a YouTube session by the session id.
func ModulePage ¶
func ModulePage(w http.ResponseWriter, r *http.Request)
ModulePage endpoint returns the module page.
func Page ¶
func Page(w http.ResponseWriter, r *http.Request)
Page returns the HTML page with all of the modules for a course.
func SessionPage ¶
func SessionPage(w http.ResponseWriter, r *http.Request)
SessionPage endpoint returns the actual session data. Could be any type of session.
Types ¶
type Course ¶
Course contains the data for a single course
type Module ¶
Module struct stores module data for rendering.
func GetModules ¶
GetModules gets all of the modules from the database.
type ModulePageData ¶
type ModulePageData struct {
Title string
ModuleSlug string
Course Course
// Modules in sidebar
Module Module
Modules []Module
Sessions []Session
Paths []helpers.Path
}
ModulePageData stores all data for rendering the module HTML page.
type MultipleChoiceData ¶
type MultipleChoiceData struct {
Title string
Paths []helpers.Path
Course Course
Module Module
Session Session
Sessions []Session
Questions []Question
}
MultipleChoiceData is used for rendering a Multiple-choice session. Should not be used by other structs.
type PageData ¶
type PageData struct {
Title string
CourseSlug string
Courses []Course
Course Course
Modules []Module
Paths []helpers.Path
}
PageData contains the data to render the HTML course page.
type Session ¶
Session struct contains session data both for rendering and for logic such as deciding the session type.
func GetSession ¶
GetSession gets the session data by the session slug.
func GetSessionsByModuleID ¶
GetSessionsByModuleID gets all of the sessions associated with one module.