Skip to content
Browse files

MDL-37037 Assignment Some minor refactoring of the previous patch

This just makes the control flow a bit easier to read.

I also added a continue button to take you back to the grading page.
  • Loading branch information...
1 parent c731018 commit d59467dfc990cc6b449e812eeb3d5e1f0b1433c0 @damyon damyon committed with danpoltawski Dec 18, 2012
Showing with 12 additions and 6 deletions.
  1. +12 −6 mod/assign/locallib.php
View
18 mod/assign/locallib.php
@@ -2040,20 +2040,26 @@ private function download_submissions() {
}
}
}
+ $result = '';
if (count($filesforzipping) == 0) {
- $result = $this->get_renderer()->render(new assign_header($this->get_instance(),
- $this->get_context(),
- '',
- $this->get_course_module()->id,
- get_string('downloadall', 'assign')));
+ $header = new assign_header($this->get_instance(),
+ $this->get_context(),
+ '',
+ $this->get_course_module()->id,
+ get_string('downloadall', 'assign'));
+ $result .= $this->get_renderer()->render($header);
$result .= $this->get_renderer()->notification(get_string('nosubmission', 'assign'));
+ $url = new moodle_url('/mod/assign/view.php', array('id'=>$this->get_course_module()->id,
+ 'action'=>'grading'));
+ $result .= $this->get_renderer()->continue_button($url);
$result .= $this->view_footer();
- return $result;
} else if ($zipfile = $this->pack_files($filesforzipping)) {
$this->add_to_log('download all submissions', get_string('downloadall', 'assign'));
// Send file and delete after sending.
send_temp_file($zipfile, $filename);
+ // We will not get here - send_temp_file calls exit.
}
+ return $result;
}
/**

0 comments on commit d59467d

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