From df00b1c519df4c6d409fbd4d350af78c26a291b0 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Tue, 11 Aug 2026 21:19:47 -0500 Subject: [PATCH 1/2] Remove the `images` display mode and related code. This updates webwork2 for the corresponding change to PG. The `images` display mode has been removed, and so remove the option to select it and the `refreshMath2img` translation option that is no longer used. Perhaps the "List of display modes available to students" and "The default display mode" options should even be removed from the course configuration page. The only real option is now "MathJax", so why list these options? Furthermore, the `displayMode` URL parameter should probably be removed. Note that the `equation_display` route that no one knows about and that can only be accessed by entering the URL `https://yourserver.edu/webwork2/courseID/equation_display` in the browser has been removed since it depends on the `ImageGenerator` package which was removed on the PG side. All of the equation cache variables have been removed from the course environment, since those are no longer used. The `remove_stale_images` script is no longer needed, and was deleted. The non-native `depths` table that was only used for these images has been removed. Note that the `depths` table will need to be manually deleted from the database. Although it won't hurt if it is still there. It will quietly sit there unused if it is not deleted. --- bin/remove_stale_images | 278 ------------------ bin/upgrade-database-to-utf8mb4.pl | 2 +- conf/defaults.config | 48 +-- conf/localOverrides.conf.dist | 18 +- lib/WeBWorK/ConfigValues.pm | 13 +- .../ContentGenerator/EquationDisplay.pm | 48 --- lib/WeBWorK/ContentGenerator/GatewayQuiz.pm | 1 - .../Instructor/ProblemGrader.pm | 1 - .../Instructor/ShowAnswers.pm | 1 - lib/WeBWorK/ContentGenerator/Problem.pm | 1 - lib/WeBWorK/ContentGenerator/ShowMeAnother.pm | 3 - lib/WeBWorK/DB/Layout.pm | 6 - lib/WeBWorK/DB/Record/Depths.pm | 20 -- lib/WeBWorK/Utils/Rendering.pm | 1 - lib/WeBWorK/Utils/Routes.pm | 7 - lib/WebworkWebservice/RenderProblem.pm | 1 - 16 files changed, 23 insertions(+), 426 deletions(-) delete mode 100755 bin/remove_stale_images delete mode 100644 lib/WeBWorK/ContentGenerator/EquationDisplay.pm delete mode 100644 lib/WeBWorK/DB/Record/Depths.pm diff --git a/bin/remove_stale_images b/bin/remove_stale_images deleted file mode 100755 index f88e4cc5b8..0000000000 --- a/bin/remove_stale_images +++ /dev/null @@ -1,278 +0,0 @@ -#!/usr/bin/env perl - -=head1 NAME - -remove_stale_images - remove old dvipng images - -=head1 SYNOPSIS - - remove_stale_images ARGUMENTS - -=head1 DESCRIPTION - -Remove old dvipng images. - -=head1 ARGUMENTS - -=over - -Arguments are optional. - - --help prints the usage message - --delete delete selected images - --remove same as --delete - --report just report information about image dates - - --days=E final date for images considered is E days ago - E can be a decimal. E defaults to 7 days ago - for deleting, and now for reporting - --access-dates use last-accessed date, the default - --modify-dates use last-modified date (probably the creation date) - - --from=D start deleting D days ago; D can be a decimal - defaulting at the beginning of time - - -You can also just specify E at the end of the command line. - -To get a status report on all of your images, use - - remove_stale_images - -To remove all which have not been accessed in the past 10 days, use - - remove_stale_images --delete --days=10 - -=back - -=cut - -use strict; -use warnings; -use Getopt::Long; -use Pod::Usage; -use File::Find; -use DBI; - -BEGIN { - use Mojo::File qw(curfile); - use Env qw(WEBWORK_ROOT); - - $WEBWORK_ROOT = curfile->dirname->dirname; -} - -use lib "$ENV{WEBWORK_ROOT}/lib"; - -use WeBWorK::CourseEnvironment; -use WeBWorK::Utils::Files qw(readFile); - -use constant ACCESSED => 8; -use constant MODIFIED => 9; - -my $now = time(); -my $which = ACCESSED; - -##### global variables to hold information from the find - -my $num_removed = 0; -my %kept = (); -my %days = (); -my %week = (); -my %depths = (); -my $grandtotal = 0; -my $depthConnection; - -##### get command-line options ##### - -my $start = $now; # way too big, but definitely before the beginning of the epoch -my $end = -1; -my $help = 0; -my $deloption = 0; -my $reportoption = 0; -my $modifydate = 0; -my $accessdate = 0; - -GetOptions( - 'from=s' => \$start, - 'days=s' => \$end, - 'delete|remove' => \$deloption, - 'report' => \$reportoption, - 'modify-dates' => \$modifydate, - 'access-dates' => \$accessdate, - 'help' => \$help -) or pod2usage(1); - -pod2usage(1) if $help; - -$reportoption = 1 if (not $deloption); - -if ($modifydate and $accessdate) { - print "You cannot specify using both access dates and modify dates\n"; - pod2usage(1); -} - -## now fix up type -my $type = $accessdate ? ACCESSED : MODIFIED; - -if (scalar(@ARGV) > 0) { - if (scalar(@ARGV) > 1) { - print "Too many arguments given\n"; - pod2usage(1); - } - $end = $ARGV[0]; -} - -$end = 7 if ($end == -1 and $deloption); - -if ($start <= $end) { - print "The start time must be greater than the end length\n"; - exit(); -} -## Fix up the start and end times - -$start = $now - 24 * 60 * 60 * $start; -$end = $now - 24 * 60 * 60 * $end; - -##### "wanted" function for find ##### - -sub wanted { - if (-f $File::Find::name and $File::Find::name =~ /\.png$/) { - my @stat = stat(_); - - if ($deloption) { - my $fullmd5 = $File::Find::name; - if (length($_) > (4 + 32)) { # this is an old style path - $fullmd5 = $_; - $fullmd5 =~ s/\.png$//; - } else { - $fullmd5 =~ s|.*/([^/]+)/([^/]+)$|$1$2|; - $fullmd5 =~ s/\.png$//; - } - if ($stat[$type] < $start or $stat[$type] > $end) { - $kept{$fullmd5} = ''; - if ($depthConnection) { # hold dvipng depths - my $fetchdepth = $depthConnection->selectall_arrayref(" - SELECT depth FROM depths WHERE md5=\"$fullmd5\""); - my $fetchdepthval = $fetchdepth->[0]->[0]; - $depths{$fullmd5} = $fetchdepthval if ($fetchdepthval); - } - } else { - my $result = unlink($File::Find::name); - if ($result) { - $num_removed++; - return (); - } else { - # If you don't have permissions to delete a file, you will probably - # mess up the permissions on the equation cache - die "Tried, but could not remove $File::Find::name\n"; - } - } - } - - if ($reportoption) { - return () if (not $deloption and ($stat[$type] < $start or $stat[$type] > $end)); - my $lapse = $now - $stat[$type]; - my $val = int(($lapse) / (60 * 60 * 24)); - $val = " " . $val if ($val < 10); - $val = " " . $val if ($val < 100); - if (defined($days{$val})) { $days{$val} += 1; } - else { $days{$val} = 1; } - $val = int($val / 7); - if (defined($week{$val})) { $week{$val} += 1; } - else { $week{$val} = 1; } - $grandtotal++; - } - - } -} - -##### reporting function ##### - -sub count_report { - my $j; - print "Days\n"; - for $j (sort { $a <=> $b } keys(%days)) { - print "$j $days{$j}\n"; - } - - print "\nWeeks\n"; - for $j (sort { $a <=> $b } keys(%week)) { - print " $j $week{$j}\n"; - } - - print "\nTotal: $grandtotal\n"; -} - -##### main function ##### - -# bring up a minimal course environment -my $ce = WeBWorK::CourseEnvironment->new({ webwork_dir => $ENV{WEBWORK_ROOT} }); - -my $dirHead = $ce->{webworkDirs}->{equationCache}; -my $cachePath = $ce->{webworkFiles}->{equationCacheDB}; -my $tmpdir = $ce->{webworkDirs}->{tmp}; -my $tmpfile = "$tmpdir/equationcache.tmp"; - -# Prepare to handle depths database table -my $alignType = $ce->{pg}->{displayModeOptions}->{images}->{dvipng_align}; -if ($alignType eq 'mysql' and $deloption) { - my $dbinfo = $ce->{pg}->{displayModeOptions}->{images}->{dvipng_depth_db}; - $depthConnection = - DBI->connect_cached($dbinfo->{dbsource}, $dbinfo->{user}, $dbinfo->{passwd}, - { PrintError => 0, RaiseError => 1 }, - ); - print "Could not make database connection for dvipng image depths.\n" unless defined $depthConnection; -} - -find({ wanted => \&wanted, follow_fast => 1 }, $dirHead); - -print "Removed $num_removed images.\n\n" if ($deloption); -count_report() if ($reportoption); - -# For depth database, empty it and insert only values for the images -# we kept. -my $ent; -if ($depthConnection) { # clean out database and put back in good values - $depthConnection->do("TRUNCATE depths"); - for my $ent (keys %depths) { - $depthConnection->do( - "INSERT INTO `depths` VALUES( - \"$ent\", \"$depths{$ent}\")" - ); - } -} - -## The rest is updating the equation cache if we deleted images and there is a cache -exit() unless ($deloption and $num_removed); -exit() unless ($cachePath); -print "Updating the equation cache\n"; -my ($perms, $uid, $groupID) = (stat $cachePath)[ 2, 4, 5 ]; #Get values from current cache file -my $cachevalues = readFile($cachePath); -my @cachelines = split "\n", $cachevalues; -for $ent (@cachelines) { - chomp($ent); - my $entmd5 = $ent; - $entmd5 =~ s/^(\S+)\s+(\S+)\s+.*$/$1$2/; - if (defined($kept{$entmd5})) { - $kept{$entmd5} = $ent; - } -} - -#print "Temp file $tmpfile\n"; -#print "Cache file had group $groupID and perms $perms\n"; -open(OUTF, ">$tmpfile") or die "Could not write to temp file $tmpfile"; -for $ent (keys %kept) { - if ($kept{$ent}) { - print OUTF $kept{$ent} . "\n"; - } else { - print "could not find $ent\n"; - } -} -close(OUTF); -rename($tmpfile, $cachePath); -# hopefully, either we are superuser and this works, or we are -# the web server in which case it wasn't needed -chmod $perms, $cachePath; -chown $uid, $groupID, $cachePath; - -1; diff --git a/bin/upgrade-database-to-utf8mb4.pl b/bin/upgrade-database-to-utf8mb4.pl index 9c1a1f9a25..fd4e7da0d2 100755 --- a/bin/upgrade-database-to-utf8mb4.pl +++ b/bin/upgrade-database-to-utf8mb4.pl @@ -19,7 +19,7 @@ =head1 SYNOPSIS be the defaults for webwork. This pass is not run by default. -n|--upgrade-non-native Upgrade the non-native tables - (locations, location_addresses, depths) + (locations, location_addresses, etc.) --no-backup Do not backup the database before making changes to the database. (Not recommended) -b|--backup-file [file] Filename for the database backup file. diff --git a/conf/defaults.config b/conf/defaults.config index 3f117cc694..e59e73da8d 100644 --- a/conf/defaults.config +++ b/conf/defaults.config @@ -321,10 +321,6 @@ $webworkURLs{htdocs} = "$webwork_htdocs_url"; $webworkDirs{htdocs_temp} = "$webworkDirs{htdocs}/tmp"; $webworkURLs{htdocs_temp} = "$webworkURLs{htdocs}/tmp"; -# Location of cached equation images. -$webworkDirs{equationCache} = "$webworkDirs{htdocs_temp}/equations"; -$webworkURLs{equationCache} = "$webworkURLs{htdocs_temp}/equations"; - # Location of theme templates. $webworkDirs{themes} = "$webworkDirs{htdocs}/themes"; @@ -460,13 +456,6 @@ $courseLinks{Student_Orientation} = # Location of this file. $webworkFiles{environment} = "$webworkDirs{conf}/defaults.conf"; -# Flat-file database used to protect against MD5 hash collisions. TeX equations -# are hashed to determine the name of the image file. There is a tiny chance of -# a collision between two TeX strings. This file allows for that. However, this -# is slow, so most people chose not to worry about it. Set this to "" if you -# don't want to use the equation cache file. -$webworkFiles{equationCacheDB} = ""; # "$webworkDirs{DATA}/equationcache"; - ################################################################################ # Hardcopy Theme ################################################################################ @@ -1027,18 +1016,17 @@ $caliper{enabled} = 0; ################################################################################ # List of enabled screen display modes. Comment out any modes you don't wish to -# make available for use. -# The first uncommented option is the default for instructors rendering problems -# in the homework sets editor. +# make available for use. The first uncommented option is the default for +# instructors rendering problems in the homework sets editor. $pg{displayModes} = [ - "MathJax", # render TeX math expressions on the client side using - # MathJax; we strongly recommend people install and use - # MathJax, and it is required if you want to use MathView - "images", # display math expressions as images generated by dvipng + "MathJax", # render TeX math expressions client side using MathJax. #"plainText", # display raw TeX for math expressions ]; +# Default display mode. Should be an uncommented item listed above. +$pg{options}{displayMode} = "MathJax"; + # List of additional display modes for the PG editor only. $pg{additionalPGEditorDisplayModes} = [ "tex", # display tex code for a rendered problem @@ -1075,9 +1063,6 @@ $options{PGCodeMirror} = 1; #### coloring of answer blanks and the numeric display of entered answers. ########################################################################################### -# Default display mode. Should be listed above (uncomment only one). -$pg{options}{displayMode} = "MathJax"; - # The default grader to use, if a problem doesn't specify. $pg{options}{grader} = "avg_problem_grader"; @@ -1116,23 +1101,6 @@ $pg{options}{showEvaluatedAnswers} = 1; # propagate to the main process. So this really should never be set to 0. $pg{options}{catchWarnings} = 1; -##### Settings for various display modes - -# "images" mode has several settings: -$pg{displayModeOptions}{images} = { - # Determines the method used to align images in output. Can be any valid value for the css vertical-align rule such - # as 'baseline' or 'middle'. - dvipng_align => 'baseline', - - # If dbsource is set to a nonempty value, then this database connection information will be used to store dvipng - # depths. It is assumed that the 'depths' table exists in the database. - dvipng_depth_db => { - dbsource => $database_dsn, - user => $database_username, - passwd => $database_password, - }, -}; - ##### Directories used by PG # The root of the PG directory tree (from pg_dir set in conf/webwork2.mojolicious.yml). @@ -1202,8 +1170,8 @@ $pg{specialPGEnvironmentVars}{convertFullWidthCharacters} = 0; # Strings to insert at the start and end of the body of a problem # (at beginproblem() and ENDDOCUMENT) in various modes. More display modes -# can be added if different behaviours are desired (e.g., HTML_dpng, -# HTML_asciimath, etc.). These parts are not used in the Library browser. +# can be added if different behaviours are desired. These parts are not used +# in the Library browser. $pg{specialPGEnvironmentVars}{problemPreamble} = { TeX => '', HTML => '' }; $pg{specialPGEnvironmentVars}{problemPostamble} = { TeX => '', HTML => '' }; diff --git a/conf/localOverrides.conf.dist b/conf/localOverrides.conf.dist index 8c72492d7c..d7dec903ab 100644 --- a/conf/localOverrides.conf.dist +++ b/conf/localOverrides.conf.dist @@ -273,20 +273,16 @@ $mail{feedbackRecipients} = [ # PG subsystem options ################################################################################ -# List of enabled display modes. Comment out any modes you don't wish to make -# available for use. -# The first uncommented option is the default for instructors rendering problems -# in the Library Browser and Set Detail page. +# List of enabled screen display modes. Comment out any modes you don't wish to +# make available for use. The first uncommented option is the default for +# instructors rendering problems in the homework sets editor. #$pg{displayModes} = [ - #"MathJax", # render TeX math expressions on the client side using MathJax - # we strongly recommend people install and use MathJax, and it is required if you want to use mathview - #"images", # display math expressions as images generated by dvipng - #"plainText", # display raw TeX for math expressions + #"MathJax", # render TeX math expressions client side using MathJax. + #"plainText", # display raw TeX for math expressions #]; - # Default display mode. Should be an uncommented item listed above. -#$pg{options}{displayMode} = "images"; +#$pg{options}{displayMode} = "plainText"; ################################################################################ # Adding to the macro file search path. (Check with entries in defaults.config before overriding) @@ -415,8 +411,6 @@ $mail{feedbackRecipients} = [ # To implement, uncomment the following 6 lines: #$webworkDirs{htdocs_temp} = '/var/www/html/wwtmp'; #$webworkURLs{htdocs_temp} = '/wwtmp'; -#$webworkDirs{equationCache} = "$webworkDirs{htdocs_temp}/equations"; -#$webworkURLs{equationCache} = "$webworkURLs{htdocs_temp}/equations"; #$courseDirs{html_temp} = "/var/www/html/wwtmp/$courseName"; #$courseURLs{html_temp} = "/wwtmp/$courseName"; diff --git a/lib/WeBWorK/ConfigValues.pm b/lib/WeBWorK/ConfigValues.pm index b5c0d37498..b01df53735 100644 --- a/lib/WeBWorK/ConfigValues.pm +++ b/lib/WeBWorK/ConfigValues.pm @@ -690,28 +690,31 @@ sub getConfigValues ($ce) { [ x('Problem Display/Answer Checking'), { + # FIXME: Perhaps the pg{displayModes} and pg{options}{displayMode} options should just be deleted. The + # only real display mode is MathJax. Why would anyone ever choose plainText? var => 'pg{displayModes}', doc => x('List of display modes made available to students'), doc2 => x( '

