From 7c005e8d908d826e4b3834972f202a0a902a09fd Mon Sep 17 00:00:00 2001 From: Jakob Cornell Date: Mon, 6 Jan 2020 20:31:04 -0600 Subject: [PATCH] Add composite score to table export --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 389a781..96f22b6 100644 --- a/main.py +++ b/main.py @@ -274,7 +274,13 @@ class MainView(View): def on_gen_table(): name = self.controller.state['student'] - rows = [DataEditModel.Record.DISPLAY_NAMES] + self.controller.data[name] + head = list(DataEditModel.Record.DISPLAY_NAMES) + head.insert(5, "Score (Comp)") + def with_composite(record): + new = list(record) + new.insert(5, round(record.overall_score(), 1)) + return new + rows = [head] + list(map(with_composite, self.controller.data[name])) data = json.dumps(rows).encode('utf-8') server = AsyncHttpServer(57853, data) server.start() -- 2.30.2