Skip to content

Commit

Permalink
Merge pull request openwebwork#2399 from Alex-Jordan/set-to-display
Browse files Browse the repository at this point in the history
define set_to_display as empty string when undefined
  • Loading branch information
drgrice1 authored Apr 14, 2024
2 parents cf3f225 + a5fdb76 commit 3886757
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,9 @@ sub pre_header_initialize ($c) {
}
} elsif ($c->param('view_course_set')) {
# View problems selected from the a set in this course
my $set_to_display = $c->{current_library_set};
my $set_to_display = $c->{current_library_set} // '';
debug("set_to_display is $set_to_display");
if (!defined $set_to_display || $set_to_display eq '') {
if ($set_to_display eq '') {
$c->addbadmessage($c->maketext("You need to select a set from this course to view."));
} else {
@pg_files = map { { 'filepath' => $_->source_file, 'morelt' => 0 } }
Expand All @@ -549,9 +549,9 @@ sub pre_header_initialize ($c) {
$use_previous_problems = 0;
} elsif ($c->param('view_setdef_set')) {
# View a set from a set*.def
my $set_to_display = $c->{current_library_set};
my $set_to_display = $c->{current_library_set} // '';
debug("set_to_display is $set_to_display");
if (!defined $set_to_display || $set_to_display eq '') {
if ($set_to_display eq '') {
$c->addbadmessage($c->maketext("You need to select a set definition file to view."));
} else {
@pg_files = $c->read_set_def($set_to_display);
Expand Down

0 comments on commit 3886757

Please sign in to comment.