From a6af62d33ddd13c8acfccd4b49e6f582ce8ce937 Mon Sep 17 00:00:00 2001
From: Frank Fuhlbrück
Date: Fri, 27 Nov 2020 11:08:43 +0100
Subject: exsh: bessere Teilaufgabenerkennung

---
 exercisesheets-beamer.sty | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

(limited to 'exercisesheets-beamer.sty')

diff --git a/exercisesheets-beamer.sty b/exercisesheets-beamer.sty
index 517a4d0..f86d4db 100644
--- a/exercisesheets-beamer.sty
+++ b/exercisesheets-beamer.sty
@@ -51,6 +51,7 @@
 \newif\ifexsh@forcesample %force printing sample sol. of wrong type
 \newif\ifexsh@beamersolution
 \newif\ifexsh@defersolutiontitle
+\newif\ifexsh@framed
 \newif\ifexsh@gradingguides
 \newif\ifexsh@inplace
 \newif\ifexsh@sample
@@ -75,6 +76,8 @@
   beamersolution/.default=true,
   defersolutiontitle/.is if=exsh@defersolutiontitle,
   defersolutiontitle/.default=true,
+  framed/.is if=exsh@framed,
+  framed/.default=true,
   gradingguides/.is if=exsh@gradingguides,
   gradingguides/.default=true,
   only/.initial={-},
@@ -147,6 +150,7 @@
   forcesample/.initial={false},
   beamersolution/.initial={false},
   defersolutiontitle/.initial={false},
+  framed/.initial={false},
   firstline/.initial={},
   points/.initial={},
   oral/.style={/exsh/points=oral},oral/.value forbidden,
@@ -729,9 +733,6 @@
   \endgroup
   \setbeamertemplate{enumerate items}{\insertenumlabel}
   \renewcommand{\insertenumlabel}{\alph{enumi})}
-%   \let\orig@endenumerate\endenumerate%
-%   \def{\endenumerate}{\orig@endenumerate\setcounter{enumi}{0}}%
-  \apptocmd{\endenumerate}{\setcounter{enumi}{0}}{}{}%
 }%
 
 \AfterPackage*{varioref}{
@@ -792,7 +793,7 @@
   }{}%
   \next
 }{%
-%   \ifnum\value{enumi}=0
+  \ifbool{exsh@framed}{\end{frame}}{}
   \ifbool{exsh@beamersolution}{}{%
     \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
       \ifbool{exsh@oralsolutions}{\clearpage}{}%
@@ -808,7 +809,7 @@
     \pgfkeysvalueof{/exsh/solution title font}%
     \pgfkeysvalueof{/exsh/strings/solution} %
     (\pgfkeysvalueof{/exsh/strings/exercise} \arabic{section}%
-    \alph{enumi})%
+      \ifnum\@enumdepth>0\alph{enumi}\fi)%
   \end{beamercolorbox}}
 \newcommand{\solutiontitle}[1][\linewidth]{
   \ifbool{exsh@defersolutiontitle}{%
@@ -817,10 +818,9 @@
 }
 
 \def\exsh@startsolution{%
-  \ifnum\value{enumi}=0%
-  \clearpage
+  \ifnum\@enumdepth=0
+    \clearpage
   \fi
-  \begingroup
 %   \usebeamercolor{block title alerted}
 %   \setbeamercolor{block body}{bg=bg,fg=fg}
 %   \block{}
@@ -829,11 +829,14 @@
 %     (\pgfkeysvalueof{/exsh/strings/exercise} \arabic{section}%
 %     \alph{enumi})%
 %   \endblock
+  \ifbool{exsh@framed}{\exsh@defersolutiontitletrue}{}
   \ifbool{exsh@defersolutiontitle}{}{%
     \ifhmode \linebreak\fi\exsh@solutiontitle{\linewidth}
   }%
-  \endgroup
-  \@afterheading
+  \ifbool{exsh@framed}{\clearpage
+  \begin{frame}[t,fragile,environment=solution]
+  \solutiontitle
+  }{}%
 }%
 
 \long\def\exsh@skipsolution#1{%
@@ -872,6 +875,7 @@
   }{}%
   \next
 }{%
+  \ifbool{exsh@framed}{\end{frame}}{}
   \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
     \ifbool{exsh@oralsolutions}{\clearpage}{}%
   }{%
-- 
cgit v1.2.3

