Skip to content

Commit

Permalink
create solution and submission pdf files
Browse files Browse the repository at this point in the history
  • Loading branch information
nhurwitz committed Nov 15, 2014
1 parent f124c6e commit 381570f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions website/package_problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,28 @@ def problem_answer_pairings(asgt):
problem_pairings.append(problem_file, solution_file)

return problem_pairings


def problem_solution_file(problem):
name = problem.name
problem_file = open(name, 'a')
aggregator.print_header(problem_file)
p_h = r"\begin{problem}[" + problem.name + "][" + problem.points + r"]\\"
print(p_h, file=problem_file)
print(problem.content, file=problem_file)
print(r"\end{problem}", file=problem_file)
print(r"\begin{solution}", file=problem_file)
print(problem.solution, file=problem_file)
print(r"\end{solution}", file=problem_file)


def submission_files(submission):
name = submission.problem.name
submission_file = open("SUBMISSION-" + name, 'a')
p_h = r"\begin{problem}[" + submission.problem.name + "][" + submission.problem.points + r"]\\"
print(p_h, file=submission_file)
print(submission.problem.content, file=submission_file)
print(r"\end{problem}", file=submission_file)
print(r"\begin{solution}", file=submission_file)
print(submission.contents, file=submission_file)
print(r"\end{solution}", file=submission_file)

0 comments on commit 381570f

Please sign in to comment.