%%%
% R\'eponses \`a relier
%%%
\setKVdefault[ClesRelie]{Solution=false,LargeurG=5cm,LargeurD=2cm,Stretch=1.5,Ecart=2cm,Couleur=black}

\newcommand\Relie[2][]{%
  \useKVdefault[ClesRelie]%
  \setKV[ClesRelie]{#1}%
  \setsepchar[*]{,*/}%
  \readlist*\ListeRelie{#2}%
  \buildtabrelie%
  \ifboolKV[ClesRelie]{Solution}{%
    \colorlet{PfCRelieCouleurTrace}{\useKV[ClesRelie]{Couleur}}%
    \xintFor* ##1 in {\xintSeq {1}{\ListeRelielen}}\do{%
      \itemtomacro\ListeRelie[##1,1]\untest
      \ifx\bla\untest\bla%
      \else
      \tikz[remember picture,overlay]{\draw[PfCRelieCouleurTrace] (RelieG-##1) -- (RelieD-\ListeRelie[##1,3]);}%
      \fi
    }%
  }{%
  }%
}

\newcounter{NbRelie}

\def\buildtabrelie{%
  \setcounter{NbRelie}{0}%
  \renewcommand{\arraystretch}{\useKV[ClesRelie]{Stretch}}%
  \begin{tabular}{p{\useKV[ClesRelie]{LargeurG}}cp{\useKV[ClesRelie]{Ecart}}>{\tikz[remember
    picture]{\node[name=RelieD-\theNbRelie,inner
    sep=0pt]{};\fill[] (RelieD-\theNbRelie) circle[radius=1.5pt]}}cp{\useKV[ClesRelie]{LargeurD}}}%
    \xintFor* ##1 in {\xintSeq {1}{\ListeRelielen}}\do{\ListeRelie[##1,1]\itemtomacro\ListeRelie[##1,1]\untest%
\ifx\bla\untest\bla%                                       
    \uppercase{&}\stepcounter{NbRelie}%
      \else
      \uppercase{&}\stepcounter{NbRelie}\tikz[remember
                   picture,overlay]{\node[name=RelieG-\theNbRelie,inner
                   sep=0pt]{};\fill[]
                   (RelieG-\theNbRelie) circle[radius=1.5pt];}
\fi&&&\ListeRelie[##1,2]\\}%
  \end{tabular}%
  \setcounter{NbRelie}{0}%
}%

\def\buildtabrelieold{%
  \setcounter{NbRelie}{0}%
  \renewcommand{\arraystretch}{\useKV[ClesRelie]{Stretch}}%
  \begin{tabular}{p{\useKV[ClesRelie]{LargeurG}}cp{\useKV[ClesRelie]{Ecart}}>{\tikz[remember
    picture,baseline]{\node[name=RelieD-\theNbRelie]{\Large\textbullet};}}cp{\useKV[ClesRelie]{LargeurD}}}%
    \xintFor* ##1 in {\xintSeq {1}{\ListeRelielen}}\do{\ListeRelie[##1,1]\itemtomacro\ListeRelie[##1,1]\untest%
\ifx\bla\untest\bla%                                       
    \uppercase{&}\stepcounter{NbRelie}%
      \else
      \uppercase{&}\stepcounter{NbRelie}\tikz[remember picture,baseline]{\node[name=RelieG-\theNbRelie]{\Large\textbullet};}
\fi&&&\ListeRelie[##1,2]\\}%
  \end{tabular}%
  \setcounter{NbRelie}{0}%
}%