Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGrades ¶
GetGrades takes the grades models and returns its response view object by creating buckets of frequency
For example a collection of grades {7.0, 7.5, 10.0, 10.0} will become {0.0: 0, ..., 7.0: 1, ..., 7.5: 1, ..., 10.0: 2}
func GetOfferingComments ¶
GetOfferingComments takes the comments models and returns their view response objects
It also sorts comments to display most upvoted (and least downvoted) on top
func GetOfferingsWithStats ¶
func GetOfferingsWithStats( ctx *gin.Context, IDs []string, offerings []*models.Offering, stats []*models.OfferingStats, limit int, )
GetOfferingsWithStats takes the offering models and returns their view response objects
It also takes IDs of the professors for each offering (given that this information is not stored in the model directly) Finally, it sorts the offerings to display most interesting ones on top
Types ¶
This section is empty.