Documentation ¶
Index ¶
- Variables
- func IsAcademicCantEditCourseError(err error) bool
- func IsInvalidCourseParametersError(err error) bool
- func IsInvalidDeadlineError(err error) bool
- func IsInvalidTaskParametersError(err error) bool
- func IsInvalidTestDataError(err error) bool
- func IsInvalidTestPointError(err error) bool
- type Academic
- type AcademicCantEditCourseError
- type AcademicType
- type Access
- type AutoCodeCheckingTaskCreationParams
- type Course
- func (c *Course) AddAutoCodeCheckingTask(academic Academic, params AutoCodeCheckingTaskCreationParams) (int, error)
- func (c *Course) AddCollaborators(academic Academic, teacherIDs ...string) error
- func (c *Course) AddManualCheckingTask(academic Academic, params ManualCheckingTaskCreationParams) (int, error)
- func (c *Course) AddStudents(academic Academic, studentIDs ...string) error
- func (c *Course) AddTestingTask(academic Academic, params TestingTaskCreationParams) (int, error)
- func (c *Course) Collaborators() []string
- func (c *Course) CreatorID() string
- func (c *Course) Extend(params CreationParams) (*Course, error)
- func (c *Course) ID() string
- func (c *Course) Period() Period
- func (c *Course) RemoveCollaborator(academic Academic, teacherID string) error
- func (c *Course) RemoveStudent(academic Academic, studentID string) error
- func (c *Course) RenameTask(academic Academic, taskNumber int, title string) error
- func (c *Course) ReplaceTaskDeadline(academic Academic, taskNumber int, deadline Deadline) error
- func (c *Course) ReplaceTaskDescription(academic Academic, taskNumber int, description string) error
- func (c *Course) ReplaceTaskTestData(academic Academic, taskNumber int, testData []TestData) error
- func (c *Course) ReplaceTaskTestPoints(academic Academic, taskNumber int, testPoints []TestPoint) error
- func (c *Course) Started() bool
- func (c *Course) Students() []string
- func (c *Course) Task(taskNumber int) (Task, error)
- func (c *Course) Tasks() []Task
- func (c *Course) TasksNumber() int
- func (c *Course) Title() string
- type CreationParams
- type Deadline
- type ManualCheckingTaskCreationParams
- type Period
- type Semester
- type Task
- type TaskType
- type TestData
- type TestPoint
- type TestingTaskCreationParams
- type UnmarshallingParams
- type UnmarshallingTaskParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyAcademicID = errors.New("empty academic id") ErrInvalidAcademicType = errors.New("invalid academic type") ErrNotTeacherCantCreateCourse = errors.New("not teacher can't create course") )
View Source
var ( ErrEmptyCourseID = errors.New("empty course id") ErrZeroCreator = errors.New("empty course creator id") ErrEmptyCourseTitle = errors.New("empty course title") ErrZeroCoursePeriod = errors.New("zero course period") )
View Source
var ( ErrZeroExcellentGradeTime = errors.New("zero excellent grade time") ErrZeroGoodGradeTime = errors.New("zero good grade time") ErrExcellentGradeTimeAfterGood = errors.New("excellent grade time after good") )
View Source
var ( ErrStartYearAfterEnd = errors.New("academic start year after end") ErrYearDurationOverYear = errors.New("academic year duration over year") ErrStartYearEqualsEndYear = errors.New("academic start year equals end year") ErrInvalidSemester = errors.New("invalid academic semester") )
View Source
var ( ErrTaskHasNoDeadline = errors.New("task has no deadline") ErrTaskHasNoTestPoints = errors.New("task has no test points") ErrTaskHasNoTestData = errors.New("task has no test data") ErrTaskTitleTooLong = errors.New("task title too long") ErrTaskDescriptionTooLong = errors.New("task description too long") ErrCourseHasNoSuchTask = errors.New("course has no such task") )
View Source
var ( ErrTestInputDataTooLong = errors.New("test input data too long") ErrTestOutputDataTooLong = errors.New("test output data too long") )
View Source
var ( ErrTestPointDescriptionTooLong = errors.New("test point description too long") ErrEmptyTestPointVariants = errors.New("empty test point variants") ErrEmptyTestPointCorrectVariants = errors.New("test points has no correct variants") ErrTooMuchTestPointCorrectVariants = errors.New("test point has too much correct variants") ErrInvalidTestPointVariantNumber = errors.New("invalid test point variant number") )
View Source
var ErrCourseHasNoSuchCollaborator = errors.New("course has no such collaborator")
View Source
var ErrCourseHasNoSuchStudent = errors.New("course has no such student")
Functions ¶
func IsInvalidDeadlineError ¶
func IsInvalidTestDataError ¶
func IsInvalidTestPointError ¶
Types ¶
type Academic ¶
type Academic struct {
// contains filtered or unexported fields
}
func MustNewAcademic ¶
func MustNewAcademic(id string, t AcademicType) Academic
func NewAcademic ¶
func NewAcademic(id string, t AcademicType) (Academic, error)
func (Academic) Type ¶
func (a Academic) Type() AcademicType
type AcademicCantEditCourseError ¶
type AcademicCantEditCourseError struct {
// contains filtered or unexported fields
}
func (AcademicCantEditCourseError) Error ¶
func (e AcademicCantEditCourseError) Error() string
type AcademicType ¶
type AcademicType uint8
const ( TeacherType AcademicType = iota + 1 StudentType )
func NewAcademicTypeFromString ¶
func NewAcademicTypeFromString(value string) AcademicType
func (AcademicType) IsValid ¶
func (at AcademicType) IsValid() bool
func (AcademicType) String ¶
func (at AcademicType) String() string
type Course ¶
type Course struct {
// contains filtered or unexported fields
}
func MustNewCourse ¶
func MustNewCourse(params CreationParams) *Course
func NewCourse ¶
func NewCourse(params CreationParams) (*Course, error)
func UnmarshalFromDatabase ¶
func UnmarshalFromDatabase(params UnmarshallingParams) *Course
UnmarshalFromDatabase unmarshalls Course from the database. It should be used only for unmarshalling from the database! Using UnmarshalFromDatabase may put domain into the invalid state!
func (*Course) AddAutoCodeCheckingTask ¶
func (c *Course) AddAutoCodeCheckingTask(academic Academic, params AutoCodeCheckingTaskCreationParams) (int, error)
func (*Course) AddCollaborators ¶
func (*Course) AddManualCheckingTask ¶
func (c *Course) AddManualCheckingTask(academic Academic, params ManualCheckingTaskCreationParams) (int, error)
func (*Course) AddStudents ¶
func (*Course) AddTestingTask ¶
func (c *Course) AddTestingTask(academic Academic, params TestingTaskCreationParams) (int, error)
func (*Course) Collaborators ¶
func (*Course) RemoveCollaborator ¶
func (*Course) RemoveStudent ¶
func (*Course) RenameTask ¶
func (*Course) ReplaceTaskDeadline ¶
func (*Course) ReplaceTaskDescription ¶
func (*Course) ReplaceTaskTestData ¶
func (*Course) ReplaceTaskTestPoints ¶
func (*Course) TasksNumber ¶
type CreationParams ¶
type Deadline ¶
type Deadline struct {
// contains filtered or unexported fields
}
func MustNewDeadline ¶
func NewDeadline ¶
func (Deadline) ExcellentGradeTime ¶
func (Deadline) GoodGradeTime ¶
type Period ¶
type Period struct {
// contains filtered or unexported fields
}
func MustNewPeriod ¶
func (Period) AcademicEndYear ¶
func (Period) AcademicStartYear ¶
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func (*Task) Description ¶
func (*Task) TestPoints ¶
type TestData ¶
type TestData struct {
// contains filtered or unexported fields
}
func MustNewTestData ¶
func NewTestData ¶
func (TestData) OutputData ¶
type TestPoint ¶
type TestPoint struct {
// contains filtered or unexported fields
}
func MustNewTestPoint ¶
func NewTestPoint ¶
func (TestPoint) CorrectVariantNumbers ¶
func (TestPoint) Description ¶
type UnmarshallingParams ¶
Click to show internal directories.
Click to hide internal directories.