Skip to content

Commit

Permalink
MDL-29689 Assignment 2.2: cleaned print_responsefiles function
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajesh Taneja committed Oct 4, 2012
1 parent deba4dc commit 17bf85d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
11 changes: 1 addition & 10 deletions mod/assignment/type/upload/assignment.class.php
Expand Up @@ -355,19 +355,10 @@ function count_real_submissions($groupid=0) {
}

function print_responsefiles($userid, $return=false) {
global $CFG, $USER, $OUTPUT, $PAGE;

$mode = optional_param('mode', '', PARAM_ALPHA);
$offset = optional_param('offset', 0, PARAM_INT);
global $OUTPUT, $PAGE;

$output = $OUTPUT->box_start('responsefiles');

$candelete = $this->can_manage_responsefiles();
$strdelete = get_string('delete');

$fs = get_file_storage();
$browser = get_file_browser();

if ($submission = $this->get_submission($userid)) {
$renderer = $PAGE->get_renderer('mod_assignment');
$output .= $renderer->assignment_files($this->context, $submission->id, 'response');
Expand Down
13 changes: 2 additions & 11 deletions mod/assignment/type/uploadsingle/assignment.class.php
Expand Up @@ -149,24 +149,15 @@ function count_real_submissions($groupid=0) {
}

function print_responsefiles($userid, $return=false) {
global $CFG, $USER, $OUTPUT, $PAGE;

$mode = optional_param('mode', '', PARAM_ALPHA);
$offset = optional_param('offset', 0, PARAM_INT);
global $OUTPUT, $PAGE;

$output = $OUTPUT->box_start('responsefiles');

$candelete = $this->can_manage_responsefiles();
$strdelete = get_string('delete');

$fs = get_file_storage();
$browser = get_file_browser();

if ($submission = $this->get_submission($userid)) {
$renderer = $PAGE->get_renderer('mod_assignment');
$output .= $renderer->assignment_files($this->context, $submission->id, 'response');
$output .= $OUTPUT->box_end();
}
$output .= $OUTPUT->box_end();

if ($return) {
return $output;
Expand Down

0 comments on commit 17bf85d

Please sign in to comment.