Commit 058ba21c authored by Lückemeyer's avatar Lückemeyer
Browse files

individualized backend communication url

parent 6dc9e2a6
Pipeline #9061 passed with stage
No preview for this file type
......@@ -79,17 +79,18 @@ class DtaBackendUtils {
* Sends submission config or archive to backend to be tested.
*
* @param stdClass $assignment assignment for the submission
* @param int $submissionid submissionid of the current file
* @param stdClass $file submission config file or archive with submission
* @return string json string with testresults or null on error
*/
public static function sendsubmissiontobackend($assignment, $file): ?string {
public static function sendsubmissiontobackend($assignment, $submissionid, $file): ?string {
$backendaddress = self::getbackendbaseurl();
if (empty($backendaddress)) {
return true;
}
// Set endpoint for test upload.
$url = $backendaddress . "/v1/task";
$url = $backendaddress . "/v1/task/" . $submissionid;
// Prepare params.
$params = [
......
......@@ -285,7 +285,7 @@ class assign_submission_dta extends assign_submission_plugin {
$file = reset($files);
// Send file to backend.
$response = DtaBackendUtils::sendsubmissiontobackend($this->assignment, $file);
$response = DtaBackendUtils::sendsubmissiontobackend($this->assignment, $submission->id, $file);
// With a null response, return an error.
if (is_null($response)) {
......
......@@ -28,4 +28,4 @@ $plugin->version = 2023123001;
$plugin->requires = 2020061525; // Moodle 3.9 LTS. Older unsupported versions from the 3.x branch should also work.
$plugin->component = 'assignsubmission_dta';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = "3.0.1";
$plugin->release = "3.1.0";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment