Documentation ¶
Index ¶
- Constants
- Variables
- func GetQuestionResponseList(questionResponse string) []string
- func RegisterFeedbackFormToAdmin(Admin *admin.Admin, config admin.Config)
- func RegisterFeedbackToAdmin(Admin *admin.Admin, config admin.Config)
- func RegisterQuestionToAdmin(Admin *admin.Admin, config admin.Config)
- func RegisterSkillToAdmin(Admin *admin.Admin, config admin.Config)
- func SetQuestionRelatedFieldMeta(res *admin.Resource)
- func ValidateResponseRegex(questionResponse string) bool
- type Category
- type Feedback
- type FeedbackForm
- type FeedbackFormContent
- type FeedbackFormStatus
- type FeedbackStatus
- type Question
- type QuestionResponse
- type QuestionType
- type Schedule
- type Skill
- type TeamFeedbackForm
Constants ¶
const QuestionResponseSeparator = ","
QuestionResponseSeparator ...
Variables ¶
var FeedbackFormStatusValues = [...]string{
"Draft",
"Published",
}
FeedbackFormStatusValues ...
var FeedbackStatusValues = [...]string{
"New",
"In Progress",
"Submitted",
}
FeedbackStatusValues ...
var QuestionTypeValues = [...]string{
"Multi Choice",
"Grade",
"Boolean",
}
QuestionTypeValues ...
Functions ¶
func GetQuestionResponseList ¶
GetQuestionResponseList ...
func RegisterFeedbackFormToAdmin ¶
RegisterFeedbackFormToAdmin ...
func RegisterFeedbackToAdmin ¶
RegisterFeedbackToAdmin ...
func RegisterQuestionToAdmin ¶
RegisterQuestionToAdmin ...
func RegisterSkillToAdmin ¶
RegisterSkillToAdmin ...
func SetQuestionRelatedFieldMeta ¶
SetQuestionRelatedFieldMeta ...
func ValidateResponseRegex ¶
ValidateResponseRegex ...
Types ¶
type Category ¶
type Category struct { gorm.Model Title string `gorm:"type:varchar(255); not null"` Description string `gorm:"type:text"` }
Category represent a category in feedback form
type Feedback ¶
type Feedback struct { gorm.Model FeedbackForm FeedbackForm Title string `gorm:"type:varchar(255); not null"` FeedbackFormID uint `gorm:"not null"` ForUserProfile userModels.UserProfile ForUserProfileID uint ByUserProfile userModels.UserProfile ByUserProfileID uint `gorm:"not null"` Team userModels.Team TeamID uint `gorm:"not null"` Status FeedbackStatus `gorm:"default:0; not null"` SubmittedAt *time.Time DurationStart time.Time `gorm:"not null"` DurationEnd time.Time `gorm:"not null"` ExpireAt time.Time `gorm:"not null"` }
Feedback represent a submitted/in-progress feedback form by a user
type FeedbackForm ¶
type FeedbackForm struct { gorm.Model Title string `gorm:"type:varchar(255); not null"` Description string `gorm:"type:text;"` Status FeedbackFormStatus `gorm:"default:0; not null"` Archive bool `gorm:"default:false; not null"` }
FeedbackForm represent template form for feedback TODO Add support for versioning
type FeedbackFormContent ¶
type FeedbackFormContent struct { gorm.Model FeedbackForm FeedbackForm FeedbackFormID uint `gorm:"not null"` Skill Skill SkillID uint `gorm:"not null"` Category Category CategoryID uint `gorm:"not null"` }
FeedbackFormContent represent the content of the feedback form TODO Add support for making it non-editable
type FeedbackFormStatus ¶
type FeedbackFormStatus int8
FeedbackFormStatus ...
const ( DraftFeedbackForm FeedbackFormStatus = iota PublishedFeedbackForm )
FeedbackFormStatus ...
type FeedbackStatus ¶
type FeedbackStatus int8
FeedbackStatus ...
const ( NewFeedback FeedbackStatus = iota InProgressFeedback SubmittedFeedback )
FeedbackStatus ...
type Question ¶
type Question struct { gorm.Model Text string `gorm:"type:text; not null"` Type QuestionType `gorm:"default:0; not null)"` Skill Skill SkillID uint `gorm:"not null"` Options fields.JSONB `gorm:"type:jsonb; not null; default:'{}'::jsonb"` Weight int `gorm:"default:1; not null"` }
Question represent the questions asked for a skill TODO Add support for versioning and making it non-editable
func (*Question) BeforeSave ¶
BeforeSave ...
func (Question) GetOptions ¶
GetOptions ...
func (*Question) ValidateQuestionResponse ¶
ValidateQuestionResponse validates the question response (default also), against the question options
type QuestionResponse ¶
type QuestionResponse struct { gorm.Model Feedback Feedback FeedbackID uint `gorm:"not null"` FeedbackFormContent FeedbackFormContent FeedbackFormContentID uint `gorm:"not null"` Question Question QuestionID uint `gorm:"not null"` Response string `gorm:"type:text"` Comment string `gorm:"type:text"` }
QuestionResponse represent the response/answer to a question asked for a skill
func (*QuestionResponse) BeforeSave ¶
func (questionResponse *QuestionResponse) BeforeSave(db *gorm.DB) (err error)
BeforeSave ...
type QuestionType ¶
type QuestionType int8
QuestionType ...
const ( MultiChoiceType QuestionType = iota GradingType BooleanType )
QuestionType ...
type Schedule ¶
type Schedule struct { gorm.Model Team userModels.Team TeamID uint `gorm:"not null"` PeriodValue uint `gorm:"not null"` // consecutive period units, after which event need to be recreated PeriodUnit string `gorm:"type:varchar(15); not null"` // Unit of period, eg: year, week, days PeriodOffset uint `gorm:"default:1; not null"` // Offset in days between the period end and actual event date FeedbackTitle string `gorm:"type:varchar(255); not null"` ExpireInDays uint `gorm:"default:10; not null"` NextEventAt time.Time `gorm:"not null"` Active bool `gorm:"default:true; not null"` }
Schedule at which feedback events would be created for a team
type Skill ¶
type Skill struct { gorm.Model Title string `gorm:"type:varchar(255); not null"` DisplayTitle string `gorm:"type:varchar(255)"` Description string `gorm:"type:text"` Weight int `gorm:"default:1"` Questions []Question }
Skill represent the skill comprised by category TODO Add support for versioning and making it non-editable
type TeamFeedbackForm ¶
type TeamFeedbackForm struct { gorm.Model Team userModels.Team TeamID uint `gorm:"not null"` ForRole userModels.Role ForRoleID uint `gorm:"not null"` FeedbackForm FeedbackForm FeedbackFormID uint `gorm:"not null"` Active bool `gorm:"default:false; not null"` }
TeamFeedbackForm represent the feedback template to be used for a role under a team