Skip to content

Commit

Permalink
Fix an uninitialized value used in pattern match.
Browse files Browse the repository at this point in the history
This is caused by trying to match the problem flags with
`/:needs_grading$/' when there isn't a real problem.  For instance when
a set info file is rendered.
  • Loading branch information
drgrice1 committed Feb 12, 2024
1 parent 8cc8a86 commit 452931a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/WeBWorK/Utils/Rendering.pm
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ sub constructPGOptions ($ce, $user, $set, $problem, $psvn, $formFields, $transla
$options{num_of_incorrect_ans} = $problem->num_incorrect;

# This means that there are essay questions in the problem that have not been graded.
$options{needs_grading} = $problem->flags =~ /:needs_grading$/;
$options{needs_grading} = ($problem->flags // '') =~ /:needs_grading$/;

# Persistent problem data
$options{PERSISTENCE_HASH} = decode_json($problem->problem_data || '{}');
Expand Down

0 comments on commit 452931a

Please sign in to comment.