From ea65cf2914cf41b90e46a88ce76d1efc61b87865 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Wed, 10 Jun 2020 23:38:32 +0200 Subject: Prepare for compilation of final test. --- misc/randomize-test.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'misc') diff --git a/misc/randomize-test.pl b/misc/randomize-test.pl index e569adb..42ff144 100755 --- a/misc/randomize-test.pl +++ b/misc/randomize-test.pl @@ -22,6 +22,9 @@ my @qvars = (); # Array of question variants # Each entry is an arrayref of indexes in the questions array +my $commonseed = $opts{N} // ""; +my $seed = $opts{n} // ""; + ### READ INPUT FILE if ( 1 ) { ## Keep following variables local @@ -34,6 +37,9 @@ my $listref = \@preamble; my $varid; LINELOOP: while ($_ = <>) { + if ( $_ =~ m/^\\def\\seedval\{.*\}$/ ) { + $_ = "\\def\\seedval\{$seed\}\n"; + } if ( $_ =~ m/\\begin\{qcm\}/ ) { die "wrong placement" unless $in_preamble; die "bad format" unless $_ eq "\\begin\{qcm\}\n"; @@ -98,8 +104,6 @@ while ($_ = <>) { ### RANDOMIZE -my $commonseed = $opts{N} // ""; -my $seed = $opts{n} // ""; my $nbqn = $opts{c} // int((scalar(@qvars)+1)/2); my @questab = (); -- cgit v1.2.3