summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-09-12 20:29:14 +0000
committerKarl Berry <karl@freefriends.org>2021-09-12 20:29:14 +0000
commitbe52c14bbe48645b8bda2d8366e1b7981d2aad3d (patch)
tree76d1d1f81acf17db3e37cca59deb7a094f8e5a36 /Master/texmf-dist/tex
parentfb50ed521936ee0f9fc10cdbc1f0c5d7b7fab36f (diff)
mcexam (12sep21)
git-svn-id: svn://tug.org/texlive/trunk@60481 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/mcexam/mcexam.sty8
1 files changed, 5 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/mcexam/mcexam.sty b/Master/texmf-dist/tex/latex/mcexam/mcexam.sty
index f28c975ced2..c2359ac17ae 100644
--- a/Master/texmf-dist/tex/latex/mcexam/mcexam.sty
+++ b/Master/texmf-dist/tex/latex/mcexam/mcexam.sty
@@ -46,7 +46,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mcexam}[2017/12/26 v0.4 LaTeX package for creating randomized Multiple Choice questions]
+\ProvidesPackage{mcexam}[2021/09/12 v0.5 LaTeX package for creating randomized Multiple Choice questions]
% package option: output
\newbool{mc@concept}
@@ -1057,10 +1057,11 @@
\foreach \a in {1,...,\csuse{mc@totalNumberOfAnswersQ\q}}{
\csxdef{mc@answerTempnum\a}{\a}
}
+ \numdef\@numberofpermuteanswers{\csuse{mc@totalNumberOfAnswersQ\q}}
\numdef\@numberofswaps{\csuse{mc@totalNumberOfAnswersQ\q}-1}
\foreach \v in {1,...,\mc@totalNumberOfVersions}{
\foreach \x in {1,...,\@numberofswaps}{
- \pgfmathrandominteger{\r}{\x}{\csuse{mc@totalNumberOfAnswersQ\q}}
+ \pgfmathrandominteger{\r}{\x}{\@numberofpermuteanswers}
\letcs\@temp{mc@answerTempnum\x}
\global\csletcs{mc@answerTempnum\x}{mc@answerTempnum\r}
\global\cslet{mc@answerTempnum\r}{\@temp}
@@ -1137,6 +1138,7 @@
\def\mc@randomizeAnswers@userdefined{
+ \numdef\@numberofpermuteanswers{\csuse{mc@totalNumberOfUserPermutationsQ\q}}
\numdef\@numberofswaps{\csuse{mc@totalNumberOfUserPermutationsQ\q}-1}
\gdef\mc@cntr{0}
\renewcommand*{\do}[1]{
@@ -1147,7 +1149,7 @@
\foreach \v in {1,...,\mc@totalNumberOfVersions}{
\ifnumequal{\mc@cntr}{0}{
\foreach \p in {1,...,\@numberofswaps}{
- \pgfmathrandominteger{\r}{\p}{\csuse{mc@totalNumberOfUserPermutationsQ\q}}
+ \pgfmathrandominteger{\r}{\p}{\@numberofpermuteanswers}
\letcs\@temp{mc@userPermutationQ\q P\p}
\global\csletcs{mc@userPermutationQ\q P\p}{mc@userPermutationQ\q P\r}
\global\cslet{mc@userPermutationQ\q P\r}{\@temp}