Skip to content
Browse files

MDL-39761: mod_assign: Always check submission plugin status and visi…

…bility.
  • Loading branch information...
1 parent e2637d1 commit 3257f85f23d3eb8807bfa395e3be32b451ceb957 @kabalin kabalin committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 mod/assign/locallib.php
View
6 mod/assign/locallib.php
@@ -4232,7 +4232,9 @@ protected function process_submit_for_grading($mform) {
// Give each submission plugin a chance to process the submission.
$plugins = $this->get_submission_plugins();
foreach ($plugins as $plugin) {
- $plugin->submit_for_grading($submission);
+ if ($plugin->is_enabled() && $plugin->is_visible()) {
+ $plugin->submit_for_grading($submission);
+ }
}
$submission->status = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
@@ -4779,7 +4781,7 @@ protected function process_save_submission(&$mform, &$notices) {
$allempty = true;
$pluginerror = false;
foreach ($this->submissionplugins as $plugin) {
- if ($plugin->is_enabled()) {
+ if ($plugin->is_enabled() && $plugin->is_visible()) {
if (!$plugin->save($submission, $data)) {
$notices[] = $plugin->get_error();
$pluginerror = true;

0 comments on commit 3257f85

Please sign in to comment.
Something went wrong with that request. Please try again.