                 else
                     cb()
             (cb) =>
-                # write the due date to a file
-                due_date = store.get_due_date(assignment)
-                if not due_date?
-                    cb(); return
-                webapp_client.write_text_file_to_project
-                    project_id : store.get('course_project_id')
-                    path       : src_path + '/DUE_DATE.txt'
-                    content    : "This assignment is due\n\n   #{due_date.toLocaleString()}"
-                    cb         : cb
+                if create_due_date_file
+                    @copy_assignment_create_due_date_file(assignment, store, cb)
+                else
+                    cb()
             (cb) =>
                 @set_activity(id:id, desc:"Copying files to #{student_name}'s project")
                 webapp_client.copy_path_between_projects


    # Copy the given assignment to all non-deleted students, doing several copies in parallel at once.
    copy_assignment_to_all_students: (assignment, new_only) =>
        desc = "Copying assignments to all students #{if new_only then 'who have not already received it' else ''}"
        short_desc = "copy to student"
        @_action_all_students(assignment, new_only, @copy_assignment_to_student, 'assignment', desc, short_desc)

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

    #    assignment.last_assignment[student_id] = {time:?, error:err}
    #
    # where time >= now is the current time in milliseconds.
    copy_assignment_to_student: (assignment, student, create_due_date_file=false) =>
        if @_start_copy(assignment, student, 'last_assignment')
            return
        id = @set_activity(desc:"Copying assignment to a student")
