testparts

package module
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 37 Imported by: 0

README

TestParts

A bit of a random collection of objects that can be used to build test generation and taking apps. Tests are specified as JSON and LaTeX is used to format the tests. Creating a Google Form is also an option.

Documentation

Index

Constants

View Source
const ZERO_WIDTH_SPACE = "\u200b"

Variables

View Source
var GoogleFormAuthSuccess = []byte(`
		<!DOCTYPE html>
		<html lang="en">
		<head>
				<meta charset="UTF-8" />
				<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
				<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
				<title>Registration Successful Message Example</title>

				<meta name="author" content="Codeconvey" />
				<!-- Message Box CSS -->
		<style>

		body {
			background: #1488EA;
		}

		#card {
			position: relative;
			width: 320px;
			display: block;
			margin: 40px auto;
			text-align: center;
			font-family: 'Source Sans Pro', sans-serif;
		}

		#upper-side {
			padding: 2em;
			background-color: #8BC34A;
			display: block;
			color: #fff;
			border-top-right-radius: 8px;
			border-top-left-radius: 8px;
		}

		#checkmark {
			font-weight: lighter;
			fill: #fff;
			margin: -3.5em auto auto 20px;
		}

		#status {
			font-weight: lighter;
			text-transform: uppercase;
			letter-spacing: 2px;
			font-size: 1em;
			margin-top: -.2em;
			margin-bottom: 0;
		}

		#lower-side {
			padding: 2em 2em 5em 2em;
			background: #fff;
			display: block;
			border-bottom-right-radius: 8px;
			border-bottom-left-radius: 8px;
		}

		#message {
			margin-top: -.5em;
			color: #757575;
			letter-spacing: 1px;
		}

		#contBtn {
			position: relative;
			top: 1.5em;
			text-decoration: none;
			background: #8bc34a;
			color: #fff;
			margin: auto;
			padding: .8em 3em;
			-webkit-box-shadow: 0px 15px 30px rgba(50, 50, 50, 0.21);
			-moz-box-shadow: 0px 15px 30px rgba(50, 50, 50, 0.21);
			box-shadow: 0px 15px 30px rgba(50, 50, 50, 0.21);
			border-radius: 25px;
			-webkit-transition: all .4s ease;
				-moz-transition: all .4s ease;
				-o-transition: all .4s ease;
				transition: all .4s ease;
		}

		#contBtn:hover {
			-webkit-box-shadow: 0px 15px 30px rgba(50, 50, 50, 0.41);
			-moz-box-shadow: 0px 15px 30px rgba(50, 50, 50, 0.41);
			box-shadow: 0px 15px 30px rgba(50, 50, 50, 0.41);
			-webkit-transition: all .4s ease;
				-moz-transition: all .4s ease;
				-o-transition: all .4s ease;
				transition: all .4s ease;
		}

		</style>
		</head>
		<body>
		<div id='card' class="animated fadeIn">
			<div id='upper-side'>
				<?xml version="1.0" encoding="utf-8"?>
					<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
					<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
					<svg version="1.1" id="checkmark" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" xml:space="preserve">
						<path d="M131.583,92.152l-0.026-0.041c-0.713-1.118-2.197-1.447-3.316-0.734l-31.782,20.257l-4.74-12.65
			c-0.483-1.29-1.882-1.958-3.124-1.493l-0.045,0.017c-1.242,0.465-1.857,1.888-1.374,3.178l5.763,15.382
			c0.131,0.351,0.334,0.65,0.579,0.898c0.028,0.029,0.06,0.052,0.089,0.08c0.08,0.073,0.159,0.147,0.246,0.209
			c0.071,0.051,0.147,0.091,0.222,0.133c0.058,0.033,0.115,0.069,0.175,0.097c0.081,0.037,0.165,0.063,0.249,0.091
			c0.065,0.022,0.128,0.047,0.195,0.063c0.079,0.019,0.159,0.026,0.239,0.037c0.074,0.01,0.147,0.024,0.221,0.027
			c0.097,0.004,0.194-0.006,0.292-0.014c0.055-0.005,0.109-0.003,0.163-0.012c0.323-0.048,0.641-0.16,0.933-0.346l34.305-21.865
			C131.967,94.755,132.296,93.271,131.583,92.152z" />
						<circle fill="none" stroke="#ffffff" stroke-width="5" stroke-miterlimit="10" cx="109.486" cy="104.353" r="32.53" />
					</svg>
					<h3 id='status'>
					Success
				</h3>
			</div>
			<div id='lower-side'>
				<p id='message'>
					Congratulations, your Google Forms access has been granted. You may close this window/tab.
  </div>
</div>
</body>
</html>
`)

