%% Example file for grad
\reset

\class G4b (Spring 2022)

%% define students
\student maelenn     	Rothenhaus Maëlenn
\student uma     	Änders Uma
\student laura		Gigèr Laura
\student severin 	Müller Severin
\student ida     	Röthenberger Ida
\student brigitte     	Umbrêcht Brigitte

%% set name of LaTeX folder for future \printlatex commands
\setlatexfolder latexfiles

%% min and max-values of grades created by the linear scale of exams
\range 1 6

%% rounding-precision: round to quarters
\rounding 0.25

%% define a grade called "m1" with weight 1
\grade m1 1		oral grade 1

%% set the grades of m1
%% format: grade - student grade
m1 - ida	4.75
m1 - uma     	5.5
m1 - laura 	4.75
m1 - severin 	4.25
m1 - brigitte  	5
m1 - maelenn 	6

\grade m2 1		oral grade 2
m2 - laura 	3.25
m2 - severin 	4.75
m2 - ida     	5
m2 - uma     	6

%% define an exam called "s1" with weight 1.5
%% the scale (points -> grade) is linear with 48 points corresponding
%% to a grade 4, and 80 points corresponding to a grade 6
\exam s1 1.5 48 4 80 6	written exam 11.10.2021

%% optionally add list of possible points of each question:
\possiblepoints s1 60 20 20 20 70 20

%% format: exam - student points_problem1 points_problem2 etc.
%% the total of all points and the grade is computed automatically
%% in this example, s1 has 6 problems
%% negative points are possible in principle
s1 - severin    4  -9  12   4   9   7
s1 - uma       12  12  11  20   0   3
s1 - laura    -10   0  +5  12  67  12
s1 - ida       58   0   0   0   0   0

\show s1
\line

%% sort s1 according to grades
\sort g s1				
\show s1
\line

\grade m3 0.6		oral exam (counts only if it helps)
m3 - ida     	3.75
m3 - laura 	2.25
m3 - severin 	6
m3 - uma     	4.5

%% compute average of m1 and m2
\grade m 1		final oral grade
\avg m < m1 m2				
\show m
\line

%% order of m is according to the first exam/grade, i.e., in this case
%% according to m1. To fix this, we use again the \sort command. This
%% time we sort according to student name:
\sort n m
\show m
\line

%% show overview of all exams and students:
\show
\line

%% to order the list according to student name, we use \sort without
%% grades/exams:
\sort n
\show
\line

\rounding 0.5				

\grade f1 0		final grade version 1 (with m3)
\avg f1 < m s1 m3  

\grade f2 0		final grade version 2 (without m3)
\avg f2 < m s1  

%% pick maximum of f1 and f2
\grade f 0		final grade
\max f < f1 f2
\show f
\line

%% manually overwrite grade of uma (only grade is changed,
%% exact grade remains)
f + uma	 5.5				
\show f
\line

%% overview again:
\show
\line

%% hiding f1 f2 in overview and printlatex
\hide f1 f2
\show
\line

%% but the hidden grades are still visible when listing all
%% exams/grades of one student. Here the order is always according to
%% the setting of the grades.
\show uma
\line

\stop

%% print latex versions: (comment out "\stop" when needed)
%% for each account a LaTeX file is created and stored in the
%% folder specified by \setlatexfolder.
%% Additionally, an empty table with all students and (by 
%% default 12) columns of empty fields is created called
%% "z_studlist.tex" and an overview table with all accounts
%% and all exams (except the hidden ones) is created called
%% "z_overview.tex".
%% LaTeXing needs to be done externally; and research19.sty
%% is required for compilation (is included with the source)

%% normal:
% \printlatex 

%% in landscape format:
% \printlatex l

%% with comments (usually full name) instead of student account names:
% \printlatex c

%% anonymously without names:
% \printlatex a

%% To change the number of empty fields in "z_studlist.tex" to, e.g.,
%% 17 fields (and still in landscape format):
% \printlatex l 17
%% Note: The size of the fields and possible titles can be edited
%% manually afterwards directly in the LaTeX file.

%% Command used to create files in latexfiles:
\sort c
\sort c f
\printlatex c10
%% z_studlist was manually changed to landscape format before
%% pdflatex-compilation
