在这个文档类“考试”中,一个问题有 6.5 分,另一个问题有 4.5 分。
为什么分数 6.5 和 4.5 没有出现在表格中?而且分数总和也是错误的。我希望分数出现在表格中。此外,还有 5.5.5 这个数字我没有写。我该如何修改我的脚本?
\documentclass[addpoints]{exam}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,top=1.5cm,bottom=1.5cm,left=1.5cm,right=1.5cm]{geometry}
\usepackage{enumerate}
\makeatletter
\newcommand*{\ExamResetAfterFirstRun}{%
\renewcommand*{\PgInfo@write}[1]{}%
\renewcommand*{\label}[1]{\@bsphack\@esphack}%
}
\makeatother
\pointpoints{Punto}{Punti}
\bonuspointpoints{punto (bonus)}{punti (bonus)}
\newcommand{\makenonemptybox}[2]{%
\par\nobreak\vspace{\ht\strutbox}\noindent
\fbox{%
\parbox[c][\dimexpr#1-2\fboxsep][t]{\dimexpr\linewidth-2\fboxsep}{
\hrule width \hsize height 0pt
#2
}%
}%
\par\vspace{\ht\strutbox}
}
\begin{document}
\large
\newcounter{copynum} % copy number, to be printed in the footer
\newcounter{NumCopy} % how many copies do we want?
\setcounter{NumCopy}{1} % we want 3
\whiledo{\thecopynum<\theNumCopy}{%
\setcounter{page}{1} % start numbering pages for the current copy at 1
\addtocounter{copynum}{1} % the number of the current copy
\setcounter{question}{1} % make questions start at 1 again
\setcounter{part}{1} % make parts start at 1 again
\setcounter{numquestions}{0}
\setcounter{numpoints}{0}
\setcounter{numbonuspoints}{0}
\setcounter{numparts}{0}
\setcounter{numsubparts}{0}
\setcounter{numsubsubparts}{0}
\ifnum\value{copynum}>1 %
\ExamResetAfterFirstRun
\fi
\begin{center}
Institute bla bla bla
\begin{minipage}{.40\textwidth}
\centering
{\textbf{TEST}}
\end{minipage}
\end{center}
\vspace{0.2in}
\noindent {\makebox[\textwidth]{Name:\enspace\hrulefill} }
\begin{questions}
\question[10] Question 1 bla bla bla
\question[6.5] Question 2 bla bla bla
\question[4.5] Question 3 bla bla bla
\end{questions}
{
{
\begin{center}
\hqword{EX}
\hpword{Pt}
\bhpword{Bonus Pt:}
\htword{\textbf{Tot}}
\hsword{tot 2}
\cellwidth{1.0em}
\gradetable[h][questions]
\end{center}
\begin{center}
{\footnotesize bla bla bla}
\end{center}}
}
}
\end{document}
答案1
将 .5 更改为\half
\documentclass[addpoints]{exam}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,top=1.5cm,bottom=1.5cm,left=1.5cm,right=1.5cm]{geometry}
\usepackage{enumerate}
\makeatletter
\newcommand*{\ExamResetAfterFirstRun}{%
\renewcommand*{\PgInfo@write}[1]{}%
\renewcommand*{\label}[1]{\@bsphack\@esphack}%
}
\makeatother
\pointpoints{Punto}{Punti}
\bonuspointpoints{punto (bonus)}{punti (bonus)}
\newcommand{\makenonemptybox}[2]{%
\par\nobreak\vspace{\ht\strutbox}\noindent
\fbox{%
\parbox[c][\dimexpr#1-2\fboxsep][t]{\dimexpr\linewidth-2\fboxsep}{
\hrule width \hsize height 0pt
#2
}%
}%
\par\vspace{\ht\strutbox}
}
\begin{document}
\large
\newcounter{copynum} % copy number, to be printed in the footer
\newcounter{NumCopy} % how many copies do we want?
\setcounter{NumCopy}{1} % we want 3
\whiledo{\thecopynum<\theNumCopy}{%
\setcounter{page}{1} % start numbering pages for the current copy at 1
\addtocounter{copynum}{1} % the number of the current copy
\setcounter{question}{1} % make questions start at 1 again
\setcounter{part}{1} % make parts start at 1 again
\setcounter{numquestions}{0}
\setcounter{numpoints}{0}
\setcounter{numbonuspoints}{0}
\setcounter{numparts}{0}
\setcounter{numsubparts}{0}
\setcounter{numsubsubparts}{0}
\ifnum\value{copynum}>1 %
\ExamResetAfterFirstRun
\fi
\begin{center}
Institute bla bla bla
\begin{minipage}{.40\textwidth}
\centering
{\textbf{TEST}}
\end{minipage}
\end{center}
\vspace{0.2in}
\noindent {\makebox[\textwidth]{Name:\enspace\hrulefill} }
\begin{questions}
\question[10] Question 1 bla bla bla
\question[6\half] Question 2 bla bla bla
\question[4\half] Question 3 bla bla bla
\end{questions}
{
{
\begin{center}
\hqword{EX}
\hpword{Pt}
\bhpword{Bonus Pt:}
\htword{\textbf{Tot}}
\hsword{tot 2}
\cellwidth{1.0em}
\gradetable[h][questions]
\end{center}
\begin{center}
{\footnotesize bla bla bla}
\end{center}}
}
}
\end{document}