Skip to content

Commit

Permalink
Fetch assignment before solution
Browse files Browse the repository at this point in the history
  • Loading branch information
ykazakov committed Oct 25, 2024
1 parent d148500 commit ac05c5b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ngshare_exchange/fetch_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@ def init_dest(self):
)
else:
root = self.coursedir.assignment_id
assignment_root = os.path.join(self.assignment_dir, root)
if not os.path.isdir(assignment_root):
self.fail(
'Assignment "{}" was not downloaded, run `nbgrader fetch_assignment` first.'.format(
self.coursedir.assignment_id
)
)
self.dest_path = os.path.abspath(
os.path.join(self.assignment_dir, root, 'solution')
os.path.join(assignment_root, 'solution')
)

# check if feedback folder exists
# check if solution folder exists
if not os.path.exists(self.dest_path):
Path(self.dest_path).mkdir(parents=True)
Path(self.dest_path).mkdir()

def do_copy(self, files):
'''Copy the src dir to the dest dir omitting the self.coursedir.ignore globs.'''
Expand Down

0 comments on commit ac05c5b

Please sign in to comment.