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
ln -sf $1 grades-template.txt
./ $1
./scripts/ $1
......@@ -7,12 +7,11 @@ if [[ ! $? -eq 0 ]]; then
echo "marks.xls -> marks.csv"
./ marks.xls marks.csv
python scripts/ marks.xls marks.csv
R < knit.R --save 2> R.log || exit 1
echo "Generate edoz-final.txt for upload."
python scripts/ && 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 "
Required packages in R: ``dplyr, ggplot2, reshape, knitr``. Use ``install.packages('pkngname')`` in the R shell.
Required packages in R: ``dplyr, ggplot2, reshape, knitr``. Use ``install.packages('pkngname')`` in an R shell.
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.
- ``data.csv``
- ``edoz.txt``: must be exported from ``Edoz > Noten/Resultate`` and renamed accordingly
- ``edoz-grades.txt`` file for upload to edoz
- LaTeX/PDF file containing the statistics
- in R
.. code-block:: R
- (optional) You can use emacs/`ess-mode <>`_ to run the
``Rnw`` - file. This is more convenient, especially if you would like to make
modifications. Here is how to set it up:
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
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``.
.. figure:: preview.png
......@@ -48,7 +48,7 @@ def extract_columns(args):
edoz_data = pa.read_csv(args.src, sep='\t', encoding='ISO-8859-1')
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 @@
<<<<<<< variant A
>>>>>>> variant B
======= end
<<<<<<< HEAD
\chead{Numerische Methoden PHYS FS16}
\lhead{DMATH ETHZ}
\rhead{Prof. Muster}
>>>>>>> variant B
======= end
% ==================== USER SETTINGS ==================== %
\lhead{DMATH ETHZ}
<<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)
<<setup, include=FALSE, purl=FALSE, cache=FALSE>>=
# from
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