Package mcexam random question from file The Next CEO of Stack OverflowWrite answers in the...

Chain wire methods together in Lightning Web Components

Why isn't the Mueller report being released completely and unredacted?

How is this set of matrices closed under multiplication?

Make solar eclipses exceedingly rare, but still have new moons

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

Method for adding error messages to a dictionary given a key

Is there a difference between "Fahrstuhl" and "Aufzug"

Why do remote US companies require working in the US?

Solving system of ODEs with extra parameter

A small doubt about the dominated convergence theorem

Do I need to write [sic] when a number is less than 10 but isn't written out?

Is it okay to majorly distort historical facts while writing a fiction story?

What does "Its cash flow is deeply negative" mean?

Unclear about dynamic binding

Can you be charged for obstruction for refusing to answer questions?

How to edit “Name” property in GCI output?

Does increasing your ability score affect your main stat?

Proper way to express "He disappeared them"

Is it possible to use a NPN BJT as switch, from single power source?

Why, when going from special to general relativity, do we just replace partial derivatives with covariant derivatives?

What did we know about the Kessel run before the prequels?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

What happened in Rome, when the western empire "fell"?

Why does standard notation not preserve intervals (visually)



Package mcexam random question from file



The Next CEO of Stack OverflowWrite answers in the same line using package mcexamMultiple test versions in the same output pdf using mcexam packageObtaining the total number of questions from mcexammcexam a custom type questionUsing conditionals inside mcexam












1















It has a file of multiple choice questions with 50 questions that wanted to generate evaluations with different questions, for each evaluation limit the number by 10 questions, generating 5 files with different questions.



 documentclass[a4paper]{article}

usepackage[output=exam
,numberofversions=4
,version=1
,seed=1
,randomizequestions=true
,randomizeanswers=true
,writeRfile=false
]{mcexam}

% Packages used for special things
usepackage{tikz,framed}
usepackage{fancyhdr,lastpage,totcount,xpatch}
usepackage{calc}

% Set headers and footers
pagestyle{fancy}

