Here is a suggestion based on the ocgx package. The answer is shown by clicking a switch.
\documentclass{article}
\usepackage{ocgx,lipsum,boxedminipage}
\newcounter{question}
\newenvironment{question}%
{\medskip\par\stepcounter{question}%
\begin{boxedminipage}{\textwidth}%
\textbf{Question \arabic{question}}}
%
{\end{boxedminipage}}
\newenvironment{answer}%
{\medskip\par\begin{ocg}{Answer \arabic{question}}{answer\arabic{question}}{0}}
%
{\end{ocg}\medskip\par\switchocg{answer\arabic{question}}{\fbox{Show Answer}}\medskip\par}
\begin{document}
\begin{question}
The ultimate question.
\begin{answer}
42
\end{answer}
\end{question}
\begin{question}
The penultimate question.
\begin{answer}
21
\end{answer}
\end{question}
\begin{question}
Write some pseudo-Latin.
\begin{answer}
\lipsum[1-4]
\end{answer}
\end{question}
\end{document}
The visibility switch only works if the whole answer is on the same page. To ensure this, I have wrapped the answer inside a minipage. I also stuffed the question inside the same minipage, although that is not required; whether or not it is practical for you will depend on your content. Obviously, there is some room for improvement with respect to the layout ;)
The ocgx documentation warns that the package is not fully tested in all PDF viewers. On my Linux box, it works in Acrobat Reader but not Okular.
xcolorpackage and then use\textcolor{white}{invisible}. Please add a minimal working example (MWE) starting with\documentclass{...}and ending with\end{document}if you found some problem with this. – Fran Mar 10 '17 at 18:39