Skip to content

Commit f0a28af

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 e35ae29 commit f0a28af

File tree

7 files changed

+7
-1
lines changed

7 files changed

+7
-1
lines changed

lib/PGloadfiles.pm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ package PGloadfiles;
5353
use strict;
5454
#use Encode(qw(encode decode));
5555
use Exporter;
56+
5657
use PGcore;
5758
use WeBWorK::PG::Translator;
5859
use WeBWorK::PG::IO;
@@ -117,7 +118,6 @@ sub loadMacros {
117118
# At this point the directories have been defined from %envir and we can define
118119
# the directories for this file
119120
###############################################################################
120-
121121
while (@files) {
122122
$fileName = shift @files;
123123

@@ -145,6 +145,12 @@ sub loadMacros {
145145
unless ($macro_file_loaded) {
146146
warn "loadMacros: loading macro file $fileName" if $debugON;
147147
my $filePath = $self->findMacroFile($fileName);
148+
my @dirs = split(/\//, $filePath);
149+
warn "This problem uses the deprecated macro $filePath. It will continue to work but this macro "
150+
. 'will be removed in a future version. This problem should be updated to remove this macro '
151+
. 'to work.'
152+
if $dirs[ $#dirs - 1 ] eq 'deprecated' && $self->{envir}{isInstructor};
153+
148154
#### (check for renamed files here?) ####
149155
warn "loadMacros: look for $fileName at |$filePath|" if $debugON;
150156
if ($filePath) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)