Can you help me to modify automultiplechoice.sty in order to be able to use numquestions=0 (0 questions selected)?

Added by Miguel J Ruiz Benítez almost 2 years ago

Hi,

I am trying to make numquestions=0 work in order not to select questions from a certain group, for certain students (by adding columns indicating the number of questions to select of a group in the students.csv file - nominative exams).

I can guess that I have to modify

\newcommand{\copygroupfrom}[4][0]{ %
  \AMCgrouploop@prep{#1}{#2}{#4}%
  {\loop%
    \AMCgrouploop@next{#2}%
    \AMC@prepare@element{#3}%
    \global\csname #3@\romannumeral\AMCtok@k\endcsname=\csname #2@\romannumeral\AMCtok@ik\endcsname%
  \ifnum\AMCtok@size>\z@\repeat}%

And maybe AMCgrouploop@prep, \AMCgrouploop@next \AMC@prepare@element in cascade, but my knowledge of LaTeX and the logic of automultiplechoice.sty does not allow me to make much progress.

I would be grateful for a starting point to achieve the intended modification.

Thanks, Miguel


Replies (2)

RE: Can you help me to modify automultiplechoice.sty in order to be able to use numquestions=0 (0 questions selected)? - Added by Miguel J Ruiz Benítez almost 2 years ago

My apologies

As usual, the answer appears shortly after posting. Just two lines addition:

file: plain.pm

if ( $group->{numquestions} ne "0") { # LINE ADDED
$t .= "\\insertgroup";
$t .= "[" . $group->{numquestions} . "]" if ( $group->{numquestions} );
$t .= "{" . $self->group_name($group) . "}";
for my $q ( grep { $_->{last} } ( @{ $group->{questions} } ) ) {
$t .= "\n" . $self->format_question($q);
}
} # LINE ADDED

Again, sorry!

(1-2/2)