version 1.594, 2010/02/19 15:41:32
|
version 1.596, 2010/02/28 23:31:42
|
Line 2212 KEYWORDS
|
Line 2212 KEYWORDS
|
foreach my $submission (@$string) { |
foreach my $submission (@$string) { |
my ($partid,$respid) = ($submission =~ /^resource\.([^\.]*)\.([^\.]*)\.submission/); |
my ($partid,$respid) = ($submission =~ /^resource\.([^\.]*)\.([^\.]*)\.submission/); |
if (join('_',@{$part}) ne ($partid.'_'.$respid)) { next; } |
if (join('_',@{$part}) ne ($partid.'_'.$respid)) { next; } |
my ($ressub,$subval) = split(/:/,$submission,2); |
my ($ressub,$hide,$subval) = split(/:/,$submission,3); |
# Similarity check |
# Similarity check |
my $similar=''; |
my $similar=''; |
if($env{'form.checkPlag'}){ |
if($env{'form.checkPlag'}){ |
Line 2224 KEYWORDS
|
Line 2224 KEYWORDS
|
&Apache::lonnet::coursedescription($ocrsid, |
&Apache::lonnet::coursedescription($ocrsid, |
{'one_time' => 1}); |
{'one_time' => 1}); |
|
|
$similar="<hr /><h3><span class=\"LC_warning\">". |
if ($hide) { |
&mt('Essay is [_1]% similar to an essay by [_2] in course [_3] (course id [_4]:[_5])', |
$similar='<hr /><span class="LC_warning">'.&mt("Essay was found to be similar to another essay submitted for this assignment.").'<br />'. |
$osim, |
&mt('As the current submission is for an anonymous survey, no other details are available.').'</span><hr />'; |
&Apache::loncommon::plainname($oname,$odom).' ('.$oname.':'.$odom.')', |
} else { |
$old_course_desc{'description'}, |
$similar="<hr /><h3><span class=\"LC_warning\">". |
$old_course_desc{'num'}, |
&mt('Essay is [_1]% similar to an essay by [_2] in course [_3] (course id [_4]:[_5])', |
$old_course_desc{'domain'}). |
$osim, |
'</span></h3><blockquote><i>'. |
&Apache::loncommon::plainname($oname,$odom).' ('.$oname.':'.$odom.')', |
&keywords_highlight($oessay). |
$old_course_desc{'description'}, |
'</i></blockquote><hr />'; |
$old_course_desc{'num'}, |
|
$old_course_desc{'domain'}). |
|
'</span></h3><blockquote><i>'. |
|
&keywords_highlight($oessay). |
|
'</i></blockquote><hr />'; |
|
} |
} |
} |
} |
} |
my $order=&get_order($partid,$respid,$symb,$uname,$udom); |
my $order=&get_order($partid,$respid,$symb,$uname,$udom); |
Line 2248 KEYWORDS
|
Line 2253 KEYWORDS
|
'</b></span> '; |
'</b></span> '; |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record); |
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record); |
if (@$files) { |
if (@$files) { |
$lastsubonly.='<br /><span class="LC_warning">'.&mt('Like all files provided by users, this file may contain viruses').'</span><br />'; |
if ($hide) { |
my $file_counter = 0; |
$lastsubonly.='<br />'.&mt('[quant,_1,file] uploaded to this anonymous survey',scalar(@{$files})); |
foreach my $file (@$files) { |
} else { |
$file_counter++; |
$lastsubonly.='<br /><span class="LC_warning">'.&mt('Like all files provided by users, this file may contain viruses').'</span><br />'; |
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
foreach my $file (@$files) { |
$lastsubonly.='<br /><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border="0" /> '.$file.'</a>'; |
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
} |
$lastsubonly.='<br /><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border="0" /> '.$file.'</a>'; |
|
} |
|
} |
$lastsubonly.='<br />'; |
$lastsubonly.='<br />'; |
} |
} |
$lastsubonly.='<b>'.&mt('Submitted Answer:').' </b>'. |
if ($hide) { |
&cleanRecord($subval,$responsetype,$symb,$partid, |
$lastsubonly.='<b>'.&mt('Anonymous Survey').'</b>'; |
$respid,\%record,$order,undef,$uname,$udom); |
} else { |
|
$lastsubonly.='<b>'.&mt('Submitted Answer:').' </b>'. |
|
&cleanRecord($subval,$responsetype,$symb,$partid, |
|
$respid,\%record,$order,undef,$uname,$udom); |
|
} |
if ($similar) {$lastsubonly.="<br /><br />$similar\n";} |
if ($similar) {$lastsubonly.="<br /><br />$similar\n";} |
$lastsubonly.='</div>'; |
$lastsubonly.='</div>'; |
} |
} |
Line 2454 sub check_collaborators {
|
Line 2465 sub check_collaborators {
|
#--- Retrieve the last submission for all the parts |
#--- Retrieve the last submission for all the parts |
sub get_last_submission { |
sub get_last_submission { |
my ($returnhash)=@_; |
my ($returnhash)=@_; |
my (@string,$timestamp); |
my (@string,$timestamp,%lasthidden); |
if ($$returnhash{'version'}) { |
if ($$returnhash{'version'}) { |
my %lasthash=(); |
my %lasthash=(); |
my ($version); |
my ($version); |
Line 2466 sub get_last_submission {
|
Line 2477 sub get_last_submission {
|
&Apache::lonlocal::locallocaltime($$returnhash{$version.':timestamp'}); |
&Apache::lonlocal::locallocaltime($$returnhash{$version.':timestamp'}); |
} |
} |
} |
} |
|
my %typeparts; |
|
my $showsurv = |
|
&Apache::lonnet::allowed('vas',$env{'request.course.id'}); |
|
foreach my $key (sort(keys(%lasthash))) { |
|
if ($key =~ /\.type$/) { |
|
if (($lasthash{$key} eq 'anonsurvey') || |
|
($lasthash{$key} eq 'anonsurveycred')) { |
|
my ($ign,@parts) = split(/\./,$key); |
|
pop(@parts); |
|
unless ($showsurv) { |
|
my $id = join(',',@parts); |
|
$typeparts{$ign.'.'.$id} = $lasthash{$key}; |
|
} |
|
delete($lasthash{$key}); |
|
} |
|
} |
|
} |
|
my @hidden = keys(%typeparts); |
foreach my $key (keys(%lasthash)) { |
foreach my $key (keys(%lasthash)) { |
next if ($key !~ /\.submission$/); |
next if ($key !~ /\.submission$/); |
|
my $hide; |
|
if (@hidden) { |
|
foreach my $id (@hidden) { |
|
if ($key =~ /^\Q$id\E/) { |
|
$hide = 1; |
|
last; |
|
} |
|
} |
|
} |
my ($partid,$foo) = split(/submission$/,$key); |
my ($partid,$foo) = split(/submission$/,$key); |
my $draft = $lasthash{$partid.'awarddetail'} eq 'DRAFT' ? |
my $draft = $lasthash{$partid.'awarddetail'} eq 'DRAFT' ? |
'<span class="LC_warning">Draft Copy</span> ' : ''; |
'<span class="LC_warning">Draft Copy</span> ' : ''; |
push(@string, join(':', $key, $draft.$lasthash{$key})); |
push(@string, join(':', $key, $hide, $draft.$lasthash{$key})); |
} |
} |
} |
} |
if (!@string) { |
if (!@string) { |
Line 3561 sub editgrades {
|
Line 3598 sub editgrades {
|
'incorrect'=>'incorrect_by_override', |
'incorrect'=>'incorrect_by_override', |
'excused' =>'excused', |
'excused' =>'excused', |
'ungraded' =>'ungraded_attempted', |
'ungraded' =>'ungraded_attempted', |
|
'credited' =>'credit_attempted', |
'nothing' => '', |
'nothing' => '', |
); |
); |
my ($classlist,undef,$fullname) = &getclasslist($env{'form.section'},'0'); |
my ($classlist,undef,$fullname) = &getclasslist($env{'form.section'},'0'); |
Line 4590 sub displaySubByDates {
|
Line 4628 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 $hidden; |
|
if (($$record{$version.':resource.'.$partid.'.type'} eq 'anonsurvey') || |
|
($$record{$version.':resource.'.$partid.'.type'} eq 'anonsurveycred')) { |
|
$hidden = 1; |
|
} |
my @matchKey = ($isTask ? sort(grep /^resource\.\d+\.\Q$partid\E\.award$/,@versionKeys) |
my @matchKey = ($isTask ? sort(grep /^resource\.\d+\.\Q$partid\E\.award$/,@versionKeys) |
: sort(grep /^resource\.\Q$partid\E\..*?\.submission$/,@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)= ($isTask ? ($matchKey=~ /^resource\.(.*?)\.\Q$partid\E\.award$/) |
my ($responseId)= ($isTask ? ($matchKey=~ /^resource\.(.*?)\.\Q$partid\E\.award$/) |
: ($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/)); |
: ($matchKey=~ /^resource\.\Q$partid\E\.(.*?)\.submission$/)); |
$displaySub[0].='<span class="LC_nobreak"'; |
$displaySub[0].='<span class="LC_nobreak"'; |
Line 4608 sub displaySubByDates {
|
Line 4650 sub displaySubByDates {
|
.'('.&mt('Part ID: [_1]',$responseId).')' |
.'('.&mt('Part ID: [_1]',$responseId).')' |
.'</span>' |
.'</span>' |
.' <b>'; |
.' <b>'; |
if ($$record{"$where.$partid.tries"} eq '') { |
if ($hidden) { |
$displaySub[0].=&mt('Trial not counted'); |
$displaySub[0].= &mt('Anonymous Survey').'</b>'; |
} else { |
} else { |
$displaySub[0].=&mt('Trial: [_1]', |
if ($$record{"$where.$partid.tries"} eq '') { |
|
$displaySub[0].=&mt('Trial not counted'); |
|
} else { |
|
$displaySub[0].=&mt('Trial: [_1]', |
$$record{"$where.$partid.tries"}); |
$$record{"$where.$partid.tries"}); |
} |
} |
my $responseType=($isTask ? 'Task' |
my $responseType=($isTask ? 'Task' |
: $responseType->{$partid}->{$responseId}); |
: $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}= |
&get_order($partid,$responseId,$symb,$uname,$udom, |
&get_order($partid,$responseId,$symb,$uname,$udom, |
$no_increment); |
$no_increment); |
} |
} |
$displaySub[0].='</b></span>'; # /nobreak |
$displaySub[0].='</b></span>'; # /nobreak |
$displaySub[0].=' '. |
$displaySub[0].=' '. |
&cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:",$uname,$udom).'<br />'; |
&cleanRecord($$record{$version.':'.$matchKey},$responseType,$symb,$partid,$responseId,$record,$orders{$partid}->{$responseId},"$version:",$uname,$udom).'<br />'; |
|
} |
} |
} |
} |
} |
if (exists($$record{"$where.$partid.checkedin"})) { |
if (exists($$record{"$where.$partid.checkedin"})) { |
Line 9322 ENDHEADER
|
Line 9368 ENDHEADER
|
sub navmap_errormsg { |
sub navmap_errormsg { |
return '<div class="LC_error">'. |
return '<div class="LC_error">'. |
&mt('An error occurred retrieving information about resources in the course.').'<br />'. |
&mt('An error occurred retrieving information about resources in the course.').'<br />'. |
&mt('It is recommended that you [_1]re-initialize the course[_2] and then return to this grading page..','<a href="/adm/roles?selectrole=1&newrole='.$env{'request.role'}.'">','</a>'). |
&mt('It is recommended that you [_1]re-initialize the course[_2] and then return to this grading page.','<a href="/adm/roles?selectrole=1&newrole='.$env{'request.role'}.'">','</a>'). |
'</div>'; |
'</div>'; |
} |
} |
|
|