version 1.150, 2003/11/07 19:10:51
|
version 1.151, 2003/11/07 19:23:56
|
Line 1562 KEYWORDS
|
Line 1562 KEYWORDS
|
# (3) Last submission plus the parts info |
# (3) Last submission plus the parts info |
# (4) The whole record for this student |
# (4) The whole record for this student |
if ($ENV{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) { |
if ($ENV{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) { |
my ($string,$timestamp)= &get_last_submission(\%record); |
my ($string,$timestamp)= &get_last_submission(\%record); |
my $lastsubonly=''. |
my $lastsubonly=''. |
($$timestamp eq '' ? '' : '<b>Date Submitted:</b> '. |
($$timestamp eq '' ? '' : '<b>Date Submitted:</b> '. |
$$timestamp)."</td></tr>\n"; |
$$timestamp)."</td></tr>\n"; |
if ($$timestamp eq '') { |
if ($$timestamp eq '') { |
$lastsubonly.='<tr><td bgcolor="#ffffe6">'.$$string[0]; |
$lastsubonly.='<tr><td bgcolor="#ffffe6">'.$$string[0]; |
} else { |
} else { |
my %seenparts; |
my %seenparts; |
for my $part (sort keys(%$handgrade)) { |
for my $part (sort keys(%$handgrade)) { |
my ($partid,$respid) = split(/_/,$part); |
my ($partid,$respid) = split(/_/,$part); |
if ($ENV{"form.$uname:$udom:$partid:submitted_by"}) { |
if ($ENV{"form.$uname:$udom:$partid:submitted_by"}) { |
if (exists($seenparts{$partid})) { next; } |
if (exists($seenparts{$partid})) { next; } |
$seenparts{$partid}=1; |
$seenparts{$partid}=1; |
my $submitby='<b>Part '.$partid. |
my $submitby='<b>Part '.$partid. |
' Collaborative submission by: </b>'. |
' Collaborative submission by: </b>'. |
'<a href="javascript:viewSubmitter(\''. |
'<a href="javascript:viewSubmitter(\''. |
$ENV{"form.$uname:$udom:$partid:submitted_by"}. |
$ENV{"form.$uname:$udom:$partid:submitted_by"}. |
'\')"; TARGET=_self>'. |
'\')"; TARGET=_self>'. |
$$fullname{$ENV{"form.$uname:$udom:$partid:submitted_by"}}.'</a><br />'; |
$$fullname{$ENV{"form.$uname:$udom:$partid:submitted_by"}}.'</a><br />'; |
$request->print($submitby); |
$request->print($submitby); |
next; |
next; |
|
} |
|
my $responsetype = $responseType->{$partid}->{$respid}; |
|
if (!exists($record{"resource.$partid.$respid.submission"})) { |
|
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part '. |
|
$partid.'</b> <font color="#999999">( ID '.$respid. |
|
' )</font> '. |
|
'<font color="red">Nothing submitted - no attempts</font><br /><br />'; |
|
next; |
|
} |
|
foreach (@$string) { |
|
my ($partid,$respid) = /^resource\.([^\.]*)\.([^\.]*)\.submission/; |
|
if ($part ne ($partid.'_'.$respid)) { next; } |
|
my ($ressub,$subval) = split(/:/,$_,2); |
|
# Similarity check |
|
my $similar=''; |
|
if($ENV{'form.checkPlag'}){ |
|
my ($oname,$odom,$ocrsid,$oessay,$osim)= |
|
&most_similar($uname,$udom,$subval); |
|
if ($osim) { |
|
$osim=int($osim*100.0); |
|
$similar="<hr /><h3><font color=\"#FF0000\">Essay". |
|
" is $osim% similar to an essay by ". |
|
&Apache::loncommon::plainname($oname,$odom). |
|
'</font></h3><blockquote><i>'. |
|
&keywords_highlight($oessay). |
|
'</i></blockquote><hr />'; |
|
} |
} |
} |
my $responsetype = $responseType->{$partid}->{$respid}; |
my $order=&get_order($partid,$respid,$symb,$uname,$udom); |
if (!exists($record{'resource.'.$partid.'.'.$respid.'.submission'})) { |
if ($ENV{'form.lastSub'} eq 'lastonly' || |
|
($ENV{'form.lastSub'} eq 'hdgrade' && |
|
$$handgrade{$part} eq 'yes')) { |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part '. |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part '. |
$partid.'</b> <font color="#999999">( ID '.$respid. |
$partid.'</b> <font color="#999999">( ID '.$respid. |
' )</font> '. |
' )</font> '; |
'<font color="red">Nothing submitted - no attempts</font><br /><br />'; |
if ($record{"resource.$partid.$respid.uploadedurl"}) { |
} else { |
$lastsubonly.='<a href="'.&Apache::lonnet::tokenwrapper($record{"resource.$partid.$respid.uploadedurl"}).'"><img src="/adm/lonIcons/unknown.gif" border=0"> File uploaded by student</a> <font color="red" size="1">Like all files provided by users, this file may contain virusses</font><br />'; |
foreach (@$string) { |
|
my ($partid,$respid) = /^resource\.([^\.]*)\.([^\.]*)\.submission/; |
|
if ($part eq ($partid.'_'.$respid)) { |
|
my ($ressub,$subval) = split(/:/,$_,2); |
|
# Similarity check |
|
my $similar=''; |
|
my $oname; |
|
my $odom; |
|
my $ocrsid; |
|
my $oessay; |
|
my $osim; |
|
if($ENV{'form.checkPlag'}){ |
|
($oname,$odom,$ocrsid,$oessay,$osim)=&most_similar($uname,$udom,$subval); |
|
if ($osim) { |
|
$osim=int($osim*100.0); |
|
$similar='<hr /><h3><font color="#FF0000">Essay is '.$osim. |
|
'% similar to an essay by '.&Apache::loncommon::plainname($oname,$odom). |
|
'</font></h3><blockquote><i>'. |
|
&keywords_highlight($oessay).'</i></blockquote><hr />'; |
|
} |
|
} |
|
my $order=&get_order($partid,$respid,$symb,$uname,$udom); |
|
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part '. |
|
$partid.'</b> <font color="#999999">( ID '.$respid. |
|
' )</font> '. |
|
($record{"resource.$partid.$respid.uploadedurl"}? |
|
'<a href="'. |
|
&Apache::lonnet::tokenwrapper($record{"resource.$partid.$respid.uploadedurl"}). |
|
'"><img src="/adm/lonIcons/unknown.gif" border=0"> File uploaded by student</a> '. |
|
'<font color="red" size="1">Like all files provided by users, '. |
|
'this file may contain virusses</font><br />':''). |
|
'<b>Submitted Answer: </b>'. |
|
&cleanRecord($subval,$responsetype,$symb,$partid,$respid,\%record,$order). |
|
'<br /><br />'.$similar."\n" |
|
if ($ENV{'form.lastSub'} eq 'lastonly' || |
|
($ENV{'form.lastSub'} eq 'hdgrade' && |
|
$$handgrade{$part} eq 'yes')); |
|
} |
|
} |
} |
|
$lastsubonly.='<b>Submitted Answer: </b>'. |
|
&cleanRecord($subval,$responsetype,$symb,$partid, |
|
$respid,\%record,$order); |
|
if ($similar) {$lastsubonly.="<br /><br />$similar\n";} |
} |
} |
} |
} |
} |
} |
$lastsubonly.='</td></tr><tr bgcolor="#ffffff"><td>'."\n"; |
} |
$request->print($lastsubonly); |
$lastsubonly.='</td></tr><tr bgcolor="#ffffff"><td>'."\n"; |
|
$request->print($lastsubonly); |
} elsif ($ENV{'form.lastSub'} eq 'datesub') { |
} elsif ($ENV{'form.lastSub'} eq 'datesub') { |
my (undef,$responseType,undef,$parts) = &showResourceInfo($url); |
my (undef,$responseType,undef,$parts) = &showResourceInfo($url); |
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); |
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); |