Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
HFTSoftwareProject
MoodleDTA
Commits
058ba21c
Commit
058ba21c
authored
Jan 19, 2024
by
Lückemeyer
Browse files
individualized backend communication url
parent
6dc9e2a6
Pipeline
#9061
passed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dta.zip
View file @
058ba21c
No preview for this file type
dta/classes/backend.php
View file @
058ba21c
...
...
@@ -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
=
[
...
...
dta/locallib.php
View file @
058ba21c
...
...
@@ -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
))
{
...
...
dta/version.php
View file @
058ba21c
...
...
@@ -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
"
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment