zeitquiz

package
v0.0.0-...-c9a28b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateResult

func EvaluateResult(pointsScored int, result Result) (string, error)

func PromptReady

func PromptReady() bool

Types

type Answer

type Answer struct {
	ID      int    `json:"id"`
	Text    string `json:"text"`
	Correct bool   `json:"correct"`
}

type Average

type Average struct {
	MeanPoints  string `json:"mean_points"`
	TotalPlayed int    `json:"total_played"`
	MeanTime    string `json:"mean_time"`
}

type Daily

type Daily struct {
	Quizzes []DailyQuizOverview `json:"quizzes"`
}

type DailyQuizOverview

type DailyQuizOverview struct {
	Id int `json:"id"`
}

type Details

type Details struct {
	AnswerID    int `json:"answer_id"`
	PointScored int `json:"points_scored"`
	QuestionID  int `json:"question_id"`
	TimeTaken   int `json:"time_taken_ms"`
}

type PlayerResult

type PlayerResult struct {
	Details      []Details `json:"details"`
	PointsScored int       `json:"points_scored"`
	TotalTime    int       `json:"total_time"`
}

func PromptQuiz

func PromptQuiz(quiz Quiz) (PlayerResult, error)

type Question

type Question struct {
	ID       int      `json:"id"`
	Question string   `json:"question"`
	Answers  []Answer `json:"answers"`
}

type Quiz

type Quiz struct {
	ID        int        `json:"id"`
	Questions []Question `json:"questions"`
}

type QuizOverview

type QuizOverview struct {
	Quiz Quiz `json:"quiz"`
}

type Ranking

type Ranking struct {
	Name       string `json:"name"`
	ResultUUID string `json:"resultUUID"`
}

type Result

type Result struct {
	Stats Stats  `json:"stats"`
	UUID  string `json:"uuid"`
}

type Stats

type Stats struct {
	Average Average `json:"average"`
}

type ZeitClient

type ZeitClient struct {
	// contains filtered or unexported fields
}

func NewZeitClient

func NewZeitClient() ZeitClient

func (*ZeitClient) GetQuiz

func (z *ZeitClient) GetQuiz(url string) (Quiz, error)

func (*ZeitClient) GetQuizIds

func (z *ZeitClient) GetQuizIds(url string) ([]int, error)

func (*ZeitClient) PostPlayerResult

func (z *ZeitClient) PostPlayerResult(playerResult PlayerResult, url string, cookies string) (Result, error)

func (*ZeitClient) PostRanking

func (z *ZeitClient) PostRanking(ranking Ranking, url, cookies string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL