From 9f1e037ff5af611f3abf38646ef40f00e267fb90 Mon Sep 17 00:00:00 2001
From: Sebastian Kuhnert
Date: Tue, 16 Jun 2009 10:18:06 +0000
Subject: exercisesheets.sty: slight improvements to solutions=nonoral

---
 exercisesheets.sty | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

(limited to 'exercisesheets.sty')

diff --git a/exercisesheets.sty b/exercisesheets.sty
index cfa10b5..3d54984 100644
--- a/exercisesheets.sty
+++ b/exercisesheets.sty
@@ -534,25 +534,27 @@
 }
 \newenvironment{solution}[1][]{%
   \pgfkeys{exsh,every solution,#1,solution font}%
-  \ifbool{exsh@solutions}{%
-    \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
-      \ifbool{exsh@oralsolutions}{
-        \let\next\exsh@startsolution
-      }{%
-        \let\next\exsh@skipsolution
-      }%
+  \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
+    \ifbool{exsh@oralsolutions}{%
+      \let\next\exsh@startsolution
     }{%
-      \ifbool{exsh@nonoralsolutions}{
-        \let\next\exsh@startsolution
-      }{%
-        \let\next\exsh@skipsolution
-      }%
+      \let\next\exsh@skipsolution
     }%
   }{%
-    \let\next\next\exsh@skipsolution
+    \ifbool{exsh@nonoralsolutions}{%
+      \let\next\exsh@startsolution
+    }{%
+      \let\next\exsh@skipsolution
+    }%
   }%
   \next
-}{\ifbool{exsh@solutions}{\par}{}}
+}{%
+  \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
+    \ifbool{exsh@oralsolutions}{\par}{}%
+  }{%
+    \ifbool{exsh@nonoralsolutions}{\par}{}%
+  }%
+}
 
 \def\exsh@startsolution{\@afterindentfalse
   \vskip\pgfkeysvalueof{/exsh/above solution skip}\relax%
@@ -600,4 +602,10 @@
   \PackageWarning{exercisesheets}{TODO marker found}%
 }
 
-\newcommand{\ifsolutions}[2]{\ifexsh@solutions #1\else #2\fi}
+\newcommand{\ifsolutions}[2]{%
+  \ifthenelse{\equal{oral}{\pgfkeysvalueof{/exsh/points}}}{%
+    \ifbool{exsh@oralsolutions}{#1}{#2}%
+  }{%
+    \ifbool{exsh@nonoralsolutions}{#1}{#2}%
+  }%
+}
-- 
cgit v1.2.3

