--- loncom/homework/essayresponse.pm 2012/12/18 17:09:45 1.117
+++ loncom/homework/essayresponse.pm 2014/12/04 15:41:30 1.119
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.117 2012/12/18 17:09:45 raeburn Exp $
+# $Id: essayresponse.pm,v 1.119 2014/12/04 15:41:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -279,14 +279,14 @@ sub format_prior_response {
}
if ($answer =~ /\S/) {
$output.='
'.&mt('Submitted text').
- '
'.$answer.'
';
+ ''.&HTML::Entities::encode($answer, '"<>&').'
';
}
return ''.$output.'
';
}
sub file_submission {
- my ($part,$id,$award,$uploadedflag,$totalsize,$deletions)=@_;
+ my ($part,$id,$award,$uploadedflag,$totalsize,$deletions,$context,$info)=@_;
my $files;
my $jspart=$part;
$jspart=~s/\./_/g;
@@ -513,6 +513,16 @@ sub file_submission {
$$uploadedflag=1;
}
}
+ if ($context eq 'externalresponse') {
+ my @todelete = keys(%port_delete);
+ if (@tolock || @todelete) {
+ if (ref($info) eq 'HASH') {
+ if ($info->{'ip'}) {
+ &Apache::lonnet::automated_portfile_access('ip',\@tolock,\@todelete,$info);
+ }
+ }
+ }
+ }
&Apache::lonnet::unmark_as_readonly($udom,$uname,[$symb,$crsid]);
&Apache::lonnet::mark_as_readonly($udom,$uname,[@tolock],[$symb,$crsid]);
&Apache::lonnet::clear_selected_files($uname);