texlive[47573] Master: competences (2may18)

commits+karl at tug.org commits+karl at tug.org
Wed May 2 22:48:54 CEST 2018


Revision: 47573
          http://tug.org/svn/texlive?view=revision&revision=47573
Author:   karl
Date:     2018-05-02 22:48:54 +0200 (Wed, 02 May 2018)
Log Message:
-----------
competences (2may18)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/competences/
    trunk/Master/texmf-dist/doc/latex/competences/README.md
    trunk/Master/texmf-dist/doc/latex/competences/example.tex
    trunk/Master/texmf-dist/source/latex/competences/
    trunk/Master/texmf-dist/source/latex/competences/competences.dtx
    trunk/Master/texmf-dist/source/latex/competences/competences.ins
    trunk/Master/texmf-dist/tex/latex/competences/
    trunk/Master/texmf-dist/tex/latex/competences/competences.sty
    trunk/Master/tlpkg/tlpsrc/competences.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/competences/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/competences/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/competences/README.md	2018-05-02 20:48:54 UTC (rev 47573)
@@ -0,0 +1,21 @@
+
+This package is an attempt to track skills assessed during a classroom check.
+
+Each question can be associated with one or more skills and be assigned a number of points to be earned.
+
+At the end of the text, a table set summarizes the skills assessed, and in what proportions.
+
+
+
+-------------------------------------------------------------
+Copyright (C) 2016 by Christophe Bares <christopheATbares.fr>
+-------------------------------------------------------------
+
+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 version.
+The latest version of this license is in:
+
+    http://www.latex-project.org/lppl.txt
+
+and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later.


