Commit 62785221 authored by Jojo Boulix's avatar Jojo Boulix
Browse files

New \AMCreTick command, and \AMCOpen retick option, to tick boxes while annotating.

parent d01bc376
Pipeline #441461492 passed with stages
in 19 minutes and 30 seconds
......@@ -193,6 +193,9 @@ while (<SRC>) {
if (/\\dontannotate\{(.*)\}/) {
add_flag( $1, BOX_FLAGS_DONTANNOTATE );
}
if (/\\retick\{(.*)\}/) {
add_flag( $1, BOX_FLAGS_RETICK );
}
if (/\\association\{([0-9]+)\}\{(.*)\}\{(.*)\}/) {
my $student = $1;
my $id = $2;
......
......@@ -813,7 +813,7 @@ sub draw_symbol {
# when the subject background is used instead of the scan, darken
# boxes that have been ticked by the student
if ( $tick && $cochee ) {
if ( ( $tick || $box->{flags} & BOX_FLAGS_RETICK ) && $cochee ) {
debug "Tick.";
$self->set_color('black');
$self->command(
......
......@@ -149,6 +149,7 @@ use Exporter qw(import);
use constant {
BOX_FLAGS_DONTSCAN => 0x1,
BOX_FLAGS_DONTANNOTATE => 0x2,
BOX_FLAGS_RETICK => 0x4,
BOX_FLAGS_SHAPE_OVAL => 0x10,
ZONE_FLAGS_ID => 0x1,
......@@ -165,10 +166,10 @@ use constant {
};
our @EXPORT_OK =
qw(BOX_FLAGS_DONTSCAN BOX_FLAGS_DONTANNOTATE BOX_FLAGS_SHAPE_OVAL BOX_ROLE_ANSWER BOX_ROLE_QUESTIONONLY BOX_ROLE_SCORE BOX_ROLE_SCOREQUESTION BOX_ROLE_QUESTIONTEXT BOX_ROLE_ANSWERTEXT ZONE_FLAGS_ID);
qw(BOX_FLAGS_DONTSCAN BOX_FLAGS_DONTANNOTATE BOX_FLAGS_RETICK BOX_FLAGS_SHAPE_OVAL BOX_ROLE_ANSWER BOX_ROLE_QUESTIONONLY BOX_ROLE_SCORE BOX_ROLE_SCOREQUESTION BOX_ROLE_QUESTIONTEXT BOX_ROLE_ANSWERTEXT ZONE_FLAGS_ID);
our %EXPORT_TAGS = (
flags => [
qw/BOX_FLAGS_DONTSCAN BOX_FLAGS_DONTANNOTATE BOX_FLAGS_SHAPE_OVAL BOX_ROLE_ANSWER BOX_ROLE_QUESTIONONLY BOX_ROLE_SCORE BOX_ROLE_SCOREQUESTION BOX_ROLE_QUESTIONTEXT BOX_ROLE_ANSWERTEXT ZONE_FLAGS_ID/
qw/BOX_FLAGS_DONTSCAN BOX_FLAGS_DONTANNOTATE BOX_FLAGS_RETICK BOX_FLAGS_SHAPE_OVAL BOX_ROLE_ANSWER BOX_ROLE_QUESTIONONLY BOX_ROLE_SCORE BOX_ROLE_SCOREQUESTION BOX_ROLE_QUESTIONTEXT BOX_ROLE_ANSWERTEXT ZONE_FLAGS_ID/
],
);
......
......@@ -1857,14 +1857,17 @@ Three digits and two letters:\insertgroup{mixed}.
% \end{macrocode}\end{macro}\end{macro}
%
% \begin{macro}{\AMCdontScan}\begin{macro}{\AMCdontAnnotate}
% The commands |\AMCdontScan| and |\AMCdontAnnotate| write
% \begin{macro}{\AMCreTick}
% The commands |\AMCdontScan|, |\AMCdontAnnotate| and |\AMCreTick| write
% into the |xy| file instructions related to the current question.
% \begin{macrocode}
\newcommand{\AMCdontScan}{\ifAMC@calibration\immediate\write\AMC@XYFILE{\string\dontscan{\the\AMCid@etud,\the\AMCid@quest}}\fi}
\newcommand{\AMCdontAnnotate}{\ifAMC@calibration\immediate\write\AMC@XYFILE{\string\dontannotate{\the\AMCid@etud,\the\AMCid@quest}}\fi}
\newcommand{\AMCreTick}{\ifAMC@calibration\immediate\write\AMC@XYFILE{\string\retick{\the\AMCid@etud,\the\AMCid@quest}}\fi}
%% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\AMC@tracechar}
% The macro
......@@ -4577,9 +4580,10 @@ Three digits and two letters:\insertgroup{mixed}.
\define@key{AMCOpen}{lineuptext}{\def\AMCopen@lineuptext{#1}}
\define@boolkey{AMCOpen}{dots}[true]{}
\define@boolkey{AMCOpen}{scan}[true]{}
\define@boolkey{AMCOpen}{retick}[true]{}
\define@boolkey{AMCOpen}{annotate}[false]{}
\define@boolkey{AMCOpen}{lineup}[false]{}
\setkeys{AMCOpen}{dots,scan,annotate,lineup,contentcommand}
\setkeys{AMCOpen}{dots,scan,retick,annotate,lineup,contentcommand}
\newcommand\AMCopenOpts[1]{\setkeys{AMCOpen}{#1}}
% \end{macrocode}
%
......@@ -4631,6 +4635,7 @@ Three digits and two letters:\insertgroup{mixed}.
\fi%
#2%
\ifKV@AMCOpen@scan\else\AMCdontScan\fi%
\ifKV@AMCOpen@retick\AMCreTick\fi%
\ifKV@AMCOpen@annotate\else\AMCdontAnnotate\fi%
\end{choicescustom}%
\ifx\@empty\AMCotextReserved\@empty%
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment