Source

...

Target

Commits (4)
Showing with 1598 additions and 0 deletions
+1598 -0
.assets/install_conf_1.png

122 KB

.assets/install_conf_2.png

112 KB

.assets/usage_student_1.png

109 KB

.assets/usage_student_2.png

95 KB

.assets/usage_student_3.png

118 KB

.assets/usage_student_4.png

83.2 KB

.assets/usage_teacher_1.png

88.4 KB

.assets/usage_teacher_2.png

137 KB

.assets/usage_teacher_3.png

112 KB

FROM amazoncorretto:17.0.3-alpine as corretto-jdk
ENV BASEDIR /data
ENV TESTDIR $BASEDIR/test
ENV SOURCEDIR $BASEDIR/src
ENV RESULTDIR $BASEDIR/result
ENV LIBSDIR $BASEDIR/libs
RUN mkdir -p $TESTDIR \
&& mkdir $SOURCEDIR \
&& mkdir $RESULTDIR \
&& mkdir -p /$LIBSDIR/additional
ADD target/dta-jdk17-junit5-runner-jar-with-dependencies.jar /$BASEDIR/app.jar
ADD https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-api/5.10.0/junit-jupiter-api-5.10.0.jar /$LIBSDIR/
ADD https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/5.10.0/junit-jupiter-engine-5.10.0.jar /$LIBSDIR/
ADD https://repo1.maven.org/maven2/org/junit/platform/junit-platform-engine/1.10.0/junit-platform-engine-1.10.0.jar /$LIBSDIR/
ADD https://repo1.maven.org/maven2/org/junit/platform/junit-platform-commons/1.10.0/junit-platform-commons-1.10.0.jar /$LIBSDIR/
ADD https://repo1.maven.org/maven2/org/junit/platform/junit-platform-launcher/1.10.0/junit-platform-launcher-1.10.0.jar /$LIBSDIR/
ADD https://repo1.maven.org/maven2/org/apiguardian/apiguardian-api/1.1.1/apiguardian-api-1.1.1.jar /$LIBSDIR/
ADD https://repo1.maven.org/maven2/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar /$LIBSDIR/
WORKDIR $BASEDIR
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -jar /$BASEDIR/app.jar "$SOURCEDIR/src:$TESTDIR/test" "$LIBSDIR/*:$TESTDIR/libs/*" $RESULTDIR
\ No newline at end of file
This diff is collapsed.
# Moodle Dockerized Test Agent (MoDTA) Plugin
This is the source code repository for the MoDTA plugin. It is an extended and enhanced version of the approved Moodle JUnit Exercise Corrector (MoJEC) plugin, and the Moodle Dockerized Code Testing (MoDoCoT) and Moodle Dockerized Test Tool (Moodle DTT) plugins - for which no approval was requested, which all still run up to Moodle 4.3. MoDTA can thus be considered MoJEC version 4, thought it can test code in any programming language for which a teacher provides a test runner docker image.
The zip archive in the root directory contains the files from the dta directory for easy installation as long as it is unavailable via Moodle Plugins Directory.
## Goals
MoDTA empowers teachers to provide programming Moodle assignments for their students, which are automatically corrected upon hand-in using teacher-provided tests and the results provided as extended submission feedback.
Corrections optionally include a pedagogic agent giving feedback on student competencies and in the next version recommending next exercises based on student competency levels and resilience.
Furthermore, MoDTA optionally provides the errors as tickets in supported ticketing systems to resemble current state-of-the-art software development workflows.
### Motivation
Due to contact time constraints, assignments for a new topic typically include about three tasks (one easy introductory, one standard usage, and one advanced combination with previous topics). Students e.g. stuck at the standard level assignment may face frustration and only little opportunity for qualified feedback. Especially in beginners’ programming education, many students struggle with the way of thinking and at the same time feel reluctant to ask teachers for help.
MoDTA allows for teachers to provide additional assignments at intermediate levels from their typically existing assignment collection. Teachers have to create automated tests for the assignments and place them in a git repository. Afterwards students can practice their skills 24/7 with a less steep learning curve and without having to overcome their potential reluctance to ask a teacher for help. They receive feedback consistent with other assignment results integrated into the Moodle environment.
MoDTA supports beginners not educated in state-of-the-art repository-based workflows by offering hand-ins in a zip archive containing the code to lower the learning curve. It also supports hand-in via repository URL and optionally repository credentials for advanced students.
Optionally, if a teacher provides competency profiles and difficulties for tasks and tests, students also receive feedback about their achieved competencies by a pedagogic agent, which in the next version optionally recommends a learning path to the students based on their resilience.
Furthermore and independent of the other optional features, MoDTA optionally supports a state-of-the-art workflow by placing tickets for compile errors in a student-provided ticketing system link (currently supported: GitLab and Atlassian Jira).
## Overview
The MoDTA system comprises two key components:
• The MoDTA Moodle plugin, designed as an assignment submission tool.
• The DTA backend web service, which interfaces with the Moodle plugin through REST and employs the JSON file format for communication.
The plugin establishes communication with the external DTA backend REST web service offering the endpoints:
• POST /v1/unittest:** This endpoint requires the assignment ID and a text file containing the repository link (see usage below for an example). Optionally, it may include credentials, if the repository is private. Credentials should be formatted as "username:password" or "username:auth-token". Also optionally, the file may contain a link to a ticketing system in a new line of the same format. The results are returned in JSON format.
• POST /v1/tasks:** This API expects the assignment ID and a text file containing a repository link. Similar to the previous endpoint, it can also include an optional line for credentials when dealing with private repositories, using the same "username:password" or "username:auth-token" format. The results are provided in JSON format.
• DELETE /v1/unittest?assignmentId={id}:** Initiates the deletion of test files when provided with the assignment ID as a query parameter.
## Installation & Configuration
After approval, install the plugin directly from the Moodle Plugins Directory via Site Administration/Plugins/Install Plugins.
Before that or alternatively: zip the plugin code from https://transfer.hft-stuttgart.de/gitlab/HFTSoftwareProject/moodledta (here). The readily-zipped current version also sits in the repository’s main directory. Then install the plugin from zip via Site Administration/Plugins/Install Plugins, or by extracting the plugin archive to {Moodle_Root}/mod/assign/submission/dta and visiting the admins notifications page.
Visit Site Administration/Plugins/Plugin Overview and select Settings next to the Moodle Dockerized Test Agent (MoDTA) entry to enter the URI of your backend as shown in Fig. 1. ![Fig. 1: Plugin List](doc/install_conf_1.png) Finally, configure via Site Administration/Security/HTTP Security settings permitting communication with the backend URI and port as seen in Fig. 2. ![Fig. 2: DTA Configuration Dialog](doc/install_conf_2.png) The plugin requires the external DTA REST webservice backend.
Notes:
The universal DTA REST webservice backend is available under the GPLv3 as well at https://transfer.hft-stuttgart.de/gitlab/HFTSoftwareProject/dtabackend and the docker image at https://hub.docker.com/r/hftstuttgart/dta-backend . See the documentation in the repository for the necessary setup.
An example JDK 17 JUnit 5 test runner is available under GPLv3 as well at https://transfer.hft-stuttgart.de/gitlab/HFTSoftwareProject/dtatestrunner and the pre-built docker image at https://hub.docker.com/r/hftstuttgart/dta-jdk17-junit5-testrunner . The repository contains an example docker-compose.yaml for tests with a bitnami Moodle and MariaDB setup and the backend.
## Usage
With the MoDTA plugin installed and configured backend URI (including Moodle Security/HTTP Security settings permitting communication with that URI):
### Teacher
When creating an assignment, a teacher can select the MoDTA exercise as a new assignment type via an additional checkbox on the assignment creation page as shown at the bottom of Fig. 3. ![Fig. 3: Moodle DTA Activation Checkbox](doc/usage_teacher_1.png) A new standard file upload field appears as indicated in Fig. 4. ![Fig. 4: Moodle DTA Upload File Area](doc/usage_teacher_2.png). There, the teacher must upload a text file with the git repository URI containing the tests as shown in Fig. 5. ![Fig. 5: Moodle DTA Teacher Text File Upload](doc/usage_teacher_3.png) The text file has to adhere to the following format also given in the example repository:
The text file has to contain the following, each separated by ::
- dtt as the URI-type
- \<git https repository URI>
- \<git user name or the fixed string “none” for publicly accessible repositories>
- \<git password for the given user, git read access token for the repository, or the fixed string “none” for publicly accessible repositories>
- \<docker hub image for the test runner>
- optionally, an additional line of the same structure containing a ticketing system URI, user name and password or write access token
An example text file content looks like this:
dtt::https://transfer.hft-stuttgart.de/gitlab/dtt/example_openjdk11-junit5-calculator-test.git::none::none::hftstuttgart/dta-jdk17-junit5-testrunner:latest
Students use the same format, just without the runner part at the end.
### Student
Students use an additional MoDTA standard file upload field in the standard submission processs in Moodle like in Fig. 6. [Fig. 6: Moodle DTA Student File Upload](doc/usage_student_1.png) There, they place either a zip archive or a text file adhering to the same format as the teacher’s file with their code repository URI and optionally credentials and/or a ticketing system URI as shown in Fig. 7. ![Fig. 7: Moodle DTA Student Text File Upload](doc/usage_student_2.png)
Upon completion, students see a summarized overview of their test results in an additional column of the submission feedback table like in Fig. 8. ![Fig. 8: Moodle DTA Submission Result Summay](doc/usage_student_3.png) Clicking on a new expansion icon in that column, they reach a detailed feedback dialog including stack traces of compile errors and test failures as in Fig. 9. ![Fig. 9: Moodle DTA Student Detail Result View](doc/usage_student_4.png) Optionally, the MoDTA backend creates tickets for compile failures in the ticketing system under the URI provided by the student upon hand-in.
Note: Teachers have access to the Moodle submission result view to assess student results. However, teacher control and grading are not the focus of MoDTA.
### Technical Workflow
Assignment creation: The backend creates a temporary directory and checks out the test code from the given repository to that directory's subdirectory test. If the repository contains a file test-competencies.mft in its root directory with a structure described in the backend documentation, this enables the optional competency feedback.
Assignment submission: The MoDTA plugin passes the submission id and submitted text or zip file – no personal teacher student data – to the external DTA backend REST web service. The DTA backend REST web service fetches or extracts the code to the temporary directory's subdirectory src. It launches via docker a dedicated test runner based on the docker image provided in the teacher’s text file. This test runner compiles and executes the code, running the teacher-defined tests to evaluate the students' submission.
The runner returns the result in a file named result.json in the temporary directory's subdirectory result. The backend optionally enriches the result with competency feedback. It then returns the json result structure to the MoDTA moodle plugin. The MoDTA moodle plugin adds a new column to the submission result table and shows a result summary as well as an + button. Clicking on the + button, the student sees the detailed test results and, optionally, competency feedback.
## Plugin Detail Documentation – MoDTA Assignment Submission Plugin
The assignment submission plugin type was the most suitable choice with assignment feedback as another related option. It empowers you to present customized form fields to students during the assignment submission process and to teachers when configuring assignment settings. Moreover, it grants complete control over how submitted assignments are displayed to both graders and students.
The primary features of this plugin type include the ability to:
• Integrate additional settings into the module settings page for assignments.
• Provide a summary of the submission to students and teachers.
• Incorporate form fields into the student submission page for added flexibility and customization.
### File Structure
To ensure proper organization, all files related to the MoDTA assignment submission plugin reside in the directory path "mod/assign/submission/dta" within {Moodle_Root}.
### Language
The language files for our plugin are found under "lang/<country_code>/assignsubmission_dta.php." These files are organized into different subfolders depending on the language to be supported. For instance:
- English: "lang/en/assignsubmission_dta.php"
The filename corresponds to the component name of the plugin, structured as <plugintype>_<pluginname>, which, in our case, is "assignsubmission_dta." The repository delivers only English as requested by the Moodle team.
Each language file contains various key-value entries formatted as $string["key"] = "Value," with the key provided in English as the most widespread language remaining consistent across different language files, while the value varies according to the chosen language. Moodle incorporates a dedicated String API used In the plugin as required In the approval guidelines, allowing for easy value retrieval based on a given key and the selected language (e.g., get_string("key", "default value")).
### version.php
This file provides version information about the plugin to manage installation and upgrades.
### settings.php
The settings file defines two settings for the MoDTA plugin:
1. Default: This setting offers a checkbox to determine whether the plugin should be enabled by default when creating a new assignment.
2. Web Service Base URL: It features a text field where you can specify the base URL for the web service, facilitating file communication and actual testing.
### db/upgrade.php
This file is currently empty, as the data structure for the plugin has not changed so far.
### db/install.xml
This file defines the necessary database tables and rows for storing data associated with the MoDTA plugin. Moodle offers a specialized XML schema designed for modeling this information, featuring elements like TABLENAME, FIELDS, and KEY. The plugin utilizes two additional tables for cleanliness not to alter moodle standard tables:
assignsubmission_dta_summary which is related 1:1 to the submission and uses the assignment_id and submission_id as foreign keys, and assignsubmission_dta_result which stores the results of a submission as a 1:n relation to the assignsubmission_dta_summary. Whenever a new MoDTA assignment is submitted, the backend web service is engaged, returning one or more test results or compilation errors in the form of a JSON string. The front end parses this JSON string for the result summary and results and stores them in the appropriate tables.
### locallib.php
This is where all the functionality for this plugin is defined. All submission plugins must define a class with the component name of the plugin that extends assign_submission_plugin .
That yields the following class hierarchy:
The "assign_submission_plugin" class serves as an abstract foundation that all assignment submission plugins must build upon. It incorporates a limited set of supplementary functions tailored exclusively to submission plugins. On the other hand, the "assign_plugin" class is also an abstract class, but it functions as the fundamental class for all assignment plugins, encompassing both feedback and submission plugins. This class facilitates access to the assignment instance, represented as "$this->assignment." Collectively, these two classes offer a series of public functions, often referred to as "hooks," which are designed to be overridden to implement the required functionality.
The following provides brief descriptions of a selection of functions to illustrate the types of hooks available:
• get_settings(): This function comes into play during the creation of the assignment settings page. For the MoDTA plugin, this involves adding a file manager that permits teachers to upload their test repo and docker Image URI as a textfile. This function is overridden from the assign_plugin class.
• save_settings(): The save_settings function is invoked when the assignment settings page is submitted, whether for a new assignment or the modification of an existing one. In the MoDTA plugin, this function is responsible for preserving the text file chosen by the teacher and transmitting the file to the backend web service. Like the previous function, this one is overridden from the assign_plugin class.
• get_form_elements_for_user(): During the construction of the submission form, this function plays a similar role to the get_settings() function for settings. In the context of the MoDTA plugin, it adds a file manager to enable students to upload their text or zip file. Once again, this function is overridden from the assign_plugin class.
• save():This function is invoked to save a user's submission. Within the MoDTA plugin, this function sends the student's submission to the backend and receives the result as the response. For details see the technical details section above.
• view_summary(): This function is called to display a summary of the submission to both teachers and students. For the students, this summary will be shown within the submission status table and for the teachers within a column of the grading table. In the MoDTA plugin this method returns a more compact view (only essential data) for the grading table and a detailed view for the students submission status table.
### lib.php
This file serves as the gateway to various standard Moodle APIs designed for plugins. In the content of the MoDTA plugin, this function is denoted as "assignsubmission_dta_pluginfile."
### util folder
The folder contains various utility files, e.g. displaying the new test summary pages is delegated from the locallib.php for brevity of that source.
# Moodle Dockerized Test Agent (MoDTA) Plugin
This is the source code repository for the MoDTA plugin. It is an extended and enhanced version of the approved Moodle JUnit Exercise Corrector (MoJEC) plugin, and the Moodle Dockerized Code Testing (MoDoCoT) and Moodle Dockerized Test Tool (Moodle DTT) plugins - for which no approval was requested, which all still run up to Moodle 4.3. MoDTA can thus be considered MoJEC version 4, thought it can test code in any programming language for which a teacher provides a test runner docker image.
The zip archive in the root directory contains the files from the dta directory for easy installation as long as it is unavailable via Moodle Plugins Directory.
## Goals
MoDTA empowers teachers to provide programming Moodle assignments for their students, which are automatically corrected upon hand-in using teacher-provided tests and the results provided as extended submission feedback.
Corrections optionally include a pedagogic agent giving feedback on student competencies and in the next version recommending next exercises based on student competency levels and resilience.
Furthermore, MoDTA optionally provides the errors as tickets in supported ticketing systems to resemble current state-of-the-art software development workflows.
### Motivation
Due to contact time constraints, assignments for a new topic typically include about three tasks (one easy introductory, one standard usage, and one advanced combination with previous topics). Students e.g. stuck at the standard level assignment may face frustration and only little opportunity for qualified feedback. Especially in beginners’ programming education, many students struggle with the way of thinking and at the same time feel reluctant to ask teachers for help.
MoDTA allows for teachers to provide additional assignments at intermediate levels from their typically existing assignment collection. Teachers have to create automated tests for the assignments and place them in a git repository. Afterwards students can practice their skills 24/7 with a less steep learning curve and without having to overcome their potential reluctance to ask a teacher for help. They receive feedback consistent with other assignment results integrated into the Moodle environment.
MoDTA supports beginners not educated in state-of-the-art repository-based workflows by offering hand-ins in a zip archive containing the code to lower the learning curve. It also supports hand-in via repository URL and optionally repository credentials for advanced students.
Optionally, if a teacher provides competency profiles and difficulties for tasks and tests, students also receive feedback about their achieved competencies by a pedagogic agent, which in the next version optionally recommends a learning path to the students based on their resilience.
Furthermore and independent of the other optional features, MoDTA optionally supports a state-of-the-art workflow by placing tickets for compile errors in a student-provided ticketing system link (currently supported: GitLab and Atlassian Jira).
## Overview
The MoDTA system comprises two key components:
• The MoDTA Moodle plugin, designed as an assignment submission tool.
• The DTA backend web service, which interfaces with the Moodle plugin through REST and employs the JSON file format for communication.
The plugin establishes communication with the external DTA backend REST web service offering the endpoints:
• POST /v1/unittest:** This endpoint requires the assignment ID and a text file containing the repository link (see usage below for an example). Optionally, it may include credentials, if the repository is private. Credentials should be formatted as "username:password" or "username:auth-token". Also optionally, the file may contain a link to a ticketing system in a new line of the same format. The results are returned in JSON format.
• POST /v1/tasks:** This API expects the assignment ID and a text file containing a repository link. Similar to the previous endpoint, it can also include an optional line for credentials when dealing with private repositories, using the same "username:password" or "username:auth-token" format. The results are provided in JSON format.
• DELETE /v1/unittest?assignmentId={id}:** Initiates the deletion of test files when provided with the assignment ID as a query parameter.
## Installation & Configuration
After approval, install the plugin directly from the Moodle Plugins Directory via Site Administration/Plugins/Install Plugins.
Before that or alternatively: zip the plugin code from https://transfer.hft-stuttgart.de/gitlab/HFTSoftwareProject/moodledta (here). The readily-zipped current version also sits in the repository’s main directory. Then install the plugin from zip via Site Administration/Plugins/Install Plugins, or by extracting the plugin archive to {Moodle_Root}/mod/assign/submission/dta and visiting the admins notifications page.
Visit Site Administration/Plugins/Plugin Overview and select Settings next to the Moodle Dockerized Test Agent (MoDTA) entry to enter the URI of your backend as shown in Fig. 1. ![Fig. 1: Plugin List](doc/install_conf_1.png) Finally, configure via Site Administration/Security/HTTP Security settings permitting communication with the backend URI and port as seen in Fig. 2. ![Fig. 2: DTA Configuration Dialog](doc/install_conf_2.png) The plugin requires the external DTA REST webservice backend.
Notes:
The universal DTA REST webservice backend is available under the GPLv3 as well at https://transfer.hft-stuttgart.de/gitlab/HFTSoftwareProject/dtabackend and the docker image at https://hub.docker.com/r/hftstuttgart/dta-backend . See the documentation in the repository for the necessary setup.
An example JDK 17 JUnit 5 test runner is available under GPLv3 as well at https://transfer.hft-stuttgart.de/gitlab/HFTSoftwareProject/dtatestrunner and the pre-built docker image at https://hub.docker.com/r/hftstuttgart/dta-jdk17-junit5-testrunner . The repository contains an example docker-compose.yaml for tests with a bitnami Moodle and MariaDB setup and the backend.
## Usage
With the MoDTA plugin installed and configured backend URI (including Moodle Security/HTTP Security settings permitting communication with that URI):
### Teacher
When creating an assignment, a teacher can select the MoDTA exercise as a new assignment type via an additional checkbox on the assignment creation page as shown at the bottom of Fig. 3. ![Fig. 3: Moodle DTA Activation Checkbox](doc/usage_teacher_1.png) A new standard file upload field appears as indicated in Fig. 4. ![Fig. 4: Moodle DTA Upload File Area](doc/usage_teacher_2.png). There, the teacher must upload a text file with the git repository URI containing the tests as shown in Fig. 5. ![Fig. 5: Moodle DTA Teacher Text File Upload](doc/usage_teacher_3.png) The text file has to adhere to the following format also given in the example repository:
The text file has to contain the following, each separated by ::
- dtt as the URI-type
- \<git https repository URI>
- \<git user name or the fixed string “none” for publicly accessible repositories>
- \<git password for the given user, git read access token for the repository, or the fixed string “none” for publicly accessible repositories>
- \<docker hub image for the test runner>
- optionally, an additional line of the same structure containing a ticketing system URI, user name and password or write access token
An example text file content looks like this:
dtt::https://transfer.hft-stuttgart.de/gitlab/dtt/example_openjdk11-junit5-calculator-test.git::none::none::hftstuttgart/dta-jdk17-junit5-testrunner:latest
Students use the same format, just without the runner part at the end.
### Student
Students use an additional MoDTA standard file upload field in the standard submission processs in Moodle like in Fig. 6. [Fig. 6: Moodle DTA Student File Upload](doc/usage_student_1.png) There, they place either a zip archive or a text file adhering to the same format as the teacher’s file with their code repository URI and optionally credentials and/or a ticketing system URI as shown in Fig. 7. ![Fig. 7: Moodle DTA Student Text File Upload](doc/usage_student_2.png)
Upon completion, students see a summarized overview of their test results in an additional column of the submission feedback table like in Fig. 8. ![Fig. 8: Moodle DTA Submission Result Summay](doc/usage_student_3.png) Clicking on a new expansion icon in that column, they reach a detailed feedback dialog including stack traces of compile errors and test failures as in Fig. 9. ![Fig. 9: Moodle DTA Student Detail Result View](doc/usage_student_4.png) Optionally, the MoDTA backend creates tickets for compile failures in the ticketing system under the URI provided by the student upon hand-in.
Note: Teachers have access to the Moodle submission result view to assess student results. However, teacher control and grading are not the focus of MoDTA.
### Technical Workflow
Assignment creation: The backend creates a temporary directory and checks out the test code from the given repository to that directory's subdirectory test. If the repository contains a file test-competencies.mft in its root directory with a structure described in the backend documentation, this enables the optional competency feedback.
Assignment submission: The MoDTA plugin passes the submission id and submitted text or zip file – no personal teacher student data – to the external DTA backend REST web service. The DTA backend REST web service fetches or extracts the code to the temporary directory's subdirectory src. It launches via docker a dedicated test runner based on the docker image provided in the teacher’s text file. This test runner compiles and executes the code, running the teacher-defined tests to evaluate the students' submission.
The runner returns the result in a file named result.json in the temporary directory's subdirectory result. The backend optionally enriches the result with competency feedback. It then returns the json result structure to the MoDTA moodle plugin. The MoDTA moodle plugin adds a new column to the submission result table and shows a result summary as well as an + button. Clicking on the + button, the student sees the detailed test results and, optionally, competency feedback.
## Plugin Detail Documentation – MoDTA Assignment Submission Plugin
The assignment submission plugin type was the most suitable choice with assignment feedback as another related option. It empowers you to present customized form fields to students during the assignment submission process and to teachers when configuring assignment settings. Moreover, it grants complete control over how submitted assignments are displayed to both graders and students.
The primary features of this plugin type include the ability to:
• Integrate additional settings into the module settings page for assignments.
• Provide a summary of the submission to students and teachers.
• Incorporate form fields into the student submission page for added flexibility and customization.
### File Structure
To ensure proper organization, all files related to the MoDTA assignment submission plugin reside in the directory path "mod/assign/submission/dta" within {Moodle_Root}.
### Language
The language files for our plugin are found under "lang/<country_code>/assignsubmission_dta.php." These files are organized into different subfolders depending on the language to be supported. For instance:
- English: "lang/en/assignsubmission_dta.php"
The filename corresponds to the component name of the plugin, structured as <plugintype>_<pluginname>, which, in our case, is "assignsubmission_dta." The repository delivers only English as requested by the Moodle team.
Each language file contains various key-value entries formatted as $string["key"] = "Value," with the key provided in English as the most widespread language remaining consistent across different language files, while the value varies according to the chosen language. Moodle incorporates a dedicated String API used In the plugin as required In the approval guidelines, allowing for easy value retrieval based on a given key and the selected language (e.g., get_string("key", "default value")).
### version.php
This file provides version information about the plugin to manage installation and upgrades.
### settings.php
The settings file defines two settings for the MoDTA plugin:
1. Default: This setting offers a checkbox to determine whether the plugin should be enabled by default when creating a new assignment.
2. Web Service Base URL: It features a text field where you can specify the base URL for the web service, facilitating file communication and actual testing.
### db/upgrade.php
This file is currently empty, as the data structure for the plugin has not changed so far.
### db/install.xml
This file defines the necessary database tables and rows for storing data associated with the MoDTA plugin. Moodle offers a specialized XML schema designed for modeling this information, featuring elements like TABLENAME, FIELDS, and KEY. The plugin utilizes two additional tables for cleanliness not to alter moodle standard tables:
assignsubmission_dta_summary which is related 1:1 to the submission and uses the assignment_id and submission_id as foreign keys, and assignsubmission_dta_result which stores the results of a submission as a 1:n relation to the assignsubmission_dta_summary. Whenever a new MoDTA assignment is submitted, the backend web service is engaged, returning one or more test results or compilation errors in the form of a JSON string. The front end parses this JSON string for the result summary and results and stores them in the appropriate tables.
### locallib.php
This is where all the functionality for this plugin is defined. All submission plugins must define a class with the component name of the plugin that extends assign_submission_plugin .
That yields the following class hierarchy:
The "assign_submission_plugin" class serves as an abstract foundation that all assignment submission plugins must build upon. It incorporates a limited set of supplementary functions tailored exclusively to submission plugins. On the other hand, the "assign_plugin" class is also an abstract class, but it functions as the fundamental class for all assignment plugins, encompassing both feedback and submission plugins. This class facilitates access to the assignment instance, represented as "$this->assignment." Collectively, these two classes offer a series of public functions, often referred to as "hooks," which are designed to be overridden to implement the required functionality.
The following provides brief descriptions of a selection of functions to illustrate the types of hooks available:
• get_settings(): This function comes into play during the creation of the assignment settings page. For the MoDTA plugin, this involves adding a file manager that permits teachers to upload their test repo and docker Image URI as a textfile. This function is overridden from the assign_plugin class.
• save_settings(): The save_settings function is invoked when the assignment settings page is submitted, whether for a new assignment or the modification of an existing one. In the MoDTA plugin, this function is responsible for preserving the text file chosen by the teacher and transmitting the file to the backend web service. Like the previous function, this one is overridden from the assign_plugin class.
• get_form_elements_for_user(): During the construction of the submission form, this function plays a similar role to the get_settings() function for settings. In the context of the MoDTA plugin, it adds a file manager to enable students to upload their text or zip file. Once again, this function is overridden from the assign_plugin class.
• save():This function is invoked to save a user's submission. Within the MoDTA plugin, this function sends the student's submission to the backend and receives the result as the response. For details see the technical details section above.
• view_summary(): This function is called to display a summary of the submission to both teachers and students. For the students, this summary will be shown within the submission status table and for the teachers within a column of the grading table. In the MoDTA plugin this method returns a more compact view (only essential data) for the grading table and a detailed view for the students submission status table.
### lib.php
This file serves as the gateway to various standard Moodle APIs designed for plugins. In the content of the MoDTA plugin, this function is denoted as "assignsubmission_dta_pluginfile."
### util folder
The folder contains various utility files, e.g. displaying the new test summary pages is delegated from the locallib.php for brevity of that source.
<?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 backend webservice contact functionality for the DTA plugin
*
* @package assignsubmission_dta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright Gero Lueckemeyer and student project teams
*/
/**
* backend webservice contact utility class
*
* @package assignsubmission_dta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright Gero Lueckemeyer and student project teams
*/
class DtaBackendUtils {
/**
* Returns the base url of the backend webservice as configured in the administration settings.
* @return string backend host base url
*/
private static function getbackendbaseurl(): string {
$backendaddress = get_config(assign_submission_dta::COMPONENT_NAME, "backendHost");
if (empty($backendaddress)) {
\core\notification::error(get_string("backendHost_not_set", assign_submission_dta::COMPONENT_NAME));
}
return $backendaddress;
}
/**
* Sends the configuration textfile uploaded by prof to the backend.
*
* @param stdClass $assignment assignment this test-config belongs to
* @param stdClass $file uploaded test-config
* @return bool true if no error occurred
*/
public static function sendtestconfigtobackend($assignment, $file): bool {
$backendaddress = self::getbackendbaseurl();
if (empty($backendaddress)) {
return true;
}
// Set endpoint for test upload.
$url = $backendaddress . "/v1/unittest";
// Prepare params.
$params = [
"unitTestFile" => $file,
"assignmentId" => $assignment->get_instance()->id,
];
// If request returned null, return false to indicate failure.
if (is_null(self::post($url, $params))) {
return false;
} else {
return true;
}
}
/**
* 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, $submissionid, $file): ?string {
$backendaddress = self::getbackendbaseurl();
if (empty($backendaddress)) {
return true;
}
// Set endpoint for test upload.
$url = $backendaddress . "/v1/task/" . $submissionid;
// Prepare params.
$params = [
"taskFile" => $file,
"assignmentId" => $assignment->get_instance()->id,
];
return self::post($url, $params);
}
/**
* Posts the given params to the given url and returns the response as a string.
* @param string $url full url to request to
* @param array $params parameters for http-request
*
* @return string received body on success or null on error
*/
private static function post($url, $params): ?string {
if (!isset($url) || !isset($params)) {
return false;
}
$options = ["CURLOPT_RETURNTRANSFER" => true];
$curl = new curl();
$response = $curl->post($url, $params, $options);
// Check state of request, if response code is a 2xx return the answer.
$info = $curl->get_info();
if ($info["http_code"] >= 200 && $info["http_code"] < 300) {
return $response;
}
// Something went wrong, return null and give an error message.
debugging(assign_submission_dta::COMPONENT_NAME . ": Post file to server was not successful: http_code=" .
$info["http_code"]);
if ($info['http_code'] >= 400 && $info['http_code'] < 500) {
\core\notification::error(get_string("http_client_error_msg", assign_submission_dta::COMPONENT_NAME));
return null;
} else if ($info['http_code'] >= 500 && $info['http_code'] < 600) {
\core\notification::error(get_string("http_server_error_msg", assign_submission_dta::COMPONENT_NAME));
return null;
} else {
\core\notification::error(get_string("http_unknown_error_msg", assign_submission_dta::COMPONENT_NAME) .
$info["http_code"] . $response);
return null;
}
}
}
<?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/>.
/**
* persistence layer utility class
*
* @package assignsubmission_dta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright Gero Lueckemeyer and student project teams
*/
class DbUtils {
/**
* Summary database table name.
*/
private const TABLE_SUMMARY = "assignsubmission_dta_summary";
/**
* Result database table name.
*/
private const TABLE_RESULT = "assignsubmission_dta_result";
/**
* gets summary with all corresponding result entries
*
* @param int $assignmentid assignment id to search for
* @param int $submissionid submission id to search for
* @return DttResultSummary representing given submission
*/
public static function getresultsummaryfromdatabase(
int $assignmentid,
int $submissionid
): DtaResultSummary {
global $DB;
// Fetch data from database.
$summaryrecord = $DB->get_record(self::TABLE_SUMMARY, [
"assignment_id" => $assignmentid,
"submission_id" => $submissionid,
]);
$resultsarray = $DB->get_records(self::TABLE_RESULT, [
"assignment_id" => $assignmentid,
"submission_id" => $submissionid,
]);
// Create a summary instance.
$summary = new DtaResultSummary();
$summary->timestamp = $summaryrecord->timestamp;
$summary->globalstacktrace = $summaryrecord->global_stacktrace;
$summary->successfultestcompetencies = $summaryrecord->successful_competencies;
$summary->overalltestcompetencies = $summaryrecord->tested_competencies;
$summary->results = [];
// Create result instances and add to array of summary instance.
foreach ($resultsarray as $rr) {
$result = new DtaResult();
$result->packagename = $rr->package_name;
$result->classname = $rr->class_name;
$result->name = $rr->name;
$result->state = $rr->state;
$result->failuretype = $rr->failure_type;
$result->failurereason = $rr->failure_reason;
$result->stacktrace = $rr->stacktrace;
$result->columnnumber = $rr->column_number;
$result->linenumber = $rr->line_number;
$result->position = $rr->position;
$summary->results[] = $result;
}
return $summary;
}
/**
* save given result summary and single results to database
* under given assignment and submission id
*
* @param int $assignmentid assigment this is submission is linked to
* @param int $submissionid submission of this result
* @param DtaResultSummary $summary instance to persist
*/
public static function storeresultsummarytodatabase(
int $assignmentid,
int $submissionid,
DtaResultSummary $summary
): void {
global $DB;
// Prepare new database entries.
$summaryrecord = new stdClass();
$summaryrecord->assignment_id = $assignmentid;
$summaryrecord->submission_id = $submissionid;
$summaryrecord->timestamp = $summary->timestamp;
$summaryrecord->global_stacktrace = $summary->globalstacktrace;
$summaryrecord->successful_competencies = $summary->successfultestcompetencies;
$summaryrecord->tested_competencies = $summary->overalltestcompetencies;
// Prepare results to persist to array.
$resultrecords = [];
foreach ($summary->results as $r) {
$record = new stdClass();
$record->assignment_id = $assignmentid;
$record->submission_id = $submissionid;
$record->package_name = $r->packagename;
$record->class_name = $r->classname;
$record->name = $r->name;
$record->state = $r->state;
$record->failure_type = $r->failuretype;
$record->failure_reason = $r->failurereason;
$record->stacktrace = $r->stacktrace;
$record->column_number = $r->columnnumber;
$record->line_number = $r->linenumber;
$record->position = $r->position;
$resultrecords[] = $record;
}
// If results already exist, delete old values beforehand.
$submission = $DB->get_record(self::TABLE_SUMMARY, [
'assignment_id' => $assignmentid,
'submission_id' => $submissionid,
]);
if ($submission) {
$DB->delete_records(self::TABLE_RESULT, [
'assignment_id' => $assignmentid,
'submission_id' => $submissionid,
]);
$DB->delete_records(self::TABLE_SUMMARY, [
'assignment_id' => $assignmentid,
'submission_id' => $submissionid,
]);
}
// Create summary and single result entries.
$DB->insert_record(self::TABLE_SUMMARY, $summaryrecord);
foreach ($resultrecords as $rr) {
$DB->insert_record(self::TABLE_RESULT, $rr);
}
}
/**
* cleans up database if plugin is uninstalled
*/
public static function uninstallplugincleaup(): void {
global $DB;
$DB->delete_records(self::TABLE_RESULT, null);
$DB->delete_records(self::TABLE_SUMMARY, null);
}
}
<?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/>.
namespace assignsubmission_dta\privacy;
use core_privacy\local\metadata\collection;
use core_privacy\local\request\writer;
use core_privacy\local\request\contextlist;
use mod_assign\privacy\assign_plugin_request_data;
/**
* provider for data privacy
*
* @package assignsubmission_dta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright Gero Lueckemeyer and student project teams
*/
class provider implements \core_privacy\local\metadata\provider,
\mod_assign\privacy\assignsubmission_provider,
\mod_assign\privacy\assignsubmission_user_provider {
/**
* File area for dta submission assignment.
*/
const ASSIGNSUBMISSION_DTA_FILEAREA_SUBMISSION = "submissions_dta";
/**
* This is the metadata information for the assignsubmission_dta plugin.
* @param collection $collection the collection of metadata filled by the plugin
*/
public static function get_metadata(collection $collection): collection {
$collection->add_subsystem_link(
'core_files',
[],
'privacy:metadata:core_files'
);
$collection->add_database_table(
'assignsubmission_dta_summary',
[
'assignmentid' => 'privacy:metadata:assignsubmission_dta_summary:assignmentid',
'submissionid' => 'privacy:metadata:assignsubmission_dta_summary:submissionid',
'timestamp' => 'privacy:metadata:assignsubmission_dta_summary:timestamp',
'global_stacktrace' => 'privacy:metadata:assignsubmission_dta_summary:global_stacktrace',
'successful_competencies' => 'privacy:metadata:assignsubmission_dta_summary:successful_competencies',
'tested_competencies' => 'privacy:metadata:assignsubmission_dta_summary:tested_competencies',
],
'privacy:metadata:assignsubmission_dta_summary'
);
$collection->add_database_table(
'assignsubmission_dta_result',
[
'assignmentid' => 'privacy:metadata:assignsubmission_dta_summary:assignmentid',
'submissionid' => 'privacy:metadata:assignsubmission_dta_summary:submissionid',
'package_name' => 'privacy:metadata:assignsubmission_dta_result:package_name',
'class_name' => 'privacy:metadata:assignsubmission_dta_result:class_name',
'name' => 'privacy:metadata:assignsubmission_dta_result:name',
'state' => 'privacy:metadata:assignsubmission_dta_result:state',
'failure_type' => 'privacy:metadata:assignsubmission_dta_result:failure_type',
'failure_reason' => 'privacy:metadata:assignsubmission_dta_result:failure_reason',
'stacktrace' => 'privacy:metadata:assignsubmission_dta_result:stacktrace',
'column_number' => 'privacy:metadata:assignsubmission_dta_result:column_number',
'line_number' => 'privacy:metadata:assignsubmission_dta_result:line_number',
'position' => 'privacy:metadata:assignsubmission_dta_result:position',
],
'privacy:metadata:assignsubmission_dta_result'
);
$collection->add_external_location_link('dta_backend', [
'assignmentid' => 'privacy:metadata:assignsubmission_dta_summary:assignmentid',
'submissionid' => 'privacy:metadata:assignsubmission_dta_summary:submissionid',
'submissioncontent' => 'privacy:metadata:core_files',
],
'privacy:metadata:dta_backend'
);
return $collection;
}
/**
* This is covered by mod_assign provider and the query on assign_submissions.
*
* @param int $userid The user ID that we are finding contexts for.
* @param contextlist $contextlist A context list to add sql and params to for contexts.
*/
public static function get_context_for_userid_within_submission(int $userid, contextlist $contextlist) {
// This is already fetched from mod_assign.
}
/**
* This is also covered by the mod_assign provider and its queries.
*
* @param \mod_assign\privacy\useridlist $useridlist An object for obtaining user IDs of students.
*/
public static function get_student_user_ids(\mod_assign\privacy\useridlist $useridlist) {
// This is already fetched from mod_assign.
}
/**
* If you have tables that contain userids and you can generate entries in your tables without creating an
* entry in the assign_submission table then please fill in this method.
*
* @param userlist $userlist The userlist object
*/
public static function get_userids_from_context(\core_privacy\local\request\userlist $userlist) {
// Not required.
}
/**
* Export all user data for this plugin.
*
* @param assign_plugin_request_data $exportdata Data used to determine which context and user to export and other useful
* information to help with exporting.
*/
public static function export_submission_user_data(assign_plugin_request_data $exportdata) {
// We currently don't show submissions to teachers when exporting their data.
$context = $exportdata->get_context();
if ($exportdata->get_user() != null) {
return null;
}
$user = new \stdClass();
$assign = $exportdata->get_assign();
$submission = $exportdata->get_pluginobject();
$files = get_files($submission, $user);
foreach ($files as $file) {
$userid = $exportdata->get_pluginobject()->userid;
$dtaresultsummary = DBUtils::getresultsummaryfromdatabase($assign->id, $submission->id);
// Submitted file.
writer::with_context($exportdata->get_context())->export_file($exportdata->get_subcontext(), $file)
// DTA result.
->export_related_data($dtaresultsummary);
// Plagiarism data.
$coursecontext = $context->get_course_context();
\core_plagiarism\privacy\provider::export_plagiarism_user_data($userid, $context, $exportdata->get_subcontext(), [
'cmid' => $context->instanceid,
'course' => $coursecontext->instanceid,
'userid' => $userid,
'file' => $file,
]);
}
}
/**
* Any call to this method should delete all user data for the context defined in the deletion_criteria.
*
* @param assign_plugin_request_data $requestdata Information useful for deleting user data.
*/
public static function delete_submission_for_context(assign_plugin_request_data $requestdata) {
global $DB;
\core_plagiarism\privacy\provider::delete_plagiarism_for_context($requestdata->get_context());
$fs = get_file_storage();
$fs->delete_area_files($requestdata->get_context()->id, 'assignsubmission_dta', ASSIGNSUBMISSION_DTA_FILEAREA_SUBMISSION);
$assignmentid = $requestdata->get_assign()->get_instance()->id;
// Delete records from assignsubmission_dta tables.
$DB->delete_records('assignsubmission_dta_result', ['assignmentid' => $assignmentid]);
$DB->delete_records('assignsubmission_dta_summary', ['assignmentid' => $assignmentid]);
}
/**
* A call to this method should delete user data (where practical) using the userid and submission.
*
* @param assign_plugin_request_data $deletedata Details about the user and context to focus the deletion.
*/
public static function delete_submission_for_userid(assign_plugin_request_data $deletedata) {
global $DB;
\core_plagiarism\privacy\provider::delete_plagiarism_for_user($deletedata->get_user()->id, $deletedata->get_context());
$assignmentid = $deletedata->get_assign()->get_instance()->id;
$submissionid = $deletedata->get_pluginobject()->id;
$fs = get_file_storage();
$fs->delete_area_files($deletedata->get_context()->id, 'assignsubmission_dta', ASSIGNSUBMISSION_DTA_FILEAREA_SUBMISSION,
$submissionid);
// Delete records from assignsubmission_dta tables. Also possible with a list as below.
$DB->delete_records('assignsubmission_dta_result', [
'assignmentid' => $assignmentid,
'submissionid' => $submissionid,
]);
$DB->delete_records('assignsubmission_dta_summary', [
'assignmentid' => $assignmentid,
'submissionid' => $submissionid,
]);
}
/**
* Deletes all submissions for the submission ids / userids provided in a context.
* assign_plugin_request_data contains:
* - context
* - assign object
* - submission ids (pluginids)
* - user ids
* @param assign_plugin_request_data $deletedata A class that contains the relevant information required for deletion.
*/
public static function delete_submissions(assign_plugin_request_data $deletedata) {
global $DB;
\core_plagiarism\privacy\provider::delete_plagiarism_for_users($deletedata->get_userids(), $deletedata->get_context());
if (empty($deletedata->get_submissionids())) {
return;
}
$fs = get_file_storage();
list($sql, $params) = $DB->get_in_or_equal($deletedata->get_submissionids(), SQL_PARAMS_NAMED);
$fs->delete_area_files_select($deletedata->get_context()->id, 'assignsubmission_file', ASSIGNSUBMISSION_FILE_FILEAREA,
$sql, $params);
$params['assignid'] = $deletedata->get_assignid();
$DB->delete_records_select('assignsubmission_dta_result', "assignmentid = :assignid AND submissionid $sql", $params);
$DB->delete_records_select('assignsubmission_dta_summary', "assignmentid = :assignid AND submissionid $sql", $params);
}
/**
* Produce a list of files suitable for export that represent this feedback or submission
*
* @param stdClass $submission The submission
* @param stdClass $user The user record - unused
* @return array - return an array of files indexed by filename
*/
public function get_files(stdClass $submission, stdClass $user) {
$result = [];
$fs = get_file_storage();
$files = $fs->get_area_files($this->assignment->get_context()->id,
'assignsubmission_file',
ASSIGNSUBMISSION_DTA_FILEAREA_SUBMISSION,
$submission->id,
'timemodified',
false);
foreach ($files as $file) {
// Do we return the full folder path or just the file name?
if (isset($submission->exportfullpath) && $submission->exportfullpath == false) {
$result[$file->get_filename()] = $file;
} else {
$result[$file->get_filepath().$file->get_filename()] = $file;
}
}
return $result;
}
}
<?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/>.
/**
* utility class for DTA submission plugin result display
*
* @package assignsubmission_dta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright Gero Lueckemeyer and student project teams
*/
class view_submission_utils {
/**
* Broadly used in logic, parametrized for easier change.
*/
const COMPONENT_NAME = "assignsubmission_dta";
/**
* generates a short summary html
*
* @param int $assignmentid assignment
* @param int $submissionid submission to create a report for
* @return string html
*/
public static function generatesummaryhtml(
int $assignmentid,
int $submissionid
): string {
// Fetch data.
$summary = DbUtils::getResultSummaryFromDatabase($assignmentid, $submissionid);
$html = "";
// Calculate success rate, if no unknown result states or compilation errors.
$successrate = "?";
if ($summary->unknownCount() == 0 && $summary->compilationErrorCount() == 0) {
$successrate = round(($summary->successfulCount() / $summary->resultCount()) * 100, 2 );
}
// Generate html.
$html .= $summary->successfulCount() . "/";
$html .= ($summary->compilationErrorCount() == 0 && $summary->unknownCount() == 0)
? $summary->resultCount() . " (" . $successrate . "%)"
: "?";
$html .= get_string("tests_successful", self::COMPONENT_NAME) . "<br />";
if ($summary->compilationErrorCount() > 0) {
$html .= $summary->compilationErrorCount() . get_string("compilation_errors", self::COMPONENT_NAME) . "<br />";
}
if ($summary->unknownCount() > 0) {
$html .= $summary->unknownCount() . get_string("unknown_state", self::COMPONENT_NAME) . "<br />";
}
$showncompetencies = explode(";", $summary->successfultestcompetencies);
$overallcompetencies = explode(";", $summary->overalltestcompetencies);
$tmp = "";
for ($index = 0, $size = count($showncompetencies); $index < $size; $index++) {
$shown = $showncompetencies[$index];
$comp = $overallcompetencies[$index];
// If the competency was actually assessed by the assignment and tests, add a summary entry.
if ($shown != "0") {
$tmp .= get_string("comp" . $index, self::COMPONENT_NAME) .
" " . 100 * floatval($shown) / floatval($comp) . "% " . "<br />";
}
}
$html .= get_string("success_competencies", self::COMPONENT_NAME) . "<br />" . $tmp . "<br />";
return html_writer::div($html, "dtaSubmissionSummary");
}
/**
* generates detailed view html
*
* @param int $assignmentid assignment
* @param int $submissionid submission to create a report for
*/
public static function generatedetailhtml(
int $assignmentid,
int $submissionid
): string {
// Fetch data.
$summary = DbUtils::getResultSummaryFromDatabase($assignmentid, $submissionid);
$html = "";
// Define a few css classes and prepare html attribute arrays to beautify the output.
$tableheaderrowattributes = ["class" => "dtaTableHeaderRow"];
$tablerowattributes = ["class" => "dtaTableRow"];
$resultrowattributes = $tablerowattributes;
$unknownattributes = 'dtaResultUnknown';
$successattributes = 'dtaResultSuccess';
$failureattributes = 'dtaResultFailure';
$compilationerrorattributes = 'dtaResultCompilationError';
// Summary table.
$tmp = "";
$tmp .= html_writer::tag("th", get_string("summary", self::COMPONENT_NAME), ["class" => "dtaTableHeader"]);
$tmp .= html_writer::empty_tag("th", ["class" => "dtaTableHeader"]);
$header = html_writer::tag("tr", $tmp, $tableheaderrowattributes);
$header = html_writer::tag("thead", $header);
$body = "";
$tmp = "";
$attributes = ["class" => "dtaTableData"];
$tmp .= html_writer::tag(
"td",
get_string("total_items", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$summary->resultCount(),
$attributes);
$resultrowattributes = $tablerowattributes;
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $unknownattributes;
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td", get_string("tests_successful", self::COMPONENT_NAME), $attributes);
$tmp .= html_writer::tag( "td", $summary->successfulCount(), $attributes);
$resultrowattributes = $tablerowattributes;
$successrate = "?";
if ($summary->unknownCount() > 0 || $summary->compilationErrorCount() > 0) {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $unknownattributes;
} else {
$successrate = round(($summary->successfulCount() / $summary->resultCount()) * 100, 2 );
if ($successrate < 50) {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $compilationerrorattributes;
} else if ($successrate < 75) {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $failureattributes;
} else {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $successattributes;
}
}
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td", get_string("failures", self::COMPONENT_NAME), $attributes);
$tmp .= html_writer::tag("td", $summary->failedCount(), $attributes);
$resultrowattributes = $tablerowattributes;
if ($summary->failedCount() > 0) {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $failureattributes;
} else {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $successattributes;
}
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td", get_string("compilation_errors", self::COMPONENT_NAME), $attributes);
$tmp .= html_writer::tag("td", $summary->compilationErrorCount(), $attributes);
$resultrowattributes = $tablerowattributes;
if ($summary->compilationErrorCount() > 0) {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $compilationerrorattributes;
} else {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $successattributes;
}
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td", get_string("unknown_state", self::COMPONENT_NAME), $attributes);
$tmp .= html_writer::tag("td", $summary->unknownCount(), $attributes);
$resultrowattributes = $tablerowattributes;
if ($summary->unknownCount() > 0) {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $unknownattributes;
} else {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $successattributes;
}
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag("td", html_writer::tag("b", get_string("success_rate", self::COMPONENT_NAME)), $attributes);
$tmp .= html_writer::tag(
"td",
html_writer::tag("b", $summary->successfulCount()
. "/" . (($summary->compilationErrorCount() == 0 && $summary->unknownCount() == 0) ? $summary->resultCount()
. " (" . $successrate . "%)"
: "?")),
$attributes);
$resultrowattributes = $tablerowattributes;
if ($summary->unknownCount() > 0 || $summary->compilationErrorCount() > 0) {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $unknownattributes;
} else {
if ($successrate < 50) {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $compilationerrorattributes;
} else if ($successrate < 75) {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $failureattributes;
} else {
$resultrowattributes['class'] = $resultrowattributes['class'] . " " . $successattributes;
}
}
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$body = html_writer::tag("tbody", $body);
$table = html_writer::tag("table", $header . $body, ["class" => "dtaTable"]);
$html .= $table;
// Add empty div for spacing between summary and compentency table.
$html .= html_writer::empty_tag("div", ["class" => "dtaSpacer"]);
// Competency assessment table.
$body = "";
$tmp = "";
$tmp .= html_writer::tag("th", get_string("competencies", self::COMPONENT_NAME), ["class" => "dtaTableHeader"]);
$tmp .= html_writer::empty_tag("th", ["class" => "dtaTableHeader"]);
$header = html_writer::tag("tr", $tmp, $tableheaderrowattributes);
$header = html_writer::tag("thead", $header);
$showncompetencies = explode(";", $summary->successfultestcompetencies);
$overallcompetencies = explode(";", $summary->overalltestcompetencies);
for ($index = 0, $size = count($overallcompetencies); $index < $size; $index++) {
$comp = $overallcompetencies[$index];
$shown = $showncompetencies[$index];
// If the competency was actually assessed by the assignment and tests, add a row in the table.
if ($comp != "0") {
// New copy of base attributes array.
$resultrowattributes = $tablerowattributes;
$tmp = "";
$tmp .= html_writer::tag("td", get_string("comp" . $index, self::COMPONENT_NAME), $resultrowattributes);
$tmp .= html_writer::tag("td", 100 * floatval($shown) / floatval($comp) . "% " .
"(" . $shown . " / " . $comp . ")", $resultrowattributes);
$tmp .= html_writer::tag("td", get_string("comp_expl" . $index, self::COMPONENT_NAME), $resultrowattributes);
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
}
}
$body = html_writer::tag("tbody", $body);
$html .= html_writer::tag("table", $header . $body, ["class" => "dtaTable"]);
// Add empty div for spacing between competency and details table.
$html .= html_writer::empty_tag("div", ["class" => "dtaSpacer"]);
// Details table.
$tmp = "";
$tmp .= html_writer::tag("th", get_string("details", self::COMPONENT_NAME), ["class" => "dtaTableHeader"]);
$tmp .= html_writer::empty_tag("th", ["class" => "dtaTableHeader"]);
$header = html_writer::tag("tr", $tmp, $tableheaderrowattributes);
$header = html_writer::tag("thead", $header);
$body = "";
$spacerrow = null;
foreach ($summary->results as $r) {
// Add spacer first if not null.
if (!is_null($spacerrow)) {
$body .= $spacerrow;
}
// New copy of base attributes array.
$resultrowattributes = $tablerowattributes;
// Check which css class to add for the colored left-border according to resuls state.
if ($r->state == 0) {
$resultrowattributes['class'] = $resultrowattributes['class'] . ' dtaResultUnknown';
} else if ($r->state == 1) {
$resultrowattributes['class'] = $resultrowattributes['class'] . ' dtaResultSuccess';
} else if ($r->state == 2) {
$resultrowattributes['class'] = $resultrowattributes['class'] . ' dtaResultFailure';
} else if ($r->state == 3) {
$resultrowattributes['class'] = $resultrowattributes['class'] . ' dtaResultCompilationError';
}
$tmp = "";
$tmp .= html_writer::tag(
"td",
get_string("package_name", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$r->packagename,
$attributes);
$tmp .= html_writer::tag(
"td",
get_string("unit_name", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$r->classname,
$attributes);
$tmp .= html_writer::tag(
"td",
get_string("test_name", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$r->name,
$attributes);
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag(
"td",
get_string("status", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
DtaResult::getStateName($r->state),
$attributes);
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
// If state is something different than successful, show additional rows.
if ($r->state != 1) {
$tmp = "";
$tmp .= html_writer::tag(
"td",
get_string("failure_type", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$r->failureType,
$attributes);
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
$tmp = "";
$tmp .= html_writer::tag(
"td",
get_string("failure_reason", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$r->failureReason,
$attributes);
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
// Only show line, column and position if they have useful values.
if (!is_null($r->lineNumber) && $r->lineNumber > 0) {
$tmp = "";
$tmp .= html_writer::tag(
"td",
get_string("line_no", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$r->lineNumber,
$attributes);
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
}
if (!is_null($r->columnNumber) && $r->columnNumber > 0) {
$tmp = "";
$tmp .= html_writer::tag(
"td",
get_string("col_no", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$r->columnNumber,
$attributes);
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
}
if (!is_null($r->position) && $r->position > 0) {
$tmp = "";
$tmp .= html_writer::tag(
"td",
get_string("pos", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
$r->position,
$attributes);
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
}
$tmp = "";
$tmp .= html_writer::tag(
"td",
get_string("stacktrace", self::COMPONENT_NAME),
$attributes);
$tmp .= html_writer::tag(
"td",
html_writer::tag("details", $r->stacktrace, ["class" => "dtaStacktraceDetails"]),
$attributes);
$body .= html_writer::tag("tr", $tmp, $resultrowattributes);
}
// Set spacerrow value if null for next round separation.
if (is_null($spacerrow)) {
$spacerrow = html_writer::empty_tag("tr", ["class" => "dtaTableSpacer"]);
}
}
$html .= html_writer::tag("table", $header . $body, ["class" => "dtaTable"]);
// Wrap generated html into final div.
$html = html_writer::div($html, "dtaSubmissionDetails");
return $html;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/assign/submission/dta/db" VERSION="20210107" COMMENT="XMLDB file for Moodle mod/assign/submission/dta"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="assignsubmission_dta_summary" COMMENT="DTA 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="successful_competencies" TYPE="char" LENGTH="80" NOTNULL="false"/>
<FIELD NAME="tested_competencies" TYPE="char" LENGTH="80" NOTNULL="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_dta_result" COMMENT="DTA 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="package_name" TYPE="char" LENGTH="255" NOTNULL="false"/>
<FIELD NAME="class_name" TYPE="char" LENGTH="255" NOTNULL="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_dta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright Gero Lueckemeyer and student project teams
*/
/**
* Stub for upgrade code
* @param int $oldversion
* @return bool
*/
function xmldb_assignsubmission_dta_upgrade($oldversion) {
global $CFG;
// Currently no adjustments necessary for Moodle upgrades. Works without changes since the first MoJEC version.
return true;
}
<?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/>.
/**
* Strings for component "assignsubmission_dta", language "en"
*
* @package assignsubmission_dta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright Gero Lueckemeyer and student project teams
*/
// General.
$string["pluginname"] = "Dockerized Testing Agent (DTA)";
$string["enabled"] = $string["pluginname"];
// Dialog field labels.
$string["submission_label"] = "DTA submission configuration or zip-packed project";
$string["submission_label_help"] = "Either upload a single textfile containing one DTA 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"] = "DTA test configuration";
$string["submission_settings_label_help"] = "single text file with DTA test URI";
$string["enabled_help"] = "If enabled, you will have to upload a textfile containing a valid DTA 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 resembling the expected repository structure or as well by providing a textifle with a valid DTA URI pointing to the repository with their submission logic";
// Content.
$string["tests_successful"] = " successful";
$string["failures"] = " failure";
$string["compilation_errors"] = " compilation error";
$string["unknown_state"] = " with unknown state";
$string["success_competencies"] = "Successfully tested competency profile ";
$string["summary"] = "Summary";
$string["total_items"] = "Total items";
$string["success_rate"] = "Success rate";
$string["details"] = "Details";
$string["competencies"] = "Competencies";
$string["package_name"] = "Package Name";
$string["unit_name"] = "Unit Name";
$string["test_name"] = "Test Name";
$string["status"] = "Status";
$string["failure_type"] = "Failure Type";
$string["failure_reason"] = "Failure Reason";
$string["line_no"] = "Line Number";
$string["col_no"] = "Column Number";
$string["pos"] = "Position";
$string["stacktrace"] = "Stack Trace";
// Comeptencies.
$string["comp_statement"] = "Statement";
$string["comp_block"] = "Block";
$string["comp_flow"] = "Flow of Control";
$string["comp_loop"] = "Repetition";
$string["comp_const"] = "Constant";
$string["comp_var"] = "Variable";
$string["comp_type"] = "Type";
$string["comp_datastructure"] = "Data Structure";
$string["comp_interface"] = "Interface";
$string["comp_unit"] = "Unit of Code";
$string["comp_proc_usage"] = "Procedure Usage";
$string["comp_proc_sign"] = "Procedure Signature";
$string["comp_library"] = "Library Usage";
$string["comp_ext_api"] = "External API Usage";
$string["comp_simple"] = "Simplicity";
$string["comp_abstraction"] = "Abstraction";
// Competencies for index calculation.
$string["comp0"] = $string["comp_statement"];
$string["comp1"] = $string["comp_block"];
$string["comp2"] = $string["comp_flow"];
$string["comp3"] = $string["comp_loop"];
$string["comp4"] = $string["comp_const"];
$string["comp5"] = $string["comp_var"];
$string["comp6"] = $string["comp_type"];
$string["comp7"] = $string["comp_datastructure"];
$string["comp8"] = $string["comp_interface"];
$string["comp9"] = $string["comp_unit"];
$string["comp10"] = $string["comp_proc_usage"];
$string["comp11"] = $string["comp_proc_sign"];
$string["comp12"] = $string["comp_library"];
$string["comp13"] = $string["comp_ext_api"];
$string["comp14"] = $string["comp_simple"];
$string["comp15"] = $string["comp_abstraction"];
// Competency explanations.
$string["comp_statement_expl"] = "formulate a syntactically correct statement that contributes to the solution of the given problem.";
$string["comp_block_expl"] = "structure code into syntactically correct small unnamed units that contribute to the solution of the given problem.";
$string["comp_flow_expl"] = "formulate syntax elements guiding the control flow such that it contributes to the solution of the given problem.";
$string["comp_loop_expl"] = "use syntax elements repeating statements such that it contributes to the solution of the given problem.";
$string["comp_const_expl"] = "identify and syntactically correctly define constants that contribute to the understanding and solution of the given problem.";
$string["comp_var_expl"] = "identify and syntactically correctly define variables that contribute to the solution of the given problem.";
$string["comp_type_expl"] = "define and/or choose appropriate data types for data elements such that they contribute to the solution of the given problem.";
$string["comp_datastructure_expl"] = "define and/or choose appropriate data structures for data elements such that they contribute to the solution of the given problem.";
$string["comp_interface_expl"] = "define and use interfaces for larger units of code such that it contributes to the solution of the given problem.";
$string["comp_unit_expl"] = "define and larger units of code such that it contributes to the solution of the given problem.";
$string["comp_proc_usage_expl"] = "use existing named structure blocks with a pre-defined behavior and signature such that it contributes to the solution of the given problem.";
$string["comp_proc_sign_expl"] = "define named structure blocks with a pre-defined behavior and signature such that it contributes to the solution of the given problem.";
$string["comp_library_expl"] = "use existing larger collections of named structure blocks with a pre-defined behavior and signature such that it contributes to the solution of the given problem.";
$string["comp_ext_api_expl"] = "use standardized existing external collections of named structure blocks with a pre-defined behavior and signature such that it contributes to the solution of the given problem.";
$string["comp_simple_expl"] = "create a simple solution of the given problem.";
$string["comp_abstraction_expl"] = "create a sufficiently abstract solution for the given problem.";
// Competency explanations for index calculations.
$string["comp_expl0"] = $string["comp_statement_expl"];
$string["comp_expl1"] = $string["comp_block_expl"];
$string["comp_expl2"] = $string["comp_flow_expl"];
$string["comp_expl3"] = $string["comp_loop_expl"];
$string["comp_expl4"] = $string["comp_const_expl"];
$string["comp_expl5"] = $string["comp_var_expl"];
$string["comp_expl6"] = $string["comp_type_expl"];
$string["comp_expl7"] = $string["comp_datastructure_expl"];
$string["comp_expl8"] = $string["comp_interface_expl"];
$string["comp_expl9"] = $string["comp_unit_expl"];
$string["comp_expl10"] = $string["comp_proc_usage_expl"];
$string["comp_expl11"] = $string["comp_proc_sign_expl"];
$string["comp_expl12"] = $string["comp_library_expl"];
$string["comp_expl13"] = $string["comp_ext_api_expl"];
$string["comp_expl14"] = $string["comp_simple_expl"];
$string["comp_expl15"] = $string["comp_abstraction_expl"];
// Warnings.
$string["no_testfile_warning"] = "Submission type is \"Dockerized Testing Agent\" but no configuration file uploaded";
// Error messages.
$string["backendHost_not_set"] = "The Dockerized Testing Agent backend URL is not configured";
$string["no_submissionfile_warning"] = "Submission type is \"Dockerized Testing Agent\" but no configuration file or submission archive 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";
$string["backendHost_help"] = "Address/Name and Port of backend server";
// Database field descriptions for privacy API.
$string["privacy:metadata:core_files"] = "Moodle core files.";
$string["privacy:metadata:assignsubmission_dta_summary:assignmentid"] = "ID of the assignment";
$string["privacy:metadata:assignsubmission_dta_summary:submissionid"] = "ID of the submission";
$string["privacy:metadata:assignsubmission_dta_summary:timestamp"] = "Date and time of the submission";
$string["privacy:metadata:assignsubmission_dta_summary"] = "Stack trace of the compilation and test if major problems occur";
$string["privacy:metadata:assignsubmission_dta_summary:successful_competencies"] = "List of the successfully tested competencies";
$string["privacy:metadata:assignsubmission_dta_summary:tested_competencies"] = "List of the tested competencies";
$string["privacy:metadata:assignsubmission_dta_summary"] = "Summary of Dockerized Test Agent (DTA) results";
$string["privacy:metadata:assignsubmission_dta_result:package_name"] = "Package name of individual test";
$string["privacy:metadata:assignsubmission_dta_result:class_name"] = "Class name of individual test";
$string["privacy:metadata:assignsubmission_dta_result:name"] = "Name of individual test";
$string["privacy:metadata:assignsubmission_dta_result:state"] = "State of individual test";
$string["privacy:metadata:assignsubmission_dta_result:failure_type"] = "Failure type of individual test";
$string["privacy:metadata:assignsubmission_dta_result:failure_reason"] = "Failure reason of individual test";
$string["privacy:metadata:assignsubmission_dta_result:stacktrace"] = "Stack trace of failed compilation or individual test";
$string["privacy:metadata:assignsubmission_dta_result:column_number"] = "Column number of failed individual compilation or test";
$string["privacy:metadata:assignsubmission_dta_result:line_number"] = "Line number of failed individual compilation or test";
$string["privacy:metadata:assignsubmission_dta_result:position"] = "Position of failed individual compilation or test";
$string["privacy:metadata:assignsubmission_dta_result"] = "Individual Dockerized Test Agent (DTA) results";
$string["privacy:metadata:dta_backend"] = "Dockerized Test Agent (DTA) backend ReST web service";