Skip to content

Commit

Permalink
MDL-39761: mod_assign: Always check submission plugin status and visi…
Browse files Browse the repository at this point in the history
…bility.
  • Loading branch information
kabalin committed May 20, 2013
1 parent e038687 commit 8a06e21
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mod/assign/locallib.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8a06e21

Please sign in to comment.