diff --git a/data/templates/maths/config/options.xml b/data/templates/maths/config/options.xml index 86a7a2a..e610679 100644 --- a/data/templates/maths/config/options.xml +++ b/data/templates/maths/config/options.xml @@ -1,61 +1,61 @@ <_modifie> <_modifie_ok>1 marges <preassoc> 0 cr data EXAM-catalog.pdf EXAM-sujet.pdf EXAM-calage.xy EXAM-corrige.pdf EMAIL Linear Algebra: test result Please find enclosed your annotated completed answer sheet. Best Regards. UTF-8 UTF-8 - ID,NOM,SCIPER,SECTION,EMAIL,TAILLE_NOM,NOM_COMPLET,SEMESTRE + ID,SCIPER,NAME,SECTION,EMAIL ; 2 student.copy,student.key,student.name 1 a4 n latex EXAM-filtered.tex CSV SCIPER %PROJET/students.csv 1 pdflatex 0 normal 0.5 6 1 1 notes-common.xml 0 0 ALL STUDENTS 0.007 %PROJET/exam.tex %(ID) Score: %S/%M "%s/%m" diff --git a/data/templates/maths/csv/blank.csv b/data/templates/maths/csv/blank.csv index ef45c47..113885e 100644 --- a/data/templates/maths/csv/blank.csv +++ b/data/templates/maths/csv/blank.csv @@ -1,3 +1,3 @@ -ID,NOM,SCIPER,SECTION,EMAIL,TAILLE_NOM,NOM_COMPLET,SEMESTRE -n/a,n/a,999999,(n/a),do_not_reply@epfl.ch,3,n/a,1 +ID,SCIPER,NAME,SECTION,EMAIL,STATUS +n/a,999999,n/a,(n/a),do-not-reply@epfl.ch,BLANK diff --git a/data/templates/maths/csv/extra.csv b/data/templates/maths/csv/extra.csv index d5f9cbd..ac41785 100644 --- a/data/templates/maths/csv/extra.csv +++ b/data/templates/maths/csv/extra.csv @@ -1 +1 @@ -#ID#,XXX-#NB#,#SCIPER#,XXX,#EMAIL# +#ID#,#SCIPER#,XXX-#NB#,XXX,#EMAIL#,EXTRA diff --git a/data/templates/maths/csv/sample.csv b/data/templates/maths/csv/sample.csv index 4d39d92..2a4eb0b 100644 --- a/data/templates/maths/csv/sample.csv +++ b/data/templates/maths/csv/sample.csv @@ -1,5 +1,5 @@ -ID,NOM,SCIPER,SECTION,EMAIL,TAILLE_NOM,NOM_COMPLET,SEMESTRE -1,Lennon John,XXXXX1,XYZ,pierre-Olivier.valles@epfl.ch,11,Lennon John,1 -2,McCartney Paul,XXXXX2,XYZ,pierre-Olivier.valles@epfl.ch,14,McCartney Paul,1 -3,Harrisson George,XXXXX3,XYZ,pierre-Olivier.valles@epfl.ch,16,Harrisson George,1 -4,Starr Ringo,XXXXX4,XYZ,pierre-Olivier.valles@epfl.ch,11,Starr Ringo,1 +ID,SCIPER,NAME,SECTION,EMAIL,STATUS +1,XXXXX1,Lennon John,XYZ,no-not-reply@epfl.ch,SAMPLE +2,XXXXX2,McCartney Paul,XYZ,do-not-reply@epfl.ch,SAMPLE +3,XXXXX3,Harrisson George,XYZ,do-not-reply@epfl.ch,SAMPLE +4,XXXXX4,Starr Ringo,XYZ,do-not-replay@epfl.ch,11,SAMPLE diff --git a/data/templates/maths/de/first_page.tex b/data/templates/maths/de/first_page.tex index 8ffbe10..f6ef531 100644 --- a/data/templates/maths/de/first_page.tex +++ b/data/templates/maths/de/first_page.tex @@ -1,54 +1,54 @@ % First page - GERMAN \noindent \begin{minipage}[c]{350pt} \bf \prof~-~\ExamName~-~\SECTION \\ ~ \\ \bf \ExamDate~-~Dauer: \Time \end{minipage} \begin{minipage}[c]{100pt} \includegraphics[scale=0.24]{Logo_EPFL} \end{minipage} \vfill \begin{minipage}[c]{\textwidth} \noindent \hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill \vspace{1cm} \par \noindent -\hfill\fontsize{40}{48}{\selectfont{\NOM{}}}\hfill~ +\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~ \end{minipage} \vfill \noindent \namefield{SCIPER: {\Large \bf \SCIPER{} }} \\ ~ \\ \noindent \textbf{Drehen Sie diese Seite nicht um, bevor Sie dazu aufgefordert werden.} \textbf{Jedes Blatt hat eine Vorder- und eine R\"uckseite. Es gibt \totalPages\ Seiten, die letzten sind m\"oglicherweise leer.} \textbf{L\"osen Sie nicht die Heftklammer.} \begin{itemize} \item[-] Legen Sie Ihren Studentenausweis auf den Tisch. \item[-] Es sind \textbf{keine} Unterlagen zugelassen. \item[-] Die Nutzung eines \textbf{Taschenrechners} oder jedes anderen elektronischen Hilfsmittels ist w\"ahrend der Pr\"ufung nicht gestattet. \item[-] F\"ur die \textbf{Multiple Choice} Fragen erh\"alt man: \begin{itemize} \item [$+3$] Punkte, wenn die Antwort korrekt ist, \item [0] Punkte, wenn die Frage nicht beantwortet ist oder mehrere M\"oglichkeiten angekreuzt sind, und \item [$-1$] Punkt, wenn die Antwort falsch ist. \end{itemize} \item [-] F\"ur die \textbf{Wahr/Falsch }Fragen erh\"alt man: \begin{itemize} \item [$+1$] Punkt, wenn die Antwort korrekt ist, \item [0] Punkte, wenn die Frage nicht beantwortet ist oder mehrere M\"oglichkeiten angekreuzt sind, und \item [$-1$] Punkt, wenn die Antwort falsch ist. \end{itemize} \item[-] Benutzen Sie einen \textbf{Kugelschreiber} und falls n\"otig l\"oschen Sie mit Tipp-Ex sorgf\"altig aus. \item[-] Beachten Sie bitte diese Richtlinien bei der Markierung \textbf{der Antworten}: \end{itemize} \hfill \includegraphics[scale=0.2]{good_bad_square} \hfill % End of first page diff --git a/data/templates/maths/en/first_page.tex b/data/templates/maths/en/first_page.tex index 14aca90..aaccd14 100644 --- a/data/templates/maths/en/first_page.tex +++ b/data/templates/maths/en/first_page.tex @@ -1,55 +1,55 @@ % First page - ENGLISH \noindent \begin{minipage}[c]{350pt} \bf \prof~-~\ExamName~-~\SECTION \\ ~ \\ \bf \ExamDate~-~duration : \Time \end{minipage} \begin{minipage}[c]{100pt} \includegraphics[scale=0.24]{Logo_EPFL} \end{minipage} \vfill \begin{minipage}[c]{\textwidth} \noindent \hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill \vspace{1cm} \par \noindent -\hfill\fontsize{40}{48}{\selectfont{\NOM{}}}\hfill~ +\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~ \end{minipage} \vfill \noindent \namefield{SCIPER: {\Large \bf \SCIPER{} }} \\ ~ \\ \noindent \textbf{Do not turn the page before the start of the exam.} \textbf{This document is double-sided, has \totalPages\ pages, the last ones possibly blank.} \textbf{Do not unstaple.} \medskip \begin{itemize} \item[-] Place your student card on your table. \item[-] \textbf{No other paper materials} are allowed to be used during the exam. \item[-] Using a \textbf{calculator} or any electronic device is not permitted during the exam. \item[-] For the \textbf{multiple choice} questions, we give \begin{itemize} \item [$+3$] points if your answer is correct, \item [$0$ ] points if you give no answer or more than one, \item [$-1$] points if your answer is incorrect. \end{itemize} \item[-] For the \textbf{true/false} questions, we give \begin{itemize} \item [$+1$] points if your answer is correct, \item [$0$ ] points if you give no answer or more than one, \item [$-1$] points if your answer is incorrect. \end{itemize} \item[-] Use a \textbf{ballpen} and clearly erase with \textbf{correction fluid} if necessary. \item[-] Observe these guidelines when \textbf{recording your answers}: \end{itemize} \hfill \includegraphics[scale=0.2]{good_bad_square} \hfill % End of first page diff --git a/data/templates/maths/fr/first_page.tex b/data/templates/maths/fr/first_page.tex index d35123e..cf5de7c 100644 --- a/data/templates/maths/fr/first_page.tex +++ b/data/templates/maths/fr/first_page.tex @@ -1,55 +1,55 @@ % First page - FRENCH \noindent \begin{minipage}[c]{350pt} \bf \prof~-~\ExamName~-~\SECTION \\ ~ \\ \bf \ExamDate~-~durée : \Time \end{minipage} \begin{minipage}[c]{100pt} \includegraphics[scale=0.24]{Logo_EPFL} \end{minipage} \vfill \begin{minipage}[c]{\textwidth} \noindent \hfill\fontsize{100}{120}{\selectfont{\ID{}}}\hfill \vspace{1cm} \par \noindent -\hfill\fontsize{40}{48}{\selectfont{\NOM{}}}\hfill~ +\hfill\fontsize{40}{48}{\selectfont{\NAME{}}}\hfill~ \end{minipage} \vfill \noindent \namefield{SCIPER: {\Large \bf \SCIPER{} }} \\ ~ \\ \noindent \textbf{Attendez le d\'ebut de l'\'epreuve avant de tourner la page.} \textbf{Ce document est imprim\'e recto-verso, il contient \totalPages\ pages, les derni\`eres pouvant \^etre vides.} \textbf{Ne pas d\'egrafer.} \medskip \begin{itemize} \item[-] Posez votre carte d'\'etudiant sur la table. \item[-] \textbf{Aucun} document n'est autoris\'{e}. \item[-] L'utilisation d'une \textbf{calculatrice} et de tout outil \'electronique est interdite pendant l'\'epreuve. \item[-] Pour les questions \`a \textbf{choix multiple}, on comptera: \begin{itemize} \item [$+3$] points si la r\'eponse est correcte, \item [0] point si la question n'est pas r\'epondue ou s'il y a plusieurs croix, \item [$-1$] point si la r\'eponse est incorrecte. \end{itemize} \item [-]Pour les questions de type \textbf{vrai-faux}, on comptera: \begin{itemize} \item [$+1$] point si la r\'eponse est correcte, \item [0] point si la question n'est pas r\'epondue ou s'il y a plusieurs croix, \item [$-1$] point si la r\'eponse est incorrecte. \end{itemize} \item[-] Utilisez un \textbf{stylo} et effacez proprement avec du \textbf{correcteur blanc} si n\'ecessaire. \item[-] Respectez les consignes suivantes pour \textbf{marquer vos réponses} : \end{itemize} \hfill \includegraphics[scale=0.2]{good_bad_square} \hfill %% End of first page diff --git a/lib/bash/bamc_exams.sh b/lib/bash/bamc_exams.sh index 1d6b2cf..1b6c04d 100644 --- a/lib/bash/bamc_exams.sh +++ b/lib/bash/bamc_exams.sh @@ -1,78 +1,78 @@ #/bin/bash function action_list() { # Check workspace assert_workspace; if [ $? -eq 1 ]; then return 1; fi # List exams verbose "List of exams in current workspace:" - for exam in $(find $DIR_WORKSPACE/$DIR_EXAMS -mindepth 1 -maxdepth 1 -type d -exec basename {} \;); do - color_echo "- \"$exam\"" + for exam in $(find $DIR_WORKSPACE/$DIR_EXAMS -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | sort); do + color_echo "$exam" done # Done return 0 } function get_exam_list() { assert_workspace "quiet"; if [ $? -eq 1 ]; then return 1; fi find $DIR_WORKSPACE/$DIR_EXAMS -mindepth 1 -maxdepth 1 -type d -exec basename {} \; } function action_add-exam() { # Check workspace assert_workspace; if [ $? -eq 1 ]; then return 1; fi # Set source DIR_EXAM=$DIR_WORKSPACE_TEMPLATE/$DIR_EXAMS/skel if [ ! -d $DIR_EXAM ]; then error_echo "Directory '$DIR_EXAM' not found." return 1 fi is_set 'exam' if [ $? -eq 1 ]; then DESTINATION=$(get_parameter 'exam'); fi is_set 'e' if [ $? -eq 1 ]; then DESTINATION=$(get_parameter 'e'); fi if [ -z "$DESTINATION" ]; then error_echo "No exam name provided. Add parameter 'exam=exam-name' to your command line"; return 1; fi # Set destination DESTINATION=$DIR_WORKSPACE/$DIR_EXAMS/$DESTINATION if [ -d $DESTINATION ]; then warn "This exam already exists!" confirm "Do you want to write in existing exam '$(basename $DESTINATION)' ?" if [ $? -eq 0 ]; then return 1; fi fi # Copy color_echo_n "Creating new exam '$(basename $DESTINATION)' from '$DIR_EXAM'... " cp -rp $DIR_EXAM $DESTINATION check_rc_echo $? return $? } function assert_exam() { # Check workspace assert_workspace; if [ $? -eq 1 ]; then return 1; fi local exam=$1 local mode=$2 if [ ! -d $DIR_WORKSPACE/$DIR_EXAMS/$exam ]; then if [ "$mode" != "quiet" ]; then error_echo "This exam does not exists: '$exam'. Please check the list of exams in this workspace using the 'list' action."; fi return 1 fi return 0 } function get_exam_parameter() { cat $DIR_WORKSPACE/$DIR_EXAMS/$1/$FILE_EXAM | grep "^$2:" | cut -d ':' -f 2- } function get_lang() { get_exam_parameter $1 'LANG' } # EOF diff --git a/lib/bash/debugging.sh b/lib/bash/debugging.sh index 992f96d..7ef154f 100644 --- a/lib/bash/debugging.sh +++ b/lib/bash/debugging.sh @@ -1,35 +1,35 @@ #!/bin/bash function error() { error_echo $@ } function warn() { warning_echo $@ } function debug() { is_set quiet; if [ $? -eq 1 ]; then return 0; fi is_set debug; if [ $? -eq 1 ]; then debug_echo $@; fi } function perma() { is_set quiet; if [ $? -eq 1 ]; then return 0; fi color_echo "${Green}*${NoColor} "$@ } function verbose() { is_set quiet; if [ $? -eq 1 ]; then return 0; fi - is_set verbose; if [ $? -eq 1 ]; then echo " "$@; fi + is_set verbose; if [ $? -eq 1 ]; then echo $@; fi } function check_file_exists() { if [ -r $1 ]; then return 0 else error "File not found: $1" return 1 fi } # EOF