--- loncom/interface/statistics/lonstudentsubmissions.pm 2005/03/17 18:50:06 1.39
+++ loncom/interface/statistics/lonstudentsubmissions.pm 2005/04/07 06:56:24 1.40
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentsubmissions.pm,v 1.39 2005/03/17 18:50:06 matthew Exp $
+# $Id: lonstudentsubmissions.pm,v 1.40 2005/04/07 06:56:24 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -27,7 +27,7 @@
package Apache::lonstudentsubmissions;
use strict;
-use Apache::lonnet();
+use Apache::lonnet;
use Apache::loncommon();
use Apache::lonhtmlcommon();
use Apache::loncoursedata();
@@ -71,8 +71,8 @@ sub BuildStudentSubmissionsPage {
'
'.&mt('Loading student data').'
');
$r->rflush();
#
- if (exists($ENV{'form.problemchoice'}) &&
- ! exists($ENV{'form.SelectAnother'})) {
+ if (exists($env{'form.problemchoice'}) &&
+ ! exists($env{'form.SelectAnother'})) {
foreach my $button (@SubmitButtons) {
if ($button->{'name'} eq 'break') {
$r->print("
\n");
@@ -120,14 +120,14 @@ sub BuildStudentSubmissionsPage {
my $resource = $Problems[0];
$r->print(''.$resource->title.'
');
$r->print(''.$resource->src.'
');
- if ($ENV{'form.renderprob'} eq 'true') {
+ if ($env{'form.renderprob'} eq 'true') {
$r->print(&Apache::lonstathelpers::render_resource($resource));
$r->rflush();
}
}
- if ($ENV{'form.output'} eq 'excel') {
+ if ($env{'form.output'} eq 'excel') {
&prepare_excel_output($r,\@Problems,\@Students);
- } elsif ($ENV{'form.output'} eq 'csv') {
+ } elsif ($env{'form.output'} eq 'csv') {
&prepare_csv_output($r,\@Problems,\@Students);
} else {
&prepare_html_output($r,\@Problems,\@Students);
@@ -154,10 +154,10 @@ sub BuildStudentSubmissionsPage {
##
sub get_extra_response_headers {
my @extra_resp_headers;
- if ($ENV{'form.correctans'} eq 'true') {
+ if ($env{'form.correctans'} eq 'true') {
push(@extra_resp_headers,'Correct');
}
- if ($ENV{'form.prob_status'} eq 'true') {
+ if ($env{'form.prob_status'} eq 'true') {
push(@extra_resp_headers,'Award Detail');
push(@extra_resp_headers,'Time');
push(@extra_resp_headers,'Attempt');
@@ -350,7 +350,7 @@ sub prepare_html_output {
$maxrow = scalar(@$results);
}
for (my $j=scalar(@$results)-1;$j>=0;$j--) {
- if ($ENV{'form.all_sub'} ne 'true') {
+ if ($env{'form.all_sub'} ne 'true') {
next if ($j ne scalar(@$results)-1);
}
my $response = &hashify_response($results->[$j],
@@ -430,7 +430,7 @@ sub prepare_html_output {
sub hashify_response {
my ($response,$prob,$student,$partid,$respid) =@_;
my $resp_hash = {};
- if ($ENV{'form.correctans'} eq 'true') {
+ if ($env{'form.correctans'} eq 'true') {
$resp_hash->{'Correct'} =
&Apache::lonstathelpers::get_student_answer
($prob,$student->{'username'},$student->{'domain'},
@@ -636,7 +636,7 @@ sub prepare_excel_output {
# Add headers to the worksheet
my $rows_output = 0;
$worksheet->write($rows_output++,0,
- $ENV{'course.'.$ENV{'request.course.id'}.'.description'},
+ $env{'course.'.$env{'request.course.id'}.'.description'},
$format->{'h1'});
$rows_output++;
my $cols_output = 0;
@@ -725,7 +725,7 @@ sub prepare_excel_output {
my $response_start_col = $start_col{$prob->symb}->{$partid}->{$respid};
for (my $j=scalar(@$results)-1;$j>=0;$j--) {
$cols_output = $response_start_col;
- if ($ENV{'form.all_sub'} ne 'true') {
+ if ($env{'form.all_sub'} ne 'true') {
next if ($j ne scalar(@$results)-1);
}
my $response = &hashify_response($results->[$j],
@@ -878,7 +878,7 @@ sub prepare_csv_output {
# Open a file
my $outputfile;
my $filename = '/prtspool/'.
- $ENV{'user.name'}.'_'.$ENV{'user.domain'}.'_'.
+ $env{'user.name'}.'_'.$env{'user.domain'}.'_'.
time.'_'.rand(1000000000).'.csv';
unless ($outputfile = Apache::File->new('>/home/httpd'.$filename)) {
$r->log_error("Couldn't open $filename for output $!");
@@ -960,7 +960,7 @@ sub prepare_csv_output {
$results = [];
}
for (my $j=0; $j'.$/;
foreach ('HTML','Excel','CSV') {
$output_selector .= '