Skip to content

Commit

Permalink
Prevent PHP warnings when language undefined (probably due to a missi…
Browse files Browse the repository at this point in the history
…ng prototype).
  • Loading branch information
trampgeek committed May 13, 2024
1 parent 9123381 commit 7c1be89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public function correct_response(question_attempt $qa) {
}
}

$uclang = ucwords($currentlanguage);
$uclang = ucwords($currentlanguage ?? ''); // Current language can be null when prototype missing.
$heading = get_string('asolutionis', 'qtype_coderunner');
$heading = substr($heading, 0, strlen($heading) - 1) . ' (' . $uclang . ')';
$divid = 'id_div_' . $fieldname;
Expand Down

0 comments on commit 7c1be89

Please sign in to comment.