parser

package
v0.0.0-...-de69bfc Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAnswer

func ParseAnswer(file io.Reader) map[string]map[int]AnswersAndReferences

ParseAnswer returns the list of answers and references for a given rule and question number

Types

type AnswersAndReferences

type AnswersAndReferences struct {
	Answers    []string
	References []string
}

type Choice

type Choice struct {
	ID         int
	QuestionID int
	Option     string
	Text       string
	IsAnswer   bool
}

type Question

type Question struct {
	ID             int
	Text           string
	Choices        []Choice
	Rule           Rule
	QuestionNumber int
	References     []Reference
}

func ParseQuestion

func ParseQuestion(tokens []token.Token, answerMap map[string]map[int]AnswersAndReferences) []Question

type Reference

type Reference struct {
	ID         int
	QuestionID int
	Text       string
}

type Rule

type Rule struct {
	ID        string
	Name      string
	SortOrder int
}

Jump to

Keyboard shortcuts

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