Part: '.
+ $display_part.' ( ID '.$respid.
' ) ';
if ($record{"resource.$partid.$respid.uploadedurl"}) {
- $lastsubonly.=' File uploaded by student Like all files provided by users, this file may contain virusses ';
+ &Apache::lonnet::allowuploaded('/adm/grades',
+ $record{"resource.$partid.$respid.uploadedurl"});
+ $lastsubonly.=' File uploaded by student Like all files provided by users, this file may contain virusses ';
}
$lastsubonly.='Submitted Answer: '.
&cleanRecord($subval,$responsetype,$symb,$partid,
@@ -2049,11 +2081,11 @@ sub saveHandGrade {
}
} elsif ($dropMenu eq 'reset status'
&& exists($record{'resource.'.$_.'.solved'})) { #don't bother if no old records -> no attempts
- $newrecord{'resource.'.$_.'.tries'} = 0;
- $newrecord{'resource.'.$_.'.solved'} = '';
- $newrecord{'resource.'.$_.'.award'} = '';
- $newrecord{'resource.'.$_.'.awarded'} = 0;
- $newrecord{'resource.'.$_.'.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}";
+ foreach my $key (keys (%record)) {
+ if ($key=~/^resource\.\Q$_\E\./) { $newrecord{$key} = ''; }
+ }
+ $newrecord{'resource.'.$_.'.regrader'}=
+ "$ENV{'user.name'}:$ENV{'user.domain'}";
} elsif ($dropMenu eq '') {
$pts = ($ENV{'form.GD_BOX'.$newflg.'_'.$_} ne '' ?
$ENV{'form.GD_BOX'.$newflg.'_'.$_} :
@@ -2297,7 +2329,7 @@ sub viewgrades {
my $sectionClass;
if ($ENV{'form.section'} eq 'all') {
$sectionClass='Class ';
- } elsif ($ENV{'form.section'} eq 'no') {
+ } elsif ($ENV{'form.section'} eq 'none') {
$sectionClass='Students in no Section ';
} else {
$sectionClass='Students in Section '.$ENV{'form.section'}.'';
@@ -2324,7 +2356,8 @@ sub viewgrades {
$ctsparts.'" value="'.$partid.'" />'."\n";
$result.=''."\n";
- $result.='
Part '.$partid.' Point:
';
+ my $display_part=&get_display_part($partid,$url,$symb);
+ $result.='
Part: '.$display_part.' Point:
';
$result.='
';
my $ctr = 0;
while ($ctr<=$weight{$partid}) { # display radio buttons in a nice table 10 across
@@ -2363,14 +2396,17 @@ sub viewgrades {
my $display=&Apache::lonnet::metadata($url,$part.'.display');
$display =~ s|^Number of Attempts|Tries |; # makes the column narrower
if (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); }
+ my ($partid) = &split_part_type($part);
+ my $display_part=&get_display_part($partid,$url,$symb);
if ($display =~ /^Partial Credit Factor/) {
- my ($partid) = &split_part_type($part);
- $result.='
Score Part '.$partid.' (weight = '.
- $weight{$partid}.')
';
@@ -2596,7 +2633,7 @@ sub editgrades {
if ($noupdate) {
# my $numcols=(scalar(@partid)*(scalar(@parts)-1)*2)+3;
my $numcols=scalar(@partid)*4+2;
- $result .= '
No Changes Occurred For the Students Below
'.$noupdate;
+ $result .= '
No Changes Occurred For the Students Below
'.$noupdate;
}
$result .= '
'."\n".
&show_grading_menu_form ($symb,$url);
@@ -3211,12 +3248,14 @@ sub displaySubByDates {
foreach my $partid (@{$parts}) {
my @matchKey = sort(grep /^resource\.\Q$partid\E\..*?\.submission$/,@versionKeys);
# next if ($$record{"$version:resource.$partid.solved"} eq '');
+ my $display_part=&get_display_part($partid,undef,$symb);
foreach my $matchKey (@matchKey) {
- if (exists $$record{$version.':'.$matchKey}) {
+ if (exists($$record{$version.':'.$matchKey}) &&
+ $$record{$version.':'.$matchKey} ne '') {
my ($responseId)=($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/);
- $displaySub[0].='Part '.$partid.' ';
+ $displaySub[0].='Part: '.$display_part.' ';
$displaySub[0].='(ID '.
- $responseId.') ';
+ $responseId.') ';
if ($$record{"$version:resource.$partid.tries"} eq '') {
$displaySub[0].='Trial not counted';
} else {
@@ -3234,14 +3273,14 @@ sub displaySubByDates {
}
}
if (exists $$record{"$version:resource.$partid.award"}) {
- $displaySub[1].='Part '.$partid.' '.
+ $displaySub[1].='Part: '.$display_part.' '.
lc($$record{"$version:resource.$partid.award"}).' '.
$mark{$$record{"$version:resource.$partid.solved"}}.
' ';
}
if (exists $$record{"$version:resource.$partid.regrader"}) {
$displaySub[2].=$$record{"$version:resource.$partid.regrader"}.
- ' ('.&mt('Part').': '.$partid.')';
+ ' ('.&mt('Part').': '.$display_part.')';
}
}
# needed because old essay regrader has not parts info
@@ -3338,12 +3377,13 @@ sub updateGradeByPage {
$changeflag++;
$newpts = '';
}
-
+ my $display_part=&get_display_part($partid,undef,
+ $curRes->symb());
my $oldstatus = $ENV{'form.solved'.$question.'_'.$partid};
- $displayPts[0].=' Part '.$partid.' = '.
+ $displayPts[0].=' Part: '.$display_part.' = '.
(($oldstatus eq 'excused') ? 'excused' : $oldpts).
' ';
- $displayPts[1].=' Part '.$partid.' = '.
+ $displayPts[1].=' Part: '.$display_part.' = '.
(($score eq 'excused') ? 'excused' : $newpts).
' ';
@@ -3417,18 +3457,25 @@ sub getSequenceDropDown {
return $result;
}
-sub scantron_uploads {
- if (!-e $Apache::lonnet::perlvar{'lonScansDir'}) { return ''};
- my $result= '