def generateFile(problem, filename=None, content=None, correct=False):
p = Problem(problem)<EOL>filename = filename or p.filename()<EOL>with open(filename, '<STR_LIT:w>') as f:<EOL><INDENT>if correct:<EOL><INDENT>f.write('<STR_LIT>'.format(p.solution))<EOL><DEDENT>elif content:<EOL><INDENT>f.write(content)<EOL><DEDENT><DEDENT>
Uses Problem.solution to generate a problem file. The correct
argument controls whether the generated file is correct or not.