Documentation
¶
Index ¶
- Variables
- func AddAssignmentToClassroom(assignment *models.Assignment, classroom *models.Classroom) error
- func AddStudentToAssignmentBlacklist(userID, assignmentID uint) error
- func AddUserToClassroom(UserID uint, ClassroomCode string, IsTeacher bool) error
- func ChangeActiveStatusInstantTest(active bool, privateCode string) (err error)
- func Connect(dsn string) (*gorm.DB, error)
- func CreateClassroom(Name string, TeacherID uint) (*models.Classroom, error)
- func CreateInstantTest(questions []models.Question, email string) (privateCode, publicCode string, err error)
- func CreateNewUser(UniversityID string, Name string, Email string, Password string, ...) (err error)
- func ExcuseStudentFromAssignmentBlacklist(userID, assignmentID uint) error
- func GetAssignment(assignmentID uint) (*models.Assignment, error)
- func GetAssignmentBlacklist(assignmentID uint) ([]models.User, error)
- func GetAssignmentForAIVerification(assignmentID uint) (models.Assignment, error)
- func GetAssignmentForEdit(assignmentID uint) (models.Assignment, error)
- func GetAssignmentSubmissionPerStudent(assignmentID, userID uint) (submission models.AssignmentSubmission, questionIDs []uint, ...)
- func GetAssignmentSubmissions(assignmentID uint) (submissions []models.AssignmentSubmission, questionIDs []uint, err error)
- func GetClassroom(ClassroomCode string) (*models.Classroom, error)
- func GetClassroomByID(classroomID uint) (*models.Classroom, error)
- func GetInstantTest(publicCode string) (questions []models.Question, isActive bool, err error)
- func GetInstantTestByPrivateCode(privateCode string) (models.InstantTest, error)
- func GetInstantTestSubmissions(privateCode string) ([]models.InstantTestSubmission, []uint, bool, error)
- func GetUserByID(userID uint) (user models.User, err error)
- func GetUserByUniversityIDPassword(UniversityID string, Password string) (user models.User, err error)
- func SaveAssignment(assignment models.Assignment) error
- func SaveInstantTest(instantTest models.InstantTest) error
- func SetVivaScore(assignmentID, userID, questionID uint, score int) error
- func UpsertAssignmentSubmissionAndAnswers(assignmentID uint, userID uint, universityID string, newAnswer models.Answer) (uint, error)
- func UpsertSubmissionAndAnswers(instantTestID uint, universityID string, newAnswer models.Answer) error
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB // other packages can access this variable
View Source
var DBLock sync.Mutex
Functions ¶
func AddAssignmentToClassroom ¶
func AddAssignmentToClassroom(assignment *models.Assignment, classroom *models.Classroom) error
func AddUserToClassroom ¶
func CreateInstantTest ¶
func CreateNewUser ¶
func GetAssignment ¶
func GetAssignment(assignmentID uint) (*models.Assignment, error)
func GetAssignmentBlacklist ¶
this function returns the list of students that are blacklisted from an assignment
func GetAssignmentForAIVerification ¶
func GetAssignmentForAIVerification(assignmentID uint) (models.Assignment, error)
The difference between this function and GetAssignment is that this also fetches test cases, submissions, etc
func GetAssignmentForEdit ¶
func GetAssignmentForEdit(assignmentID uint) (models.Assignment, error)
func GetAssignmentSubmissions ¶
func GetAssignmentSubmissions(assignmentID uint) (submissions []models.AssignmentSubmission, questionIDs []uint, err error)
func GetInstantTest ¶
func GetInstantTestByPrivateCode ¶
func GetInstantTestByPrivateCode(privateCode string) (models.InstantTest, error)
func GetInstantTestSubmissions ¶
func GetInstantTestSubmissions(privateCode string) ([]models.InstantTestSubmission, []uint, bool, error)
This function fetches all submissions in a given instant test and returns it as an array it also returns an array of questionIDs and a boolean stating if the test is active
func SaveAssignment ¶
func SaveAssignment(assignment models.Assignment) error
func SaveInstantTest ¶
func SaveInstantTest(instantTest models.InstantTest) error
func SetVivaScore ¶
func UpsertAssignmentSubmissionAndAnswers ¶
func UpsertAssignmentSubmissionAndAnswers(assignmentID uint, userID uint, universityID string, newAnswer models.Answer) (uint, error)
the below function is used to update the submission and answers of a student if the submission exists, we update it. If not, it's created
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.