Part '.
- $partid.' ( ID '.$respid.
+ $lastsubonly.='Part: '.
+ $display_part.' ( ID '.$respid.
' ) '.
'Nothing submitted - no attempts
';
next;
@@ -1665,8 +1685,9 @@ KEYWORDS
if ($ENV{'form.lastSub'} eq 'lastonly' ||
($ENV{'form.lastSub'} eq 'hdgrade' &&
$$handgrade{$part} eq 'yes')) {
- $lastsubonly.=' | Part '.
- $partid.' ( ID '.$respid.
+ my $display_part=&get_display_part($partid,$url,$symb);
+ $lastsubonly.='Part: '.
+ $display_part.' ( ID '.$respid.
' ) ';
if ($record{"resource.$partid.$respid.uploadedurl"}) {
&Apache::lonnet::allowuploaded('/adm/grades',
@@ -2326,7 +2347,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
@@ -2365,14 +2387,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}.') | '."\n";
+ $result.='Score Part: '.$display_part.
+ ' (weight = '.$weight{$partid}.') | '."\n";
next;
+ } else {
+ $display =~s/\[Part: \Q$partid\E\]/Part:<\/b> $display_part/;
}
$display =~ s|Problem Status|Grade Status |;
- $result.=''.$display.' | '."\n";
+ $result.=''.$display.' | '."\n";
}
$result.=' ';
@@ -2502,9 +2527,10 @@ sub editgrades {
}
}
foreach my $partid (@partid) {
+ my $display_part=&get_display_part($partid,$url,$symb);
$result .= 'Part '.$partid.
- ' (Weight = '.$weight{$partid}.') | ';
+ '" align="center">Part: '.$display_part.
+ ' (Weight = '.$weight{$partid}.')';
}
$result .= '';
@@ -3193,9 +3219,12 @@ sub displayPage {
sub displaySubByDates {
my ($symb,$record,$parts,$responseType,$checkIcon,$uname,$udom) = @_;
+ my $isCODE=0;
+ if (exists($record->{'resource.CODE'})) { $isCODE=1; }
my $studentTable=''.
''.
'Date/Time | '.
+ ($isCODE?'CODE | ':'').
'Submission | '.
'Status | ';
my ($version);
@@ -3208,18 +3237,22 @@ sub displaySubByDates {
for ($version=1;$version<=$$record{'version'};$version++) {
my $timestamp = scalar(localtime($$record{$version.':timestamp'}));
$studentTable.=''.$timestamp.' | ';
+ if ($isCODE) {
+ $studentTable.=''.$record->{$version.':resource.CODE'}.' | ';
+ }
my @versionKeys = split(/\:/,$$record{$version.':keys'});
my @displaySub = ();
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}) &&
$$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 {
@@ -3237,14 +3270,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
@@ -3341,12 +3374,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).
' ';
@@ -3818,7 +3852,8 @@ sub scantron_find_student {
sub scantron_filter {
my ($curres)=@_;
- if (ref($curres) && $curres->is_problem() && !$curres->randomout) {
+ # randomout is dysfunctional at best for this purpose
+ if (ref($curres) && $curres->is_problem()) { #&& !$curres->randomout) {
return 1;
}
return 0;
@@ -3970,7 +4005,7 @@ sub scantron_form_start {
-
+
@@ -4290,8 +4325,8 @@ sub scantron_get_correction {
} elsif ($error eq 'duplicateCODE') {
$r->print("The encoded CODE has also been used by a previous paper ".join(', ',@{$arg}).", and CODEs are supposed to be unique \n");
}
- $r->print("The CODE on the form is ".
- $$scan_record{'scantron.CODE'}." \n");
+ $r->print(" The CODE on the form is '".
+ $$scan_record{'scantron.CODE'}."' \n");
$r->print(" The ID on the form is ".
$$scan_record{'scantron.ID'}." \n");
$r->print("The name on the paper is ".
@@ -4437,13 +4472,21 @@ sub scantron_validate_CODE {
$scan_data);
my $CODE=$$scan_record{'scantron.CODE'};
my $error=0;
- if (!exists($allcodes{$CODE}) && !$$scan_record{'scantron.useCODE'}) {
+ if (!&Apache::lonnet::validCODE($CODE)) {
&scantron_get_correction($r,$i,$scan_record,
\%scantron_config,
$line,'incorrectCODE',\%allcodes);
return(1,$currentphase);
}
- if (exists($usedCODEs{$CODE}) && $ENV{'form.scantron_CODEunique'}
+ if (%allcodes && !exists($allcodes{$CODE})
+ && !$$scan_record{'scantron.useCODE'}) {
+ &scantron_get_correction($r,$i,$scan_record,
+ \%scantron_config,
+ $line,'incorrectCODE',\%allcodes);
+ return(1,$currentphase);
+ }
+ if (exists($usedCODEs{$CODE})
+ && $ENV{'form.scantron_CODEunique'} eq 'yes'
&& !$$scan_record{'scantron.CODE_ignore_dup'}) {
&scantron_get_correction($r,$i,$scan_record,
\%scantron_config,
@@ -4608,11 +4651,14 @@ SCANTRONFORM
if (exists($scan_record->{'scantron.CODE'}) &&
$scan_record->{'scantron.CODE'}) {
$form{'CODE'}=$scan_record->{'scantron.CODE'};
+ } else {
+ $form{'CODE'}='';
}
my $result=&Apache::lonnet::ssi($resource->src(),%form);
-
+ if (&Apache::loncommon::connection_aborted($r)) { last; }
}
$completedstudents{$uname}={'line'=>$line};
+ if (&Apache::loncommon::connection_aborted($r)) { last; }
} continue {
&Apache::lonnet::delenv('form.counter');
&Apache::lonnet::delenv('scantron\.');
@@ -5078,8 +5124,7 @@ sub send_header {
sub send_footer {
my ($request)= @_;
- $request->print('
|
| | |