在考試類別中新增星號

在考試類別中新增星號

我正在利用exam課堂為學生寫一些練習。我想要一些問題作為課後練習,並通過在問題編號後面添加星號來表示,例如(a)*.我嘗試過\part[*],但這會給(* point)。請問我能做什麼?謝謝你!我的程式碼如下。

\documentclass[english]{exam}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{bigints}
\usepackage{amssymb}
\usepackage{amsthm}

\begin{document}

\begin{questions}

\question

\begin{parts}

\part $*$ bla bla

\end{parts}

\end{questions}

\end{document}

答案1

這是定義兩個命令\afterclasspart\standardpart給出所需格式的一種方法:

\documentclass{exam}

\newcommand\afterclasspart{\renewcommand\partlabel{(\thepartno)$^\ast$}}  
\newcommand\standardpart{\renewcommand\partlabel{(\thepartno)}}
  
\begin{document}

\begin{questions}
\question[10]
Why is there air?
\question
What if there were no air?
\begin{parts}
\part[5]
Describe the effect on the balloon industry.
\afterclasspart
\part[5]
Describe the effect on the aircraft industry.
\standardpart
\part[5]
Describe the effect on the wool industry.
\end{parts}
\question[20]
\begin{parts}
\afterclasspart
\part
Define the universe.
Give three examples.
\standardpart
\part
If the universe were to end, how would you know?
\part
If the universe were not to end, how would you know?
\end{parts}
\end{questions}

\end{document}

結果:

在此輸入影像描述

也許這個變體可以更好地對齊標籤:

\documentclass{exam}

\newcommand\afterclasspart{\renewcommand\partlabel{(\thepartno)\makebox[0pt]{$\ ^\ast$}}}  
\newcommand\standardpart{\renewcommand\partlabel{(\thepartno)}}
  
\begin{document}

\begin{questions}
\question[10]
Why is there air?
\question
What if there were no air?
\begin{parts}
\part[5]
Describe the effect on the balloon industry.
\afterclasspart
\part[5]
Describe the effect on the aircraft industry.
\standardpart
\part[5]
Describe the effect on the wool industry.
\end{parts}
\question[20]
\begin{parts}
\afterclasspart
\part
Define the universe.
Give three examples.
\standardpart
\part
If the universe were to end, how would you know?
\part
If the universe were not to end, how would you know?
\end{parts}
\end{questions}

\end{document}

結果:

在此輸入影像描述

更新

可以應用類似的過程將星號加入選定的問題:

\documentclass{exam}

\newcommand\afterclasspart{\renewcommand\partlabel{(\thepartno)\makebox[0pt]{$\ ^\ast$}}}  
\newcommand\standardpart{\renewcommand\partlabel{(\thepartno)}}
\newcommand\afterclassquestion{\renewcommand\questionlabel{\thequestion.\makebox[0pt]{$^\ast$}}}  
\newcommand\standardquestion{\renewcommand\questionlabel{\thequestion.}}  

\begin{document}

\begin{questions}
\afterclassquestion
\question[10]
Why is there air?
\standardquestion
\question
What if there were no air?
\begin{parts}
\part[5]
Describe the effect on the balloon industry.
\afterclasspart
\part[5]
Describe the effect on the aircraft industry.
\standardpart
\part[5]
Describe the effect on the wool industry.
\end{parts}
\question[20]
\begin{parts}
\afterclasspart
\part
Define the universe.
Give three examples.
\standardpart
\part
If the universe were to end, how would you know?
\part
If the universe were not to end, how would you know?
\end{parts}
\end{questions}

\end{document}

在此輸入影像描述

相關內容