Functions

func AnswerSheet

func AnswerSheet(test *TestBundleSt, sections []SectionSt, isKey, showAll bool,
	qNum *QuestNumSt) []string

func CloseCockroachDB

func CloseCockroachDB(db *gorm.DB) error

func DocumentBegin

func DocumentBegin(test *TestBundleSt) []string

func DocumentEnd

func DocumentEnd(test *TestBundleSt) []string

func MakeBundle

func MakeBundle(dsn string, testJSON TestJSONSt, sections []SectionSt) (*arraylist.List[*TestBundleSt], error)

func OpenCockroachDB

func OpenCockroachDB(dsn string, autoMigrate bool) (*gorm.DB, error)

func ProcessInclude

func ProcessInclude(section JSONSectionSt, assetdir string)

func ProcessIncludeAiken

func ProcessIncludeAiken(section JSONSectionSt, assetdir string)

func ProcessIncludeQuestgen

func ProcessIncludeQuestgen(section JSONSectionSt, assetdir string)

func ProcessWordsInclude

func ProcessWordsInclude(section JSONSectionSt, assetdir string)

func QuestDistoSheet

func QuestDistoSheet(test TestJSONSt, sections []SectionSt) []string

func QuizSheet

func QuizSheet(quiz *TestBundleSt, sections []SectionSt, qNum *QuestNumSt) []string

func TestSheet

func TestSheet(test *TestBundleSt, sections []SectionSt, qNum *QuestNumSt) []string

Types

type ClassJSONSt

type ClassJSONSt struct {
	Name     string  `json:"name"`
	Students WordsSt `json:"students"`
}

type ClassMapSt

type ClassMapSt struct {
	*treemap.Map[string, WordsSt]
}

func (*ClassMapSt) UnmarshalJSON

func (cm *ClassMapSt) UnmarshalJSON(data []byte) error

type CompQuestionsSt

type CompQuestionsSt struct {
	SectionHeadSt
	Questions    QuestionListSt
	AllQuestions QuestionSetSt
}

func (*CompQuestionsSt) AnswerLatex

func (c *CompQuestionsSt) AnswerLatex(isKey, showAll bool, student uint, qNum *QuestNumSt) []string

func (*CompQuestionsSt) DistribLatex

func (c *CompQuestionsSt) DistribLatex(testTitle string, numTest uint) []string

func (*CompQuestionsSt) GetHead

func (c *CompQuestionsSt) GetHead() *SectionHeadSt

func (*CompQuestionsSt) Init

func (c *CompQuestionsSt) Init(section JSONSectionSt, numTest uint)

func (*CompQuestionsSt) TestForm

func (c *CompQuestionsSt) TestForm(gf *GoogleFormSt, student uint) error

func (*CompQuestionsSt) TestLatex

func (c *CompQuestionsSt) TestLatex(student uint, qNum *QuestNumSt) []string

func (*CompQuestionsSt) TestRTF

func (c *CompQuestionsSt) TestRTF(doc *RTFDoc, student uint, qNum *QuestNumSt)

type CustomSt

type CustomSt struct {
	SectionHeadSt
	Questions    QuestionListSt
	AllQuestions QuestionSetSt
	AnswerText   *arraylist.List[string]
	Answers      *arraylist.List[string]
}

func (*CustomSt) AnswerLatex

func (c *CustomSt) AnswerLatex(isKey, showAll bool, student uint, qNum *QuestNumSt) []string

func (*CustomSt) DistribLatex

func (c *CustomSt) DistribLatex(testTitle string, numTest uint) []string

func (*CustomSt) GetHead

func (c *CustomSt) GetHead() *SectionHeadSt

