summaryrefslogtreecommitdiffstats
path: root/misc/randomize-test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'misc/randomize-test.pl')
-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 = ();