Documentation ¶
Index ¶
- Variables
- func GetTestReportByReportID(reportId string) (StudentReport, []TestResults, error)
- type Data
- type Notification
- type NotificationInput
- type ReportInput
- type Response
- func AddNewStudent(input StudentInput, imageData string) (Response, error)
- func AddNewTeacher(input TeacherInput) (Response, error)
- func AddStudentNotification(notificationInput []NotificationInput, message string) (Response, error)
- func AdminLogin(username, password string) (Response, error)
- func Login(username, password string) (Response, error)
- func UpdateStudentByStudentID(input StudentInput) (Response, error)
- func UpdateTeacherByTeacherID(input TeacherInput) (Response, error)
- type Student
- type StudentInput
- type StudentList
- type StudentReport
- type Teacher
- type TeacherInput
- type TestResults
- type TestResultsInput
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func GetTestReportByReportID ¶
func GetTestReportByReportID(reportId string) (StudentReport, []TestResults, error)
This generates the report of a paricular student based on his/her reportID.
Types ¶
type Data ¶
type Data struct { StudentReport StudentReport TestResults []TestResults }
func SaveStudentReport ¶
func SaveStudentReport(report *ReportInput, testResults []TestResultsInput) (Data, error)
Saves new student report
type Notification ¶
type Notification struct { ID string `gorm:"primary_key;not null"` StudentName string StudentID string Message string `gorm:"type:text"` CreatedAt string `gorm:"unique;not null"` Type string `gorm:"default:'ADMIN'"` MarkRead bool `gorm:"default: false"` Total int `gorm:"-"` }
func AllNotifications ¶
func AllNotifications() ([]Notification, error)
func GetAdminNotificationByStudentID ¶
func GetAdminNotificationByStudentID(studentId string) ([]Notification, error)
func MarkNotificationAsRead ¶
func MarkNotificationAsRead(notificationId string) (Notification, error)
func NotificationsStudentList ¶
func NotificationsStudentList(createdAt string) ([]Notification, error)
type NotificationInput ¶
type ReportInput ¶
type ReportInput struct { ID string `json:"id"` StudentID string `json:"studentId"` TeacherID string `json:"teacherId"` Date string `json:"date"` HwCompletion string `json:"hwCompletion"` VocabularyCompletion string `json:"vocabularyCompletion"` ClassParticipation string `json:"classParticipation"` DictionaryUse string `json:"dictionaryUse"` TestCorrection string `json:"testCorrection"` Feedback string `json:"feedback"` ConversationClub bool `json:"conversationClub"` Workshops bool `json:"workshop"` MovieClub bool `json:"movieClub"` ReadingClub bool `json:"readingClub"` }
type Response ¶
type Response struct { ID string `json:"id"` Status bool `json:"status"` Message string `json:"message"` Token string `json:"token"` Role string StudentName string }
func AddNewStudent ¶
func AddNewStudent(input StudentInput, imageData string) (Response, error)
Adds new student in db..
func AddNewTeacher ¶
func AddNewTeacher(input TeacherInput) (Response, error)
Adds new teacher into the db...
func AddStudentNotification ¶
func AddStudentNotification(notificationInput []NotificationInput, message string) (Response, error)
func UpdateStudentByStudentID ¶
func UpdateStudentByStudentID(input StudentInput) (Response, error)
func UpdateTeacherByTeacherID ¶
func UpdateTeacherByTeacherID(input TeacherInput) (Response, error)
type Student ¶
type Student struct { ID string `gorm:"primary_key;not null"` StudentName string Status int TeacherID string ParentName string Username string Password string TeacherName string `gorm:"-"` ImageUrl string }
func GetStudentDetails ¶
Fetches student details for admin
type StudentInput ¶
type StudentList ¶
type StudentList struct { Name string `json:"name"` ID string `json:"id"` Date string `json:"date"` Subject string `json:"subject"` Teacher string `json:"teacher"` ImageUrl string }
func GetStudentList ¶
func GetStudentList(teacherId string) ([]StudentList, error)
Fetches the list of students for given teacher id.
func GetStudentListForAdmin ¶
func GetStudentListForAdmin() ([]StudentList, error)
Generates student list for admin
type StudentReport ¶
type StudentReport struct { ID string `gorm:"primary_key;not null"` StudentID string `gorm:"not null"` Date string `gorm:"type:varchar(10)"` HwCompletion string VocabularyCompletion string ClassParticipation string DictionaryUse string ConversationClub bool Workshops bool MovieClub bool ReadingClub bool MarkRead bool TestCorrection string Feedback string TeacherID string Type string `gorm:"default:'TEACHER'"` }
func GetStudentTestReportsByStudentID ¶
func GetStudentTestReportsByStudentID(studentId string) ([]StudentReport, error)
This generates all the Test Reports of a particular student based on his StudentID.
func MarkReportAsRead ¶
func MarkReportAsRead(reportId string) (StudentReport, error)
Mark the report as read.
func UpdateStudentReportByReportID ¶
func UpdateStudentReportByReportID(report *ReportInput, testResults []TestResultsInput) (StudentReport, error)
Updates the previous student report..
type Teacher ¶
type Teacher struct { ID string `gorm:"primary_key;not null"` Name string Subject string Username string Password string Count int `gorm:"-"` }
func GetTeacherByTeacherID ¶
Gets teacher details by teacher id for admin
type TeacherInput ¶
type TestResults ¶
type TestResultsInput ¶
Click to show internal directories.
Click to hide internal directories.