Skip to content

Commit

Permalink
Fix collect for single user and personalized_inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
tmetzl committed Mar 14, 2024
1 parent 7868e60 commit a37c8ef
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions e2xgrader/exchange/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,22 @@ class E2xExchangeCollect(E2xExchange, ExchangeCollect):
).tag(config=True)

def init_submissions(self):
student_id = self.coursedir.student_id if self.coursedir.student_id else "*"
if self.personalized_inbound:
self.log.info("Collecting from restricted submit dirs")
submit_dirs = [
username
for username in os.listdir(self.inbound_path)
if "+" not in username
and os.path.isdir(os.path.join(self.inbound_path, username))
]
if student_id == "*":
submit_dirs = [
username
for username in os.listdir(self.inbound_path)
if "+" not in username
and os.path.isdir(os.path.join(self.inbound_path, username))
]
else:
submit_dirs = [
username
for username in os.listdir(self.inbound_path)
if username == student_id
]
self.log.info(f"Submission dirs: {submit_dirs}")

usergroups = defaultdict(list)
Expand All @@ -59,7 +67,6 @@ def init_submissions(self):
records.append(user_records)

else:
student_id = self.coursedir.student_id if self.coursedir.student_id else "*"
pattern = os.path.join(
self.inbound_path,
"{}+{}+*".format(student_id, self.coursedir.assignment_id),
Expand Down

0 comments on commit a37c8ef

Please sign in to comment.