diff --git a/grade/import/csv/lang/en/gradeimport_csv.php b/grade/import/csv/lang/en/gradeimport_csv.php index 3e2a2090bb86a..06f06562c552f 100644 --- a/grade/import/csv/lang/en/gradeimport_csv.php +++ b/grade/import/csv/lang/en/gradeimport_csv.php @@ -24,5 +24,6 @@ */ $string['csv:view'] = 'Import grades from CSV'; +$string['gradepenalties'] = 'Grade penalties will not be applied to imported grades.'; $string['pluginname'] = 'CSV file'; $string['privacy:metadata'] = 'The import grades from CSV plugin does not store any personal data.'; diff --git a/grade/lib.php b/grade/lib.php index e241c7ae9879c..ab25f7b0319ad 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -992,6 +992,17 @@ function print_grade_page_head(int $courseid, string $active_type, ?string $acti $output = $OUTPUT->heading($heading); } + // If any grade penalty plugins are enabled, notify the user that grade penalties will not be applied to imported grades. + if ($active_type === 'import') { + foreach (core_plugin_manager::instance()->get_plugins_of_type('gradepenalty') as $plugin) { + if ($plugin->is_enabled()) { + $output .= $OUTPUT->notification(get_string('gradepenalties', 'gradeimport_csv'), + \core\output\notification::NOTIFY_INFO, false); + break; + } + } + } + if ($return) { $returnval .= $output; } else {