Also group assignments in the same way as notes
All checks were successful
Deploy to birb co. production / deploy (push) Successful in 6s
All checks were successful
Deploy to birb co. production / deploy (push) Successful in 6s
This commit is contained in:
16
build.py
16
build.py
@@ -75,6 +75,22 @@ def scan_shared() -> list[Section]:
|
|||||||
|
|
||||||
assignments_dir = SHARED_DIR / "assignments"
|
assignments_dir = SHARED_DIR / "assignments"
|
||||||
if assignments_dir.exists():
|
if assignments_dir.exists():
|
||||||
|
subdirs = sorted(
|
||||||
|
d for d in assignments_dir.iterdir()
|
||||||
|
if d.is_dir() and should_include(d)
|
||||||
|
)
|
||||||
|
if subdirs:
|
||||||
|
subsections = []
|
||||||
|
for subdir in subdirs:
|
||||||
|
zip_name = f"assignments-{subdir.name}.zip"
|
||||||
|
create_zip(subdir, ZIPS_DIR / zip_name)
|
||||||
|
subsections.append(SubSection(
|
||||||
|
name=subdir.name,
|
||||||
|
zip_url=f"zips/{zip_name}",
|
||||||
|
files=list_files(subdir),
|
||||||
|
))
|
||||||
|
sections.append(Section(title="Assignments", subsections=subsections))
|
||||||
|
else:
|
||||||
zip_name = "assignments.zip"
|
zip_name = "assignments.zip"
|
||||||
create_zip(assignments_dir, ZIPS_DIR / zip_name)
|
create_zip(assignments_dir, ZIPS_DIR / zip_name)
|
||||||
sections.append(Section(
|
sections.append(Section(
|
||||||
|
|||||||
Reference in New Issue
Block a user