func (*CustomSt) Init

func (c *CustomSt) Init(section JSONSectionSt, numTest uint)

func (*CustomSt) TestForm

func (c *CustomSt) TestForm(gf *GoogleFormSt, student uint) error

func (*CustomSt) TestLatex

func (c *CustomSt) TestLatex(student uint, qNum *QuestNumSt) []string

func (*CustomSt) TestRTF

func (c *CustomSt) TestRTF(doc *RTFDoc, student uint, qNum *QuestNumSt)

type FlagsSt

type FlagsSt struct {
	ShowAll, SaveTex, CreateDistro, CreateRtf, CreateForm, CreatePDF, DBImport,
	ContinuousNumbering, ImportClass, ImportSession bool
}

type GoogleFormSt

type GoogleFormSt struct {
	Status GoogleFormStatus
	// contains filtered or unexported fields
}

func NewGoogleForm

func NewGoogleForm(dsn, formCredentials string) *GoogleFormSt

func (*GoogleFormSt) AddQuestions

func (gf *GoogleFormSt) AddQuestions(questions QuestionSetSt,
	qPoints int64) error

func (*GoogleFormSt) AddSection

func (gf *GoogleFormSt) AddSection(title, desc string) error

func (*GoogleFormSt) Create

func (gf *GoogleFormSt) Create(title, documentTitle, desc string) (*GoogleFormSt, error)

type GoogleFormStatus

type GoogleFormStatus int32
const (
	Connecting GoogleFormStatus = iota
	Available
	Unavailable
	Unknown
)

type GormClass

type GormClass struct {
	gorm.Model
	Subject  string `gorm:"uniqueIndex:index:idx_class"`
	Sections []GormClassSection
	Tests    []GormTest
}

type GormClassSection

type GormClassSection struct {
	gorm.Model
	Section     string `gorm:"uniqueIndex:index:idx_section"`
	GormClassID uint   `gorm:"uniqueIndex:index:idx_section"`
	Students    []GormStudent
}

type GormQuestion

type GormQuestion struct {
	gorm.Model
	Required   bool
	Question   string
	Points     uint
	GormTestID uint
	Choices    []GormQuestionChoice
}

func (*GormQuestion) ShuffleChoices added in v0.1.19

func (q *GormQuestion) ShuffleChoices()

type GormQuestionChoice

type GormQuestionChoice struct {
	gorm.Model
	GormQuestionID uint
	Choice         string
	Feedback       string
	Answer         bool
}

type GormStudent

type GormStudent struct {
	gorm.Model
	FamilyName         string
	GivenName          string
	GormClassSectionID uint
}

type GormTest

type GormTest struct {
	gorm.Model
	Title        string `gorm:"index:idx_test"`
	Length       uint
	MinQuestions uint
	GormClassID  uint
	Sessions     []GormTestSession
	Attempts     []GormTestAttempt
	Questions    []GormQuestion
}

func (*GormTest) GetQuestion added in v0.1.20

func (t *GormTest) GetQuestion() *GormQuestion

func (*GormTest) PutQuestion added in v0.1.20

func (t *GormTest) PutQuestion(question *GormQuestion)

func (*GormTest) ShuffleQuestions added in v0.1.19

func (t *GormTest) ShuffleQuestions()

type GormTestAttempt

type GormTestAttempt struct {
	gorm.Model
	GormStudentID uint
	GormTestID    uint
	Score         float64
	AttemptStart  time.Time
	AttemptEnd    time.Time
	Answers       datatypes.JSON
}

type GormTestSession

type GormTestSession struct {
	gorm.Model
	GormTestID         uint
	GormClassSectionID uint
	QuestionTime       time.Duration
	StartDateTime      time.Time
	EndDateTime        time.Time
}

type GromPreference

type GromPreference struct {
	gorm.Model
	Key   string `gorm:"uniqueIndex"`
	Value string
}

type JSONSectionSt

