Commit 770e5fd3 authored by Lückemeyer's avatar Lückemeyer
Browse files

Added tehcnical Moodle approval documentation

parent 8d283b9c
Pipeline #8869 passed with stage
# DTT Moodle Plugin # Moodle Dockerized Test Agent (MoDTA) Plugin
This is the source code repository for the DTT Moodle Plugin. This is the source code repository for the MoDTA plugin.
Documentation for this is done with GitLab Pages using MkDocs and is available here: 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
[https://transfer.hft-stuttgart.de/pages/dtt/documentation][pages-link]
If you don't want to open the Webpage or it is not available for whatever reason, ## Plugin Type – Assignment Submission Plugin
the documentation root is found [here][docs-root]
[docs-root]: https://transfer.hft-stuttgart.de/gitlab/dtt/documentation/-/blob/master/docs/index.md 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.
[pages-link]: https://transfer.hft-stuttgart.de/pages/dtt/documentation
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 must reside in the directory path "mod/assign/submission/dta" within the Moodle installation's root folder.
### 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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment