Improve the Note.String function (with emojis!!1)

This commit is contained in:
Marcel Transier 2019-10-06 19:59:58 +02:00
parent eb9f2ed4ce
commit 987cccd189

View File

@ -21,7 +21,20 @@ type Note struct {
}
func (n *Note) String() string {
return fmt.Sprintf("%s: %s", n.Name, n.Note)
var status string
switch n.Status {
case "angemeldet":
status = "⏳ - "
case "bestanden":
status = "✔ "
case "nicht bestanden":
// Not sure if thats the correct value.
// Can't test it. Never failed an exam :P
status = "✖ "
default:
status = "❓"
}
return fmt.Sprintf("%s%s %s", status, n.Note, n.Name)
}
// Noten returns a list of the grades of all graded or signed up modules