From 33e9334931193062d98179a27fa034f254c2e1dc Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Thu, 18 Dec 2025 20:08:56 -0600 Subject: [PATCH] Remove everything CAPA. The CAPA problems have now been removed from the Contrib section of the OPL (see https://github.com/openwebwork/webwork-open-problem-library/pull/1277). So this is not needed anymore. Note that the `courses.dist/modelCourse/templates/setDemo/prob0837.pg` problem is already unused (it is not in the `setDemo.def` file). --- conf/defaults.config | 31 ++------- conf/localOverrides.conf.dist | 5 +- .../modelCourse/templates/capaLibrary | 1 - .../modelCourse/templates/setDemo/prob0837.pg | 64 ------------------- htdocs/show-source.cgi | 10 +-- lib/HardcopyRenderedProblem.pm | 2 +- lib/WeBWorK/ContentGenerator/Hardcopy.pm | 2 +- lib/WeBWorK/Utils/Instructor.pm | 5 +- lib/WeBWorK/Utils/Rendering.pm | 1 - 9 files changed, 15 insertions(+), 106 deletions(-) delete mode 120000 courses.dist/modelCourse/templates/capaLibrary delete mode 100644 courses.dist/modelCourse/templates/setDemo/prob0837.pg diff --git a/conf/defaults.config b/conf/defaults.config index 581e66c3f1..b015754b1c 100644 --- a/conf/defaults.config +++ b/conf/defaults.config @@ -451,7 +451,6 @@ $courseDirs{mailmerge} = "$courseDirs{DATA}/mailmerge"; # course links that are regulated by webwork2 $courseLinks{Library} = [ $problemLibrary{root}, "$courseDirs{templates}/Library" ]; $courseLinks{Contrib} = [ $contribLibrary{root}, "$courseDirs{templates}/Contrib" ]; -$courseLinks{capaLibrary} = [ "$contribLibrary{root}/CAPA", "$courseDirs{templates}/capaLibrary" ]; $courseLinks{Student_Orientation} = [ "$webworkDirs{assets}/pg/Student_Orientation", "$courseDirs{templates}/Student_Orientation" ]; ################################################################################ @@ -567,12 +566,10 @@ $uneditableCourseFiles = [ # activated below gives access to all the directories in the National # Problem Library. # -$courseFiles{problibs} = { - Library => "OPL Directory", - Contrib => "Contrib", # remember to create link from Contrib to Contrib - # library directory - capaLibrary => "CAPA", # remember to create link from capaLibrary to CAPA - # in contrib +$courseFiles{problibs} = { + Library => "OPL Directory", + Contrib => "Contrib", # remember to create link from Contrib to Contrib + # library directory }; ################################################################################ @@ -1154,7 +1151,6 @@ $pg{directories}{macrosPath} = [ $courseDirs{macros}, $pg{directories}{macros}, "$pg{directories}{macros}/answers", - "$pg{directories}{macros}/capa", "$pg{directories}{macros}/contexts", "$pg{directories}{macros}/core", "$pg{directories}{macros}/graph", @@ -1204,25 +1200,6 @@ $pg{specialPGEnvironmentVars}{latexImageSVGMethod} = "dvisvgm"; # convert file.ext1 file.ext2 $pg{specialPGEnvironmentVars}{latexImageConvertOptions} = {input => {density => 300}, output => {quality => 100}}; - # set the flags immediately above in the $pg{options} section above -- not here. - -# Locations of CAPA resources. (Only necessary if you need to use converted CAPA -# problems.) -################################################################################ -# "Special" PG environment variables. (Stuff that doesn't fit in anywhere else.) -################################################################################ - - $pg{specialPGEnvironmentVars}{CAPA_Tools} = "$courseDirs{templates}/Contrib/CAPA/macros/CAPA_Tools/", - $pg{specialPGEnvironmentVars}{CAPA_MCTools} = "$courseDirs{templates}/Contrib/CAPA/macros/CAPA_MCTools/", - $pg{specialPGEnvironmentVars}{CAPA_GraphicsDirectory} = "$courseDirs{templates}/Contrib/CAPA/CAPA_Graphics/", - $pg{specialPGEnvironmentVars}{CAPA_Graphics_URL} = "$webworkURLs{htdocs}/CAPA_Graphics/", - - push @{$pg{directories}{macrosPath}}, - "$courseDirs{templates}/Contrib/CAPA/macros/CAPA_Tools", - "$courseDirs{templates}/Contrib/CAPA/macros/CAPA_MCTools"; - - # The link Contrib in the course templates directory should point to ../webwork-open-problem-library/Contrib - # The link webwork2/htdocs/CAPA_Graphics should point to ../webwork-open-problem-library/Contrib/CAPA/macros/CAPA_graphics # Size in pixels of dynamically-generated images, i.e. graphs. $pg{specialPGEnvironmentVars}{onTheFlyImageSize} = 400, diff --git a/conf/localOverrides.conf.dist b/conf/localOverrides.conf.dist index f8c90710d9..f00f85024e 100644 --- a/conf/localOverrides.conf.dist +++ b/conf/localOverrides.conf.dist @@ -183,9 +183,8 @@ $mail{feedbackRecipients} = [ # Problem Library. #$courseFiles{problibs} = { - #Library => "OPL Directory", - #capaLibrary => "CAPA", - #Contrib => "Contrib", + #Library => "OPL Directory", + #Contrib => "Contrib", # the following are not really needed but you can # create links to your own private libraries this way. #rochesterLibrary => "Rochester", diff --git a/courses.dist/modelCourse/templates/capaLibrary b/courses.dist/modelCourse/templates/capaLibrary deleted file mode 120000 index 4678d8df5c..0000000000 --- a/courses.dist/modelCourse/templates/capaLibrary +++ /dev/null @@ -1 +0,0 @@ -../../../libraries/webwork-open-problem-library/Contrib/CAPA \ No newline at end of file diff --git a/courses.dist/modelCourse/templates/setDemo/prob0837.pg b/courses.dist/modelCourse/templates/setDemo/prob0837.pg deleted file mode 100644 index bd39f44c66..0000000000 --- a/courses.dist/modelCourse/templates/setDemo/prob0837.pg +++ /dev/null @@ -1,64 +0,0 @@ -DOCUMENT(); - -loadMacros( "PGbasicmacros.pl", - "PGauxiliaryFunctions.pl", - "PGchoicemacros.pl", - "PGanswermacros.pl", - "PGgraphmacros.pl", - "PG_CAPAmacros.pl" -); - -# machine translated from CAPA. -# This is probaly not a good model for elegant PG code. -## ************************************** -## -## Projectile motion. -## By F. Wolfs, WOLFS@NSRL31.NSRL.Rochester.edu -## No unauthorized commercial use -## Imported Files -## ${CAPA_Tools}Problem -## ${CAPA_GraphicsDirectory}Gtype08/prob37.eps -## Values needing defined: -## prob_val (number, e.g. /LET prob_val=1) -## prob_try (number, e.g. /LET prob_try=5) -## -## Last modified 07/08/97 -## by: Patrick D. Freivald, patrick@freivald.org -## -## ************************************** -## -$L = random( 2.0 , 10.0 , 0.2 ) ; -$h = random( 0.5 , 0.5 * $L , 0.1 ) ; -$Theta = random( 35.0 , 60.0 , 1.0 ) ; -$v0_sq = $smallg * $L / ( 2.0 * cos( $Theta * $degrad ) * cos( $Theta * $degrad ) * ( tan( $Theta * $degrad ) - $h / $L ) ) ; -$v0 = pow( $v0_sq , 0.5 ) ; -## -CAPA_import( " ${CAPA_Tools}Problem " ); -TEXT(CAPA_EV (<<'END_OF_TEXT')); -A basketball player throws the ball at a \{ spf( $Theta , "%0.0f" ) \}\{ $deg_u \} angle above the horizontal to a hoop which is located a horizontal distance \{ CAPA_tex( '/*L/*' , 'L' ) \} = \{ spf( $L , "%0.1f" ) \} \{ $m_u \} from the point of release and at a height \{ CAPA_tex( '/*h/*' , 'h' ) \} = \{ spf( $h , "%0.1f" ) \} \{ $m_u \} above it. What is the required speed if the basketball is to reach the hoop? -\{ CAPA_web( '' , '\noindent {\centerline{\epsfxsize = 2.4 in \epsffile{${CAPA_GraphicsDirectory}Gtype08/prob37.eps}}}' , '' ) \} -END_OF_TEXT - -## - -TEXT("$BR$BR",ans_rule(30),"$BR"); -ANS( CAPA_ans( $v0 , 'format' => "%0.2e" , 'sig' => '3 PLUS 13', 'reltol' => 1 , 'wgt' => $prob_val , 'tries' => $prob_try , 'unit' => 'm/s' ) ); -ENDDOCUMENT(); -##################### - -###Error: $smallg not defined in this file -###Error: $degrad not defined in this file -###Error: $degrad not defined in this file -###Error: $degrad not defined in this file -###Error: $deg_u not defined in this file -###Error: $m_u not defined in this file -###Error: $m_u not defined in this file -###Error: $prob_val not defined in this file -###Error: $prob_try not defined in this file - -##################### - - -################################################# -## Processing time = 0 secs ( 0.56 usr 0.00 sys = 0.56 cpu) -################################################# diff --git a/htdocs/show-source.cgi b/htdocs/show-source.cgi index 8cf298e894..af3181a2ad 100755 --- a/htdocs/show-source.cgi +++ b/htdocs/show-source.cgi @@ -14,10 +14,12 @@ my $filedir = $file =~ s!/[^/]+$!!r; $file =~ s!.*/!!; my @PGdirs = ( - "../templates$filedir", '../templates/macros', "$root/pg/macros", "$root/pg/macros/answers", - "$root/pg/macros/capa", "$root/pg/macros/contexts", "$root/pg/macros/core", "$root/pg/macros/deprecated", - "$root/pg/macros/graph", "$root/pg/macros/math", "$root/pg/macros/misc", "$root/pg/macros/parsers", - "$root/pg/macros/ui", + "../templates$filedir", '../templates/macros', + "$root/pg/macros", "$root/pg/macros/answers", + "$root/pg/macros/contexts", "$root/pg/macros/core", + "$root/pg/macros/deprecated", "$root/pg/macros/graph", + "$root/pg/macros/math", "$root/pg/macros/misc", + "$root/pg/macros/parsers", "$root/pg/macros/ui", ); for my $dir (@PGdirs) { ShowSource("$dir/$file") if (-e "$dir/$file") } diff --git a/lib/HardcopyRenderedProblem.pm b/lib/HardcopyRenderedProblem.pm index bb44f10a06..4f1fcb654b 100644 --- a/lib/HardcopyRenderedProblem.pm +++ b/lib/HardcopyRenderedProblem.pm @@ -120,7 +120,7 @@ sub generate_hardcopy_tex { if $@; } my $pgAssetsTex_dir = path($ce->{pg}{directories}{assetsTex}); - for (qw{pg.sty PGML.tex CAPA.tex}) { + for (qw{pg.sty PGML.tex}) { eval { $pgAssetsTex_dir->child($_)->copy_to($working_dir) }; push(@$errors, qq{Failed to copy "$ce->{pg}{directories}{assetsTex}/$_" into directory "$working_dir": $@}) if $@; diff --git a/lib/WeBWorK/ContentGenerator/Hardcopy.pm b/lib/WeBWorK/ContentGenerator/Hardcopy.pm index ccca8abf3f..7e7809f389 100644 --- a/lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ b/lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -674,7 +674,7 @@ sub generate_hardcopy_tex ($c, $temp_dir_path, $final_file_basename) { ); } } - for (qw{pg.sty PGML.tex CAPA.tex}) { + for (qw{pg.sty PGML.tex}) { eval { Mojo::File->new("$ce->{pg}{directories}{assetsTex}/$_")->copy_to($bundle_path) }; if ($@) { $c->add_error( diff --git a/lib/WeBWorK/Utils/Instructor.pm b/lib/WeBWorK/Utils/Instructor.pm index 62aa3eb942..8e4716673e 100644 --- a/lib/WeBWorK/Utils/Instructor.pm +++ b/lib/WeBWorK/Utils/Instructor.pm @@ -554,10 +554,7 @@ sub getDefList { find( { wanted => sub { - if ($File::Find::dir =~ /^$topdir\/Library/ - || $File::Find::dir =~ /^$topdir\/Contrib/ - || $File::Find::dir =~ /^$topdir\/capaLibrary/) - { + if ($File::Find::dir =~ /^$topdir\/Library/ || $File::Find::dir =~ /^$topdir\/Contrib/) { $File::Find::prune = 1; return; } diff --git a/lib/WeBWorK/Utils/Rendering.pm b/lib/WeBWorK/Utils/Rendering.pm index c87be8a842..b1cd6f3787 100644 --- a/lib/WeBWorK/Utils/Rendering.pm +++ b/lib/WeBWorK/Utils/Rendering.pm @@ -192,7 +192,6 @@ sub constructPGOptions ($ce, $user, $set, $problem, $psvn, $formFields, $transla tmpl => $ce->{courseDirs}{templates}, # ditto }; - # Variables for interpreting capa problems and other things to be seen in a pg file. $options{specialPGEnvironmentVars} = $ce->{pg}{specialPGEnvironmentVars}; return %options;