[Tex/LaTex] How to have upside down text in body

blockfontsrotating

I have environments Question (described in To clearly separate block inside a chapter) and Answer blocks.
I want the Answer block be the same as as Question block but the text upside down in it.

Minimal example

\documentclass{article}
\usepackage{rotating}

\usepackage[framemethod=tikz]{mdframed}
\newtheorem{question}{Question}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{question}

\newtheorem{answer}{Answer}
\mdfdefinestyle{ans}{
  linecolor=cyan,
  backgroundcolor=yellow!20
  % , rotatebox
}
\surroundwithmdframed[style=ans]{answer}


\begin{document}
\begin{question}
\textbf{E.coli.}
Escherichia coli ...
\end{question}
\begin{answer}
Lorem
\end{answer}
\end{document}

I get

enter image description here

How can you have upside down text in the Answer environment?
I want that the text is difficult to read so the readers try to answer the question themselves before looking for the answer.
Any other way to include answers is also accepted, since I am not sure which is the best way to do it.
I however want personally that those answer are visible in the draw code just after the question.

Best Answer

See the last edit for automatic toggling

You can define a new environment Answer based on your answer environment:

\usepackage{environ}
\NewEnviron{Answer}
{%
\noindent
\rotatebox[origin=c]{180}{%
\noindent
\begin{minipage}[t]{\linewidth}
\begin{answer}
\BODY
\end{answer}%
\end{minipage}%
}%
}%

Full code:

\documentclass{article}
\usepackage{rotating}

\usepackage[framemethod=tikz]{mdframed}
\newtheorem{question}{Question}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{question}

\newtheorem{answer}{Answer}
\mdfdefinestyle{ans}{
  linecolor=cyan,
  backgroundcolor=yellow!20
  % , rotatebox
}
\surroundwithmdframed[style=ans]{answer}

\usepackage{environ}
\NewEnviron{Answer}
{%
\noindent
\rotatebox[origin=c]{180}{%
\noindent
\begin{minipage}[t]{\linewidth}
\begin{answer}
\BODY
\end{answer}%
\end{minipage}%
}%
}%


\begin{document}
\begin{question}
\textbf{E.coli.}
Escherichia coli ...
\end{question}
\begin{Answer}
Lorem ipsum is not an answer to this question but this text will provide some dummy answer for two lines all together.
\end{Answer}
\end{document}

enter image description here

Making it to difficult to read?. Here we go:

\documentclass{article}
\usepackage{rotating}

\usepackage[framemethod=tikz]{mdframed}
\newtheorem{question}{Question}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{question}

\newtheorem{answer}{Answer}
\mdfdefinestyle{ans}{
  linecolor=cyan,
  backgroundcolor=yellow!20
  % , rotatebox
}
\surroundwithmdframed[style=ans]{answer}

\usepackage{environ}
\NewEnviron{Answer}
{%
\noindent
\reflectbox{\rotatebox[origin=c]{180}{%
\noindent
\begin{minipage}[t]{\linewidth}
\begin{answer}
\BODY
\end{answer}%
\end{minipage}%
}%
}}%


\begin{document}
\begin{question}
\textbf{E.coli.}
Escherichia coli ...
\end{question}
\begin{Answer}
Lorem ipsum is not an answer to this question but this text will provide some dummy answer for two lines all together.
\end{Answer}
\end{document}

enter image description here

With

\NewEnviron{Answer}
{%
\noindent
\scalebox{1}[-1]{\rotatebox[origin=c]{180}{%
\noindent
\begin{minipage}[t]{\linewidth}
\begin{answer}
\BODY
\end{answer}%
\end{minipage}%
}%
}}%

one gets

enter image description here

but beware of those who bring mirrors ;)

In fact, with \scalebox alone, the former orientations can be achieved without using \rotatebox.

Last edit:

If you want to automatically show/hide answers here is a way. See the commented code lines

%\setboolean{answers}{true}  %%% uncomment to show answers properly
\setboolean{answers}{false}  %%% comment to show answers properly

Full code:

\documentclass{article}
\usepackage{rotating}

\usepackage[framemethod=tikz]{mdframed}
\newtheorem{question}{Question}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{question}

\newtheorem{answer}{Answer}
\mdfdefinestyle{ans}{
  linecolor=cyan,
  backgroundcolor=yellow!20
  % , rotatebox
}
\surroundwithmdframed[style=ans]{answer}

\usepackage{environ}
\usepackage{ifthen}
\newboolean{answers}
%\setboolean{answers}{true}  %%% uncomment to show answers properly
\setboolean{answers}{false}  %%% comment to show answers properly


\ifthenelse{\boolean{answers}}%
  {%
  \NewEnviron{Answer}
    {%
    \noindent
    \begin{minipage}[t]{\linewidth}
        \begin{answer}
            \BODY
        \end{answer}%
    \end{minipage}%  here put what the command has to do when outside
        }%
}%
    {\NewEnviron{Answer}
    {%
    \noindent
    \scalebox{1}[-1]{%
    \noindent
    \begin{minipage}[t]{\linewidth}
        \begin{answer}
            \BODY
        \end{answer}%
    \end{minipage}%
       }%
    }%
}%


\begin{document}
\begin{question}
\textbf{E.coli.}
Escherichia coli ...
\end{question}
\begin{Answer}
Lorem ipsum is not an answer to this question but this text will provide some dummy answer for two lines all together.
\end{Answer}
\end{document}

With

\setboolean{answers}{false}

we get:

enter image description here

With

\setboolean{answers}{true}

we get:

enter image description here

With optional argument

\documentclass{article}
\usepackage{rotating}

\usepackage[framemethod=tikz]{mdframed}
\newtheorem{question}{Question}
\mdfdefinestyle{que}{
  linecolor=cyan,
  backgroundcolor=cyan!20,
}
\surroundwithmdframed[style=que]{question}

\newtheorem{answer}{Answer}
\mdfdefinestyle{ans}{
  linecolor=cyan,
  backgroundcolor=yellow!20
  % , rotatebox
}
\surroundwithmdframed[style=ans]{answer}

\usepackage{environ}

\def\invert{-1}
 \NewEnviron{Answer}[1][1]%
    {%
    \noindent
    \scalebox{1}[#1]{%
    \noindent
    \begin{minipage}[t]{\linewidth}%
        \begin{answer}
            \BODY
        \end{answer}%
    \end{minipage}%
       }%
    }%

\begin{document}
\begin{question}
\textbf{E.coli.}
Escherichia coli ...
\end{question}
\begin{Answer}
Lorem ipsum is not an answer to this question but this text will provide some dummy answer for two lines all together.
\end{Answer}

\begin{question}
\textbf{E.coli.}
Escherichia coli ...
\end{question}
\begin{Answer}[\invert] 
Lorem ipsum is not an answer to this question but this text will provide some dummy answer for two lines all together.
\end{Answer}
\end{document}