summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ran_toks/examples
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-01-26 03:01:06 +0000
committerNorbert Preining <norbert@preining.info>2021-01-26 03:01:06 +0000
commit94ac70b92400e4b95d43d570ad53a713c036118b (patch)
treef312a316fd2dc7070b7550ece5dbb3d25be5f480 /macros/latex/contrib/ran_toks/examples
parent31152d888efa58265aef8521042ad58c300f9576 (diff)
CTAN sync 202101260301
Diffstat (limited to 'macros/latex/contrib/ran_toks/examples')
-rw-r--r--macros/latex/contrib/ran_toks/examples/ctrl-build.tex58
-rw-r--r--macros/latex/contrib/ran_toks/examples/db1.tex2
-rw-r--r--macros/latex/contrib/ran_toks/examples/db2.tex4
-rw-r--r--macros/latex/contrib/ran_toks/examples/db3.tex4
-rw-r--r--macros/latex/contrib/ran_toks/examples/db4.tex4
-rw-r--r--macros/latex/contrib/ran_toks/examples/mc-db.tex72
-rw-r--r--macros/latex/contrib/ran_toks/examples/mc-dbu-ctrld.tex62
-rw-r--r--macros/latex/contrib/ran_toks/examples/mc-dbu.tex75
-rw-r--r--macros/latex/contrib/ran_toks/examples/ran-toks.tex (renamed from macros/latex/contrib/ran_toks/examples/ran_toks.tex)1
-rw-r--r--macros/latex/contrib/ran_toks/examples/rt-cb.tex36
-rw-r--r--macros/latex/contrib/ran_toks/examples/rt-tst-eqe.tex (renamed from macros/latex/contrib/ran_toks/examples/random_tst.tex)5
-rw-r--r--macros/latex/contrib/ran_toks/examples/rt-tst-qz.tex (renamed from macros/latex/contrib/ran_toks/examples/random_tst_qz.tex)24
-rw-r--r--macros/latex/contrib/ran_toks/examples/viewDB.tex40
13 files changed, 339 insertions, 48 deletions
diff --git a/macros/latex/contrib/ran_toks/examples/ctrl-build.tex b/macros/latex/contrib/ran_toks/examples/ctrl-build.tex
new file mode 100644
index 0000000000..c5401a303d
--- /dev/null
+++ b/macros/latex/contrib/ran_toks/examples/ctrl-build.tex
@@ -0,0 +1,58 @@
+\documentclass{article}
+\usepackage{shellesc}
+\usepackage{fancyvrb}
+
+\newif\ifcompileit \compileittrue
+
+\begin{document}
+
+\noindent
+This is a dummy file to help compile multiple versions of the same source file.
+The commands are very simple, they can be improved in a variety of ways.
+
+\def\basename{mc-dbu-ctrld} % base name of target file
+\def\altbasename{mc-dbu} % base name of output file
+% define a simple \forVersion command, convert letter to upper case
+\def\forVersion#1{\uppercase{\edef\selVersion{#1}}}
+
+% select the version letter (upper or lower case)
+\forVersion{a}
+% define a suffix that follows \altbasename, redefine as desired
+\edef\altsuffix{%
+ \if\selVersion Asec01\else
+ \if\selVersion Bsec02\else
+ \if\selVersion Csec03\else
+ \if\selVersion Dsec04\fi\fi\fi\fi}
+
+\begin{VerbatimOut}[commandchars=!()]{build-info.tex}
+\examNum{1}
+\numVersions{4}
+\forVersion{!selVersion}
+\vA{\useThisSeed{54356}}
+\vB{\useThisSeed{577867}}
+\vC{\useThisSeed{6746788}}
+\vD{\useThisSeed{856785}}
+%\viewIDstrue % to view the IDs of problems used
+\end{VerbatimOut}
+
+\medskip\noindent
+Compiling the file \texttt{\basename.tex} for version~\selVersion\space(\altsuffix), and renaming the final
+PDF produced to \texttt{\altbasename-\altsuffix.pdf}
+
+
+\ifcompileit
+
+% compile using the PDF creator of your choice, copy and paste this next
+% line to execute multiple compiles to bring labels, if any, up to date
+\ShellEscape{pdflatex \basename}
+%\ShellEscape{pdflatex \basename}
+%\ShellEscape{pdflatex \basename}
+
+% copy the newly created file to a new file name
+\ShellEscape{move \basename.pdf \altbasename-\altsuffix.pdf}
+% delete build-info.tex
+\ShellEscape{del build-info.tex}
+
+\fi
+
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/ran_toks/examples/db1.tex b/macros/latex/contrib/ran_toks/examples/db1.tex
index 45a8b67124..f51bf5b74b 100644
--- a/macros/latex/contrib/ran_toks/examples/db1.tex
+++ b/macros/latex/contrib/ran_toks/examples/db1.tex
@@ -1,7 +1,7 @@
%
% First DB, uses ran_toks and eqexam
%
-\bRTVToks{DB1-}
+\bRTVToks{DB1}
\begin{rtVW}
\begin{problem}[5]
diff --git a/macros/latex/contrib/ran_toks/examples/db2.tex b/macros/latex/contrib/ran_toks/examples/db2.tex
index dc18b86faa..bb1cfb8e75 100644
--- a/macros/latex/contrib/ran_toks/examples/db2.tex
+++ b/macros/latex/contrib/ran_toks/examples/db2.tex
@@ -2,7 +2,7 @@
% Second DB, uses ran_toks and eqexam
%
-\bRTVToks{DB2-}
+\bRTVToks{DB2}
\begin{rtVW}
\begin{problem}[5]
@@ -62,4 +62,4 @@ DB2: Fourth: Which is correct?
\eRTVToks
-\endinput \ No newline at end of file
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/ran_toks/examples/db3.tex b/macros/latex/contrib/ran_toks/examples/db3.tex
index 1948692f1f..099eeb2c7b 100644
--- a/macros/latex/contrib/ran_toks/examples/db3.tex
+++ b/macros/latex/contrib/ran_toks/examples/db3.tex
@@ -2,7 +2,7 @@
% Third DB, uses ran_toks and eqexam
%
-\bRTVToks{DB3-}
+\bRTVToks{DB3}
\begin{rtVW}
\begin{problem}[5]
@@ -62,4 +62,4 @@ DB3: Fourth: Which is correct?
\eRTVToks
-\endinput \ No newline at end of file
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/ran_toks/examples/db4.tex b/macros/latex/contrib/ran_toks/examples/db4.tex
index 64b1d241ef..b6b4556a6f 100644
--- a/macros/latex/contrib/ran_toks/examples/db4.tex
+++ b/macros/latex/contrib/ran_toks/examples/db4.tex
@@ -2,7 +2,7 @@
% Fourth DB, uses ran_toks and eqexam
%
-\bRTVToks{DB4-}
+\bRTVToks{DB4}
\begin{rtVW}
\begin{problem}[5]
@@ -62,4 +62,4 @@ DB4: Fourth: Which is correct?
\eRTVToks
-\endinput \ No newline at end of file
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/ran_toks/examples/mc-db.tex b/macros/latex/contrib/ran_toks/examples/mc-db.tex
index 1eb2ce548a..549da16f2c 100644
--- a/macros/latex/contrib/ran_toks/examples/mc-db.tex
+++ b/macros/latex/contrib/ran_toks/examples/mc-db.tex
@@ -1,7 +1,9 @@
-\documentclass{article}
-\usepackage[allowrandomize,nosolutions,
- forpaper,pointsonleft,noparttotals]{eqexam}
-\usepackage{ran_toks}
+\documentclass[a4paper]{article}
+\usepackage[%
+ allowrandomize,
+ nosolutions,
+ forpaper,pointsonleft,noparttotals]{eqexam}
+\usepackage[usedbapp]{ran_toks}
\useLastAsSeed
% To reproduce the same pseudo-random sequence, you need to supply a seed
@@ -13,14 +15,21 @@
\subject[MC]{My Course}
\date{Spring \the\year}
\keywords{Test~\nExam, Section 001}
-
-\university
+ \university
{%
THE UNIVERSITY OF AKRON\\
Theoretical and Applied Mathematics
}
\email{dpstory@uakron.edu}
+
+
+%\uniqueXDBChoicesOn
+%\viewIDstrue % to view the IDs of problems used\university
+%\doNotRandomizeChoices % eqexam 2021/01/20
+%\allowRandomizedChoices % eqexam 2021/01/20
+
+
% Input the DB files used in the demo file
\useTheseDBs{db1,db2,db3,db4}
@@ -38,38 +47,47 @@ This part demonstrates how to not only randomly pull problems (two from each of
to randomize the order they are listed in the exam.
\end{instructions}
-\ranToks{myExam}{%
- {\useRanTok[DB1-]{1}}
- {\useRanTok[DB1-]{2}}
- {\useRanTok[DB2-]{1}}
- {\useRanTok[DB2-]{2}}
- {\useRanTok[DB3-]{1}}
- {\useRanTok[DB3-]{2}}
- {\useRanTok[DB4-]{1}}
- {\useRanTok[DB4-]{2}}
+\ranToksOff
+
+\ranToks{myExam}
+{%
+ {\useRanTok[DB1]{1}}
+ {\useRanTok[DB1]{2}}
+ {\useRanTok[DB2]{1}}
+ {\useRanTok[DB2]{2}}
+ {\useRanTok[DB3]{1}}
+ {\useRanTok[DB3]{2}}
+ {\useRanTok[DB4]{1}}
+ {\useRanTok[DB4]{2}}
}
\displayListRandomly{myExam}
\end{exam}
+\newpage
+
+%\uniqueXDBChoicesOff
+
\begin{exam}{Part2}
\begin{instructions}
-In this part, we take the same two problems from each of the four DB files, but do not randomize
-the order of the questions.
+In this part, when \verb~\uniqueXDBChoicesOff~ (the default) is
+expanded, we take the same two problems from each of the four DB
+files, but here, we do not randomize the order of the questions. However,
+when \verb~\uniqueXDBChoicesOn~ is expanded in the preamble,
+this set of eight questions are entirely different from the ones
+of \textsf{Part1}.
\end{instructions}
-\useRanTok[DB1-]{1}
-\useRanTok[DB1-]{2}
-\useRanTok[DB2-]{1}
-\useRanTok[DB2-]{2}
-\useRanTok[DB3-]{1}
-\useRanTok[DB3-]{2}
-\useRanTok[DB4-]{1}
-\useRanTok[DB4-]{2}
+\useRanTok[DB1]{1}
+\useRanTok[DB1]{2}
+\useRanTok[DB2]{1}
+\useRanTok[DB2]{2}
+\useRanTok[DB3]{1}
+\useRanTok[DB3]{2}
+\useRanTok[DB4]{1}
+\useRanTok[DB4]{2}
\end{exam}
\end{document}
-
-
diff --git a/macros/latex/contrib/ran_toks/examples/mc-dbu-ctrld.tex b/macros/latex/contrib/ran_toks/examples/mc-dbu-ctrld.tex
new file mode 100644
index 0000000000..0f0b9b140a
--- /dev/null
+++ b/macros/latex/contrib/ran_toks/examples/mc-dbu-ctrld.tex
@@ -0,0 +1,62 @@
+\documentclass{article}
+\usepackage[allowrandomize,nosolutions,
+ forpaper,pointsonleft,noparttotals]{eqexam}
+\usepackage[usedbapp]{ran_toks}
+
+%\rtdebugtrue
+
+% This file is not compiled directly, but by the file ctrl-build.tex, see that file for details
+\input{build-info}
+
+\uniqueXDBChoicesOn
+\InputUsedIDs
+
+\title[T\nExam]{Test \nExam}
+\author{D. P. Story}
+\subject[MC]{My Course}
+\date{Spring \the\year}
+\keywords{Test~\nExam, Section 001}
+\altTitle{Section~%
+ \if\selVersion A01\else
+ \if\selVersion B02\else
+ \if\selVersion C03\else
+ 04\fi\fi\fi\space(Version~\selVersion)}
+
+\makeInfoAWarning
+
+\university
+{%
+ THE UNIVERSITY OF AKRON\\
+ Theoretical and Applied Mathematics
+}
+\email{dpstory@uakron.edu}
+
+% Input the DB files used in the demo file
+\useTheseDBs{db1,db2,db3,db4}
+
+\begin{document}
+
+\maketitle
+
+\begin{exam}{Part1}
+
+\begin{instructions}
+Solve each without error. Passing is 100\%.
+
+\medskip\noindent
+This part demonstrates how to not only randomly pull problems (two from each of the DB files), but
+to randomize the order they are listed in the exam.
+\end{instructions}
+
+\ranToks{myExam}
+{%
+ {\useRanTok[DB1]{1}}
+ {\useRanTok[DB2]{1}}
+ {\useRanTok[DB3]{1}}
+ {\useRanTok[DB4]{1}}
+}
+\displayListRandomly{myExam}
+
+\end{exam}
+
+\end{document}
diff --git a/macros/latex/contrib/ran_toks/examples/mc-dbu.tex b/macros/latex/contrib/ran_toks/examples/mc-dbu.tex
new file mode 100644
index 0000000000..b0790c8bba
--- /dev/null
+++ b/macros/latex/contrib/ran_toks/examples/mc-dbu.tex
@@ -0,0 +1,75 @@
+\documentclass{article}
+\usepackage[allowrandomize,nosolutions,
+ forpaper,pointsonleft,noparttotals]{eqexam}
+\usepackage[usedbapp]{ran_toks}
+
+%\rtdebugtrue
+
+%\useLastAsSeed
+% To reproduce the same pseudo-random sequence, you need to supply a seed
+%\useThisSeed{1125676795}
+
+\examNum{1}
+\numVersions{4}
+\forVersion{d}
+\vA{\useThisSeed{54356}}
+\vB{\useThisSeed{577867}}
+\vC{\useThisSeed{6746788}}
+\vD{\useThisSeed{856785}}
+
+\uniqueXDBChoicesOn
+\InputUsedIDs
+\viewIDstrue % to view the IDs of problems used
+
+\title[T\nExam]{Test \nExam}
+\author{D. P. Story}
+\subject[MC]{My Course}
+\date{Spring \the\year}
+\keywords{Test~\nExam, Section 001}
+\altTitle{Section~%
+ \if\selVersion A01\else
+ \if\selVersion B02\else
+ \if\selVersion C03\else
+ 04\fi\fi\fi\space(Version~\selVersion)}
+
+%\makeInfoAWarning
+
+\university
+{%
+ THE UNIVERSITY OF AKRON\\
+ Theoretical and Applied Mathematics
+}
+\email{dpstory@uakron.edu}
+
+% Input the DB files used in the demo file
+\useTheseDBs{db1,db2,db3,db4}
+
+\begin{document}
+
+\maketitle
+
+\begin{exam}{Part1}
+
+\begin{instructions}
+Solve each without error. Passing is 100\%.
+
+\medskip\noindent
+This part demonstrates how to not only randomly pull problems
+(two from each of the DB files), but to randomize the order they
+are listed in the exam.
+\end{instructions}
+
+\ranToksOff % turn off randomization of the order
+
+\ranToks{myExam}
+{%
+ {\useRanTok[DB1]{1}}
+ {\useRanTok[DB2]{1}}
+ {\useRanTok[DB3]{1}}
+ {\useRanTok[DB4]{1}}
+}
+\displayListRandomly{myExam}
+
+\end{exam}
+
+\end{document}
diff --git a/macros/latex/contrib/ran_toks/examples/ran_toks.tex b/macros/latex/contrib/ran_toks/examples/ran-toks.tex
index e10238aa5a..0408003d24 100644
--- a/macros/latex/contrib/ran_toks/examples/ran_toks.tex
+++ b/macros/latex/contrib/ran_toks/examples/ran-toks.tex
@@ -57,6 +57,7 @@ How did that other stuff get in there?
\begin{enumerate}
\displayListRandomly[\item]{myThoughts}
\end{enumerate}
+
Use \verb!\useRTName! command when another list separates the current
position from the list you want to use. Here we want to use the list named
\texttt{myPals}, but since that definition, a new list named
diff --git a/macros/latex/contrib/ran_toks/examples/rt-cb.tex b/macros/latex/contrib/ran_toks/examples/rt-cb.tex
new file mode 100644
index 0000000000..c8e20e4d17
--- /dev/null
+++ b/macros/latex/contrib/ran_toks/examples/rt-cb.tex
@@ -0,0 +1,36 @@
+\documentclass{article}
+\usepackage{ran_toks}
+\usepackage{collectbox}
+
+\useLastAsSeed
+
+\newbox\rtcollectbox
+
+\parindent0pt
+
+
+\begin{document}
+
+In this file, a method of placing verbatim content in as a token argument of
+\verb~\ranToks~ The key is to use the \textsf{collectbox} package, and collect
+the verbatim content with \verb~\collectboxto~.
+
+\def\cbCont{\def\myVerb{\usebox{\rtcollectbox}}}
+\collectboxto{\rtcollectbox}{\cbCont}{\verb!$x^2+1$!}
+
+%\ranToksOff
+\ranToks{CB}
+{%
+ {Don-1}
+ {Kira-2}
+ {Alex-3}
+ {Jim-4}
+ {Rick-5}
+ {\myVerb-6}
+}
+
+\useRanTok{1}, \useRanTok{2}, \useRanTok{3}, \useRanTok{4}, \useRanTok{5},
+\useRanTok{6}%, \useRanTok{7}
+
+
+\end{document}
diff --git a/macros/latex/contrib/ran_toks/examples/random_tst.tex b/macros/latex/contrib/ran_toks/examples/rt-tst-eqe.tex
index 1f64c79907..5d4d665396 100644
--- a/macros/latex/contrib/ran_toks/examples/random_tst.tex
+++ b/macros/latex/contrib/ran_toks/examples/rt-tst-eqe.tex
@@ -8,8 +8,7 @@
\usepackage{ran_toks}
\useLastAsSeed
-%\useThisSeed{452836675} % fi,t,f,s
-
+%\useThisSeed{452836675}
\examNum{1}
\title[T\nExam]{Test \nExam}
\author{D. P. Story}
@@ -25,6 +24,7 @@
\email{dpstory@uakron.edu}
\begin{document}
+
\maketitle
@@ -97,7 +97,6 @@ Fourth: Which is correct?
% Ok, now display this questions in a random order.
\displayListRandomly{Exam\nExam}
-
\end{exam}
\end{document}
diff --git a/macros/latex/contrib/ran_toks/examples/random_tst_qz.tex b/macros/latex/contrib/ran_toks/examples/rt-tst-qz.tex
index 3ca3c4043e..07be773883 100644
--- a/macros/latex/contrib/ran_toks/examples/random_tst_qz.tex
+++ b/macros/latex/contrib/ran_toks/examples/rt-tst-qz.tex
@@ -8,14 +8,16 @@
\documentclass{article}
\usepackage[designiv]{web}
\usepackage[allowrandomize,showgrayletters]{exerquiz}
-\usepackage{ran_toks}
+\usepackage{ran-toks} % alt pkg name
+
+% \previewOn\pmpvOn
% When using cross-referencing and \useLastAsSeed, the cross-references are never up to date.
-% Once you randomize, read the auxiliary file (\jobname_rt.save), copy the first seed listed
-% and paste in as the argument of \useThisSeed. Compile a few more times to bring cross-refereces
+% Once you randomize, read the auxiliary file (\jobname_rt.sav), copy the first seed listed
+% and paste in as the argument of \useThisSeed. Compile a few more times to bring cross-references
% up to date.
%\useLastAsSeed
-\useThisSeed{1327548830}
+\useThisSeed{955908747}
\rowsepDefault{3pt}
@@ -27,7 +29,7 @@
\begin{questions}
\item Try to guess the correct answer.
\begin{answers}{2}
- \bChoices[random]
+ \bChoices[random=true]
\Ans0 1 a choice\eAns
\Ans1\label{eq} 2 another choice\eAns
\Ans0 3 still another choice\eAns
@@ -38,8 +40,8 @@
\Ans0 8 too many\eAns
\Ans0 9 choices\eAns
\Ans0 10 \input{mytext.verb}\eAns
- \eFreeze
- \Ans0 10 None of these\eAns
+ \eFreeze
+ \Ans0 11 None of these\eAns
\eChoices
\end{answers}
\end{questions}
@@ -71,10 +73,10 @@ Solve each.
\useRTName{myChoices}
\begin{manswers}*{1}
\bChoices[random=true,label=rtAns]
- \Ans{1}\label{rtAns3}\rtTokByNum{1}\eAns
+ \Ans{1}\label{rtAns3} \rtTokByNum{1}\eAns
\Ans{0} Wow, \rtTokByNum{2}, this is great!\eAns
- \Ans{0}\rtTokByNum{3}\eAns
- \Ans{0}\rtTokByNum{4}\eAns
+ \Ans{0} \rtTokByNum{3}\eAns
+ \Ans{0} \rtTokByNum{4}\eAns
\eFreeze
\Ans{1} Hello mom!\eAns
\eChoices
@@ -110,6 +112,6 @@ The answer is \hyperref[rtAns1]{(\REF*{rtAns1})} found in the
\eChoices
\end{answers}
\end{questions}
-\end{quiz*}
+\end{quiz*}\quad\ScoreField\currQuiz\CorrButton\currQuiz
\end{document}
diff --git a/macros/latex/contrib/ran_toks/examples/viewDB.tex b/macros/latex/contrib/ran_toks/examples/viewDB.tex
new file mode 100644
index 0000000000..be9c5623b5
--- /dev/null
+++ b/macros/latex/contrib/ran_toks/examples/viewDB.tex
@@ -0,0 +1,40 @@
+\documentclass[12pt]{article}
+\usepackage[usedbapp]{ran_toks}
+
+\usepackage[%allowrandomize,
+ nosolutions,forcolorpaper,pointsonleft,noparttotals]{eqexam}
+
+\everymath{\displaystyle}
+
+\examNum{1}
+\title[ViewDB]{View a DB Test File}
+\author{D. P. Story}
+\subject[MC]{Demo file}
+\university
+{%
+ THE UNIVERSITY OF AKRON\\
+ Theoretical and Applied Mathematics
+}
+\email{dpstory@uakron.edu}
+
+\useProbDBs{db1,db2,db3,db4}
+\viewIDstrue
+
+\begin{document}
+
+
+\begin{exam}{View}
+
+%%%%%%%%%%%%%%%%
+% Typeset a DB %
+%%%%%%%%%%%%%%%%
+% The problems are input in the order they appear in the DB, the alternatives
+% are not randomized either.
+\viewDB{DB1} % DB1, DB2, DB3, DB4
+
+
+\end{exam}
+\end{document}
+
+
+