Property changes on: trunk/Master/texmf-dist/doc/latex/competences/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/competences/example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/competences/example.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/competences/example.tex	2018-05-02 20:48:54 UTC (rev 47573)
@@ -0,0 +1,81 @@
+\documentclass{article}
+
+\usepackage[
+% nomargin, % Remove margin competence tag
+]{competences}
+
+\renewcommand \thesection{\Alph{section}}
+
+\begin{document}
+
+\declareprefix{CA}
+\declareprefix{CB}
+\declareprefix{CC}
+
+% Declare competences is not mandantory,
+% but it defines order in sumup tables
+% and allows to detect forgiven competences.
+\declarecompetence{CA1}
+\declarecompetence{CA2}
+\declarecompetence{CB1}
+\declarecompetence{CB2}
+\declarecompetence{CC1}
+\declarecompetence{CC2}
+\declarecompetence{CC3}
+\declarecompetence{CC4}
+\declarecompetence{FOO}
+
+% Some competences are global,
+% ie not link to a particular question.
+\addGlobalCompetence[1]{CC4}
+\addGlobalCompetence[2]{CC3}
+
+
+\section{Test}
+Question one.
+\addcompetence{CA1}
+
+\section{test2}
+Question two with 2 competences.
+\addcompetence{CA1}\addcompetence{CA2}
+
+\subsection{test3}
+Question three with points different from 1.
+\addcompetence[3]{CB1}\addcompetence[1]{CC1}
+
+\subsubsection{test4}
+Question four in a subsubsection.
+\addcompetence[3]{CB1}
+
+
+\section{test5}
+\subsection{test6}
+\begin{enumerate}
+ \item Question five in enumerate \addcompetence[1]{CB2}
+ \item Question six \addcompetence[1]{CC2}
+  \begin{enumerate}
+    \item text seven in enumerate in enumerate\addcompetence[3]{CC1}
+    \item text hight \addcompetence[1]{CB2}
+  \end{enumerate}
+\end{enumerate}
+
+\section{Test 7}
+\subsection{test10}
+  \begin{enumerate}
+    \item text nine in enumerate\addcompetence{CB1}
+ \end{enumerate}
+
+
+\section{Résumé des compétences}
+\tableaupartie{A}
+% \tableaupartie{A}
+\tableaupartie{B}
+\tableaupartie{C}
+%\tableaupartie{D}
+
+\tableaupartie{Global}
+
+
+\tableauprefix{A,B,C,Global}
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/competences/example.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/competences/competences.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/competences/competences.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/competences/competences.dtx	2018-05-02 20:48:54 UTC (rev 47573)
@@ -0,0 +1,479 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2016 by Christophe Bares <christopheATbares.fr>
+% -------------------------------------------------------------
+%
+% 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 version.
+% The latest version of this license is in:
+%
+%    http://www.latex-project.org/lppl.txt
+%
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{competences.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+%<package>\ProvidesPackage{competences}
+%<*package>
+    [2016/10/27 v1.0]
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{competences}[2016/10/27]
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+  \DocInput{competences.dtx}
+  \PrintChanges
+  \PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{0}
+%
+% \CharacterTable
+%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%   Digits        \0\1\2\3\4\5\6\7\8\9
+%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%   Dollar        \$     Percent       \%     Ampersand     \&
+%   Acute accent  \'     Left paren    \(     Right paren   \)
+%   Asterisk      \*     Plus          \+     Comma         \,
+%   Minus         \-     Point         \.     Solidus       \/
+%   Colon         \:     Semicolon     \;     Less than     \<
+%   Equals        \=     Greater than  \>     Question mark \?
+%   Commercial at \@     Left bracket  \[     Backslash     \\
+%   Right bracket \]     Circumflex    \^     Underscore    \_
+%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%   Right brace   \}     Tilde         \~}
+%
+%
+% \changes{v0.1}{2016/06/26}{Initial version}
+% \changes{v1.0}{2016/10/27}{First functional version}
+%
+% \GetFileInfo{competences.dtx}
+%
+% \DoNotIndex{\newcommand,\newenvironment}
+%
+%
+% \title{The \textsf{competences} package\thanks{This document
+%   corresponds to \textsf{competences}~\fileversion, dated \filedate.}}
+% \author{Christophe Bares\\ \texttt{<christopheATbares.fr>}}
+%
+% \maketitle
+%
+% \section{Introduction}
+%
+% This package is a attempt to
+%
+% \section{Usage}
+%
+%
+% \DescribeMacro{\declareprefix}
+% This macro declares a new prefix as competence tag
+% \index{declareprefix|usage}. This macro takes the prefix you want
+% to declare as unique argument.
+%
+% This prefix will be use in sumup table. If you want to declare several
+% prefixes, use this macro for each prefix.
+
+
+% \DescribeEnv{dummyEnv}
+% This environment does nothing.  It is merely an example.
+% If this were a real environment, you would put a paragraph here
+% describing what the environment is supposed to do, what its
+% mandatory and optional arguments are, and so forth.
+%
+% \StopEventually{}
+%
+% \section{Implementation}
+%
+% \begin{macro}{\dummyMacro}
+% This is a dummy macro.  If it did anything, we'd describe its
+% implementation here.
+%    \begin{macrocode}
+\newcommand{\dummyMacro}{}
+
+
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{dummyEnv}
+% This is a dummy environment.  If it did anything, we'd describe its
+% implementation here.
+%    \begin{macrocode}
+\newenvironment{dummyEnv}{%
+}{%
+%    \end{macrocode}
+% \changes{v1.0a}{2004/11/05}{Added a spurious change log entry to
+%   show what a change \emph{within} an environment definition looks
+%   like.}
+% Don't use |%| to introduce a code comment within a |macrocode|
+% environment.  Instead, you should typeset all of your comments with
+% \LaTeX---doing so gives much prettier results.  For comments within a
+% macro/environment body, just do an |\end{macrocode}|, include some
+% commentary, and do another |\begin{macrocode}|.  It's that simple.
+%    \begin{macrocode}
+}
+%    \end{macrocode}
+% \end{environment}
+%
+
+% \iffalse
+%<*package>
+\RequirePackage[%
+color=blue!20,%
+]{todonotes}
+\reversemarginpar
+
+\RequirePackage{datatool}
+\RequirePackage{etoolbox}
+\RequirePackage{longtable}
+
+\def\total{0}
+\def\gtotal{0}
+
+
+\newcommand{\getCurrentSectionNumber}{%
+  \ifnum\c at enumi=0 %
+    \ifnum\c at section=0 %
+      \thechapter
+    \else
+      \ifnum\c at subsection=0 %
+        \thesection
+      \else
+        \ifnum\c at subsubsection=0 %
+          \thesubsection
+        \else
+          \thesubsubsection
+        \fi
+      \fi
+    \fi
+  \else
+    \ifnum\c at enumii=0 %
+       \theenumi
+     \else
+       \theenumii
+     \fi
+   \fi
+}
+
+%</package>
+\newcommand{\getCurrentpartiedocument}{%
+  \thesection
+}
+%<*package>
+
+\DTLgnewdb{CS}
+\DTLgnewdb{QUEST}
+\DTLgnewdb{PARTIE}
+\DTLgnewdb{PF}
+\DTLaddcolumn{QUEST}{compsec}%
+\DTLaddcolumn{QUEST}{partie}%
+
+% Is Competence already in DB?
+\newcommand{\ifcompexists}[3]{%
+  \DTLgetrowforkey{\competences at tmpcs}{CS}{cs}{#1}%
+  \ifdefempty{\competences at tmpcs}{#3}{#2}%
+}
+
+% Is Question already in DB?
+\newcommand{\ifquestexists}[3]{%
+  \DTLgetrowforkey{\competences at tmpq}{QUEST}{compsec}{#1}%
+  \ifdefempty{\competences at tmpq}{#3}{#2}%
+}
+
+% Is Part already in DB?
+\newcommand{\ifpartexists}[3]{%
+  \DTLgetrowforkey{\competences at tmpp}{PARTIE}{partie}{#1}%
+  \ifdefempty{\competences at tmpp}{#3}{#2}%
+}
+
+
+\newcommand{\addcompetence}[2][1]{%
+  \todo[noline]{#2}
+
+
+  \ifcompexists{#2}{%
+    }
+    {\DTLnewrow{CS}%
+    \DTLnewdbentry{CS}{cs}{#2}%
+    \DTLaddcolumn{QUEST}{#2}%
+    }
+  \def\quest{\getCurrentSectionNumber}
+  \def\partie{\getCurrentpartiedocument}
+
+  \ifpartexists{\partie}{}{
+    \DTLnewrow{PARTIE}%
+    \dtlexpandnewvalue
+    \DTLnewdbentry{PARTIE}{partie}{\partie}%
+    \dtlnoexpandnewvalue
+    }
+
+  \ifquestexists{\quest}{%
+    \DTLnewdbentry{QUEST}{#2}{#1}%
+  }{%
+    \DTLforeach*{CS}{\cs=cs}{
+      \DTLaddcolumn{QUEST}{\cs}%
+    }%
+
+    \DTLnewrow{QUEST}%
+    \dtlexpandnewvalue
+    \DTLnewdbentry{QUEST}{compsec}{\quest}%
+    \DTLnewdbentry{QUEST}{partie}{\partie}%
+    \dtlnoexpandnewvalue
+    \DTLnewdbentry{QUEST}{#2}{#1}%
+  }
+}
+
+\newcommand{\addGlobalCompetence}[2][1]{%
+  \ifcompexists{#2}{%
+  }{%
+    \DTLnewrow{CS}%
+    \DTLnewdbentry{CS}{cs}{#2}%
+    \DTLaddcolumn{QUEST}{#2}%
+  }
+
+  \def\quest{-}
+  \def\partie{Global}
+
+  \ifpartexists{\partie}{%
+  }{%
+    \DTLnewrow{PARTIE}%
+    \dtlexpandnewvalue
+    \DTLnewdbentry{PARTIE}{partie}{\partie}%
+    \dtlnoexpandnewvalue
+    }
+
+  \ifquestexists{\quest}{%
+    \DTLnewdbentry{QUEST}{#2}{#1}%
+  }{%
+    \DTLforeach*{CS}{\cs=cs}{
+      \DTLaddcolumn{QUEST}{\cs}%
+    }%
+
+    \DTLnewrow{QUEST}%
+    \dtlexpandnewvalue
+    \DTLnewdbentry{QUEST}{compsec}{\quest}%
+    \DTLnewdbentry{QUEST}{partie}{\partie}%
+    \dtlnoexpandnewvalue
+    \DTLnewdbentry{QUEST}{#2}{#1}%
+  }
+}
+
+
+\newcommand{\tableaucompetences}{%
+Ce sujet aborde \DTLrowcount{CS}\ compétences: \DTLforeach*{CS}{\compname=cs}{\compname\DTLiflastrow{.}{, }}
+  \bigskip
+
+
+  \begin{longtable}{l|c|*{\DTLrowcount{CS}}{|c}||c}
+  Question &Partie& \DTLforeach*{CS}{\cs=cs}{\cs &} points\\\hline
+  \DTLforeach*{QUEST}{\compsec=compsec,\partie=partie}{
+       \DTLforeachkeyinrow{\point}
+	{\DTLifstringeq{\point}{NULL}{}{
+	  \point%
+	  \DTLifstringeq{\dtlkey}{compsec}{}{%
+	    \DTLifstringeq{\dtlkey}{partie}{}{%
+	      \DTLgadd{\total}{\point}{\total}%
+	      }%
+	    }%
+	  } & %
+	}
+   \total
+   \DTLgadd{\gtotal}{\total}{\gtotal}
+   \DTLgadd{\total}{0}{0}
+   \DTLiflastrow{\\\hline}{\\}%
+  }%
+  Total &-&\DTLforeach*{CS}{\cs=cs}{\DTLsumforkeys{QUEST}{\cs}{\total} \total&} \gtotal\\\hline
+  & & \DTLforeach*{CS}{\cs=cs}{\cs &}
+  \end{longtable}
+
+%% For debugging
+%   \DTLdisplaylongdb{CS}
+%   \DTLdisplaylongdb{PARTIE}
+%  \DTLdisplaylongdb{QUEST}
+
+}
+%<*package>
+\def\cstotal{0}%
+%</package>
+\newcommand{\sumcspartie}[2]{%
+    \DTLgadd{\cstotal}{0}{0}%
+    \DTLforeach*[\DTLiseq{\part}{#1}]{QUEST}{\comp=#2,\part=partie}{%
+      \DTLifnull{\comp}{}{\DTLgadd{\cstotal}{\cstotal}{\comp}}%
+    }%
+%     \cstotal
+}
+
+
+
+\newcommand{\tableaupartie}[1]{%
+\def\ptotal{0}
+\def\pctotal{0}
+\def\gptotal{0}
+Bilan Partie #1
+  \begin{longtable}{l|c|*{\DTLrowcount{CS}}{|c}||c}%
+  Question &Partie& \DTLforeach*{CS}{\cs=cs}{\cs &} points\\\hline
+  \DTLforeach*[\DTLiseq{\partie}{#1}]{QUEST}{\compsec=compsec,\partie=partie}{%
+    \DTLforeachkeyinrow{\point}%
+      {\DTLifstringeq{\point}{NULL}{}{%
+	\point%
+	\DTLifstringeq{\dtlkey}{compsec}{}{%
+	  \DTLifstringeq{\dtlkey}{partie}{}{%
+	    \DTLgadd{\ptotal}{\point}{\ptotal}%
+	     }%
+	   }%
+	}&%
+      }%
+    \ptotal%
+    \DTLgadd{\gptotal}{\ptotal}{\gptotal}%
+    \DTLgadd{\ptotal}{0}{0}%
+    \\\hline%
+  }%
+  Total &-&\DTLforeach*{CS}{\cs=cs}{%
+    \sumcspartie{#1}{\cs}%
+    \cstotal
+    &
+    }%
+    \gptotal\\\hline
+  Total \% &-&\DTLforeach*{CS}{\cs=cs}{%
+    \sumcspartie{#1}{\cs}
+    \DTLdiv{\pctotal}{\cstotal}{\gptotal}%
+    \DTLmul{\pctotal}{100}{\pctotal}%
+    \DTLround{\pctotal}{\pctotal}{1}%
+    \pctotal \%&%
+    }%
+    100.0\%\\\hline
+  & & \DTLforeach*{CS}{\cs=cs}{\cs &}
+  \end{longtable}
+
+%% For debugging
+%   \DTLdisplaylongdb{CS}
+%   \DTLdisplaylongdb{QUEST}
+%    \DTLdisplaylongdb{PARTIE}
+}
+
+\def\pftotal{0}
+\newcommand{\sumpfpartie}[2]{%
+  \DTLgadd{\pftotal}{0}{0}%
+  \DTLforeach*[\DTLisinlist{\partiein}{#1}]{QUEST}{\compsec=compsec,\partiein=partie}{%
+    \DTLforeachkeyinrow{\point}{%
+      \DTLifstringeq{\point}{NULL}{}{%
+	\DTLifstringeq{\dtlkey}{compsec}{}{%
+	  \DTLifstringeq{\dtlkey}{partie}{}{%
+	    \DTLifStartsWith{\dtlkey}{#2}{%
+		\DTLgadd{\pftotal}{\pftotal}{\point}%
+	    }{}%
+	  }%
+	}%
+      }%
+    }%
+  }%
+}%
+
+
+
+\newcommand{\tableauprefix}[1]{%
+\begin{center}
+\begin{tabular}{|c|*{\DTLrowcount{PF}}{|c}||c|}\hline%
+  Partie & \DTLforeach*{PF}{\pf=pf}{\pf &} Total\\\hline
+  \DTLforeach*[\DTLisinlist{\partie}{#1}]{PARTIE}{\partie=partie}{%
+    \partie &
+    \DTLgadd{\gptotal}{0}{0}%
+    \DTLforeach*{PF}{\pf=pf}{%
+      \sumpfpartie{\partie}{\pf}%
+      \pftotal
+      \DTLgadd{\gptotal}{\pftotal}{\gptotal}%
+      \DTLgadd{\pftotal}{0}{0}%
+      &
+    }%
+    \gptotal\\
+    &
+    \DTLforeach*{PF}{\pf=pf}{%
+      \sumpfpartie{\partie}{\pf}%
+      \DTLdiv{\pctotal}{\pftotal}{\gptotal}%
+      \DTLmul{\pctotal}{100}{\pctotal}%
+      \DTLround{\pctotal}{\pctotal}{1}%
+      \pctotal \%%
+      \DTLgadd{\pftotal}{0}{0}%
+      &
+    }%
+    \\\hline
+  }%
+  Total &
+  \DTLgadd{\gptotal}{0}{0}%
+    \DTLforeach*{PF}{\pf=pf}{%
+      \sumpfpartie{#1}{\pf}%
+      \pftotal
+      \DTLgadd{\gptotal}{\pftotal}{\gptotal}%
+      \DTLgadd{\pftotal}{0}{0}%
+      &
+    }%
+    \gptotal\\
+    &%
+    \DTLforeach*{PF}{\pf=pf}{%
+      \sumpfpartie{#1}{\pf}%
+      \DTLdiv{\pctotal}{\pftotal}{\gptotal}%
+      \DTLmul{\pctotal}{100}{\pctotal}%
+      \DTLround{\pctotal}{\pctotal}{1}%
+      \pctotal \%%
+      \DTLgadd{\pftotal}{0}{0}%
+      &
+    }%
+    100\%\\\hline
+\end{tabular}
+\end{center}
+}%
+
+% preremplissage de la BdD CS
+\newcommand{\declarecompetence}[1]{%
+   \DTLnewrow{CS}%
+   \DTLnewdbentry{CS}{cs}{#1}%
+}
+
+% preremplissage de la BdD PF
+\newcommand{\declareprefix}[1]{%
+   \DTLnewrow{PF}%
+   \DTLnewdbentry{PF}{pf}{#1}%
+}
+
+%</package>
+% \fi
+
+% \iffalse meta-comment
+%
+% \RequirePackage{pgfkeys,pgffor}
+%
+% \newcounter{mainargs}
+% \pgfkeys{mainargs/.is family, mainargs,
+% step counter/.code=\stepcounter{mainargs},
+% add argument/.style={step counter, arg\themainargs/.initial={#1}},
+% }
+%
+% \newcommand{\listecompetences}[2][]{%
+%      \setcounter{mainargs}{0}%
+%      \pgfkeys{mainargs, add argument/.list={#2}}%
+%      %
+%      \foreach \n in {1,...,\themainargs}{%
+%      \DTLnewrow{CS}%
+%      \DTLnewdbentry{CS}{cs}{\pgfkeysvalueof{/mainargs/arg\n}}%
+% %    \pgfkeysvalueof{/mainargs/arg\n},
+%     }%
+%
+% }
+% \fi
+
+
+% \Finale
+\endinput


Property changes on: trunk/Master/texmf-dist/source/latex/competences/competences.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/competences/competences.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/competences/competences.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/competences/competences.ins	2018-05-02 20:48:54 UTC (rev 47573)
@@ -0,0 +1,56 @@
+%%
+%% Copyright (C) 2016 by Christophe Bares <christopheATbares.fr>
+%%
+%% 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 version.  The latest version of this
+%% license is in:
+%%
+%%    http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2005/12/01 or later.
+%%
+
+\UseRawInputEncoding
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/competences}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2016 by Christophe Bares <christopheATbares.fr>
+
+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 version.  The latest version of this
+license is in:
+
+   http://www.latex-project.org/lppl.txt
+
+and version 1.3 or later is part of all distributions of LaTeX version
+2005/12/01 or later.
+
+\endpreamble
+
+\generate{\file{competences.sty}{\from{competences.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{*                                                           *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX:                    *}
+\Msg{*                                                           *}
+\Msg{*     competences.sty                                       *}
+\Msg{*                                                           *}
+\Msg{* To produce the documentation run the file competences.dtx *}
+\Msg{* through LaTeX.                                            *}
+\Msg{*                                                           *}
+\Msg{* Happy TeXing!                                             *}
+\Msg{*                                                           *}
+\Msg{*************************************************************}
+
+\endbatchfile

Added: trunk/Master/texmf-dist/tex/latex/competences/competences.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/competences/competences.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/competences/competences.sty	2018-05-02 20:48:54 UTC (rev 47573)
@@ -0,0 +1,329 @@
+%%
+%% This is file `competences.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% competences.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright (C) 2016 by Christophe Bares <christopheATbares.fr>
+%% 
+%% 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 version.  The latest version of this
+%% license is in:
+%% 
+%%    http://www.latex-project.org/lppl.txt
+%% 
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2005/12/01 or later.
+%% 
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{competences}
+    [2016/10/27 v1.0]
+
+\newcommand{\dummyMacro}{}
+
+\newenvironment{dummyEnv}{%
+}{%
+}
+
+\RequirePackage[%
+color=blue!20,%
+]{todonotes}
+\reversemarginpar
+
+\RequirePackage{datatool}
+\RequirePackage{etoolbox}
+\RequirePackage{longtable}
+
+\def\total{0}
+\def\gtotal{0}
+
+\newcommand{\getCurrentSectionNumber}{%
+  \ifnum\c at enumi=0 %
+    \ifnum\c at section=0 %
+      \thechapter
+    \else
+      \ifnum\c at subsection=0 %
+        \thesection
+      \else
+        \ifnum\c at subsubsection=0 %
+          \thesubsection
+        \else
+          \thesubsubsection
+        \fi
+      \fi
+    \fi
+  \else
+    \ifnum\c at enumii=0 %
+       \theenumi
+     \else
+       \theenumii
+     \fi
+   \fi
+}
+
+\newcommand{\getCurrentpartiedocument}{%
+  \thesection
+}
+
+\DTLgnewdb{CS}
+\DTLgnewdb{QUEST}
+\DTLgnewdb{PARTIE}
+\DTLgnewdb{PF}
+\DTLaddcolumn{QUEST}{compsec}%
+\DTLaddcolumn{QUEST}{partie}%
+
+\newcommand{\ifcompexists}[3]{%
+  \DTLgetrowforkey{\competences at tmpcs}{CS}{cs}{#1}%
+  \ifdefempty{\competences at tmpcs}{#3}{#2}%
+}
+
+\newcommand{\ifquestexists}[3]{%
+  \DTLgetrowforkey{\competences at tmpq}{QUEST}{compsec}{#1}%
+  \ifdefempty{\competences at tmpq}{#3}{#2}%
+}
+
+\newcommand{\ifpartexists}[3]{%
+  \DTLgetrowforkey{\competences at tmpp}{PARTIE}{partie}{#1}%
+  \ifdefempty{\competences at tmpp}{#3}{#2}%
+}
+
+\newcommand{\addcompetence}[2][1]{%
+  \todo[noline]{#2}
+
+  \ifcompexists{#2}{%
+    }
+    {\DTLnewrow{CS}%
+    \DTLnewdbentry{CS}{cs}{#2}%
+    \DTLaddcolumn{QUEST}{#2}%
+    }
+  \def\quest{\getCurrentSectionNumber}
+  \def\partie{\getCurrentpartiedocument}
+
+  \ifpartexists{\partie}{}{
+    \DTLnewrow{PARTIE}%
+    \dtlexpandnewvalue
+    \DTLnewdbentry{PARTIE}{partie}{\partie}%
+    \dtlnoexpandnewvalue
+    }
+
+  \ifquestexists{\quest}{%
+    \DTLnewdbentry{QUEST}{#2}{#1}%
+  }{%
+    \DTLforeach*{CS}{\cs=cs}{
+      \DTLaddcolumn{QUEST}{\cs}%
+    }%
+
+    \DTLnewrow{QUEST}%
+    \dtlexpandnewvalue
+    \DTLnewdbentry{QUEST}{compsec}{\quest}%
+    \DTLnewdbentry{QUEST}{partie}{\partie}%
+    \dtlnoexpandnewvalue
+    \DTLnewdbentry{QUEST}{#2}{#1}%
+  }
+}
+
+\newcommand{\addGlobalCompetence}[2][1]{%
+  \ifcompexists{#2}{%
+  }{%
+    \DTLnewrow{CS}%
+    \DTLnewdbentry{CS}{cs}{#2}%
+    \DTLaddcolumn{QUEST}{#2}%
+  }
+
+  \def\quest{-}
+  \def\partie{Global}
+
+  \ifpartexists{\partie}{%
+  }{%
+    \DTLnewrow{PARTIE}%
+    \dtlexpandnewvalue
+    \DTLnewdbentry{PARTIE}{partie}{\partie}%
+    \dtlnoexpandnewvalue
+    }
+
+  \ifquestexists{\quest}{%
+    \DTLnewdbentry{QUEST}{#2}{#1}%
+  }{%
+    \DTLforeach*{CS}{\cs=cs}{
+      \DTLaddcolumn{QUEST}{\cs}%
+    }%
+
+    \DTLnewrow{QUEST}%
+    \dtlexpandnewvalue
+    \DTLnewdbentry{QUEST}{compsec}{\quest}%
+    \DTLnewdbentry{QUEST}{partie}{\partie}%
+    \dtlnoexpandnewvalue
+    \DTLnewdbentry{QUEST}{#2}{#1}%
+  }
+}
+
+\newcommand{\tableaucompetences}{%
+Ce sujet aborde \DTLrowcount{CS}\ compétences: \DTLforeach*{CS}{\compname=cs}{\compname\DTLiflastrow{.}{, }}
+  \bigskip
+
+  \begin{longtable}{l|c|*{\DTLrowcount{CS}}{|c}||c}
+  Question &Partie& \DTLforeach*{CS}{\cs=cs}{\cs &} points\\\hline
+  \DTLforeach*{QUEST}{\compsec=compsec,\partie=partie}{
+       \DTLforeachkeyinrow{\point}
+{\DTLifstringeq{\point}{NULL}{}{
+  \point%
+  \DTLifstringeq{\dtlkey}{compsec}{}{%
+    \DTLifstringeq{\dtlkey}{partie}{}{%
+      \DTLgadd{\total}{\point}{\total}%
+      }%
+    }%
+  } & %
+}
+   \total
+   \DTLgadd{\gtotal}{\total}{\gtotal}
+   \DTLgadd{\total}{0}{0}
+   \DTLiflastrow{\\\hline}{\\}%
+  }%
+  Total &-&\DTLforeach*{CS}{\cs=cs}{\DTLsumforkeys{QUEST}{\cs}{\total} \total&} \gtotal\\\hline
+  & & \DTLforeach*{CS}{\cs=cs}{\cs &}
+  \end{longtable}
+
+%% For debugging
+
+}
+\def\cstotal{0}%
+\newcommand{\sumcspartie}[2]{%
+    \DTLgadd{\cstotal}{0}{0}%
+    \DTLforeach*[\DTLiseq{\part}{#1}]{QUEST}{\comp=#2,\part=partie}{%
+      \DTLifnull{\comp}{}{\DTLgadd{\cstotal}{\cstotal}{\comp}}%
+    }%
+}
+
+\newcommand{\tableaupartie}[1]{%
+\def\ptotal{0}
+\def\pctotal{0}
+\def\gptotal{0}
+Bilan Partie #1
+  \begin{longtable}{l|c|*{\DTLrowcount{CS}}{|c}||c}%
+  Question &Partie& \DTLforeach*{CS}{\cs=cs}{\cs &} points\\\hline
+  \DTLforeach*[\DTLiseq{\partie}{#1}]{QUEST}{\compsec=compsec,\partie=partie}{%
+    \DTLforeachkeyinrow{\point}%
+      {\DTLifstringeq{\point}{NULL}{}{%
+\point%
+\DTLifstringeq{\dtlkey}{compsec}{}{%
+  \DTLifstringeq{\dtlkey}{partie}{}{%
+    \DTLgadd{\ptotal}{\point}{\ptotal}%
+     }%
+   }%
+}&%
+      }%
+    \ptotal%
+    \DTLgadd{\gptotal}{\ptotal}{\gptotal}%
+    \DTLgadd{\ptotal}{0}{0}%
+    \\\hline%
+  }%
+  Total &-&\DTLforeach*{CS}{\cs=cs}{%
+    \sumcspartie{#1}{\cs}%
+    \cstotal
+    &
+    }%
+    \gptotal\\\hline
+  Total \% &-&\DTLforeach*{CS}{\cs=cs}{%
+    \sumcspartie{#1}{\cs}
+    \DTLdiv{\pctotal}{\cstotal}{\gptotal}%
+    \DTLmul{\pctotal}{100}{\pctotal}%
+    \DTLround{\pctotal}{\pctotal}{1}%
+    \pctotal \%&%
+    }%
+    100.0\%\\\hline
+  & & \DTLforeach*{CS}{\cs=cs}{\cs &}
+  \end{longtable}
+
+%% For debugging
+}
+
+\def\pftotal{0}
+\newcommand{\sumpfpartie}[2]{%
+  \DTLgadd{\pftotal}{0}{0}%
+  \DTLforeach*[\DTLisinlist{\partiein}{#1}]{QUEST}{\compsec=compsec,\partiein=partie}{%
+    \DTLforeachkeyinrow{\point}{%
+      \DTLifstringeq{\point}{NULL}{}{%
+\DTLifstringeq{\dtlkey}{compsec}{}{%
+  \DTLifstringeq{\dtlkey}{partie}{}{%
+    \DTLifStartsWith{\dtlkey}{#2}{%
+\DTLgadd{\pftotal}{\pftotal}{\point}%
+    }{}%
+  }%
+}%
+      }%
+    }%
+  }%
+}%
+
+\newcommand{\tableauprefix}[1]{%
+\begin{center}
+\begin{tabular}{|c|*{\DTLrowcount{PF}}{|c}||c|}\hline%
+  Partie & \DTLforeach*{PF}{\pf=pf}{\pf &} Total\\\hline
+  \DTLforeach*[\DTLisinlist{\partie}{#1}]{PARTIE}{\partie=partie}{%
+    \partie &
+    \DTLgadd{\gptotal}{0}{0}%
+    \DTLforeach*{PF}{\pf=pf}{%
+      \sumpfpartie{\partie}{\pf}%
+      \pftotal
+      \DTLgadd{\gptotal}{\pftotal}{\gptotal}%
+      \DTLgadd{\pftotal}{0}{0}%
+      &
+    }%
+    \gptotal\\
+    &
+    \DTLforeach*{PF}{\pf=pf}{%
+      \sumpfpartie{\partie}{\pf}%
+      \DTLdiv{\pctotal}{\pftotal}{\gptotal}%
+      \DTLmul{\pctotal}{100}{\pctotal}%
+      \DTLround{\pctotal}{\pctotal}{1}%
+      \pctotal \%%
+      \DTLgadd{\pftotal}{0}{0}%
+      &
+    }%
+    \\\hline
+  }%
+  Total &
+  \DTLgadd{\gptotal}{0}{0}%
+    \DTLforeach*{PF}{\pf=pf}{%
+      \sumpfpartie{#1}{\pf}%
+      \pftotal
+      \DTLgadd{\gptotal}{\pftotal}{\gptotal}%
+      \DTLgadd{\pftotal}{0}{0}%
+      &
+    }%
+    \gptotal\\
+    &%
+    \DTLforeach*{PF}{\pf=pf}{%
+      \sumpfpartie{#1}{\pf}%
+      \DTLdiv{\pctotal}{\pftotal}{\gptotal}%
+      \DTLmul{\pctotal}{100}{\pctotal}%
+      \DTLround{\pctotal}{\pctotal}{1}%
+      \pctotal \%%
+      \DTLgadd{\pftotal}{0}{0}%
+      &
+    }%
+    100\%\\\hline
+\end{tabular}
+\end{center}
+}%
+
+\newcommand{\declarecompetence}[1]{%
+   \DTLnewrow{CS}%
+   \DTLnewdbentry{CS}{cs}{#1}%
+}
+
+\newcommand{\declareprefix}[1]{%
+   \DTLnewrow{PF}%
+   \DTLnewdbentry{PF}{pf}{#1}%
+}
+
+
+
+\endinput
+%%
+%% End of file `competences.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/competences/competences.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2018-05-02 20:47:43 UTC (rev 47572)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2018-05-02 20:48:54 UTC (rev 47573)
@@ -163,7 +163,7 @@
     colortbl colorwav colorweb colourchange
     combelow combine combinedgraphics combofont comfortaa comicneue
     comma commado commath comment
-    compactbib
+    compactbib competences
     complexity components-of-TeX comprehensive computational-complexity
     concepts concmath concmath-fonts concprog concrete confproc constants conteq
     context-account context-algorithmic context-animation context-annotation

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2018-05-02 20:47:43 UTC (rev 47572)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2018-05-02 20:48:54 UTC (rev 47573)
@@ -187,6 +187,7 @@
 depend comma
 depend commado
 depend comment
+depend competences
 depend concepts
 depend concprog
 depend constants

Added: trunk/Master/tlpkg/tlpsrc/competences.tlpsrc
===================================================================


More information about the tex-live-commits mailing list