When viewing a problem, users may choose different methods of rendering formulas via an ' . 'options box in the left panel. Here, you can adjust what display modes are listed.

' . '

The display modes are

You must use at least ' + . '

  • MathJax: uses javascript to render mathematics.
  • You must use at least ' . 'one display mode. If you select only one, then the options box will not give a choice of ' . 'modes (since there will only be one active).

    ' ), min => 1, - values => [ 'MathJax', 'images', 'plainText' ], + values => [ 'MathJax', 'plainText' ], type => 'checkboxlist' }, { var => 'pg{options}{displayMode}', doc => x('The default display mode'), doc2 => x( - 'Enter one of the allowed display mode types above. See \'display modes entry\' for descriptions.'), + 'Enter one of the allowed display mode types above. See the help for the ' + . '"List of display modes made available to students" options for descriptions.' + ), min => 1, - values => [qw(MathJax images plainText)], + values => [qw(MathJax plainText)], type => 'popuplist' }, { diff --git a/lib/WeBWorK/ContentGenerator/EquationDisplay.pm b/lib/WeBWorK/ContentGenerator/EquationDisplay.pm deleted file mode 100644 index 224837866b..0000000000 --- a/lib/WeBWorK/ContentGenerator/EquationDisplay.pm +++ /dev/null @@ -1,48 +0,0 @@ -package WeBWorK::ContentGenerator::EquationDisplay; -use Mojo::Base 'WeBWorK::ContentGenerator', -signatures; - -=head1 NAME - -WeBWorK::ContentGenerator::EquationDisplay -- create .png version of TeX equations. - -=cut - -use WeBWorK::PG::ImageGenerator; - -sub display_equation ($c, $str) { - my $ce = $c->ce; - - my $image_gen = WeBWorK::PG::ImageGenerator->new( - tempDir => $ce->{webworkDirs}{tmp}, - latex => $ce->{externalPrograms}{latex}, - dvipng => $ce->{externalPrograms}{dvipng}, - useCache => 1, - cacheDir => $ce->{webworkDirs}{equationCache}, - cacheURL => $ce->{webworkURLs}{equationCache}, - cacheDB => $ce->{webworkFiles}{equationCacheDB}, - useMarkers => 1, - dvipng_align => 'baseline', - dvipng_depth_db => { dbsource => '' }, - ); - - my $imageTag = $image_gen->add($str, 'inline'); - $image_gen->render; - return $imageTag; -} - -sub initialize ($c) { - my $equationStr = $c->param('eq') // ''; - - # Prepare to display the typeset image and the HTML code that links to the source image. The HTML code is linked - # also to the image address This requires digging out the link from the string returned by display_equation and - # ImageGenerator. The server name and port are included in the new url. - $c->stash->{typesetStr} = $equationStr ? $c->display_equation($equationStr) : ''; - - # Add the host name to the string. - my $hostName = $c->req->url->to_abs->host_port; - $c->stash->{typesetStr} =~ s|src="|src="http://$hostName|; - - return; -} - -1; diff --git a/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm b/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm index f18b4ca492..2ed3e5b96c 100644 --- a/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm +++ b/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm @@ -1487,7 +1487,6 @@ async sub getProblemHTML ($c, $effectiveUser, $set, $formFields, $mergedProblem) displayMode => $c->{displayMode}, showHints => $c->{will}{showHints}, showSolutions => $c->{will}{showSolutions}, - refreshMath2img => $c->{will}{showHints} || $c->{will}{showSolutions}, processAnswers => 1, QUIZ_PREFIX => 'Q' . sprintf('%04d', $mergedProblem->problem_id) . '_', useMathQuill => $c->{will}{useMathQuill}, diff --git a/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm b/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm index dae595e356..2158ab96e3 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm @@ -185,7 +185,6 @@ async sub initialize ($c) { displayMode => $user->displayMode || $c->ce->{pg}{options}{displayMode}, showHints => 0, showSolutions => 0, - refreshMath2img => 0, processAnswers => 1, permissionLevel => $db->getPermissionLevel($userID)->permission, effectivePermissionLevel => $db->getPermissionLevel($userID)->permission, diff --git a/lib/WeBWorK/ContentGenerator/Instructor/ShowAnswers.pm b/lib/WeBWorK/ContentGenerator/Instructor/ShowAnswers.pm index 3600589a36..01d6a49aab 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/ShowAnswers.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/ShowAnswers.pm @@ -140,7 +140,6 @@ async sub initialize ($c) { processAnswers => 1, showHints => 0, showSolutions => 0, - refreshMath2img => 0, permissionLevel => 0, effectivePermissionLevel => 0, }, diff --git a/lib/WeBWorK/ContentGenerator/Problem.pm b/lib/WeBWorK/ContentGenerator/Problem.pm index b28bccb08b..b27d5752da 100644 --- a/lib/WeBWorK/ContentGenerator/Problem.pm +++ b/lib/WeBWorK/ContentGenerator/Problem.pm @@ -559,7 +559,6 @@ async sub pre_header_initialize ($c) { showHints => $will{showHints}, showSolutions => $will{showSolutions}, showResourceInfo => $will{showResourceInfo}, - refreshMath2img => $will{showHints} || $will{showSolutions}, processAnswers => 1, permissionLevel => $db->getPermissionLevel($userID)->permission, effectivePermissionLevel => $db->getPermissionLevel($effectiveUserID)->permission, diff --git a/lib/WeBWorK/ContentGenerator/ShowMeAnother.pm b/lib/WeBWorK/ContentGenerator/ShowMeAnother.pm index 338ba78e79..8769edf00c 100644 --- a/lib/WeBWorK/ContentGenerator/ShowMeAnother.pm +++ b/lib/WeBWorK/ContentGenerator/ShowMeAnother.pm @@ -72,7 +72,6 @@ async sub pre_header_initialize ($c) { showHints => 0, showSolutions => 0, forceScaffoldsOpen => 1, - refreshMath2img => 0, processAnswers => 1, permissionLevel => $db->getPermissionLevel($c->{userID})->permission, effectivePermissionLevel => $db->getPermissionLevel($c->{effectiveUserID})->permission, @@ -111,7 +110,6 @@ async sub pre_header_initialize ($c) { showHints => 0, showSolutions => 0, forceScaffoldsOpen => 1, - refreshMath2img => 0, processAnswers => 1, permissionLevel => $db->getPermissionLevel($c->{userID})->permission, effectivePermissionLevel => $db->getPermissionLevel($c->{effectiveUserID})->permission, @@ -191,7 +189,6 @@ async sub pre_header_initialize ($c) { displayMode => $c->{displayMode}, showHints => $c->{will}{showHints}, showSolutions => $c->{will}{showSolutions}, - refreshMath2img => $c->{will}{showHints} || $c->{will}{showSolutions}, processAnswers => 1, permissionLevel => $db->getPermissionLevel($c->{userID})->permission, effectivePermissionLevel => $db->getPermissionLevel($c->{effectiveUserID})->permission, diff --git a/lib/WeBWorK/DB/Layout.pm b/lib/WeBWorK/DB/Layout.pm index 3638933a36..65fddbc330 100644 --- a/lib/WeBWorK/DB/Layout.pm +++ b/lib/WeBWorK/DB/Layout.pm @@ -87,11 +87,6 @@ sub databaseLayout ($courseName) { schema => "WeBWorK::DB::Schema::NewSQL::Std", params => { non_native => 1 }, }, - depths => { - record => "WeBWorK::DB::Record::Depths", - schema => "WeBWorK::DB::Schema::NewSQL::Std", - params => { non_native => 1 }, - }, lti_launch_data => { record => "WeBWorK::DB::Record::LTILaunchData", schema => "WeBWorK::DB::Schema::NewSQL::Std", @@ -201,7 +196,6 @@ sub databaseLayout ($courseName) { schema => "WeBWorK::DB::Schema::NewSQL::Std", params => { tableOverride => "${courseName}_past_answer" }, }, - achievement_user => { record => "WeBWorK::DB::Record::UserAchievement", schema => "WeBWorK::DB::Schema::NewSQL::Std", diff --git a/lib/WeBWorK/DB/Record/Depths.pm b/lib/WeBWorK/DB/Record/Depths.pm deleted file mode 100644 index 4dccf43c26..0000000000 --- a/lib/WeBWorK/DB/Record/Depths.pm +++ /dev/null @@ -1,20 +0,0 @@ -package WeBWorK::DB::Record::Depths; -use parent qw(WeBWorK::DB::Record); - -=head1 NAME - -WeBWorK::DB::Record::Depths - represent a record from the depths table. - -=cut - -use strict; -use warnings; - -BEGIN { - __PACKAGE__->_fields( - md5 => { type => "CHAR(33) NOT NULL", key => 1 }, - depth => { type => "SMALLINT" }, - ); -} - -1; diff --git a/lib/WeBWorK/Utils/Rendering.pm b/lib/WeBWorK/Utils/Rendering.pm index bdad7c6164..b225cc42ab 100644 --- a/lib/WeBWorK/Utils/Rendering.pm +++ b/lib/WeBWorK/Utils/Rendering.pm @@ -60,7 +60,6 @@ sub constructPGOptions ($ce, $user, $set, $problem, $psvn, $formFields, $transla $options{setOpen} = time > $set->open_date; $options{pastDue} = time > $set->due_date; $options{answersAvailable} = time > $set->answer_date; - $options{refreshMath2img} = $translationOptions->{refreshMath2img}; $options{feedback_button_name} = $ce->{feedback_button_name}; # Default values for evaluating answers diff --git a/lib/WeBWorK/Utils/Routes.pm b/lib/WeBWorK/Utils/Routes.pm index 0c5f708a2d..92cfb5b793 100644 --- a/lib/WeBWorK/Utils/Routes.pm +++ b/lib/WeBWorK/Utils/Routes.pm @@ -45,7 +45,6 @@ PLEASE FOR THE LOVE OF GOD UPDATE THIS IF YOU CHANGE THE ROUTES BELOW!!! grades /$courseID/grades achievements /$courseID/achievements achievements_leaderboard /$courseID/achievements/leaderboard - equation_display /$courseID/equation feedback /$courseID/feedback gateway_quiz /$courseID/test_mode/$setID @@ -285,7 +284,6 @@ my %routeParameters = ( set_list => { title => '[_4]', children => [ qw( - equation_display feedback gateway_quiz proctored_gateway_quiz @@ -343,11 +341,6 @@ my %routeParameters = ( path => '/leaderboard', unrestricted => 1 }, - equation_display => { - title => x('Equation Display'), - module => 'EquationDisplay', - path => '/equation' - }, feedback => { title => x('Feedback'), module => 'Feedback', diff --git a/lib/WebworkWebservice/RenderProblem.pm b/lib/WebworkWebservice/RenderProblem.pm index cfed1eb0e9..6640283ea8 100644 --- a/lib/WebworkWebservice/RenderProblem.pm +++ b/lib/WebworkWebservice/RenderProblem.pm @@ -217,7 +217,6 @@ async sub renderProblem { displayMode => $rh->{displayMode} // 'MathJax', showHints => $rh->{showHints}, showSolutions => $rh->{showSolutions}, - refreshMath2img => $rh->{showHints} || $rh->{showSolutions}, processAnswers => $rh->{processAnswers} // 1, catchWarnings => 1, r_source => $r_problem_source, From 209fca3f1465f8274f2f35d342d96f87826c63b8 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Wed, 12 Aug 2026 09:17:13 -0500 Subject: [PATCH 2/2] Remove the displayMode and related options. Note that this only removes the selection as pertains to HTML display mode choices in the user interface. Internally, there are still display mode decistions that are made to determine the type of problem render. There is one case where the display mode choice is left, and that is in the problem editor. That is because that is a different type of choice that is much the same as the internal decisions made elsewhere. In short the displayMode is now only used to determine if it is hardcopy, html, or PTX. In some cases plainText is used to save processing (such as in determining a new variant for a "Show Me Another" problem). --- conf/defaults.config | 17 ++--------- conf/localOverrides.conf.dist | 11 -------- htdocs/js/RenderProblem/renderproblem.js | 1 - htdocs/js/Stats/stats.js | 5 ---- lib/WeBWorK/ConfigValues.pm | 28 ------------------- lib/WeBWorK/ContentGenerator.pm | 5 +--- lib/WeBWorK/ContentGenerator/Feedback.pm | 1 - lib/WeBWorK/ContentGenerator/GatewayQuiz.pm | 3 -- .../Instructor/PGProblemEditor.pm | 4 +-- .../Instructor/ProblemGrader.pm | 3 +- lib/WeBWorK/ContentGenerator/LoginProctor.pm | 2 +- lib/WeBWorK/ContentGenerator/Options.pm | 8 +++--- lib/WeBWorK/ContentGenerator/Problem.pm | 13 ++------- lib/WeBWorK/ContentGenerator/ProblemSet.pm | 7 +---- lib/WeBWorK/ContentGenerator/ShowMeAnother.pm | 1 - lib/WeBWorK/CourseEnvironment.pm | 1 - lib/WeBWorK/DB/Record/User.pm | 1 - lib/WeBWorK/Utils.pm | 2 +- templates/ContentGenerator/Feedback.html.ep | 3 +- .../Feedback/feedback_email.html.ep | 1 - .../Feedback/feedback_email.txt.ep | 1 - .../PGProblemEditor/view_form.html.ep | 8 ++---- .../Instructor/ProblemGrader.html.ep | 8 ------ .../Instructor/ProblemSetDetail.html.ep | 7 ----- .../Instructor/SetMaker/problem_row.html.ep | 4 --- .../SetMaker/view_problems_line.html.ep | 17 ----------- .../Instructor/Stats/problem_stats.html.ep | 8 ------ templates/ContentGenerator/Options.html.ep | 22 --------------- .../ProblemSet/auxiliary_tools.html.ep | 2 -- .../ContentGenerator/ProblemSets.html.ep | 1 - 30 files changed, 20 insertions(+), 175 deletions(-) diff --git a/conf/defaults.config b/conf/defaults.config index e59e73da8d..8abf21ba86 100644 --- a/conf/defaults.config +++ b/conf/defaults.config @@ -1015,20 +1015,9 @@ $caliper{enabled} = 0; # PG subsystem options ################################################################################ -# List of enabled screen display modes. Comment out any modes you don't wish to -# make available for use. The first uncommented option is the default for -# instructors rendering problems in the homework sets editor. -$pg{displayModes} = [ - "MathJax", # render TeX math expressions client side using MathJax. - - #"plainText", # display raw TeX for math expressions -]; - -# Default display mode. Should be an uncommented item listed above. -$pg{options}{displayMode} = "MathJax"; - -# List of additional display modes for the PG editor only. -$pg{additionalPGEditorDisplayModes} = [ +# List of display modes that can be selected in the PG editor. +$pg{PGEditorDisplayModes} = [ + "MathJax", # render TeX math expressions using MathJax "tex", # display tex code for a rendered problem "PTX", # display static PreTeXt XML for a rendered problem ]; diff --git a/conf/localOverrides.conf.dist b/conf/localOverrides.conf.dist index d7dec903ab..e28a5aeecf 100644 --- a/conf/localOverrides.conf.dist +++ b/conf/localOverrides.conf.dist @@ -273,17 +273,6 @@ $mail{feedbackRecipients} = [ # PG subsystem options ################################################################################ -# List of enabled screen display modes. Comment out any modes you don't wish to -# make available for use. The first uncommented option is the default for -# instructors rendering problems in the homework sets editor. -#$pg{displayModes} = [ - #"MathJax", # render TeX math expressions client side using MathJax. - #"plainText", # display raw TeX for math expressions -#]; - -# Default display mode. Should be an uncommented item listed above. -#$pg{options}{displayMode} = "plainText"; - ################################################################################ # Adding to the macro file search path. (Check with entries in defaults.config before overriding) ################################################################################ diff --git a/htdocs/js/RenderProblem/renderproblem.js b/htdocs/js/RenderProblem/renderproblem.js index ec4503a64a..5b7345c79c 100644 --- a/htdocs/js/RenderProblem/renderproblem.js +++ b/htdocs/js/RenderProblem/renderproblem.js @@ -13,7 +13,6 @@ const ro = { courseID: document.getElementsByName('hidden_course_id')[0]?.value, language: document.getElementsByName('hidden_language')[0]?.value ?? 'en', - displayMode: document.getElementById('problem_displaymode').value ?? 'MathJax', problemSeed: 1, permissionLevel: 10, outputformat: 'simple', diff --git a/htdocs/js/Stats/stats.js b/htdocs/js/Stats/stats.js index 87d5a743d9..d88eb92bc6 100644 --- a/htdocs/js/Stats/stats.js +++ b/htdocs/js/Stats/stats.js @@ -4,8 +4,6 @@ if (!webworkConfig.renderProblem) return; - const displayModeSelector = document.getElementById('problem_displaymode'); - const render = () => { webworkConfig.renderProblem('problem_render_area', { set_id: document.getElementById('hidden_set_id')?.value, @@ -16,7 +14,4 @@ // Render the problem on page load. render(); - - // Re-render when a new display mode is selected. - displayModeSelector?.addEventListener('change', render); })(); diff --git a/lib/WeBWorK/ConfigValues.pm b/lib/WeBWorK/ConfigValues.pm index b01df53735..2876e51fba 100644 --- a/lib/WeBWorK/ConfigValues.pm +++ b/lib/WeBWorK/ConfigValues.pm @@ -689,34 +689,6 @@ sub getConfigValues ($ce) { ], [ x('Problem Display/Answer Checking'), - { - # FIXME: Perhaps the pg{displayModes} and pg{options}{displayMode} options should just be deleted. The - # only real display mode is MathJax. Why would anyone ever choose plainText? - var => 'pg{displayModes}', - doc => x('List of display modes made available to students'), - doc2 => x( - '

    When viewing a problem, users may choose different methods of rendering formulas via an ' - . 'options box in the left panel. Here, you can adjust what display modes are listed.

    ' - . '

    The display modes are

    You must use at least ' - . 'one display mode. If you select only one, then the options box will not give a choice of ' - . 'modes (since there will only be one active).

    ' - ), - min => 1, - values => [ 'MathJax', 'plainText' ], - type => 'checkboxlist' - }, - { - var => 'pg{options}{displayMode}', - doc => x('The default display mode'), - doc2 => x( - 'Enter one of the allowed display mode types above. See the help for the ' - . '"List of display modes made available to students" options for descriptions.' - ), - min => 1, - values => [qw(MathJax plainText)], - type => 'popuplist' - }, { var => 'pg{specialPGEnvironmentVars}{entryAssist}', doc => x('Assist with the student answer entry process.'), diff --git a/lib/WeBWorK/ContentGenerator.pm b/lib/WeBWorK/ContentGenerator.pm index c4d47dcd75..9ab1063d64 100644 --- a/lib/WeBWorK/ContentGenerator.pm +++ b/lib/WeBWorK/ContentGenerator.pm @@ -512,10 +512,7 @@ sub links ($c) { } # System link parameters that are common to all links (except the Courses link). - my %systemlink_params = ( - $c->param('displayMode') ? (displayMode => $c->param('displayMode')) : (), - $c->param('showOldAnswers') ? (showOldAnswers => $c->param('showOldAnswers')) : () - ); + my %systemlink_params = ($c->param('showOldAnswers') ? (showOldAnswers => $c->param('showOldAnswers')) : ()); my $current_url = $c->url_for; diff --git a/lib/WeBWorK/ContentGenerator/Feedback.pm b/lib/WeBWorK/ContentGenerator/Feedback.pm index 1a47560682..ee77fbe4d8 100644 --- a/lib/WeBWorK/ContentGenerator/Feedback.pm +++ b/lib/WeBWorK/ContentGenerator/Feedback.pm @@ -21,7 +21,6 @@ use WeBWorK::Utils qw(createEmailSenderTransportSMTP fetchEmailRecipients format # route # set (if from ProblemSet or Problem) # problem (if from Problem) -# displayMode (if from Problem) # showOldAnswers (if from Problem) # showCorrectAnswers (if from Problem) # showHints (if from Problem) diff --git a/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm b/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm index 2ed3e5b96c..69e3f38b1a 100644 --- a/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm +++ b/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm @@ -774,8 +774,6 @@ async sub pre_header_initialize ($c) { # false if the "pageChangeHack" input is set (a page change link was used). $c->param('previewAnswers', 0) if $c->param('pageChangeHack'); - $c->{displayMode} = $user->displayMode || $ce->{pg}{options}{displayMode}; - # Set options from request parameters. $c->{redisplay} = $c->param('redisplay'); $c->{submitAnswers} = $c->param('submitAnswers') || 0; @@ -1484,7 +1482,6 @@ async sub getProblemHTML ($c, $effectiveUser, $set, $formFields, $mergedProblem) $set->psvn, $formFields, { - displayMode => $c->{displayMode}, showHints => $c->{will}{showHints}, showSolutions => $c->{will}{showSolutions}, processAnswers => 1, diff --git a/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm b/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm index a8be0a4049..069d5c6294 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm @@ -146,7 +146,7 @@ sub pre_header_initialize ($c) { # Determine displayMode and problemSeed that are needed for viewing the problem. # They are also two of the parameters which can be set by the editor. # Note that the problem seed may be overridden by the value obtained from the problem record later. - $c->{displayMode} = $c->param('displayMode') // $ce->{pg}{options}{displayMode}; + $c->{displayMode} = $c->param('displayMode') // 'MathJax'; $c->{problemSeed} = (($c->param('problemSeed') // '') =~ s/^\s*|\s*$//gr) || DEFAULT_SEED(); # Insure that file_type is defined @@ -745,7 +745,7 @@ sub fixProblemContents { sub view_handler ($c) { my $problemSeed = $c->param('action.view.seed') // DEFAULT_SEED(); - my $displayMode = $c->param('action.view.displayMode') // $c->ce->{pg}{options}{displayMode}; + my $displayMode = $c->param('action.view.displayMode') // 'MathJax'; # Grab the problemContents from the form in order to save it to the tmp file. $c->{r_problemContents} = \(fixProblemContents($c->param('problemContents'))); diff --git a/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm b/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm index 2158ab96e3..d0df1d9bab 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm @@ -171,7 +171,7 @@ async sub initialize ($c) { # These should always be defined except for some odd edge cases. return unless $set && $problem; - # Get the current user for the displayMode. + # Get the current user. my $user = $db->getUser($userID); # Render the problem text. @@ -182,7 +182,6 @@ async sub initialize ($c) { $set->psvn, {}, { - displayMode => $user->displayMode || $c->ce->{pg}{options}{displayMode}, showHints => 0, showSolutions => 0, processAnswers => 1, diff --git a/lib/WeBWorK/ContentGenerator/LoginProctor.pm b/lib/WeBWorK/ContentGenerator/LoginProctor.pm index 3bf5d58eec..2876fcabc6 100644 --- a/lib/WeBWorK/ContentGenerator/LoginProctor.pm +++ b/lib/WeBWorK/ContentGenerator/LoginProctor.pm @@ -91,7 +91,7 @@ async sub initialize ($c) { ), $set->psvn, {}, - { displayMode => $c->param('displayMode') || $ce->{pg}{options}{displayMode} } + {} ); return; diff --git a/lib/WeBWorK/ContentGenerator/Options.pm b/lib/WeBWorK/ContentGenerator/Options.pm index 9c6bda537f..7208281f4d 100644 --- a/lib/WeBWorK/ContentGenerator/Options.pm +++ b/lib/WeBWorK/ContentGenerator/Options.pm @@ -144,16 +144,16 @@ sub initialize ($c) { if ($changeOptions && $authz->hasPermissions($userID, 'change_pg_display_settings')) { if ( - (defined($c->param('displayMode')) && $c->{effectiveUser}->displayMode() ne $c->param('displayMode')) - || (defined($c->param('showOldAnswers')) - && $c->{effectiveUser}->showOldAnswers() ne $c->param('showOldAnswers')) + ( + defined($c->param('showOldAnswers')) + && $c->{effectiveUser}->showOldAnswers() ne $c->param('showOldAnswers') + ) || (defined($c->param('useMathQuill')) && $c->{effectiveUser}->useMathQuill() ne $c->param('useMathQuill')) || (defined($c->param('useMathView')) && $c->{effectiveUser}->useMathView() ne $c->param('useMathView')) ) { - $c->{effectiveUser}->displayMode($c->param('displayMode')); $c->{effectiveUser}->showOldAnswers($c->param('showOldAnswers')); $c->{effectiveUser}->useMathQuill($c->param('useMathQuill')); $c->{effectiveUser}->useMathView($c->param('useMathView')); diff --git a/lib/WeBWorK/ContentGenerator/Problem.pm b/lib/WeBWorK/ContentGenerator/Problem.pm index b27d5752da..fc4d3d2954 100644 --- a/lib/WeBWorK/ContentGenerator/Problem.pm +++ b/lib/WeBWorK/ContentGenerator/Problem.pm @@ -44,8 +44,6 @@ use WeBWorK::HTML::StudentNav qw(studentNav); # # Rendering options: # -# displayMode - name of display mode to use -# # showOldAnswers - request that last entered answer be shown (if allowed) # showCorrectAnswers - request that correct answers be shown (if allowed) # showHints - request that hints be shown (if allowed) @@ -384,8 +382,7 @@ async sub pre_header_initialize ($c) { # Form processing # Set options from form fields (see comment at top of file for form fields). - my $displayMode = $c->param('displayMode') || $user->displayMode || $ce->{pg}->{options}->{displayMode}; - my $redisplay = $c->param('redisplay'); + my $redisplay = $c->param('redisplay'); $c->{submitAnswers} = $c->param('submitAnswers'); my $checkAnswers = $c->param('checkAnswers'); my $previewAnswers = $c->param('previewAnswers'); @@ -410,7 +407,6 @@ async sub pre_header_initialize ($c) { delete $formFields->{submitAnswers}; } - $c->{displayMode} = $displayMode; $c->{redisplay} = $redisplay; $c->{checkAnswers} = $checkAnswers; $c->{previewAnswers} = $previewAnswers; @@ -555,7 +551,6 @@ async sub pre_header_initialize ($c) { && !$problem->{prCount} && !($c->{submitAnswers} || $previewAnswers || $checkAnswers || $showOnlyCorrectAnswers) ? {} : $formFields, { - displayMode => $displayMode, showHints => $will{showHints}, showSolutions => $will{showSolutions}, showResourceInfo => $will{showResourceInfo}, @@ -834,7 +829,6 @@ sub nav ($c, $args) { } my %tail; - $tail{displayMode} = $c->{displayMode} if defined $c->{displayMode}; $tail{showOldAnswers} = 1 if $c->{will}{showOldAnswers}; $tail{studentNavFilter} = $c->param('studentNavFilter') if $c->param('studentNavFilter'); @@ -1243,9 +1237,7 @@ sub output_misc ($c) { my $output = $c->c; # Save state for viewOptions - push(@$output, - $c->hidden_field(showOldAnswers => $c->{will}{showOldAnswers}), - $c->hidden_field(displayMode => $c->{displayMode})); + push(@$output, $c->hidden_field(showOldAnswers => $c->{will}{showOldAnswers})); # Only allow file editing for users that have the permission to modify problem sets. if ($c->authz->hasPermissions($c->param('user'), 'modify_problem_sets')) { @@ -1487,7 +1479,6 @@ sub output_email_instructor ($c) { problem_id => $c->{problem}->problem_id ), studentName => $user->full_name, - displayMode => $c->{displayMode}, showOldAnswers => $c->{will}{showOldAnswers}, showCorrectAnswers => $c->{will}{showCorrectAnswers}, showHints => $c->{will}{showHints}, diff --git a/lib/WeBWorK/ContentGenerator/ProblemSet.pm b/lib/WeBWorK/ContentGenerator/ProblemSet.pm index e78b2c1775..e28b16184c 100644 --- a/lib/WeBWorK/ContentGenerator/ProblemSet.pm +++ b/lib/WeBWorK/ContentGenerator/ProblemSet.pm @@ -88,8 +88,6 @@ async sub initialize ($c) { } } - $c->{displayMode} = $user->displayMode || $ce->{pg}{options}{displayMode}; - # Import problem records for assignments or test version records for tests now. Then initialize all # achievement item data to have access to the updated records if an achievement item was used. if ($c->{set}->assignment_type =~ /gateway/) { @@ -124,9 +122,6 @@ async sub initialize ($c) { ? $ce->{webworkFiles}{screenSnippets}{setHeader} : $c->{set}->set_header; - # Note this may be different than the display mode above when previewing a temporary set header file. - my $displayMode = $c->param('displayMode') || $ce->{pg}{options}{displayMode}; - if ($authz->hasPermissions($userID, 'modify_problem_sets')) { if (defined $c->param('editMode') && $c->param('editMode') eq 'temporaryFile') { $screenSetHeader = $c->param('sourceFilePath'); @@ -150,7 +145,7 @@ async sub initialize ($c) { ); $c->{pg} = - await renderPG($c, $effectiveUser, $c->{set}, $problem, $c->{set}->psvn, {}, { displayMode => $displayMode }); + await renderPG($c, $effectiveUser, $c->{set}, $problem, $c->{set}->psvn, {}, {}); $c->{pg} = '' unless $c->{pg}{body_text} =~ /\S/; return; diff --git a/lib/WeBWorK/ContentGenerator/ShowMeAnother.pm b/lib/WeBWorK/ContentGenerator/ShowMeAnother.pm index 8769edf00c..4922afc321 100644 --- a/lib/WeBWorK/ContentGenerator/ShowMeAnother.pm +++ b/lib/WeBWorK/ContentGenerator/ShowMeAnother.pm @@ -186,7 +186,6 @@ async sub pre_header_initialize ($c) { $c->{set}->psvn, $c->{formFields}, { - displayMode => $c->{displayMode}, showHints => $c->{will}{showHints}, showSolutions => $c->{will}{showSolutions}, processAnswers => 1, diff --git a/lib/WeBWorK/CourseEnvironment.pm b/lib/WeBWorK/CourseEnvironment.pm index 119c74402e..d413b57cb5 100644 --- a/lib/WeBWorK/CourseEnvironment.pm +++ b/lib/WeBWorK/CourseEnvironment.pm @@ -20,7 +20,6 @@ and course.conf files. }); my $timeout = $courseEnv->{sessionTimeout}; - my $mode = $courseEnv->{pg}->{options}->{displayMode}; # etc... =head1 DESCRIPTION diff --git a/lib/WeBWorK/DB/Record/User.pm b/lib/WeBWorK/DB/Record/User.pm index d4c5c5fdd5..afac971983 100644 --- a/lib/WeBWorK/DB/Record/User.pm +++ b/lib/WeBWorK/DB/Record/User.pm @@ -22,7 +22,6 @@ BEGIN { section => { type => "TEXT" }, recitation => { type => "TEXT" }, comment => { type => "TEXT" }, - displayMode => { type => "TEXT" }, showOldAnswers => { type => "INT" }, useMathView => { type => "INT" }, useMathQuill => { type => "INT" }, diff --git a/lib/WeBWorK/Utils.pm b/lib/WeBWorK/Utils.pm index df919a521d..391930c0af 100644 --- a/lib/WeBWorK/Utils.pm +++ b/lib/WeBWorK/Utils.pm @@ -356,7 +356,7 @@ sub generateURLs ($c, %params) { if (defined $params{set_id} && $params{set_id} ne '') { if ($params{problem_id}) { $routePath = $c->url_for('problem_detail', setID => $params{set_id}, problemID => $params{problem_id}); - for my $name ('displayMode', 'showCorrectAnswers', 'showHints', 'showOldAnswers', 'showSolutions') { + for my $name ('showCorrectAnswers', 'showHints', 'showOldAnswers', 'showSolutions') { $args{$name} = [ $c->param($name) ] if defined $c->param($name) && $c->param($name) ne ''; } } else { diff --git a/templates/ContentGenerator/Feedback.html.ep b/templates/ContentGenerator/Feedback.html.ep index aebbaa7010..478f7244da 100644 --- a/templates/ContentGenerator/Feedback.html.ep +++ b/templates/ContentGenerator/Feedback.html.ep @@ -25,8 +25,7 @@ % } else { <%= form_for current_route, method => 'POST', enctype => 'multipart/form-data', begin =%> <%= $c->hidden_authen_fields =%> - <%= $c->hidden_fields(qw(route set problem displayMode showOldAnswers - showCorrectAnswers showHints showSolutions)) =%> + <%= $c->hidden_fields(qw(route set problem showOldAnswers showCorrectAnswers showHints showSolutions)) =%> %
    <%= maketext( diff --git a/templates/ContentGenerator/Feedback/feedback_email.html.ep b/templates/ContentGenerator/Feedback/feedback_email.html.ep index fb263e2bd5..193c08f25d 100644 --- a/templates/ContentGenerator/Feedback/feedback_email.html.ep +++ b/templates/ContentGenerator/Feedback/feedback_email.html.ep @@ -155,7 +155,6 @@ % my @rows = ( - % [ maketext('Display Mode'), param('displayMode') ], % [ maketext('Show Old Answers'), param('showOldAnswers') ? $yes : $no ], % [ maketext('Show Correct Answers'), param('showCorrectAnswers') ? $yes : $no ], % [ maketext('Show Hints'), param('showHints') ? $yes : $no ], diff --git a/templates/ContentGenerator/Feedback/feedback_email.txt.ep b/templates/ContentGenerator/Feedback/feedback_email.txt.ep index 5de552e159..7f0624390c 100644 --- a/templates/ContentGenerator/Feedback/feedback_email.txt.ep +++ b/templates/ContentGenerator/Feedback/feedback_email.txt.ep @@ -74,7 +74,6 @@ ***** <%= maketext('Data about the problem processor:') %> ***** -<%= maketext('Display Mode:') %> <%== param('displayMode') %> <%= maketext('Show Old Answers:') %> <%== param('showOldAnswers') ? 'yes' : 'no' %> <%= maketext('Show Correct Answers:') %> <%== param('showCorrectAnswers') ? 'yes' : 'no' %> <%= maketext('Show Hints:') %> <%== param('showHints') ? 'yes' : 'no' %> diff --git a/templates/ContentGenerator/Instructor/PGProblemEditor/view_form.html.ep b/templates/ContentGenerator/Instructor/PGProblemEditor/view_form.html.ep index 2db0ca6651..86044cb581 100644 --- a/templates/ContentGenerator/Instructor/PGProblemEditor/view_form.html.ep +++ b/templates/ContentGenerator/Instructor/PGProblemEditor/view_form.html.ep @@ -27,11 +27,9 @@ class => 'col-form-label col-auto' =%>
    <%= select_field - 'action.view.displayMode' => [ - map { [ $_ => $_, $_ eq $c->{displayMode} ? (selected => undef) : () ] } - @{ $ce->{pg}{displayModes} }, - @{ $ce->{pg}{additionalPGEditorDisplayModes} } - ], + 'action.view.displayMode' => + [ map { [ $_ => $_, $_ eq $c->{displayMode} ? (selected => undef) : () ] } + @{ $ce->{pg}{PGEditorDisplayModes} } ], id => 'action_view_displayMode_id', class => 'form-select form-select-sm d-inline w-auto' =%>
    diff --git a/templates/ContentGenerator/Instructor/ProblemGrader.html.ep b/templates/ContentGenerator/Instructor/ProblemGrader.html.ep index fc4cd493cc..8b742847bf 100644 --- a/templates/ContentGenerator/Instructor/ProblemGrader.html.ep +++ b/templates/ContentGenerator/Instructor/ProblemGrader.html.ep @@ -89,14 +89,6 @@ id => 'student_selector', class => 'form-select' =%>
    -
    - <%= label_for problem_displaymode => maketext('Display Mode:'), class => 'input-group-text' =%> - <%= select_field - 'problem_displaymode' => - [ grep { exists WeBWorK::PG::DISPLAY_MODES()->{$_} } @{ $ce->{pg}{displayModes} } ], - id => 'problem_displaymode', - class => 'form-select' =%> -
    % diff --git a/templates/ContentGenerator/Instructor/ProblemSetDetail.html.ep b/templates/ContentGenerator/Instructor/ProblemSetDetail.html.ep index d7171759ce..3eec71a3bf 100644 --- a/templates/ContentGenerator/Instructor/ProblemSetDetail.html.ep +++ b/templates/ContentGenerator/Instructor/ProblemSetDetail.html.ep @@ -383,13 +383,6 @@ % } -
    - <%= label_for problem_displaymode => maketext('Display Mode:'), class => 'input-group-text' =%> - <%= select_field - 'problem_displaymode' => [ grep { exists $display_modes->{$_} } @{ $ce->{pg}{displayModes} } ], - id => 'problem_displaymode', - class => 'form-select w-auto flex-grow-0' =%> -
    %
    diff --git a/templates/ContentGenerator/Instructor/SetMaker/problem_row.html.ep b/templates/ContentGenerator/Instructor/SetMaker/problem_row.html.ep index ab3ed4f2d7..e392f68a19 100644 --- a/templates/ContentGenerator/Instructor/SetMaker/problem_row.html.ep +++ b/templates/ContentGenerator/Instructor/SetMaker/problem_row.html.ep @@ -311,10 +311,6 @@ editMode => 'SetMaker', problemSeed => $c->{problem_seed}, sourceFilePath => $sourceFileName, - displayMode => - (!defined param('problem_displaymode') || param('problem_displaymode') eq 'None') - ? $ce->{pg}{options}{displayMode} - : param('problem_displaymode'), } ), id => "tryit$cnt", diff --git a/templates/ContentGenerator/Instructor/SetMaker/view_problems_line.html.ep b/templates/ContentGenerator/Instructor/SetMaker/view_problems_line.html.ep index 382ce17b44..8790290fec 100644 --- a/templates/ContentGenerator/Instructor/SetMaker/view_problems_line.html.ep +++ b/templates/ContentGenerator/Instructor/SetMaker/view_problems_line.html.ep @@ -3,23 +3,6 @@
    <%= submit_button maketext('View Problems'), name => $internal_name, class => 'btn btn-secondary btn-sm mb-2' =%> % -
    - <%= label_for - 'problem_displaymode' => maketext('Display Mode:'), - class => 'col-form-label col-form-label-sm' =%> - <%= select_field 'problem_displaymode' => [ - ( - map { [ $_ => $_, $_ eq $ce->{pg}{options}{displayMode} ? (selected => undef) : () ] } - grep { exists WeBWorK::PG::DISPLAY_MODES()->{$_} } @{ $ce->{pg}{displayModes} } - ), - # Special display mode "None". This is illegal in other modules, - # but means don't render the problem in this module. - [ maketext('None') => 'None' ] - ], - id => 'problem_displaymode', - class => 'form-select form-select-sm d-inline w-auto' =%> - <%= hidden_field original_displayMode => param('problem_displaymode') || $ce->{pg}{options}{displayMode} =%> -
    % # Give a choice of the number of problems to show.
    <%= label_for max_shown => maketext('Max. Shown:'), class => 'col-form-label col-form-label-sm' =%> diff --git a/templates/ContentGenerator/Instructor/Stats/problem_stats.html.ep b/templates/ContentGenerator/Instructor/Stats/problem_stats.html.ep index f310a63821..6265e9dbac 100644 --- a/templates/ContentGenerator/Instructor/Stats/problem_stats.html.ep +++ b/templates/ContentGenerator/Instructor/Stats/problem_stats.html.ep @@ -146,14 +146,6 @@ <%= hidden_field problemID => $problemID, id => 'hidden_problem_id' =%> <%= hidden_field sourceFilePath => $c->{problemRecord}->source_file, id => 'hidden_source_file' =%>
    -
    - <%= label_for problem_displaymode => maketext('Display Mode:'), class => 'input-group-text' =%> - <%= select_field - 'problem_displaymode' => - [ grep { exists WeBWorK::PG::DISPLAY_MODES()->{$_} } @{ $ce->{pg}{displayModes} } ], - id => 'problem_displaymode', - class => 'form-select' =%> -
    <%= link_to maketext('Edit Problem') => $c->systemLink(url_for('instructor_problem_editor_withset_withproblem')), diff --git a/templates/ContentGenerator/Options.html.ep b/templates/ContentGenerator/Options.html.ep index 4ce5286936..09a26b2695 100644 --- a/templates/ContentGenerator/Options.html.ep +++ b/templates/ContentGenerator/Options.html.ep @@ -148,28 +148,6 @@

    <%= maketext('Display Settings') %>

    % % my $display_settings_block = begin - % my $curr_displayMode = $c->{effectiveUser}->displayMode || $ce->{pg}{options}{displayMode}; - % my %display_modes = %{ WeBWorK::PG::DISPLAY_MODES() }; - % my @active_modes = grep { exists $display_modes{$_} } @{ $ce->{pg}{displayModes} }; - % - % if (@active_modes > 1) { -
    -
    - <%= maketext('View equations as') . ':' =%> - % for (@active_modes) { -
    - <%= radio_button - displayMode => $_, - id => "displayMode-$_", - class => 'form-check-input', - $_ eq $curr_displayMode ? (checked => undef) : () =%> - <%= label_for "displayMode-$_" => $_, class => 'form-check-label' =%> -
    - % } -
    -
    - %} - % % if ($authz->hasPermissions($userID, 'can_show_old_answers')) { % my $curr_showOldAnswers = % $c->{effectiveUser}->showOldAnswers ne '' diff --git a/templates/ContentGenerator/ProblemSet/auxiliary_tools.html.ep b/templates/ContentGenerator/ProblemSet/auxiliary_tools.html.ep index 019186b24e..392ba84d1a 100644 --- a/templates/ContentGenerator/ProblemSet/auxiliary_tools.html.ep +++ b/templates/ContentGenerator/ProblemSet/auxiliary_tools.html.ep @@ -6,7 +6,6 @@ route => current_route, set => $c->{set}->set_id, problem => '', - displayMode => $c->{displayMode}, showOldAnswers => '', showCorrectAnswers => '', showHints => '', @@ -23,7 +22,6 @@ route => current_route, set => $c->{set}->set_id, problem => '', - displayMode => $c->{displayMode}, showOldAnswers => '', showCorrectAnswers => '', showHints => '', diff --git a/templates/ContentGenerator/ProblemSets.html.ep b/templates/ContentGenerator/ProblemSets.html.ep index d3d608cf69..0fa8612bfd 100644 --- a/templates/ContentGenerator/ProblemSets.html.ep +++ b/templates/ContentGenerator/ProblemSets.html.ep @@ -75,7 +75,6 @@ route => current_route, set => '', problem => '', - displayMode => '', showOldAnswers => '', showCorrectAnswers => '', showHints => '',