version 1.334, 2006/03/13 21:10:34
|
version 1.335, 2006/03/19 21:29:50
|
Line 118 sub response_type {
|
Line 118 sub response_type {
|
my %seen = (); |
my %seen = (); |
my (@partlist,%handgrade,%responseType); |
my (@partlist,%handgrade,%responseType); |
foreach (split(/,/,&Apache::lonnet::metadata($url,'packages'))) { |
foreach (split(/,/,&Apache::lonnet::metadata($url,'packages'))) { |
if (/^\w+response_.*/) { |
if (/^\w+response_.*/ || /^Task_/) { |
my ($responsetype,$part) = split(/_/,$_,2); |
my ($responsetype,$part) = split(/_/,$_,2); |
my ($partid,$respid) = split(/_/,$part); |
my ($partid,$respid) = split(/_/,$part); |
|
if ($responsetype eq 'Task') { $respid='0'; } |
if (&Apache::loncommon::check_if_partid_hidden($partid,$symb)) { |
if (&Apache::loncommon::check_if_partid_hidden($partid,$symb)) { |
next; |
next; |
} |
} |
Line 205 sub get_order {
|
Line 206 sub get_order {
|
return ($analyze{"$partid.$respid.shown"}); |
return ($analyze{"$partid.$respid.shown"}); |
} |
} |
#--- Clean response type for display |
#--- Clean response type for display |
#--- Currently filters option/rank/radiobutton/match/essay response types only. |
#--- Currently filters option/rank/radiobutton/match/essay/Task |
|
# response types only. |
sub cleanRecord { |
sub cleanRecord { |
my ($answer,$response,$symb,$partid,$respid,$record,$order,$version) = @_; |
my ($answer,$response,$symb,$partid,$respid,$record,$order,$version) = @_; |
my $grayFont = '<font color="#999999">'; |
my $grayFont = '<font color="#999999">'; |
Line 288 sub cleanRecord {
|
Line 290 sub cleanRecord {
|
my $jme=$record->{$version."resource.$partid.$respid.molecule"}; |
my $jme=$record->{$version."resource.$partid.$respid.molecule"}; |
$result.=&Apache::chemresponse::jme_img($jme,$answer,400); |
$result.=&Apache::chemresponse::jme_img($jme,$answer,400); |
return $result; |
return $result; |
|
} elsif ( $response eq 'Task') { |
|
if ( $answer eq 'SUBMITTED') { |
|
my $files = $record->{$version."resource.$respid.$partid.bridgetask.portfiles"}; |
|
my $result = &Apache::bridgetask::file_list($files); |
|
return $result; |
|
} elsif ( grep(/^\Q$version\E.*?\.instance$/, keys(%{$record})) ) { |
|
my @matches = grep(/^\Q$version\E.*?\.instance$/, |
|
keys(%{$record})); |
|
return join('<br />',($version,@matches)); |
|
|
|
|
|
} else { |
|
my $result = |
|
'<p>' |
|
.&mt('Overall result: [_1]', |
|
$record->{$version."resource.$respid.$partid.status"}) |
|
.'</p>'; |
|
|
|
$result .= '<ul>'; |
|
my @grade = grep(/^\Q${version}resource.$respid.$partid.\E[^.]*[.]status$/, |
|
keys(%{$record})); |
|
foreach my $grade (sort(@grade)) { |
|
my ($dim) = ($grade =~/[.]([^.]+)[.]status$/); |
|
$result.= '<li>'.&mt("Dimension: [_1], status [_2] ", |
|
$dim, $record->{$grade}). |
|
'</li>'; |
|
} |
|
$result.='</ul>'; |
|
return $result; |
|
} |
|
|
} |
} |
return $answer; |
return $answer; |
} |
} |
Line 1841 KEYWORDS
|
Line 1874 KEYWORDS
|
foreach my $file (@$files) { |
foreach my $file (@$files) { |
$file_counter ++; |
$file_counter ++; |
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
$lastsubonly.='<br /><a href="'.$file.'" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border="0"> '.$file.'</a>'; |
$lastsubonly.='<br /><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border=0"> '.$file.'</a>'; |
} |
} |
$lastsubonly.='<br />'; |
$lastsubonly.='<br />'; |
} |
} |
Line 3842 sub displayPage {
|
Line 3875 sub displayPage {
|
sub displaySubByDates { |
sub displaySubByDates { |
my ($symb,$record,$parts,$responseType,$checkIcon,$uname,$udom) = @_; |
my ($symb,$record,$parts,$responseType,$checkIcon,$uname,$udom) = @_; |
my $isCODE=0; |
my $isCODE=0; |
|
my $isTask = ($symb =~/\.task$/); |
if (exists($record->{'resource.CODE'})) { $isCODE=1; } |
if (exists($record->{'resource.CODE'})) { $isCODE=1; } |
my $studentTable='<table border="0" width="100%"><tr><td bgcolor="#777777">'. |
my $studentTable='<table border="0" width="100%"><tr><td bgcolor="#777777">'. |
'<table border="0" width="100%"><tr bgcolor="#e6ffff">'. |
'<table border="0" width="100%"><tr bgcolor="#e6ffff">'. |
Line 3856 sub displaySubByDates {
|
Line 3890 sub displaySubByDates {
|
if (!exists($$record{'1:timestamp'})) { |
if (!exists($$record{'1:timestamp'})) { |
return '<br /> <font color="red">Nothing submitted - no attempts</font><br />'; |
return '<br /> <font color="red">Nothing submitted - no attempts</font><br />'; |
} |
} |
|
|
|
my $interaction; |
for ($version=1;$version<=$$record{'version'};$version++) { |
for ($version=1;$version<=$$record{'version'};$version++) { |
my $timestamp = scalar(localtime($$record{$version.':timestamp'})); |
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.='<tr bgcolor="#ffffff" valign="top"><td>'.$timestamp.'</td>'; |
$studentTable.='<tr bgcolor="#ffffff" valign="top"><td>'.$timestamp.'</td>'; |
if ($isCODE) { |
if ($isCODE) { |
$studentTable.='<td>'.$record->{$version.':resource.CODE'}.'</td>'; |
$studentTable.='<td>'.$record->{$version.':resource.CODE'}.'</td>'; |
Line 3865 sub displaySubByDates {
|
Line 3908 sub displaySubByDates {
|
my @versionKeys = split(/\:/,$$record{$version.':keys'}); |
my @versionKeys = split(/\:/,$$record{$version.':keys'}); |
my @displaySub = (); |
my @displaySub = (); |
foreach my $partid (@{$parts}) { |
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 ''); |
# next if ($$record{"$version:resource.$partid.solved"} eq ''); |
my $display_part=&get_display_part($partid,$symb); |
my $display_part=&get_display_part($partid,$symb); |
foreach my $matchKey (@matchKey) { |
foreach my $matchKey (@matchKey) { |
if (exists($$record{$version.':'.$matchKey}) && |
if (exists($$record{$version.':'.$matchKey}) && |
$$record{$version.':'.$matchKey} ne '') { |
$$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].='<b>Part:</b> '.$display_part.' '; |
$displaySub[0].='<b>Part:</b> '.$display_part.' '; |
$displaySub[0].='<font color="#999999">(ID '. |
$displaySub[0].='<font color="#999999">(ID '. |
$responseId.')</font> <b>'; |
$responseId.')</font> <b>'; |
if ($$record{"$version:resource.$partid.tries"} eq '') { |
if ($$record{"$where.$partid.tries"} eq '') { |
$displaySub[0].='Trial not counted'; |
$displaySub[0].='Trial not counted'; |
} else { |
} else { |
$displaySub[0].='Trial '. |
$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})) { $orders{$partid}={}; } |
if (!exists($orders{$partid}->{$responseId})) { |
if (!exists($orders{$partid}->{$responseId})) { |
$orders{$partid}->{$responseId}= |
$orders{$partid}->{$responseId}= |
Line 3891 sub displaySubByDates {
|
Line 3941 sub displaySubByDates {
|
&cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:").'<br />'; |
&cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:").'<br />'; |
} |
} |
} |
} |
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"}. |
|
'<br />'; |
|
} |
|
if (exists $$record{"$where.$partid.award"}) { |
$displaySub[1].='<b>Part:</b> '.$display_part.' '. |
$displaySub[1].='<b>Part:</b> '.$display_part.' '. |
lc($$record{"$version:resource.$partid.award"}).' '. |
lc($$record{"$where.$partid.award"}).' '. |
$mark{$$record{"$version:resource.$partid.solved"}}. |
$mark{$$record{"$where.$partid.solved"}}. |
'<br />'; |
'<br />'; |
} |
} |
if (exists $$record{"$version:resource.$partid.regrader"}) { |
if (exists $$record{"$where.$partid.regrader"}) { |
$displaySub[2].=$$record{"$version:resource.$partid.regrader"}. |
$displaySub[2].=$$record{"$where.$partid.regrader"}. |
|
' (<b>'.&mt('Part').':</b> '.$display_part.')'; |
|
} elsif ($$record{"$version:resource.$partid.regrader"} =~ /\S/) { |
|
$displaySub[2].= |
|
$$record{"$version:resource.$partid.regrader"}. |
' (<b>'.&mt('Part').':</b> '.$display_part.')'; |
' (<b>'.&mt('Part').':</b> '.$display_part.')'; |
} |
} |
} |
} |
Line 4637 sub remember_current_skipped {
|
Line 4697 sub remember_current_skipped {
|
$to_remember{$i}=1; |
$to_remember{$i}=1; |
} |
} |
} |
} |
&Apache::lonnet::logthis('remembering '.join(':',%to_remember)); |
|
&scan_data($scan_data,'remember_skipping',join(':',%to_remember)); |
&scan_data($scan_data,'remember_skipping',join(':',%to_remember)); |
&scantron_putfile(undef,$scan_data); |
&scantron_putfile(undef,$scan_data); |
} |
} |
Line 5559 sub scantron_upload_scantron_data_save {
|
Line 5618 sub scantron_upload_scantron_data_save {
|
sub valid_file { |
sub valid_file { |
my ($requested_file)=@_; |
my ($requested_file)=@_; |
foreach my $filename (sort(&scantron_filenames())) { |
foreach my $filename (sort(&scantron_filenames())) { |
&Apache::lonnet::logthis("$requested_file $filename"); |
|
if ($requested_file eq $filename) { return 1; } |
if ($requested_file eq $filename) { return 1; } |
} |
} |
return 0; |
return 0; |