I want to prepare a book with many chapters (and sections), notes, exercises and linked solutions at the end of the book . I decided to adopt the example from on matching enumerated exercises with their answer. However, I want to display points per question part as shown here . The
exam
package
\documentclass{memoir}
\usepackage{amsmath}
\usepackage[inline]{enumitem}
\usepackage{xcolor}
\usepackage{ntheorem}
\theorembodyfont{\upshape}
\theoremseparator{.}
\usepackage{answers}
\Newassociation{sol}{Solution}{ans}
\renewcommand{\Solutionlabel}[1]{\small{#1.}}
\newtheorem{ex}{}[section]
\renewcommand{\theex}{\arabic{ex}}
\newenvironment{Ex}[1]{\begin{trivlist}\item \textsc{#1} %
\renewcommand{\Currentlabel}{#1}}{\end{trivlist}}
\usepackage{multicol}
\newenvironment{mtmulticols}[1]{%
\Writetofile{ans}{\string\begin{multicols}{#1}}
\begin{multicols}{#1}}{\end{multicols}%
\Writetofile{ans}{\string\end{multicols}}}
\Newassociation{solitem}{Solutionsubitem}{ans}
\renewcommand{\Solutionsubitemlabel}[1]{#1}
\newenvironment{Solutionsublist}{\Writetofile{ans}{\string\begin{Solution} {\theex}}}{\Writetofile{ans}{\string\end{Solution}}}`
\begin{document}
\chapter{Polynomials}
\section{Partial fractions}
\label{sec:partial-fractions}
\tracingmacros=1
\Opensolutionfile{ans}[partial-fractions]
\section*{Exercises for Section \ref{sec:partial-fractions}}
\vspace{-0.6cm}
\hrulefill
\begin{Ex}{Warm-ups}
\end{Ex}
\begin{ex}
Who is the most famous mathematician of all time?
\begin{sol}
Euler
\end{sol}
\end{ex}
\begin{ex}
Resolve each of the following proper rational expressions (some filler here) into partial fractions.
\begin{multicols}{3}
\begin{Solutionsublist}
\begin{enumerate}[label=(\alph*)]
\item $\displaystyle{\frac{1}{(x - 1)(x - 2)}}$
\begin{solitem}
$\displaystyle{\frac{1}{x - 2} - \frac{1}{x - 1}}$
\end{solitem}
\item $\displaystyle{\frac{5x + 4}{x^2 + x - 2}}$
\begin{solitem}
$\displaystyle{\frac{2}{x + 2} + \frac{3}{x - 1}}$
\end{solitem}
\item $\displaystyle{\frac{7x - 1}{2x^2 - x - 1}}$
\begin{solitem}
$\displaystyle{\frac{3}{2x + 1} + \frac{2}{x - 1}}$
\end{solitem}
\item $\displaystyle{\frac{25}{18x^3 - 9x^2 - 11x + 2}}$
\begin{solitem}
$\displaystyle{\frac{3}{3x + 2} - \frac{12}{6x - 1} + \frac{1}{x -
1}}$
\end{solitem}
\item $\displaystyle{\frac{x^2 + 15x - 4}{(x + 1)(x + 2)(x - 8)}}$
\begin{solitem}
$\displaystyle{\frac{2}{x - 8} + \frac{2}{x + 1} - \frac{3}{x +
2}}$
\end{solitem}
\item $\displaystyle{\frac{48}{(x^2 - 1)(x^2 - 9)}}$
\begin{solitem}
$\displaystyle{\frac{3}{x - 1} + \frac{3}{x + 1} - \frac{1}{x + 3}
+ \frac{1}{x - 3}}$
\end{solitem}
\end{enumerate}
\end{Solutionsublist}
\end{multicols}
\end{ex}
\Closesolutionfile{ans}
\section*{Answers for Section \ref{sec:partial-fractions}}
\input{partial-fractions}
\end{document}