write all course data to file