type JSONSectionSt struct {
	Type             string        `json:"type"`
	SectionTitle     string        `json:"sectionTitle"`
	NumLines         string        `json:"numLines"`
	Title            string        `json:"title"`
	Points           uint          `json:"points"`
	NumQuest         uint          `json:"questionsOntest"`
	NumCol           uint          `json:"numCol"`
	AnswerLines      bool          `json:"answerLines"`
	QuizBox          bool          `json:"quizBox"`
	KeepOrder        bool          `json:"keepOrder"`
	AnswerText       WordsSt       `json:"answerText"`
	WordList         WordsSt       `json:"word-list"`
	Include          WordsSt       `json:"include"`
	IncludeQuestgen  WordsSt       `json:"includeQuestgen"`
	IncludeAiken     WordsSt       `json:"includeAiken"`
	Answers          WordsSt       `json:"answers"`
	ColumnHead       WordsSt       `json:"columnHead"`
	Instructions     NLStringSt    `json:"instructions"`
	FormInstructions NLStringSt    `json:"formInstructions"`
	Text             NLStringSt    `json:"text"`
	Words            WordDefMapSt  `json:"words"`
	Questions        QuestionSetSt `json:"questions"`
	AssetDir         string        `json:"-"`
}

type MultipleChoiceSt

type MultipleChoiceSt struct {
	SectionHeadSt
	Questions    QuestionListSt
	AllQuestions QuestionSetSt
}

func (*MultipleChoiceSt) AnswerLatex

func (m *MultipleChoiceSt) AnswerLatex(isKey, showAll bool, student uint, qNum *QuestNumSt) []string

func (*MultipleChoiceSt) DistribLatex

func (m *MultipleChoiceSt) DistribLatex(testTitle string, numTest uint) []string

func (*MultipleChoiceSt) GetHead

func (m *MultipleChoiceSt) GetHead() *SectionHeadSt

func (*MultipleChoiceSt) Init

func (m *MultipleChoiceSt) Init(section JSONSectionSt, numTest uint)

func (*MultipleChoiceSt) TestForm

func (m *MultipleChoiceSt) TestForm(gf *GoogleFormSt, student uint) error

func (*MultipleChoiceSt) TestLatex

func (m *MultipleChoiceSt) TestLatex(student uint, qNum *QuestNumSt) []string

func (*MultipleChoiceSt) TestRTF

func (m *MultipleChoiceSt) TestRTF(doc *RTFDoc, student uint, qNum *QuestNumSt)

type NLStringListSt

type NLStringListSt struct {
	*arraylist.List[NLStringSt]
}

func (*NLStringListSt) UnmarshalJSON

func (nls *NLStringListSt) UnmarshalJSON(data []byte) error

type NLStringSt

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

func (*NLStringSt) CleanString

func (nls *NLStringSt) CleanString() string

func (*NLStringSt) UnmarshalJSON

func (nls *NLStringSt) UnmarshalJSON(data []byte) error

type Oauth2ResponseSt

type Oauth2ResponseSt struct {
	Error       string `json:"error"`
	Description string `json:"error_description"`
}

type PassageCompletionSt

type PassageCompletionSt struct {
	SectionHeadSt
	WordList  StringListSt
	Answers   StringListSt
	Questions QuestionListSt // not used
}

func (*PassageCompletionSt) AnswerLatex

func (p *PassageCompletionSt) AnswerLatex(isKey, showAll bool, student uint, qNum *QuestNumSt) []string

func (*PassageCompletionSt) DistribLatex

func (p *PassageCompletionSt) DistribLatex(testTitle string, numTest uint) []string

func (*PassageCompletionSt) GetHead

func (p *PassageCompletionSt) GetHead() *SectionHeadSt

func (*PassageCompletionSt) Init

func (p *PassageCompletionSt) Init(section JSONSectionSt, numTest uint)

func (*PassageCompletionSt) TestForm

func (p *PassageCompletionSt) TestForm(gf *GoogleFormSt, student uint) error

func (*PassageCompletionSt) TestLatex

func (p *PassageCompletionSt) TestLatex(student uint, qNum *QuestNumSt) []string

func (*PassageCompletionSt) TestRTF

func (pc *PassageCompletionSt) TestRTF(doc *RTFDoc, student uint, qNum *QuestNumSt)

type PathStrSt

