MDL-13741 Incorrect max size shown when using course upload limit; patch by Jason Meinzer; merged from MOODLE_19_STABLE

This commit is contained in:
skodak 2008-03-03 20:49:54 +00:00
parent d747d41bf2
commit ba9ad04975
2 changed files with 5 additions and 2 deletions

View File

@ -140,7 +140,8 @@ class assignment_upload extends assignment_base {
$submission = $this->get_submission($USER->id);
$struploadafile = get_string('uploadafile');
$strmaxsize = get_string('maxsize', '', display_size($this->assignment->maxbytes));
$maxbytes = $this->assignment->maxbytes == 0 ? $this->course->maxbytes : $this->assignment->maxbytes;
$strmaxsize = get_string('maxsize', '', display_size($maxbytes));
if ($this->is_finalized($submission)) {
// no uploading

View File

@ -81,7 +81,9 @@ class assignment_uploadsingle extends assignment_base {
function view_upload_form() {
global $CFG;
$struploadafile = get_string("uploadafile");
$strmaxsize = get_string("maxsize", "", display_size($this->assignment->maxbytes));
$maxbytes = $this->assignment->maxbytes == 0 ? $this->course->maxbytes : $this->assignment->maxbytes;
$strmaxsize = get_string('maxsize', '', display_size($maxbytes));
echo '<div style="text-align:center">';
echo '<form enctype="multipart/form-data" method="post" '.