app

package
v0.0.0-...-4b23463 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCourseDoesntExist  = errors.New("course doesn't exist")
	ErrTeacherDoesntExist = errors.New("teacher doesn't exist")
	ErrStudentDoesntExist = errors.New("student doesn't exist")
	ErrGroupDoesntExist   = errors.New("group doesn't exist")
	ErrTaskDoesntExist    = errors.New("course task doesn't exist")
	ErrDatabaseProblems   = errors.New("database problems")
)

Functions

func Wrap

func Wrap(applicationError error, originError error) error

Types

type AddCollaboratorCommand

type AddCollaboratorCommand struct {
	Academic       course.Academic
	CourseID       string
	CollaboratorID string
}

type AddStudentCommand

type AddStudentCommand struct {
	Academic  course.Academic
	CourseID  string
	StudentID string
}

type AddTaskCommand

type AddTaskCommand struct {
	Academic        course.Academic
	CourseID        string
	TaskTitle       string
	TaskDescription string
	TaskType        course.TaskType
	Deadline        course.Deadline
	TestPoints      []course.TestPoint
	TestData        []course.TestData
}

type AllCoursesQuery

type AllCoursesQuery struct {
	Academic course.Academic
	Title    string
}

type AllTasksQuery

type AllTasksQuery struct {
	Academic course.Academic
	CourseID string
	Type     course.TaskType
	Text     string
}

type Application

type Application struct {
	Commands Commands
	Queries  Queries
}

type Commands

type Commands struct {
	CreateCourse       createCourseHandler
	ExtendCourse       extendCourseHandler
	AddCollaborator    addCollaboratorHandler
	RemoveCollaborator removeCollaboratorHandler
	AddStudent         addStudentHandler
	RemoveStudent      removeStudentHandler
	AddTask            addTaskHandler
}

type CommonCourse

type CommonCourse struct {
	ID          string
	Title       string
	Period      Period
	CreatorID   string
	Started     bool
	TasksNumber int
}

type CreateCourseCommand

type CreateCourseCommand struct {
	Academic      course.Academic
	CourseStarted bool
	CourseTitle   string
	CoursePeriod  course.Period
}

type Deadline

type Deadline struct {
	ExcellentGradeTime time.Time
	GoodGradeTime      time.Time
}

type ExtendCourseCommand

type ExtendCourseCommand struct {
	Academic       course.Academic
	OriginCourseID string
	CourseStarted  bool
	CourseTitle    string
	CoursePeriod   course.Period
}

type GeneralTask

type GeneralTask struct {
	Number      int
	Title       string
	Description string
	Type        course.TaskType
}

type Period

type Period struct {
	AcademicStartYear int
	AcademicEndYear   int
	Semester          course.Semester
}

type Queries

type Queries struct {
	SpecificCourse specificCourseHandler
	AllCourses     allCoursesHandler
	SpecificTask   specificTaskHandler
	AllTasks       allTasksHandler
}

type RemoveCollaboratorCommand

type RemoveCollaboratorCommand struct {
	Academic       course.Academic
	CourseID       string
	CollaboratorID string
}

type RemoveStudentCommand

type RemoveStudentCommand struct {
	Academic  course.Academic
	CourseID  string
	StudentID string
}

type SpecificCourseQuery

type SpecificCourseQuery struct {
	Academic course.Academic
	CourseID string
}

type SpecificTask

type SpecificTask struct {
	Number      int
	Title       string
	Description string
	Type        course.TaskType
	Deadline    *Deadline
	TestData    []TestData
	Points      []TestPoint
}

type SpecificTaskQuery

type SpecificTaskQuery struct {
	Academic   course.Academic
	CourseID   string
	TaskNumber int
}

type TestData

type TestData struct {
	InputData  string
	OutputData string
}

type TestPoint

type TestPoint struct {
	Description           string
	Variants              []string
	CorrectVariantNumbers []int
	SingleCorrectVariant  bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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