The assignfeedback_dta plugin is part of the MoDTA (Moodle Dockerized Test Agent) system. It automatically calculates and displays grades for student submissions tested using the Dockerized Test Agent (DTA) system. When students submit code through the DTA submission plugin, the DTA backend runs automated tests and sends results back to Moodle. This feedback plugin takes those test results and automatically calculates a grade, displaying it in a dedicated feedback column.
-------
- Provides an informational column “Dockerized Test Agent Feedback” in the grading table.
The MoDTA system comprises two key components:
- Shows only the suggested grade percentage from the DTA backend; feedback block stays hidden.
- Optional auto-grading: when “Grade automatically” is enabled, the plugin applies grades; otherwise it only displays the suggestion.
• The MoDTA Moodle submission plugin (`assignsubmission_dta`), designed as an assignment submission tool.
• The MoDTA Moodle feedback plugin (`assignfeedback_dta`), designed to automatically calculate and display grades based on test results.
Installation
• The DTA backend web service, which interfaces with the Moodle plugins through REST and employs the JSON file format for communication.
------------
- Unzip into `{moodleroot}/mod/assign/feedback/dta`.
## Goals
- Visit Site administration → Notifications to complete installation.
- Ensure the companion submission plugin `assignsubmission_dta` is installed and the DTA backend is reachable (HTTP allowlist/ports configured in Moodle security settings).
MoDTA empowers teachers to provide programming Moodle assignments for their students, which are automatically corrected upon hand-in using teacher-provided tests. The feedback plugin extends this functionality by automatically calculating grades based on test results, providing immediate feedback to both students and teachers.
Configuration
The feedback plugin optionally supports automatic grade calculation, allowing teachers to:
-------------
- Automatically calculate grades based on test results
- Settings → “Grade automatically”: default is **disabled**.
- Display grades in a dedicated feedback column
- Disabled: only the column shows the suggestion percent (info-only); no grades are applied.
- Optionally apply grades to the "Final grade" column for automatic grading
- Enabled: the column still shows the suggestion; the plugin also writes the calculated grade.
- Or keep "Final grade" empty for manual grade entry
- Feedback block is suppressed (`is_empty` returns true); all user-facing text is English and sourced from `lang/en/assignfeedback_dta.php`.
## What is this plugin?
Data
----
The assignfeedback_dta plugin automatically calculates and displays grades for student submissions tested using the Dockerized Test Agent (DTA) system. When students submit code, the DTA backend runs automated tests and sends results back to Moodle. This plugin takes those test results and automatically calculates a grade, displaying it in a dedicated feedback column.
- No own database tables. Reads DTA results from `assignsubmission_dta` tables (`assignsubmission_dta_summary` / `assignsubmission_dta_result`).
## How does it work?
Behavior notes (current)
------------------------
1.**Student submits code** - Uploads Java project files through the DTA submission plugin (`assignsubmission_dta`)
- Suggested grade is calculated with 50/50 weighting (tests/competencies) as provided by the backend; “hard 0” for compilation errors removed.
2.**Backend tests the code** - DTA backend automatically runs test cases
- Column renders percent when DTA data exists; nothing else is shown elsewhere.
3.**Results come back** - Backend sends test results to Moodle, stored in `assignsubmission_dta_summary` and `assignsubmission_dta_result` tables
4.**Plugin calculates grade** - This feedback plugin reads the test results and calculates a grade based on:
Packaging
- Test success rate (passed tests / total tests)
---------
- Compilation errors (more than 1 error results in 0%)
- Release ZIP excludes VCS and assets: `.git`, `.assets`.
- Optional competency scores (if available)
5.**Grade appears in feedback column** - Shows "80.00 / 100.00" in "Dockerized Test Agent Feedback" column
## The "Grade automatically" Button
In the assignment settings, you'll find a checkbox labeled **"Grade automatically"** in the Feedback types section. This button controls how the plugin handles grade calculation.
**When checked (Automatic Grading ON):**
- The plugin automatically calculates and displays grades based on test results
- Grades appear immediately in the DTA Feedback column after backend processing
- Grades are also automatically applied to the "Final grade" column
- You can still manually adjust grades in the "Final grade" column if needed
**When unchecked (Automatic Grading OFF):**
- The plugin shows test results and calculates a suggested grade
- The grade is displayed only in the DTA Feedback column
- No grade is automatically applied to "Final grade"
- You review each submission and manually enter grades in the "Final grade" column
## Scenarios
### Scenario 1: Automatic Grading Enabled
**Setup:** You enable the plugin and check "Grade automatically" in assignment settings.
**Student submits:** Code passes 8 out of 10 tests, no compilation errors.
**Result:** Plugin automatically calculates 80% and displays "80.00 / 100.00" in DTA Feedback column. The grade is also automatically applied to the "Final grade" column.
**Use case:** Perfect for large classes where you want quick automated grading with the option to manually adjust exceptional cases.
### Scenario 2: Automatic Grading Disabled
**Setup:** You enable the plugin but leave "Grade automatically" unchecked.
**Student submits:** Code passes 7 out of 10 tests.
**Result:** Plugin calculates suggested grade of 70% and displays it in DTA Feedback column. "Final grade" column remains empty. You review the code, notice good documentation and effort, and manually enter 85% in Final grade column.
**Use case:** Ideal when code quality, documentation, and subjective factors matter alongside test results.
### Scenario 3: Compilation Errors
**Setup:** Automatic grading enabled.
**Student submits:** Code has 2 compilation errors.
**Result:** Plugin automatically sets grade to 0% and displays "0.00 / 100.00". This ensures students fix critical errors first.
**Use case:** Helps identify submissions that need immediate attention before test cases can even run.
### Scenario 4: Perfect Submission
**Setup:** Automatic grading enabled.
**Student submits:** All 10 tests pass, no errors.
**Result:** Plugin calculates 100% and displays "100.00 / 100.00" immediately. Grade is automatically applied to "Final grade".
**Use case:** Instant feedback for students who submit correct code, encouraging early submissions.
### Scenario 5: Switching Modes Mid-Assignment
**Initial:** Automatic grading enabled, students submitting and getting grades automatically.
**Change:** You uncheck "Grade automatically" after reviewing initial submissions.
**Result:** New submissions show suggested grades only in DTA Feedback column. "Final grade" remains empty. You manually review and enter final grades. Existing automatic grades remain visible for reference.
**Use case:** Flexibility to adapt grading strategy based on assignment progress and student performance patterns.
## Key features
- ✅ **Automatic grade calculation** based on test results
- ✅ **Batch testing support** - Works with batch testing functionality from submission plugin
- ✅ **Competency-based grading** - Supports competency scores if available from backend
## Installation & Configuration
### Prerequisites
The `assignsubmission_dta` plugin must be installed first, as the feedback plugin depends on it for test results. The feedback plugin reads from the database tables created by the submission plugin:
-`mdl_assignsubmission_dta_summary` - Summary of test results
-`mdl_assignsubmission_dta_result` - Individual test case results
### Quick installation
1. Download `assignfeedback_dta.zip`
2. Go to **Site administration → Plugins → Install plugins**
3. Upload the ZIP file as shown in Fig. 1. 
4. Follow the installation wizard
### Manual installation
1. Extract ZIP and copy `dta` folder to `/mod/assign/feedback/dta/`
2. Set permissions: `chown -R www-data:www-data dta/`
3. Go to **Site administration → Notifications** to upgrade
4. Purge caches: **Site administration → Development → Purge all caches**
### Configuration
After installation, the plugin requires no additional configuration. It automatically reads test results from the submission plugin's database tables. However, ensure that:
- The DTA backend is properly configured (see submission plugin documentation)
- The submission plugin is installed and working
- HTTP Security settings allow communication with the backend (if needed)
## Usage
With the MoDTA feedback plugin installed and the submission plugin configured:
### Teacher Setup
When creating or editing an assignment, a teacher can enable the DTA Feedback plugin in the **Feedback types** section as shown in Fig. 2. 
2.**Students submit code** via DTA submission plugin
3.**View grades:**
- Open assignment grading page as shown in Fig. 3. 
- See grades in **"Dockerized Test Agent Feedback"** column
- Format: "85.50 / 100.00"
- If "Grade automatically" is enabled, grades also appear in **"Final grade"** column
- If disabled, **"Final grade"** column remains empty for manual entry
### Student View
Students see the calculated grade in the DTA Feedback column when viewing their submission status as shown in Fig. 4.  The grade is displayed in the format "XX.XX / 100.00" showing both the calculated grade and maximum possible grade.
## Grade calculation
The plugin uses a sophisticated calculation method:
$string["grade_automatically_help"]="If enabled, the plugin will automatically calculate and apply grades based on test results. If disabled, the plugin will only display test results as feedback, and the teacher must manually assign grades.";
$string["grade_automatically_help"]="If enabled, the plugin will automatically calculate and apply grades based on test results. If disabled, the plugin will only display test results as feedback, and the teacher must manually assign grades.";