             @set_activity(id:id, desc:"Copying assignment to #{student_name}")
             student_project_id = student.get('project_id')
             student_id = student.get('student_id')
+            src_path = assignment.get('path')
             async.series([
                 (cb) =>
                     if not student_project_id?

                @clear_activity(id)
            else
                @set_activity(id:id, desc:"Returning assignment to #{student_name}")
                salvus_client.copy_path_between_projects
                    src_project_id    : course_project_id
                    src_path          : assignment.get('collect_path') + '/' + student.get('student_id')
                    target_project_id : student_project_id
                    target_path       : assignment.get('graded_path')
                    overwrite_newer   : assignment.get('overwrite_newer')
                    delete_missing    : assignment.get('delete_missing')
                    exclude_history   : true
                    cb                : finish

        # Copy the given assignment to all non-deleted students, doing several copies in parallel at once.
        return_assignment_to_all_students: (assignment, new_only) =>

                    else
                        cb()
                (cb) =>
                    # write the due date to a file
                    due_date = store.get_due_date(assignment)
                    console.log("due_date =", due_date)
                    if not due_date?
                        cb(); return
                    salvus_client.write_text_file_to_project
                        project_id : course_project_id
                        path       : src_path + '/DUE_DATE.txt'
                        content    : "This assignment is due\n\n   #{due_date}"
                        cb         : cb
                (cb) =>
                    @set_activity(id:id, desc:"Copying files to #{student_name}'s project")
                    salvus_client.copy_path_between_projects
                        src_project_id    : course_project_id
                        src_path          : src_path
                        target_project_id : student_project_id
                        target_path       : assignment.get('target_path')
                        overwrite_newer   : false
