version 1.360, 2006/06/12 00:34:45
|
version 1.364, 2006/06/21 20:18:43
|
Line 36 use Apache::lonhtmlcommon;
|
Line 36 use Apache::lonhtmlcommon;
|
use Apache::lonnavmaps; |
use Apache::lonnavmaps; |
use Apache::lonhomework; |
use Apache::lonhomework; |
use Apache::loncoursedata; |
use Apache::loncoursedata; |
use Apache::lonmsg qw(:user_normal_msg); |
use Apache::lonmsg(); |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use String::Similarity; |
use String::Similarity; |
Line 1556 sub handback_box {
|
Line 1556 sub handback_box {
|
$file_disp = "$name.$ext"; |
$file_disp = "$name.$ext"; |
$file = $file_path.$file_disp; |
$file = $file_path.$file_disp; |
$result.=&mt('Return commented version of [_1] to student.', |
$result.=&mt('Return commented version of [_1] to student.', |
'<span class="filename">'.$file_disp.'</span>'); |
'<span class="LC_filename">'.$file_disp.'</span>'); |
$result.='<input type="file" name="'.$prefix.'returndoc'.$file_counter.'" />'."\n"; |
$result.='<input type="file" name="'.$prefix.'returndoc'.$file_counter.'" />'."\n"; |
$result.='<input type="hidden" name="'.$prefix.'origdoc'.$file_counter.'" value="'.$file.'" /><br />'; |
$result.='<input type="hidden" name="'.$prefix.'origdoc'.$file_counter.'" value="'.$file.'" /><br />'; |
$file_counter++; |
$file_counter++; |
Line 2107 sub processHandGrade {
|
Line 2107 sub processHandGrade {
|
if ($includemsg =~ /savemsg|newmsg\Q$ctr\E/) { |
if ($includemsg =~ /savemsg|newmsg\Q$ctr\E/) { |
$subject = $env{'form.msgsub'} if ($includemsg =~ /msgsub/); |
$subject = $env{'form.msgsub'} if ($includemsg =~ /msgsub/); |
unless ($subject=~/\w/) { $subject=&mt('Grading Feedback'); } |
unless ($subject=~/\w/) { $subject=&mt('Grading Feedback'); } |
|
$subject.=' ['.&Apache::lonnet::declutter($url).']'; |
my (@msgnum) = split(/,/,$includemsg); |
my (@msgnum) = split(/,/,$includemsg); |
foreach (@msgnum) { |
foreach (@msgnum) { |
$message.=$env{'form.'.$_} if ($_ =~ /savemsg|newmsg/ && $_ ne ''); |
$message.=$env{'form.'.$_} if ($_ =~ /savemsg|newmsg/ && $_ ne ''); |
Line 2119 sub processHandGrade {
|
Line 2120 sub processHandGrade {
|
"?symb=$symb\">$env{'form.probTitle'}</a>"; |
"?symb=$symb\">$env{'form.probTitle'}</a>"; |
} |
} |
$msgstatus = &Apache::lonmsg::user_normal_msg($uname,$udom, |
$msgstatus = &Apache::lonmsg::user_normal_msg($uname,$udom, |
$subject.' ['. |
$subject, |
&Apache::lonnet::declutter($url).']',$message); |
$message); |
$request->print('<br />'.&mt('Sending message to [_1]@[_2]',$uname,$udom).': '. |
$request->print('<br />'.&mt('Sending message to [_1]@[_2]',$uname,$udom).': '. |
$msgstatus); |
$msgstatus); |
} |
} |
Line 2133 sub processHandGrade {
|
Line 2134 sub processHandGrade {
|
&saveHandGrade($request,$symb,$collaborator,$udom,$ctr, |
&saveHandGrade($request,$symb,$collaborator,$udom,$ctr, |
$env{'form.unamedom'.$ctr},$part); |
$env{'form.unamedom'.$ctr},$part); |
if ($errorflag eq 'not_allowed') { |
if ($errorflag eq 'not_allowed') { |
$request->print("<font color=\"red\">Not allowed to modify grades for $collaborator:$udom</font>"); |
$request->print("<span class=\"LC_error\">".&mt('Not allowed to modify grades for [_1]',"$collaborator:$udom")."</span>"); |
next; |
next; |
} else { |
} else { |
if ($message ne '') { |
if ($message ne '') { |
$msgstatus = &Apache::lonmsg::user_normal_msg($collaborator,$udom,$env{'form.msgsub'},$message); |
$msgstatus = &Apache::lonmsg::user_normal_msg($collaborator,$udom,$subject,$message); |
} |
} |
} |
} |
} |
} |
Line 2329 sub saveHandGrade {
|
Line 2330 sub saveHandGrade {
|
if (exists($record{'resource.'.$new_part.'.awarded'})) { |
if (exists($record{'resource.'.$new_part.'.awarded'})) { |
$newrecord{'resource.'.$new_part.'.awarded'} = ''; |
$newrecord{'resource.'.$new_part.'.awarded'} = ''; |
} |
} |
$newrecord{'resource.'.$new_part.'.regrader'}="$env{'user.name'}:$env{'user.domain'}"; |
$newrecord{'resource.'.$new_part.'.regrader'}="$env{'user.name'}:$env{'user.domain'}"; |
} |
} |
} elsif ($dropMenu eq 'reset status' |
} elsif ($dropMenu eq 'reset status' |
&& exists($record{'resource.'.$new_part.'.solved'})) { #don't bother if no old records -> no attempts |
&& exists($record{'resource.'.$new_part.'.solved'})) { #don't bother if no old records -> no attempts |
Line 2404 sub saveHandGrade {
|
Line 2405 sub saveHandGrade {
|
|
|
if (%newrecord) { |
if (%newrecord) { |
if (@version_parts) { |
if (@version_parts) { |
my @changed_keys = &version_portfiles(\%record, \@parts_graded, $env{'request.course.id'}, $symb, $domain, $stuname, \@version_parts); |
my @changed_keys = &version_portfiles(\%record, \@parts_graded, |
|
$env{'request.course.id'}, $symb, $domain, $stuname, \@version_parts); |
@newrecord{@changed_keys} = @record{@changed_keys}; |
@newrecord{@changed_keys} = @record{@changed_keys}; |
} |
} |
&Apache::lonnet::cstore(\%newrecord,$symb, |
&Apache::lonnet::cstore(\%newrecord,$symb, |
Line 2446 sub handback_files {
|
Line 2448 sub handback_files {
|
my ($portfolio_path) = ($directory =~ /^.+$stuname\/portfolio(.*)/); |
my ($portfolio_path) = ($directory =~ /^.+$stuname\/portfolio(.*)/); |
my @dir_list = &Apache::lonnet::dirlist($portfolio_path,$domain,$stuname,$portfolio_root); |
my @dir_list = &Apache::lonnet::dirlist($portfolio_path,$domain,$stuname,$portfolio_root); |
my $version = &get_next_version($answer_name, $answer_ext, \@dir_list); |
my $version = &get_next_version($answer_name, $answer_ext, \@dir_list); |
my $new_answer = &version_selected_portfile($domain, $stuname, $portfolio_path, $answer_file, $version); |
|
$$newrecord{"resource.$new_part.$resp_id.handback"} = $new_answer; |
|
$version++; |
|
# fix file name |
# fix file name |
my ($save_file_name) = (($directory.$answer_name.".$version.".$answer_ext) =~ /^.+\/${stuname}\/(.*)/); |
my ($save_file_name) = (($directory.$answer_name.".$version.".$answer_ext) =~ /^.+\/${stuname}\/(.*)/); |
my $result=&Apache::lonnet::finishuserfileupload($stuname,$domain, |
my $result=&Apache::lonnet::finishuserfileupload($stuname,$domain, |
Line 2462 sub handback_files {
|
Line 2461 sub handback_files {
|
my @files = ($save_file_name); |
my @files = ($save_file_name); |
my @what = ($symb,'handback'); |
my @what = ($symb,'handback'); |
&Apache::lonnet::mark_as_readonly($domain,$stuname,\@files,\@what); |
&Apache::lonnet::mark_as_readonly($domain,$stuname,\@files,\@what); |
|
$$newrecord{"resource.$new_part.$resp_id.handback"} = $save_file_name; |
my $subject = "File Handed Back by Instructor "; |
my $subject = "File Handed Back by Instructor "; |
my $message = "A file has been returned that was originally submitted in reponse to: <br />"; |
my $message = "A file has been returned that was originally submitted in reponse to: <br />"; |
$message .= "<strong>".&Apache::lonnet::gettitle($symb)."</strong><br />"; |
$message .= "<strong>".&Apache::lonnet::gettitle($symb)."</strong><br />"; |
$message .= " The returned file is named: <br /><strong>".$save_file_name."</strong><br />"; |
$message .= " The returned file is named: <br /><strong>".$save_file_name."</strong><br />"; |
$message .= " and can be found in your portfolio space."; |
$message .= " and can be found in your portfolio space."; |
&Apache::lonnet::logthis($message); |
my $url = (&Apache::lonnet::decode_symb($symb))[2]; |
|
$url = &Apache::lonnet::declutter($url); |
my $msgstatus = &Apache::lonmsg::user_normal_msg($stuname,$domain, |
my $msgstatus = &Apache::lonmsg::user_normal_msg($stuname,$domain, |
$subject.' [File Returned]',$message); |
$subject.' (File Returned) ['.$url.']',$message); |
} |
} |
$request->print("<br />".$fname." will be the uploaded file name"); |
$request->print("<br />".$fname." will be the uploaded file name"); |
$request->print(" ".$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}); |
$request->print(" ".$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}); |