[system] / trunk / webwork2 / lib / WeBWorK / ContentGenerator / Instructor / ScoringDownload.pm Repository:
ViewVC logotype

Diff of /trunk/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ScoringDownload.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1663 Revision 1928
1################################################################################ 1################################################################################
2# WeBWorK Online Homework Delivery System 2# WeBWorK Online Homework Delivery System
3# Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ 3# Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/
4# $CVSHeader$ 4# $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/ScoringDownload.pm,v 1.2 2003/12/09 01:12:31 sh002i Exp $
5# 5#
6# This program is free software; you can redistribute it and/or modify it under 6# This program is free software; you can redistribute it and/or modify it under
7# the terms of either: (a) the GNU General Public License as published by the 7# the terms of either: (a) the GNU General Public License as published by the
8# Free Software Foundation; either version 2, or (at your option) any later 8# Free Software Foundation; either version 2, or (at your option) any later
9# version, or (b) the "Artistic License" which comes with this package. 9# version, or (b) the "Artistic License" which comes with this package.
27use warnings; 27use warnings;
28use Apache::Constants qw(:common); 28use Apache::Constants qw(:common);
29 29
30sub header { 30sub header {
31 my ($self) = @_; 31 my ($self) = @_;
32 my $r = $self->{r}; 32 my $r = $self->r;
33 my $ce = $self->{ce}; 33 my $ce = $r->ce;
34 my $scoringDir = $ce->{courseDirs}->{scoring}; 34 my $scoringDir = $ce->{courseDirs}->{scoring};
35 my $file = $r->param('getFile'); 35 my $file = $r->param('getFile');
36 if (-f "$scoringDir/$file") { 36 if (-f "$scoringDir/$file") {
37 $r->content_type('text/comma-separated-values'); 37 $r->content_type('text/comma-separated-values');
38 $r->header_out("Content-Disposition" => "attachment; filename=$file;"); 38 $r->header_out("Content-Disposition" => "attachment; filename=$file;");
43 return NOT_FOUND; 43 return NOT_FOUND;
44 } 44 }
45} 45}
46 46
47sub content { 47sub content {
48 my ($self) = @_; 48 my ($self) = @_;
49 my $r = $self->{r}; 49 my $r = $self->r;
50 my $ce = $self->{ce}; 50 my $ce = $r->ce;
51 my $authz = $self->{authz}; 51 my $authz = $r->authz;
52 my $scoringDir = $ce->{courseDirs}->{scoring}; 52 my $scoringDir = $ce->{courseDirs}->{scoring};
53 my $user = $r->param('user'); 53 my $user = $r->param('user');
54 54
55 if (!$authz->hasPermissions($user, "score_sets")) { 55 if (!$authz->hasPermissions($user, "score_sets")) {
56 print "You do not have permission to access scoring data"; 56 print "You do not have permission to access scoring data";
57 } else { 57 } else {
58 my $file = $r->param('getFile'); 58 my $file = $r->param('getFile');

Legend:
Removed from v.1663  
changed lines
  Added in v.1928

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9