I've been using the site since starting to learn LaTeX a few months ago, and find it to be very helpful thanks to you all.
My Issue is that some professors at my university do not like the assignments to be typed as it seems that some students copy and paste the answers from the internet, and we are told to solve the problems by hand. Now, I still want to keep the problem statements in latex, then print them and complete them by hand, I've been doing so, ever since, but find that without the grid is just too messy.
I would like the file to look like that in the picture, but I achieved that exporting my document as a PDF and using some "design software" to draw the grid, and it is too time consuming to do so on every page of the assignment (usually 8 pages long).
I'll leave you an example of the source code:
\documentclass[a4paper, 11pt]{article}
\usepackage{comment} % enables the use of multi-line comments (\ifx \fi)
\usepackage{fullpage} % changes the margin
\usepackage[a4paper, total={7in, 10in}]{geometry}
\usepackage[fleqn]{amsmath}
\usepackage{amssymb,amsthm} % assumes amsmath package installed
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{verbatim}
\usepackage{float}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{arrows,calc,positioning}
\tikzset{
block/.style = {draw, rectangle,
minimum height=1cm,
minimum width=1.5cm},
input/.style = {coordinate,node distance=1cm},
output/.style = {coordinate,node distance=4cm},
arrow/.style={draw, -latex,node distance=2cm},
pinstyle/.style = {pin edge={latex-, black,node distance=2cm}},
sum/.style = {draw, circle, node distance=1cm},
}
\usepackage{xcolor}
\usepackage{mdframed}
\usepackage[shortlabels]{enumitem}
\usepackage{indentfirst}
\usepackage{hyperref}
\renewcommand{\thesubsection}{\thesection.\alph{subsection}}
\newenvironment{problem}[2][Problem]
{ \begin{mdframed} \textbf{#1 #2} \}
{ \end{mdframed}}
% Define solution environment
\newenvironment{solution}
{\textbf{\textit{Ans.\ \ \}}}
{}
\renewcommand{\qed}{\quad\qedsymbol}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%Header-Make sure you update this information!!!!
\noindent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\large\textbf{Homework - #4} \hfill \textbf{Leonardo Sánchez} \
Calculus 1 \hfill Civil & Electromechanical Engineering \
Professor Fang Jung Shiou \hfill Due date: $30^{th}$ March, 2020\
Teacher Assistant: Paulo C. C. Galeano \
\noindent\rule{7in}{2.8pt}
%Problem 1%
\begin{problem}{1 - (Section 11.3 Exs. 17 & 21 - Page 726 - Stewart $8^{th}$ ed.)}
Determine whether the series is convergent or divergent.\
a) $$\sum_{n=1}^\infty \cfrac{1}{n^2 + 4}.$$
b) $$\sum_{n=2}^{\infty}\cfrac{1}{n \ln n}.$$
\end{problem}
\begin{solution}
\pagebreak
\end{solution}
\end{document}
I read that environments do not work that way and it's not possible to nest some things inside them, so if my question is bad formulated, can someone point to me what would be the right way to achieve what I'm asking?
Thanks in advance!

'mcode.sty' not found. Moreover, many people will not have the font SimSun, maybe you can do without it? – gernot Sep 15 '20 at 18:19