Permalink
Browse files

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

…bility.
  • Loading branch information...
1 parent 5e3412d commit 7e8514c5fdae40bd2f28540a72060943000f7f23 @kabalin kabalin committed May 17, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 mod/assign/locallib.php
@@ -2643,7 +2643,9 @@ private function process_submit_for_grading() {
// 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;
@@ -2921,7 +2923,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 7e8514c

Please sign in to comment.