Documentation ¶
Index ¶
- type DBModel
- func (m *DBModel) AllActiveCourses() ([]clientmodels.Course, error)
- func (m *DBModel) AllActiveSections() ([]clientmodels.Section, error)
- func (m *DBModel) AllActiveSectionsForStudentID(id int) ([]clientmodels.Section, error)
- func (m *DBModel) AllAssignments(id int) ([]clientmodels.Assignment, error)
- func (m *DBModel) AllCourses() ([]clientmodels.Course, error)
- func (m *DBModel) AllSections() ([]clientmodels.Section, error)
- func (m *DBModel) AllStudents() ([]clientmodels.Student, error)
- func (m *DBModel) CourseAccessHistoryForStudent(userID int) ([]clientmodels.CourseAccess, error)
- func (m *DBModel) CourseSectionAccessHistory(sectionID int) ([]clientmodels.CourseAccess, error)
- func (m *DBModel) DeleteSection(id int) error
- func (m *DBModel) GetAssignment(id int) (clientmodels.Assignment, error)
- func (m *DBModel) GetCourse(id int) (clientmodels.Course, error)
- func (m *DBModel) GetCourseForPublic(id int) (clientmodels.Course, error)
- func (m *DBModel) GetCourseSection(id int) (clientmodels.Section, error)
- func (m *DBModel) GetLecture(id int) (clientmodels.Lecture, error)
- func (m *DBModel) GetLectureForSection(id, sectionID int) (clientmodels.Lecture, error)
- func (m *DBModel) GetNextPreviousLectures(courseID, lectureID int) (int, int, error)
- func (m *DBModel) GetSection(id int) (clientmodels.Section, error)
- func (m *DBModel) GetTrafficForCourseForStudent(id, studentID int) ([]clientmodels.CourseTraffic, error)
- func (m *DBModel) GetTrafficForCourseSection(id int) ([]clientmodels.CourseTraffic, error)
- func (m *DBModel) GradeAssignment(a clientmodels.Assignment) error
- func (m *DBModel) InsertAssignment(c clientmodels.Assignment) (int, error)
- func (m *DBModel) InsertCourse(c clientmodels.Course) (int, error)
- func (m *DBModel) InsertLecture(c clientmodels.Lecture) (int, error)
- func (m *DBModel) InsertSection(c clientmodels.Section) (int, error)
- func (m *DBModel) RecordCourseAccess(a clientmodels.CourseAccess) error
- func (m *DBModel) RemoveStudentFromSection(id, sectionID int) error
- func (m *DBModel) StudentsForSection(id int) ([]clientmodels.Student, error)
- func (m *DBModel) UpdateAssignment(a clientmodels.Assignment) error
- func (m *DBModel) UpdateCourse(c clientmodels.Course) error
- func (m *DBModel) UpdateCourseContent(c clientmodels.Course) error
- func (m *DBModel) UpdateEnrollmentForSection(id int, students []string) error
- func (m *DBModel) UpdateLecture(c clientmodels.Lecture) error
- func (m *DBModel) UpdateLectureContent(c clientmodels.Lecture) error
- func (m *DBModel) UpdateLectureSortOrder(id, order int) error
- func (m *DBModel) UpdateSection(c clientmodels.Section) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBModel ¶
DBModel holds the database
func (*DBModel) AllActiveCourses ¶
func (m *DBModel) AllActiveCourses() ([]clientmodels.Course, error)
AllActiveCourses returns slice of active courses (without lectures)
func (*DBModel) AllActiveSections ¶ added in v1.4.0
func (m *DBModel) AllActiveSections() ([]clientmodels.Section, error)
AllActiveSections returns slice of all active sections
func (*DBModel) AllActiveSectionsForStudentID ¶ added in v1.5.0
func (m *DBModel) AllActiveSectionsForStudentID(id int) ([]clientmodels.Section, error)
AllActiveSectionsForStudentID returns slice of all active sections for a student
func (*DBModel) AllAssignments ¶ added in v1.0.2
func (m *DBModel) AllAssignments(id int) ([]clientmodels.Assignment, error)
AllAssignments gets assignments
func (*DBModel) AllCourses ¶
func (m *DBModel) AllCourses() ([]clientmodels.Course, error)
AllCourses returns slice of courses (without lectures)
func (*DBModel) AllSections ¶ added in v1.4.0
func (m *DBModel) AllSections() ([]clientmodels.Section, error)
AllSections returns slice of all sections
func (*DBModel) AllStudents ¶ added in v1.1.2
func (m *DBModel) AllStudents() ([]clientmodels.Student, error)
AllStudents returns all students
func (*DBModel) CourseAccessHistoryForStudent ¶ added in v1.1.2
func (m *DBModel) CourseAccessHistoryForStudent(userID int) ([]clientmodels.CourseAccess, error)
CourseAccessHistoryForStudent gets access history for a course by id
func (*DBModel) CourseSectionAccessHistory ¶ added in v1.4.0
func (m *DBModel) CourseSectionAccessHistory(sectionID int) ([]clientmodels.CourseAccess, error)
CourseSectionAccessHistory gets access history for a course by id
func (*DBModel) DeleteSection ¶ added in v1.4.0
DeleteSection deletes a course section
func (*DBModel) GetAssignment ¶ added in v1.1.0
func (m *DBModel) GetAssignment(id int) (clientmodels.Assignment, error)
GetAssignment gets one assignment
func (*DBModel) GetCourse ¶
func (m *DBModel) GetCourse(id int) (clientmodels.Course, error)
GetCourse gets a course (for admin) with all lectures
func (*DBModel) GetCourseForPublic ¶
func (m *DBModel) GetCourseForPublic(id int) (clientmodels.Course, error)
GetCourseForPublic gets a course with only active lectures (for students)
func (*DBModel) GetCourseSection ¶ added in v1.4.0
func (m *DBModel) GetCourseSection(id int) (clientmodels.Section, error)
GetCourseSection gets a course (for admin) with all lectures
func (*DBModel) GetLecture ¶
func (m *DBModel) GetLecture(id int) (clientmodels.Lecture, error)
GetLecture returns one lecture
func (*DBModel) GetLectureForSection ¶ added in v1.4.0
func (m *DBModel) GetLectureForSection(id, sectionID int) (clientmodels.Lecture, error)
GetLectureForSection returns one lecture with section info
func (*DBModel) GetNextPreviousLectures ¶ added in v1.0.1
GetNextPreviousLectures gets ids for next/previous buttons
func (*DBModel) GetSection ¶ added in v1.4.0
func (m *DBModel) GetSection(id int) (clientmodels.Section, error)
GetSection gets a section
func (*DBModel) GetTrafficForCourseForStudent ¶ added in v1.3.1
func (m *DBModel) GetTrafficForCourseForStudent(id, studentID int) ([]clientmodels.CourseTraffic, error)
GetTrafficForCourseForStudent gets chart data
func (*DBModel) GetTrafficForCourseSection ¶ added in v1.4.0
func (m *DBModel) GetTrafficForCourseSection(id int) ([]clientmodels.CourseTraffic, error)
GetTrafficForCourseSection gets chart data for section
func (*DBModel) GradeAssignment ¶ added in v1.1.0
func (m *DBModel) GradeAssignment(a clientmodels.Assignment) error
GradeAssignment assigns a grade
func (*DBModel) InsertAssignment ¶ added in v1.0.2
func (m *DBModel) InsertAssignment(c clientmodels.Assignment) (int, error)
InsertAssignment inserts an assignment and returns new id
func (*DBModel) InsertCourse ¶
func (m *DBModel) InsertCourse(c clientmodels.Course) (int, error)
InsertCourse inserts a course and returns new id
func (*DBModel) InsertLecture ¶
func (m *DBModel) InsertLecture(c clientmodels.Lecture) (int, error)
InsertLecture inserts a lecture lecture and returns new id
func (*DBModel) InsertSection ¶ added in v1.4.0
func (m *DBModel) InsertSection(c clientmodels.Section) (int, error)
InsertSection inserts a course section
func (*DBModel) RecordCourseAccess ¶ added in v1.1.0
func (m *DBModel) RecordCourseAccess(a clientmodels.CourseAccess) error
RecordCourseAccess records a student starting/leaving a lecture
func (*DBModel) RemoveStudentFromSection ¶ added in v1.4.0
RemoveStudentFromSection deletes a student from a course section
func (*DBModel) StudentsForSection ¶ added in v1.4.0
func (m *DBModel) StudentsForSection(id int) ([]clientmodels.Student, error)
StudentsForSection returns slice of all students, and whether registered or not
func (*DBModel) UpdateAssignment ¶ added in v1.0.2
func (m *DBModel) UpdateAssignment(a clientmodels.Assignment) error
UpdateAssignment updates an assignment (grading)
func (*DBModel) UpdateCourse ¶
func (m *DBModel) UpdateCourse(c clientmodels.Course) error
UpdateCourse updates a course
func (*DBModel) UpdateCourseContent ¶ added in v1.0.1
func (m *DBModel) UpdateCourseContent(c clientmodels.Course) error
UpdateCourseContent updates a course content (description)
func (*DBModel) UpdateEnrollmentForSection ¶ added in v1.4.0
UpdateEnrollmentForSection manages student enrollment
func (*DBModel) UpdateLecture ¶
func (m *DBModel) UpdateLecture(c clientmodels.Lecture) error
UpdateLecture updates a course lecture
func (*DBModel) UpdateLectureContent ¶ added in v1.0.1
func (m *DBModel) UpdateLectureContent(c clientmodels.Lecture) error
UpdateLectureContent updates a course lecture content (notes)
func (*DBModel) UpdateLectureSortOrder ¶
UpdateLectureSortOrder updates sort order
func (*DBModel) UpdateSection ¶ added in v1.4.0
func (m *DBModel) UpdateSection(c clientmodels.Section) error
UpdateSection updates a course section