Commit b21fd370 authored by Abbassy's avatar Abbassy
Browse files

Fix null handling and update defaults/docs

parent fba97647
......@@ -27,7 +27,12 @@ Data
Behavior notes (current)
------------------------
- Suggested grade is calculated with 50/50 weighting (tests/competencies) as provided by the backend; “hard 0” for compilation errors removed.
- Column renders percent when DTA data exists; nothing else is shown elsewhere.
- Column renders percent when DTA data exists; nothing else is shown elsewhere. Missing DTA rows are handled gracefully (no output).
Release package
---------------
- Top-level folder: `assignfeedback_dta` (ready to unzip into `mod/assign/feedback`).
- ZIP excludes VCS and assets: `.git`, `.assets`.
Packaging
---------
......
......@@ -130,10 +130,8 @@ class assign_feedback_dta extends assign_feedback_plugin {
null, // No description text - help only via help button
null, array(0, 1));
$mform->addHelpButton('assignfeedback_dta_gradeautomatically', 'grade_automatically', self::COMPONENT_NAME);
// Set default value from saved config, or 1 if not set yet.
// Default to disabled (0) if not set.
$defaultvalue = $this->get_config('gradeautomatically', 0);
$mform->setDefault('assignfeedback_dta_gradeautomatically', $defaultvalue);
// Default to disabled for new assignments.
$mform->setDefault('assignfeedback_dta_gradeautomatically', 0);
$mform->setType('assignfeedback_dta_gradeautomatically', PARAM_BOOL);
// Hide the checkbox if this feedback plugin (Dockerized Test Agent) is not enabled.
......@@ -643,6 +641,9 @@ class assign_feedback_dta extends assign_feedback_plugin {
$submission = $this->assignment->get_user_submission($grade->userid, false, -1);
if (!empty($submission) && $this->are_dta_tables_available()) {
$dtasubmission = $this->get_dta_submission($this->assignment->get_instance()->id, $submission->id);
if ($dtasubmission === false) {
$dtasubmission = null; // normalize missing record to null
}
}
}
......
Supports Markdown
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