Skip to content

Commit f37ba13

Browse files
committed
Revert number inputs for fields with labels on the problem set detail page.
This is a quick fix that will make things function for now, and is good for a hotfix. This just reverts all of the fields that were switched to number inputs and that have labels for special negative values back to text inputs and the functionality prior to WeBWorK 2.20. The fields that do not have those labels can still be number inputs. That will work fine for those. Also set the default for showMeAnother to the "Course Default" instead of "Never" which is what it should be. This resolves issue openwebwork#2820 for the current release. We can try to do better for the next release, but I don't see any other easy way to fix this that is appropriate for a hotfix.
1 parent a39e424 commit f37ba13

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ use constant FIELD_PROPERTIES => {
480480
},
481481
max_attempts => {
482482
name => x('Max Attempts'),
483-
type => [ -1, undef, 1 ],
483+
type => 'edit',
484484
size => 6,
485485
override => 'any',
486486
default => '-1',
@@ -493,10 +493,10 @@ use constant FIELD_PROPERTIES => {
493493
},
494494
showMeAnother => {
495495
name => x('Show Me Another'),
496-
type => [ -2, undef, 1 ],
496+
type => 'edit',
497497
size => '6',
498498
override => 'any',
499-
default => '-1',
499+
default => '-2',
500500
labels => {
501501
'-1' => x('Never'),
502502
'-2' => x('Course Default'),
@@ -509,7 +509,7 @@ use constant FIELD_PROPERTIES => {
509509
},
510510
showHintsAfter => {
511511
name => x('Show Hints After'),
512-
type => [ -2, undef, 1 ],
512+
type => 'edit',
513513
size => '6',
514514
override => 'any',
515515
default => '-2',
@@ -526,7 +526,7 @@ use constant FIELD_PROPERTIES => {
526526
},
527527
prPeriod => {
528528
name => x('Rerandomize After'),
529-
type => [ -1, undef, 1 ],
529+
type => 'edit',
530530
size => '6',
531531
override => 'any',
532532
default => '-1',
@@ -606,7 +606,7 @@ use constant FIELD_PROPERTIES => {
606606
},
607607
att_to_open_children => {
608608
name => x('Attempt Threshold for Children'),
609-
type => [ -1, undef, 1 ],
609+
type => 'edit',
610610
size => 6,
611611
override => 'any',
612612
default => '0',
@@ -960,10 +960,9 @@ sub fieldHTML ($c, $userID, $setID, $problemID, $globalRecord, $userRecord, $fie
960960
} elsif ($number) {
961961
$input = $c->number_field(
962962
@field_args,
963-
min => ($properties{type}[0] || 0),
964-
max => ($properties{type}[1] || undef),
965-
step => ($properties{type}[2] || 1),
966-
placeholder => $value,
963+
min => ($properties{type}[0] || 0),
964+
max => ($properties{type}[1] || undef),
965+
step => ($properties{type}[2] || 1),
967966
$forUsers && $canOverride ? (placeholder => $c->maketext('Set Default')) : ()
968967
);
969968
} else {

0 commit comments

Comments
 (0)