这是我的第一篇帖子,在此先谢谢大家的建议。我用 Latex 打字完成我所有的数学试卷(测验、测试、考试等),但我遇到了这个问题,找不到任何合适的解决方案。
这是一个最小的工作示例。我希望一开始就有一个评分表。但是,我不知道如何在文档开头显示计数器的最终值。我按照一些建议使用 totcount 包,但没有成功。
非常感谢,维罗妮卡
\documentclass[letterpaper,11pt]{exam}
\usepackage{calc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{pointKnowledge}
\newcounter{pointApplication}
\newcounter{pointThinking}
\newcounter{pointCommunication}
\def\K#1{{\sf \hfill [K/U /#1]}\addtocounter{pointKnowledge}{#1}}
\def\A#1{{\sf \hfill [A /#1]}\addtocounter{pointApplication}{#1}}
\def\T#1{{\sf \hfill [T /#1]}\addtocounter{pointThinking}{#1}}
\def\C#1{{\sf \hfill [C /#1]}\addtocounter{pointCommunication}{#1}}
\def\resetPoints{\setcounter{pointKnowledge}{0}}
\def\resetPoints{\setcounter{pointApplication}{0}}
\def\resetPoints{\setcounter{pointThinking}{0}}
\def\resetPoints{\setcounter{pointCommunication}{0}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
I WOULD LIKE THE GRADING TABLE HERE RATHER THEN AT THE END.\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BEGINNING GRADING TABLE\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vspace{0.2cm}
\begin{tabular}{ |r |r |r |r| r |} \hline
Knowledge/Understanding & Application & Communication & Thinking & \hspace{0.5cm} Total \hspace{0.5cm} \\ \hline
/ & /& / & / & / \\ [0.25cm] \hline
\end{tabular}
\begin{questions}
\question Question 1 knowledge \K{1}
\question Question 2 knowledge \K{5}
\question Question 3 application \A{2}
\question Question 4 application \A{5}
\question Question 5 thinking \T{7}
\question Question 6 thinking \T{2}
\question Question 6 communication \C{2}
\question Question 6 communication \C{3}
\end{questions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
END GRADING TABLE\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{FinalMark}
\setcounter{FinalMark}{\value{pointKnowledge}+\value{pointApplication}+\value{pointThinking}+\value{pointCommunication}}
\begin{tabular}{ |r |r |r |r| r |} \hline
Knowledge/Understanding & Application & Communication & Thinking & \hspace{0.5cm} Total \hspace{0.5cm} \\ \hline
/\the\value{pointKnowledge} & /\the\value{pointApplication}& /\the\value{pointCommunication} & /\the\value{pointThinking} & /\the\value{FinalMark} \\ [0.25cm] \hline
\end{tabular}
\end{document}
答案1
感谢大家的建议!谢谢 Harald,我采用了建议的想法,而且很有效。我费了好大劲才把所有的事情都做完,但现在问题已经解决了。这是我自己问题的完整解决方案:
维罗妮卡
\documentclass[answers,12pt,addpoints]{exam}
\usepackage{calc}
\newcounter{Know}
\def\K#1{{\sf \hfill [K/U /#1]}\addtocounter{Know}{#1}}
\def\resetPoints{\setcounter{Know}{0}}
\newcounter{Appl}
\def\A#1{{\sf \hfill [A /#1]}\addtocounter{Appl}{#1}}
\def\resetPoints{\setcounter{Appl}{0}}
\newcounter{Comm}
\def\C#1{{\sf \hfill [C /#1]}\addtocounter{Comm}{#1}}
\def\resetPoints{\setcounter{Comm}{0}}
\newcounter{Think}
\def\T#1{{\sf \hfill [T /#1]}\addtocounter{Think}{#1}}
\def\resetPoints{\setcounter{Think}{0}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\noindent
\ref{Know} Knowledge points\\
\ref{Appl} Application points\\
\ref{Comm} Communication points\\
\ref{Think} Thinking points\\
\ref{Total}\textbf{ Total marks}\\
\begin{questions}
\question question \K{1}
\question question \K{2}
\question question \A{4}
\question question \A{10}
\question question \C{5}
\question question \C{6}
\question question \T{7}
\question question \T{10}
\end{questions}
\addtocounter{Know}{-1}\refstepcounter{Know}
\label{Know}
\addtocounter{Appl}{-1}\refstepcounter{Appl}
\label{Appl}
\addtocounter{Comm}{-1}\refstepcounter{Comm}
\label{Comm}
\addtocounter{Think}{-1}\refstepcounter{Think}
\label{Think}
\newcounter{Total}
\setcounter{Total}{\value{Know}+\value{Appl}+\value{Think}++\value{Comm}}
\addtocounter{Total}{-1}\refstepcounter{Total}
\label{Total}
\end{document}
答案2
也可以在评分开始时使用计数器的参考。如 2013 年 4 月的“Die TeXnische Komödie”中所述。
\textbf{Übungsaufgaben zu Brüchen}
\emph{Gesamtpunktzahl: \ref{points} Punkte}
\newcounter{exnumber}\setcounter{exnumber}{0}
\newcounter{points} \setcounter{points}{0}
\newcommand\exercise[1]{\vspace{2ex}%
\addtocounter{points}{#1}%
\stepcounter{exnumber}%
\textbf{Aufgabe \arabic{exnumber}} (#1 \ifthenelse{#1 > 1}{Punkte}{ ↪Punkt}):}
\exercise{2} Wandeln Sie in einen Bruch um: $0.\overline{545\,26}$
\exercise{1} Weshalb ist $\frac{12}{77}$ nicht als abbrechende Dezimalzahl ↪darstellbar?
\addtocounter{points}{-1}\refstepcounter{points}
\label{points}