version 1.249, 2005/02/28 21:18:08
|
version 1.251, 2005/03/30 21:11:44
|
Line 96 sub get_symb_and_url {
|
Line 96 sub get_symb_and_url {
|
sub nameUserString { |
sub nameUserString { |
my ($type,$fullname,$uname,$udom) = @_; |
my ($type,$fullname,$uname,$udom) = @_; |
if ($type eq 'header') { |
if ($type eq 'header') { |
return '<b> Fullname </b><font color="#999999">(Username)</font> Section/Group'; |
return '<b> Fullname </b><font color="#999999">(Username)</font>'; |
} else { |
} else { |
return ' '.$fullname.'<font color="#999999"> ('.$uname. |
return ' '.$fullname.'<font color="#999999"> ('.$uname. |
($ENV{'user.domain'} eq $udom ? '' : ' ('.$udom.')').')</font>'; |
($ENV{'user.domain'} eq $udom ? '' : ' ('.$udom.')').')</font>'; |
Line 678 LISTJAVASCRIPT
|
Line 678 LISTJAVASCRIPT
|
my $loop = 0; |
my $loop = 0; |
while ($loop < 2) { |
while ($loop < 2) { |
$gradeTable.='<td><b> No.</b> </td><td><b> Select </b></td>'. |
$gradeTable.='<td><b> No.</b> </td><td><b> Select </b></td>'. |
'<td>'.&nameUserString('header').'</td>'; |
'<td>'.&nameUserString('header').' Section/Group</td>'; |
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { |
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { |
foreach (sort(@$partlist)) { |
foreach (sort(@$partlist)) { |
my $display_part=&get_display_part((split(/_/))[0],$url,$symb); |
my $display_part=&get_display_part((split(/_/))[0],$url,$symb); |
Line 2113 sub saveHandGrade {
|
Line 2113 sub saveHandGrade {
|
$ENV{'request.course.id'}); |
$ENV{'request.course.id'}); |
if (!&canmodify($usec)) { return('not_allowed'); } |
if (!&canmodify($usec)) { return('not_allowed'); } |
my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$domain,$stuname); |
my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$domain,$stuname); |
|
my @parts_graded; |
my %newrecord = (); |
my %newrecord = (); |
my ($pts,$wgt) = ('',''); |
my ($pts,$wgt) = ('',''); |
foreach (split(/:/,$ENV{'form.partlist'.$newflg})) { |
foreach (split(/:/,$ENV{'form.partlist'.$newflg})) { |
Line 2147 sub saveHandGrade {
|
Line 2148 sub saveHandGrade {
|
if ($partial eq $record{'resource.'.$_.'.awarded'}) { |
if ($partial eq $record{'resource.'.$_.'.awarded'}) { |
#do not update score for part if not changed. |
#do not update score for part if not changed. |
next; |
next; |
|
} else { |
|
push @parts_graded, $_; |
} |
} |
if ($record{'resource.'.$_.'.awarded'} ne $partial) { |
if ($record{'resource.'.$_.'.awarded'} ne $partial) { |
$newrecord{'resource.'.$_.'.awarded'} = $partial; |
$newrecord{'resource.'.$_.'.awarded'} = $partial; |
Line 2170 sub saveHandGrade {
|
Line 2173 sub saveHandGrade {
|
} |
} |
} |
} |
if (scalar(keys(%newrecord)) > 0) { |
if (scalar(keys(%newrecord)) > 0) { |
|
&version_portfiles(\%record, \@parts_graded, $ENV{'request.course.id'}, $symb, $domain, $stuname); |
&Apache::lonnet::cstore(\%newrecord,$symb, |
&Apache::lonnet::cstore(\%newrecord,$symb, |
$ENV{'request.course.id'},$domain,$stuname); |
$ENV{'request.course.id'},$domain,$stuname); |
} |
} |
return '',$pts,$wgt; |
return '',$pts,$wgt; |
} |
} |
|
|
|
# ----------- Handles creating versions for portfolio files as answers |
|
sub version_portfiles { |
|
my ($record, $parts_graded, $courseid, $symb, $domain, $stuname) = @_; |
|
my $parts = join '|', @$parts_graded; |
|
foreach my $key (sort keys %$record) { |
|
if ($key =~ /^resource\.($parts)\./ && $key =~ /\.portfiles$/) { |
|
&Apache::lonnet::logthis('found key portfiles '.$key); |
|
&Apache::lonnet::logthis('found value portfiles '.$$record{$key}); |
|
} |
|
} |
|
|
|
|
|
} |
|
|
#-------------------------------------------------------------------------------------- |
#-------------------------------------------------------------------------------------- |
# |
# |
#-------------------------- Next few routines handles grading by section or whole class |
#-------------------------- Next few routines handles grading by section or whole class |