--- loncom/homework/essayresponse.pm 2014/12/06 20:08:16 1.122
+++ loncom/homework/essayresponse.pm 2014/12/22 17:04:03 1.123
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.122 2014/12/06 20:08:16 raeburn Exp $
+# $Id: essayresponse.pm,v 1.123 2014/12/22 17:04:03 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -68,7 +68,7 @@ sub start_essayresponse {
($Apache::lonhomework::type eq 'anonsurveycred')) {
$hiddendraft = '';
} else {
- $result = &draft_row($part,$id,$ncol,$uploadedfiletypes);
+ $result = &draft_row($part,$id,$ncol,$uploadedfiletypes.'essayresponse');
}
if ($ncol > 0) {
$result .= &get_collab_row($part,$id,$coll,$ncol);
@@ -98,7 +98,7 @@ sub start_essayresponse {
}
sub draft_row {
- my ($part,$id,$ncol,$uploadedfiletypes) = @_;
+ my ($part,$id,$ncol,$uploadedfiletypes,$resptype) = @_;
my $status_text = &mt('Submission type');
if ($Apache::lonhomework::history{"resource.$part.award"} eq 'DRAFT') {
$status_text .= '
'.&mt('(Currently -- draft)');
@@ -107,14 +107,23 @@ sub draft_row {
unless ($ncol || $uploadedfiletypes) {
$closure = 1;
}
+ my %label = (
+ draft => {
+ essayresponse => &mt('Save entries below (not submitted for credit yet)'),
+ externalresponse => &mt('Save entries below (not submitted for grading yet)'),
+ },
+ submit => {
+ essayresponse => &mt('Submit entries below as answer to receive credit'),
+ externalresponse => &mt('Submit entries below for grading'),
+ }
+ );
return &Apache::lonhtmlcommon::row_title($status_text).
'
'.
+ ' '.$label{'submit'}{$resptype}.'
'.
''.
+ $label{'draft'}{$resptype}.''.
&Apache::lonhtmlcommon::row_closure($closure);
}
@@ -318,7 +327,14 @@ sub file_submission {
if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"} ||
$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"}) {
if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}) {
- @portfiles = split(/,/,$Apache::lonhomework::history{"resource.$part.$id.portfiles"});
+ my @possfiles = split(/,/,$Apache::lonhomework::history{"resource.$part.$id.portfiles"});
+ foreach my $file (@possfiles) {
+ my ($path,$name) = ($file =~ m{^(.*/)([^/]+)$});
+ my ($origname,$version,$ext) = &Apache::lonnet::file_name_version_ext($name);
+ unless ($version) {
+ push(@portfiles,$file);
+ }
+ }
}
$uploadedurl = $Apache::lonhomework::history{"resource.$part.$id.uploadedurl"};
if (ref($deletions) eq 'ARRAY') {