From eb851a7d0f489e9fff46cfc9a8ee16a794f18091 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Tue, 3 Dec 2019 09:51:43 +0100 Subject: [PATCH] Fix English classes --- count-points.pl | 50 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/count-points.pl b/count-points.pl index b8af460..8307df9 100755 --- a/count-points.pl +++ b/count-points.pl @@ -163,7 +163,9 @@ sub check_if_the_right_task { } } - return 0 if $task_id =~ m{^TaskE} and $student_id != 148603 and $student_id != 148335 and $student_id != 148521 and $student_id != 148567; + return 0 if $task_id =~ m{^TaskE} and not is_estudent($student_id); + + return 0 if $task_id =~ m{^TaskA} and is_estudent($student_id); return 1; } @@ -231,3 +233,49 @@ sub get_override_key { return $id.'+'.$task; } + +sub is_estudent { + my ($id) = @_; + + my $suffix = substr($id, 1); + + my %estudents = map { $_ => 1 } split/\n/,<<'END_OF_NUMBERS'; +16136 +30291 +30686 +32746 +32753 +32754 +32757 +32759 +32778 +32813 +32837 +34595 +34596 +34598 +34599 +34603 +34604 +34608 +34650 +34654 +39546 +40549 +42335 +42611 +42612 +42613 +42614 +50169 +50711 +52484 +84146 +END_OF_NUMBERS + + if ($estudents{$suffix}) { + return 1; + } + + return 0; +}