type PathStrSt struct {
	TestFile, Outdir, Workdir, Assetdir, Templatepath, ImportFile string
}

type Preference

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

func (*Preference) Del

func (p *Preference) Del(key string) error

func (*Preference) Get

func (p *Preference) Get(key string) (string, error)

func (*Preference) Set

func (p *Preference) Set(key, value string) error

type QuestNumSt

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

func MakeQuestNum

func MakeQuestNum(sectionNumbering bool) QuestNumSt

func (*QuestNumSt) AddNumber

func (qn *QuestNumSt) AddNumber(add uint32)

func (*QuestNumSt) CurrentNumber

func (qn *QuestNumSt) CurrentNumber() uint32

func (*QuestNumSt) NewSection

func (qn *QuestNumSt) NewSection()

func (*QuestNumSt) NextNumber

func (qn *QuestNumSt) NextNumber() uint32

type QuestgenQuestionSt

type QuestgenQuestionSt struct {
	Question string  `json:"question"`
	Answer   string  `json:"answer"`
	Choices  WordsSt `json:"distractors"`
}

type QuestionListSt

type QuestionListSt struct {
	*arraylist.List[QuestionSetSt]
}

type QuestionSetSt

type QuestionSetSt struct {
	*arraylist.List[*QuestionsSt]
}

func (QuestionSetSt) GetQuestions

func (questions QuestionSetSt) GetQuestions(numTest, numQuest, numCol uint,
	keepOrder bool) QuestionListSt

func (QuestionSetSt) QuestionSet

func (q QuestionSetSt) QuestionSet(numQuest, numTest uint,
	keepOrder bool) QuestionSetSt

func (*QuestionSetSt) UnmarshalJSON

func (qs *QuestionSetSt) UnmarshalJSON(data []byte) error

type QuestionsSt

type QuestionsSt struct {
	Answer   uint           `json:"answer"`
	NumCol   uint           `json:"numCol"`
	Used     uint           `json:"used"`
	Required bool           `json:"required"`
	Choices  WordsSt        `json:"choices"`
	Answers  WordsSt        `json:"answers"`
	Question NLStringSt     `json:"question"`
	Parts    NLStringListSt `json:"parts"`
}

func (*QuestionsSt) Begin

func (q *QuestionsSt) Begin(outStr []string) []string

func (*QuestionsSt) Choice

func (q *QuestionsSt) Choice(outStr []string, numCol uint) []string

func (*QuestionsSt) Lines

func (q *QuestionsSt) Lines(outStr []string, isQuiz bool, head SectionHeadSt) []string

func (*QuestionsSt) Part

func (q *QuestionsSt) Part(outStr []string) []string

type QuizSt

type QuizSt struct {
	SectionHeadSt
	Questions    QuestionListSt
	AllQuestions QuestionSetSt
}

func (*QuizSt) AnswerLatex

func (q *QuizSt) AnswerLatex(isKey, showAll bool, student uint, qNum *QuestNumSt) []string

func (*QuizSt) DistribLatex

func (q *QuizSt) DistribLatex(testTitle string, numTest uint) []string

func (*QuizSt) GetHead

func (q *QuizSt) GetHead() *SectionHeadSt

func (*QuizSt) Init

func (q *QuizSt) Init(section JSONSectionSt, numTest uint)

func (*QuizSt) TestForm

func (q *QuizSt) TestForm(gf *GoogleFormSt, student uint) error

func (*QuizSt) TestLatex

func (q *QuizSt) TestLatex(student uint, qNum *QuestNumSt) []string

func (*QuizSt) TestRTF

func (q *QuizSt) TestRTF(doc *RTFDoc, student uint, qNum *QuestNumSt)

type RTFDoc

type RTFDoc struct {
	*rtfdoc.Document
}

func (*RTFDoc) Init

func (doc *RTFDoc) Init()

func (*RTFDoc) PageFooter

func (doc *RTFDoc) PageFooter(head *TestHeadSt)

func (*RTFDoc) PageHeader

func (doc *RTFDoc) PageHeader(head *TestHeadSt)

func (*RTFDoc) Sections

func (doc *RTFDoc) Sections(student uint, sections []SectionSt, qNum *QuestNumSt)

