-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
78 additions
and
116 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
\relax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
\documentclass[12pt,letterpaper,boxed]{hmcpset} | ||
% set 1-inch margins in the document | ||
\usepackage[margin=1in]{geometry} | ||
\usepackage{marvosym} | ||
\usepackage{MnSymbol,wasysym} | ||
\usepackage{tikz} | ||
\usetikzlibrary{graphs,graphs.standard} | ||
\usepackage{color} | ||
\usepackage{enumerate} | ||
\usepackage{tikz} | ||
\usepackage{mathtools} | ||
\DeclarePairedDelimiter\ceil{\lceil}{\rceil} | ||
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor} | ||
% include this if you want to import graphics files with /includegraphics | ||
\begin{document} | ||
\begin{problem}[Shahriari 8.1.1][20]\\ | ||
\\ | ||
A coffee company was willing to pay \$1 for each person interviewed about his or her lieks and dislikes on types of cofee. Of the persons interviewed, 270 liked ground coffee, 200 liked instant coffee, 70 liked both, and 50 did not like either choice. What is the total amount of money the company had to pay? | ||
\ | ||
\end{problem} | ||
\begin{solution} | ||
|
||
Sum all the people and subtract out the double counted people: | ||
$$270+200+50-70 = \boxed{450}$$ | ||
|
||
\end{solution} | ||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
\relax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
\documentclass[12pt,letterpaper,boxed]{hmcpset} | ||
% set 1-inch margins in the document | ||
\usepackage[margin=1in]{geometry} | ||
\usepackage{marvosym} | ||
\usepackage{MnSymbol,wasysym} | ||
\usepackage{tikz} | ||
\usetikzlibrary{graphs,graphs.standard} | ||
\usepackage{color} | ||
\usepackage{enumerate} | ||
\usepackage{tikz} | ||
\usepackage{mathtools} | ||
\DeclarePairedDelimiter\ceil{\lceil}{\rceil} | ||
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor} | ||
% include this if you want to import graphics files with /includegraphics | ||
\begin{document} | ||
\begin{solution} | ||
|
||
Sum all the people and subtract out the double counted people: | ||
$$270+200+50-70 = \boxed{450}$$ | ||
|
||
\end{solution} | ||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,36 @@ | ||
from __future__ import print_function | ||
from models import Assignment, Problem, Submission | ||
import aggregator | ||
import os | ||
|
||
def problem_answer_pairings(asgt): | ||
a_n = asgt.name | ||
problem_pairings = {} | ||
|
||
for i in range(0, asgt.problems.count()): | ||
name = asgt.problems[i].name | ||
problem_file = open(a_n + "-" + name, 'a') | ||
aggregator.print_header(problem_file) | ||
p_h = r"\begin{problem}[" + asgt.problems[i].name + "][" + asgt.problems[i].points + r"]\\" | ||
print(p_h, file=problem_file) | ||
print(asgt.problems[i].content, file=problem_file) | ||
print(r"\end{problem}", file=problem_file) | ||
|
||
solution_file = open("SOLUTIONS" + "-" + a_n + "-" + name, 'a') | ||
print(r"\begin{solution}", file=solution_file) | ||
print(asgt.problems[i].solution, file=solution_file) | ||
print(r"\end{solution}", file=solution_file) | ||
problem_pairings.append(problem_file, solution_file) | ||
|
||
return problem_pairings | ||
|
||
|
||
def problem_solution_file(problem): | ||
name = problem.name | ||
problem_file = open(name, 'a') | ||
problem_file = open("p"+str(problem.pk) + aggregator.TEX_FILE, 'w') | ||
aggregator.print_header(problem_file) | ||
p_h = r"\begin{problem}[" + problem.name + "][" + problem.points + r"]\\" | ||
print(r"\begin{document}",file=problem_file) | ||
p_h = r"\begin{problem}[" + problem.name + "][" + str(problem.points) + r"]\\" | ||
print(p_h, file=problem_file) | ||
print(problem.content, file=problem_file) | ||
print(problem.contents, 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) | ||
print(r"\end{document}",file=problem_file) | ||
print("pdflatex %s" % "p"+str(problem.pk) + aggregator.TEX_FILE) | ||
problem_file.close() | ||
os.system("pdflatex %s" % "p"+str(problem.pk) + aggregator.TEX_FILE) | ||
os.system("mv p%s.pdf ./website/static/probs/" % problem.pk) | ||
|
||
|
||
def submission_files(submission): | ||
name = submission.problem.name | ||
submission_file = open("SUBMISSION-" + name, 'a') | ||
submission_file = open("s"+str(submission.pk) + aggregator.TEX_FILE, 'w') | ||
aggregator.print_header(submission_file) | ||
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{document}",file=submission_file) | ||
print(r"\begin{solution}", file=submission_file) | ||
print(submission.contents, file=submission_file) | ||
print(r"\end{solution}", file=submission_file) | ||
print(r"\end{solution}", file=submission_file) | ||
print(r"\end{document}",file=submission_file) | ||
submission_file.close() | ||
os.system("pdflatex %s" % "s"+str(submission.pk) + aggregator.TEX_FILE) | ||
os.system("mv s%s.pdf ./website/static/subs/" % submission.pk) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters