Permalink
Browse files

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

…bility.
  • Loading branch information...
1 parent e038687 commit 8a06e21c2afa77e2f6a48af822378c0f1e110adf @kabalin kabalin committed May 17, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 mod/assign/locallib.php
View
@@ -3585,10 +3585,12 @@ private function process_submit_for_grading($mform) {
}
if ($submission->status != ASSIGN_SUBMISSION_STATUS_SUBMITTED) {
- // Give each submission plugin a chance to process the submission
+ // Give each submission plugin a chance to process the submission.
$plugins = $this->get_submission_plugins();
foreach ($plugins as $plugin) {
- $plugin->submit_for_grading();
+ if ($plugin->is_enabled() && $plugin->is_visible()) {
+ $plugin->submit_for_grading();
+ }
}
$submission->status = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
@@ -4013,7 +4015,7 @@ private 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 8a06e21

Please sign in to comment.