From 956eb8cb1642f606a3e9d76e4e1ed8f9e997643d Mon Sep 17 00:00:00 2001 From: Richard Lobb Date: Tue, 5 Mar 2024 14:51:54 +1300 Subject: [PATCH] Replace checks for b_ DB prefix with checks against $CFG->behat_prefix. --- .~lock.loadtestingresults2.ods# | 1 + edit_coderunner_form.php | 2 +- renderer.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .~lock.loadtestingresults2.ods# diff --git a/.~lock.loadtestingresults2.ods# b/.~lock.loadtestingresults2.ods# new file mode 100644 index 00000000..59262f77 --- /dev/null +++ b/.~lock.loadtestingresults2.ods# @@ -0,0 +1 @@ +,rjl83,RichardEliteX2,29.02.2024 14:47,file:///home/rjl83/.config/libreoffice/4; \ No newline at end of file diff --git a/edit_coderunner_form.php b/edit_coderunner_form.php index 79db9919..e9aba7d0 100644 --- a/edit_coderunner_form.php +++ b/edit_coderunner_form.php @@ -250,7 +250,7 @@ protected function add_sample_answer_field($mform) { $mform->addHelpButton('sampleanswerattachments', 'sampleanswerattachments', 'qtype_coderunner'); // Unless behat is running, hide the attachments file picker. // behat barfs if it's hidden. - if ($CFG->prefix !== "b_") { + if ($CFG->prefix !== $CFG->behat_prefix) { $method = method_exists($mform, 'hideIf') ? 'hideIf' : 'disabledIf'; $mform->$method('sampleanswerattachments', 'attachments', 'eq', 0); } diff --git a/renderer.php b/renderer.php index 98798f18..f3ad10d9 100644 --- a/renderer.php +++ b/renderer.php @@ -424,7 +424,7 @@ protected function build_results_table($outcome, qtype_coderunner_question $ques if (isset($sandboxinfo['jobeserver'])) { $jobeserver = $sandboxinfo['jobeserver']; $apikey = $sandboxinfo['jobeapikey']; - if ($jobeserver == constants::JOBE_HOST_DEFAULT && $CFG->prefix !== 'b_') { + if ($jobeserver == constants::JOBE_HOST_DEFAULT && $CFG->prefix !== $CFG->behat_prefix) { if ($apikey == constants::JOBE_HOST_DEFAULT_API_KEY) { $fb .= get_string('jobe_warning_html', 'qtype_coderunner'); } else {