Skip to content

Commit

Permalink
Fix uninitialized variable warning when not using LTI.
Browse files Browse the repository at this point in the history
Check that `$ce->{LTIVersion}` is defined and not empty before using it.
This variable being initialized should ensure that the other LTI variables
used here are also initialized.
  • Loading branch information
somiaj committed Nov 13, 2024
1 parent 16d8d13 commit 29af722
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/WeBWorK/ContentGenerator/ProblemSets.pm
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ sub getSetStatus ($c, $set) {
$link_is_active = 0 unless $canViewUnopened;
push(@$other_messages, $c->restricted_progression_msg(0, $set->restricted_status * 100, @restricted));
} elsif (!$canViewUnopened
&& $ce->{LTIVersion}
&& ($ce->{LTIVersion} ne 'v1p3' || !$ce->{LTI}{v1p3}{ignoreMissingSourcedID})
&& defined $ce->{LTIGradeMode}
&& $ce->{LTIGradeMode} eq 'homework'
Expand Down

0 comments on commit 29af722

Please sign in to comment.