model

package
v0.0.0-...-0985497 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Course

type Course struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at,omitempty"`
	UpdatedAt time.Time `db:"updated_at,omitempty"`

	Name               string    `db:"name"`
	Description        string    `db:"description"`
	BeginsAt           time.Time `db:"begins_at"`
	EndsAt             time.Time `db:"ends_at"`
	RequiredPercentage int       `db:"required_percentage"`
}

Course holds specific application settings linked to an entity, which represents a course

type Enrollment

type Enrollment struct {
	ID       int64 `db:"id"`
	CourseID int64 `db:"course_id"`
	Role     int64 `db:"role"`
}

Enrollment represents a an enrollment-type of a given user

type Exam

type Exam struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at,omitempty"`
	UpdatedAt time.Time `db:"updated_at,omitempty"`

	Name        string    `db:"name"`
	Description string    `db:"description"`
	ExamTime    time.Time `db:"exam_time"`
	CourseID    int64     `db:"course_id"`
}

Course holds specific application settings linked to an entity, which represents a course

type Grade

type Grade struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at,omitempty"`
	UpdatedAt time.Time `db:"updated_at,omitempty"`

	PublicExecutionState  int    `db:"public_execution_state"`
	PrivateExecutionState int    `db:"private_execution_state"`
	PublicTestLog         string `db:"public_test_log"`
	PrivateTestLog        string `db:"private_test_log"`
	PublicTestStatus      int    `db:"public_test_status"`
	PrivateTestStatus     int    `db:"private_test_status"`
	AcquiredPoints        int    `db:"acquired_points"`
	Feedback              string `db:"feedback"`
	TutorID               int64  `db:"tutor_id"`
	SubmissionID          int64  `db:"submission_id"`
	UserID                int64  `db:"user_id,readonly"`
	UserFirstName         string `db:"user_first_name,readonly"`
	UserLastName          string `db:"user_last_name,readonly"`
	UserEmail             string `db:"user_email,readonly"`
}

Grade is a database view representing a all information used for grading programming assignments solutions

type Group

type Group struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at,omitempty"`
	UpdatedAt time.Time `db:"updated_at,omitempty"`

	TutorID     int64  `db:"tutor_id"`
	CourseID    int64  `db:"course_id"`
	Description string `db:"description"`
}

Group is a database view for a group entity

type GroupBid

type GroupBid struct {
	ID int64 `db:"id"`

	UserID  int64 `db:"user_id"`
	GroupID int64 `db:"group_id"`
	Bid     int   `db:"bid"`
}

GroupBid is a database view of a bid by a student for a specific exercise group

type GroupEnrollment

type GroupEnrollment struct {
	ID int64 `db:"id"`

	UserID  int64 `db:"user_id"`
	GroupID int64 `db:"group_id"`
}

GroupEnrollment is a database view for an enrollment of a student into a group. Note, Tutors (a person who manage a group) is not enrolled in the group.

type GroupWithTutor

type GroupWithTutor struct {
	Group

	TutorFirstName string      `db:"tutor_first_name"`
	TutorLastName  string      `db:"tutor_last_name"`
	TutorAvatarURL null.String `db:"tutor_avatar_url"`
	TutorEmail     string      `db:"tutor_email"`
	TutorLanguage  string      `db:"tutor_language"`
}

GroupWithTutor is a database view of a group including tutor information

type Material

type Material struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at,omitempty"`
	UpdatedAt time.Time `db:"updated_at,omitempty"`

	Name         string    `db:"name"`
	Kind         int       `db:"kind"`
	Filename     string    `db:"filename"`
	PublishAt    time.Time `db:"publish_at"`
	LectureAt    time.Time `db:"lecture_at"`
	RequiredRole int       `db:"required_role"`
}

Material are elements in a course like slides, additional code examples, ...

type MissingGrade

type MissingGrade struct {
	Grade
	CourseID int64 `db:"course_id"`
	SheetID  int64 `db:"sheet_id"`
	TaskID   int64 `db:"task_id"`
}

MissingGrade is a database view containing all grades which are finished yet. We expects TAs to give at least a feedback.

type MissingTask

type MissingTask struct {
	*Task

	SheetID  int64 `db:"sheet_id"`
	CourseID int64 `db:"course_id"`
}

MissingTask is an item in the list of tasks a user has not uploaded any solution (this is used by the dashboard)

type OverviewGrade

