diff --git a/19.aux b/2.aux similarity index 100% rename from 19.aux rename to 2.aux diff --git a/19.tex b/2.tex similarity index 100% rename from 19.tex rename to 2.tex diff --git a/db.sqlite3 b/db.sqlite3 index 2d07582..60b7f3b 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/p13.aux b/p13.aux new file mode 100644 index 0000000..f23e546 --- /dev/null +++ b/p13.aux @@ -0,0 +1 @@ +\relax diff --git a/p13.tex b/p13.tex new file mode 100644 index 0000000..49f61a3 --- /dev/null +++ b/p13.tex @@ -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} diff --git a/s13.aux b/s13.aux new file mode 100644 index 0000000..f23e546 --- /dev/null +++ b/s13.aux @@ -0,0 +1 @@ +\relax diff --git a/s13.tex b/s13.tex new file mode 100644 index 0000000..7522ab1 --- /dev/null +++ b/s13.tex @@ -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} diff --git a/website/migrations/0001_initial.py b/website/migrations/0001_initial.py index 0316fd7..7f9181a 100644 --- a/website/migrations/0001_initial.py +++ b/website/migrations/0001_initial.py @@ -18,6 +18,8 @@ class Migration(migrations.Migration): ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.CharField(max_length=255)), ('due_date', models.DateTimeField()), + ('points', models.IntegerField(null=True, blank=True)), + ('received_submission', models.BooleanField(default=True)), ], options={ }, @@ -59,12 +61,6 @@ class Migration(migrations.Migration): }, bases=(models.Model,), ), - migrations.AddField( - model_name='submission', - name='student', - field=models.ForeignKey(to='website.UserProfile'), - preserve_default=True, - ), migrations.AddField( model_name='problem', name='graders', diff --git a/website/migrations/0002_auto_20141115_1202.py b/website/migrations/0002_auto_20141115_1202.py deleted file mode 100644 index 022b43b..0000000 --- a/website/migrations/0002_auto_20141115_1202.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('website', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='assignment', - name='points', - field=models.IntegerField(default=0), - preserve_default=False, - ), - migrations.AddField( - model_name='assignment', - name='received_submission', - field=models.BooleanField(default=True), - preserve_default=True, - ), - ] diff --git a/website/migrations/0003_auto_20141115_1229.py b/website/migrations/0003_auto_20141115_1229.py deleted file mode 100644 index fa1d65b..0000000 --- a/website/migrations/0003_auto_20141115_1229.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('website', '0002_auto_20141115_1202'), - ] - - operations = [ - migrations.AlterField( - model_name='assignment', - name='points', - field=models.IntegerField(null=True, blank=True), - preserve_default=True, - ), - ] diff --git a/website/migrations/0004_remove_submission_student.py b/website/migrations/0004_remove_submission_student.py deleted file mode 100644 index c486e67..0000000 --- a/website/migrations/0004_remove_submission_student.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('website', '0003_auto_20141115_1229'), - ] - - operations = [ - migrations.RemoveField( - model_name='submission', - name='student', - ), - ] diff --git a/website/package_problems.py b/website/package_problems.py index 7ce5286..09d26a8 100644 --- a/website/package_problems.py +++ b/website/package_problems.py @@ -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) \ No newline at end of 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) \ No newline at end of file diff --git a/website/static/asgts/19.pdf b/website/static/asgts/2.pdf similarity index 99% rename from website/static/asgts/19.pdf rename to website/static/asgts/2.pdf index 4a50d4e..539aa53 100644 Binary files a/website/static/asgts/19.pdf and b/website/static/asgts/2.pdf differ diff --git a/website/static/probs/p13.pdf b/website/static/probs/p13.pdf new file mode 100644 index 0000000..298cf82 Binary files /dev/null and b/website/static/probs/p13.pdf differ diff --git a/website/static/subs/s13.pdf b/website/static/subs/s13.pdf new file mode 100644 index 0000000..7181721 Binary files /dev/null and b/website/static/subs/s13.pdf differ diff --git a/website/templates/grader.html b/website/templates/grader.html index 1c5b34b..1b56806 100644 --- a/website/templates/grader.html +++ b/website/templates/grader.html @@ -40,10 +40,10 @@