schemas

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EssaySemanticsBytes []byte
View Source
var MultiChoiceSemanticsBytes []byte
View Source
var TrueFalseSemanticsBytes []byte

Functions

This section is empty.

Types

type AnswerOption

type AnswerOption struct {
	Text            string                 `json:"text"`
	Correct         bool                   `json:"correct"`
	TipsAndFeedback *AnswerTipsAndFeedback `json:"tipsAndFeedback,omitempty"`
}

AnswerOption represents a single answer choice

type AnswerTipsAndFeedback

type AnswerTipsAndFeedback struct {
	Tip               string `json:"tip,omitempty"`
	ChosenFeedback    string `json:"chosenFeedback,omitempty"`
	NotChosenFeedback string `json:"notChosenFeedback,omitempty"`
}

AnswerTipsAndFeedback provides hints and feedback for individual answers

type Behaviour

type Behaviour struct {
	EnableRetry           bool   `json:"enableRetry,omitempty"`
	EnableSolutionsButton bool   `json:"enableSolutionsButton,omitempty"`
	EnableCheckButton     bool   `json:"enableCheckButton,omitempty"`
	Type                  string `json:"type,omitempty"` // "auto", "multi", "single"
	SinglePoint           bool   `json:"singlePoint,omitempty"`
	RandomAnswers         bool   `json:"randomAnswers,omitempty"`
	PassPercentage        int    `json:"passPercentage,omitempty"`
	ShowScorePoints       bool   `json:"showScorePoints,omitempty"`
}

Behaviour controls how the MultiChoice question behaves

type FeedbackRange

type FeedbackRange struct {
	From     int    `json:"from"`
	To       int    `json:"to"`
	Feedback string `json:"feedback,omitempty"`
}

FeedbackRange defines feedback for a score range

type MediaGroup

type MediaGroup struct {
	Type                string `json:"type,omitempty"`
	DisableImageZooming bool   `json:"disableImageZooming,omitempty"`
}

MediaGroup represents optional media content (images, videos)

type MultiChoiceParams

type MultiChoiceParams struct {
	Media           *MediaGroup      `json:"media,omitempty"`
	Question        string           `json:"question"`
	Answers         []AnswerOption   `json:"answers"`
	OverallFeedback *OverallFeedback `json:"overallFeedback,omitempty"`
	Behaviour       *Behaviour       `json:"behaviour,omitempty"`
	UI              *UITranslations  `json:"UI,omitempty"`
}

MultiChoiceParams represents the parameters for H5P.MultiChoice content type This struct is generated from the official H5P MultiChoice semantics.json schema

func (*MultiChoiceParams) Validate

func (p *MultiChoiceParams) Validate() error

Validate checks if the MultiChoiceParams are valid according to H5P semantics

type OverallFeedback

type OverallFeedback struct {
	OverallFeedback []FeedbackRange `json:"overallFeedback,omitempty"`
}

OverallFeedback provides score-based feedback ranges

type UITranslations

type UITranslations struct {
	CheckAnswerButton  string `json:"checkAnswerButton,omitempty"`
	ShowSolutionButton string `json:"showSolutionButton,omitempty"`
	TryAgainButton     string `json:"tryAgainButton,omitempty"`
	TipsLabel          string `json:"tipsLabel,omitempty"`
	ScoreBarLabel      string `json:"scoreBarLabel,omitempty"`
	TipAvailable       string `json:"tipAvailable,omitempty"`
	FeedbackAvailable  string `json:"feedbackAvailable,omitempty"`
	ReadFeedback       string `json:"readFeedback,omitempty"`
	WrongAnswer        string `json:"wrongAnswer,omitempty"`
	CorrectAnswer      string `json:"correctAnswer,omitempty"`
}

UITranslations contains user interface text labels

Jump to

Keyboard shortcuts

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