Documentation
¶
Index ¶
- Constants
- type Answer
- type AnswerWrapper
- type Answers
- type Assertion
- type AssertionWrapper
- type Assertions
- type Binary
- type Block
- type BlockWrapper
- type DoublePointAnswer
- type DoublePointPairAnswer
- type DropDownFieldBlock
- type Enonce
- type Equality
- type ExpressionAnswer
- type ExpressionFieldBlock
- type FigureBlock
- type FigureOrGraph
- type FigureOrGraphWrapper
- type FormulaBlock
- type FunctionArea
- type FunctionPoint
- type FunctionPointsAnswer
- type FunctionPointsFieldBlock
- type FunctionSign
- type FunctionsGraphBlock
- type GFPoint
- type GFVector
- type GFVectorPair
- type GeoField
- type GeoFieldWrapper
- type GeometricConstructionFieldBlock
- type Node
- type NumberAnswer
- type NumberFieldBlock
- type OrderedListAnswer
- type OrderedListFieldBlock
- type PointAnswer
- type Proof
- type ProofAnswer
- type ProofFieldBlock
- type Question
- type QuestionAnswersIn
- type QuestionAnswersOut
- type QuestionSyntaxCheckIn
- type QuestionSyntaxCheckOut
- type RadioAnswer
- type RadioFieldBlock
- type Sequence
- type SetAnswer
- type SetFieldBlock
- type SignSymbol
- type SignTableAnswer
- type SignTableBlock
- type SignTableFieldBlock
- type SizeHint
- type Statement
- type TableAnswer
- type TableBlock
- type TableFieldBlock
- type TextBlock
- type TextLine
- type TextOrMath
- type TreeAnswer
- type TreeBlock
- type TreeFieldBlock
- type TreeNodeAnswer
- type TreeShape
- type VariationColumnNumber
- type VariationTableAnswer
- type VariationTableBlock
- type VariationTableFieldBlock
- type VectorFieldBlock
- type VectorNumberAnswer
Constants ¶
const ( DoublePointAnswerAnKind = "DoublePointAnswer" DoublePointPairAnswerAnKind = "DoublePointPairAnswer" ExpressionAnswerAnKind = "ExpressionAnswer" FunctionPointsAnswerAnKind = "FunctionPointsAnswer" NumberAnswerAnKind = "NumberAnswer" OrderedListAnswerAnKind = "OrderedListAnswer" PointAnswerAnKind = "PointAnswer" ProofAnswerAnKind = "ProofAnswer" RadioAnswerAnKind = "RadioAnswer" SetAnswerAnKind = "SetAnswer" SignTableAnswerAnKind = "SignTableAnswer" TableAnswerAnKind = "TableAnswer" TreeAnswerAnKind = "TreeAnswer" VariationTableAnswerAnKind = "VariationTableAnswer" VectorNumberAnswerAnKind = "VectorNumberAnswer" )
const ( EqualityAsKind = "Equality" NodeAsKind = "Node" SequenceAsKind = "Sequence" StatementAsKind = "Statement" )
const ( DropDownFieldBlockBlKind = "DropDownFieldBlock" ExpressionFieldBlockBlKind = "ExpressionFieldBlock" FigureBlockBlKind = "FigureBlock" FormulaBlockBlKind = "FormulaBlock" FunctionPointsFieldBlockBlKind = "FunctionPointsFieldBlock" FunctionsGraphBlockBlKind = "FunctionsGraphBlock" GeometricConstructionFieldBlockBlKind = "GeometricConstructionFieldBlock" NumberFieldBlockBlKind = "NumberFieldBlock" OrderedListFieldBlockBlKind = "OrderedListFieldBlock" ProofFieldBlockBlKind = "ProofFieldBlock" RadioFieldBlockBlKind = "RadioFieldBlock" SetFieldBlockBlKind = "SetFieldBlock" SignTableBlockBlKind = "SignTableBlock" SignTableFieldBlockBlKind = "SignTableFieldBlock" TableBlockBlKind = "TableBlock" TableFieldBlockBlKind = "TableFieldBlock" TextBlockBlKind = "TextBlock" TreeBlockBlKind = "TreeBlock" TreeFieldBlockBlKind = "TreeFieldBlock" VariationTableBlockBlKind = "VariationTableBlock" VariationTableFieldBlockBlKind = "VariationTableFieldBlock" VectorFieldBlockBlKind = "VectorFieldBlock" )
const ( FigureBlockFiKind = "FigureBlock" FunctionsGraphBlockFiKind = "FunctionsGraphBlock" )
const ( GFPointGeKind = "GFPoint" GFVectorGeKind = "GFVector" GFVectorPairGeKind = "GFVectorPair" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Answer ¶
type Answer interface {
// contains filtered or unexported methods
}
Answer is a sum type for the possible answers of question fields
type AnswerWrapper ¶
type AnswerWrapper struct {
Data Answer
}
AnswerWrapper may be used as replacements for Answer when working with JSON
func (AnswerWrapper) MarshalJSON ¶
func (item AnswerWrapper) MarshalJSON() ([]byte, error)
func (*AnswerWrapper) UnmarshalJSON ¶
func (out *AnswerWrapper) UnmarshalJSON(src []byte) error
type Assertion ¶
type Assertion interface {
// contains filtered or unexported methods
}
Assertion is the general container for an element of the proof
type AssertionWrapper ¶
type AssertionWrapper struct {
Data Assertion
}
AssertionWrapper may be used as replacements for Assertion when working with JSON
func (AssertionWrapper) MarshalJSON ¶
func (item AssertionWrapper) MarshalJSON() ([]byte, error)
func (*AssertionWrapper) UnmarshalJSON ¶
func (out *AssertionWrapper) UnmarshalJSON(src []byte) error
type Assertions ¶
type Assertions []Assertion
func (Assertions) MarshalJSON ¶
func (list Assertions) MarshalJSON() ([]byte, error)
func (*Assertions) UnmarshalJSON ¶
func (list *Assertions) UnmarshalJSON(data []byte) error
type BlockWrapper ¶
type BlockWrapper struct {
Data Block
}
BlockWrapper may be used as replacements for Block when working with JSON
func (BlockWrapper) MarshalJSON ¶
func (item BlockWrapper) MarshalJSON() ([]byte, error)
func (*BlockWrapper) UnmarshalJSON ¶
func (out *BlockWrapper) UnmarshalJSON(src []byte) error
type DoublePointPairAnswer ¶
type DropDownFieldBlock ¶
DropDownFieldBlock is the same has RadioFieldBlock, but is displayed inline.
type ExpressionAnswer ¶
type ExpressionAnswer struct {
Expression string
}
type ExpressionFieldBlock ¶
type FigureBlock ¶
func (FigureBlock) FigBounds ¶
func (fg FigureBlock) FigBounds() repere.RepereBounds
type FigureOrGraph ¶
type FigureOrGraph interface { FigBounds() repere.RepereBounds // contains filtered or unexported methods }
type FigureOrGraphWrapper ¶
type FigureOrGraphWrapper struct {
Data FigureOrGraph
}
FigureOrGraphWrapper may be used as replacements for FigureOrGraph when working with JSON
func (FigureOrGraphWrapper) MarshalJSON ¶
func (item FigureOrGraphWrapper) MarshalJSON() ([]byte, error)
func (*FigureOrGraphWrapper) UnmarshalJSON ¶
func (out *FigureOrGraphWrapper) UnmarshalJSON(src []byte) error
type FormulaBlock ¶
type FormulaBlock struct {
Formula string // as latex
}
FormulaBlock is whole line, rendered as LaTeX in display mode
type FunctionArea ¶
type FunctionArea struct { Color repere.ColorHex Path []functiongrapher.BezierCurve }
type FunctionPoint ¶
type FunctionPointsAnswer ¶
type FunctionPointsAnswer struct {
Fxs []int
}
type FunctionPointsFieldBlock ¶
type FunctionPointsFieldBlock struct { IsDiscrete bool // true for sequences, removing the curve between points Label string // name of the function Xs []int // the grid // the derivatives of the function, to plot a nice curve // empty if [IsDiscrete] is true Dfxs []float64 Bounds repere.RepereBounds ID int }
FunctionPointsFieldBlock asks to place points to draw the graph of a function
type FunctionSign ¶
type FunctionSign struct { Label string // printed in math mode FxSymbols []SignSymbol // one for each X, alternate with [Signs] Signs []bool // is positive, with length len(Xs) - 1 }
type FunctionsGraphBlock ¶
type FunctionsGraphBlock struct { Functions []functiongrapher.FunctionGraph Sequences []functiongrapher.SequenceGraph Areas []FunctionArea Points []FunctionPoint Bounds repere.RepereBounds }
func (FunctionsGraphBlock) FigBounds ¶
func (fg FunctionsGraphBlock) FigBounds() repere.RepereBounds
type GFVector ¶
FigureVectorFieldBlock asks for a vector, represented by start and end. It may be used for vectors and affine functions
type GFVectorPair ¶
type GFVectorPair struct{}
FigureVectorPairFieldBlock asks for two vectors, represented by start and end, but evaluated as vector. The trivial case where the two pair of points are equals is not allowed
type GeoFieldWrapper ¶
type GeoFieldWrapper struct {
Data GeoField
}
GeoFieldWrapper may be used as replacements for GeoField when working with JSON
func (GeoFieldWrapper) MarshalJSON ¶
func (item GeoFieldWrapper) MarshalJSON() ([]byte, error)
func (*GeoFieldWrapper) UnmarshalJSON ¶
func (out *GeoFieldWrapper) UnmarshalJSON(src []byte) error
type GeometricConstructionFieldBlock ¶
type GeometricConstructionFieldBlock struct { ID int Field GeoField Background FigureOrGraph }
func (GeometricConstructionFieldBlock) MarshalJSON ¶
func (item GeometricConstructionFieldBlock) MarshalJSON() ([]byte, error)
func (*GeometricConstructionFieldBlock) UnmarshalJSON ¶
func (item *GeometricConstructionFieldBlock) UnmarshalJSON(src []byte) error
type Node ¶
Node is an higher level assertion, such as (m is even) AND (n is odd)
func (Node) MarshalJSON ¶
func (*Node) UnmarshalJSON ¶
type NumberAnswer ¶
type NumberAnswer struct {
Value float64
}
NumberAnswer is compared with float equality, with a fixed precision of 8 digits
type NumberFieldBlock ¶
NumberFieldBlock is an answer field where only numbers are allowed answers are compared as float values
type OrderedListAnswer ¶
type OrderedListAnswer struct {
Indices []int // indices into the question field proposals
}
type OrderedListFieldBlock ¶
type PointAnswer ¶
PointAnswer is a 2D point, whoose coordinates are rounded before begin compared
type ProofAnswer ¶
type ProofAnswer struct {
Proof Proof
}
type ProofFieldBlock ¶
type QuestionAnswersIn ¶
type QuestionAnswersIn struct {
Data Answers
}
QuestionAnswersIn map the field ids to their answer
type QuestionAnswersOut ¶
func (QuestionAnswersOut) IsCorrect ¶
func (qu QuestionAnswersOut) IsCorrect() bool
IsCorrect returns `true` if all the fields are correct.
type QuestionSyntaxCheckIn ¶
QuestionSyntaxCheckIn is emitted by the client to perform a preliminary check of the syntax, without validating the answer
func (QuestionSyntaxCheckIn) MarshalJSON ¶
func (item QuestionSyntaxCheckIn) MarshalJSON() ([]byte, error)
func (*QuestionSyntaxCheckIn) UnmarshalJSON ¶
func (item *QuestionSyntaxCheckIn) UnmarshalJSON(src []byte) error
type QuestionSyntaxCheckOut ¶
type RadioAnswer ¶
type RadioAnswer struct {
Index int
}
RadioAnswer is compared against a reference index It is shared by Radio and DropDown fields.
type RadioFieldBlock ¶
type Sequence ¶
type Sequence struct {
Parts Assertions
}
Sequence is a list of elementary steps needed to write a mathematical proof, where each step are implicitely connected by a "So" (Donc) connector.
type SetFieldBlock ¶
SetFieldBlock asks the student to build a set expression, using the given [Sets] and math set operators
type SignSymbol ¶
type SignSymbol uint8
const ( Nothing SignSymbol = iota // Zero // 0 ForbiddenValue // || )
func (SignSymbol) MarshalJSON ¶
func (s SignSymbol) MarshalJSON() ([]byte, error)
By default a slice of SignSymbol is marshalled as string by Go, which is not recognized by Dart
type SignTableAnswer ¶
type SignTableAnswer struct { Xs []string // expressions Functions []FunctionSign // each label is ignored }
type SignTableBlock ¶
type SignTableBlock struct { Xs []string // as LaTeX code, includes empty cells Functions []FunctionSign }
type SignTableFieldBlock ¶
type SignTableFieldBlock struct { LengthProposals []int // propositions of the number of signs to fill Labels []string // LaTeX code, for each function ID int }
SignTableFieldBlock asks to complete a sign table (with fixed length)
type SizeHint ¶
type SizeHint = int
SizeHint is the length of the expected answer, in runes. It may be used by the client to adjust the field width.
type TableAnswer ¶
type TableAnswer struct {
Rows [][]float64
}
type TableBlock ¶
type TableBlock struct { HorizontalHeaders []TextOrMath // optional VerticalHeaders []TextOrMath // optional Values [][]TextOrMath }
type TableFieldBlock ¶
type TableFieldBlock struct { HorizontalHeaders []TextOrMath VerticalHeaders []TextOrMath ID int }
type TextLine ¶
type TextLine []TextOrMath
TextLine is the general form of a static chunk of text, alternating LaTeX or basic text
type TextOrMath ¶
TextOrMath is a part of a text line, rendered either as plain text or using LaTeX in text mode.
type TreeAnswer ¶
type TreeAnswer struct {
Root TreeNodeAnswer
}
type TreeBlock ¶
type TreeBlock struct { EventsProposals []TextLine Root TreeNodeAnswer }
type TreeFieldBlock ¶
TreeFieldBlock asks to choose the shape and complete a probability tree
type TreeNodeAnswer ¶
type TreeNodeAnswer struct { Children []TreeNodeAnswer Probabilities []string // expression for edges, same length as Children Value int // index into the proposals, ignored for the root }
type TreeShape ¶
type TreeShape []int
TreeShape defines the shape of a "regular" tree, specifying the number of children for each level
type VariationColumnNumber ¶
type VariationColumnNumber struct {
X, Y string // LaTeX
IsUp bool // to adjust the vertical alignment
}
VariationColumnNumber is a column in a variation table displaying (x, f(x)) values
type VariationTableAnswer ¶
type VariationTableBlock ¶
type VariationTableBlock struct { Label string // LaTeX Columns []VariationColumnNumber // Arrows displays the arrows between two local extrema, // with the convention that `true` means `isUp`. Arrows []bool }
type VariationTableFieldBlock ¶
type VariationTableFieldBlock struct { Label string // LaTeX code LengthProposals []int // propositions of the number of arrows ID int }
VariationTableFieldBlock asks to complete a variation table (with fixed length)
type VectorFieldBlock ¶
type VectorNumberAnswer ¶
type VectorNumberAnswer struct {
X, Y float64
}