[LON-CAPA-cvs] cvs: loncom /homework essayresponse.pm
raeburn
raeburn@source.lon-capa.org
Sat, 29 Jan 2011 19:41:42 -0000
raeburn Sat Jan 29 19:41:42 2011 EDT
Modified files:
/loncom/homework essayresponse.pm
Log:
- Only include div and pick_box table if needed
(questiontype can have drafts, or parameter is set for collaborators or
for filetypes).
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.113 loncom/homework/essayresponse.pm:1.114
--- loncom/homework/essayresponse.pm:1.113 Fri Dec 31 02:40:14 2010
+++ loncom/homework/essayresponse.pm Sat Jan 29 19:41:41 2011
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.113 2010/12/31 02:40:14 raeburn Exp $
+# $Id: essayresponse.pm,v 1.114 2011/01/29 19:41:41 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -58,22 +58,18 @@
if (!defined($maxfilesize)) {
$maxfilesize = 10.0; #FIXME This should become a domain configuration
}
+ my $hiddendraft;
if (($Apache::lonhomework::type eq 'survey') ||
($Apache::lonhomework::type eq 'surveycred') ||
($Apache::lonhomework::type eq 'anonsurvey') ||
($Apache::lonhomework::type eq 'anonsurveycred')) {
- $result.= '<input type="hidden" name="HWDRAFT'.$part.'_'.$id.'" value="yes" />';
- }
- my $status_text = &mt('Submission type');
- if ($Apache::lonhomework::history{"resource.$part.award"} eq 'DRAFT') {
- $status_text .= '<br />'.&mt('(Currently -- draft)');
- }
- $result.= '<div>'.&Apache::lonhtmlcommon::start_pick_box().
- &Apache::lonhtmlcommon::row_title($status_text);
- if (($Apache::lonhomework::type ne 'survey') &&
- ($Apache::lonhomework::type ne 'surveycred') &&
- ($Apache::lonhomework::type ne 'anonsurvey') &&
- ($Apache::lonhomework::type ne 'anonsurveycred')) {
+ $hiddendraft = '<input type="hidden" name="HWDRAFT'.$part.'_'.$id.'" value="yes" />';
+ } else {
+ my $status_text = &mt('Submission type');
+ if ($Apache::lonhomework::history{"resource.$part.award"} eq 'DRAFT') {
+ $status_text .= '<br />'.&mt('(Currently -- draft)');
+ }
+ $result = &Apache::lonhtmlcommon::row_title($status_text);
my $closure;
unless ($ncol || $uploadedfiletypes) {
$closure = 1;
@@ -111,7 +107,15 @@
}
$result.=&Apache::inputtags::file_selector($part,$id,$uploadedfiletypes,
$filesfrom,undef,$maxfilesize);
- $result.=&Apache::lonhtmlcommon::end_pick_box().'</div>';
+ if ($result) {
+ $result =
+ '<div>'.$hiddendraft.
+ &Apache::lonhtmlcommon::start_pick_box().
+ $result.
+ &Apache::lonhtmlcommon::end_pick_box().'</div>';
+ } else {
+ $result = $hiddendraft;
+ }
} elsif ($target eq 'web' &&
$Apache::inputtags::status[-1] ne 'CAN_ANSWER') {
my $part= $Apache::inputtags::part;