我对 Database.tex 有一些疑问(6 个问题)。
\documentclass{article}
\usepackage{fouriernc}
\usepackage[paperwidth=17cm, paperheight=24cm, left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{exsheets}
\SetupExSheets{
counter-within = subsection ,
counter-format = \thesection.qu.,
headings=runin
}
\SetupExSheets[question]{type=exam, name=Problem}
\begin{document}
\section{Random}
\subsection{The first way}
\includequestions[random={2}]{Database_English.tex}
\subsection{Second way}
\subsection{Odd label}
\includequestions[IDs={q1,q3,q5}]{Database_English.tex}
\subsection{Even label}
\includequestions[IDs={q2,q4,q6}]{Database_English.tex}
\section{Solutions}
\printsolutions
\end{document}
数据库.tex
\begin{question}[ID=q1]
The question was labeled q1.
\end{question}
\begin{solution}
Solution.
\end{solution}
\begin{question}[ID=q2]
The question was labeled q2.
\end{question}
\begin{question}[ID=q3]
The question was labeled q3.
\end{question}
\begin{question}[ID=q4]
The question was labeled q4.
\end{question}
\begin{question}[ID=q5]
The question was labeled q5.
\end{question}
\begin{question}[ID=q6]
The question was labeled q6.
\end{question}
现在我根据以下规则随机选择。
这些问题都标有奇数。我试过
\includequestions[IDs={q1,q3,q5}]{数据库.tex}
这些问题都标有偶数。我试过
\includequestions[IDs={q2,q4,q6}]{数据库.tex}
已选择 2 个问题
\includequestions[random={2}]{数据库.tex}
我的问题是,如果我有 100 个问题。我该如何选择
- 问题 1、3、5、...、99?
- 问题 2、4、6、...、100?
- 问题 3、6、9、...、3k?
- 从 1 到 30 的问题?
答案1
我没有用 解决我的问题exsheets
。我尝试用xsim
。
\documentclass{article}
\usepackage[paperwidth=17cm, paperheight=24cm, left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{fouriernc}
\usepackage{xsim,pgffor}
\usepackage{needspace}
\DeclareExerciseEnvironmentTemplate{runin}
{%
\par\vspace{\baselineskip}
\Needspace * {2\baselineskip}
\noindent
\textbf{\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{counter}}%
\GetExercisePropertyT{subtitle}{ \textit{#1}} %
\GetExercisePropertyT{points}{%
\marginpar{%
\PropertyValue
\GetExercisePropertyT{bonus-points}{+\PropertyValue}%
\,\IfExerciseGoalSingularTF{points}
{\XSIMtranslate{point}}
{\XSIMtranslate{points}}%
}%
}%
}
{}
\xsimsetup{
exercise/within=section ,
exercise/template=runin,
solution/template=runin,
solution/print = true,
exercise/the-counter = \thesection.\arabic{exercise}.}
\DeclareExerciseCollection{exam}
\begin{document}
\collectexercises{exam}
\begin{exercise}[ID=q1]
1
\end{exercise}
\begin{solution}
1
\end{solution}
\begin{exercise}[ID=q2]
2
\end{exercise}
\begin{exercise}[ID=q3]
3
\end{exercise}
\begin{exercise}[ID=q4]
4
\end{exercise}
\begin{exercise}[ID=q5]
5
\end{exercise}
\begin{exercise}[ID=q6]
6
\end{exercise}
\begin{exercise}[ID=q7]
7
\end{exercise}
\begin{exercise}[ID=q8]
8
\end{exercise}
\begin{exercise}[ID=q9]
9
\end{exercise}
\begin{exercise}[ID=q10]
10
\end{exercise}
\collectexercisesstop{exam}
\section{All labels}
\foreach \x in {1,2,...,10}{
\XSIMexpandcode{\printexercise{exercise}{\x}}
}
\section{Some labels}
\subsection{Type 1}
\foreach \x in {3,4,...,10}{
\XSIMexpandcode{\printexercise{exercise}{\x}}
}
\subsection{Type 2, any order}
\foreach \x in {9,7,6,3}{
\XSIMexpandcode{\printexercise{exercise}{\x}}
}
\section{Odd labels}
\foreach \x in {1,3,...,10}{
\XSIMexpandcode{\printexercise{exercise}{\x}}
}
\section{Even labels}
\foreach \x in {2,4,...,10}{
\XSIMexpandcode{\printexercise{exercise}{\x}}
}
\section{Random}
\subsection{Firt time}
\printrandomexercises[collection=exam]{2}
\subsection{Second time}
\printrandomexercises[collection=exam]{2}
\section{Answers}
\printsolutions
\end{document}