From: Jakob Cornell Date: Tue, 7 Jan 2020 02:31:04 +0000 (-0600) Subject: Add composite score to table export X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c005e8d908d826e4b3834972f202a0a902a09fd;p=tutoring-tool.git Add composite score to table export --- 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()