summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/esami
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/esami')
-rw-r--r--macros/latex/contrib/esami/README18
-rw-r--r--macros/latex/contrib/esami/VERSION2
-rw-r--r--macros/latex/contrib/esami/doc/esami-doc-en.pdfbin459201 -> 481289 bytes
-rw-r--r--macros/latex/contrib/esami/doc/esami-doc-en.tex9
-rw-r--r--macros/latex/contrib/esami/doc/esami-doc-it.pdfbin466907 -> 489492 bytes
-rw-r--r--macros/latex/contrib/esami/doc/esami-doc-it.tex9
-rw-r--r--macros/latex/contrib/esami/doc/esami.bib5
-rw-r--r--macros/latex/contrib/esami/doc/examples/test14.tex465
-rw-r--r--macros/latex/contrib/esami/doc/examples/testA-sol.pdfbin232036 -> 211514 bytes
-rw-r--r--macros/latex/contrib/esami/doc/examples/testA.pdfbin177496 -> 178754 bytes
-rw-r--r--macros/latex/contrib/esami/es-italian.lng5
-rw-r--r--macros/latex/contrib/esami/esami-xyz.cfg11
-rw-r--r--macros/latex/contrib/esami/esami.sty707
13 files changed, 658 insertions, 573 deletions
diff --git a/macros/latex/contrib/esami/README b/macros/latex/contrib/esami/README
index ccb8c24163..0703530247 100644
--- a/macros/latex/contrib/esami/README
+++ b/macros/latex/contrib/esami/README
@@ -1,6 +1,6 @@
-The esami package v. 2.5
+The esami package v. 2.6
For generation of texts and solutions of exams in LaTeX
-2018/05/06
+2021/10/11
File: README
Author: Grazia Messineo and Salvatore Vassallo
@@ -14,7 +14,7 @@ varying in random order, with closed or open answer, matching, problems, and so
of each group are randomly scrambled across the exam and variants of each exercise are chosen
randomly from a file which contains them all and.
-Copyright: (C) 2008--2018 Grazia Messineo & Salvatore Vassallo
+Copyright: (C) 2008--2021 Grazia Messineo & Salvatore Vassallo
Licence: LPPL
FILES IN DISTRIBUTION
@@ -25,7 +25,7 @@ FILES IN DISTRIBUTION
VERSION
README This file.
esami.sty The main file
- xyz.cfg A template of configuration file
+ esami-xyz.cfg A template of configuration file
es-*.lng Localisation files
DOCUMENTATION:
@@ -50,7 +50,7 @@ FILES IN DISTRIBUTION
test4.tex
test5-fillin.tex
test9.tex
- test11.tex
+ test11.tex
test12.tex
test13.tex
test14.tex
@@ -63,8 +63,8 @@ FILES IN DISTRIBUTION
problem4-fillin.tex
Examples of an exam (and solutions) built using above exercises using pdflatex, xelatex and lualatex
- testA.pdf
- testA.tex
+ testA.pdf
+ testA.tex
testA-luatex-sol.pdf
testA-luatex.pdf
testA-sol.pdf
@@ -85,7 +85,7 @@ File sty and files cfg and lng must be copied in a folder where LATEX can find t
<texmf>/tex/latex/esami/
esami.sty The main file
- xyz.cfg A template of configuration file
+ esami-xyz.cfg A template of configuration file
es-*.lng Localisation files
@@ -93,4 +93,4 @@ File sty and files cfg and lng must be copied in a folder where LATEX can find t
README
doc-esami-en.pdf User manual in English
doc-esami-it.pdf User manual in Italian
- doc-esami-*.tex Sources for documentation \ No newline at end of file
+ doc-esami-*.tex Sources for documentation
diff --git a/macros/latex/contrib/esami/VERSION b/macros/latex/contrib/esami/VERSION
index d7a901e88e..655ad0fa4f 100644
--- a/macros/latex/contrib/esami/VERSION
+++ b/macros/latex/contrib/esami/VERSION
@@ -1 +1 @@
-VERSION 2.5 DATE=May 06, 2018
+VERSION 2.6 DATE=October 11, 2021
diff --git a/macros/latex/contrib/esami/doc/esami-doc-en.pdf b/macros/latex/contrib/esami/doc/esami-doc-en.pdf
index 8c00ce718d..017a1b28d8 100644
--- a/macros/latex/contrib/esami/doc/esami-doc-en.pdf
+++ b/macros/latex/contrib/esami/doc/esami-doc-en.pdf
Binary files differ
diff --git a/macros/latex/contrib/esami/doc/esami-doc-en.tex b/macros/latex/contrib/esami/doc/esami-doc-en.tex
index bb1f7f319b..33e51db7cd 100644
--- a/macros/latex/contrib/esami/doc/esami-doc-en.tex
+++ b/macros/latex/contrib/esami/doc/esami-doc-en.tex
@@ -77,6 +77,7 @@
\changes{Version 2.3}{2017/09/18}{Corrected a misprint in the code.}
\changes{Version 2.4}{2018/02/10}{Documentation corrected. }
\changes{Version 2.5}{2018/05/06}{Corrected a misprint in the code. Improved the selection of random exercises.}
+\changes{Version 2.6}{2021/10/11}{Improved the spacing in \cmd{\FPsignpol}. Corrected the code to avoid some spourios spaces. }
%\IndexPrologue{\section*{Index} Numbers written in italic refer to the page where the item is described; underlined numebers refer to the line of code in which the item is described; other references are to the line of code where the item is used.}
\GlossaryPrologue{\section*{Changelog}}
@@ -86,8 +87,8 @@
\fontshape\updefault
\footnotesize}
\GetFileInfo{esami.sty}
-\def\fileversion{version 2.5}
-\def\filedate{2018/05/06}
+\def\fileversion{versione 2.6}
+\def\filedate{2021/10/11}
\title{Package esami\thanks{This document
@@ -599,6 +600,8 @@ It's possible to exclude one or more values from the choice (parameter \oarg{exc
except 6 and the value assigned to \cmd{\a}).
\end{esempio}
+\textbf{N.B. It is better to define the parameters inside the environments \envname{problem}, \envname{problem*}, etc, to avoid spurious spaces between the name of the exercise and its body text. Anyway, the authors suggest to begin the text on a new line.}
+
You can work on the parameters defined with this command as on numbers and we have defined commands which allow to work on them showing both the numerical result and the operations in a parametric form.
\begin{itemize}
@@ -789,7 +792,7 @@ Inside this file you should use only one command, \cmd{\def \textbackslash eserc
\item[Version 2.3 (2017/09/18)] Corrected a misprint in the code.
\item[Version 2.4 (2018/02/10)] Documentation corrected.
\item[Version 2.5 (2018/05/06)] Corrected a misprint in the code. Improved the selection of random exercises.
-
+ \item[Version 2.6 (2021/10/11)] Improved the spacing in \cmd{\FPsignpol}. Corrected the code to avoid some spourios spaces.
\end{description}
\bibliographystyle{plain}
diff --git a/macros/latex/contrib/esami/doc/esami-doc-it.pdf b/macros/latex/contrib/esami/doc/esami-doc-it.pdf
index 1233910008..8b32737ca2 100644
--- a/macros/latex/contrib/esami/doc/esami-doc-it.pdf
+++ b/macros/latex/contrib/esami/doc/esami-doc-it.pdf
Binary files differ
diff --git a/macros/latex/contrib/esami/doc/esami-doc-it.tex b/macros/latex/contrib/esami/doc/esami-doc-it.tex
index f44d3a9d5d..d8e8363ee8 100644
--- a/macros/latex/contrib/esami/doc/esami-doc-it.tex
+++ b/macros/latex/contrib/esami/doc/esami-doc-it.tex
@@ -1,4 +1,3 @@
-%\documentclass[10pt]{article}
%\iffalse This is a METACOMMENT
%
@@ -77,6 +76,7 @@
\changes{Versione 2.3}{2017/09/18}{Corretto un errore di battitura nel codice.}
\changes{Versione 2.4}{2018/02/10}{Corretta la documentazione .}
\changes{Versione 2.5}{2018/05/06}{Corretto un errore di battitura nel codice. Migliorata la scelta aleatoria degli esercizi.}
+\changes{Versione 2.6}{2021/10/11}{Migliorata la spaziatura in \cmd{\FPsignpol}. Corretto il codice per eliminare alcuni spazi spuri.}
%\IndexPrologue{\section*{Indice} I numeri scritti in italico rimandano alla pagina dove è descritto l'item; i numeri sottolineati rimandano alla riga di codice in cui l'item è descritto; le altre referenze sono alla riga di codice dove l'item è usato.}
\GlossaryPrologue{\section*{Changelog}}
@@ -86,8 +86,8 @@
\fontshape\updefault
\footnotesize}
\GetFileInfo{esami.sty}
-\def\fileversion{versione 2.5}
-\def\filedate{2018/05/06}
+\def\fileversion{versione 2.6}
+\def\filedate{2021/10/11}
\title{Il pacchetto esami\thanks{Questo documento
@@ -607,6 +607,8 @@ Il parametro opzionale \oarg{seme}, serve a imporre un seme diverso per la gener
escluso 6 e il valore già assegnato ad \cmd{\a}).
\end{esempio}
+\textbf{N.B. È utile dare i comandi di definizione dei parametri all'interno dell'ambiente \envname{problem}, \envname{problem*}, ecc. per evitare la creazione di spazi spuri tra il nome dell'esercizio e il testo dello stesso. Gli autori consigliano comunque di iniziare il testo dell'esercizio su una nuova riga.}
+
Sui parametri definiti è possibile operare come su numeri e sono stati definiti comandi che permettono di operare su tali parametri mostrando il risultato numerico o le operazioni in forma parametrica.
\begin{itemize}
@@ -792,6 +794,7 @@ Al suo interno si deve usare un solo comando, \cmd{\def \textbackslash esercizio
\item[Versione 2.3 (2017/09/18)] Corretto un errore di battitura nel codice.
\item[Versione 2.4 (2018/02/10)] Corretta la documentazione .
\item[Versione 2.5 (2018/05/06)] Corretto un errore di battitura nel codice. Migliorata la scelta aleatoria degli esercizi.
+ \item[Versione 2.6 (2021/10/11)] Migliorata la spaziatura in \cmd{\FPsignpol}. Corretto il codice per eliminare alcuni spazi spuri.
\end{description}
diff --git a/macros/latex/contrib/esami/doc/esami.bib b/macros/latex/contrib/esami/doc/esami.bib
index 4380dffa62..5ca60ecc07 100644
--- a/macros/latex/contrib/esami/doc/esami.bib
+++ b/macros/latex/contrib/esami/doc/esami.bib
@@ -1,5 +1,4 @@
-% This file was created with JabRef 2.9.2.
-% Encoding: Cp1252
+% Encoding: UTF-8
@MISC{examdesign,
author = {Jason Alexander},
@@ -62,3 +61,5 @@
pages = {40-46},
number = {1}
}
+
+@Comment{jabref-meta: databaseType:bibtex;}
diff --git a/macros/latex/contrib/esami/doc/examples/test14.tex b/macros/latex/contrib/esami/doc/examples/test14.tex
index da8e182851..b544ebc859 100644
--- a/macros/latex/contrib/esami/doc/examples/test14.tex
+++ b/macros/latex/contrib/esami/doc/examples/test14.tex
@@ -2,25 +2,8 @@
\FPsetpar{a}{2}{5}
\FPsetpar{b}{2}{5}
\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14a $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}
- \begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14b $a=\a$, $b=\b$, $c=\c$
+\estrai{3,5,7,11}{alpha}
+\item \PTs{1} exercise 14a $a=\a$, $b=\b$, $c=\c$ $alphai=\alphai$\ $alphaii=\alphaii$\
\begin{answers}{1}\bChoices[random]
\Ans1 answer 1 correct\eAns
\Ans0 answer 2 wrong\eAns
@@ -33,227 +16,227 @@
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14c $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14d $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14e $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14c $a=\a$, $b=\b$, $c=\c$ \alphai\ \alphaii\
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14d $a=\a$, $b=\b$, $c=\c$ \alphai\ \alphaii\
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14e $a=\a$, $b=\b$, $c=\c$ \alphai\ \alphaii\
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
- \newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14f $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}
- \begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14g $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14h $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14k $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14i $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14j $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}
- \begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14l $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14m $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14n $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
-
-
-\newproblem{
-\FPsetpar{a}{2}{5}
-\FPsetpar{b}{2}{5}
-\FPsetpar{c}{2}{8}
-
-\item \PTs{1} exercise 14o $a=\a$, $b=\b$, $c=\c$
- \begin{answers}{1}\bChoices[random]
- \Ans1 answer 1 correct\eAns
- \Ans0 answer 2 wrong\eAns
- \Ans0 answer 3 wrong\eAns
- \Ans0 answer 4 wrong\eAns
- \Ans0 answer 5 wrong \eAns
- \eChoices\end{answers}\begin{solution}
- This is the solution $a=\a$, $b=\b$, $c=\c$
- \end{solution}}
+ %\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14f $a=\a$, $b=\b$, $c=\c$ \alphai\ \alphaii\
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}
+ %\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14g $a=\a$, $b=\b$, $c=\c$ \alphai\ \alphaii\
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14h $a=\a$, $b=\b$, $c=\c$
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14k $a=\a$, $b=\b$, $c=\c$
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14i $a=\a$, $b=\b$, $c=\c$
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14j $a=\a$, $b=\b$, $c=\c$
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}
+ %\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14l $a=\a$, $b=\b$, $c=\c$
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14m $a=\a$, $b=\b$, $c=\c$
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14n $a=\a$, $b=\b$, $c=\c$
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
+
+
+%\newproblem{
+%\FPsetpar{a}{2}{5}
+%\FPsetpar{b}{2}{5}
+%\FPsetpar{c}{2}{8}
+
+%\item \PTs{1} exercise 14o $a=\a$, $b=\b$, $c=\c$
+ %\begin{answers}{1}\bChoices[random]
+ %\Ans1 answer 1 correct\eAns
+ %\Ans0 answer 2 wrong\eAns
+ %\Ans0 answer 3 wrong\eAns
+ %\Ans0 answer 4 wrong\eAns
+ %\Ans0 answer 5 wrong \eAns
+ %\eChoices\end{answers}\begin{solution}
+ %This is the solution $a=\a$, $b=\b$, $c=\c$
+ %\end{solution}}
diff --git a/macros/latex/contrib/esami/doc/examples/testA-sol.pdf b/macros/latex/contrib/esami/doc/examples/testA-sol.pdf
index 67ec2164f8..4970190095 100644
--- a/macros/latex/contrib/esami/doc/examples/testA-sol.pdf
+++ b/macros/latex/contrib/esami/doc/examples/testA-sol.pdf
Binary files differ
diff --git a/macros/latex/contrib/esami/doc/examples/testA.pdf b/macros/latex/contrib/esami/doc/examples/testA.pdf
index c29557ff0b..16f1ca17ab 100644
--- a/macros/latex/contrib/esami/doc/examples/testA.pdf
+++ b/macros/latex/contrib/esami/doc/examples/testA.pdf
Binary files differ
diff --git a/macros/latex/contrib/esami/es-italian.lng b/macros/latex/contrib/esami/es-italian.lng
index a8b2a626d4..1da7162ab2 100644
--- a/macros/latex/contrib/esami/es-italian.lng
+++ b/macros/latex/contrib/esami/es-italian.lng
@@ -7,7 +7,7 @@
%%% Labels (xyz.cfg)
-\def\profname{Prof.\ }
+\def\profname{Prof Duck }
\def\studsignname{Firma leggibile dello studente}
\def\studlastname{Cognome}
\def\studfirstname{Nome}
@@ -56,8 +56,7 @@
%%% Useful Language dependent packages
\AtEndOfPackage{
-\usepackage[italian]{babel}
-%\NoIntelligentComma
+
\usepackage{geometry}
\geometry{a4paper,lmargin=6mm,rmargin=22mm,tmargin=10mm,bmargin=18mm,marginparsep=2mm,footskip=1cm}
\usepackage{icomma}
diff --git a/macros/latex/contrib/esami/esami-xyz.cfg b/macros/latex/contrib/esami/esami-xyz.cfg
index eb17b9b96e..0d76641979 100644
--- a/macros/latex/contrib/esami/esami-xyz.cfg
+++ b/macros/latex/contrib/esami/esami-xyz.cfg
@@ -1,11 +1,11 @@
%% Package `esami' to use with LaTeX 2e
-%% Copyright (C) 2008-2018 G. Messineo e S. Vassallo
+%% Copyright (C) 2008-2021 G. Messineo e S. Vassallo
%%
%% This is file `esami-xyz.cfg',
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% esami-xyz.cfg, 2018-05-06 %%
-%% Copyright (C) 2008-2018 G. Messineo e S. Vassallo %%
+%% esami-xyz.cfg, 2021-10-11 %%
+%% Copyright (C) 2008-2021 G. Messineo e S. Vassallo %%
%% %%
%% This program can be redistributed and/or modified %%
%% under the terms of the LaTeX Project Public License %%
@@ -27,6 +27,7 @@
\DeclareMathOperator{\arctg}{arctg}
\providecommand*{\dif}{\mathop{}\!\mathrm{d}}
\providecommand{\dlim}{\displaystyle \lim}
+\providecommand{\dsum}{\displaystyle \sum}
\providecommand{\me}{\mathrm{e}}
\providecommand{\D}{\displaystyle}
@@ -127,8 +128,8 @@ n. \thevers} -- %%
\sffamily \textbf{INSTRUCTIONS}
\begin{itemize}
\item Write here your instructions
- \item two è con accento
- \item three è à é ò ù
+ \item two
+ \item three
\end{itemize}}}
\def\istruzioniii{\setlength{\fboxsep}{1.5ex}\setlength{\fboxrule}{1.2pt}{\sffamily
diff --git a/macros/latex/contrib/esami/esami.sty b/macros/latex/contrib/esami/esami.sty
index 8d1e7e445e..668bef7606 100644
--- a/macros/latex/contrib/esami/esami.sty
+++ b/macros/latex/contrib/esami/esami.sty
@@ -2,8 +2,8 @@
%% This is file `esami.sty',
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% esami.sty package, 2018-02-10 %%
-%% Copyright (C) 2008-2018 G. Messineo e S. Vassallo %%
+%% esami.sty package, 2021-10-11 %%
+%% Copyright (C) 2008-2021 G. Messineo e S. Vassallo %%
%% %%
%% This program can be redistributed and/or modified %%
%% under the terms of the LaTeX Project Public License %%
@@ -45,9 +45,12 @@
% Version 2.5
% 2018/05/06
%Corrected a misprint in the code. Improved the selection of random exercises.
+% Version 2.6
+% 2021/10/11
+%Corrected a misprint in the code. Improved the selection of random exercises.
\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{esami}
- [2018/05/06 v2.5 An Exam Construction Package]
+ [2021/10/11 v2.6 An Exam Construction Package]
% +=============================+
% | THE OPTIONS |
@@ -130,9 +133,7 @@
%========================================================%
\newwrite\parametri
-
\DeclareOption{param}{\es@paramtrue \AtBeginDocument{\newwrite\params}}
-
\ProcessOptions\relax
% +=============================+
@@ -141,7 +142,7 @@
\usepackage{graphicx}
\usepackage{enumerate}
-\usepackage{fp}
+\usepackage[nomessages]{fp}
\usepackage{currfile}
\usepackage{array}
\usepackage{environ}
@@ -152,37 +153,33 @@
\ifes@pst
-\usepackage{pstricks,pstricks-add}
-\ifes@autopst
-\usepackage[crop=off,dvips={}]{auto-pst-pdf}
+ \usepackage{pstricks,pstricks-add}
+ \ifes@autopst
+ \usepackage[crop=off,dvips={}]{auto-pst-pdf}
\else
-\usepackage[off]{auto-pst-pdf}
+ \usepackage[off]{auto-pst-pdf}
\fi
- \else
+\else
\@ifpackageloaded{xcolor}{}{\usepackage{xcolor}}
\fi
+
\input random
%========================================================%
% Error Messages %
%========================================================%
-\def\testversioni{\ifthenelse{\not\equal{\numcompiti}{} } {\relax} %
+\def\testversioni{\ifthenelse{\not\equal{\numcompiti}{}}{\relax} %
{ \immediate\write16{\es@numcompitierror}
{\endlinechar=-1 \global\read16 to\numcompiti}}}
- \ifthenelse{\equal{\jobname}{\detokenize{master}}}{%%
- {%
- \PackageError{esami} %
- {\es@mastererror}
- {}}}
- \ifthenelse{\equal{\jobname}{\detokenize{master-sol}}}{%%
- {%
- \PackageError{esami} %
- {\es@mastererror}
- {}}}
+ \ifthenelse{\equal{\jobname}{\detokenize{master}}} {{ \PackageError{esami} {\es@mastererror}{}}}%
+ \ifthenelse{\equal{\jobname}{\detokenize{master-sol}}}{{\PackageError{esami}{\es@mastererror}{}}}%
+
+\ifes@language
+\else
+ \InputIfFileExists{es-italian.lng}{ \typeout{esami: No language chosen: Italian language will be used.}}{NO LANGUAGE!!!}
+\fi
-\ifes@language \else \InputIfFileExists{es-italian.lng}%
- { \typeout{esami: No language chosen: Italian language will be used.}}{NO LANGUAGE!!!}\fi
%========================================================%
% DIMENSIONS %
%========================================================%
@@ -264,13 +261,14 @@
\newcounter{nomefile}%%% counter for year-month-day
\newcount\tmp@quest %%% the number of the exercise
\newcount\@probselN %%% in \selectrandomlyn
-\newcount\@shfctr \newcount\@shfA \newcount\@shfB %%% In "\shuffle"
+\newcount\@shfctr %%% In "\shuffle"
+\newcount\@shfA %%% In "\shuffle"
+\newcount\@shfB %%% In "\shuffle"
\newcount\icount %%% counter to shuffle exercises
\newcount\io
\newcount\inizio
\newcount\old@rando
\FPeval\seme{round(\thenomefile+1-trunc(\thenomefile/(2^31-1):0)*(2^31-1):0)}
-%\FPset\semeex\seme
\def\semeex{\seme}
\inizio=1
%%%%
@@ -281,7 +279,7 @@
\newcounter{fp@contatore}%%% used in \FPsetpar
\newcount\old@randomii%%% used to change seed shuffling exercise
\newcount\old@randomi%%% used to change seed in \FPsetpar
-\newcount\old@random%%% used to change seed in \selectrandomly %%%NUOVO
+\newcount\old@random%%% used to change seed in \selectrandomly
\newcount\sh@max%%% used to choose the exercises
\newcount\@probN%%% number of exercises in \selectrandomly
\newcount\j@m%%% temporary counter in \newproblem
@@ -290,7 +288,8 @@
\newcounter{shuf@lop}
\newcounter{temp@cnt}
\newcounter{questionno}%%% the number of the question in test
-\newcount\@esquestiondepth \@esquestiondepth=0
+\newcount\@esquestiondepth
+ \@esquestiondepth=0
\newcounter{esquestionnoi}
\renewcommand{\theesquestionnoi}{\arabic{esquestionnoi}}
\newcounter{esquestionnoii}
@@ -374,12 +373,15 @@
\newcommand\exlabelformatwp{{\scshape\exlabel\ \theex@no.}}
\newcommand{\exsolafter}{\es@exsolafterDefault}
\newcommand{\es@exsolafterDefault}{\textit{\es@solutionname}: }
-\newcommand{\esexlisttabheader}
-{(\hfil\theex@partno\hfil)%
-}
-\newcommand{\ex@header}
-{\hbox{\if\exerstar*\exlabelformatwp\else%
- \exlabelformat\fi}%
+\newcommand{\esexlisttabheader}{(\hfil\theex@partno\hfil)}
+\newcommand{\ex@header}{\hbox
+{%
+\if
+ \exerstar*\exlabelformatwp%
+\else
+ \exlabelformat
+ \fi
+ }%
}
% +=============================+
@@ -390,36 +392,54 @@
% Maths %
%========================================================%
-%\ifes@param
-%\newcommand{\FPsv}[2][0]{(#2)}%%% \FPsv shows oparations
-%\newcommandx{\FPval}[3][2=0]{\expandafter\def\csname#1\endcsname{(#1)}
-%\immediate\write\params{%%% writes on a file
-% \string\textbf\string{\string\noindent\space \es@parametermessagea{#1}{#3}
-% \string}\string\newline}}
-%\else
-\newcommand{\FPsv}[2][0]{\FPeval{\fp@tmpa}{clip(round(#2:#1))}\numprint{\fp@tmpa}}%%% It does operations with #1 decimals and with the "param" option it shows operations
-\newcommandx{\FPval}[3][2=0]{\FPeval{#1}{clip(round(#3:#2))}}%% it works like \FPsv with the option param, like \FPeval otherwise
-%\fi
+
+\newcommand{\FPsv}[2][0]
+{%%%% It does operations with #1 decimals and with the "param" option it shows operations
+ \FPeval{\fp@tmpa}{clip(round(#2:#1))}\numprint{\fp@tmpa}\relax
+ }
+\newcommandx{\FPval}[3][2=0]{%% it works like \FPsv with the option param, like \FPeval otherwise
+ \FPeval{#1}{clip(round(#3:#2))%
+ }%
+ }
+
+
%========================================================%
% fractions %
%========================================================%
\newcommand{\@sempli}[2]{%%%% simplification (private command)
- \FPeval\segnofrac{round(#1:0)*round(#2:0)}
- \FPeval\fp@tmp{round(abs(#1):0)}\FPset\fp@n{\fp@tmp}%
+ \FPeval\segnofrac{round(#1:0)*round(#2:0)}%
+ \FPeval\fp@tmp{round(abs(#1):0)}%
+ \FPset\fp@n{\fp@tmp}%
\FPeval\fp@tmp{round(abs(#2):0)}%
- \FPifzero{\fp@tmp}\PackageError{esami}{\es@zerodenerror{#1}{#2}}\fi
+ \FPifzero{\fp@tmp}
+ \PackageError{esami}{\es@zerodenerror{#1}{#2}}%
+ \fi
\FPset\fp@d{\fp@tmp}%
- \FPeval\fp@num{max(\fp@n,\fp@d)}\FPeval\fp@den{min(\fp@n,\fp@d)}\FPset\fp@resto{\fp@den}\whiledo{\fp@resto>0}%
- {\FPset\fp@restoold{\fp@resto}\FPeval\fp@resto{round((\fp@num-trunc((\fp@num)/\fp@den:0)*(\fp@den)):0)}%
- \FPset\fp@num{\fp@den}\FPset\fp@den{\fp@resto}}\FPeval\fp@num{round((\fp@n/\fp@restoold):0)}\FPeval\fp@den{round((\fp@d/\fp@restoold):0)}%
- \FPifneg\segnofrac{-}\else{}\fi\ifthenelse{\fp@den=1}{\ifthenelse{\fp@num=1}{1}{\fp@num}}{\frac{\fp@num}{\fp@den}}%
+ \FPeval\fp@num{max(\fp@n,\fp@d)}%
+ \FPeval\fp@den{min(\fp@n,\fp@d)}%
+ \FPset\fp@resto{\fp@den}%
+ \whiledo{\fp@resto>0}%
+ {%
+ \FPset\fp@restoold{\fp@resto}%
+ \FPeval\fp@resto{round((\fp@num-trunc((\fp@num)/\fp@den:0)*(\fp@den)):0)}%
+ \FPset\fp@num{\fp@den}%
+ \FPset\fp@den{\fp@resto}%
+ }
+ \FPeval\fp@num{round((\fp@n/\fp@restoold):0)}%
+ \FPeval\fp@den{round((\fp@d/\fp@restoold):0)}%
+ \FPifneg\segnofrac{-}
+ \else{}
+ \fi
+ \ifthenelse{\fp@den=1}{%
+ \ifthenelse{\fp@num=1}{1}{\fp@num}
+ }
+ {\frac{\fp@num}{\fp@den}}%
}
\newcommand{\sempli}[2]{%%% simplification (user command)
\FPeval\fp@tmp{round(abs(#1):0)}%
- \FPifzero{\fp@tmp}\PackageError{esami}{\es@zeronumerrorshort{#1}{#2}}
- {\es@zeronumerrorlong{#1}{#2}}\fi
+ \FPifzero{\fp@tmp}\PackageError{esami}{\es@zeronumerrorshort{#1}{#2}}{\es@zeronumerrorlong{#1}{#2}}\fi
\FPeval\fp@temp{round(abs(#2):0)}%
\FPifeq{\fp@tmp}{\fp@temp}\PackageWarning{esami}{\es@fraconewarn{#1}{#2}}\fi
\@sempli{#1}{#2}%
@@ -427,37 +447,29 @@
\newcommand{\semplix}[2]{%%% simplification (coefficients)
\FPeval\fp@tmp{round(abs(#1):0)}%
- \FPifzero{\fp@tmp}\PackageError{esami}{\es@zeronumerrorshort{#1}{#2}}
- {\es@zeronumerrorlong{#1}{#2}}\fi
+ \FPifzero{\fp@tmp}\PackageError{esami}{\es@zeronumerrorshort{#1}{#2}}{\es@zeronumerrorlong{#1}{#2}}\fi
\FPeval\t@mpa{round(#1:0)}\FPeval\t@mpb{round(#2:0)}%
- \ifthenelse{\t@mpa=\t@mpb}{}%
- {\ifthenelse{\t@mpa=-\t@mpb}{-}%
- {\@sempli{#1}{#2}}%
- }
+ \ifthenelse{\t@mpa=\t@mpb}{}{\ifthenelse{\t@mpa=-\t@mpb}{-}{\@sempli{#1}{#2}}}
}
\newcommand{\sempliz}[2]{%%% simplifications (zero)
\FPeval\t@mpa{round(#1:0)}%
- \ifthenelse{\t@mpa=0}{0}%
- {\@sempli{#1}{#2}}%
+ \ifthenelse{\t@mpa=0}{0}{\@sempli{#1}{#2}}%
}
\newcommand{\esempli}[2]{%%% simplification (exponents)
\FPeval\fp@tmp{round(abs(#1):0)}%
- \FPifzero{\fp@tmp}\PackageError{esami}{\es@zeronumerrorshort{#1}{#2}}
- {\es@zeronumerrorlong{#1}{#2}}\fi
- \FPeval\t@mpa{round(#1:0)}\FPeval\t@mpb{round(#2:0)}%
- \ifthenelse{\t@mpa=\t@mpb}{}%
- {\ifthenelse{\t@mpa=-\t@mpb}{-1}%
- {\@sempli{#1}{#2}}%
- }
+ \FPifzero{\fp@tmp}\PackageError{esami}{\es@zeronumerrorshort{#1}{#2}}{\es@zeronumerrorlong{#1}{#2}}\fi
+ \FPeval\t@mpa{round(#1:0)}%
+ \FPeval\t@mpb{round(#2:0)}%
+ \ifthenelse{\t@mpa=\t@mpb}{}{\ifthenelse{\t@mpa=-\t@mpb}{-1}{\@sempli{#1}{#2}}}
}
%========================================================%
% Radicals (simplification) %
%========================================================%
-\newcommand\simpsqrt[2]{
+\newcommand\simpsqrt[2]{%
\FPset\tmp@sqi{2}%
\FPset\sq@factor{1}%
\FPset\tmp@factor{1}%
@@ -466,20 +478,69 @@
\FPeval\sq@ind{round(#1:0)}%
\FPeval\tmp@sqpw{round(\tmp@sqi^(\sq@ind):0)}%
\FPeval\tmp@sqj{round(\sq@rad+1:0)}%
- \ifthenelse{\equal\sq@rad{0}}{0}{%
- \whiledo{\tmp@sqpw<\tmp@sqj}{\FPeval\tmp@rad{\sq@rad/\tmp@sqpw}%
- \FPeval\sq@resto{round((\sq@rad-trunc((\sq@rad)/\tmp@sqpw:0)*(\tmp@sqpw)):0)}%
- \ifthenelse{\equal{\sq@resto}{0}}{\FPset\tmp@factor{\sq@factor}\FPeval\sq@factor{round(\tmp@factor*\tmp@sqi:0)}\FPeval\sq@rad{round(\tmp@rad:0)}%
- \FPset\tmp@sqi{1}}{}\FPset\tmp@sqii{\tmp@sqi}\FPeval\tmp@sqi{round(\tmp@sqii+1:0)}\FPeval\tmp@sqpw{round(\tmp@sqi^(\sq@ind):0)}}%
- \ifthenelse{\isodd{\sq@ind}}{%
- \ifthenelse{\equal{\sq@factor}{1}} {\ifthenelse{\equal{\sq@rad}{1}}{\ifthenelse{\sq@segno<0}{-1}{1}}
- {\ifthenelse{\sq@segno<0}{-\sqrt[\sq@ind]{\sq@rad}}{\sqrt[\sq@ind]{\sq@rad}}}}%
- {\ifthenelse{\equal{\sq@rad}{1}}{\ifthenelse{\sq@segno<0}{-\sq@factor}{\sq@factor} }
- {\ifthenelse{\sq@segno<0}{-\sq@factor\sqrt[\sq@ind]{\sq@rad}}{\sq@factor\sqrt[\sq@ind]{\sq@rad} }}}}%
- {\ifthenelse{\sq@segno<0}{\PackageError{esami}{\es@radicalerror}}{\ifthenelse{\equal{\sq@factor}{1}} {\ifthenelse{\equal{\sq@rad}{1}}{1}
- {\ifthenelse{\sq@ind=2}{\sqrt{\sq@rad}}{\sqrt[\sq@ind]{\sq@rad}}} }%
- {\ifthenelse{\equal{\sq@rad}{1}}{\sq@factor}{\ifthenelse{\sq@ind=2}{\sq@factor\sqrt{\sq@rad}}{\sq@factor\sqrt[\sq@ind]{\sq@rad}}} }}}}%
- }
+ \ifthenelse{\equal\sq@rad{0}}{0}
+ {%
+ \whiledo{\tmp@sqpw<\tmp@sqj}
+ {%
+ \FPeval\tmp@rad{\sq@rad/\tmp@sqpw}%
+ \FPeval\sq@resto{round((\sq@rad-trunc((\sq@rad)/\tmp@sqpw:0)*(\tmp@sqpw)):0)}%
+ \ifthenelse{\equal\sq@resto{0}}
+ {%
+ \FPset\tmp@factor{\sq@factor}%
+ \FPeval\sq@factor{round(\tmp@factor*\tmp@sqi:0)}%
+ \FPeval\sq@rad{round(\tmp@rad:0)}%
+ \FPset\tmp@sqi{1}
+ }{}
+ \FPset\tmp@sqii{\tmp@sqi}%
+ \FPeval\tmp@sqi{round(\tmp@sqii+1:0)}%
+ \FPeval\tmp@sqpw{round(\tmp@sqi^(\sq@ind):0)}
+ }%
+ \ifthenelse{\isodd{\sq@ind}}
+ {%
+ \ifthenelse{\equal{\sq@factor}{1}}
+ {%
+ \ifthenelse{\equal{\sq@rad}{1}}
+ {%
+ \ifthenelse{\sq@segno<0}{-1}{1}
+ }
+ {%
+ \ifthenelse{\sq@segno<0}{-\sqrt[\sq@ind]{\sq@rad}}
+ {\sqrt[\sq@ind]{\sq@rad}}
+ }
+ }
+ {%
+ \ifthenelse{\equal{\sq@rad}{1}}
+ {%
+ \ifthenelse{\sq@segno<0}{-\sq@factor}{\sq@factor}
+ }
+ {%
+ \ifthenelse{\sq@segno<0}{-\sq@factor\sqrt[\sq@ind]{\sq@rad}}{\sq@factor\sqrt[\sq@ind]{\sq@rad} }
+ }
+ }
+ }%
+ {%
+ \ifthenelse{\sq@segno<0}
+ {\PackageError{esami}{\es@radicalerror}}
+ {\ifthenelse{\equal{\sq@factor}{1}}
+ {%
+ \ifthenelse{\equal{\sq@rad}{1}}
+ {1}
+ {%
+ \ifthenelse{\sq@ind=2}{\sqrt{\sq@rad}}{\sqrt[\sq@ind]{\sq@rad}}
+ }
+ }%
+ {%
+ \ifthenelse{\equal{\sq@rad}{1}}
+ {\sq@factor}
+ {\ifthenelse{\sq@ind=2}
+ {\sq@factor\sqrt{\sq@rad}}
+ {\sq@factor\sqrt[\sq@ind]{\sq@rad}}
+ }
+ }
+ }
+ }
+ }
+ }
%========================================================%
% Coefficients of polynomial %
@@ -487,9 +548,24 @@
\newcommand{\FPsignpol}[2] %%% adapted from code contributed by Hjalmar Basile NEW 2016/04/11
{\FPval\tempsign{#1}
-\ifthenelse{\equal{#2}{}}{\ifnum \tempsign<0 {\sempli{\tempsign}{1}#2}\else \ifnum \tempsign>0{+\sempli{\tempsign}{1}#2}\else{}\fi\fi}
-{\ifnum \tempsign<0 {\semplix{\tempsign}{1}#2}\else \ifnum \tempsign>0{+\semplix{\tempsign}{1}#2}\else{}\fi\fi}
-} %%% nuovo 2016/12/11 per termine noto
+ \ifthenelse{\equal{#2}{}}
+ {%
+ \ifnum \tempsign<0 {\:\sempli{\tempsign}{1}#2}
+ \else
+ \ifnum \tempsign>0{\:+\:\sempli{\tempsign}{1}#2}
+ \else{}
+ \fi
+ \fi
+ }
+ {%
+ \ifnum \tempsign<0 {\:\semplix{\tempsign}{1}#2\:}
+ \else
+ \ifnum \tempsign>0{\:+\:\semplix{\tempsign}{1}#2}
+ \else{}
+ \fi
+ \fi
+ }
+} %% improved for spacing 2021/10/11
%========================================================%
@@ -501,8 +577,6 @@
\def\es@l@l{\normalsize\normalfont(d)}
\newcommand\PTs{\def\es@star{x}\@PTs}
\def\@PTs#1{%
-%\addtolength{\punteggio}{#1 pt} %% NEW 2016/04/11 to check the total score of exercises
-%\global\punteggio=\punteggio
\gdef\es@PTs{#1}\ifx\es@PTs\@empty\gdef\es@PTs{1}\fi
\global\let\esPTs=\es@PTs\global\let\es@PTs=\@empty
\if\es@star*\else\PTs@Hook\fi
@@ -512,34 +586,6 @@
\let\qMark@Hook\@empty
\newcommand{\post@questionsHook}{}
\newcommand{\punti}{}
-%%=========================================================================%
-%% Modified commands for parametric version in "totale-versioni" %
-%%=========================================================================%
-%%%%
-%\ifes@param
-%\renewcommand{\FPsv}[2][0]{(#2)}%%% \FPsv shows oparations
-%\renewcommandx{\FPval}[3][2=0]{\expandafter\def\csname#1\endcsname{(#1)}
-%\immediate\write\params{%%% writes on a file
-% \string\textbf\string{\string\noindent\space \es@parametermessagea{#1}{#3}
-% \string}\string\newline}}
-%\renewcommand{\FPsignpol}[2]{+(#1)#2} %%% adapted from code contributed by Hjalmar Basile NEW 2016/04/11
-%\renewcommand{\simpsqrt}[2]{\sqrt[#1]{(#2)}}%%% \simpsqrt shows operations
-%\renewcommand{\sempli}[2]{%%% all simplifications become \frac
-% \ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
-% \renewcommand{\semplix}[2]{%
-% \ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
-% \renewcommand{\sempliz}[2]{%
-% \ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
-% \renewcommand{\esempli}[2]{%
-% \ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
-% \PTsHook{\emph{(\esPTs\ \ifthenelse{\equal{\esPTs}{\detokenize{1}}}{\es@pointname}{\es@pointsname})} %
-% \ifes@test
-% \immediate\closeout\params
-% \fi
-% }
-%\fi
-
-
%========================================================%
% Commands adapted from eqexam %
@@ -595,45 +641,69 @@
%%%%%%% Fill in %%%%%%
\newcommand\fillinproblem{\es@fillintrue%
\ifes@solutions
-\immediate\openout\parametri=qf\nome q\romannumeral\tmp@quest e\thevers.parametri.tex
+ \immediate\openout\parametri=qf\nome q\romannumeral\tmp@quest e\thevers.parametri.tex
\fi
}
\ifes@solutions
-\def\fill@ans@color#1{\bfseries\color{red}{#1}}%%% with solutions answers are in red by default
- \else
+ \def\fill@ans@color#1{\bfseries\color{red}{#1}}%%% with solutions answers are in red by default
+ \else
\def\fill@ans@color#1{\phantom{#1}}%%% without solutions option -> no answers
- \fi
+ \fi
\newcommand{\fillin}[3][u]{%%% #1= the box (u=underlined, e=empty, b= boxed) #2= space for the answer, #3= the correct answer
\space
\ifx#1u\let\fillin@Fmt=\underbar%%% by default underlined space
- \else\ifx#1e\let\fillin@Fmt=\relax%%% empty space
- \else\ifx#1b\let\fillin@Fmt=\fbox%%% box
- \fi\fi\fi
- \fillin@Fmt{\parbox[b][.8\height][b]{#2}{%
- \strut\hfil\fill@ans@color{#3}\hfil}%
- \ifes@test
+ \else
+ \ifx#1e\let\fillin@Fmt=\relax%% empty space
+ \else
+ \ifx#1b\let\fillin@Fmt=\fbox%%% box
+ \fi
+ \fi
+ \fi
+\fillin@Fmt{\parbox[b][.8\height][b]{#2}{%
+ \strut\hfil\fill@ans@color{#3}\hfil}%
+ \ifes@test
\ifes@prova
\else
-\ifes@solutions%%% to write the string of solutions
-\immediate\write\sols{\string\item\space\string\makeatletter\space\string\input\string{qf\nome q\romannumeral\tmp@quest e\thevers.parametri\string}\string\makeatother}
-\immediate\write\sols{\unexpanded{#3}}
-\immediate\write\loe{\es@exercisename\space\theesquestionnoi:\space \probchosen}
-\fi
-\fi
-\fi
+ \ifes@solutions%%% to write the string of solutions
+ \immediate\write\sols{%
+ \string\item\space\string\makeatletter\space\string\input\string{qf\nome q\romannumeral\tmp@quest e\thevers.parametri\string}\string\makeatother}
+ \immediate\write\sols{\unexpanded{#3}}
+ \immediate\write\loe{\es@exercisename\space\theesquestionnoi:\space \probchosen}
+ \fi
+ \fi
+ \fi
}
}
%%%%% Other commands %%%%%%
-\newcommand\stepverssols{\immediate\write\sols{\string\begin{minipage}{.33\string\textwidth}{\string\large\string\textbf{\es@solutionname\ \versionname\ n. \thevers}}}}
-\newcommand\closeverssols{\immediate\write\sols{\string\end{minipage}}}
-
-\newcommand\stepvers{\stepcounter{vers}\ifes@solutions\stepverssols
-\immediate\write\loe{\versionname\space n. \thevers}\fi}
- \newcommand\closevers{\newpage\setcounter{page}{1}\setcounter{ex@no}{0}\ifes@solutions\closeverssols
- \immediate\write\loe{\space}
- \immediate\write\loe{\space}
- \fi}
+\newcommand\stepverssols%
+{%
+\immediate\write\sols
+ {%
+\string\begin{minipage}{.33\string\textwidth}{\string\large\string\textbf{\es@solutionname\ \versionname\ n. \thevers}}
+ }
+}
+\newcommand\closeverssols%
+{%
+\immediate\write\sols{\string\end{minipage}}
+}
+\newcommand\stepvers
+{%
+\stepcounter{vers}
+ \ifes@solutions\stepverssols
+ \immediate\write\loe{\versionname\space n. \thevers}
+ \fi
+}
+ \newcommand\closevers
+{%
+\newpage\setcounter{page}{1}
+\setcounter{ex@no}{0}
+ \ifes@solutions
+ \closeverssols
+ \immediate\write\loe{\space}
+ \immediate\write\loe{\space}
+ \fi
+}
\def\mydate#1/#2/#3\@empty{\setcounter{nomefile}{\two@digits{#1}\two@digits{#2}\two@digits{#3}}}%%% it gives to the counter "nomefile" a value determined by the date
\PTsHook{\emph{(\esPTs\ \ifthenelse{\equal{\esPTs}{\detokenize{1}}}{\es@pointname}{\es@pointsname})}}%%% The name of the points
@@ -641,24 +711,34 @@
\proofingsymbol{$\blacktriangleright$}%%% the proofing symbol that can be changed in document
\newenvironment{gobbleenv}{\Collect@Body \@gobble}{}%%% this environment eats its content
-\AtBeginDocument{%%% the date and the date component of the seed and some code for solutions
+\AtBeginDocument%% the date and the date component of the seed and some code for solutions
+{%
\def\longdate{\expandafter\es@longdate\@date\@empty}
\def\shortdate{\expandafter\es@shortdate\@date\@empty}
\expandafter\mydate\@date\@empty
- \ifes@prova
- \else
-\ifes@solutions
-\newwrite\sols
-\immediate\openout\sols=\jobname.sol.tex
-\newwrite\loe
-\immediate\openout\loe=\jobname.loe
- \fi
- \fi}
-\newcommand\es@segnala{%%% this command gives the reference of the exact answer in the string of solutions
- \if\es@listType1\addtocounter{sq@quizno}{-1}\refstepcounter{sq@quizno}\fi
-\ifes@prova \else \label{\probchosen} \immediate\write\sols{ \string\item\string\ref{\probchosen}}
-\immediate\write\loe{\es@exercisename\space\theesquestionnoi:\space \probchosen} \fi
- }
+ \ifes@prova
+ \else
+ \ifes@solutions
+ \newwrite\sols
+ \immediate\openout\sols=\jobname.sol.tex
+ \newwrite\loe
+ \immediate\openout\loe=\jobname.loe
+ \fi
+ \fi
+ }
+\newcommand\es@segnala%%% this command gives the reference of the exact answer in the string of solutions
+{%
+ \if\es@listType1
+ \addtocounter{sq@quizno}{-1}
+ \refstepcounter{sq@quizno}
+ \fi
+ \ifes@prova
+ \else
+ \label{\probchosen}
+ \immediate\write\sols{\string\item\string\ref{\probchosen}}
+ \immediate\write\loe{\es@exercisename\space\theesquestionnoi:\space \probchosen}
+ \fi
+ }
\newcommand{\prior@questionsHook}{}
%========================================================%
@@ -666,55 +746,61 @@
%========================================================%
\def\maxLoopLimit{10}%
\ifes@param
-\newcommandx{\FPsetpar}[5][1=\seme,5={}]{%%% the parameters are not assigned
+\newcommandx{\FPsetpar}[5][1=\seme,5={}]{% %% the parameters are not assigned
\expandafter\def\csname#2\endcsname{#2}%%% in the parametric version, the parameter appears with its name and not with its value
- \immediate\write\params{%%% writes on a file
+ \immediate\write\params{% %% writes on a file
\string\textbf\string{\string\noindent\space \es@parametermessage{#2}{#3}{#4}
\space \ifx#5\@empty\else $#2\neq #5$.\fi\space \es@seedmessage{#1}
- \string}\string\newline}}
+ \string}\string\newline}}%
\else
\newcommandx{\FPsetpar}[5][1=\seme,5={}]{%
-\ifnum#3>#4\PackageError{esami}{\es@fpsetparerrshort{#2}}{\es@fpsetparerrlong{#2}}\fi%% NEW 2015
-\@ifundefined{nome}{\setcounter{fp@contatore}{-2}}{
-\@ifundefined{base\nome}{\setcounter{fp@contatore}{-2}}{\setcounter{fp@contatore}{-\csname base\nome \endcsname}}}
-\FPval{randomico}{\thevers+\then@par+\thequestionno+#1}
-\old@randomi=\number\randomi%%% it saves the old seed
+\ifnum#3>#4
+ \PackageError{esami}{\es@fpsetparerrshort{#2}}{\es@fpsetparerrlong{#2}}%
+\fi%
+\@ifundefined{nome}{\setcounter{fp@contatore}{-2}}{%
+ \@ifundefined{base\nome}{\setcounter{fp@contatore}{-2}}{\setcounter{fp@contatore}{-\csname base\nome \endcsname}}}%
+\FPeval{randomico}{round(\thevers+\then@par+\thequestionno+#1:0)}%
+\old@randomi=\number\randomi\relax%%% it saves the old seed
\stepcounter{n@par}%
\setcounter{fp@contatore}{-\value{vers}}%
-\randomi=\randomico%
-\ifnum#3>0 \addtocounter{fp@contatore}{-#3} \else \addtocounter{fp@contatore}{#3}\fi
+\randomi=\randomico\relax
+\ifnum#3>0
+ \addtocounter{fp@contatore}{-#3}
+ \else
+ \addtocounter{fp@contatore}{#3}%
+\fi%
\whiledo{\value{fp@contatore}<\value{questionno}}{\nextrandom\stepcounter{fp@contatore}}%
\setrannum{\tmp@a}{#3}{#4}%
\def\rand@ne{#5}%%% checks the parameter (adapted from rangen)
-\ifx\rand@ne\@empty\else\loopCnt=0\relax%
-\@whilenum\loopCnt<\maxLoopLimit\do{%
-\rnd@cnt=1\relax%
-\@for\ne@@tmp:=\rand@ne\do{%
-\ifnum\tmp@a=\ne@@tmp\relax%
-\multiply\rnd@cnt0\relax%
-\else%
-\multiply\rnd@cnt1\relax%
-\fi%
-}%
-\ifnum\rnd@cnt=1\relax%%% all conditions are satisfied
-\loopCnt=\maxLoopLimit%
-\else%
-\advance\loopCnt1\relax%
-\ifnum\loopCnt=\maxLoopLimit%
-\PackageError{esami}{\es@fpsetparerrorshort}{\es@fpsetparerrorshort}%
-\else%
-\setrannum{\tmp@a}{#3}{#4}%
-\fi%
-\fi%
+\ifx\rand@ne\@empty\else\loopCnt=0\relax
+ \@whilenum\loopCnt<\maxLoopLimit\do{%
+ \rnd@cnt=1\relax
+ \@for\ne@@tmp:=\rand@ne\do{%
+ \ifnum\tmp@a=\ne@@tmp\relax
+ \multiply\rnd@cnt0\relax
+ \else%
+ \multiply\rnd@cnt1\relax
+ \fi%
+ }%
+ \ifnum\rnd@cnt=1\relax%% all conditions are satisfied
+ \loopCnt=\maxLoopLimit\relax
+ \else%
+ \advance\loopCnt1\relax
+ \ifnum\loopCnt=\maxLoopLimit
+ \PackageError{esami}{\es@fpsetparerrorshort}{\es@fpsetparerrorshort}%
+ \else%
+ \setrannum{\tmp@a}{#3}{#4}%
+ \fi%
+ \fi%
+ }%
+ \fi%
+ \FPeval{#2}{round(\number\tmp@a:0)}%
+ \ifes@fillin
+ \immediate\write\parametri{\string\FPeval\string{#2\string}\string{round(\number\tmp@a:0)\string}}%
+ \fi
+ \randomi=\number\old@randomi%%% restores the seed
}%
\fi%
-\FPeval{#2}{round(\number\tmp@a:0)}%
-\ifes@fillin%
-\immediate\write\parametri{\string\FPeval\string{#2\string}\string{round(\number\tmp@a:0)\string}}%
-\fi%
-\randomi=\number\old@randomi%%% restores the seed
-}%
-\fi
%%%% Command for random sign (taken from rangen) %%%%%
\newcommand{\RandS}{%
@@ -731,25 +817,26 @@
%%%
\ifes@param
\renewcommand{\FPsv}[2][0]{(#2)}%%% \FPsv shows oparations
-\renewcommandx{\FPval}[3][2=0]{\expandafter\def\csname#1\endcsname{(#1)}
+\renewcommandx{\FPval}[3][2=0]
+{%
+\expandafter\def\csname#1\endcsname{(#1)}
\immediate\write\params{%%% writes on a file
- \string\textbf\string{\string\noindent\space \es@parametermessagea{#1}{#3}
- \string}\string\newline}}
+\string\textbf\string{\string\noindent\space \es@parametermessagea{#1}{#3}\string}\string\newline
+}
+}
\renewcommand{\FPsignpol}[2]{+(#1)#2} %%% adapted from code contributed by Hjalmar Basile NEW 2016/04/11
\renewcommand{\simpsqrt}[2]{\sqrt[#1]{(#2)}}%%% \simpsqrt shows operations
\renewcommand{\sempli}[2]{%%% all simplifications become \frac
\ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
- \renewcommand{\semplix}[2]{%
- \ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
- \renewcommand{\sempliz}[2]{%
- \ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
- \renewcommand{\esempli}[2]{%
- \ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
- \PTsHook{\emph{(\esPTs\ \ifthenelse{\equal{\esPTs}{\detokenize{1}}}{\es@pointname}{\es@pointsname})} %
+ \renewcommand{\semplix}[2]{\ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
+ \renewcommand{\sempliz}[2]{\ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
+ \renewcommand{\esempli}[2]{\ifthenelse{\equal{#2}{1}}{(#1)}{\frac{#1}{#2}}}
+ \PTsHook{%
+ \emph{(\esPTs\ \ifthenelse{\equal{\esPTs}{\detokenize{1}}}{\es@pointname}{\es@pointsname})} %
\ifes@test
\immediate\closeout\params
- \fi
- }
+ \fi
+ }
\fi
% +===================================+
@@ -763,33 +850,39 @@
\newcolumntype{$}{>{\global\let\currentrowstyle\relax}}
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}#1\ignorespaces}
-\ifes@solutions
-\colorlet{tab@ans@color}{red}
-\newcolumntype{C}[1]{>{\color{tab@ans@color}}#1}%%% the column of the solutions is red (option solution)
-\else
-\def\cancella#1\finqui{\phantom{#1}}
-\newcolumntype{C}[1]{>{\cancella}#1<{\finqui}}%%% the column of the solutions is empty (exam)
-\fi
+ \ifes@solutions
+ \colorlet{tab@ans@color}{red}
+ \newcolumntype{C}[1]{>{\color{tab@ans@color}}#1}%%% the column of the solutions is red (option solution)
+ \else
+ \def\cancella#1\finqui{\phantom{#1}}
+ \newcolumntype{C}[1]{>{\cancella}#1<{\finqui}}%%% the column of the solutions is empty (exam)
+ \fi
\newenvironment{tabella}[3][2]{\bigskip%%% open answers in columns #1=n. of visible columns (+1 invisible), #2={r,c,l} alignment of visible columns, #3={r,c,l} alignment of invisible column
\renewcommand\arraystretch{2}
-\begin{tabular}{$#2*{#1}{|^C#3}} }{
-\end{tabular} \renewcommand\arraystretch{1}}
+\begin{tabular}{$#2*{#1}{|^C#3}} }{\end{tabular} \renewcommand\arraystretch{1}}
%========================================================%
% Risposta %
%========================================================%
\ifes@solutions
-\newenvironment{risposta}[2][l]{\relax}{}
+ \newenvironment{risposta}[2][l]{\relax}{}
\else
-\newenvironment{risposta}[2][b]{% #1={b,l} box or lines, #2= heigth of box or number of lines
-\setlength{\es@rig}{#2cm minus 12pt}
- \ifx#1b \fbox{\parbox[b][\es@rig]{\textwidth}{\vfill\hfill }}
- \else
- \ifx#1l \setcounter{risp@righe}{-#2}\stepcounter{risp@righe}
-{\whiledo{\therisp@righe < #2}
-{ \par \vspace{.2cm} \dotfill \stepcounter{risp@righe}}}\else \fi\fi}
-{}
+ \newenvironment{risposta}[2][b]{% #1={b,l} box or lines, #2= heigth of box or number of lines
+ \setlength{\es@rig}{#2cm minus 12pt}
+ \ifx#1b
+ \fbox{\parbox[b][\es@rig]{\textwidth}{\vfill\hfill }}
+ \else
+ \ifx#1l
+ \setcounter{risp@righe}{-#2}\stepcounter{risp@righe}
+ {%
+ \whiledo{\therisp@righe < #2}
+ {\par \vspace{.2cm} \dotfill \stepcounter{risp@righe}}
+ }
+ \else
+ \fi
+ \fi}
+ {}
\fi
%========================================================%
@@ -803,44 +896,43 @@
\expandafter\edef\csname match@num\thematch@q\endcsname{\thematch@q}
}
\ifes@solutions
-\def\match@ans@color#1{\bfseries\color{red}{#1}}%%% visible solutions in red (solutions)
+ \def\match@ans@color#1{\bfseries\color{red}{#1}}%%% visible solutions in red (solutions)
\else
-\def\match@ans@color#1{\phantom{#1}}%%% invisible solutions (exam)
+ \def\match@ans@color#1{\phantom{#1}}%%% invisible solutions (exam)
\fi
\newcommand{\matching}{%%% it generates the 2 columns
\@getitemsr \@getitemsl
\vspace{5mm}
\setcounter{match@q}{0}
}
-\def\@getitemsl{%%% left column and shuffle of items
+\def\@getitemsl%%% left column and shuffle of items
+{%
\i@sh=\thematch@q
\loop
-\expandafter\let \csname flag\number\i@sh\endcsname a%
-\advance\i@sh by-1
-\ifnum\i@sh > 0 \repeat
+ \expandafter\let \csname flag\number\i@sh\endcsname a%
+ \advance\i@sh by-1
+ \ifnum\i@sh > 0 \repeat
\i@sh=\thematch@q
\loop
-\setrannum{\j@sh}{1}{\thematch@q}
-\expandafter\ifx \csname flag\number\j@sh\endcsname a%
-\expandafter\let \csname flag\number\j@sh\endcsname b%%% Sets the flag.
-\expandafter\edef\csname match@qsti\number\i@sh\endcsname{\noexpand\csname match@qstii\number\j@sh\endcsname}
-\setcounter{match@plu}{\thematch@q}
-\addtocounter{match@plu}{-\csname match@numii\number\j@sh\endcsname}
-\addtocounter{match@plu}{1}
-\setcounter{match@plo}{\thematch@q}
-\addtocounter{match@plo}{- \number\i@sh}
-\addtocounter{match@plo}{1}
-\expandafter\edef\csname match@numi\number\i@sh\endcsname{(\Alph{match@plu})}
-\vspace{2ex}
-
-\begin{tabular}{p{.05\textwidth}p{.40\textwidth}p{.01\textwidth}p{.40\textwidth}}
-\underbar{\makebox[.5cm]{\match@ans@color{\csname match@numi\number\i@sh\endcsname}}} & \csname match@qsti\number\i@sh\endcsname&&(\Alph{match@plo})\hspace{3mm}\csname match@ansi\number\i@sh\endcsname%\tabularnewline
-\end{tabular}
- \advance\i@sh by-1
- \ifnum\i@sh > 0 \fi
- \fi
- \ifnum\i@sh > 0
-\repeat
+ \setrannum{\j@sh}{1}{\thematch@q}
+ \expandafter\ifx \csname flag\number\j@sh\endcsname a%
+ \expandafter\let \csname flag\number\j@sh\endcsname b%%% Sets the flag.
+ \expandafter\edef\csname match@qsti\number\i@sh\endcsname{\noexpand\csname match@qstii\number\j@sh\endcsname}
+ \setcounter{match@plu}{\thematch@q}
+ \addtocounter{match@plu}{-\csname match@numii\number\j@sh\endcsname}
+ \addtocounter{match@plu}{1}
+ \setcounter{match@plo}{\thematch@q}
+ \addtocounter{match@plo}{- \number\i@sh}
+ \addtocounter{match@plo}{1}
+ \expandafter\edef\csname match@numi\number\i@sh\endcsname{(\Alph{match@plu})}
+ \vspace{2ex}
+ \begin{tabular}{p{.05\textwidth}p{.40\textwidth}p{.01\textwidth}p{.40\textwidth}}
+ \underbar{\makebox[.5cm]{\match@ans@color{\csname match@numi\number\i@sh\endcsname}}} & \csname match@qsti\number\i@sh\endcsname&&(\Alph{match@plo})\hspace{3mm}\csname match@ansi\number\i@sh\endcsname%\tabularnewline
+ \end{tabular}
+ \advance\i@sh by-1
+ \ifnum\i@sh > 0 \fi
+ \fi
+ \ifnum\i@sh > 0\repeat
}
\def\@getitemsr{%%% right column and shuffle of tems
\i@sh=\thematch@q
@@ -871,64 +963,67 @@
\newif\iffirstpass
\ifes@prova
-\newcommand{\newproblem}[1]{%%% \newproblem for the file "totale-versioni"
-\advance\tmp@quest by1
-\iffirstpass
-\global\advance\@probN by 1
-\else
-\let\nome\currfilebase
-\global\def\problabel{e:\thevers-file:\nome}
-\global\def\probnumber{q:\romannumeral\tmp@quest}
- \ifes@fillin
- \immediate\openout\parametri=qf\nome q\number\j@n e\thevers.parametri.tex
- \fi
-\expandafter\global\expandafter\newcommand\csname \probnumber \endcsname{#1}
- \fi
+ \newcommand{\newproblem}[1]%% \newproblem for the file "totale-versioni"
+{%
+ \advance\tmp@quest by1
+ \iffirstpass
+ \global\advance\@probN by 1
+ \else
+ \let\nome\currfilebase
+ \global\def\problabel{e:\thevers-file:\nome}
+ \global\def\probnumber{q:\romannumeral\tmp@quest}
+ \ifes@fillin
+ \immediate\openout\parametri=qf\nome q\number\j@n e\thevers.parametri.tex
+ \fi
+ \expandafter\global\expandafter\newcommand\csname \probnumber \endcsname{#1}
+ \fi
}
\else
\ifes@correzione
- \newcommand{\newproblem}[1]{%%% \newproblem for the "correzione" option
-\advance\tmp@quest by1
- \iffirstpass
- \global\advance\@probN by 1
- \else
- \let\nome\currfilebase
- \global\def\problabel{e:\thevers-file:\nome}
-\global\def\probnumber{q:\romannumeral\tmp@quest}
- \ifes@fillin
- \immediate\openout\parametri=qf\nome q\romannumeral\tmp@quest e\thevers.parametri.tex
- \fi
-\expandafter\global\expandafter\newcommand\csname @prob-\problabel-\probnumber \endcsname{\unexpanded{#1}}
- \expandafter\global\expandafter\newcommand\csname @probi-\problabel-\probnumber \endcsname{#1}
- \fi
- }
- \else
-\newcommand{\newproblem}[1]{%%% \newproblem for the exam
-\advance\tmp@quest by1
-\iffirstpass
-\global\advance\@probN by 1
-\else
-\let\nome\currfilebase
-\global\def\problabel{e:\thevers-file:\nome}
-\global\def\probnumber{q:\romannumeral\tmp@quest}
-\ifes@fillin
-\ifes@solutions%%% to write the string of solutions
-\immediate\openout\parametri=qf\nome q\romannumeral\tmp@quest e\thevers.parametri.tex
-\fi
-\fi
-
-\expandafter\global\expandafter\newcommand\csname @prob-\problabel-\probnumber \endcsname{\unexpanded{#1}}
-\expandafter\global\expandafter\newcommand\csname @probi-\problabel-\probnumber\endcsname{#1}%%% it assigns a unique name to exercise
-\fi
-}
-\fi
+ \newcommand{\newproblem}[1]%% \newproblem for the "correzione" option
+ {%
+ \advance\tmp@quest by1
+ \iffirstpass
+ \global\advance\@probN by 1
+ \else
+ \let\nome\currfilebase
+ \global\def\problabel{e:\thevers-file:\nome}
+ \global\def\probnumber{q:\romannumeral\tmp@quest}
+ \ifes@fillin
+ \immediate\openout\parametri=qf\nome q\romannumeral\tmp@quest e\thevers.parametri.tex
+ \fi
+ \expandafter\global\expandafter\newcommand\csname @prob-\problabel-\probnumber \endcsname{\unexpanded{#1}}
+ \expandafter\global\expandafter\newcommand\csname @probi-\problabel-\probnumber \endcsname{#1}
+ \fi
+}
+ \else
+ \newcommand{\newproblem}[1]%% \newproblem for the exam
+ {%
+ \advance\tmp@quest by1
+ \iffirstpass
+ \global\advance\@probN by 1
+ \else
+ \let\nome\currfilebase
+ \global\def\problabel{e:\thevers-file:\nome}
+ \global\def\probnumber{q:\romannumeral\tmp@quest}
+ \ifes@fillin
+ \ifes@solutions%%% to write the string of solutions
+ \immediate\openout\parametri=qf\nome q\romannumeral\tmp@quest e\thevers.parametri.tex
+ \fi
+ \fi
+ \expandafter\global\expandafter\newcommand\csname @prob-\problabel-\probnumber \endcsname{\unexpanded{#1}}
+ \expandafter\global\expandafter\newcommand\csname @probi-\problabel-\probnumber\endcsname{#1}%%% it assigns a unique name to exercise
+ \fi
+ }
+ \fi
\fi
\newcommand{\newfillinproblem}[1]{ \newproblem{\fillinproblem #1}}
%%%%%%%% \selectrandomly %%%%%%%
-\newcommand{\selectrandomly}[1]{%
+\newcommand{\selectrandomly}[1]
+{%
\global\@probN=0\relax
\firstpasstrue
\tmp@quest=0
@@ -936,7 +1031,7 @@
\firstpassfalse%%% now prints the question
\tmp@quest=0
\input{#1}
-\@ifundefined{base\nome}{\old@random=\number\randomi %%% 2015/01/16
+\@ifundefined{base\nome}{\old@random=\number\randomi
\randomi=\semeex
\setrannum{\rnd@cnta}{1}{\@probN}
\randomi=\number\old@random
@@ -944,10 +1039,9 @@
}{}
\old@rando=\number\randomi
\randomi=\semeex
-\ifthenelse{\number\semeex=\number\seme}{
-\FPeval\restotrentasei{round(\thevers+\thenomefile+1+base\nome-trunc((\thevers+\thenomefile+base\nome)/36:0)*36:0)}}{
-\FPeval\restotrentasei{round(1+\thenomefile+1+base\nome-trunc((1+\thenomefile+base\nome)/36:0)*36:0)}
-}
+\ifthenelse{\number\semeex=\number\seme}
+{\FPeval\restotrentasei{round(\thevers+\thenomefile+1+base\nome-trunc((\thevers+\thenomefile+base\nome)/36:0)*36:0)}}
+{\FPeval\restotrentasei{round(1+\thenomefile+1+base\nome-trunc((1+\thenomefile+base\nome)/36:0)*36:0)}}
\randomi=\number\old@rando %%% AGGIUNTO 2018/04/28 per giro sbagliato
\ifcase\@probN\or
\def\j@n{1}%%% just one variant
@@ -1015,6 +1109,7 @@
}{
\csname @probi-\problabel-q:\romannumeral\j@m \endcsname
}%
+ \Acapo
\fi
\par\vspace{2mm}
\ifes@param%
@@ -1862,7 +1957,7 @@
\immediate\write\params{\es@EstraiMessage{#2}{#3}}%%% writes to a file
\immediate\closeout\params
}
-\newcommand{\estraialfa}[3]{
+\newcommand{\estraialfa}[3]{%
\beg@al=#1
\loop
\expandafter\edef\csname #3\romannumeral\beg@al \endcsname{(#3\romannumeral\beg@al)}