I am not longer able to use a self defined environment which depends on \printanswers before the first question since the exam class was updated to version 2.6. (I use this solution.)
With the exam class 2.5 I was able to do
\documentclass{exam}
\usepackage{framed}
\newenvironment{note}{%
\ifprintanswers
\begin{framed}\noindent\textbf{Note:}\par\noindent
\else
\setbox0\vbox\bgroup
\fi
}{%
\ifprintanswers
\end{framed}%
\else
\egroup
\fi%
}
\printanswers
%\noprintanswers
\begin{document}
\begin{questions}
\begin{note}
this is a note
\end{note}
\question
question
\begin{solution}
this is the solution
\end{solution}
\begin{note}
this is another note
\end{note}
\end{questions}
\end{document}
But with the exam class 2.6 I always get this error:
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.25 \end{note}