restricted

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGrades

func GetGrades(ctx *gin.Context, grades []models.Record)

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

func GetOfferingComments(ctx *gin.Context, comments []*models.Comment)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL