Skip to content

Commit

Permalink
automatic merge by nix-conf
Browse files Browse the repository at this point in the history
Merged branches:
- amc-my-patches
- ucspi-tcp-ipv6-support
- gnuplot-info
- nixos-rebuild-dont-reexec
- fix-typst-lsp
  • Loading branch information
nix-conf committed Aug 21, 2024
6 parents c374d94 + a5ebe44 + 9da4ebf + a40a1dc + 454c080 + b1020a1 commit 19a9fbd
Show file tree
Hide file tree
Showing 11 changed files with 699 additions and 497 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From 20c120c57a65eb0ab9203cb347bb78b664b80974 Mon Sep 17 00:00:00 2001
From: Michal Sojka <[email protected]>
Date: Sun, 21 Jan 2018 23:13:00 +0100
Subject: [PATCH 1/2] AMC-TXT: New global option ShowGroupText

When this option is enabled (default), the text after group start/end
marks i.e., after "*(" or "*)", is shown in the printed tests. This is
the same behavior as before this commit.

By setting this option to 0, no group marks are generated. This is
useful if groups are used merely as containers for similar questions
and have numquestions=1 option. In this case, it makes little sense to
add group text before and after every question.
---
AMC-perl/AMC/Filter/plain.pm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/AMC-perl/AMC/Filter/plain.pm b/AMC-perl/AMC/Filter/plain.pm
index 5970266d..e0f7d4be 100644
--- a/AMC-perl/AMC/Filter/plain.pm
+++ b/AMC-perl/AMC/Filter/plain.pm
@@ -63,6 +63,7 @@ sub new {
TitleWidth
Pages
RandomSeed
+ ShowGroupText
PreAssociation PreAssociationKey PreAssociationName
/
];
@@ -75,6 +76,7 @@ sub new {
CompleteMulti SeparateAnswerSheet AutoMarks
Arabic
ManualDuplex SingleSided
+ ShowGroupText
/
];

@@ -119,6 +121,7 @@ sub new {
namefieldlinespace => '.5em',
titlewidth => ".47\\linewidth",
randomseed => "1527384",
+ showgrouptext => 1,
lang => '',
code => 0,
'latex-preambule' => '',
@@ -487,7 +490,7 @@ sub read_file {
if (/^\s*\*([\(\)])(?:\[([^]]*)\])?\s*(.*)/) {
my $action = $1;
my $options = $2;
- my $text = $3;
+ my $text=$self->{'options'}->{'showgrouptext'} ? $3 : "";
debug "Group A=" . printable($action) . " O=" . printable($options);
my %oo = $self->read_options($options);
if ( $action eq '(' ) {
--
2.34.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
From bed560fcf352343d75f8a4c719d2710c60420672 Mon Sep 17 00:00:00 2001
From: Michal Sojka <[email protected]>
Date: Fri, 25 Jan 2019 18:26:26 +0100
Subject: [PATCH 2/2] Test 8-page alignment

---
AMC-buildpdf.cc | 2 ++
AMC-perl/AMC/Annotate.pm | 11 +++++++++++
2 files changed, 13 insertions(+)

diff --git a/AMC-buildpdf.cc b/AMC-buildpdf.cc
index 73dea3ca..a4549e57 100644
--- a/AMC-buildpdf.cc
+++ b/AMC-buildpdf.cc
@@ -89,6 +89,8 @@ int main(int argc, char** argv )
processing_error = PDF.load_pdf(command + 9);
} else if(sscanf(command, "page pdf %ld", &i) == 1) {
processing_error = PDF.new_page_from_pdf(i);
+ } else if(strcmp(command, "page empty") == 0) {
+ processing_error = PDF.next_page();
} else if(strcmp(command, "matrix identity") == 0) {
PDF.identity_matrix();
} else if(sscanf(command, "matrix %lf %lf %lf %lf %lf %lf",
diff --git a/AMC-perl/AMC/Annotate.pm b/AMC-perl/AMC/Annotate.pm
index 6e15af59..cbb49f37 100644
--- a/AMC-perl/AMC/Annotate.pm
+++ b/AMC-perl/AMC/Annotate.pm
@@ -1036,6 +1036,14 @@ sub student_draw_page {
}
}

+sub draw_empty_page {
+ my ($self,$page)=@_;
+
+ debug "Drawing empty page #$page";
+
+ $self->command("page empty");
+}
+
# process a student copy

sub process_student {
@@ -1077,6 +1085,9 @@ sub process_student {
for my $page ( $self->student_pages($student) ) {
$self->student_draw_page( $student, $page );
}
+ for (my $i = $self->student_pages($student); $i % 8 != 0; $i++) {
+ $self->draw_empty_page($i+1);
+ }

$self->{data}->end_transaction('aOST');
}
--
2.34.1

5 changes: 5 additions & 0 deletions pkgs/applications/misc/auto-multiple-choice/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ stdenv.mkDerivation (finalAttrs: rec {
"GCC_PP=${stdenv.cc.targetPrefix}c++"
];

patches = [
./0001-AMC-TXT-New-global-option-ShowGroupText.patch
./0002-Test-8-page-alignment.patch
];

preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
Expand Down
Loading

0 comments on commit 19a9fbd

Please sign in to comment.