competencies

package
v0.0.0-...-8597337 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxAnswerNumber = 3
	MaxVariantsLen  = 6
)
View Source
const MaxCountSequence = 10

Variables

View Source
var (
	ErrParseCompetencyCode = errors.New("error parse competency code")
	ErrParseIndicatorCode  = errors.New("error parse indicator code")
)
View Source
var (
	ErrProgramIDIsEmpty            = errors.New("competency: programID is empty")
	ErrLevelIDIsEmpty              = errors.New("competency: levelID is empty")
	ErrSpecialtyIDAndUgsnIDIsEmpty = errors.New("competency: ugsnID and specialtyID is empty")
	ErrCompetencyIDIsEmpty         = errors.New("competency: id is empty")
	ErrCompetencyTitleIsEmpty      = errors.New("competency: title is empty")
	ErrCompetencyCategoryIsEmpty   = errors.New("competency: category is empty")
	ErrCompetencyTypeInvalid       = errors.New("competency: type is invalid")
	ErrCompetencyCodeInvalid       = errors.New("competency: code is invalid")
)
View Source
var (
	ErrIndicatorCompetencyIDIsEmpty = errors.New("indicator: competencyID is empty")
	ErrIndicatorIDIsEmpty           = errors.New("indicator: id is empty")
	ErrIndicatorTitleIsEmpty        = errors.New("indicator: title is empty")
	ErrIndicatorSubjectIDIsEmpty    = errors.New("indicator: code is invalid")
)
View Source
var (
	ErrQuestionIDEmpty               = errors.New("question: id cannot be empty")
	ErrQuestionRankSegment           = errors.New("question: rank is not included in segment")
	ErrQuestionDescriptionEmpty      = errors.New("question: description cannot be empty")
	ErrQuestionIndicatorIDEmpty      = errors.New("question: indicator id cannot be empty")
	ErrQuestionTypeInvalid           = errors.New("question: type invalid")
	ErrQuestionCompleteAnswerIsEmpty = errors.New("question: complete answer is empty")
	ErrQuestionTaskSequenceIsEmpty   = errors.New("question: test sequence is empty or has one element")
	ErrQuestionTaskConformityIsEmpty = errors.New("question: test conformity is empty or has one element")
)
View Source
var (
	ErrSubjectEmptyID    = errors.New("subject: id cannot be empty")
	ErrSubjectEmptyName  = errors.New("subject: name cannot be empty")
	ErrSubjectEmptySName = errors.New("subject: sname cannot be empty")
)
View Source
var (
	ErrTaskConformityLeftEmpty  = errors.New("task conformity: left answer is empty")
	ErrTaskConformityRightEmpty = errors.New("task conformity: right answer is empty")
)
View Source
var (
	ErrTaskPointVariantsIsEmpty       = errors.New("task point: number of answer options is less than one")
	ErrTaskPointVariantsIsEmptyValue  = errors.New("task point: one or more variants options is blank")
	ErrTaskPointVariantsMoreMax       = errors.New("task point: variants more maximum")
	ErrTaskPointAnswerIncorrect       = errors.New("task point: one or more answer options is incorrect")
	ErrTaskPointAnswerIsEmpty         = errors.New("task point: answer is empty")
	ErrTaskPointAnswerNumberIncorrect = errors.New("task point: incorrect number answer")
)
View Source
var (
	ErrTaskSequenceZero      = errors.New("sequence number cannot be zero")
	ErrTaskSequenceAnswer    = errors.New("answer cannot be empty")
	ErrTaskSequenceIncorrect = errors.New("sequence is incorrect")
)
View Source
var ErrNoSuchValue = errors.New("competencies type: no such value")

Functions

func ValidateCodeCompetency

func ValidateCodeCompetency(code string) bool

func ValidateCodeIndicator

func ValidateCodeIndicator(code string) bool

Types

type Competency

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

func NewCompetency

func NewCompetency(param CompetencyParam) (*Competency, error)

func (Competency) Category

func (c Competency) Category() string

func (Competency) Code

func (c Competency) Code() string

func (Competency) CompetencyType

func (c Competency) CompetencyType() Type

func (Competency) ID

func (c Competency) ID() string

func (Competency) LevelID

func (c Competency) LevelID() string

func (Competency) ProgramID

func (c Competency) ProgramID() string

func (Competency) SpecialtyID

func (c Competency) SpecialtyID() string

func (Competency) Title

func (c Competency) Title() string

func (Competency) UgsnID

func (c Competency) UgsnID() string

type CompetencyParam

type CompetencyParam struct {
	ID             string
	Title          string
	Code           string
	Category       string
	LevelID        string
	UgsnID         string
	SpecialtyID    string
	ProgramID      string
	CompetencyType Type
}

