Reworked scoring

This commit is contained in:
2023-12-06 13:57:19 -08:00
parent f33be5fab2
commit a48e6f5d15
4 changed files with 207 additions and 162 deletions

View File

@ -13,34 +13,19 @@
\usepackage{afterpage}
\usepackage[hang]{footmisc}
% A row of stars, for showing difficulty
% first arg: filled stars
% second arg: total stars
\def\liststars#1#2{%
\def\oncolor{\color{ogrape}}%
\def\offcolor{\color{white}}%
%
\count255=1%
\count254=#2%
\advance\count254 by -1%
\ifnum #1 > 0
% The $$ are required around \bigstar.
% the special \odot chess piece breaks
% star sizing if they are ommited.
\loop
{\oncolor $\bigstar$}%
\ifnum\count255 < #1
\advance\count255 by 1
\repeat%
\else%
{\oncolor $\bigstar$}%
\fi%
%
\ifnum \count255 < #2%
\loop
{\offcolor $\bigstar$}%
\ifnum\count255 < \count254
\advance\count255 by 1
% Modify default tab positions for better stars
\TabPositions{1.2cm, 2cm, 3cm, 4cm, 5cm, 6cm, 7cm, 8cm}
\def\nstars#1#2{%
\ifnum #2 > 0%
\def\starcolor{\color{#1}}%
\count255=1%
\loop{%
\starcolor $\bigstar$%
}%
\ifnum \count255 < #2%
\advance\count255 by 1%
\repeat%
\fi%
}
@ -102,16 +87,41 @@ $\odot$}}
\fi
}
\@makeORMCbox{hintlist}
{Available Hints}
\@makeORMCbox{@hintlist}
{Score Decomposition:}
{black!12!white}
{black!80!white}
\newenvironment{hintlist}{
\begin{@hintlist}
}{
% Remove vspace from the last \hintcontent
\if@solutions\vspace{-2mm}\fi
\end{@hintlist}
}
\def\threestars#1#2#3{
\nstars{white}{#1}\nstars{ogrape}{#2}\nstars{white}{#3}
}
\def\onestars#1{
\nstars{ogrape}{#1}
}
\long\def\hintcontentnew#1{
\if@solutions
#1 \par
\vspace{2mm}
\fi
}
\long\def\hintcontent#1#2#3{
\if@solutions
\liststars{#1}{#2} \par #3
\nstars{white}{#1}\nstars{ogrape}{#2} \par #3
\vspace{2mm}
\else
\liststars{#1}{#2}
\nstars{white}{#1}\nstars{ogrape}{#2}
\fi\par
}
\makeatother