diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/verifiche/verifiche.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/verifiche/verifiche.sty | 73 |
1 files changed, 64 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/verifiche/verifiche.sty b/Master/texmf-dist/tex/latex/verifiche/verifiche.sty index 917894db6ba..75d1b26a553 100644 --- a/Master/texmf-dist/tex/latex/verifiche/verifiche.sty +++ b/Master/texmf-dist/tex/latex/verifiche/verifiche.sty @@ -6,7 +6,7 @@ %% %% verifiche.dtx (with options: `package') %% This is a generated file. -%% Copyright (C) 2020 - 2023 by Francesco Raccanello +%% Copyright (C) 2020 - 2024 by Francesco Raccanello %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either %% version 1.3 of this license or (at your option) any later @@ -15,7 +15,8 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{verifiche} [2024/02/05 v7.1 .dtx verifiche file] +\ProvidesPackage{verifiche} [2024/11/27 v8.0 .dtx verifiche file] + \RequirePackage{xparse} @@ -25,6 +26,8 @@ \RequirePackage[shortlabels, inline]{enumitem} \RequirePackage{tikz} \RequirePackage[normalem]{ulem} +\RequirePackage[nomessages]{fp} +\RequirePackage{randomlist} %%newif \newif\ifsol \newif\ifinstitute\institutetrue @@ -59,8 +62,9 @@ \DeclareOptionX*{\PackageWarning{verifiche}{Unknown ‘\CurrentOption’}} \ProcessOptionsX %%counters -\newcounter{exercisenumber} -\newcounter{partialpoints}[exercisenumber] +\newcounter{exercisenumber}% +\newcounter{partialpoints}[exercisenumber]% +\newcounter{shuffleitemscount}% %%newlenght \newlength{\candidatenamerulerlength} \newlength{\classrulerlength} @@ -181,7 +185,7 @@ \renewcommand{\@ptplurlabel}{#2}% \renewcommand{\@ptsinglabel}{\IfNoValueTF{#1}{#2}{#1}}}% \newcommand{\@useptlabel}[1]{% - \ifnum#1=1 \@ptsinglabel \else \@ptplurlabel\fi} + \FPifeq{#1}{1} \@ptsinglabel \else \@ptplurlabel\fi}% %%partialpt label \newcommand{\@partialptsinglabel}{pt} \newcommand{\@partialptplurlabel}{pt} @@ -189,7 +193,7 @@ \renewcommand{\@partialptplurlabel}{#2}% \renewcommand{\@partialptsinglabel}{\IfNoValueTF{#1}{#2}{#1}}}% \newcommand{\@usepartialptlabel}[1]{% - \ifnum#1=1 \@partialptsinglabel \else \@partialptplurlabel\fi} + \FPifeq{#1}{1} \@partialptsinglabel \else \@partialptplurlabel\fi}% %%partialpt delimiter \newcommand{\@lpartialpt@delimiter}{(} \newcommand{\@rpartialpt@delimiter}{)} @@ -341,6 +345,16 @@ \@rpt@delimiter} \showmarginexercisetrue \fi}% +\define@key{esercizio}{sumpoints}[none]{% + \ifshowexercisept% + \def\@totalpartialpt{\convertreftonum{ptes@\theexercisenumber}}% + \def\sumpartialpt{% + \ptfont% + \@ptprefix\@lpt@delimiter% + \@totalpartialpt\space\@useptlabel{\@totalpartialpt}% + \@rpt@delimiter}% + \showmarginexercisetrue + \fi}% \define@key{esercizio}{partialpt}[none]{% \ifshowexercisept% \def\@totalpartialpt{\convertreftonum{ptes@\theexercisenumber}}% @@ -366,7 +380,8 @@ }% \newcommand{\savepointsaux}{% \ifdefined\sumpartialpt% - \protected@write \@auxout {}{\string\newlabel {ptes@\theexercisenumber}{{\thepartialpoints}{}}}% + \FPeval\sommafinale{clip(partialpoints)}% + \protected@write \@auxout {}{\string\newlabel {ptes@\theexercisenumber}{{\sommafinale}{}}}% \fi% \ifdefined\espoint% \protected@write \@auxout {}{\string\newlabel {ptes@\theexercisenumber}{{\pointes}{}}}% @@ -375,6 +390,7 @@ \NewDocumentEnvironment{esercizio}{o +b}{% \refstepcounter{exercisenumber}% + \FPset\partialpoints{0}% \showmarginexercisefalse% \IfValueT{#1}{\setkeys{esercizio}{#1}}% \par\addvspace{\baselineskip}% @@ -389,6 +405,7 @@ \savepointsaux% }% \NewDocumentEnvironment{esercizio*}{o +b}{% + \FPset\partialpoints{0}% \showmarginexercisefalse% \IfValueT{#1}{\setkeys{esercizio}{#1}}% \par\addvspace{\baselineskip}{\noindent\bfseries\exercisetitle}% @@ -407,7 +424,8 @@ \ptfont\hfill\@partialptprefix% \@lpartialpt@delimiter#1\space\@usepartialptlabel{#1}% \@rpartialpt@delimiter% - \addtocounter{partialpoints}{#1}}\ignorespaces% + \FPadd\partialpoints\partialpoints{#1}% + \xdef\partialpoints{\partialpoints}}\ignorespaces% \fi}% \define@key{soluzione}{label}[\solutionlabel]{% \def\verifiche@tempsoluzionelabel{#1}% @@ -559,7 +577,44 @@ \clearpage% }% }{} - +\newcommand{\shuffleseed}[1]{\RLsetrandomseed{#1}}% +\newcommand{\sitem}[1]{\InsertFirstItem{\verifiche@listname}{#1}}% +\NewDocumentEnvironment{shuffledenumerate}{O{} m}{% +\addtocounter{shuffleitemscount}{1}% +\edef\verifiche@listname{lista\theshuffleitemscount}% +\expandafter\NewList\expandafter{\verifiche@listname}% +#2% +}{% + \begin{enumerate}[#1]% +\ForEachRandomItem{\verifiche@listname}{items}{\items}% + \end{enumerate}% +\expandafter\ClearList\expandafter{\verifiche@listname}% +\addtocounter{shuffleitemscount}{-1}% +}% +\NewDocumentEnvironment{shuffleditemize}{O{} m}{% +\addtocounter{shuffleitemscount}{1}% +\edef\verifiche@listname{lista\theshuffleitemscount}% +\expandafter\NewList\expandafter{\verifiche@listname}% +#2% +}{% + \begin{itemize}[#1]% +\ForEachRandomItem{\verifiche@listname}{items}{\items}% + \end{itemize}% +\expandafter\ClearList\expandafter{\verifiche@listname}% +\addtocounter{shuffleitemscount}{-1}% +}% +\NewDocumentEnvironment{shuffledclosed}{m}{% +\addtocounter{shuffleitemscount}{1}% +\edef\verifiche@listname{lista\theshuffleitemscount}% +\expandafter\NewList\expandafter{\verifiche@listname}% +#1% +}{% + \begin{closedquestion}% +\ForEachRandomItem{\verifiche@listname}{items}{\items}% + \end{closedquestion}% +\expandafter\ClearList\expandafter{\verifiche@listname}% +\addtocounter{shuffleitemscount}{-1}% +}% \endinput %% %% End of file `verifiche.sty'. |