diff --git a/lib/WebworkWebservice/RenderProblem.pm b/lib/WebworkWebservice/RenderProblem.pm index 8d38f82846..ab6edd44e0 100644 --- a/lib/WebworkWebservice/RenderProblem.pm +++ b/lib/WebworkWebservice/RenderProblem.pm @@ -185,17 +185,19 @@ async sub renderProblem { if defined($rh->{problemSource}) && $rh->{problemSource}; } + print 'file name is "' . ($rh->{fileName} // 'undefined') . qq{"\n}; + # Initialize problem source my $r_problem_source; if ($rh->{problemSource}) { $r_problem_source = \(decode_utf8_base64($rh->{problemSource}) =~ tr/\r/\n/r); - $problemRecord->source_file(defined $rh->{fileName} ? $rh->{fileName} : $rh->{sourceFilePath}); + $problemRecord->source_file($rh->{fileName} ? $rh->{fileName} : $rh->{sourceFilePath}); } elsif ($rh->{rawProblemSource}) { $r_problem_source = \$rh->{rawProblemSource}; - $problemRecord->source_file(defined $rh->{fileName} ? $rh->{fileName} : $rh->{sourceFilePath}); + $problemRecord->source_file($rh->{fileName} ? $rh->{fileName} : $rh->{sourceFilePath}); } elsif ($rh->{uriEncodedProblemSource}) { $r_problem_source = \(url_unescape($rh->{uriEncodedProblemSource})); - $problemRecord->source_file(defined $rh->{fileName} ? $rh->{fileName} : $rh->{sourceFilePath}); + $problemRecord->source_file($rh->{fileName} ? $rh->{fileName} : $rh->{sourceFilePath}); } elsif (defined $rh->{sourceFilePath} && $rh->{sourceFilePath} =~ /\S/) { $problemRecord->source_file($rh->{sourceFilePath}); $r_problem_source = \(readFile($ce->{courseDirs}{templates} . '/' . $rh->{sourceFilePath}));