Skip to content

Commit 4187f9a

Browse files
committed
Deprecate some more macros and set a warning if using.
Include the rest of the Union macros in the deprecate and move the PGnumericevaluators out of deprecate because every problem loads it. In addition show a warning to instructors if a problem is using a deprecated macro.
1 parent 1569db9 commit 4187f9a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/PGloadfiles.pm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ package PGloadfiles;
5959
use strict;
6060
#use Encode(qw(encode decode));
6161
use Exporter;
62+
6263
use PGcore;
6364
use WeBWorK::PG::Translator;
6465
use WeBWorK::PG::IO;
@@ -123,7 +124,6 @@ sub loadMacros {
123124
# At this point the directories have been defined from %envir and we can define
124125
# the directories for this file
125126
###############################################################################
126-
127127
while (@files) {
128128
$fileName = shift @files;
129129

@@ -151,6 +151,12 @@ sub loadMacros {
151151
unless ($macro_file_loaded) {
152152
warn "loadMacros: loading macro file $fileName" if $debugON;
153153
my $filePath = $self->findMacroFile($fileName);
154+
my @dirs = split(/\//, $filePath);
155+
warn "This problem uses the deprecated macro $filePath. It will continue to work but this macro "
156+
. 'will be removed in a future version. This problem should be updated to remove this macro '
157+
. 'to work.'
158+
if $dirs[ $#dirs - 1 ] eq 'deprecated' && $self->{envir}{isInstructor};
159+
154160
#### (check for renamed files here?) ####
155161
warn "loadMacros: look for $fileName at |$filePath|" if $debugON;
156162
if ($filePath) {

0 commit comments

Comments
 (0)