func (*RTFDoc) TestHeader

func (doc *RTFDoc) TestHeader(head *TestHeadSt, sections []SectionSt)

type ReadingCompSt

type ReadingCompSt struct {
	SectionHeadSt
	Questions    QuestionListSt
	AllQuestions QuestionSetSt
}

func (*ReadingCompSt) AnswerLatex

func (r *ReadingCompSt) AnswerLatex(isKey, showAll bool, student uint, qNum *QuestNumSt) []string

func (*ReadingCompSt) DistribLatex

func (r *ReadingCompSt) DistribLatex(testTitle string, numTest uint) []string

func (*ReadingCompSt) GetHead

func (r *ReadingCompSt) GetHead() *SectionHeadSt

func (*ReadingCompSt) Init

func (r *ReadingCompSt) Init(section JSONSectionSt, numTest uint)

func (*ReadingCompSt) TestForm

func (r *ReadingCompSt) TestForm(gf *GoogleFormSt, student uint) error

func (*ReadingCompSt) TestLatex

func (r *ReadingCompSt) TestLatex(student uint, qNum *QuestNumSt) []string

func (*ReadingCompSt) TestRTF

func (r *ReadingCompSt) TestRTF(doc *RTFDoc, student uint, qNum *QuestNumSt)

type SectionHeadSt

type SectionHeadSt struct {
	Type             string
	SectionTitle     string
	Title            string
	NumLines         string
	Points           uint
	NumCol           uint
	NumQuest         uint
	AnswerLines      bool
	QuizBox          bool
	Quiz             bool
	KeepOrder        bool
	Instructions     string
	FormInstructions string
	Text             string
	ColumnHead       WordsSt
}

type SectionSt

type SectionSt interface {
	Init(JSONSectionSt, uint)
	TestLatex(uint, *QuestNumSt) []string
	TestRTF(*RTFDoc, uint, *QuestNumSt)
	TestForm(*GoogleFormSt, uint) error
	AnswerLatex(bool, bool, uint, *QuestNumSt) []string
	DistribLatex(string, uint) []string
	GetHead() *SectionHeadSt
}

func MakeSections

func MakeSections(testJSON TestJSONSt, assetDir string, showAll bool) ([]SectionSt, error)

type StringListSt

type StringListSt struct {
	*arraylist.List[NLStringListSt]
}

func (StringListSt) UnmarshalJSON

func (sl StringListSt) UnmarshalJSON(data []byte) error

type TakerClass

type TakerClass struct {
	Subject  string `json:"subject"`
	Sections []struct {
		Section  string   `json:"section"`
		Students []string `json:"students"`
	} `json:"sections"`
}

type TakerSession

type TakerSession struct {
	Subject      string    `json:"subject"`
	Title        string    `json:"title"`
	Section      string    `json:"section"`
	StartTime    time.Time `json:"startTime"`
	EndTime      time.Time `json:"endTime"`
	QuestionTime string    `json:"questionTime"`
}

type TestBundleSt

type TestBundleSt struct {
	Student    string
	StudentNum uint
	*TestHeadSt
}

func (*TestBundleSt) Create

func (bundle *TestBundleSt) Create(dsn string, pathStrings PathStrSt,
	flags FlagsSt, test TestSt) error

func (*TestBundleSt) CreateDistro

func (distroTest *TestBundleSt) CreateDistro(pathStrings PathStrSt, flags FlagsSt, test TestSt)

type TestHeadSt

type TestHeadSt struct {
	Subject         string
	Grade           string
	School          string
	Title           string
	RTFTitle        string
	Date            string
	Points          uint
	Time            uint
	Quiz            bool
	NoKey           bool
	Dsn             string
	FormCredentials string
}

type TestJSONSt

type TestJSONSt struct {
	Subject      string          `json:"subject"`
	Grade        string          `json:"grade"`
	Title        string          `json:"title"`
	RTFTitle     string          `json:"rtfTitle"`
	School       string          `json:"school"`
	Date         string          `json:"date"`
	Time         uint            `json:"time"`
	NoKey        bool            `json:"noKey"`
	MinQuestions uint            `json:"minQuestions"`
	Students     WordsSt         `json:"students"`
	Classes      ClassMapSt      `json:"classes"`
	Sections     []JSONSectionSt `json:"sections"`
}

