Commit 054b3bdf authored by Simon Pintarelli's avatar Simon Pintarelli

cleanup statistics.Rnw, move *py to scripts, update README

parent a7923d65
......@@ -9,4 +9,4 @@ if [[ $# -lt 1 ]]; then
fi
ln -sf $1 grades-template.txt
./init-spreadsheet-from-edoz.py $1
./scripts/init-spreadsheet-from-edoz.py $1
......@@ -7,12 +7,11 @@ if [[ ! $? -eq 0 ]]; then
fi
echo "marks.xls -> marks.csv"
./xls2csv.py marks.xls marks.csv
python scripts/xls2csv.py marks.xls marks.csv
R < knit.R --save 2> R.log || exit 1
echo "Generate edoz-final.txt for upload."
python pandas-script.py
python scripts/pandas-script.py && echo "Generated edoz-final.txt for upload."
echo "Running pdflatex..."
pdflatex statistics.tex > tex.log && pdflatex statistics.tex > /dev/null || echo "Warning: pdflatex failed!"
pdflatex statistics.tex > tex.log && pdflatex statistics.tex > /dev/null && echo "Successfully created statistics.pdf "
Installation
===============
Required packages in R: ``dplyr, ggplot2, reshape, knitr``. Use ``install.packages('pkngname')`` in the R shell.
Installation
============
Required packages in R: ``dplyr, ggplot2, reshape, knitr``. Use ``install.packages('pkngname')`` in an R shell.
Usage
======
Data is read form a csv file ``data.csv`` with columns ``Nummer, Familienname,
A1,..., An`` in ``ISO-8859-1`` encoding. Colums ``A1, ..., An`` contain the points
for each subtask. Change the parameters in ``USER SETTINGS`` on line 103 in
``statistics.Rnw`` to adapt the grading scale to your needs.
Input:
- ``data.csv``
- ``edoz.txt``: must be exported from ``Edoz > Noten/Resultate`` and renamed accordingly
Output:
- ``edoz-grades.txt`` file for upload to edoz
- LaTeX/PDF file containing the statistics
Execution
-----------
- in R
.. code-block:: R
library(knitr)
knit('statistics.Rnw')
- (optional) You can use emacs/`ess-mode <http://ess.r-project.org/>`_ to run the
``Rnw`` - file. This is more convenient, especially if you would like to make
modifications. Here is how to set it up: http://yihui.name/knitr/demo/editors/
=====
1. Login to edoz (use the English version), go to
``Grades/Results > Grades`` and click on ``Export data``.
2. Unzip the file ``GRADES..txt`` into the same directory where the scripts are.
3. Open a shell (cd to the directory containing the scripts) and type:
``./1-prepare-to-enter-grades [GRADES...txt]``. This will create a file ``marks.xls``
4. Open ``marks.xls`` in the spreadsheet editor of your choice (e.g. localc) and enter
the number of points per task for each student (Columns A1..An). Add or remove
columns for tasks as needed. Save as Excel document to ``marks.xls``.
5. Open the file ``statistics.Rnw`` and enter the name of the lecture(r). You can enter a
grading scale (piecewise linear) by modifying the R vectors ``int_points`` and
``int_grades``.
6. Open a shell and type ``./2-generate-stats-and-edoz-upload``. This will generate the
files ``statistics.pdf`` and ``edoz-final.txt``
7. Check the grades of a few students manually to make sure that results in
``edoz-final.txt`` are correct.
8. Upload ``edoz-final.txt`` to edoz by clicking on ``Import Data``.
Preview
=======
.. figure:: preview.png
......@@ -48,7 +48,7 @@ def extract_columns(args):
edoz_data = pa.read_csv(args.src, sep='\t', encoding='ISO-8859-1')
except:
raise Exception('Could not read from csv-file ' + str(args.src) +
str('\nCheck that file exists and is ISO-8859-1 encoded'))
str('\nCheck that the file exists and is ISO-8859-1 encoded'))
if 'Familienname' in edoz_data.columns:
# there is a tab past there last column => pandas reads an additional empty
......
......@@ -21,24 +21,15 @@
\usepackage{caption}
\usepackage{adjustbox}
\captionsetup{labelformat=empty}
<<<<<<< variant A
>>>>>>> variant B
======= end
\pagestyle{fancy}
<<<<<<< HEAD
\chead{Numerische Methoden PHYS FS16}
\lhead{DMATH ETHZ}
\rhead{Prof. Muster}
>>>>>>> variant B
======= end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ==================== USER SETTINGS ==================== %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chead{LECTURE NAME}
\chead{LECTURE TITLE}
\lhead{DMATH ETHZ}
\rhead{LECTURER}
<<usersettings, echo=FALSE>>=
maxpoints <- 52 # max. points
dp <- 0.5 # point interval
......@@ -48,6 +39,7 @@ int_points <- c(0, 21, 46, maxpoints)
int_grades <- c(1, 4, 6, 6)
@
\begin{document}
<<setup, include=FALSE, purl=FALSE, cache=FALSE>>=
# from http://stackoverflow.com/questions/11030898/knitr-how-to-align-code-and-plot-side-by-side
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment