Documentation
¶
Index ¶
- Constants
- Variables
- func CommonTags(tags [][]ed.TagSection) ed.Tags
- func LoadQuestionNumbers(db tr.DB, config tr.Trivial, userID uID) (out [trivial.NbCategories]int, err error)
- type CheckMissingQuestionsOut
- type Controller
- func (ct *Controller) CheckDemoQuestions() error
- func (ct *Controller) CheckMissingQuestions(c echo.Context) error
- func (ct *Controller) ConnectStudentSession(c echo.Context) error
- func (ct *Controller) CreateTrivialPoursuit(c echo.Context) error
- func (ct *Controller) DeleteTrivialPoursuit(c echo.Context) error
- func (ct *Controller) DuplicateTrivialPoursuit(c echo.Context) error
- func (ct *Controller) GetTrivialPoursuit(c echo.Context) error
- func (ct *Controller) GetTrivialRunningSessions(c echo.Context) error
- func (ct *Controller) GetTrivialsMetrics(c echo.Context) error
- func (ct *Controller) LaunchSessionTrivialPoursuit(c echo.Context) error
- func (ct *Controller) SetupStudentClient(c echo.Context) error
- func (ct *Controller) StartTrivialGame(c echo.Context) error
- func (ct *Controller) StopTrivialGame(c echo.Context) error
- func (ct *Controller) StudentGetSelfaccess(c echo.Context) error
- func (ct *Controller) StudentLaunchSelfaccess(c echo.Context) error
- func (ct *Controller) StudentStartSelfaccess(c echo.Context) error
- func (ct *Controller) TrivialGetSelfaccess(c echo.Context) error
- func (ct *Controller) TrivialTeacherMonitor(c echo.Context) error
- func (ct *Controller) TrivialUpdateSelfaccess(c echo.Context) error
- func (ct *Controller) UpdateTrivialPoursuit(c echo.Context) error
- func (ct *Controller) UpdateTrivialVisiblity(c echo.Context) error
- type GamePlayers
- type GameSummary
- type GetSelfaccessOut
- type GroupsStrategy
- type GroupsStrategyAuto
- type GroupsStrategyManual
- type GroupsStrategyWrapper
- type LaunchSelfaccessOut
- type LaunchSessionIn
- type LaunchSessionOut
- type MonitorOut
- type QuestionContent
- type RunningSessionMetaOut
- type SetupStudentClientOut
- type TrivialExt
- type TrivialSelfaccess
- type UpdateSelfaccessIn
- type UpdateTrivialVisiblityIn
Constants ¶
const ( GroupsStrategyAutoGrKind = "GroupsStrategyAuto" GroupsStrategyManualGrKind = "GroupsStrategyManual" )
Variables ¶
Functions ¶
func CommonTags ¶
func CommonTags(tags [][]ed.TagSection) ed.Tags
CommonTags returns the tags found in every list.
func LoadQuestionNumbers ¶
func LoadQuestionNumbers(db tr.DB, config tr.Trivial, userID uID) (out [trivial.NbCategories]int, err error)
LoadQuestionNumbers returns the number of questions available for each categories, as defined by [config.Questions]
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the top level (singleton) objects handling requests related to trivial pousuit setups It delegates to trivial-poursuit.GameController for the actual game logic handling.
func NewController ¶
func (*Controller) CheckDemoQuestions ¶
func (ct *Controller) CheckDemoQuestions() error
CheckDemoQuestions checks that the categories registred for the demo games indeed contains questions.
func (*Controller) CheckMissingQuestions ¶
func (ct *Controller) CheckMissingQuestions(c echo.Context) error
CheckMissingQuestions is an hint to avoid forgetting a tag when setting up the questions. It first finds the current common tags, and then checks that no questions sharing the same tags are left behind.
func (*Controller) ConnectStudentSession ¶
func (ct *Controller) ConnectStudentSession(c echo.Context) error
ConnectStudentSession handles the connection of one student to the activity, using the meta data returned by a previous call to `SetupStudentClient`.
func (*Controller) CreateTrivialPoursuit ¶
func (ct *Controller) CreateTrivialPoursuit(c echo.Context) error
func (*Controller) DeleteTrivialPoursuit ¶
func (ct *Controller) DeleteTrivialPoursuit(c echo.Context) error
func (*Controller) DuplicateTrivialPoursuit ¶
func (ct *Controller) DuplicateTrivialPoursuit(c echo.Context) error
func (*Controller) GetTrivialPoursuit ¶
func (ct *Controller) GetTrivialPoursuit(c echo.Context) error
func (*Controller) GetTrivialRunningSessions ¶
func (ct *Controller) GetTrivialRunningSessions(c echo.Context) error
func (*Controller) GetTrivialsMetrics ¶
func (ct *Controller) GetTrivialsMetrics(c echo.Context) error
GetTrivialsMetrics shows the number of actually running IsyTriv. This is a public endpoint.
func (*Controller) LaunchSessionTrivialPoursuit ¶
func (ct *Controller) LaunchSessionTrivialPoursuit(c echo.Context) error
LaunchSessionTrivialPoursuit starts a new TrivialPoursuit session where the games are setup with the given config.
func (*Controller) SetupStudentClient ¶
func (ct *Controller) SetupStudentClient(c echo.Context) error
SetupStudentClient handles the connection of one student to the activity It is responsible for checking the credentials, creating games if needed, and returning the resolved game URL param used by `ConnectStudentSession`.
func (*Controller) StartTrivialGame ¶
func (ct *Controller) StartTrivialGame(c echo.Context) error
StartTtrivialGame starts a game created in manual mode
func (*Controller) StopTrivialGame ¶
func (ct *Controller) StopTrivialGame(c echo.Context) error
StopTrivialGame stops a game, optionnaly restarting it, interrupting the connection with clients.
func (*Controller) StudentGetSelfaccess ¶
func (ct *Controller) StudentGetSelfaccess(c echo.Context) error
func (*Controller) StudentLaunchSelfaccess ¶
func (ct *Controller) StudentLaunchSelfaccess(c echo.Context) error
StudentLaunchSelfaccess creates a game for the given config, and returns the public game code, which may be joined with the regular API.
func (*Controller) StudentStartSelfaccess ¶
func (ct *Controller) StudentStartSelfaccess(c echo.Context) error
StartSelfaccess starts a game previously created by [StudentLaunchSelfaccess] TODO: secure this access
func (*Controller) TrivialGetSelfaccess ¶
func (ct *Controller) TrivialGetSelfaccess(c echo.Context) error
[TrivialGetSelfaccess] returns the classroom which may launch the given trivial
func (*Controller) TrivialTeacherMonitor ¶
func (ct *Controller) TrivialTeacherMonitor(c echo.Context) error
TrivialTeacherMonitor returns the summary of games currently playing
func (*Controller) TrivialUpdateSelfaccess ¶
func (ct *Controller) TrivialUpdateSelfaccess(c echo.Context) error
[TrivialUpdateSelfaccess] sets the classroom which may launch the given trivial
func (*Controller) UpdateTrivialPoursuit ¶
func (ct *Controller) UpdateTrivialPoursuit(c echo.Context) error
func (*Controller) UpdateTrivialVisiblity ¶
func (ct *Controller) UpdateTrivialVisiblity(c echo.Context) error
type GamePlayers ¶
type GameSummary ¶
type GameSummary struct { GameID tv.RoomID CurrentPlayer string // empty when no one is playing LatestQuestion QuestionContent // empty before the first question Players []GamePlayers RoomSize tv.RoomSize InQuestionStudents []string }
type GetSelfaccessOut ¶
type GroupsStrategy ¶
type GroupsStrategy interface {
// contains filtered or unexported methods
}
type GroupsStrategyAuto ¶
type GroupsStrategyAuto struct {
Groups []int
}
GroupsStrategyAuto starts the game when full
type GroupsStrategyManual ¶
type GroupsStrategyManual struct {
NbGroups int
}
GroupsStrategyManual does not fix the number of players
type GroupsStrategyWrapper ¶
type GroupsStrategyWrapper struct {
Data GroupsStrategy
}
GroupsStrategyWrapper may be used as replacements for GroupsStrategy when working with JSON
func (GroupsStrategyWrapper) MarshalJSON ¶
func (item GroupsStrategyWrapper) MarshalJSON() ([]byte, error)
func (*GroupsStrategyWrapper) UnmarshalJSON ¶
func (out *GroupsStrategyWrapper) UnmarshalJSON(src []byte) error
type LaunchSelfaccessOut ¶
type LaunchSelfaccessOut struct { GameID tv.RoomID Notification events.EventNotification // new in version 1.7 }
type LaunchSessionIn ¶
type LaunchSessionIn struct { IdConfig tr.IdTrivial Groups GroupsStrategy }
func (LaunchSessionIn) MarshalJSON ¶
func (item LaunchSessionIn) MarshalJSON() ([]byte, error)
func (*LaunchSessionIn) UnmarshalJSON ¶
func (item *LaunchSessionIn) UnmarshalJSON(src []byte) error
type LaunchSessionOut ¶
type MonitorOut ¶
type MonitorOut struct {
Games []GameSummary
}
type QuestionContent ¶
type RunningSessionMetaOut ¶
type RunningSessionMetaOut struct {
NbGames int
}
type SetupStudentClientOut ¶
type SetupStudentClientOut struct {
GameMeta string
}
type TrivialExt ¶
type TrivialSelfaccess ¶
type TrivialSelfaccess struct { Classrooms []teacher.Classroom Actives []teacher.IdClassroom }
type UpdateSelfaccessIn ¶
type UpdateSelfaccessIn struct { IdTrivial trivial.IdTrivial IdClassrooms []teacher.IdClassroom }