\documentclass[a4paper]{article}
\usepackage{verbatim}
\usepackage{probsoln}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{epstopdf}
\usepackage{enumerate}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{alltt}
\usepackage{listings}
\usepackage{color}
\newcommand{\proglang}[1]{\texttt{#1}}
\showanswers
\newboolean{eachProblemInOnePage}
\setboolean{eachProblemInOnePage}{false}
\newboolean{identifyAuthor}
\setboolean{identifyAuthor}{true}
\begin{document}
\newproblem{identifier}{      % An identifier for the problem. Change it also at \useproblem
  % Problem identification
	\begin{large}
 	\hspace{\fill}\newline
    \textbf{My mega amazing problem!}       % A title for the problem
	\end{large}
	\\
    \ifthenelse{\boolean{identifyAuthor}}{\textit{Author Name} \\}{}
  % Problem statement
  Find the solution of the ODE
	$$y'= 3$$
  that fulfills $y(0) = 1$.
  % End the problem statement with a blank line
  
}{
    % Solution
    Generic solution is:
    $$
    y = 3x + C.
    $$
    Solution to the initial value problem is:
    $$ 
    y = 3x + 1.
    $$
    You can also solve the problem with \proglang{MatLab}:
    \lstinputlisting{script.m}
    This is shown on the next figure:
    \begin{figure}[ht!]
        \centering
        \includegraphics[width=0.7\textwidth]{graphic.pdf}
    \end{figure}
}
\useproblem{identifier} % same identifier used at the definition of newproblem
\ifthenelse{\boolean{eachProblemInOnePage}}{\newpage}{}
\end{document}