summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2020-06-10 23:38:32 +0200
committerDavid A. Madore <david+git@madore.org>2020-06-10 23:38:32 +0200
commitea65cf2914cf41b90e46a88ce76d1efc61b87865 (patch)
tree837988187f10ea9d0a033f2dd35165e3e1d8a18e /misc
parentd59d4b9d5ddff6da7d2cfd91b0056bdbcaa4479f (diff)
downloadinf105-ea65cf2914cf41b90e46a88ce76d1efc61b87865.tar.gz
inf105-ea65cf2914cf41b90e46a88ce76d1efc61b87865.tar.bz2
inf105-ea65cf2914cf41b90e46a88ce76d1efc61b87865.zip
Prepare for compilation of final test.exam-20200612
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/randomize-test.pl8
1 files changed, 6 insertions, 2 deletions
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 = ();