Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
exam-statistics
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simon Pintarelli
exam-statistics
Commits
054b3bdf
Commit
054b3bdf
authored
Jan 28, 2017
by
Simon Pintarelli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup statistics.Rnw, move *py to scripts, update README
parent
a7923d65
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
51 deletions
+31
-51
1-prepare-to-enter-grades
1-prepare-to-enter-grades
+1
-1
2-generate-stats-and-edoz-upload
2-generate-stats-and-edoz-upload
+3
-4
Readme.rst
Readme.rst
+23
-34
scripts/init-spreadsheet-from-edoz.py
scripts/init-spreadsheet-from-edoz.py
+1
-1
scripts/pandas-script.py
scripts/pandas-script.py
+0
-0
scripts/xls2csv.py
scripts/xls2csv.py
+0
-0
statistics.Rnw
statistics.Rnw
+3
-11
No files found.
1-prepare-to-enter-grades
View file @
054b3bdf
...
...
@@ -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
2-generate-stats-and-edoz-upload
View file @
054b3bdf
...
...
@@ -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
"
Readme.rst
View file @
054b3bdf
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
init-spreadsheet-from-edoz.py
→
scripts/
init-spreadsheet-from-edoz.py
View file @
054b3bdf
...
...
@@ -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
(
'
\n
Check that file exists and is ISO-8859-1 encoded'
))
str
(
'
\n
Check 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
...
...
pandas-script.py
→
scripts/
pandas-script.py
View file @
054b3bdf
File moved
xls2csv.py
→
scripts/
xls2csv.py
View file @
054b3bdf
File moved
statistics.Rnw
View file @
054b3bdf
...
...
@@ -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
NAM
E}
\chead{LECTURE
TITL
E}
\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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment