From 3cd3739694dfc5d8f91b1a79878cb403fd3f8ee6 Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Mon, 17 Jan 2022 10:01:53 +0800 Subject: analyze.py: a few more comments. --- analyze.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'analyze.py') diff --git a/analyze.py b/analyze.py index 590995d..8a38ba6 100644 --- a/analyze.py +++ b/analyze.py @@ -186,7 +186,7 @@ def get_scores_for_each_student(grade_dir, task_dict): def get_objective_total(d): - ''' For each objective, get its total by summing all tasks.''' + ''' For each objective, get its total by summing over all tasks.''' objective_lst = d['course.objectives'] result = [] check_sum = 0 @@ -199,7 +199,7 @@ def get_objective_total(d): check_sum += total result.append((o, total)) if check_sum != 100: - print('Objective total is not 100 (%d instead). Make sure you have divide the objective scores across task correctly.' % (check_sum)) + print('Objective total is not 100 (%d instead). Make sure you have divide the objective scores across tasks correctly.' % (check_sum)) sys.exit() return result # [(objective1, value1), (objective2, value2), ...] @@ -319,8 +319,8 @@ print('Check spreadsheet %s.' % (GRADE_FILE)) objective_total = get_objective_total(task_dict) num_student = len(student_lst) for x in objective_total: - co = x[0] - value = x[1] + co = x[0] # name of the course objective + value = x[1] # the associated total value of that course objective try: percentage = 100 * course_object_cumulative_score[co]/(value * num_student) print('Course objective %s is %.0f%% satisfied.' % (co, percentage)) -- cgit v1.2.1