From 32e35bc9190fdae098e861b3fc34d56af87dd8ff Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Sat, 17 Sep 2022 17:14:05 +0800 Subject: [PATCH] fix: use login_id as student id --- joint_teapot/workers/canvas.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/joint_teapot/workers/canvas.py b/joint_teapot/workers/canvas.py index c622a9a..1696d1d 100644 --- a/joint_teapot/workers/canvas.py +++ b/joint_teapot/workers/canvas.py @@ -27,7 +27,7 @@ class Canvas: # types = ["student", "observer"] types = ["student"] self.students = self.course.get_users(enrollment_type=types, include=["email"]) - for attr in ["sis_login_id", "sortable_name", "name"]: + for attr in ["login_id", "sortable_name", "name"]: if not hasattr(self.students[0], attr): raise Exception( f"Unable to gather students' {attr}, please contact the Canvas site admin" @@ -129,7 +129,7 @@ class Canvas: if student is None: continue grade_file_path = os.path.join( - assignments_dir, student.sis_login_id, self.grade_filename + assignments_dir, student.login_id, self.grade_filename ) try: grade, *comments = list(open(grade_file_path))