Skip to content

Commit 209fca3

Browse files
committed
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).
1 parent df00b1c commit 209fca3

30 files changed

Lines changed: 20 additions & 175 deletions

conf/defaults.config

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,20 +1015,9 @@ $caliper{enabled} = 0;
10151015
# PG subsystem options
10161016
################################################################################
10171017

1018-
# List of enabled screen display modes. Comment out any modes you don't wish to
1019-
# make available for use. The first uncommented option is the default for
1020-
# instructors rendering problems in the homework sets editor.
1021-
$pg{displayModes} = [
1022-
"MathJax", # render TeX math expressions client side using MathJax.
1023-
1024-
#"plainText", # display raw TeX for math expressions
1025-
];
1026-
1027-
# Default display mode. Should be an uncommented item listed above.
1028-
$pg{options}{displayMode} = "MathJax";
1029-
1030-
# List of additional display modes for the PG editor only.
1031-
$pg{additionalPGEditorDisplayModes} = [
1018+
# List of display modes that can be selected in the PG editor.
1019+
$pg{PGEditorDisplayModes} = [
1020+
"MathJax", # render TeX math expressions using MathJax
10321021
"tex", # display tex code for a rendered problem
10331022
"PTX", # display static PreTeXt XML for a rendered problem
10341023
];

conf/localOverrides.conf.dist

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -273,17 +273,6 @@ $mail{feedbackRecipients} = [
273273
# PG subsystem options
274274
################################################################################
275275

276-
# List of enabled screen display modes. Comment out any modes you don't wish to
277-
# make available for use. The first uncommented option is the default for
278-
# instructors rendering problems in the homework sets editor.
279-
#$pg{displayModes} = [
280-
#"MathJax", # render TeX math expressions client side using MathJax.
281-
#"plainText", # display raw TeX for math expressions
282-
#];
283-
284-
# Default display mode. Should be an uncommented item listed above.
285-
#$pg{options}{displayMode} = "plainText";
286-
287276
################################################################################
288277
# Adding to the macro file search path. (Check with entries in defaults.config before overriding)
289278
################################################################################

htdocs/js/RenderProblem/renderproblem.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
const ro = {
1414
courseID: document.getElementsByName('hidden_course_id')[0]?.value,
1515
language: document.getElementsByName('hidden_language')[0]?.value ?? 'en',
16-
displayMode: document.getElementById('problem_displaymode').value ?? 'MathJax',
1716
problemSeed: 1,
1817
permissionLevel: 10,
1918
outputformat: 'simple',

htdocs/js/Stats/stats.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
if (!webworkConfig.renderProblem) return;
66

7-
const displayModeSelector = document.getElementById('problem_displaymode');
8-
97
const render = () => {
108
webworkConfig.renderProblem('problem_render_area', {
119
set_id: document.getElementById('hidden_set_id')?.value,
@@ -16,7 +14,4 @@
1614

1715
// Render the problem on page load.
1816
render();
19-
20-
// Re-render when a new display mode is selected.
21-
displayModeSelector?.addEventListener('change', render);
2217
})();

lib/WeBWorK/ConfigValues.pm

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -689,34 +689,6 @@ sub getConfigValues ($ce) {
689689
],
690690
[
691691
x('Problem Display/Answer Checking'),
692-
{
693-
# FIXME: Perhaps the pg{displayModes} and pg{options}{displayMode} options should just be deleted. The
694-
# only real display mode is MathJax. Why would anyone ever choose plainText?
695-
var => 'pg{displayModes}',
696-
doc => x('List of display modes made available to students'),
697-
doc2 => x(
698-
'<p>When viewing a problem, users may choose different methods of rendering formulas via an '
699-
. 'options box in the left panel. Here, you can adjust what display modes are listed.</p>'
700-
. '<p>The display modes are</p><ul><li>plainText: shows the raw LaTeX strings for formulas.'
701-
. '</li><li>MathJax: uses javascript to render mathematics.</li></ul><p>You must use at least '
702-
. 'one display mode. If you select only one, then the options box will not give a choice of '
703-
. 'modes (since there will only be one active).</p>'
704-
),
705-
min => 1,
706-
values => [ 'MathJax', 'plainText' ],
707-
type => 'checkboxlist'
708-
},
709-
{
710-
var => 'pg{options}{displayMode}',
711-
doc => x('The default display mode'),
712-
doc2 => x(
713-
'Enter one of the allowed display mode types above. See the help for the '
714-
. '"List of display modes made available to students" options for descriptions.'
715-
),
716-
min => 1,
717-
values => [qw(MathJax plainText)],
718-
type => 'popuplist'
719-
},
720692
{
721693
var => 'pg{specialPGEnvironmentVars}{entryAssist}',
722694
doc => x('Assist with the student answer entry process.'),

lib/WeBWorK/ContentGenerator.pm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,7 @@ sub links ($c) {
512512
}
513513

514514
# System link parameters that are common to all links (except the Courses link).
515-
my %systemlink_params = (
516-
$c->param('displayMode') ? (displayMode => $c->param('displayMode')) : (),
517-
$c->param('showOldAnswers') ? (showOldAnswers => $c->param('showOldAnswers')) : ()
518-
);
515+
my %systemlink_params = ($c->param('showOldAnswers') ? (showOldAnswers => $c->param('showOldAnswers')) : ());
519516

520517
my $current_url = $c->url_for;
521518

lib/WeBWorK/ContentGenerator/Feedback.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use WeBWorK::Utils qw(createEmailSenderTransportSMTP fetchEmailRecipients format
2121
# route
2222
# set (if from ProblemSet or Problem)
2323
# problem (if from Problem)
24-
# displayMode (if from Problem)
2524
# showOldAnswers (if from Problem)
2625
# showCorrectAnswers (if from Problem)
2726
# showHints (if from Problem)

lib/WeBWorK/ContentGenerator/GatewayQuiz.pm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,6 @@ async sub pre_header_initialize ($c) {
774774
# false if the "pageChangeHack" input is set (a page change link was used).
775775
$c->param('previewAnswers', 0) if $c->param('pageChangeHack');
776776

777-
$c->{displayMode} = $user->displayMode || $ce->{pg}{options}{displayMode};
778-
779777
# Set options from request parameters.
780778
$c->{redisplay} = $c->param('redisplay');
781779
$c->{submitAnswers} = $c->param('submitAnswers') || 0;
@@ -1484,7 +1482,6 @@ async sub getProblemHTML ($c, $effectiveUser, $set, $formFields, $mergedProblem)
14841482
$set->psvn,
14851483
$formFields,
14861484
{
1487-
displayMode => $c->{displayMode},
14881485
showHints => $c->{will}{showHints},
14891486
showSolutions => $c->{will}{showSolutions},
14901487
processAnswers => 1,

lib/WeBWorK/ContentGenerator/Instructor/PGProblemEditor.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ sub pre_header_initialize ($c) {
146146
# Determine displayMode and problemSeed that are needed for viewing the problem.
147147
# They are also two of the parameters which can be set by the editor.
148148
# Note that the problem seed may be overridden by the value obtained from the problem record later.
149-
$c->{displayMode} = $c->param('displayMode') // $ce->{pg}{options}{displayMode};
149+
$c->{displayMode} = $c->param('displayMode') // 'MathJax';
150150
$c->{problemSeed} = (($c->param('problemSeed') // '') =~ s/^\s*|\s*$//gr) || DEFAULT_SEED();
151151

152152
# Insure that file_type is defined
@@ -745,7 +745,7 @@ sub fixProblemContents {
745745

746746
sub view_handler ($c) {
747747
my $problemSeed = $c->param('action.view.seed') // DEFAULT_SEED();
748-
my $displayMode = $c->param('action.view.displayMode') // $c->ce->{pg}{options}{displayMode};
748+
my $displayMode = $c->param('action.view.displayMode') // 'MathJax';
749749

750750
# Grab the problemContents from the form in order to save it to the tmp file.
751751
$c->{r_problemContents} = \(fixProblemContents($c->param('problemContents')));

lib/WeBWorK/ContentGenerator/Instructor/ProblemGrader.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ async sub initialize ($c) {
171171
# These should always be defined except for some odd edge cases.
172172
return unless $set && $problem;
173173

174-
# Get the current user for the displayMode.
174+
# Get the current user.
175175
my $user = $db->getUser($userID);
176176

177177
# Render the problem text.
@@ -182,7 +182,6 @@ async sub initialize ($c) {
182182
$set->psvn,
183183
{},
184184
{
185-
displayMode => $user->displayMode || $c->ce->{pg}{options}{displayMode},
186185
showHints => 0,
187186
showSolutions => 0,
188187
processAnswers => 1,

0 commit comments

Comments
 (0)