Documentation ¶
Index ¶
- Constants
- func AddUser2Course(s *mgo.Session, courseId bson.ObjectId, u UserInCourse_db) int
- func AdminAddUser2Course(s *mgo.Session, user User_t, admin string, courseIdHex string, ...) (int, []int)
- func AdminNewCourse(s *mgo.Session, user User_t, admin string, course Course_t) (int, string)
- func AdminRemoveUserFromCourse(s *mgo.Session, user User_t, admin string, courseIdHex string, ...) (int, []int)
- func AdminUpdateCourse(s *mgo.Session, user User_t, admin, IdHex string, details Details_t) (int, []int)
- func AdminUpdateUser(s *mgo.Session, user User_t, admin, IdHex string, details Details_t) (int, []int)
- func CheckAdmin(s *mgo.Session, user User_t) int
- func CoordinatorAddStages(s *mgo.Session, user User_t, courseIdHex string, stages []string) int
- func CoordinatorAddTasks(s *mgo.Session, user User_t, courseIdHex string, stage int, tasks []string) int
- func CoursesForUser(s *mgo.Session, UserIdHex string) (int, []Course_db, []Course_db, []Course_db)
- func GuardAdmins()
- func GuardUsers()
- func IsAdmin(user User_t, admin string) int
- func LoginHandler(s *mgo.Session, email, passwd string) (int, [2]string, string, string)
- func LoginStatus(user User_t) int
- func LogoutHandler(user User_t) int
- func ParseBody(body io.Reader, r interface{})
- func RegisterHandler(s *mgo.Session, email, username, passwd, name string) int
- func RemoveUserFromCourse(s *mgo.Session, courseId bson.ObjectId, u []string) int
- func UpdateCourseDescription(s *mgo.Session, courseId bson.ObjectId, data string) int
- func UpdateCourseName(s *mgo.Session, courseId bson.ObjectId, data string) int
- func UpdateCourseSuspended(s *mgo.Session, courseId bson.ObjectId, data bool) int
- func UpdateUserName(s *mgo.Session, userId bson.ObjectId, data string) int
- func UpdateUserSuspended(s *mgo.Session, userId bson.ObjectId, data bool) int
- type Admin_t
- type AggregateUser_t
- type AutoGenerated
- type CourseWithUsers_t
- type Course_db
- type Course_t
- type Details_t
- type OutputHandler_db
- type Stage_db
- type Task_db
- type TestCase_db
- type UserInCourse_db
- type UserInCourse_t
- type User_db
- func AdminGetUserByIdentifier(s *mgo.Session, user User_t, admin string, identifier string, ...) (int, []User_db)
- func AdminUser(s *mgo.Session, user User_t, admin, userIdHex string) (int, User_db)
- func AdminUsers(s *mgo.Session, user User_t, admin string, page int) (int, []User_db)
- func CoordinatorGetUsers(s *mgo.Session, user User_t, CourseIdHex string, UserType string) (int, []User_db)
- func GetUserByIdentifier(s *mgo.Session, identifier string, allowSuspend bool) (int, []User_db)
- type User_t
Constants ¶
View Source
const COODRINATORS = 0
View Source
const STUDENTS = 2
View Source
const TUTORS = 1
Variables ¶
This section is empty.
Functions ¶
func AddUser2Course ¶
func AddUser2Course(s *mgo.Session, courseId bson.ObjectId, u UserInCourse_db) int
func AdminAddUser2Course ¶
func AdminNewCourse ¶
func AdminUpdateCourse ¶
func AdminUpdateUser ¶
func CheckAdmin ¶
func CoordinatorAddStages ¶
func CoordinatorAddTasks ¶
func CoursesForUser ¶
func GuardAdmins ¶
func GuardAdmins()
func GuardUsers ¶
func GuardUsers()
func LoginHandler ¶
func LoginStatus ¶
func LogoutHandler ¶
func RegisterHandler ¶
func RemoveUserFromCourse ¶
func UpdateCourseDescription ¶
func UpdateCourseName ¶
func UpdateCourseSuspended ¶
Types ¶
type AggregateUser_t ¶
type AutoGenerated ¶
type CourseWithUsers_t ¶
type CourseWithUsers_t struct { Name string Description string Suspended bool Users []AggregateUser_t TimeCreated time.Time Id bson.ObjectId }
func AdminCourse ¶
func AdminCourse(s *mgo.Session, user User_t, admin, courseIdHex string) (int, CourseWithUsers_t)
type Course_db ¶
type Course_db struct { Name string `bson:"name"` Description string `bson:"description"` Suspended bool `bson:"suspended,omitempty"` Users UserInCourse_db `bson:"users,omitempty"` TimeCreated time.Time `bson:"timeCreated,omitempty"` Id bson.ObjectId `bson:"_id,omitempty"` Accessments []Stage_db `bson:"accessments,omitempty"` }
func AdminCourses ¶
func UserCourse ¶
type Details_t ¶
type Details_t struct { Details []struct { UpdateType string `json:"t"` UpdateValue interface{} `json:"v"` } `json:"d"` }
type OutputHandler_db ¶
type Task_db ¶
type Task_db struct { Description string `bson:"description"` AllowLang []string `bson:"allowLang,omitempty"` TestCases []TestCase_db `bson:"testCases,omitempty"` }
type TestCase_db ¶
type TestCase_db struct { Stdin string `bson:"stdin"` Stdout OutputHandler_db `bson:"stdout"` Stderr OutputHandler_db `bson:"stderr"` }
type UserInCourse_db ¶
type UserInCourse_t ¶
type User_db ¶
type User_db struct { Identifier [2]string `bson:"identifier"` Passwd string `bson:"passwd"` Salt string `bson:"salt"` PrevPasswd []string `bson:"prevpasswd,omitempty"` Suspended bool `bson:"suspended"` Name string `bson:"name"` Id bson.ObjectId `bson:"_id,omitempty"` }
func AdminUsers ¶
func CoordinatorGetUsers ¶
Click to show internal directories.
Click to hide internal directories.