Commit 92d07c09 authored by Lukas Wiest's avatar Lukas Wiest 🚂
Browse files

Merge branch 'refactor-dtt' into 'master'

refactor: rework plugin for new backend and relabel to DTT

See merge request HFTSoftwareProject/moodle-assignsubmission_modocot!1
parents 50e6400c 21b5fb83
pipeline {
agent any
tools {
jdk 'Java11'
}
stages {
stage('Checkout') {
steps {
git branch: 'master',
url: 'https://transfer.hft-stuttgart.de/gitlab/HFTSoftwareProject/moodle-assignsubmission_modocot.git'
}
}
stage('Build') {
steps {
sh 'chmod 744 update_plugin_script.sh && ./update_plugin_script.sh'
}
}
}
}
# Moodle Dockerized Code Testing (MoDoCoT) Plugin
A Moodle plugin to assist teachers correcting JUnit exercises.
This plugin allows students to submit their Java exercises, let them be tested against
a set of JUnit tests (that have been priorly provided by the teacher) and receive immediate feedback
on the test results.
For this to work, the plugin communicates with an external webservice providing essentially the following services on the given paths:
* POST **/v1/unittest**: Expects the assignment id and a zip file containing a repo.txt with the repository-link and an optional line for credentials when using a private repository.
You need to add the credentials like this: username:passwort or username:auth-token.
* POST **/v1/tasks**: Expects the assignment id and a zip file containing a repo.txt with the repository-link and an optional line for credentials when using a private repository.
You need to add the credentials like this: username:passwort or username:auth-token.
Returns the results as JSON.
* DELETE **/v1/unittest?assignmentId={id}**: Triggers the deletion of the test files.
See here for an implementation of the webservice: [MoDoCoT Backend](https://transfer.hft-stuttgart.de/gitlab/HFTSoftwareProject/MoDoCoT-Backend.git)
## Installation/Configuration
* Install this plugin by using the Moodle web installer, or by extracting the plugin archive to {Moodle_Root}/mod/assign/submission/modocot and visting the admins notifications page.
* Visit the plugin's settings and configure the base URL of the web service to use. (You need a running webservice to use, see [MoDoCoT Backend](https://transfer.hft-stuttgart.de/gitlab/HFTSoftwareProject/MoDoCoT-Backend.git) for a working solution)
* Done!
## Usage (Teacher)
* Create an Assignment
* In the Assignment settings: Scroll to the section **Submission types** and check the type **Dockerized Code Testing**
* Once **Dockerized Code Testing** is checked, upload a *single* ZIP file containing your repository URL in the corresponding Excercise repository ZIP upload environment.
* View aggregated test results in the grading table column **Dockerized Code Testing**
* View detailed results of a particular submission by clicking the magnifyer icon in the respective cell of the Dockerized Code Testing column of the grading table
## Usage (Student)
* Navigate to the assignment
* Press **Add Submission** respectively **Edit Submission**
* Upload a *single* ZIP file containing your repository URL that you will to be tested and click **Save changes**
* View your test results in the **Dockerized Code Testing** row of the submission status table.
## Technical Details
For the communication between the plugin and the webservice the data is en/decoded as JSON.
Here is an example JSON response after uploading the task Java file.
```JSON
{
"testResults": [
{
"testName": "CalculatorTest",
"testCount": 5,
"failureCount": 0,
"successfulTests": [
"div",
"mult",
"sub",
"add",
"sum"
],
"testFailures": []
},
{
"testName": "CalculatorSecondTest",
"testCount": 5,
"failureCount": 1,
"successfulTests": [
"add2",
"sub2",
"div2",
"sum2"
],
"testFailures": [
{
"testHeader": "mult2(CalculatorSecondTest)",
"message": "expected:<15.0> but was:<10.0>",
"trace": "stacktrace (if existent)"
}
]
}
```
The above shows the result of two JUnit test files (CalculatorTest and CalculatorSecondTest). The field “test count” indicates the number of test methods within the test file. The field “Failure count” indicates how many tests have failed and the field “successful test” indicates the method names of passed tests. In case a test failed, the necessary information can be found as an entry in the "testFailures" array.
If there was an compilation error the relevant information is part of the "compilationErrors" array as shown below.
```JSON
"compilationErrors": [
{
"code": "compiler.err.expected",
"columnNumber": 0,
"kind": "ERROR",
"lineNumber": 0,
"message": "';' expected",
"position": 46,
"filePath": "/tmp/TaskNotCompilable.java",
"startPosition": 46,
"endPosition": 46
}
]
}
```
## Bugs and Improvements?
If you've found a bug or if you've made an improvement to this plugin and want to share your code, please
open an issue in our Github project:
https://transfer.hft-stuttgart.de/gitlab/HFTSoftwareProject/moodle-assignsubmission_modocot/-/issues
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/assign/submission/modocot/db" VERSION="20161201" COMMENT="XMLDB file for Moodle mod/assign/submission/modocot"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="assignsubmission_modocot" COMMENT="Info about JUnit executor submissions for assignments.">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="assignment_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="submission_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="The unique id for this submission info."/>
<KEY NAME="fk_assignment" TYPE="foreign" FIELDS="assignment_id" REFTABLE="assign" REFFIELDS="id" COMMENT="The assignment instance this submission relates to"/>
<KEY NAME="fk_submission" TYPE="foreign" FIELDS="submission_id" REFTABLE="assign_submission" REFFIELDS="id" COMMENT="The submission this file submission relates to."/>
</KEYS>
</TABLE>
<TABLE NAME="modocot_testresult" COMMENT="Info about the JUnit executor test results.">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="testname" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="The name of the test, corresponds to the filename of the Junit test file"/>
<FIELD NAME="testcount" TYPE="int" LENGTH="3" NOTNULL="false" SEQUENCE="false" COMMENT="The overall number of tests, inclusively the failed ones."/>
<FIELD NAME="modocot_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="succtests" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Comma separated list of the successful test names"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="fk_modocot" TYPE="foreign" FIELDS="modocot_id" REFTABLE="assignsubmission_modocot" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="modocot_testfailure" COMMENT="Info about the failures occured during test execution.">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="testresult_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="testheader" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="message" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="trace" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="fk_testresult" TYPE="foreign" FIELDS="testresult_id" REFTABLE="modocot_testresult" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="modocot_compilationerror" COMMENT="Info about compilation errors while trying to compile the test classes.">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="modocot_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="columnnumber" TYPE="int" LENGTH="4" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="linenumber" TYPE="int" LENGTH="5" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="message" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="position" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="The character offset from the beginning of the source object that indicates the location of the problem."/>
<FIELD NAME="filename" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="fk_modocot" TYPE="foreign" FIELDS="modocot_id" REFTABLE="assignsubmission_modocot" REFFIELDS="id"/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/assign/submission/dtt/db" VERSION="20210107" COMMENT="XMLDB file for Moodle mod/assign/submission/dtt"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="assignsubmission_dtt_summary" COMMENT="DTT testrun summary">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="assignment_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="submission_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="timestamp" TYPE="int" LENGTH="10"/>
<FIELD NAME="global_stacktrace" TYPE="text"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="fk_assignment" TYPE="foreign" FIELDS="assignment_id" REFTABLE="assign" REFFIELDS="id" COMMENT="The assignment instance this summary relates to"/>
<KEY NAME="fk_submission" TYPE="foreign" FIELDS="submission_id" REFTABLE="assign_submission" REFFIELDS="id" COMMENT="The submission this summary relates to."/>
</KEYS>
</TABLE>
<TABLE NAME="assignsubmission_dtt_result" COMMENT="DTT testrun single test results">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="assignment_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="submission_id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true"/>
<FIELD NAME="state" TYPE="int" LENGTH="10" NOTNULL="true"/>
<FIELD NAME="failure_type" TYPE="char" LENGTH="255"/>
<FIELD NAME="failure_reason" TYPE="char" LENGTH="255"/>
<FIELD NAME="stacktrace" TYPE="text"/>
<FIELD NAME="column_number" TYPE="int" LENGTH="10"/>
<FIELD NAME="line_number" TYPE="int" LENGTH="10"/>
<FIELD NAME="position" TYPE="int" LENGTH="10"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id,assignment_id,submission_id"/>
<KEY NAME="fk_assignment" TYPE="foreign" FIELDS="assignment_id" REFTABLE="assign" REFFIELDS="id" COMMENT="The assignment instance this result relates to"/>
<KEY NAME="fk_submission" TYPE="foreign" FIELDS="submission_id" REFTABLE="assign_submission" REFFIELDS="id" COMMENT="The submission this result relates to."/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
\ No newline at end of file
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Upgrade code for install
*
* @package assignsubmission_modocot
* @copyright 2020 hft ip2
* @package assignsubmission_dtt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......@@ -29,7 +14,7 @@ defined('MOODLE_INTERNAL') || die();
* @param int $oldversion
* @return bool
*/
function xmldb_assignsubmission_modocot_upgrade($oldversion) {
function xmldb_assignsubmission_dtt_upgrade($oldversion) {
global $CFG;
// Moodle v2.8.0 release upgrade line.
......
<?php
/**
* Strings for component "assignsubmission_dtt", language "en"
*
* @package assignsubmission_dtt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string["pluginname"] = "Dockerized Testing Toolkit";
$string["submission_label"] = "DTT submission configuration or zip-packed project";
$string["submission_label_help"] = "Either upload a single textfile containing one DTT URI pointing to the repository with your submission or pack your project as zip and upload it directly. Using the textfile you can additionally add as many unified-ticketing URI (one per line) as you wish for feedback into one or more ticketsystems.";
$string["submission_settings_label"] = "DTT test configuration";
$string["submission_settings_label_help"] = "single text file with DTT test URI";
$string["backendHost_help"] = "Address/Name and Port of backend server";
$string["backendHost_not_set"] = "The Dockerized Testing Toolkit backend URL is not configured";
$string["enabled"] = $string["pluginname"];
$string["enabled_help"] = "If enabled, you'll have to upload a textfile containing a valid DTT URI pointing to the repository with your test logic and defining a docker image on dockerhub used as testrunner. Your students will have to either upload their code in a zip archive or as well by providing a textifle with a valid DTT URI pointing to the repository with their submission logic";
$string["no_submissionfile_warning"] = "Submission type is \"Dockerized Testing Toolkit\" but no configuration file or submission archive uploaded";
$string["no_testfile_warning"] = "Submission type is \"Dockerized Testing Toolkit\" but no configuration file uploaded";
$string["http_client_error_msg"] = "A client error occured (HTTP 4xx)";
$string["http_server_error_msg"] = "A server error occured (HTTP 5xx)";
$string["http_unknown_error_msg"] = "An unknown HTTP error occured on backend transfer";
// Admin Settings.
$string["default"] = "Enabled by default";
$string["default_help"] = "If set, this submission method will be enabled by default for all new assignments.";
$string["backendHost"] = "Backend Server Address";
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains the moodle hooks for the submission modocot plugin
* This file contains the moodle hooks for the submission DTT plugin
*
* @package assignsubmission_modocot
* @package assignsubmission_dtt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
......@@ -33,12 +19,14 @@ defined('MOODLE_INTERNAL') || die();
* @param bool $forcedownload
* @return bool false if file not found, does not return if found - just send the file
*/
function assignsubmission_modocot_pluginfile($course,
$cm,
context $context,
$filearea,
$args,
$forcedownload) {
function assignsubmission_modocot_pluginfile(
$course,
$cm,
context $context,
$filearea,
$args,
$forcedownload
) {
global $DB, $CFG;
if ($context->contextlevel != CONTEXT_MODULE) {
......@@ -74,7 +62,7 @@ function assignsubmission_modocot_pluginfile($course,
$relativepath = implode('/', $args);
$fullpath = "/{$context->id}/assignsubmission_modocot/$filearea/$itemid/$relativepath";
$fullpath = "/{$context->id}/assignsubmission_dtt/$filearea/$itemid/$relativepath";
$fs = get_file_storage();
if (!($file = $fs->get_file_by_hash(sha1($fullpath))) || $file->is_directory()) {
......
<?php
defined('MOODLE_INTERNAL') || die();
// import various files logic is organized in
require_once($CFG->dirroot . '/mod/assign/submission/dtt/models/DttResult.php');
require_once($CFG->dirroot . '/mod/assign/submission/dtt/utils/database.php');
require_once($CFG->dirroot . '/mod/assign/submission/dtt/utils/backend.php');
require_once($CFG->dirroot . '/mod/assign/submission/dtt/utils/view.php');
/**
* library class for DTT submission plugin extending assign submission plugin base class
*
* @package assignsubmission_dtt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class assign_submission_dtt extends assign_submission_plugin {
// broadly used in logic, parametrized for easier change
const COMPONENT_NAME = "assignsubmission_dtt";
// draft file area for modocot tests to be uploaded by the teacher
const ASSIGNSUBMISSION_DTT_DRAFT_FILEAREA_TEST = "tests_draft_dtt";
// file area for modocot tests to be uploaded by the teacher
const ASSIGNSUBMISSION_DTT_FILEAREA_TEST = "tests_dtt";
// file area for modocot submission assignment
const ASSIGNSUBMISSION_DTT_FILEAREA_SUBMISSION = "submissions_dtt";
// ========== abstract mehtods to be implemented ========== //
/**
* get plugin name
* @return string
*/
public function get_name(): string {
return get_string("pluginname", self::COMPONENT_NAME);
}
// ========== end of section ========== //
// ========== parent methods overloaded ========== //
// ===== assignment settings ===== //
/**
* Get default settings for assignment submission settings
*
* @param MoodleQuickForm $mform form to add elements to
* @return void
*/
public function get_settings(MoodleQuickForm $mform): void {
// add draft filemanager to form
$mform->addElement(
// filemanager
"filemanager",
// unique element name in form
self::ASSIGNSUBMISSION_DTT_DRAFT_FILEAREA_TEST,
// label shown to user left of filemanager
get_string("submission_settings_label", self::COMPONENT_NAME),
// attributes
null,
// options array
$this->get_file_options(true)
);
// add help button to added filemanager
$mform->addHelpButton(
// form-unique element id to add button to
self::ASSIGNSUBMISSION_DTT_DRAFT_FILEAREA_TEST,
// key to search for
"submission_settings_label",
// language file to use
self::COMPONENT_NAME
);
// only show filemanager, if our plugin is enabled
$mform->hideIf(
// form-unique element id to hide
self::ASSIGNSUBMISSION_DTT_DRAFT_FILEAREA_TEST,
// condition to check
self::COMPONENT_NAME . '_enabled',
// state to match for hiding
'notchecked'
);
}
/**
* Allows the plugin to update the defaultvalues passed in to
* the settings form (needed to set up draft areas for editor
* and filemanager elements)
* @param array $defaultvalues
*/
public function data_preprocessing(&$defaultvalues): void {
$draftitemid = file_get_submitted_draft_itemid(self::ASSIGNSUBMISSION_DTT_DRAFT_FILEAREA_TEST);
// prepare draft area with created draft filearea
file_prepare_draft_area(
// draft filemanager form-unique id
$draftitemid,
// id of current assignment
$this->assignment->get_context()->id,
// component name
self::COMPONENT_NAME,
// proper filearea
self::ASSIGNSUBMISSION_DTT_FILEAREA_TEST,
// entry id
0,
// options array?
array('subdirs' => 0)
);
$defaultvalues[self::ASSIGNSUBMISSION_DTT_DRAFT_FILEAREA_TEST] = $draftitemid;
}
/**
* Save settings of assignment submission settings
*
* @param stdClass $data
* @return bool
*/
public function save_settings(stdClass $data): bool {
// if the assignment has no filemanager for our plugin just leave
$draftFileManagerId = self::ASSIGNSUBMISSION_DTT_DRAFT_FILEAREA_TEST;
if (!isset($data->$draftFileManagerId)) {
return true;
}
// store files from draft filearea to proper one
file_save_draft_area_files(
// form-unique element id of draft filemanager from the edit
$data->$draftFileManagerId,
// id of the assignment we edit right now
$this->assignment->get_context()->id,
// component name
self::COMPONENT_NAME,
// proper file area
self::ASSIGNSUBMISSION_DTT_FILEAREA_TEST,
// entry id
0
);
// get files from proper filearea
$fs = get_file_storage();
$files = $fs->get_area_files(
// id of current assignment
$this->assignment->get_context()->id,
// component name
self::COMPONENT_NAME,
// proper filearea
self::ASSIGNSUBMISSION_DTT_FILEAREA_TEST,
// entry id
0,
// ?
'id',
// ?
false
);
// check if a file is uploaded
if (empty($files)) {
\core\notification::error(get_string("no_testfile_warning", self::COMPONENT_NAME));
return true;
}
// get file
$file = reset($files);
// send file to backend
return DttBackendUtils::sendTestConfigToBackend($this->assignment, $file);
}
// ===== student submission ===== //
/**
* Add elements to submission form
*
* @param mixed $submission stdClass|null
* @param MoodleQuickForm $mform
* @param stdClass $data
* @param int $userid
* @return bool
*/
public function get_form_elements_for_user($submissionorgrade, MoodleQuickForm $mform, stdClass $data, $userid): bool {
// prepare submission filearea
$data = file_prepare_standard_filemanager(
$data,
'tasks',
$this->get_file_options(false),
$this->assignment->get_context(),
self::COMPONENT_NAME,
self::ASSIGNSUBMISSION_DTT_FILEAREA_SUBMISSION,
$submissionorgrade ? $submissionorgrade->id : 0
);
// add filemanager to form
$mform->addElement(
// filemanager
'filemanager',
// form-unique identifier
'tasks_filemanager',
// label to show next to filemanager
get_string("submission_label", self::COMPONENT_NAME),
// attributes
null,
// options
$this->get_file_options(false)
);
// add help button
$mform->addHelpButton(
// what form item to add a helpbutton
"tasks_filemanager",
// what key to use
"submission_label",
// in which language file to look in
self::COMPONENT_NAME
);
return true;
}
/**
* @param stdClass $submission submission to check
* @return bool true if file count is zero
*/
public function is_empty(stdClass $submission): bool {
return $this->count_files($submission->id, self::ASSIGNSUBMISSION_DTT_FILEAREA_SUBMISSION) == 0;
}
/**
* Count the number of files in a filearea
*
* @param int $submissionId submission id to check
* @param string $areaId filearea id to count
* @return int
*/
private function count_files($submissionId, $areaId) {
$fs = get_file_storage();
$files = $fs->get_area_files($this->assignment->get_context()->id,
self::COMPONENT_NAME,
$areaId,
$submissionId,
'id',
false);
return count($files);
}
/**
* Save data to the database
*
* @param stdClass $submission
* @param stdClass $data
* @return bool
*/
public function save(stdClass $submission, stdClass $data) {
$data = file_postupdate_standard_filemanager(
$data,
'tasks',
$this->get_file_options(false),
$this->assignment->get_context(),
self::COMPONENT_NAME,
self::ASSIGNSUBMISSION_DTT_FILEAREA_SUBMISSION,
$submission->id
);
// if submission is empty leave directly