From cd7d2a78630c38b7e51ad5a36c7295855cb1d4d8 Mon Sep 17 00:00:00 2001 From: Megan Guiney Date: Wed, 2 May 2018 12:22:34 -0700 Subject: [PATCH] Update tabulate_scores.py to handle schema 2.0 The change over to schema 2.0 broke the tabulate scores script, updated it to handle the new format. Change-Id: I44726703a2abf41c57451ed17256f7bb4e2d531c --- working_materials/tabulate_scores.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/working_materials/tabulate_scores.py b/working_materials/tabulate_scores.py index 1337b00f..5dbcc316 100755 --- a/working_materials/tabulate_scores.py +++ b/working_materials/tabulate_scores.py @@ -79,7 +79,7 @@ csv_outfile = open(args.csv_outfile_name, 'w') # in order to do scoring. Read them from a Guideline JSON file. with open(args.json_file_name) as json_file: json_data = json.loads(json_file.read()) - criteria = json_data['criteria'] + criteria = json_data['metadata']['scoring']['criteria'] # Non-Admin doesn't appear in the scores because it's not # an official criteria...rather it's something we use in scoring @@ -179,7 +179,7 @@ with open(args.score_file_name) as filehandle: # If the total score exceeds the cutoff_score listed in # the JSON file, denote that it has scored high enough # to be included in the Guideline with an asterisk. - if total >= int(json_data['cutoff_score']): + if total >= int(json_data['metadata']['scoring']['cutoff_score']): meets_criteria = '*' else: meets_criteria = ''