Skip to content

Commit 083fac3

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 b35f650 commit 083fac3

File tree

7 files changed

+6
-1
lines changed

7 files changed

+6
-1
lines changed

lib/PGloadfiles.pm

Lines changed: 6 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,11 @@ 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.' if $dirs[$#dirs-1] eq 'deprecated' && $self->{envir}{isInstructor};
152+
148153
#### (check for renamed files here?) ####
149154
warn "loadMacros: look for $fileName at |$filePath|" if $debugON;
150155
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)