func GetTestJson

func GetTestJson(fileName, assetdir string) (TestJSONSt, error)

type TestSt

type TestSt struct {
	TestJSON   TestJSONSt
	Sections   []SectionSt
	TestBundle *arraylist.List[*TestBundleSt]
	Template   []byte
}

type Ticker added in v0.1.7

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

func NewTicker added in v0.1.7

func NewTicker(tickTime time.Duration, stop, step func()) *Ticker

func (*Ticker) Stop added in v0.1.7

func (t *Ticker) Stop()

type WordDefMapSt

type WordDefMapSt struct {
	*treemap.Map[NLStringSt, NLStringSt]
}

func (*WordDefMapSt) UnmarshalJSON

func (wdm *WordDefMapSt) UnmarshalJSON(data []byte) error

type WordDefSt

type WordDefSt struct {
	Word   NLStringSt
	Def    NLStringSt
	Answer NLStringSt
}

type WordDistMapSt

type WordDistMapSt struct {
	*treemap.Map[NLStringSt, uint]
}

func (WordDistMapSt) WordSet

func (w WordDistMapSt) WordSet(numQuest, numTest uint) NLStringListSt

type WordListSt

type WordListSt struct {
	*arraylist.List[*WordDefSt]
}

type WordMatchSt

type WordMatchSt struct {
	SectionHeadSt
	*arraylist.List[WordListSt]
	WordDist     WordDistMapSt
	AllQuestions QuestionSetSt
	AllWords     *WordDefMapSt
}

func (*WordMatchSt) AnswerLatex

func (w *WordMatchSt) AnswerLatex(isKey, showAll bool, student uint, qNum *QuestNumSt) []string

func (*WordMatchSt) DistribLatex

func (w *WordMatchSt) DistribLatex(testTitle string, numTest uint) []string

func (*WordMatchSt) GetHead

func (w *WordMatchSt) GetHead() *SectionHeadSt

func (*WordMatchSt) Init

func (w *WordMatchSt) Init(section JSONSectionSt, numTest uint)

func (*WordMatchSt) TestForm

func (w *WordMatchSt) TestForm(gf *GoogleFormSt, student uint) error

func (*WordMatchSt) TestLatex

func (w *WordMatchSt) TestLatex(student uint, qNum *QuestNumSt) []string

func (*WordMatchSt) TestRTF

func (w *WordMatchSt) TestRTF(doc *RTFDoc, student uint, qNum *QuestNumSt)

func (*WordMatchSt) ToQuestions

func (w *WordMatchSt) ToQuestions() error

type WordProblemSt

type WordProblemSt struct {
	SectionHeadSt
	Questions    QuestionListSt
	AllQuestions QuestionSetSt
}

func (*WordProblemSt) AnswerLatex

func (w *WordProblemSt) AnswerLatex(isKey, showAll bool, student uint, qNum *QuestNumSt) []string

func (*WordProblemSt) DistribLatex

func (w *WordProblemSt) DistribLatex(testTitle string, numTest uint) []string

func (*WordProblemSt) GetHead

func (w *WordProblemSt) GetHead() *SectionHeadSt

func (*WordProblemSt) Init

func (w *WordProblemSt) Init(section JSONSectionSt, numTest uint)

func (*WordProblemSt) TestForm

func (w *WordProblemSt) TestForm(gf *GoogleFormSt, student uint) error

func (*WordProblemSt) TestLatex

func (w *WordProblemSt) TestLatex(student uint, qNum *QuestNumSt) []string

func (*WordProblemSt) TestRTF

func (w *WordProblemSt) TestRTF(doc *RTFDoc, student uint, qNum *QuestNumSt)

type WordsSt

type WordsSt struct {
	*arraylist.List[string]
}

func (*WordsSt) UnmarshalJSON

func (w *WordsSt) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
fyne
Package rtf-doc provides simple tools for creation and writing rtf documents.
Package rtf-doc provides simple tools for creation and writing rtf documents.

Jump to

Keyboard shortcuts

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