fancyhf{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{1pt}
lfoot{mctheversion}
rfoot{Page thepage of pageref{LastPage}}

% Ensure each question+answers is printed entirely on the same page.
renewenvironment{setmcquestion}
{begin{minipage}[t]{linewidth-labelwidth}}
{end{minipage}par}

newtoggle{questionscounted}
globaltogglefalse{questionscounted}
makeatletter
newcommand{patch@mcquestions}{%
iftoggle{questionscounted}
{}
{%
setcounter{numquestions}{value{mc@counter}}%
globaltoggletrue{questionscounted}
}%
}
newcounter{numquestions}
regtotcounter{numquestions}
xpatchcmd{env@mcquestions@process}
{mc@setQuestionAndAnswerNumbers}
{mc@setQuestionAndAnswerNumberspatch@mcquestions}
{}{}
makeatother


begin{document}


begin{center}
bfseriesLARGE Midterm Exam
end{center}

begin{framed}
centeringbfseriesLargeMakeUppercase{mctheversion}
end{framed}

mcifoutput{concept,exam}{

bigskip

noindent Name: dotfill\[.5baselineskip]
noindent Student Number: dotfill\[.5baselineskip]
noindent Program: dotfill

vspace{2baselineskip}


noindenttextbf{Instructions:}
begin{itemize}[nosep]
item This exam has total{numquestions} questions. %THIS THROWS AN UNDEFINED CONTROL SEQUENCE ERROR
end{itemize}
}


begin{mcquestions}

question What is the color of the sky?

begin{mcanswerslist}[fixlast]
answer[correct] blue
answer green
answer red
answer yellow
answer none of the above
end{mcanswerslist}

begin{mcexplanation}
If you look up to the sky and there are no clouds, you'll see it is blue.
end{mcexplanation}

begin{mcnotes}
This question had a large proportion of good answers last year.
end{mcnotes}

question Which figure is a square?
begin{mcanswers}
begin{tabular}{@{}cccc}
answer{1}{tikz{draw (-0.66,0)--(0.66,0)--(0,1)--cycle;}}&
answer{2}{tikz{draw (0,0)--(2,0)--(2,1)--(0,1)--cycle;}}&
answer[correct]{3}{tikz{draw (0,0)--(1,0)--(1,1)--(0,1)--cycle;}}&
answer{4}{tikz{draw (0,0) circle[radius=0.5];}}\
answernum{1}&answernum{2}&answernum{3}&answernum{4}\
end{tabular}
end{mcanswers}

end{mcquestions}

end{document}









share|improve this question

























  • It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The Stack Exchange staff can merge them together for you.

    – Kurt
    3 hours ago











  • @Kurt i am guess merge all accounts now. Thanks for observation

    – Fabio Lima
    2 hours ago











  • By my file foreach i in {1,...,10}{ newpage setkeys{mcexam.sty}{version=i,seed=123} begin{mcquestions} input{../path1/file1} input{../path2/file2} end{mcquestions} } Have error compilation used this mode.

    – Fabio Lima
    2 hours ago













  • Your given code in your question compiles without problems with current MiKTeX 2.9 ... Can you please add the complete error message you get and make sure the given code in your questions results in your error please.

    – Kurt
    2 hours ago
















1















It has a file of multiple choice questions with 50 questions that wanted to generate evaluations with different questions, for each evaluation limit the number by 10 questions, generating 5 files with different questions.



 documentclass[a4paper]{article}

usepackage[output=exam
,numberofversions=4
,version=1
,seed=1
,randomizequestions=true
,randomizeanswers=true
,writeRfile=false
]{mcexam}

% Packages used for special things
usepackage{tikz,framed}
usepackage{fancyhdr,lastpage,totcount,xpatch}
usepackage{calc}

% Set headers and footers
pagestyle{fancy}

fancyhf{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{1pt}
lfoot{mctheversion}
rfoot{Page thepage of pageref{LastPage}}

% Ensure each question+answers is printed entirely on the same page.
renewenvironment{setmcquestion}
{begin{minipage}[t]{linewidth-labelwidth}}
{end{minipage}par}

newtoggle{questionscounted}
globaltogglefalse{questionscounted}
makeatletter
newcommand{patch@mcquestions}{%
iftoggle{questionscounted}
{}
{%
setcounter{numquestions}{value{mc@counter}}%
globaltoggletrue{questionscounted}
}%
}
newcounter{numquestions}
regtotcounter{numquestions}
xpatchcmd{env@mcquestions@process}
{mc@setQuestionAndAnswerNumbers}
{mc@setQuestionAndAnswerNumberspatch@mcquestions}
{}{}
makeatother


begin{document}


begin{center}
bfseriesLARGE Midterm Exam
end{center}

begin{framed}
centeringbfseriesLargeMakeUppercase{mctheversion}
end{framed}

mcifoutput{concept,exam}{

bigskip

noindent Name: dotfill\[.5baselineskip]
noindent Student Number: dotfill\[.5baselineskip]
noindent Program: dotfill

vspace{2baselineskip}


noindenttextbf{Instructions:}
begin{itemize}[nosep]
item This exam has total{numquestions} questions. %THIS THROWS AN UNDEFINED CONTROL SEQUENCE ERROR
end{itemize}
}


begin{mcquestions}

question What is the color of the sky?

begin{mcanswerslist}[fixlast]
answer[correct] blue
answer green
answer red
answer yellow
answer none of the above
end{mcanswerslist}

begin{mcexplanation}
If you look up to the sky and there are no clouds, you'll see it is blue.
end{mcexplanation}

begin{mcnotes}
This question had a large proportion of good answers last year.
end{mcnotes}

question Which figure is a square?
begin{mcanswers}
begin{tabular}{@{}cccc}
answer{1}{tikz{draw (-0.66,0)--(0.66,0)--(0,1)--cycle;}}&
answer{2}{tikz{draw (0,0)--(2,0)--(2,1)--(0,1)--cycle;}}&
answer[correct]{3}{tikz{draw (0,0)--(1,0)--(1,1)--(0,1)--cycle;}}&
answer{4}{tikz{draw (0,0) circle[radius=0.5];}}\
answernum{1}&answernum{2}&answernum{3}&answernum{4}\
end{tabular}
end{mcanswers}

end{mcquestions}

end{document}









share|improve this question

























  • It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The Stack Exchange staff can merge them together for you.

    – Kurt
    3 hours ago











  • @Kurt i am guess merge all accounts now. Thanks for observation

    – Fabio Lima
    2 hours ago











  • By my file foreach i in {1,...,10}{ newpage setkeys{mcexam.sty}{version=i,seed=123} begin{mcquestions} input{../path1/file1} input{../path2/file2} end{mcquestions} } Have error compilation used this mode.

    – Fabio Lima
    2 hours ago













  • Your given code in your question compiles without problems with current MiKTeX 2.9 ... Can you please add the complete error message you get and make sure the given code in your questions results in your error please.

    – Kurt
    2 hours ago














1












1








1








It has a file of multiple choice questions with 50 questions that wanted to generate evaluations with different questions, for each evaluation limit the number by 10 questions, generating 5 files with different questions.



 documentclass[a4paper]{article}

usepackage[output=exam
,numberofversions=4
,version=1
,seed=1
,randomizequestions=true
,randomizeanswers=true
,writeRfile=false
]{mcexam}

% Packages used for special things
usepackage{tikz,framed}
usepackage{fancyhdr,lastpage,totcount,xpatch}
usepackage{calc}

% Set headers and footers
pagestyle{fancy}

fancyhf{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{1pt}
lfoot{mctheversion}
rfoot{Page thepage of pageref{LastPage}}

% Ensure each question+answers is printed entirely on the same page.
renewenvironment{setmcquestion}
{begin{minipage}[t]{linewidth-labelwidth}}
{end{minipage}par}

newtoggle{questionscounted}
globaltogglefalse{questionscounted}
makeatletter
newcommand{patch@mcquestions}{%
iftoggle{questionscounted}
{}
{%
setcounter{numquestions}{value{mc@counter}}%
globaltoggletrue{questionscounted}
}%
}
newcounter{numquestions}
regtotcounter{numquestions}
xpatchcmd{env@mcquestions@process}
{mc@setQuestionAndAnswerNumbers}
{mc@setQuestionAndAnswerNumberspatch@mcquestions}
{}{}
makeatother


begin{document}


begin{center}
bfseriesLARGE Midterm Exam
end{center}

begin{framed}
centeringbfseriesLargeMakeUppercase{mctheversion}
end{framed}

mcifoutput{concept,exam}{

bigskip

noindent Name: dotfill\[.5baselineskip]
noindent Student Number: dotfill\[.5baselineskip]
noindent Program: dotfill

vspace{2baselineskip}


noindenttextbf{Instructions:}
begin{itemize}[nosep]
item This exam has total{numquestions} questions. %THIS THROWS AN UNDEFINED CONTROL SEQUENCE ERROR
end{itemize}
}


begin{mcquestions}

question What is the color of the sky?

begin{mcanswerslist}[fixlast]
answer[correct] blue
answer green
answer red
answer yellow
answer none of the above
end{mcanswerslist}

begin{mcexplanation}
If you look up to the sky and there are no clouds, you'll see it is blue.
end{mcexplanation}

begin{mcnotes}
This question had a large proportion of good answers last year.
end{mcnotes}

question Which figure is a square?
begin{mcanswers}
begin{tabular}{@{}cccc}
answer{1}{tikz{draw (-0.66,0)--(0.66,0)--(0,1)--cycle;}}&
answer{2}{tikz{draw (0,0)--(2,0)--(2,1)--(0,1)--cycle;}}&
answer[correct]{3}{tikz{draw (0,0)--(1,0)--(1,1)--(0,1)--cycle;}}&
answer{4}{tikz{draw (0,0) circle[radius=0.5];}}\
answernum{1}&answernum{2}&answernum{3}&answernum{4}\
end{tabular}
end{mcanswers}

end{mcquestions}

end{document}









share|improve this question
















It has a file of multiple choice questions with 50 questions that wanted to generate evaluations with different questions, for each evaluation limit the number by 10 questions, generating 5 files with different questions.



 documentclass[a4paper]{article}

usepackage[output=exam
,numberofversions=4
,version=1
,seed=1
,randomizequestions=true
,randomizeanswers=true
,writeRfile=false
]{mcexam}

% Packages used for special things
usepackage{tikz,framed}
usepackage{fancyhdr,lastpage,totcount,xpatch}
usepackage{calc}

% Set headers and footers
pagestyle{fancy}

fancyhf{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{1pt}
lfoot{mctheversion}
rfoot{Page thepage of pageref{LastPage}}

% Ensure each question+answers is printed entirely on the same page.
renewenvironment{setmcquestion}
{begin{minipage}[t]{linewidth-labelwidth}}
{end{minipage}par}

newtoggle{questionscounted}
globaltogglefalse{questionscounted}
makeatletter
newcommand{patch@mcquestions}{%
iftoggle{questionscounted}
{}
{%
setcounter{numquestions}{value{mc@counter}}%
globaltoggletrue{questionscounted}
}%
}
newcounter{numquestions}
regtotcounter{numquestions}
xpatchcmd{env@mcquestions@process}
{mc@setQuestionAndAnswerNumbers}
{mc@setQuestionAndAnswerNumberspatch@mcquestions}
{}{}
makeatother


begin{document}


begin{center}
bfseriesLARGE Midterm Exam
end{center}

begin{framed}
centeringbfseriesLargeMakeUppercase{mctheversion}
end{framed}

mcifoutput{concept,exam}{

bigskip

noindent Name: dotfill\[.5baselineskip]
noindent Student Number: dotfill\[.5baselineskip]
noindent Program: dotfill

vspace{2baselineskip}


noindenttextbf{Instructions:}
begin{itemize}[nosep]
item This exam has total{numquestions} questions. %THIS THROWS AN UNDEFINED CONTROL SEQUENCE ERROR
end{itemize}
}


begin{mcquestions}

question What is the color of the sky?

begin{mcanswerslist}[fixlast]
answer[correct] blue
answer green
answer red
answer yellow
answer none of the above
end{mcanswerslist}

begin{mcexplanation}
If you look up to the sky and there are no clouds, you'll see it is blue.
end{mcexplanation}

begin{mcnotes}
This question had a large proportion of good answers last year.
end{mcnotes}

question Which figure is a square?
begin{mcanswers}
begin{tabular}{@{}cccc}
answer{1}{tikz{draw (-0.66,0)--(0.66,0)--(0,1)--cycle;}}&
answer{2}{tikz{draw (0,0)--(2,0)--(2,1)--(0,1)--cycle;}}&
answer[correct]{3}{tikz{draw (0,0)--(1,0)--(1,1)--(0,1)--cycle;}}&
answer{4}{tikz{draw (0,0) circle[radius=0.5];}}\
answernum{1}&answernum{2}&answernum{3}&answernum{4}\
end{tabular}
end{mcanswers}

end{mcquestions}

end{document}






mcexam






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 5 mins ago









Fabio Lima

133




133










asked 9 hours ago









Fabio LimaFabio Lima

485




485













  • It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The Stack Exchange staff can merge them together for you.

    – Kurt
    3 hours ago











  • @Kurt i am guess merge all accounts now. Thanks for observation

    – Fabio Lima
    2 hours ago











  • By my file foreach i in {1,...,10}{ newpage setkeys{mcexam.sty}{version=i,seed=123} begin{mcquestions} input{../path1/file1} input{../path2/file2} end{mcquestions} } Have error compilation used this mode.

    – Fabio Lima
    2 hours ago













  • Your given code in your question compiles without problems with current MiKTeX 2.9 ... Can you please add the complete error message you get and make sure the given code in your questions results in your error please.

    – Kurt
    2 hours ago



















  • It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The Stack Exchange staff can merge them together for you.

    – Kurt
    3 hours ago











  • @Kurt i am guess merge all accounts now. Thanks for observation

    – Fabio Lima
    2 hours ago











  • By my file foreach i in {1,...,10}{ newpage setkeys{mcexam.sty}{version=i,seed=123} begin{mcquestions} input{../path1/file1} input{../path2/file2} end{mcquestions} } Have error compilation used this mode.

    – Fabio Lima
    2 hours ago













  • Your given code in your question compiles without problems with current MiKTeX 2.9 ... Can you please add the complete error message you get and make sure the given code in your questions results in your error please.

    – Kurt
    2 hours ago

















It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The Stack Exchange staff can merge them together for you.

– Kurt
3 hours ago





It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The Stack Exchange staff can merge them together for you.

– Kurt
3 hours ago













@Kurt i am guess merge all accounts now. Thanks for observation

– Fabio Lima
2 hours ago





@Kurt i am guess merge all accounts now. Thanks for observation

– Fabio Lima
2 hours ago













By my file foreach i in {1,...,10}{ newpage setkeys{mcexam.sty}{version=i,seed=123} begin{mcquestions} input{../path1/file1} input{../path2/file2} end{mcquestions} } Have error compilation used this mode.

– Fabio Lima
2 hours ago







By my file foreach i in {1,...,10}{ newpage setkeys{mcexam.sty}{version=i,seed=123} begin{mcquestions} input{../path1/file1} input{../path2/file2} end{mcquestions} } Have error compilation used this mode.

– Fabio Lima
2 hours ago















Your given code in your question compiles without problems with current MiKTeX 2.9 ... Can you please add the complete error message you get and make sure the given code in your questions results in your error please.

– Kurt
2 hours ago





Your given code in your question compiles without problems with current MiKTeX 2.9 ... Can you please add the complete error message you get and make sure the given code in your questions results in your error please.

– Kurt
2 hours ago










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482307%2fpackage-mcexam-random-question-from-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482307%2fpackage-mcexam-random-question-from-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...