From 304ba63771307e028325199cbc561ef3779fdea3 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Mon, 27 Jan 2020 16:36:43 -0500 Subject: [PATCH] [+] Create method to get completion status #3 --- src/logic/course.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/logic/course.ts b/src/logic/course.ts index a816af8..c0610a2 100644 --- a/src/logic/course.ts +++ b/src/logic/course.ts @@ -66,6 +66,21 @@ export class Assignment return this.include && (this.complete == 'Complete' || this.complete == 'Late' || this.complete == 'NREQ'); } + /** + * What is the problem with this assignment + * + * @return string Empty string if complete, otherwise return problem. + */ + get problem() + { + switch (this.complete) + { + case 'Complete': return ''; + case 'Late': return 'Late'; + case 'NREQ': return 'Dropped'; + } + } + /** * Add callback *