type OverviewGrade struct {
	UserID            int64  `db:"user_id"`
	UserFirstName     string `db:"user_first_name"`
	UserLastName      string `db:"user_last_name"`
	UserStudentNumber string `db:"user_student_number"`
	UserEmail         string `db:"user_email"`

	SheetID int64  `db:"sheet_id"`
	Name    string `db:"name"`
	Points  int    `db:"points"`
}

OverviewGrade is a database view containing informations for grades from a query (for a summary view).

type Sheet

type Sheet struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at,omitempty"`
	UpdatedAt time.Time `db:"updated_at,omitempty"`

	Name      string    `db:"name"`
	PublishAt time.Time `db:"publish_at"`
	DueAt     time.Time `db:"due_at"`
}

Sheet is a database entity representing an entire exercise sheet consisting of tasks.

type SheetPoints

type SheetPoints struct {
	AquiredPoints    int `db:"acquired_points"`
	AchievablePoints int `db:"achievable_points"`
	MaxPoints        int `db:"max_points"`
	SheetID          int `db:"sheet_id"`
}

SheetPoints contains the performance of a specific student

type Submission

type Submission struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at,omitempty"`
	UpdatedAt time.Time `db:"updated_at,omitempty"`

	UserID int64 `db:"user_id"`
	TaskID int64 `db:"task_id"`
}

Submission is an database entity linking an upload by a student to an exercise task.

type Task

type Task struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at,omitempty"`
	UpdatedAt time.Time `db:"updated_at,omitempty"`

	Name               string      `db:"name"`
	MaxPoints          int         `db:"max_points"`
	PublicDockerImage  null.String `db:"public_docker_image"`
	PrivateDockerImage null.String `db:"private_docker_image"`
}

Task is part of an exercise sheet

type TaskPoints

type TaskPoints struct {
	AchievablePoints int `db:"achievable_points"`
	AquiredPoints    int `db:"acquired_points"`
	MaxPoints        int `db:"max_points"`
	TaskID           int `db:"task_id"`
}

TaskPoints is a performance summary of a student for a given task

func (*TaskPoints) Validate

func (body *TaskPoints) Validate() error

Validate validates TaskPoints

type TaskRating

type TaskRating struct {
	ID int64 `db:"id"`

	UserID int64 `db:"user_id"`
	TaskID int64 `db:"task_id"`
	Rating int   `db:"rating"`
}

TaskRating contains the feedback of students to a task.

func (*TaskRating) Validate

func (body *TaskRating) Validate() error

Validate validates a TaskRating before interacting with a database TODO(): should be part of the request

type User

type User struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at,omitempty"`
	UpdatedAt time.Time `db:"updated_at,omitempty"`

	FirstName     string      `db:"first_name"`
	LastName      string      `db:"last_name"`
	AvatarURL     null.String `db:"avatar_url"`
	Email         string      `db:"email"`
	StudentNumber string      `db:"student_number"`
	Semester      int         `db:"semester"`
	Subject       string      `db:"subject"`
	Language      string      `db:"language"`

	EncryptedPassword  string      `db:"encrypted_password"`
	ResetPasswordToken null.String `db:"reset_password_token"`
	ConfirmEmailToken  null.String `db:"confirm_email_token"`
	Root               bool        `db:"root"`
}

User holds specific application settings linked to an entity, who can login.

func (*User) FullName

func (m *User) FullName() string

FullName is a wrapper for returning the fullname of a user

type UserCourse

type UserCourse struct {
	UserID int64 `db:"id"`
	ID     int64 `db:"id"`

	Role int64 `db:"role"`

	FirstName     string      `db:"first_name"`
	LastName      string      `db:"last_name"`
	AvatarURL     null.String `db:"avatar_url"`
	Email         string      `db:"email"`
	StudentNumber string      `db:"student_number"`
	Semester      int         `db:"semester"`
	Subject       string      `db:"subject"`
	Language      string      `db:"language"`
}

UserCourse gives enrollment information for multiple users

type UserExam

type UserExam struct {
	ID       int64 `db:"id"`
	UserID   int64 `db:"user_id"`
	ExamID   int64 `db:"exam_id"`
	CourseID int64 `db:"course_id,readonly"`

	Status int    `db:"status"`
	Mark   string `db:"mark"`
}

Enrollment represents a an enrollment-type of a given user

Jump to

Keyboard shortcuts

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