--- loncom/homework/grades.pm 2005/03/03 05:57:26 1.250
+++ loncom/homework/grades.pm 2005/04/08 19:26:58 1.261
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.250 2005/03/03 05:57:26 albertel Exp $
+# $Id: grades.pm,v 1.261 2005/04/08 19:26:58 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -80,8 +80,8 @@ sub getpartlist {
# --- Get the symbolic name of a problem and the url
sub get_symb_and_url {
my ($request,$silent) = @_;
- (my $url=$ENV{'form.url'}) =~ s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
- my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url)));
+ (my $url=$env{'form.url'}) =~ s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
+ my $symb=($env{'form.symb'} ne '' ? $env{'form.symb'} : (&Apache::lonnet::symbread($url)));
if ($symb eq '') {
if (!$silent) {
$request->print("Unable to handle ambiguous references:$url:.");
@@ -99,7 +99,7 @@ sub nameUserString {
return ' Fullname (Username)';
} else {
return ' '.$fullname.' ('.$uname.
- ($ENV{'user.domain'} eq $udom ? '' : ' ('.$udom.')').')';
+ ($env{'user.domain'} eq $udom ? '' : ' ('.$udom.')').')';
}
}
@@ -107,7 +107,7 @@ sub nameUserString {
#--- Indicate if a response type is coded handgraded or not. ---
sub response_type {
my ($url,$symb) = shift;
- $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url))) if ($symb eq '');
+ $symb=($env{'form.symb'} ne '' ? $env{'form.symb'} : (&Apache::lonnet::symbread($url))) if ($symb eq '');
my $allkeys = &Apache::lonnet::metadata($url,'keys');
my %vPart;
foreach my $partid (&Apache::loncommon::get_env_multiple('form.vPart')) {
@@ -141,7 +141,7 @@ sub response_type {
sub get_display_part {
my ($partID,$url,$symb)=@_;
if (!defined($symb) || $symb eq '') {
- $symb=$ENV{'form.symb'};
+ $symb=$env{'form.symb'};
if ($symb eq '') { $symb=&Apache::lonnet::symbread($url) }
}
my $display=&Apache::lonnet::EXT('resource.'.$partID.'.display',$symb);
@@ -199,7 +199,7 @@ sub get_order {
('grade_domain' => $udom),
('grade_symb' => $symb),
('grade_courseid' =>
- $ENV{'request.course.id'}),
+ $env{'request.course.id'}),
('grade_username' => $uname));
(undef,$subresult)=split(/_HASH_REF__/,$subresult,2);
my %analyze=&Apache::lonnet::str2hash($subresult);
@@ -270,17 +270,17 @@ sub cleanRecord {
'
'.$grayFont.'Option ID
'.
$grayFont.$bottomrow.'
'.'';
} elsif ($response eq 'essay') {
- if (! exists ($ENV{'form.'.$symb})) {
+ if (! exists ($env{'form.'.$symb})) {
my (%keyhash) = &Apache::lonnet::dump('nohist_handgrade',
- $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
- $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+ $env{'course.'.$env{'request.course.id'}.'.domain'},
+ $env{'course.'.$env{'request.course.id'}.'.num'});
- my $loginuser = $ENV{'user.name'}.':'.$ENV{'user.domain'};
- $ENV{'form.keywords'} = $keyhash{$symb.'_keywords'} ne '' ? $keyhash{$symb.'_keywords'} : '';
- $ENV{'form.kwclr'} = $keyhash{$loginuser.'_kwclr'} ne '' ? $keyhash{$loginuser.'_kwclr'} : 'red';
- $ENV{'form.kwsize'} = $keyhash{$loginuser.'_kwsize'} ne '' ? $keyhash{$loginuser.'_kwsize'} : '0';
- $ENV{'form.kwstyle'} = $keyhash{$loginuser.'_kwstyle'} ne '' ? $keyhash{$loginuser.'_kwstyle'} : '';
- $ENV{'form.'.$symb} = 1; # so that we don't have to read it from disk for multiple sub of the same prob.
+ my $loginuser = $env{'user.name'}.':'.$env{'user.domain'};
+ $env{'form.keywords'} = $keyhash{$symb.'_keywords'} ne '' ? $keyhash{$symb.'_keywords'} : '';
+ $env{'form.kwclr'} = $keyhash{$loginuser.'_kwclr'} ne '' ? $keyhash{$loginuser.'_kwclr'} : 'red';
+ $env{'form.kwsize'} = $keyhash{$loginuser.'_kwsize'} ne '' ? $keyhash{$loginuser.'_kwsize'} : '0';
+ $env{'form.kwstyle'} = $keyhash{$loginuser.'_kwstyle'} ne '' ? $keyhash{$loginuser.'_kwstyle'} : '';
+ $env{'form.'.$symb} = 1; # so that we don't have to read it from disk for multiple sub of the same prob.
}
$answer =~ s-\n- -g;
return '
'.&keywords_highlight($answer).'
';
@@ -349,8 +349,8 @@ sub getclasslist {
my $status =
$classlist->{$student}->[&Apache::loncoursedata::CL_STATUS()];
# filter students according to status selected
- if ($filterlist && $ENV{'form.Status'} ne 'Any') {
- if ($ENV{'form.Status'} ne $status) {
+ if ($filterlist && $env{'form.Status'} ne 'Any') {
+ if ($env{'form.Status'} ne $status) {
delete ($classlist->{$student});
next;
}
@@ -415,7 +415,7 @@ sub canview {
#--- Retrieve the grade status of a student for all the parts
sub student_gradeStatus {
my ($url,$symb,$udom,$uname,$partlist) = @_;
- my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$udom,$uname);
+ my %record = &Apache::lonnet::restore($symb,$env{'request.course.id'},$udom,$uname);
my %partstatus = ();
foreach (@$partlist) {
my ($status,undef) = split(/_/,$record{"resource.$_.solved"},2);
@@ -442,9 +442,9 @@ sub jscriptNform {
$jscript.= '