type Indicator

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

func NewIndicator

func NewIndicator(param IndicatorParams) (*Indicator, error)

func (*Indicator) AddSubjectID

func (i *Indicator) AddSubjectID(subjectID string) error

func (*Indicator) Code

func (i *Indicator) Code() string

func (*Indicator) CompetencyID

func (i *Indicator) CompetencyID() string

func (*Indicator) ID

func (i *Indicator) ID() string

func (*Indicator) Rename

func (i *Indicator) Rename(title string) error

func (*Indicator) SubjectID

func (i *Indicator) SubjectID() string

func (*Indicator) Title

func (i *Indicator) Title() string

type IndicatorParams

type IndicatorParams struct {
	ID           string
	Title        string
	Code         string
	SubjectID    string
	CompetencyID string
}

type Question

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

func NewQuestion

func NewQuestion(params QuestionParams) (*Question, error)

func (*Question) CompleteAnswer

func (q *Question) CompleteAnswer() string

func (*Question) Data

func (q *Question) Data() QuestionData

func (*Question) Description

func (q *Question) Description() string

func (*Question) ID

func (q *Question) ID() string

func (*Question) IndicatorID

func (q *Question) IndicatorID() string

func (*Question) QuestionType

func (q *Question) QuestionType() QuestionType

func (*Question) Rank

func (q *Question) Rank() int

func (*Question) TaskConformity

func (q *Question) TaskConformity() []TaskConformity

func (*Question) TaskPoint

func (q *Question) TaskPoint() TaskPoint

func (*Question) TaskSequence

func (q *Question) TaskSequence() []TaskSequence

type QuestionData

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

type QuestionParams

type QuestionParams struct {
	ID             string
	Description    string
	IndicatorID    string
	CompleteAnswer string
	TaskPoint      TaskPointParams
	TaskSequence   []TaskSequenceParams
	TaskConformity []TaskConformityParams
	Rank           int
	QuestionType   QuestionType
}

type QuestionType

type QuestionType uint8
const (
	// Test - тип вопроса с выбором ответа одиночным или множественным.
	Test QuestionType = iota + 1

	// Sequence - тип вопроса с установкой последовательности ответов.
	Sequence

	// Conformity - тип вопроса с сопоставлением левой и правой части.
	Conformity

	// Complete - тип вопроса с дополнением.
	Complete

	// Essay - тип вопорса свободный ответ.
	Essay
)

func (QuestionType) IsValid

func (t QuestionType) IsValid() bool

type Subject

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

func NewSubject

func NewSubject(param SubjectParams) (*Subject, error)

func (*Subject) ChangeName

func (s *Subject) ChangeName(name string) error

func (*Subject) ChangeSName

func (s *Subject) ChangeSName(sname string) error

func (*Subject) ID

func (s *Subject) ID() string

func (*Subject) Name

func (s *Subject) Name() string

func (*Subject) SName

func (s *Subject) SName() string

type SubjectParams

type SubjectParams struct {
	ID    string
	Name  string
	Sname string
}

type TaskConformity

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

func NewTaskConformity

func NewTaskConformity(params TaskConformityParams) (*TaskConformity, error)

func (*TaskConformity) Left

func (t *TaskConformity) Left() string

func (*TaskConformity) Right

func (t *TaskConformity) Right() string

type TaskConformityParams

type TaskConformityParams struct {
	Left  string
	Right string
}

type TaskPoint

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

func NewTaskPoint

func NewTaskPoint(params TaskPointParams) (*TaskPoint, error)

func (*TaskPoint) Answer

func (t *TaskPoint) Answer() []int

func (*TaskPoint) IsSingle

func (t *TaskPoint) IsSingle() bool

func (*TaskPoint) Variants

func (t *TaskPoint) Variants() []string

type TaskPointParams

type TaskPointParams struct {
	Variants []string
	Answers  []int
	Single   bool
}

type TaskSequence

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

func NewTaskSequence

func NewTaskSequence(params TaskSequenceParams) (*TaskSequence, error)

func (*TaskSequence) Answer

func (s *TaskSequence) Answer() string

func (*TaskSequence) Sequence

func (s *TaskSequence) Sequence() int

type TaskSequenceParams

type TaskSequenceParams struct {
	Answer   string
	Sequence int
}

type Type

type Type uint8
const (
	UNIVERSAL    Type = 1
	GENERAL      Type = 2
	PROFESSIONAL Type = 3
)

Type - тип компетенции. Представляет собой enum.

func (Type) IsValid

func (t Type) IsValid() bool

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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