';
+ &Apache::lonxml::clear_problem_counter();
my ($depth,$question,$prob) = (1,1,1);
$iterator->next(); # skip the first BEGIN_MAP
my $curRes = $iterator->next(); # for "current resource"
@@ -3837,6 +3926,7 @@ sub displayPage {
sub displaySubByDates {
my ($symb,$record,$parts,$responseType,$checkIcon,$uname,$udom) = @_;
my $isCODE=0;
+ my $isTask = ($symb =~/\.task$/);
if (exists($record->{'resource.CODE'})) { $isCODE=1; }
my $studentTable='
'.
'
'.
@@ -3851,8 +3941,17 @@ sub displaySubByDates {
if (!exists($$record{'1:timestamp'})) {
return ' Nothing submitted - no attempts ';
}
+
+ my $interaction;
for ($version=1;$version<=$$record{'version'};$version++) {
my $timestamp = scalar(localtime($$record{$version.':timestamp'}));
+ if (exists($$record{$version.':resource.0.version'})) {
+ $interaction = $$record{$version.':resource.0.version'};
+ }
+
+ my $where = ($isTask ? "$version:resource.$interaction"
+ : "$version:resource");
+ #&Apache::lonnet::logthis(" got $where");
$studentTable.='
'.$timestamp.'
';
if ($isCODE) {
$studentTable.='
'.$record->{$version.':resource.CODE'}.'
';
@@ -3860,40 +3959,57 @@ sub displaySubByDates {
my @versionKeys = split(/\:/,$$record{$version.':keys'});
my @displaySub = ();
foreach my $partid (@{$parts}) {
- my @matchKey = sort(grep /^resource\.\Q$partid\E\..*?\.submission$/,@versionKeys);
+ my @matchKey = ($isTask ? sort(grep /^resource\.\d+\.\Q$partid\E\.award$/,@versionKeys)
+ : sort(grep /^resource\.\Q$partid\E\..*?\.submission$/,@versionKeys));
+
+
# next if ($$record{"$version:resource.$partid.solved"} eq '');
my $display_part=&get_display_part($partid,$symb);
foreach my $matchKey (@matchKey) {
if (exists($$record{$version.':'.$matchKey}) &&
$$record{$version.':'.$matchKey} ne '') {
- my ($responseId)=($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/);
+
+ my ($responseId)= ($isTask ? ($matchKey=~ /^resource\.(.*?)\.\Q$partid\E\.award$/)
+ : ($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/));
+ #&Apache::lonnet::logthis("match $matchKey $responseId (".$$record{$version.':'.$matchKey});
$displaySub[0].='Part: '.$display_part.' ';
$displaySub[0].='(ID '.
$responseId.') ';
- if ($$record{"$version:resource.$partid.tries"} eq '') {
+ if ($$record{"$where.$partid.tries"} eq '') {
$displaySub[0].='Trial not counted';
} else {
$displaySub[0].='Trial '.
- $$record{"$version:resource.$partid.tries"};
+ $$record{"$where.$partid.tries"};
}
- my $responseType=$responseType->{$partid}->{$responseId};
+ my $responseType=($isTask ? 'Task'
+ : $responseType->{$partid}->{$responseId});
if (!exists($orders{$partid})) { $orders{$partid}={}; }
if (!exists($orders{$partid}->{$responseId})) {
$orders{$partid}->{$responseId}=
&get_order($partid,$responseId,$symb,$uname,$udom);
}
$displaySub[0].=' '.
- &cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:").' ';
+ &cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:",$uname,$udom).' ';
}
}
- if (exists $$record{"$version:resource.$partid.award"}) {
+ if (exists($$record{"$where.$partid.checkedin"})) {
+ $displaySub[1].='Checked in by '.
+ $$record{"$where.$partid.checkedin"}.' into slot '.
+ $$record{"$where.$partid.checkedin.slot"}.
+ ' ';
+ }
+ if (exists $$record{"$where.$partid.award"}) {
$displaySub[1].='Part: '.$display_part.' '.
- lc($$record{"$version:resource.$partid.award"}).' '.
- $mark{$$record{"$version:resource.$partid.solved"}}.
+ lc($$record{"$where.$partid.award"}).' '.
+ $mark{$$record{"$where.$partid.solved"}}.
' ';
}
- if (exists $$record{"$version:resource.$partid.regrader"}) {
- $displaySub[2].=$$record{"$version:resource.$partid.regrader"}.
+ if (exists $$record{"$where.$partid.regrader"}) {
+ $displaySub[2].=$$record{"$where.$partid.regrader"}.
+ ' ('.&mt('Part').': '.$display_part.')';
+ } elsif ($$record{"$version:resource.$partid.regrader"} =~ /\S/) {
+ $displaySub[2].=
+ $$record{"$version:resource.$partid.regrader"}.
' ('.&mt('Part').': '.$display_part.')';
}
}
@@ -4199,7 +4315,8 @@ sub scantron_selectphase {
Options:
-
+
+
@@ -4528,8 +4645,15 @@ sub scantron_find_student {
sub scantron_filter {
my ($curres)=@_;
- # randomout is dysfunctional at best for this purpose
- if (ref($curres) && $curres->is_problem()) { #&& !$curres->randomout) {
+
+ if (ref($curres) && $curres->is_problem()) {
+ # if the user has asked to not have either hidden
+ # or 'randomout' controlled resources to be graded
+ # don't include them
+ if ($env{'form.scantron_options_hidden'} eq 'ignore_hidden'
+ && $curres->randomout) {
+ return 0;
+ }
return 1;
}
return 0;
@@ -4624,7 +4748,6 @@ sub remember_current_skipped {
$to_remember{$i}=1;
}
}
- &Apache::lonnet::logthis('remembering '.join(':',%to_remember));
&scan_data($scan_data,'remember_skipping',join(':',%to_remember));
&scantron_putfile(undef,$scan_data);
}
@@ -4712,6 +4835,7 @@ sub scantron_form_start {
+
SCANTRONFORM
return $result;
}
@@ -4746,11 +4870,12 @@ sub scantron_validate_file {
$r->print("
Gathering neccessary info.
");$r->rflush();
#get the student pick code ready
$r->print(&Apache::loncommon::studentbrowser_javascript());
- my $max_bubble=&scantron_get_maxbubble($r);
+ my $max_bubble=&scantron_get_maxbubble();
my $result=&scantron_form_start($max_bubble).$default_form_data;
$r->print($result);
- my @validate_phases=( 'ID',
+ my @validate_phases=( 'sequence',
+ 'ID',
'CODE',
'doublebubble',
'missingbubbles');
@@ -4783,10 +4908,17 @@ STUFF
$r->print("");
}
if ($stop) {
- $r->print('');
- $r->print(' using corrected info ');
- $r->print("");
- $r->print(" this scanline saving it for later.");
+ if ($validate_phases[$currentphase] eq 'sequence') {
+ $r->print('');
+ $r->print(' this error ');
+
+ $r->print("
Or click the 'Grading Menu' button to start over.
");
+ } else {
+ $r->print('');
+ $r->print(' using corrected info ');
+ $r->print("");
+ $r->print(" this scanline saving it for later.");
+ }
}
$r->print(" ".&show_grading_menu_form($symb).
"